Skip to contentSkip to conversation

m28evk board config

PATCH New lothar at denx.de 4 participants 5 messages Sep 6, 2013 – Sep 10, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m28evk board config

From 24b6381162b4569ab86b481b8714d81877231f22 Mon Sep 17 00:00:00 2001
From: Lothar Rubusch <[email protected]>
Date: Fri, 6 Sep 2013 15:01:39 +0200
Subject: [PATCH] m28evk board specific configurations for setup with ext boot
partition and separate ext rootfs

---
  include/configs/m28evk.h | 78 
++++++++++++++++++++++++++++++++++++++++++++++--
  1 file changed, 75 insertions(+), 3 deletions(-)
include/configs/m28evk.h +75 -3
index eba8759..b65456e 100644
@@ -150,15 +150,25 @@
  #endif
 
  /* Booting Linux */
-#define CONFIG_BOOTDELAY	3
+#define CONFIG_BOOTDELAY	5
  #define CONFIG_BOOTFILE		"uImage"
  #define CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "
-#define CONFIG_BOOTCOMMAND	"run bootcmd_net"
+#define CONFIG_BOOTCOMMAND	"run mmc_mmc"
  #define CONFIG_LOADADDR		0x42000000
  #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
 
  /* Extra Environment */
  #define CONFIG_EXTRA_ENV_SETTINGS					\
+	"fdtfile=imx28-m28evk.dtb\0"                                    \
+	"consdev=ttyAMA0\0"                                             \
+	"baudrate=115200\0"                                             \
+	"bootdev=/dev/mmcblk0p2\0"                                      \
+	"rootdev=/dev/mmcblk0p3\0"                                      \
+	"netdev=eth0\0"                                                 \
+	"hostname=m28evk\0"                                             \
+	"rootpath=/opt/eldk-5.3/armv5te/rootfs-qte-sdk\0"               \
+	"kernel_addr_r=0x42000000\0"                                    \
+	"fdt_addr_r=0x41000000\0"                                       \
  	"update_nand_full_filename=u-boot.nand\0"			\
  	"update_nand_firmware_filename=u-boot.sb\0"			\
  	"update_sd_firmware_filename=u-boot.sd\0"			\
@@ -196,7 +206,69 @@
  		"setexpr fw_sz ${fw_sz} + 1 ; "				\
  		"mmc write ${loadaddr} 0x800 ${fw_sz} ; "		\
  		"fi ; "							\
-		"fi\0"
+		"fi\0"                                                  \
+	"addcons=setenv bootargs ${bootargs} console=${consdev},${baudrate}\0" 
\
+	"addip="                                                        \
+		"setenv bootargs ${bootargs} "                          \
+			"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
+				"${hostname}:${netdev}:off\0"           \
+	"addmisc=setenv bootargs ${bootargs} ${miscargs}\0"             \
+	"adddfltmtd="                                                   \
+		"if test \"x${mtdparts}\" == \"x\" ; "                  \
+		"then mtdparts default ; "                              \
+		"fi\0"                                                  \
+	"addmtd="                                                       \
+		"run adddfltmtd ; "                                     \
+		"setenv bootargs ${bootargs} ${mtdparts}\0"             \
+	"addargs=run addcons addmtd addmisc\0"                          \
+	"kernel_mmcload="                                               \
+		"mmc rescan ; "                                         \
+		"ext2load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"        \
+	"kernel_nandload=nand read ${kernel_addr_r} kernel\0"           \
+	"kernel_netload=tftp ${kernel_addr_r} ${bootfile}\0"            \
+	"fdt_mmcload="                                                  \
+		"mmc rescan ; "                                         \
+		"ext2load mmc 0:2 ${fdt_addr_r} ${fdtfile}\0"            \
+	"fdt_nandload=nand read ${fdt_addr_r} fdt\0"                    \
+	"fdt_netload=tftp ${fdt_addr_r} ${fdtfile}\0"                   \
+	"miscargs=nohlt panic=1\0"                                      \
+	"mmcargs=setenv bootargs root=${rootdev} rw rootwait\0"         \
+	"nandargs="                                                     \
+		"setenv bootargs ubi.mtd=6 root=ubi0:rootfs "           \
+			"rootfstype=ubifs\0"                            \
+	"nfsargs="                                                      \
+		"setenv bootargs root=/dev/nfs rw "                     \
+			"nfsroot=${serverip}:${rootpath},v3,tcp\0"      \
+	"mmcload=run kernel_mmcload fdt_mmcload\0"                      \
+	"nandload=run kernel_nandload fdt_nandload\0"                   \
+	"netload=run kernel_netload fdt_netload\0"                      \
+	"mmc_nfs="                                                      \
+		"run mmcload nfsargs addip addargs ; "                  \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"mmc_mmc="                                                      \
+		"run mmcload mmcargs addargs ; "                        \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"mmc_nand="                                                     \
+		"run mmcload nandargs addargs ; "                       \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"nand_mmc="                                                     \
+		"run nandload mmcargs addargs ; "                       \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"nand_nfs="                                                     \
+		"run nandload nfsargs addip addargs ; "                 \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"nand_nand="                                                    \
+		"run nandload nandargs addargs ; "                      \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"net_mmc="                                                      \
+		"run netload mmcargs addargs ; "                        \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"net_nfs="                                                      \
+		"run netload nfsargs addip addargs ; "                  \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+	"net_nand="                                                     \
+		"run netload nandargs addargs ; "                       \
+		"bootm ${kernel_addr_r} - ${fdt_addr_r}\0"
 
  /* The rest of the configuration is shared */
  #include <configs/mxs.h>
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 1/1 m28evk board config

Quoted 6 lines · On Fri, Sep 6, 2013 at 3:10 PM, <[email protected]> wrote:

From 24b6381162b4569ab86b481b8714d81877231f22 Mon Sep 17 00:00:00 2001
From: Lothar Rubusch <[email protected]>
Date: Fri, 6 Sep 2013 15:01:39 +0200
Subject: [PATCH] m28evk board specific configurations for setup with ext boot
partition and separate ext rootfs

Quite a long subject and no commit log.

Quoted 12 lines
---
 include/configs/m28evk.h | 78
++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 75 insertions(+), 3 deletions(-)
include/configs/m28evk.h +0 -0
index eba8759..b65456e 100644

include/configs/m28evk.h line 153

Quoted 5 lines
include/configs/m28evk.h +1 -1
@@ -150,15 +150,25 @@
 #endif
 
 /* Booting Linux */
-#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTDELAY       5

This is a separate change or at least it should be mentioned in the commit log.

#2 lore raw

PATCH 1/1 m28evk board config

In reply to lothar at denx.de

Dear lothar at denx.de,

Quoted 20 lines

From 24b6381162b4569ab86b481b8714d81877231f22 Mon Sep 17 00:00:00 2001
From: Lothar Rubusch <[email protected]>
Date: Fri, 6 Sep 2013 15:01:39 +0200
Subject: [PATCH] m28evk board specific configurations for setup with ext boot
partition and separate ext rootfs

---
  include/configs/m28evk.h | 78
++++++++++++++++++++++++++++++++++++++++++++++--
  1 file changed, 75 insertions(+), 3 deletions(-)
include/configs/m28evk.h +0 -0
index eba8759..b65456e 100644
@@ -150,15 +150,25 @@
  #endif

include/configs/m28evk.h line 158

Quoted 10 lines
include/configs/m28evk.h +2 -2
 
  /* Booting Linux */
-#define CONFIG_BOOTDELAY	3
+#define CONFIG_BOOTDELAY	5
  #define CONFIG_BOOTFILE		"uImage"
  #define CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "
-#define CONFIG_BOOTCOMMAND	"run bootcmd_net"
+#define CONFIG_BOOTCOMMAND	"run mmc_mmc"
  #define CONFIG_LOADADDR		0x42000000
  #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR

These two options above do not seem right, they certainly can make use of some unification. But that's for another patch.

include/configs/m28evk.h line 169

Quoted 10 lines
include/configs/m28evk.h +8 -0
  /* Extra Environment */
  #define CONFIG_EXTRA_ENV_SETTINGS					\
+	"fdtfile=imx28-m28evk.dtb\0"                                    \
+	"consdev=ttyAMA0\0"                                             \
+	"baudrate=115200\0"                                             \
+	"bootdev=/dev/mmcblk0p2\0"                                      \
+	"rootdev=/dev/mmcblk0p3\0"                                      \
+	"netdev=eth0\0"                                                 \
+	"hostname=m28evk\0"                                             \
+	"rootpath=/opt/eldk-5.3/armv5te/rootfs-qte-sdk\0"               \

Use 5.4 here ?

Quoted 12 lines
include/configs/m28evk.h +4 -1
+	"kernel_addr_r=0x42000000\0"                                    \
+	"fdt_addr_r=0x41000000\0"                                       \
  	"update_nand_full_filename=u-boot.nand\0"			\
  	"update_nand_firmware_filename=u-boot.sb\0"			\
  	"update_sd_firmware_filename=u-boot.sd\0"			\
@@ -196,7 +206,69 @@
  		"setexpr fw_sz ${fw_sz} + 1 ; "				\
  		"mmc write ${loadaddr} 0x800 ${fw_sz} ; "		\
  		"fi ; "							\
-		"fi\0"
+		"fi\0"                                                  \
+	"addcons=setenv bootargs ${bootargs} console=${consdev},${baudrate}\0"

include/configs/m28evk.h line 220

Quoted 10 lines
include/configs/m28evk.h +9 -0
 \
+	"addip="                                                        \
+		"setenv bootargs ${bootargs} "                          \
+			"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
+				"${hostname}:${netdev}:off\0"           \
+	"addmisc=setenv bootargs ${bootargs} ${miscargs}\0"             \
+	"adddfltmtd="                                                   \
+		"if test \"x${mtdparts}\" == \"x\" ; "                  \
+		"then mtdparts default ; "                              \
+		"fi\0"                                                  \

I suspect the addmtd should be called unconditionally for every boot type (mmc_nfs...net_nand).

[...]

Best regards,
Marek Vasut

#3 lore raw

PATCH 1/1 m28evk board config

Hello Mailing List - Hello Fabio and Marex
Thank you very much for your helpfull hints!!
Just some words of mine on your comments.

Am 2013-09-09 16:37, schrieb Marek Vasut:

Quoted 25 lines

Dear lothar at denx.de,

Quoted 23 lines

From 24b6381162b4569ab86b481b8714d81877231f22 Mon Sep 17 00:00:00
2001
From: Lothar Rubusch <[email protected]>
Date: Fri, 6 Sep 2013 15:01:39 +0200
Subject: [PATCH] m28evk board specific configurations for setup with ext
boot
partition and separate ext rootfs

---
  include/configs/m28evk.h | 78
++++++++++++++++++++++++++++++++++++++++++++++--
  1 file changed, 75 insertions(+), 3 deletions(-)
include/configs/m28evk.h +0 -0
index eba8759..b65456e 100644
@@ -150,15 +150,25 @@
  #endif
 
Quoted 13 lines

include/configs/m28evk.h line 158

Quoted 9 lines
include/configs/m28evk.h +2 -2
  /* Booting Linux */
-#define CONFIG_BOOTDELAY	3
+#define CONFIG_BOOTDELAY	5
  #define CONFIG_BOOTFILE		"uImage"
  #define CONFIG_BOOTARGS		"console=ttyAMA0,115200n8 "
-#define CONFIG_BOOTCOMMAND	"run bootcmd_net"
+#define CONFIG_BOOTCOMMAND	"run mmc_mmc"
  #define CONFIG_LOADADDR		0x42000000
  #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR

These two options above do not seem right, they certainly can make use of some
unification. But that's for another patch.

As Fabio Estevan already mentioned, the BOOTDELAY is definitely an unnecessary change which I'll leave out.
Fabio further complained about a missing commit history. I can see the point, but the configurations were elaborated directly through the uboot environment, and thus commited altogether. They were necessary, since the before include/configs/m28evk.h was definitely not working well with the m28evk board. Testing it, and with a huge help of Marek, I came to present this solution, and will soon post a v2 of it.

As Marek explained me personally, his comment here was related to the duplicate setting of the LOADADDR. My patch does not address this issue.

Quoted 4 lines
Quoted 4 lines
include/configs/m28evk.h +2 -0
  /* Extra Environment */
  #define CONFIG_EXTRA_ENV_SETTINGS					\
+	"fdtfile=imx28-m28evk.dtb\0"                                    \
+	"consdev=ttyAMA0\0"                                             \
Quoted 8 lines

include/configs/m28evk.h line 169

Quoted 6 lines
include/configs/m28evk.h +6 -0
+	"baudrate=115200\0"                                             \
+	"bootdev=/dev/mmcblk0p2\0"                                      \
+	"rootdev=/dev/mmcblk0p3\0"                                      \
+	"netdev=eth0\0"                                                 \
+	"hostname=m28evk\0"                                             \
+	"rootpath=/opt/eldk-5.3/armv5te/rootfs-qte-sdk\0"               \

Use 5.4 here ?

Definitely!

Quoted 19 lines
Quoted 19 lines
include/configs/m28evk.h +4 -1
+	"kernel_addr_r=0x42000000\0"                                    \
+	"fdt_addr_r=0x41000000\0"                                       \
  	"update_nand_full_filename=u-boot.nand\0"			\
  	"update_nand_firmware_filename=u-boot.sb\0"			\
  	"update_sd_firmware_filename=u-boot.sd\0"			\
@@ -196,7 +206,69 @@
  		"setexpr fw_sz ${fw_sz} + 1 ; "				\
  		"mmc write ${loadaddr} 0x800 ${fw_sz} ; "		\
  		"fi ; "							\
-		"fi\0"
+		"fi\0"                                                  \
+	"addcons=setenv bootargs ${bootargs} 

console=${consdev},${baudrate}\0"
\

include/configs/m28evk.h +5 -0
+	"addip="                                                        \
+		"setenv bootargs ${bootargs} "                          \
+			"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
+				"${hostname}:${netdev}:off\0"           \
+	"addmisc=setenv bootargs ${bootargs} ${miscargs}\0"             \
Quoted 8 lines

include/configs/m28evk.h line 219

Quoted 4 lines
include/configs/m28evk.h +4 -0
+	"adddfltmtd="                                                   \
+		"if test \"x${mtdparts}\" == \"x\" ; "                  \
+		"then mtdparts default ; "                              \
+		"fi\0"                                                  \

I suspect the addmtd should be called unconditionally for every boot type
(mmc_nfs...net_nand).

I can't currently see her which conditional case under which addmtd is running. I'll double check it for a v2. Thank you.

BR,
Lothar Rubusch

#4 lore raw

PATCH 1/1 m28evk board config

In reply to lothar at denx.de

Hi Lothar,

Quoted 7 lines · lothar at denx.de

From 24b6381162b4569ab86b481b8714d81877231f22 Mon Sep 17 00:00:00 2001
From: Lothar Rubusch <[email protected]>
Date: Fri, 6 Sep 2013 15:01:39 +0200
Subject: [PATCH] m28evk board specific configurations for setup with ext boot
partition and separate ext rootfs

Generally I think it is better you have a smaller commit subject and you increase the commit log with all changes.

However:

Quoted 24 lines
---
 include/configs/m28evk.h | 78
++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 75 insertions(+), 3 deletions(-)
include/configs/m28evk.h +2 -2
index eba8759..b65456e 100644
@@ -150,15 +150,25 @@
 #endif
 
 /* Booting Linux */
-#define CONFIG_BOOTDELAY    3
+#define CONFIG_BOOTDELAY    5
 #define CONFIG_BOOTFILE        "uImage"
 #define CONFIG_BOOTARGS        "console=ttyAMA0,115200n8 "
-#define CONFIG_BOOTCOMMAND    "run bootcmd_net"
+#define CONFIG_BOOTCOMMAND    "run mmc_mmc"
 #define CONFIG_LOADADDR        0x42000000
 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
 

include/configs/m28evk.h line 169

Quoted 10 lines
include/configs/m28evk.h +8 -0
 /* Extra Environment */
 #define CONFIG_EXTRA_ENV_SETTINGS                    \
+    "fdtfile=imx28-m28evk.dtb\0"                                    \
+    "consdev=ttyAMA0\0"                                             \
+    "baudrate=115200\0"                                             \
+    "bootdev=/dev/mmcblk0p2\0"                                      \
+    "rootdev=/dev/mmcblk0p3\0"                                      \
+    "netdev=eth0\0"                                                 \
+    "hostname=m28evk\0"                                             \
+    "rootpath=/opt/eldk-5.3/armv5te/rootfs-qte-sdk\0"               \

I know very well why, but this is against the logic that the delivered environment is quite generic for all situation. Setting rootpath is for me not different as setting ip address, that is it is a local configuration and should be not linked with the code.

Quoted 76 lines
include/configs/m28evk.h +65 -1
+    "kernel_addr_r=0x42000000\0"                                    \
+    "fdt_addr_r=0x41000000\0"                                       \
     "update_nand_full_filename=u-boot.nand\0"            \
     "update_nand_firmware_filename=u-boot.sb\0"            \
     "update_sd_firmware_filename=u-boot.sd\0"            \
@@ -196,7 +206,69 @@
         "setexpr fw_sz ${fw_sz} + 1 ; "                \
         "mmc write ${loadaddr} 0x800 ${fw_sz} ; "        \
         "fi ; "                            \
-        "fi\0"
+        "fi\0"                                                  \
+    "addcons=setenv bootargs ${bootargs}
 console=${consdev},${baudrate}\0" \
+    "addip="                                                        \
+        "setenv bootargs ${bootargs} "                          \
+            "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:" \
+                "${hostname}:${netdev}:off\0"           \
+    "addmisc=setenv bootargs ${bootargs} ${miscargs}\0"             \
+    "adddfltmtd="                                                   \
+        "if test \"x${mtdparts}\" == \"x\" ; "                  \
+        "then mtdparts default ; "                              \
+        "fi\0"                                                  \
+    "addmtd="                                                       \
+        "run adddfltmtd ; "                                     \
+        "setenv bootargs ${bootargs} ${mtdparts}\0"             \
+    "addargs=run addcons addmtd addmisc\0"                          \
+    "kernel_mmcload="                                               \
+        "mmc rescan ; "                                         \
+        "ext2load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"        \
+    "kernel_nandload=nand read ${kernel_addr_r} kernel\0"           \
+    "kernel_netload=tftp ${kernel_addr_r} ${bootfile}\0"            \
+    "fdt_mmcload="                                                  \
+        "mmc rescan ; "                                         \
+        "ext2load mmc 0:2 ${fdt_addr_r} ${fdtfile}\0"            \
+    "fdt_nandload=nand read ${fdt_addr_r} fdt\0"                    \
+    "fdt_netload=tftp ${fdt_addr_r} ${fdtfile}\0"                   \
+    "miscargs=nohlt panic=1\0"                                      \
+    "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0"         \
+    "nandargs="                                                     \
+        "setenv bootargs ubi.mtd=6 root=ubi0:rootfs "           \
+            "rootfstype=ubifs\0"                            \
+    "nfsargs="                                                      \
+        "setenv bootargs root=/dev/nfs rw "                     \
+            "nfsroot=${serverip}:${rootpath},v3,tcp\0"      \
+    "mmcload=run kernel_mmcload fdt_mmcload\0"                      \
+    "nandload=run kernel_nandload fdt_nandload\0"                   \
+    "netload=run kernel_netload fdt_netload\0"                      \
+    "mmc_nfs="                                                      \
+        "run mmcload nfsargs addip addargs ; "                  \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "mmc_mmc="                                                      \
+        "run mmcload mmcargs addargs ; "                        \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "mmc_nand="                                                     \
+        "run mmcload nandargs addargs ; "                       \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "nand_mmc="                                                     \
+        "run nandload mmcargs addargs ; "                       \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "nand_nfs="                                                     \
+        "run nandload nfsargs addip addargs ; "                 \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "nand_nand="                                                    \
+        "run nandload nandargs addargs ; "                      \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "net_mmc="                                                      \
+        "run netload mmcargs addargs ; "                        \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "net_nfs="                                                      \
+        "run netload nfsargs addip addargs ; "                  \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+    "net_nand="                                                     \
+        "run netload nandargs addargs ; "                       \
+        "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"
 
 /* The rest of the configuration is shared */
Quoted 1 line

#include <configs/mxs.h>

Even if it is smaller, I guess we fight with the same issue of Dennis' patch:

	http://patchwork.ozlabs.org/patch/261969/

that I rejected. We are moving from a a dynamic environment to a fully static environment, decided at compile time. If you read the whole thread, you can also see Wolfgang's comments about it. Generally, U-Boot is thought to be easy extendible with the environment, and each user can add his own environment on base of his needs.

However, in the last times I got al lot of changes to fix the environment - suitable for one use case. It is true, I merged most of them (shame on me !), but it seems to me that doing in this way becomes not maintainable.

In the discussion about Dennis's patch there are some proposals how to get a single image (we have plenty of tools in u-boot to get a ready to use image for the environment and to import it to set is as current one), and how to import / export the environment.

Maybe should we change the way we are adding the environment ? It should be better (*really* better) if we do not need to change the code when a variable is changed. We could maybe define a standard way (common command) to load the environment from the storage, and only this command can be put into CONFIG_EXTRA_ENV_SETTINGS. The whole environment itself will be put into a separate file(s), compiled as image and loaded when needed. The user could select which file must be loaded.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================