
On 30 May 2017 at 07:05, Hannes Schmelzer hannes.schmelzer@br-automation.com wrote:
With this commit we can modify single values within an array of a dts property.
This is useful if we have for example a pwm-backlight where we want to modifiy the pwm frequency per u-boot script.
The pwm is described in dts like this:
backlight { pwms = <0x0000002b 0x00000000 0x004c4b40>; };
For changing the frequency, here the 3rd parameter, we simply type:
fdt set /backlight pwms <? ? 0x1E8480>;
For doing all this we:
- backup the property content into our 'SCRATCHPAD'
- only modify the array-cell if the new content doesn't start with '?'
Signed-off-by: Hannes Schmelzer hannes.schmelzer@br-automation.com
cmd/fdt.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
I imagine this would have to be done before setting 'stdout' to 'vidconsole' so that the PWM is not inited before this script runs.