* [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string.
2016-11-19 17:06 ` [U-Boot] Fw: " dh at synoia.com
@ 2016-11-23 1:26 ` dh at synoia.com
2016-11-23 8:33 ` Anatolij Gustschin
0 siblings, 1 reply; 4+ messages in thread
From: dh at synoia.com @ 2016-11-23 1:26 UTC (permalink / raw)
To: u-boot
?
Imove the fdt to 0x100
fdt move ${fdt_addr}? 100
fdt addr 100
?
then
fdt get value bootargs /chosen bootargs
printenv bootargs
8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=3840 bcm2708_fb.fbheight=2160 bcm2709.boardrev=0xa02082 bcm2709.serial=0x998f552d smsc95xx.macaddr=B8:27:EB:8F:55:2D bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000? dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
1 ) Note: bootargs is over 480 characters long
setenv abc $bootargs fails...when bootargs is over 350 (approx) characters long.?
fdt set bootargs /chosen bootargs
fdt get value bootargs /chosen bootargsbootargs=8250.nr_uarts=0Bootargs is truncated
The PI firmware generated bootargs parameters have blanks in the bootargs line.?
nvalue.c implements setenv in the _do_env_set()? routine, but I cannot find a length limit in that routine.
I'm willing to make the changes and test them.
Thanks?Duncan
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string.
2016-11-23 1:26 ` [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string dh at synoia.com
@ 2016-11-23 8:33 ` Anatolij Gustschin
0 siblings, 0 replies; 4+ messages in thread
From: Anatolij Gustschin @ 2016-11-23 8:33 UTC (permalink / raw)
To: u-boot
On Wed, 23 Nov 2016 01:26:22 +0000 (UTC)
dh at synoia.com dh at synoia.com wrote:
...
> 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=3840 bcm2708_fb.fbheight=2160 bcm2709.boardrev=0xa02082 bcm2709.serial=0x998f552d smsc95xx.macaddr=B8:27:EB:8F:55:2D bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000? dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
> 1 ) Note: bootargs is over 480 characters long
>
> setenv abc $bootargs fails...when bootargs is over 350 (approx) characters long.?
> fdt set bootargs /chosen bootargs
> fdt get value bootargs /chosen bootargsbootargs=8250.nr_uarts=0Bootargs is truncated
> The PI firmware generated bootargs parameters have blanks in the bootargs line.?
> nvalue.c implements setenv in the _do_env_set()? routine, but I cannot find a length limit in that routine.
> I'm willing to make the changes and test them.
please check CONFIG_SYS_MAXARGS and CONFIG_SYS_BARGSIZE and increase
them in your board config file (include/configs/rpi.h ?). See README
for description of these macros.
If CONFIG_SYS_BARGSIZE is not defined, the default value 512 is used.
Define a bigger value and test if it works.
Also if you set long environment strings manually with console
commands, the console input buffer might be to small. In that
case check CONFIG_SYS_CBSIZE in your board config file.
--
Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string.
[not found] ` <217373290.719742.1479933982741@mail.yahoo.com>
@ 2016-11-24 9:12 ` Anatolij Gustschin
2016-11-24 21:24 ` dh at synoia.com
0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2016-11-24 9:12 UTC (permalink / raw)
To: u-boot
On Wed, 23 Nov 2016 20:46:22 +0000 (UTC)
dh at synoia.com dh at synoia.com wrote:
>On Wed, 23 Nov 2016 01:26:22 +0000 (UTC)
>dh at synoia.com dh at synoia.com wrote:
>...
>> 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=3840 bcm2708_fb.fbheight=2160 bcm2709.boardrev=0xa02082 bcm2709.serial=0x998f552d smsc95xx.macaddr=B8:27:EB:8F:55:2D bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000? dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
>> 1 ) Note: bootargs is over 480 characters long
>>
>> setenv abc $bootargs fails...when bootargs is over 350 (approx) characters long.?
>> fdt set bootargs /chosen bootargs
>> fdt get value bootargs /chosen bootargsbootargs=8250.nr_uarts=0Bootargs is truncated
>> The PI firmware generated bootargs parameters have blanks in the bootargs line.?
>> nvalue.c implements setenv in the _do_env_set()? routine, but I cannot find a length limit in that routine.
>> I'm willing to make the changes and test them.
>
>please check CONFIG_SYS_MAXARGS and CONFIG_SYS_BARGSIZE and increase
>them in your board config file (include/configs/rpi.h ?). See README
>for description of these macros.
>If CONFIG_SYS_BARGSIZE is not defined, the default value 512 is used.
>Define a bigger value and test if it works.
>
>Also if you set long environment strings manually with console
>commands, the console input buffer might be to small. In that
>case check CONFIG_SYS_CBSIZE in your board config file.
>
>
>Set:
>CONFIG_SYS_MAXARGS ????32
>CONFIG_SYS_BARGSIZE???? 1024
>
>Success! This works.
>
>Console is not a problem, I cannot type that many characters without
>an error or two.
okay, I just wanted to mention CONFIG_SYS_CBSIZE for the sake
of completeness.
>Issue possibly remaining:
>sequence fdt get/ set/ get truncates bootargs at the first blank
>in the string of bootargs.
>This is only a problem if bootargs is passed to the kernel through
>the fdt, and not as separate character string. I do not know which
>is the mechanism used.
>Further testing on this remains.
In your description above I see the command:
fdt set bootargs /chosen bootargs
This is wrong and could not work. You probably used:
fdt set /chosen bootargs $bootargs
It will insert multiple tokens separated by comma, e.g.:
=> setenv bootargs 'arg1 arg2 arg3'
=> fdt set /chosen bootargs $bootargs
=> fdt pri /chosen
chosen {
bootargs = "arg1", "arg2", "arg3";
};
=> fdt get value bootargs /chosen bootargs
=> pri bootargs
bootargs=arg1
This is the behaviour you observe.
To avoid tokenizing the bootargs property in the blob you have
to use an intermediate step, e.g.:
=> seten args "\"$bootargs\""
=> pri args
args="arg1 arg2 arg3"
=> fdt set /chosen bootargs $args
=> fdt pri /chosen
chosen {
bootargs = "arg1 arg2 arg3";
};
=> fdt get value bootargs /chosen bootargs
=> pri bootargs
bootargs=arg1 arg2 arg3
--
Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string.
2016-11-24 9:12 ` [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string Anatolij Gustschin
@ 2016-11-24 21:24 ` dh at synoia.com
0 siblings, 0 replies; 4+ messages in thread
From: dh at synoia.com @ 2016-11-24 21:24 UTC (permalink / raw)
To: u-boot
From: Anatolij Gustschin <agust@denx.de>
To: dh at synoia.com
Cc: Tom Rini <trini@konsulko.com>; u-boot <u-boot@lists.denx.de>
Sent: Thursday, November 24, 2016 1:12 AM
Subject: Re: [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string.
On Wed, 23 Nov 2016 20:46:22 +0000 (UTC)
dh at synoia.com dh at synoia.com wrote:
>On Wed, 23 Nov 2016 01:26:22 +0000 (UTC)
>dh at synoia.com dh at synoia.com wrote:
>...
>> 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=3840 bcm2708_fb.fbheight=2160 bcm2709.boardrev=0xa02082 bcm2709.serial=0x998f552d smsc95xx.macaddr=B8:27:EB:8F:55:2D bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000? dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
>> 1 ) Note: bootargs is over 480 characters long
>>
>> setenv abc $bootargs fails...when bootargs is over 350 (approx) characters long.?
>> fdt set bootargs /chosen bootargs
>> fdt get value bootargs /chosen bootargsbootargs=8250.nr_uarts=0Bootargs is truncated
>> The PI firmware generated bootargs parameters have blanks in the bootargs line.?
>> nvalue.c implements setenv in the _do_env_set()? routine, but I cannot find a length limit in that routine.
>> I'm willing to make the changes and test them.?
>
>please check CONFIG_SYS_MAXARGS and CONFIG_SYS_BARGSIZE and increase
>them in your board config file (include/configs/rpi.h ?). See README
>for description of these macros.
>If CONFIG_SYS_BARGSIZE is not defined, the default value 512 is used.
>Define a bigger value and test if it works.
>
>Also if you set long environment strings manually with console
>commands, the console input buffer might be to small. In that
>case check CONFIG_SYS_CBSIZE in your board config file.
>
>
>Set:
>CONFIG_SYS_MAXARGS ????32
>CONFIG_SYS_BARGSIZE???? 1024
>
>Success! This works.
>
>Console is not a problem, I cannot type that many characters without
>an error or two.
okay, I just wanted to mention CONFIG_SYS_CBSIZE for the sake
of completeness.
>Issue possibly remaining:
>sequence fdt get/ set/ get truncates bootargs at the first blank
>in the string of bootargs.
>This is only a problem if bootargs is passed to the kernel through
>the fdt, and not as separate character string. I do not know which
>is the mechanism used.
>Further testing on this remains.
In your description above I see the command:
fdt set bootargs /chosen bootargs
This is wrong and could not work. You probably used:
fdt set /chosen bootargs $bootargs
It will insert multiple tokens separated by comma, e.g.:
=> setenv bootargs 'arg1 arg2 arg3'
=> fdt set /chosen bootargs $bootargs
=> fdt pri /chosen? ? ? ? ? ? ? ? ?
chosen {
??? bootargs = "arg1", "arg2", "arg3";
};
=> fdt get value bootargs /chosen bootargs
=> pri bootargs
bootargs=arg1
This is the behaviour you observe.
To avoid tokenizing the bootargs property in the blob you have
to use an intermediate step, e.g.:
=> seten args "\"$bootargs\""
=> pri args
args="arg1 arg2 arg3"
=> fdt set /chosen bootargs $args
=> fdt pri /chosen
chosen {
??? bootargs = "arg1 arg2 arg3";
};
=> fdt get value bootargs /chosen bootargs
=> pri bootargs
bootargs=arg1 arg2 arg3
--
Anatolij
That works well. Thank you for you help.
Duncan Hare
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-24 21:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <217373290.719742.1479933982741.ref@mail.yahoo.com>
[not found] ` <217373290.719742.1479933982741@mail.yahoo.com>
2016-11-24 9:12 ` [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string Anatolij Gustschin
2016-11-24 21:24 ` dh at synoia.com
[not found] <CANwerB1MuiXGcV15popB08CfjVisdqO4ejpjgR7QtBz8tuqt9w@mail.gmail.com>
[not found] ` <1521360278.969111.1478746084415@mail.yahoo.com>
[not found] ` <CANwerB0LsgVe+1JJtteukoVSJwHQh+dCzkHy-bjDq7_xxyjS2A@mail.gmail.com>
[not found] ` <1803431681.1017120.1478753042164@mail.yahoo.com>
[not found] ` <CANwerB24A5P2-17RAO11ZNnPn6S7+bk4HhRi3kB7xmskzEidwA@mail.gmail.com>
[not found] ` <1877254354.2540034.1478911787854@mail.yahoo.com>
[not found] ` <CANwerB1S=NZ6NuSBZwWQm5DTBQjvxL=0nLYYy_9NqW6b_V_bHA@mail.gmail.com>
[not found] ` <1282684168.2965147.1479002677632@mail.yahoo.com>
[not found] ` <CAM-ziR5HXmQTY1YXpjnxC-tXggqa+AGTjUgcBh6r3St5dX3BmA@mail.gmail.com>
2016-11-14 0:08 ` [U-Boot] FDT retrived varaibles appear to have different properties fom other u-boot variables - and are corrupted on get, set, get sequence dh at synoia.com
2016-11-17 15:07 ` Tom Rini
[not found] ` <956355993.2194594.1479405341872@mail.yahoo.com>
2016-11-19 17:06 ` [U-Boot] Fw: " dh at synoia.com
2016-11-23 1:26 ` [U-Boot] FDT retrived raspberry pi bootargs length > 350 characters cause setenv errors, sequemce fdt get/ set/ get truncates at the first blank in the string dh at synoia.com
2016-11-23 8:33 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox