* [U-Boot] LIBFDT - changing command line
@ 2009-08-11 19:37 Michal Simek
2009-08-11 22:32 ` Jerry Van Baren
0 siblings, 1 reply; 9+ messages in thread
From: Michal Simek @ 2009-08-11 19:37 UTC (permalink / raw)
To: u-boot
Hi All,
I would like to use fdt for changing command line in DTB but
I found there is one problem if I have longer command line which contains
any spaces.
Below is my workflow.
If I understand correctly the problem is in cmd_fdt.c:fdt_parse_prop:593-603.
It will be worth to add case for supporting
fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
copy from first " to next "
Or is it there any solution which I miss for this case?
Thanks,
Michal
U-Boot-mONStR> tftp 90780000 system.dtb
Using Xilinx LL TEMAC device
TFTP from server 192.168.0.102; our IP address is 192.168.0.3
Filename 'system.dtb'.
Load address: 0x90780000
Loading: 100BASE-T/FD
#
done
Bytes transferred = 9121 (23a1 hex)
U-Boot-mONStR> fdt addr 90780000
U-Boot-mONStR> fdt h
magic: 0xd00dfeed
totalsize: 0x23a1 (9121)
off_dt_struct: 0x38
off_dt_strings: 0x14a0
off_mem_rsvmap: 0x28
version: 17
last_comp_version: 16
boot_cpuid_phys: 0x0
size_dt_strings: 0xf01
size_dt_struct: 0x1468
number mem_rsv: 0x0
U-Boot-mONStR> fdt list /chosen
chosen {
bootargs = "console=ttyUL0,115200 highres=on root=/dev/mtdblock0";
linux,stdout-path = "/plb at 0/serial at 84000000";
};
U-Boot-mONStR> fdt set /chosen bootargs console=ttyUL root=/dev/mtdblock0
U-Boot-mONStR> fdt list /chosen
chosen {
bootargs = "root=/dev/mtdblock0";
linux,stdout-path = "/plb at 0/serial at 84000000";
};
U-Boot-mONStR>
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] LIBFDT - changing command line
2009-08-11 19:37 [U-Boot] LIBFDT - changing command line Michal Simek
@ 2009-08-11 22:32 ` Jerry Van Baren
2009-08-12 6:21 ` Michal Simek
0 siblings, 1 reply; 9+ messages in thread
From: Jerry Van Baren @ 2009-08-11 22:32 UTC (permalink / raw)
To: u-boot
Hi Michal
Michal Simek wrote:
> Hi All,
>
> I would like to use fdt for changing command line in DTB but
> I found there is one problem if I have longer command line which contains
> any spaces.
> Below is my workflow.
> If I understand correctly the problem is in cmd_fdt.c:fdt_parse_prop:593-603.
> It will be worth to add case for supporting
> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
> copy from first " to next "
>
> Or is it there any solution which I miss for this case?
>
> Thanks,
> Michal
It is somewhat ugly, but the you can use "\" to escape the spaces:
fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
I did this originally (IIRC) so that I wouldn't have to deal with
handling quotes in the parsing (Are they there? Are they balanced? What
to do if not balanced?). Add in a dash of lazy...
[snip]
Best regards,
gvb
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LIBFDT - changing command line
2009-08-11 22:32 ` Jerry Van Baren
@ 2009-08-12 6:21 ` Michal Simek
2009-08-13 2:10 ` Jerry Van Baren
0 siblings, 1 reply; 9+ messages in thread
From: Michal Simek @ 2009-08-12 6:21 UTC (permalink / raw)
To: u-boot
Jerry Van Baren wrote:
> Hi Michal
>
> Michal Simek wrote:
>> Hi All,
>>
>> I would like to use fdt for changing command line in DTB but
>> I found there is one problem if I have longer command line which contains
>> any spaces.
>> Below is my workflow.
>> If I understand correctly the problem is in
>> cmd_fdt.c:fdt_parse_prop:593-603.
>> It will be worth to add case for supporting
>> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
>> copy from first " to next "
>>
>> Or is it there any solution which I miss for this case?
>>
>> Thanks,
>> Michal
>
> It is somewhat ugly, but the you can use "\" to escape the spaces:
> fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
Of course I tried it but simply not work.
U-Boot-mONStR> fdt list /chosen
chosen {
bootargs = "console=ttyUL0,115200 highres=on root=/dev/mtdblock0";
linux,stdout-path = "/plb at 0/serial at 84000000";
};
U-Boot-mONStR> fdt set /chosen bootargs console=ttyUL\ root=dev
U-Boot-mONStR> fdt list /chosen
chosen {
bootargs = "root=dev";
linux,stdout-path = "/plb at 0/serial at 84000000";
};
U-Boot-mONStR>
Can you tried it on your ppc?
Michal
>
> I did this originally (IIRC) so that I wouldn't have to deal with
> handling quotes in the parsing (Are they there? Are they balanced? What
> to do if not balanced?). Add in a dash of lazy...
>
> [snip]
>
> Best regards,
> gvb
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] LIBFDT - changing command line
2009-08-12 6:21 ` Michal Simek
@ 2009-08-13 2:10 ` Jerry Van Baren
2009-08-13 5:50 ` Wolfgang Denk
2009-08-13 9:23 ` Michal Simek
0 siblings, 2 replies; 9+ messages in thread
From: Jerry Van Baren @ 2009-08-13 2:10 UTC (permalink / raw)
To: u-boot
Hi Michal,
Michal Simek wrote:
> Jerry Van Baren wrote:
>> Hi Michal
>>
>> Michal Simek wrote:
>>> Hi All,
>>>
>>> I would like to use fdt for changing command line in DTB but
>>> I found there is one problem if I have longer command line which contains
>>> any spaces.
>>> Below is my workflow.
>>> If I understand correctly the problem is in
>>> cmd_fdt.c:fdt_parse_prop:593-603.
>>> It will be worth to add case for supporting
>>> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
>>> copy from first " to next "
>>>
>>> Or is it there any solution which I miss for this case?
>>>
>>> Thanks,
>>> Michal
>> It is somewhat ugly, but the you can use "\" to escape the spaces:
>> fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
>
> Of course I tried it but simply not work.
>
>
> U-Boot-mONStR> fdt list /chosen
> chosen {
> bootargs = "console=ttyUL0,115200 highres=on root=/dev/mtdblock0";
> linux,stdout-path = "/plb at 0/serial at 84000000";
> };
> U-Boot-mONStR> fdt set /chosen bootargs console=ttyUL\ root=dev
> U-Boot-mONStR> fdt list /chosen
> chosen {
> bootargs = "root=dev";
> linux,stdout-path = "/plb at 0/serial at 84000000";
> };
> U-Boot-mONStR>
>
> Can you tried it on your ppc?
>
> Michal
It is working for me. Are you running the "hush" shell or the old
scripting interpreter?
=> fdt print /chosen
chosen {
linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};
=> fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
=> fdt print /chosen
chosen {
bootargs = "console=ttyUL root=/dev/mtdblock0";
linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};
=> fdt set /chosen bootargs console=ttyUL\ root=dev
=> fdt print /chosen
chosen {
bootargs = "console=ttyUL root=dev";
linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
};
Best regards,
gvb
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] LIBFDT - changing command line
2009-08-13 2:10 ` Jerry Van Baren
@ 2009-08-13 5:50 ` Wolfgang Denk
2009-08-13 12:24 ` Jerry Van Baren
2009-08-13 9:23 ` Michal Simek
1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2009-08-13 5:50 UTC (permalink / raw)
To: u-boot
Dear Jerry Van Baren,
In message <4A837625.6010507@gmail.com> you wrote:
>
> => fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
Why not simply
=> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A man is not complete until he is married -- then he is finished.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LIBFDT - changing command line
2009-08-13 5:50 ` Wolfgang Denk
@ 2009-08-13 12:24 ` Jerry Van Baren
2009-08-13 12:46 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Jerry Van Baren @ 2009-08-13 12:24 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> Dear Jerry Van Baren,
>
> In message <4A837625.6010507@gmail.com> you wrote:
>> => fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
>
> Why not simply
>
> => fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
>
> ?
>
> Best regards,
>
> Wolfgang Denk
Hi Wolfgang,
I did not try that last night. I should have because it should work, at
least for hush.
Best regards,
gvb
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LIBFDT - changing command line
2009-08-13 12:24 ` Jerry Van Baren
@ 2009-08-13 12:46 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2009-08-13 12:46 UTC (permalink / raw)
To: u-boot
Dear Jerry Van Baren,
In message <4A8405FF.1060305@ge.com> you wrote:
>
> >> => fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
> >
> > Why not simply
> > => fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
> > ?
...
> I did not try that last night. I should have because it should work, at
> least for hush.
Not only for hush. Ther eshould be no difference in this respect
between the hush shell and the simple command line parser.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You may call me by my name, Wirth, or by my value, Worth.
- Nicklaus Wirth
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] LIBFDT - changing command line
2009-08-13 2:10 ` Jerry Van Baren
2009-08-13 5:50 ` Wolfgang Denk
@ 2009-08-13 9:23 ` Michal Simek
2009-08-13 9:29 ` Wolfgang Denk
1 sibling, 1 reply; 9+ messages in thread
From: Michal Simek @ 2009-08-13 9:23 UTC (permalink / raw)
To: u-boot
Jerry Van Baren wrote:
> Hi Michal,
>
> Michal Simek wrote:
>> Jerry Van Baren wrote:
>>> Hi Michal
>>>
>>> Michal Simek wrote:
>>>> Hi All,
>>>>
>>>> I would like to use fdt for changing command line in DTB but
>>>> I found there is one problem if I have longer command line which
>>>> contains
>>>> any spaces.
>>>> Below is my workflow.
>>>> If I understand correctly the problem is in
>>>> cmd_fdt.c:fdt_parse_prop:593-603.
>>>> It will be worth to add case for supporting
>>>> fdt set /chosen bootargs "console=ttyUL root=/dev/mtdblock0"
>>>> copy from first " to next "
>>>>
>>>> Or is it there any solution which I miss for this case?
>>>>
>>>> Thanks,
>>>> Michal
>>> It is somewhat ugly, but the you can use "\" to escape the spaces:
>>> fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
>>
>> Of course I tried it but simply not work.
>>
>>
>> U-Boot-mONStR> fdt list /chosen
>> chosen {
>> bootargs = "console=ttyUL0,115200 highres=on
>> root=/dev/mtdblock0";
>> linux,stdout-path = "/plb at 0/serial at 84000000";
>> };
>> U-Boot-mONStR> fdt set /chosen bootargs console=ttyUL\ root=dev
>> U-Boot-mONStR> fdt list /chosen
>> chosen {
>> bootargs = "root=dev";
>> linux,stdout-path = "/plb at 0/serial at 84000000";
>> };
>> U-Boot-mONStR>
>>
>> Can you tried it on your ppc?
>>
>> Michal
>
> It is working for me. Are you running the "hush" shell or the old
> scripting interpreter?
old scripting. With hush works + 11kB.
Thanks,
Michal
>
> => fdt print /chosen
> chosen {
> linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
> };
> => fdt set /chosen bootargs console=ttyUL\ root=/dev/mtdblock0
> => fdt print /chosen
> chosen {
> bootargs = "console=ttyUL root=/dev/mtdblock0";
> linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
> };
> => fdt set /chosen bootargs console=ttyUL\ root=dev
> => fdt print /chosen
> chosen {
> bootargs = "console=ttyUL root=dev";
> linux,stdout-path = "/soc8360 at e0000000/serial at 4500";
> };
>
> Best regards,
> gvb
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] LIBFDT - changing command line
2009-08-13 9:23 ` Michal Simek
@ 2009-08-13 9:29 ` Wolfgang Denk
0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2009-08-13 9:29 UTC (permalink / raw)
To: u-boot
Dear Michal Simek,
In message <4A83DB8E.1030707@monstr.eu> you wrote:
>
...
> > It is working for me. Are you running the "hush" shell or the old
> > scripting interpreter?
>
> old scripting. With hush works + 11kB.
Actually this should make no difference.
Are you absolutely sure it does? If so, can you please prvide exact
details?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Today is the yesterday you worried about tomorrow.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-08-13 12:46 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 19:37 [U-Boot] LIBFDT - changing command line Michal Simek
2009-08-11 22:32 ` Jerry Van Baren
2009-08-12 6:21 ` Michal Simek
2009-08-13 2:10 ` Jerry Van Baren
2009-08-13 5:50 ` Wolfgang Denk
2009-08-13 12:24 ` Jerry Van Baren
2009-08-13 12:46 ` Wolfgang Denk
2009-08-13 9:23 ` Michal Simek
2009-08-13 9:29 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox