[U-Boot] macro substitution - can someone explain please

2009-10-23 Thread David Collier
If I put the following line in my board.h file

#define CONFIG_RAMBOOTCOMMAND   \
  "ping ${serverip} && tftp && bootm ${fileaddr}"

then when I do PRINTENV I see

ramboot=ping ${serverip} && tftp && bootm 0x1040

so clearly at some point the text ${fileaddr} has been substituted,
whereas ${serverip} hasn't

If I retype the line at the command prompt, the ${fileaddr} appears as I
wished, so it must be happening diring compile and so on.

Can anyone explain, and/or can anyone tell me how to get the effect I
wanted.
  
  
David Collier

www.dexdyne.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] macro substitution - can someone explain please

2009-10-26 Thread javier Martin
I have a similar problem. In my environment:

bootcmd=cp.b c004 ${loadaddr} 28;bootm ${loadaddr}
mtdparts=mtdparts=mxc_nor_flash.0:256k(U-Boot),2560k(kernel),29312k(rootfs),512k(config),128k(env1)
bootargs=noinitrd console=ttymxc0,115200 root=/dev/mtdblock2
init=linuxrc rw ${mtdparts}

But when I execute 'run bootm', kernel boots but "mtdparts" variable
is not substituted in kernel command line:

Uncompressing 
Linux..
done, booting the kernel.
[0.00] Linux version 2.6.22.6-gb5e710ce-dirty (jav...@acuario)
(gcc version 4.1.2) #219 PREEMPT Fri Oct 23 18:12:58 CEST 2009
[0.00] CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
[0.00] Machine: Freescale i.MX27ADS
[0.00] Memory policy: ECC disabled, Data cache writeback
[0.00] CPU0: D VIVT write-back cache
[0.00] CPU0: I cache: 16384 bytes, associativity 4, 32 byte
lines, 128 sets
[0.00] CPU0: D cache: 16384 bytes, associativity 4, 32 byte
lines, 128 sets
[0.00] Built 1 zonelists.  Total pages: 16256
[0.00] Kernel command line: noinitrd console=ttymxc0,115200
root=/dev/mtdblock2 init=linuxrc rw ${mtdparts}

As stated in README file, global variables should be able to be
accessed through ${ } symbols. Is this also valid inside "bootargs"
variable?

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] macro substitution - can someone explain please

2009-10-26 Thread Mike Frysinger
On Monday 26 October 2009 03:44:41 javier Martin wrote:
> I have a similar problem. In my environment:
> 
> bootcmd=cp.b c004 ${loadaddr} 28;bootm ${loadaddr}
> mtdparts=mtdparts=mxc_nor_flash.0:256k(U-Boot),2560k(kernel),29312k(rootfs)
> ,512k(config),128k(env1) bootargs=noinitrd console=ttymxc0,115200
>  root=/dev/mtdblock2
> init=linuxrc rw ${mtdparts}
> 
> But when I execute 'run bootm', kernel boots but "mtdparts" variable
> is not substituted in kernel command line:

i dont think your issue is the same as David's.  you need to force expansion 
of the variable yourself.
set bootcmd "run do_args; run do_boot"
set do_args "set init linuxrc rw ${mtdparts}"
set do_boot "cp.b c004 ${loadaddr} 28;bootm ${loadaddr}"
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] macro substitution - can someone explain please

2009-10-26 Thread Mike Frysinger
On Friday 23 October 2009 08:25:00 David Collier wrote:
> If I put the following line in my board.h file
> 
> #define CONFIG_RAMBOOTCOMMAND \
>   "ping ${serverip} && tftp && bootm ${fileaddr}"

start with the binary.  run `strings` on your u-boot.bin (or whatever you're 
using) and see what ramboot is set to.

> then when I do PRINTENV I see
> 
> ramboot=ping ${serverip} && tftp && bootm 0x1040
> 
> so clearly at some point the text ${fileaddr} has been substituted,
> whereas ${serverip} hasn't
> 
> If I retype the line at the command prompt, the ${fileaddr} appears as I
> wished, so it must be happening diring compile and so on.

i doubt variable expansion is happening during compile.  it isnt like gcc 
knows how to expand shell variables in C code.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot