[U-Boot] SPL Framework: Add support for U_BOOT_CMD

*Hi Folks*,
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that * *When I tried to that I get following error, "error: no memory region specified for loadable section* " *When i add printf statements and build I get errors for hawkboard_nand board puts works fine. Is printf being removed as of buffer overriding *issues or *is there a support yet* to be added for printf?
Regards, --Prabhakar lad

Hi,
On Wed, Jan 25, 2012 at 10:52 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that *
Why do you want to do that? A command in an SPL?
*When I tried to that I get following error, "error: no memory region specified for loadable section* " *When i add printf statements and build I get errors for hawkboard_nand board puts works fine. Is printf being removed as of buffer overriding *issues or *is there a support yet* to be added for printf?
Could you please post an example of what you are trying to do? Are you using Sughosh Ganu's Hawkboard SPL patches or not? Without those patches hawkboard does not use the new SPL framework.
[U-Boot,1/2,V4] arm926: Flush the data cache before disabling it http://patchwork.ozlabs.org/patch/136079/
[U-Boot,2/2,V4] Changes to move hawkboard to the new spl infrastructure http://patchwork.ozlabs.org/patch/135433/
Regards, Christian

Hi Christian,
On Wed, Jan 25, 2012 at 3:57 PM, Christian Riesch < christian.riesch@omicron.at> wrote:
Hi,
On Wed, Jan 25, 2012 at 10:52 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that *
Why do you want to do that? A command in an SPL?
For davinci soc I wanted to add "clocks" command not particularly for SPL only when I move some piece of code from arc/arm/cpu/arm926ejs/cpu.c to say arc/arm/cpu/arm926ejs/speed.c and implement the command I get following errors,
arm-none-linux-gnueabi-ld: error: no memory region specified for loadable section `.u_boot_cmd' make[2]: *** [/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl/u-boot-spl] Error 1 make[2]: Leaving directory `/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl' I get these errors for SPL enabled
*When I tried to that I get following error, "error: no memory region specified for loadable section* " *When i add printf statements and build I get errors for hawkboard_nand board puts works fine. Is printf being removed as of buffer overriding
*issues
or *is there a support yet* to be added for printf?
Could you please post an example of what you are trying to do? Are you using Sughosh Ganu's Hawkboard SPL patches or not? Without those patches hawkboard does not use the new SPL framework.
I didn't use this patches, ill now.
I didn't use these patches though ill try it
[U-Boot,1/2,V4] arm926: Flush the data cache before disabling it http://patchwork.ozlabs.org/patch/136079/
[U-Boot,2/2,V4] Changes to move hawkboard to the new spl infrastructure http://patchwork.ozlabs.org/patch/135433/
Regards, Christian
Thanks, Regards --Prabhakar Lad

Hi,
On Wed, Jan 25, 2012 at 11:50 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
On Wed, Jan 25, 2012 at 3:57 PM, Christian Riesch < christian.riesch@omicron.at> wrote:
Hi,
On Wed, Jan 25, 2012 at 10:52 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that *
Why do you want to do that? A command in an SPL?
For davinci soc I wanted to add "clocks" command not particularly for SPL only when I move some piece of code from arc/arm/cpu/arm926ejs/cpu.c to say arc/arm/cpu/arm926ejs/speed.c and implement the command I get following errors,
arm-none-linux-gnueabi-ld: error: no memory region specified for loadable section `.u_boot_cmd' make[2]: *** [/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl/u-boot-spl] Error 1 make[2]: Leaving directory `/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl' I get these errors for SPL enabled
As Wolfgang wrote, commands cannot be run in SPL and therefore you should not compile them into SPL.
How about something like this:
#ifndef CONFIG_SPL_BUILD U_BOOT_CMD( ... ); #endif
If you don't use Sughosh's patches I think you need #ifndef CONFIG_NAND_SPL instead of #ifndef CONFIG_SPL_BUILD. Regards, Christian

