[U-Boot] [PATCH] cmd/fdt: support single value replacement within an array

Simon Glass sjg at chromium.org
Thu Jun 1 03:11:57 UTC 2017


On 30 May 2017 at 07:05, Hannes Schmelzer
<hannes.schmelzer at 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 at br-automation.com>
>
> ---
>
>  cmd/fdt.c | 29 +++++++++++++++++++++--------
>  1 file changed, 21 insertions(+), 8 deletions(-)

Reviewed-by: Simon Glass <sjg at 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.


More information about the U-Boot mailing list