Skip to contentSkip to conversation

armv8/ls1043a: Add MTD partition scheme

PATCH New Wenbin Song 2 participants 12 messages Apr 1, 2016 – Jul 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Add and share the the MTD partition scheme with kernel by defualt bootargs. And add the "mtdparts" env.

---
 include/configs/ls1043a_common.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
include/configs/ls1043a_common.h +20 -2
index fd243b1..6964873 100644
@@ -236,6 +236,21 @@
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
+			"5m(kernel),1m(dtb),9m(file_system)"
+#else
+#define MTDPARTS_DEFAULT "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)"
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
@@ -248,10 +263,13 @@
 	"kernel_start=0x61100000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
-	"console=ttyAMA0,38400n8\0"
+	"console=ttyAMA0,38400n8\0"		\
+	"mtdparts=" MTDPARTS_DEFAULT "\0"
 
 #define CONFIG_BOOTARGS			"console=ttyS0,115200 root=/dev/ram0 " \
-					"earlycon=uart8250,mmio,0x21c0500"
+					"earlycon=uart8250,mmio,0x21c0500 " \
+					MTDPARTS_DEFAULT
+
 #define CONFIG_BOOTCOMMAND		"cp.b $kernel_start $kernel_load "     \
 					"$kernel_size && bootm $kernel_load"
 #define CONFIG_BOOTDELAY		10
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 36 lines · Wenbin Song

Add and share the the MTD partition scheme with kernel by defualt bootargs. And add the "mtdparts" env.

---
 include/configs/ls1043a_common.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
include/configs/ls1043a_common.h +15 -0
index fd243b1..6964873 100644
@@ -236,6 +236,21 @@
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
+			"5m(kernel),1m(dtb),9m(file_system)"
+#else
+#define MTDPARTS_DEFAULT "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)"
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
@@ -248,10 +263,13 @@
 	"kernel_start=0x61100000\0"		\

include/configs/ls1043a_common.h line 271

Quoted 10 lines
include/configs/ls1043a_common.h +4 -2
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
-	"console=ttyAMA0,38400n8\0"
+	"console=ttyAMA0,38400n8\0"		\
+	"mtdparts=" MTDPARTS_DEFAULT "\0"
 
 #define CONFIG_BOOTARGS			"console=ttyS0,115200 root=/dev/ram0 " \
-					"earlycon=uart8250,mmio,0x21c0500"
+					"earlycon=uart8250,mmio,0x21c0500 " \
+					MTDPARTS_DEFAULT

You could use $mtdparts here so your bootcmd doesn't get too long.

York

#2 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 43 lines · York Sun
Quoted 42 lines · Wenbin Song

Add and share the the MTD partition scheme with kernel by defualt bootargs. And add the "mtdparts" env.

---
 include/configs/ls1043a_common.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
include/configs/ls1043a_common.h +17 -1
index fd243b1..6964873 100644
@@ -236,6 +236,21 @@
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
+			"5m(kernel),1m(dtb),9m(file_system)"
+#else
+#define MTDPARTS_DEFAULT "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)"
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
@@ -248,10 +263,13 @@
 	"kernel_start=0x61100000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
-	"console=ttyAMA0,38400n8\0"
+	"console=ttyAMA0,38400n8\0"		\
+	"mtdparts=" MTDPARTS_DEFAULT "\0"
 
Quoted 7 lines

include/configs/ls1043a_common.h line 271

Quoted 4 lines
include/configs/ls1043a_common.h +2 -1
 #define CONFIG_BOOTARGS			"console=ttyS0,115200 root=/dev/ram0 " \
-					"earlycon=uart8250,mmio,0x21c0500"
+					"earlycon=uart8250,mmio,0x21c0500 " \
+					MTDPARTS_DEFAULT

You could use $mtdparts here so your bootcmd doesn't get too long.

Wenbin,

A related question regarding MTD, how do you make NOR MTD device working on these boards (ls1043aqds and ls1043ardb)? This is a common file for both RDB and QDS. I presume you have verified on both. I have nand working on both, spi-nor working on rdb only. I don't have NOR working on either of them. It may be not a U-Boot issue though.

York

#3 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Hi: York

1, There is an issue for sdk2.0 kernel that the nor-flash can't be probed . we can fix it as follow:

$make menuconfig

x -> Device Drivers
x -> Memory Technology Device (MTD) support
x -> RAM/ROM/Flash chip drivers
x -> Flash chip driver advanced configuration options
x -> Flash cmd/query data swapping

       x x                  ( ) NO                                   
       x x                  (X) BIG_ENDIAN_BYTE                     
       x x                  ( ) LITTLE_ENDIAN_BYTE                   

Enable BIG_ENDIAN_BYTE .

2, The spi-nor flash can working on ls1043aqds , and I use the sdk2.0 kernel (ce5a3841f3).

      [    1.598954] m25p80 spi0.0: n25q128a11 (16384 Kbytes)
[    1.603923] 4 cmdlinepart partitions found on MTD device spi0.0
[    1.609842] Creating 4 MTD partitions on "spi0.0":
[    1.614624] 0x000000000000-0x000000100000 : "uboot"
[    1.624205] ftl_cs: FTL header not found.
[    1.628421] 0x000000100000-0x000000600000 : "kernel"
[    1.638086] ftl_cs: FTL header not found.
[    1.642316] 0x000000600000-0x000000700000 : "dtb"
[    1.651702] ftl_cs: FTL header not found.
[    1.655932] 0x000000700000-0x000001000000 : "file_system"
[    1.666028] ftl_cs: FTL header not found.

Best Regards
Wenbin Song

Quoted 78 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Wednesday, April 06, 2016 5:02 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 2 lines · York Sun
Quoted 1 line · Wenbin Song

Add and share the the MTD partition scheme with kernel by defualt

bootargs.

Quoted 16 lines
Quoted 16 lines

And add the "mtdparts" env.

---
 include/configs/ls1043a_common.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
include/configs/ls1043a_common.h +0 -0
index fd243b1..6964873 100644
@@ -236,6 +236,21 @@
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
Quoted 5 lines

include/configs/ls1043a_common.h

Quoted 5 lines
include/configs/ls1043a_common.h +5 -0
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
+#define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
+			"5m(kernel),1m(dtb),9m(file_system)"
+#else
+#define MTDPARTS_DEFAULT

"mtdparts=60000000.nor:1m(nor_bank0_rcw)," \

Quoted 1 line

include/configs/ls1043a_common.h line 244

Quoted 1 line
include/configs/ls1043a_common.h +1 -0
+			"1m(nor_bank0_uboot),1m(nor_bank0_uboot_env),"

\

Quoted 1 line

include/configs/ls1043a_common.h line 245

Quoted 1 line
include/configs/ls1043a_common.h +1 -0
+			"1m(nor_bank0_fman_uconde),40m(nor_bank0_fit),"

\

Quoted 2 lines

include/configs/ls1043a_common.h line 253

Quoted 2 lines
include/configs/ls1043a_common.h +2 -0
+			"1m(nor_bank4_rcw),1m(nor_bank4_uboot)," \
+
	"1m(nor_bank4_uboot_env),1m(nor_bank4_fman_ucode)," \
Quoted 17 lines
Quoted 17 lines
include/configs/ls1043a_common.h +8 -1
+			"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)"
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
@@ -248,10 +263,13 @@
 	"kernel_start=0x61100000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
-	"console=ttyAMA0,38400n8\0"
+	"console=ttyAMA0,38400n8\0"		\
+	"mtdparts=" MTDPARTS_DEFAULT "\0"
 
Quoted 1 line

include/configs/ls1043a_common.h line 269

Quoted 1 line
include/configs/ls1043a_common.h +0 -0
 #define CONFIG_BOOTARGS			"console=ttyS0,115200

root=/dev/ram0 " \

Quoted 6 lines

include/configs/ls1043a_common.h line 271

Quoted 3 lines
include/configs/ls1043a_common.h +2 -1
-					"earlycon=uart8250,mmio,0x21c0500"
+					"earlycon=uart8250,mmio,0x21c0500 " \
+					MTDPARTS_DEFAULT

You could use $mtdparts here so your bootcmd doesn't get too long.

Wenbin,

A related question regarding MTD, how do you make NOR MTD device working on these boards (ls1043aqds and ls1043ardb)? This is a common file for both RDB and QDS. I presume you have verified on both. I have nand working on both, spi-nor working on rdb only. I don't have NOR working on either of them. It may be not a U-Boot issue though.

York

#4 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

In reply to York Sun

Hi: York

Do you mean that I should use $mtdpart to instead of "MTDPARTS_DEFAULT" ?

As follows:

       #define CONFIG_BOOTARGS                 "console=ttyS0,115200 root=/dev/ram0 " \
	                                         "earlycon=uart8250,mmio,0x21c0500 " \
	                                       "$mtdparts"

If so, the variable $mtdparts can't be extend ,like that:

root at ls1043aqds:~# cat /proc/cmdline
console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ${mtdparts}

Best Regards
Wenbin Song

Quoted 67 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Wednesday, April 06, 2016 4:33 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 14 lines · Wenbin Song

Add and share the the MTD partition scheme with kernel by defualt bootargs. And add the "mtdparts" env.

---
 include/configs/ls1043a_common.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
include/configs/ls1043a_common.h +0 -0
index fd243b1..6964873 100644

include/configs/ls1043a_common.h line 239

Quoted 4 lines
include/configs/ls1043a_common.h +1 -0
@@ -236,6 +236,21 @@
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)

#define

include/configs/ls1043a_common.h

Quoted 4 lines
include/configs/ls1043a_common.h +4 -0
+MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
+			"5m(kernel),1m(dtb),9m(file_system)"
+#else
+#define MTDPARTS_DEFAULT

"mtdparts=60000000.nor:1m(nor_bank0_rcw)," \

include/configs/ls1043a_common.h line 244

Quoted 1 line
include/configs/ls1043a_common.h +1 -0
+			"1m(nor_bank0_uboot),1m(nor_bank0_uboot_env),"

\

include/configs/ls1043a_common.h line 245

Quoted 1 line
include/configs/ls1043a_common.h +1 -0
+			"1m(nor_bank0_fman_uconde),40m(nor_bank0_fit),"

\

include/configs/ls1043a_common.h line 253

Quoted 2 lines
include/configs/ls1043a_common.h +2 -0
+			"1m(nor_bank4_rcw),1m(nor_bank4_uboot)," \
+
	"1m(nor_bank4_uboot_env),1m(nor_bank4_fman_ucode)," \
Quoted 10 lines
include/configs/ls1043a_common.h +6 -0
+			"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)"
+#endif
+
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS		\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\

include/configs/ls1043a_common.h line 269

Quoted 8 lines
include/configs/ls1043a_common.h +2 -1
@@ -248,10 +263,13 @@
 	"kernel_start=0x61100000\0"		\
 	"kernel_load=0xa0000000\0"		\
 	"kernel_size=0x2800000\0"		\
-	"console=ttyAMA0,38400n8\0"
+	"console=ttyAMA0,38400n8\0"		\
+	"mtdparts=" MTDPARTS_DEFAULT "\0"
 
 #define CONFIG_BOOTARGS			"console=ttyS0,115200

root=/dev/ram0 " \

include/configs/ls1043a_common.h line 271

Quoted 3 lines
include/configs/ls1043a_common.h +2 -1
-					"earlycon=uart8250,mmio,0x21c0500"
+					"earlycon=uart8250,mmio,0x21c0500 " \
+					MTDPARTS_DEFAULT

You could use $mtdparts here so your bootcmd doesn't get too long.

York

#5 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 5 lines · Wenbin Song

Hi: York

Do you mean that I should use $mtdpart to instead of "MTDPARTS_DEFAULT" ?

As follows:

Quoted 9 lines
       #define CONFIG_BOOTARGS                 "console=ttyS0,115200 root=/dev/ram0 " \
	                                         "earlycon=uart8250,mmio,0x21c0500 " \
	                                       "$mtdparts"

If so, the variable $mtdparts can't be extend ,like that:

root at ls1043aqds:~# cat /proc/cmdline
console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ${mtdparts}

What do you see "print bootargs" under U-Boot?
I thought the variable can be extended when U-Boot runs the command. Like we used to have $consoledev, $othbootargs, etc.

York

#6 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

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.

What do you suggest?

Best Regards
Wenbin Song

Quoted 33 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Wednesday, April 06, 2016 12:39 PM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 3 lines · Wenbin Song

Hi: York

Do you mean that I should use $mtdpart to instead of

"MTDPARTS_DEFAULT" ?

Quoted 3 lines

As follows:

       #define CONFIG_BOOTARGS                 "console=ttyS0,115200

root=/dev/ram0 " \

Quoted 9 lines
	                                         "earlycon=uart8250,mmio,0x21c0500 " \
	                                       "$mtdparts"

If so, the variable $mtdparts can't be extend ,like that:

root at ls1043aqds:~# cat /proc/cmdline console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ${mtdparts}

What do you see "print bootargs" under U-Boot?
I thought the variable can be extended when U-Boot runs the command. Like we used to have $consoledev, $othbootargs, etc.

York

#7 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 22 lines · Wenbin Song

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 \

Quoted 8 lines
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

#8 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Hi: York

Please see my inline comments.

Best Regards
Wenbin Song

Quoted 54 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 07, 2016 1:18 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 7 lines · Wenbin Song

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) ,1

Quoted 1 line

m(nor_bank0_uboot_env),1m(nor_bank0_fman_uconde),40m(nor_bank0_fit ),1m

Quoted 1 line

(nor_bank4_rcw),1m(nor_bank4_uboot),1m(nor_bank4_uboot_env),1m(nor_ ban

Quoted 1 line

k4_fman_ucode),40m(nor_bank4_fit);7e800000.flash:1m(nand_uboot),1m(na n

Quoted 9 lines

d_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 .

Quoted 6 lines

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:

Quoted 9 lines

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"
Quoted 4 lines
Quoted 1 line

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"?

[wenbin]

I export this variable in order to make easier to modify the bootargs under uboot command-line.

For example:
=>setenv bootargs "console=ttyS0,115200 root=/dev/ram0 $mtdparts" =>setenv bootargs "console=ttyLP0,115200 root=/dev/ram0 $mtdparts"

Use the $mtdparts to instead of a long string.

Quoted 1 line

Would it be a better idea to set bootargs using the bootcmd?

[wenbin]

yes, It is a good idea.
But we need all kinds of ways to boot kernel with this "bootargs". The bootcmd only can specify one boot-way.
IOW, only the way specified by this "bootcmd" can execute " setenv bootargs".
So I want to supply the default bootargs by the CONFIG_BOOTARGS .

Quoted 7 lines

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.

[wenbin]

Ok, thanks for your advices, I will modify them on the later patch.

Quoted 1 line

York

#9 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 90 lines · Wenbin Song

Hi: York

Please see my inline comments.

Best Regards
Wenbin Song

Quoted 54 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 07, 2016 1:18 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 7 lines · Wenbin Song

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) ,1

Quoted 1 line

m(nor_bank0_uboot_env),1m(nor_bank0_fman_uconde),40m(nor_bank0_fit ),1m

Quoted 1 line

(nor_bank4_rcw),1m(nor_bank4_uboot),1m(nor_bank4_uboot_env),1m(nor_ ban

Quoted 1 line

k4_fman_ucode),40m(nor_bank4_fit);7e800000.flash:1m(nand_uboot),1m(na n

Quoted 9 lines

d_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 .

Quoted 6 lines

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:

Quoted 9 lines

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"
Quoted 4 lines
Quoted 1 line

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"?

[wenbin]

I export this variable in order to make easier to modify the bootargs under uboot command-line.

For example:
=>setenv bootargs "console=ttyS0,115200 root=/dev/ram0 $mtdparts" =>setenv bootargs "console=ttyLP0,115200 root=/dev/ram0 $mtdparts"

Use the $mtdparts to instead of a long string.

Quoted 1 line

Would it be a better idea to set bootargs using the bootcmd?

[wenbin]

yes, It is a good idea.
But we need all kinds of ways to boot kernel with this "bootargs". The bootcmd only can specify one boot-way.
IOW, only the way specified by this "bootcmd" can execute " setenv bootargs".
So I want to supply the default bootargs by the CONFIG_BOOTARGS .

Quoted 4 lines

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

Quoted 7 lines
Quoted 3 lines

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.

[wenbin]

Ok, thanks for your advices, I will modify them on the later patch.

Wenbin,

Do you have an update?

York

#10 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Hi: York

I'm sorry to have misunderstood you mean.
I think it is a good idea that modify/remove the wrong/useless variables in a new patch. And I will make it later.
Do you have any suggestion?

Best Regards
Wenbin Song

Quoted 119 lines

-----Original Message-----
From: york sun
Sent: Wednesday, July 20, 2016 6:02 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 64 lines · Wenbin Song

Hi: York

Please see my inline comments.

Best Regards
Wenbin Song

Quoted 57 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 07, 2016 1:18 AM
To: Wenbin Song <[email protected]>; Mingkai Hu <[email protected]>; u-boot at lists.denx.de
Cc: Qianyu Gong <[email protected]>; Shaohui Xie <[email protected]>; Zhiqiang Hou <[email protected]>
Subject: Re: [PATCH] armv8/ls1043a: Add MTD partition scheme

Quoted 7 lines · Wenbin Song

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) ,1

Quoted 1 line

m(nor_bank0_uboot_env),1m(nor_bank0_fman_uconde),40m(nor_bank0_fit ),1m

Quoted 1 line

(nor_bank4_rcw),1m(nor_bank4_uboot),1m(nor_bank4_uboot_env),1m(nor_ ban

Quoted 1 line

k4_fman_ucode),40m(nor_bank4_fit);7e800000.flash:1m(nand_uboot),1m(na n

Quoted 11 lines

d_uboot_env),20m(nand_fit);spi0.0:1m(uboot),5m(kernel),1m(dtb),9m(fi le
_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 .

Quoted 7 lines

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:

Quoted 9 lines

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"
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

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"?

[wenbin]

I export this variable in order to make easier to modify the bootargs under

uboot command-line.

Quoted 5 lines

For example:
=>setenv bootargs "console=ttyS0,115200 root=/dev/ram0 $mtdparts" =>setenv bootargs "console=ttyLP0,115200 root=/dev/ram0 $mtdparts"

Quoted 8 lines

Use the $mtdparts to instead of a long string.

Quoted 1 line

Would it be a better idea to set bootargs using the bootcmd?

[wenbin]

yes, It is a good idea.
But we need all kinds of ways to boot kernel with this "bootargs". The

bootcmd only can specify one boot-way.

Quoted 10 lines

IOW, only the way specified by this "bootcmd" can execute " setenv bootargs". So I want to supply the default bootargs by the CONFIG_BOOTARGS .

Quoted 6 lines

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.

Quoted 5 lines
Quoted 1 line

[wenbin]

Ok, thanks for your advices, I will modify them on the later patch.

Wenbin,

Do you have an update?

York

#11 lore raw

PATCH 1/1 armv8/ls1043a: Add MTD partition scheme

Quoted 6 lines · Wenbin Song

Hi: York

I'm sorry to have misunderstood you mean.
I think it is a good idea that modify/remove the wrong/useless variables in a new patch. And I will make it later.
Do you have any suggestion?

Yes, please make a cleanup patch first, then your change of MTD partition.

York