[U-Boot] [PATCH] armv8/ls1043a: Add MTD partition scheme

York Sun york.sun at nxp.com
Wed Apr 6 19:17:40 CEST 2016


On 04/06/2016 12:11 AM, Wenbin Song wrote:
> Hi: York
> 
> I set bootargs  as the following steps:
> 
> => env default mtdparts
> => printenv mtdparts
> mtdparts=mtdparts=60000000.nor:1m(nor_bank0_rcw),1m(nor_bank0_uboot),1m(nor_bank0_uboot_env),1m(nor_bank0_fman_uconde),40m(nor_bank0_fit),1m(nor_bank4_rcw),1m(nor_bank4_uboot),1m(nor_bank4_uboot_env),1m(nor_bank4_fman_ucode),40m(nor_bank4_fit);7e800000.flash:1m(nand_uboot),1m(nand_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(file_system)
> => env default bootargs
> => printenv bootargs
> bootargs=console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ${mtdparts}
> 
> 
> The macro  CONFIG_BOOTARGS  only be extern as an char-string, and it will be spliced into default_environment array . 
> 
>  const uchar default_environment[] = {
> #ifdef  CONFIG_BOOTARGS
>           "bootargs="     CONFIG_BOOTARGS                 "\0"
>  #endif
>  
> The variable we use to have $consoledev, $othbootargs  was used in the following cases:
> 
> 858  #define CONFIG_BOOTCOMMAND \
> 859         "setenv bootargs root=/dev/ram rw "             \
> 860         "console=$consoledev,$baudrate $othbootargs;"   \
> 861         "setenv ramdiskaddr 0x02000000;"                \
> 862         "setenv fdtaddr 0x00c00000;"                    \
> 863         "setenv loadaddr 0x1000000;"                    \
> 864         "bootm $loadaddr $ramdiskaddr $fdtaddr"
> 
> Because the "setenv"  will be executed  , So the variable could be extended.

I see what you mean. I am trying to reduce the environmental variables.
Do you need the variable "mtdparts"?
Would it be a better idea to set bootargs using the bootcmd?

While you are on it, I suggest you take a look at other variables.
"console=ttyAMA0,38400n8" is wrong here.

We don't have to copy kernel image from NOR flash to DDR if the ramdisk load
address is set properly in its file. So you can remove the copying from bootcmd.

York



More information about the U-Boot mailing list