Skip to contentSkip to conversation

Keymile common changes

PATCH New Valentin Longchamp 3 participants 13 messages Nov 13, 2015 – Nov 18, 2015

lore
Share & tools
lore
#0 lore raw

cover Keymile common changes

This is the last part of the changes for the Keymile boards. This series contains all the changes that are common to all boards and architectures (that's why they are sent as an independant series) and mostly target our environment scripts.

Holger Brunck (2):
km/common: stop u-boot only if someone press <SPACE> km/scripts: load fdt_bid_kwkey.dtb when working with tftp

Tobias M?ller (1):
km/scripts: search for kernel/DTBs at serverip:/PRODUCTNAME via TFTP
in develop mode

Valentin Longchamp (1):
km: update the boot script to check for a DTB

 board/keymile/scripts/develop-common.txt | 6 +++---
 include/configs/km/keymile-common.h      | 9 +++++++--
 include/configs/km/km-powerpc.h          | 1 +
 include/configs/km/km_arm.h              | 6 ++++++
 include/configs/km/kmp204x-common.h      | 1 +
 5 files changed, 18 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/4 km/common: stop u-boot only if someone press <SPACE>

From: Holger Brunck <[email protected]>

To prevent u-boot to stop accidently e.g. due to line noise on the serial line, we now use the option CONFIG_AUTOBOOT_KEYED. We choose the <SPACE> key for this.

---

 include/configs/km/keymile-common.h | 4 ++++
 1 file changed, 4 insertions(+)
include/configs/km/keymile-common.h +4 -0
index f3248bc..2fc1ea8 100644
@@ -56,6 +56,10 @@
 #define CONFIG_LOADS_ECHO
 #define CONFIG_SYS_LOADS_BAUD_CHANGE
 
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_PROMPT "Hit <SPACE> key to stop autoboot in %2ds\n"
+#define CONFIG_AUTOBOOT_STOP_STR        " "
+
 /* Support the IVM EEprom */
 #define	CONFIG_SYS_IVM_EEPROM_ADR	0x50
 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN	0x400
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/4 km/common: stop u-boot only if someone press <SPACE>

Hello Valentin,

Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:

Quoted 6 lines

From: Holger Brunck <[email protected]>

To prevent u-boot to stop accidently e.g. due to line noise on the serial line, we now use the option CONFIG_AUTOBOOT_KEYED. We choose the <SPACE> key for this.

Quoted 6 lines

---

  include/configs/km/keymile-common.h | 4 ++++
  1 file changed, 4 insertions(+)

bye,
Heiko

Quoted 17 lines
include/configs/km/keymile-common.h +4 -0
index f3248bc..2fc1ea8 100644
@@ -56,6 +56,10 @@
  #define CONFIG_LOADS_ECHO
  #define CONFIG_SYS_LOADS_BAUD_CHANGE
 
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_PROMPT "Hit <SPACE> key to stop autoboot in %2ds\n"
+#define CONFIG_AUTOBOOT_STOP_STR        " "
+
  /* Support the IVM EEprom */
  #define	CONFIG_SYS_IVM_EEPROM_ADR	0x50
  #define CONFIG_SYS_IVM_EEPROM_MAX_LEN	0x400
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH 1/4 km/common: stop u-boot only if someone press <SPACE>

In reply to Valentin Longchamp
Quoted 9 lines · Valentin Longchamp

From: Holger Brunck <[email protected]>

To prevent u-boot to stop accidently e.g. due to line noise on the serial line, we now use the option CONFIG_AUTOBOOT_KEYED. We choose the <SPACE> key for this.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151118/f8f3ff8d/attachment.sig>
#4 lore raw

PATCH 2/4 km: update the boot script to check for a DTB

In reply to Valentin Longchamp

If a DTB is found with cramfsls, the bootscript continues as expected. If none is found, the cramfsloadfdt and boot subbootcmds are updated to not load the DTB from cramfs and not pass it to the kernel. The kernel thus must have an appended DTB otherwise the boot will fail.

This is required for the km_kirkwood boards that must support .esw where the DTB sometimes is appended (for backwards compatibility) and sometimes is passed correctly (as we do now for all newer boards).

---

 include/configs/km/keymile-common.h | 5 +++--
 include/configs/km/km-powerpc.h     | 1 +
 include/configs/km/km_arm.h         | 6 ++++++
 include/configs/km/kmp204x-common.h | 1 +
 4 files changed, 11 insertions(+), 2 deletions(-)
include/configs/km/keymile-common.h +3 -2
index 2fc1ea8..91b29b3 100644
@@ -141,8 +141,9 @@
  * - 'release': for a standalone system		kernel/rootfs from flash
  */
 #define CONFIG_KM_DEF_ENV_BOOTTARGETS					\
-	"subbootcmds=ubiattach ubicopy cramfsloadfdt set_fdthigh "	\
-		"cramfsloadkernel flashargs add_default addpanic boot\0"\
+	"subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt "		\
+		"set_fdthigh cramfsloadkernel flashargs add_default "	\
+		"addpanic boot\0"					\
 	"develop="							\
 		"tftp 200000 scripts/develop-${arch}.txt && "		\
 		"env import -t 200000 ${filesize} && "			\
include/configs/km/km-powerpc.h +1 -0
index eb85a74..20ef036 100644
@@ -79,6 +79,7 @@
 		"  ${filesize} && "					\
 		"protect on " __stringify(BOOTFLASH_START) "  +${filesize}\0"\
 	"set_fdthigh=true\0"						\
+	"checkfdt=true\0"						\
 	""
 
 #endif /* __CONFIG_KEYMILE_POWERPC_H */
include/configs/km/km_arm.h +6 -0
index 15fca1a..8c18e16 100644
@@ -83,6 +83,12 @@
 	"u-boot="__stringify(CONFIG_HOSTNAME) "/u-boot.kwb\0"		\
 	CONFIG_KM_UPDATE_UBOOT						\
 	"set_fdthigh=setenv fdt_high ${kernelmem}\0"			\
+	"checkfdt="							\
+		"if cramfsls fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; "	\
+		"then true; else setenv cramfsloadfdt true; "		\
+		"setenv boot bootm ${load_addr_r}; "			\
+		"echo No FDT found, booting with the kernel "		\
+		"appended one; fi\0"					\
 	""
 
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
include/configs/km/kmp204x-common.h +1 -0
index 7536cbd..540c672 100644
@@ -458,6 +458,7 @@ int get_scl(void);
 		"sf probe 0;sf erase 0 +${filesize};"			\
 		"sf write ${load_addr_r} 0 ${filesize};\0"		\
 	"set_fdthigh=true\0"						\
+	"checkfdt=true\0"						\
 	""
 
 #define CONFIG_HW_ENV_SETTINGS						\
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 2/4 km: update the boot script to check for a DTB

Hello Valentin,

Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:

Quoted 9 lines

If a DTB is found with cramfsls, the bootscript continues as expected. If none is found, the cramfsloadfdt and boot subbootcmds are updated to not load the DTB from cramfs and not pass it to the kernel. The kernel thus must have an appended DTB otherwise the boot will fail.

This is required for the km_kirkwood boards that must support .esw where the DTB sometimes is appended (for backwards compatibility) and sometimes is passed correctly (as we do now for all newer boards).

Quoted 8 lines

---

  include/configs/km/keymile-common.h | 5 +++--
  include/configs/km/km-powerpc.h     | 1 +
  include/configs/km/km_arm.h         | 6 ++++++
  include/configs/km/kmp204x-common.h | 1 +
  4 files changed, 11 insertions(+), 2 deletions(-)

bye,
Heiko

Quoted 59 lines
include/configs/km/keymile-common.h +3 -2
index 2fc1ea8..91b29b3 100644
@@ -141,8 +141,9 @@
   * - 'release': for a standalone system		kernel/rootfs from flash
   */
  #define CONFIG_KM_DEF_ENV_BOOTTARGETS					\
-	"subbootcmds=ubiattach ubicopy cramfsloadfdt set_fdthigh "	\
-		"cramfsloadkernel flashargs add_default addpanic boot\0"\
+	"subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt "		\
+		"set_fdthigh cramfsloadkernel flashargs add_default "	\
+		"addpanic boot\0"					\
  	"develop="							\
  		"tftp 200000 scripts/develop-${arch}.txt && "		\
  		"env import -t 200000 ${filesize} && "			\
include/configs/km/km-powerpc.h +1 -0
index eb85a74..20ef036 100644
@@ -79,6 +79,7 @@
  		"  ${filesize} && "					\
  		"protect on " __stringify(BOOTFLASH_START) "  +${filesize}\0"\
  	"set_fdthigh=true\0"						\
+	"checkfdt=true\0"						\
  	""
 
  #endif /* __CONFIG_KEYMILE_POWERPC_H */
include/configs/km/km_arm.h +6 -0
index 15fca1a..8c18e16 100644
@@ -83,6 +83,12 @@
  	"u-boot="__stringify(CONFIG_HOSTNAME) "/u-boot.kwb\0"		\
  	CONFIG_KM_UPDATE_UBOOT						\
  	"set_fdthigh=setenv fdt_high ${kernelmem}\0"			\
+	"checkfdt="							\
+		"if cramfsls fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; "	\
+		"then true; else setenv cramfsloadfdt true; "		\
+		"setenv boot bootm ${load_addr_r}; "			\
+		"echo No FDT found, booting with the kernel "		\
+		"appended one; fi\0"					\
  	""
 
  #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
include/configs/km/kmp204x-common.h +1 -0
index 7536cbd..540c672 100644
@@ -458,6 +458,7 @@ int get_scl(void);
  		"sf probe 0;sf erase 0 +${filesize};"			\
  		"sf write ${load_addr_r} 0 ${filesize};\0"		\
  	"set_fdthigh=true\0"						\
+	"checkfdt=true\0"						\
  	""
 
  #define CONFIG_HW_ENV_SETTINGS						\
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw

PATCH 2/4 km: update the boot script to check for a DTB

In reply to Valentin Longchamp
Quoted 11 lines · Valentin Longchamp

If a DTB is found with cramfsls, the bootscript continues as expected. If none is found, the cramfsloadfdt and boot subbootcmds are updated to not load the DTB from cramfs and not pass it to the kernel. The kernel thus must have an appended DTB otherwise the boot will fail.

This is required for the km_kirkwood boards that must support .esw where the DTB sometimes is appended (for backwards compatibility) and sometimes is passed correctly (as we do now for all newer boards).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151118/1900064c/attachment.sig>
#7 lore raw

PATCH 3/4 km/scripts: load fdt_bid_kwkey.dtb when working with tftp

In reply to Valentin Longchamp

From: Holger Brunck <[email protected]>

When loading the dtb file via tftp we should load the one which matches boardId and hwKey and not a common one for the boardname. We have boards were different hwKeys are used and then we may load an incorrect dtb file. If no fdt_bid_kwkey.dtb file is not a fallback to boardname.dtb is used.

---

 board/keymile/scripts/develop-common.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/keymile/scripts/develop-common.txt +1 -1
index a80812a..99a0589 100644
@@ -3,7 +3,7 @@ bootcmd=run ${subbootcmds}
 configure=run set_uimage; km_setboardid && saveenv && reset
 subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
 nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
-tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${hostname}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; fi; else true; fi
 tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
 toolchain=/opt/eldk
 rootfssize=0
Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 3/4 km/scripts: load fdt_bid_kwkey.dtb when working with tftp

Hello Valentin,

Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:

Quoted 7 lines

From: Holger Brunck <[email protected]>

When loading the dtb file via tftp we should load the one which matches boardId and hwKey and not a common one for the boardname. We have boards were different hwKeys are used and then we may load an incorrect dtb file. If no fdt_bid_kwkey.dtb file is not a fallback to boardname.dtb is used.

Quoted 7 lines

---

  board/keymile/scripts/develop-common.txt | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

bye,
Heiko

Quoted 15 lines
board/keymile/scripts/develop-common.txt +1 -1
index a80812a..99a0589 100644
@@ -3,7 +3,7 @@ bootcmd=run ${subbootcmds}
  configure=run set_uimage; km_setboardid && saveenv && reset
  subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
  nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
-tftpfdt=if run set_fdthigh || test ${arch} != arm; then tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; else true; fi
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${hostname}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; fi; else true; fi
  tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
  toolchain=/opt/eldk
  rootfssize=0
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#9 lore raw

PATCH 3/4 km/scripts: load fdt_bid_kwkey.dtb when working with tftp

In reply to Valentin Longchamp
Quoted 11 lines · Valentin Longchamp

From: Holger Brunck <[email protected]>

When loading the dtb file via tftp we should load the one which matches boardId and hwKey and not a common one for the boardname. We have boards were different hwKeys are used and then we may load an incorrect dtb file. If no fdt_bid_kwkey.dtb file is not a fallback to boardname.dtb is used.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151118/32f1da84/attachment.sig>
#10 lore raw

PATCH 4/4 km/scripts: search for kernel/DTBs at serverip:/PRODUCTNAME via TFTP in develop mode

In reply to Valentin Longchamp

From: Tobias M?ller <[email protected]>

Search for the kernel and DTBs in a folder named PRODUCTNAME (found in the IVM) at the TFTP server instead of the u-boot boardname.

---

 board/keymile/scripts/develop-common.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
board/keymile/scripts/develop-common.txt +3 -3
index 99a0589..265f02f 100644
@@ -1,10 +1,10 @@
 altbootcmd=run ${subbootcmds}
 bootcmd=run ${subbootcmds}
-configure=run set_uimage; km_setboardid && saveenv && reset
+configure=run set_uimage; setenv tftppath ${IVM_Symbol} ; km_setboardid && saveenv && reset
 subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
 nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
-tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${hostname}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; fi; else true; fi
-tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${tftppath}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${tftppath}/${hostname}.dtb; fi; else true; fi
+tftpkernel=tftpboot ${load_addr_r} ${tftppath}/${uimage}
 toolchain=/opt/eldk
 rootfssize=0
 set_uimage=printenv uimage || setenv uimage uImage
Signature · 1 line
1.8.3.1
#11 lore raw

PATCH 4/4 km/scripts: search for kernel/DTBs at serverip:/PRODUCTNAME via TFTP in develop mode

Hello Valentin,

Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:

Quoted 11 lines

From: Tobias M?ller <[email protected]>

Search for the kernel and DTBs in a folder named PRODUCTNAME (found in the IVM) at the TFTP server instead of the u-boot boardname.

---

  board/keymile/scripts/develop-common.txt | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

bye,
Heiko

Quoted 20 lines
board/keymile/scripts/develop-common.txt +3 -3
index 99a0589..265f02f 100644
@@ -1,10 +1,10 @@
  altbootcmd=run ${subbootcmds}
  bootcmd=run ${subbootcmds}
-configure=run set_uimage; km_setboardid && saveenv && reset
+configure=run set_uimage; setenv tftppath ${IVM_Symbol} ; km_setboardid && saveenv && reset
  subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
  nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
-tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${hostname}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${hostname}/${hostname}.dtb; fi; else true; fi
-tftpkernel=tftpboot ${load_addr_r} ${hostname}/${uimage}
+tftpfdt=if run set_fdthigh || test ${arch} != arm; then if tftpboot ${fdt_addr_r} ${tftppath}/fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb; then; else tftpboot ${fdt_addr_r} ${tftppath}/${hostname}.dtb; fi; else true; fi
+tftpkernel=tftpboot ${load_addr_r} ${tftppath}/${uimage}
  toolchain=/opt/eldk
  rootfssize=0
  set_uimage=printenv uimage || setenv uimage uImage
Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#12 lore raw

PATCH 4/4 km/scripts: search for kernel/DTBs at serverip:/PRODUCTNAME via TFTP in develop mode

In reply to Valentin Longchamp
Quoted 8 lines · Valentin Longchamp

From: Tobias M?ller <[email protected]>

Search for the kernel and DTBs in a folder named PRODUCTNAME (found in the IVM) at the TFTP server instead of the u-boot boardname.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151118/2e048af7/attachment.sig>