On Wed, Jan 25, 2012 at 4:43 AM, Christian Riesch christian.riesch@omicron.at wrote:
Hi,
On Wed, Jan 25, 2012 at 11:50 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
On Wed, Jan 25, 2012 at 3:57 PM, Christian Riesch < christian.riesch@omicron.at> wrote:
Hi,
On Wed, Jan 25, 2012 at 10:52 AM, Prabhakar Lad prabhakar.csengg@gmail.com wrote:
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that *
Why do you want to do that? A command in an SPL?
For davinci soc I wanted to add "clocks" command not particularly for SPL only when I move some piece of code from arc/arm/cpu/arm926ejs/cpu.c to say arc/arm/cpu/arm926ejs/speed.c and implement the command I get following errors,
arm-none-linux-gnueabi-ld: error: no memory region specified for loadable section `.u_boot_cmd' make[2]: *** [/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl/u-boot-spl] Error 1 make[2]: Leaving directory `/home/plad/ti/uboot/denx_uboot/uboot-ti/u-boot-ti/spl' I get these errors for SPL enabled
As Wolfgang wrote, commands cannot be run in SPL and therefore you should not compile them into SPL.
How about something like this:
#ifndef CONFIG_SPL_BUILD U_BOOT_CMD( ... ); #endif
If you don't use Sughosh's patches I think you need #ifndef CONFIG_NAND_SPL instead of #ifndef CONFIG_SPL_BUILD. Regards, Christian
Maybe we should poke <command.h> to nop out U_BOOT_CMD for CONFIG_SPL_BUILD? OTOH, #ifndef'ing U_BOOT_CMD and the code itself gets us a space savings we wouldn't get otherwise (I suspect giving the MTD/NAND issue I've mentioned before)...

On 01/25/2012 12:19 PM, Tom Rini wrote:
Maybe we should poke <command.h> to nop out U_BOOT_CMD for CONFIG_SPL_BUILD? OTOH, #ifndef'ing U_BOOT_CMD and the code itself gets us a space savings we wouldn't get otherwise (I suspect giving the MTD/NAND issue I've mentioned before)...
Commands should be stripped out already with the new SPL -- that's what the (unfortunately uncommented) sed command in GEN_UBOOT appears to be doing.
-Scott

On Wed, Jan 25, 2012 at 11:55 AM, Scott Wood scottwood@freescale.com wrote:
On 01/25/2012 12:19 PM, Tom Rini wrote:
Maybe we should poke <command.h> to nop out U_BOOT_CMD for CONFIG_SPL_BUILD? OTOH, #ifndef'ing U_BOOT_CMD and the code itself gets us a space savings we wouldn't get otherwise (I suspect giving the MTD/NAND issue I've mentioned before)...
Commands should be stripped out already with the new SPL -- that's what the (unfortunately uncommented) sed command in GEN_UBOOT appears to be doing.
Ah that's right. Should be easy enough to test on say beagleboard, along with a patch to make <commands.h> do the right thing.

Dear Prabhakar Lad,
In message CA+V-a8vtOyW3X82hNrrzq--CBUHDVvSRR7SrhkwM9q6hUWzW+Q@mail.gmail.com you wrote:
*I want to add a command using U_BOOT_CMD in uboot, where SPL_BUILD is enabled for example for da850evm in spl frame work how can i do that *
This makes no sense. Commands can only be executed when we have full U-Boot running (actually even only after relocation). You cannot run commands in the SPL.
*is there a support yet* to be added for printf?
This makes also no sense to me - printf is available in the SPL.
Best regards,
Wolfgang Denk

On Wed, Jan 25, 2012 at 11:37 AM, Wolfgang Denk wd@denx.de wrote:
In message CA+V-a8vtOyW3X82hNrrzq--CBUHDVvSRR7SrhkwM9q6hUWzW+Q@mail.gmail.com you wrote:
*is there a support yet* to be added for printf?
This makes also no sense to me - printf is available in the SPL.
As long as CONFIG_SPL_LIBCOMMON_SUPPORT is defined. Regards, Christian
participants (5)
-
Christian Riesch
-
Prabhakar Lad
-
Scott Wood
-
Tom Rini
-
Wolfgang Denk