[U-Boot] [PATCH 0/4] 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(-)

From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com ---
include/configs/km/keymile-common.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index f3248bc..2fc1ea8 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -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

Hello Valentin,
Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:
From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com
include/configs/km/keymile-common.h | 4 ++++ 1 file changed, 4 insertions(+)
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index f3248bc..2fc1ea8 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -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

On Fri, Nov 13, 2015 at 04:15:19PM +0100, Valentin Longchamp wrote:
From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com Reviewed-by: Heiko Schocher hs@denx.de
Applied to u-boot/master, thanks!

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).
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com ---
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(-)
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 2fc1ea8..91b29b3 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -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} && " \ diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h index eb85a74..20ef036 100644 --- a/include/configs/km/km-powerpc.h +++ b/include/configs/km/km-powerpc.h @@ -79,6 +79,7 @@ " ${filesize} && " \ "protect on " __stringify(BOOTFLASH_START) " +${filesize}\0"\ "set_fdthigh=true\0" \ + "checkfdt=true\0" \ ""
#endif /* __CONFIG_KEYMILE_POWERPC_H */ diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index 15fca1a..8c18e16 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -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 */ diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index 7536cbd..540c672 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -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 \

Hello Valentin,
Am 13.11.2015 um 16:15 schrieb 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).
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com
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(-)
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h index 2fc1ea8..91b29b3 100644 --- a/include/configs/km/keymile-common.h +++ b/include/configs/km/keymile-common.h @@ -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 " \
"develop=" \ "tftp 200000 scripts/develop-${arch}.txt && " \ "env import -t 200000 ${filesize} && " \"addpanic boot\0" \
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h index eb85a74..20ef036 100644 --- a/include/configs/km/km-powerpc.h +++ b/include/configs/km/km-powerpc.h @@ -79,6 +79,7 @@ " ${filesize} && " \ "protect on " __stringify(BOOTFLASH_START) " +${filesize}\0"\ "set_fdthigh=true\0" \
"checkfdt=true\0" \ ""
#endif /* __CONFIG_KEYMILE_POWERPC_H */
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index 15fca1a..8c18e16 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -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 */
diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h index 7536cbd..540c672 100644 --- a/include/configs/km/kmp204x-common.h +++ b/include/configs/km/kmp204x-common.h @@ -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 \

On Fri, Nov 13, 2015 at 04:15:20PM +0100, Valentin Longchamp wrote:
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).
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com Reviewed-by: Heiko Schocher hs@denx.de
Applied to u-boot/master, thanks!

From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com ---
board/keymile/scripts/develop-common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt index a80812a..99a0589 100644 --- a/board/keymile/scripts/develop-common.txt +++ b/board/keymile/scripts/develop-common.txt @@ -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

Hello Valentin,
Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:
From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com
board/keymile/scripts/develop-common.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko
diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt index a80812a..99a0589 100644 --- a/board/keymile/scripts/develop-common.txt +++ b/board/keymile/scripts/develop-common.txt @@ -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

On Fri, Nov 13, 2015 at 04:15:21PM +0100, Valentin Longchamp wrote:
From: Holger Brunck holger.brunck@keymile.com
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.
Signed-off-by: Holger Brunck holger.brunck@keymile.com Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com Reviewed-by: Heiko Schocher hs@denx.de
Applied to u-boot/master, thanks!

From: Tobias Müller Tobias.Mueller@keymile.com
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.
Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com ---
board/keymile/scripts/develop-common.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt index 99a0589..265f02f 100644 --- a/board/keymile/scripts/develop-common.txt +++ b/board/keymile/scripts/develop-common.txt @@ -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

Hello Valentin,
Am 13.11.2015 um 16:15 schrieb Valentin Longchamp:
From: Tobias Müller Tobias.Mueller@keymile.com
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.
Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com
board/keymile/scripts/develop-common.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Heiko Schocher hs@denx.de
bye, Heiko
diff --git a/board/keymile/scripts/develop-common.txt b/board/keymile/scripts/develop-common.txt index 99a0589..265f02f 100644 --- a/board/keymile/scripts/develop-common.txt +++ b/board/keymile/scripts/develop-common.txt @@ -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

On Fri, Nov 13, 2015 at 04:15:22PM +0100, Valentin Longchamp wrote:
From: Tobias Müller Tobias.Mueller@keymile.com
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.
Signed-off-by: Tobias Müller Tobias.Mueller@keymile.com Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com Reviewed-by: Heiko Schocher hs@denx.de
Applied to u-boot/master, thanks!
participants (3)
-
Heiko Schocher
-
Tom Rini
-
Valentin Longchamp