nitrogen6x : Use generic distro configuration
PATCH 1/1 nitrogen6x : Use generic distro configuration
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in /boot/. Then create /boot/extlinux/extlinux.conf with for example:
default Buildroot
label Buildroot
kernel /boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /boot
--- configs/mx6qsabrelite_defconfig | 1 + configs/nitrogen6dl2g_defconfig | 1 + configs/nitrogen6dl_defconfig | 1 + configs/nitrogen6q2g_defconfig | 1 + configs/nitrogen6q_defconfig | 1 + configs/nitrogen6s1g_defconfig | 1 + configs/nitrogen6s_defconfig | 1 + doc/README.imx6 | 47 +++++++++++ include/configs/mx6_common.h | 28 +++++++ include/configs/nitrogen6x.h | 169 ++++------------------------------------ 10 files changed, 97 insertions(+), 154 deletions(-)
configs/mx6qsabrelite_defconfig +1 -0
@@ -36,3 +36,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s1g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
doc/README.imx6 +47 -0
50 lines not on this page · raw message
include/configs/mx6_common.h +28 -0
@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000 +#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE
@@ -93,4 +99,26 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> + +#ifndef CONFIG_FDTFILE +#define CONFIG_FDTFILE "undefined" +#endif + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif
include/configs/nitrogen6x.h +15 -154
195 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 1/1 nitrogen6x : Use generic distro configuration
Quoted 16 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>
...
Quoted 8 lines
(quoted diff) +1
-0+include/configs/mx6_common.h +3
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \
include/configs/mx6_common.h line 123
Quoted 10 lines
include/configs/mx6_common.h +10
-0+ "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +
This should probably be called something like CONFIG_EXTRA_DEFAULT_ENV_SETTINGS and the board files could contain
#define CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ "extra=more stuff\0" \
I would not remove any environment variables in this patch except for redundant things.
PATCH 1/1 nitrogen6x : Use generic distro configuration
Quoted 39 lines · Troy Kisky
Quoted 16 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>...
Quoted 8 lines
(quoted diff) +1
-0+include/configs/mx6_common.h +3
-0+#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \include/configs/mx6_common.h line 123
Quoted 10 lines
include/configs/mx6_common.h +10
-0+ "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +This should probably be called something like
CONFIG_EXTRA_DEFAULT_ENV_SETTINGSand the board files could contain
Quoted 6 lines
#define CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ "extra=more stuff\0" \I would not remove any environment variables in this patch except for redundant things.
Hello Troy
Thank you for your reply.
I think that all variables defined in CONFIG_EXTRA_ENV_SETTINGS are redundant with the generic distro configuration feature (except for ums). That's why I thought to replace this variable.
Advantages of this feature is:
- to boot any distro on any media
- have more common code between imx6 boards
- manage more media than current settings
- use more generic configuration (extlinux.conf)
I will prepare a new patch in order to keep current settings and set generic distro only if CONFIG_DISTRO_DEFAULTS=y
Is it ok for you?
Thanks
Fabien
PATCH v2 1/1 nitrogen6x : Use generic distro configuration
In reply to Troy KiskyIn order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in /boot/. Then create /boot/extlinux/extlinux.conf with for example:
default Buildroot
label Buildroot
kernel /boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /boot
---
Changes for V2:
- reintegration of deleted env
- changes are applied only if CONFIG_DISTRO_DEFAULTS=y
configs/mx6qsabrelite_defconfig | 1 + configs/nitrogen6dl2g_defconfig | 1 + configs/nitrogen6dl_defconfig | 1 + configs/nitrogen6q2g_defconfig | 1 + configs/nitrogen6q_defconfig | 1 + configs/nitrogen6s1g_defconfig | 1 + configs/nitrogen6s_defconfig | 1 + doc/README.imx6 | 47 +++++++++++++++++++++++++++++++++++++++++ include/configs/mx6_common.h | 28 ++++++++++++++++++++++++ include/configs/nitrogen6x.h | 35 ++++++++++++++++++++++++------ 10 files changed, 111 insertions(+), 6 deletions(-)
configs/mx6qsabrelite_defconfig +1 -0
@@ -36,3 +36,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s1g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
doc/README.imx6 +47 -0
50 lines not on this page · raw message
include/configs/mx6_common.h +28 -0
@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000 +#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE
@@ -93,4 +99,26 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> + +#ifndef CONFIG_FDTFILE +#define CONFIG_FDTFILE "undefined" +#endif + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif
include/configs/nitrogen6x.h +29 -6
@@ -10,8 +10,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#include "mx6_common.h" -#define CONFIG_MACH_TYPE 3769/* Size of malloc() pool */
@@ -38,9 +36,9 @@/* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ +#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ #define CONFIG_SYS_I2C_SPEED 100000#define CONFIG_I2C_EDID
@@ -113,6 +111,8 @@#define CONFIG_PREBOOT "" +#ifndef CONFIG_DISTRO_DEFAULTS +#ifdef CONFIG_CMD_SATA #define CONFIG_DRIVE_SATA "sata "#else
@@ -266,6 +266,29 @@ "done\0" \#endif + +#else +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb" +#else +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb" +#endif + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +#define CONFIG_EXTRA_ENV_SETTINGS \ + CONFIG_EXTRA_DEFAULT_ENV_SETTINGS + +#endif + +#include "mx6_common.h" +/* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x10000000#define CONFIG_SYS_MEMTEST_END 0x10010000
@@ -327,4 +350,4 @@#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 -#endif /* __CONFIG_H */ +#endif /* __CONFIG_H */
Signature · 1 line
2.1.4
PATCH 1/1 nitrogen6x : Use generic distro configuration
In reply to Fabien LahoudereQuoted 40 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>---
?include/configs/mx6_common.h +0
-0@@ -58,6 +58,12 @@?#endif
?#endif
?#defineCONFIG_SYS_LOAD_ADDRCONFIG_LOADADDRinclude/configs/mx6_common.h +6
-0+#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000 +#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif ?
?/* allow to overwrite serial and ethaddr */
?#defineCONFIG_ENV_OVERWRITEinclude/configs/mx6_common.h +0
-0@@ -93,4 +99,26 @@?#define
CONFIG_CMD_FUSE
?#defineCONFIG_MXC_OCOTP
?
include/configs/mx6_common.h line 103
Quoted 2 lines
include/configs/mx6_common.h +2
-0+#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h>
Why a configure option for using the default distro options rather then just always using them??
Note that you can use the defaults without enforcing distro_bootcmd usage. (Though it would be good to get some consistent boot setup on all the mx6 devices ofcourse)
include/configs/mx6_common.h line 107
Quoted 3 lines
include/configs/mx6_common.h +3
-0+#ifndef CONFIG_FDTFILE +#define CONFIG_FDTFILE "undefined" +#endif
Not having an fdt is bad when using distro boot commands, probably better to error here.
Quoted 143 lines
include/configs/mx6_common.h +15
-0+#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0"??\ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"??\ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +?#endif
include/configs/nitrogen6x.h +0
-0@@ -10,8 +10,6 @@?#ifndef
__CONFIG_H
?#define__CONFIG_H
?include/configs/nitrogen6x.h +0
-2-#include "mx6_common.h" -?#define
CONFIG_MACH_TYPE3769
?
?/* Size ofmalloc()pool */include/configs/nitrogen6x.h +0
-0@@ -38,9 +36,9 @@?/* I2C Configs */
?#defineCONFIG_SYS_I2C
?#defineCONFIG_SYS_I2C_MXC
-#defineCONFIG_SYS_I2C_MXC_I2C1/* enable I2C bus 1
*/
-#defineCONFIG_SYS_I2C_MXC_I2C2/* enable I2C bus 2
*/
-#defineCONFIG_SYS_I2C_MXC_I2C3/* enable I2C bus 3
*/include/configs/nitrogen6x.h +3
-0+#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ ?#define
CONFIG_SYS_I2C_SPEED100000
?#defineCONFIG_I2C_EDID
?include/configs/nitrogen6x.h +0
-0@@ -113,159 +111,22 @@?
?#defineCONFIG_PREBOOT?????????????????""
?include/configs/nitrogen6x.h +2
-14-#ifdef CONFIG_CMD_SATA -#define CONFIG_DRIVE_SATA "sata " -#else -#define CONFIG_DRIVE_SATA -#endif - -#ifdef CONFIG_CMD_MMC -#define CONFIG_DRIVE_MMC "mmc " -#else -#define CONFIG_DRIVE_MMC -#endif - -#ifdef CONFIG_USB_STORAGE -#define CONFIG_DRIVE_USB "usb " +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb"?#else
include/configs/nitrogen6x.h +1
-1-#define CONFIG_DRIVE_USB +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb"?#endif
?
-#defineCONFIG_DRIVE_TYPESCONFIG_DRIVE_SATACONFIG_DRIVE_MMCCONFIG_DRIVE_USBinclude/configs/nitrogen6x.h +0
-20-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC - -#if defined(CONFIG_SABRELITE ) -#define CONFIG_EXTRA_ENV_SETTINGS \ - "script=boot.scr\0" \ - "uimage=uImage\0" \ - "console=ttymxc1\0" \ - "fdt_high=0xffffffff\0" \ - "initrd_high=0xffffffff\0" \ - "fdt_file=imx6q-sabrelite.dtb\0" \ - "fdt_addr=0x18000000\0" \ - "boot_fdt=try\0" \ - "ip_dyn=yes\0" \ - "mmcdevs=0 1\0" \ - "mmcpart=1\0" \ - "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ - "mmcargs=setenv bootargs console=${console},${baudrate} " \ - "root=${mmcroot}\0" \ - "loadbootscript=" \ - "load mmc ${mmcdev}:${mmcpart} ${loadaddr}${script};\0" \
include/configs/nitrogen6x.h +0
-3-"bootscript=echo Running bootscript from mmc ...; " \ -"source\0" \ - "loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr}${uimage}\0" \
include/configs/nitrogen6x.h +0
-1- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr}${fdt_file}\0" \
include/configs/nitrogen6x.h +0
-3-"mmcboot=echo Booting from mmc ...; " \ -"run mmcargs; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} =try; then " \
include/configs/nitrogen6x.h +0
-2-"if run loadfdt; then " \ -"bootm ${loadaddr} - ${fdt_addr}; " \
include/configs/nitrogen6x.h +0
-5-"else " \ -"if test ${boot_fdt} = try; then " \ -"bootm; " \ -"else " \ - "echo WARN: Cannot load theDT; " \
include/configs/nitrogen6x.h +0
-17-"fi; " \ -"fi; " \ -"else " \ -"bootm; " \ -"fi;\0" \ -"netargs=setenv bootargs console=${console},${baudrate} " \ -"root=/dev/nfs " \ -"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ -"netboot=echo Booting from net ...; " \ -"run netargs; " \ -"if test ${ip_dyn} = yes; then " \ -"setenv get_cmd dhcp; " \ -"else " \ -"setenv get_cmd tftp; " \ -"fi; " \ -"${get_cmd} ${uimage}; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} =try; then " \
include/configs/nitrogen6x.h +0
-1- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then" \
include/configs/nitrogen6x.h +0
-1-"bootm ${loadaddr} - ${fdt_addr}; " \
include/configs/nitrogen6x.h +0
-5-"else " \ -"if test ${boot_fdt} = try; then " \ -"bootm; " \ -"else " \ - "echo WARN: Cannot load theDT; " \
include/configs/nitrogen6x.h +0
-2-"fi; " \ -"fi; " \
include/configs/nitrogen6x.h line 126
Quoted 10 lines
include/configs/nitrogen6x.h +7
-3-"else " \ -"bootm; " \ -"fi;\0" +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na)
You probably don't want to toss out all the legacy boot stuff. See commit?bc3199fd1875f89e9e1fb2af45665c4a718217b9 for an example of how to integrate older hardcoded boot commands with the distro boot commands.
Do take special care about the ordering, It's probably undesirable to have attempts for network booting happening before e.g. trying to do an upgrade.
Quoted 1 line
?
Signature · 2 lines
Sjoerd Simons Collabora Ltd.
PATCH 1/1 nitrogen6x : Use generic distro configuration
Quoted 47 lines · Sjoerd Simons
Quoted 37 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>---
include/configs/mx6_common.h +6
-0@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000 +#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE include/configs/mx6_common.h line 103
Quoted 5 lines
include/configs/mx6_common.h +2
-0@@ -93,4 +99,26 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> Why a configure option for using the default distro options rather then just always using them?
Quoted 3 lines
Note that you can use the defaults without enforcing
distro_bootcmdusage. (Though it would be good to get some consistent boot setup on all the mx6 devices ofcourse)
Because #include <config_distro_defaults.h> need CONFIG_DISTRO_DEFAULTS=y else it does not compile.
And keeping this configure option will let the end user chose u-boot behaviour without having an heavy env.
Quoted 8 lines
include/configs/mx6_common.h line 107
Quoted 4 lines
include/configs/mx6_common.h +3
-0+#ifndef CONFIG_FDTFILE +#define CONFIG_FDTFILE "undefined" +#endif Not having an fdt is bad when using distro boot commands, probably better to error here.
Ok. I agree and I will fix this.
Quoted 159 lines
Quoted 143 lines
include/configs/mx6_common.h +15
-0+#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif include/configs/nitrogen6x.h +3
-5@@ -10,8 +10,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#include "mx6_common.h" -#define CONFIG_MACH_TYPE 3769/* Size of malloc() pool */ @@ -38,9 +36,9 @@/* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ +#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ #define
CONFIG_SYS_I2C_SPEED100000
#defineCONFIG_I2C_EDIDinclude/configs/nitrogen6x.h +3
-16@@ -113,159 +111,22 @@#define CONFIG_PREBOOT "" -#ifdef CONFIG_CMD_SATA -#define CONFIG_DRIVE_SATA "sata " -#else -#define CONFIG_DRIVE_SATA -#endif - -#ifdef CONFIG_CMD_MMC -#define CONFIG_DRIVE_MMC "mmc " -#else -#define CONFIG_DRIVE_MMC -#endif - -#ifdef CONFIG_USB_STORAGE -#define CONFIG_DRIVE_USB "usb " +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb"#else -#define CONFIG_DRIVE_USB +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb"#endif -#define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
CONFIG_DRIVE_USBinclude/configs/nitrogen6x.h +0
-20-#define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC - -#if defined(CONFIG_SABRELITE ) -#define CONFIG_EXTRA_ENV_SETTINGS \ - "script=boot.scr\0" \ - "uimage=uImage\0" \ - "console=ttymxc1\0" \ - "fdt_high=0xffffffff\0" \ - "initrd_high=0xffffffff\0" \ - "fdt_file=imx6q-sabrelite.dtb\0" \ - "fdt_addr=0x18000000\0" \ - "boot_fdt=try\0" \ - "ip_dyn=yes\0" \ - "mmcdevs=0 1\0" \ - "mmcpart=1\0" \ - "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ - "mmcargs=setenv bootargs console=${console},${baudrate} " \ - "root=${mmcroot}\0" \ - "loadbootscript=" \ - "load mmc ${mmcdev}:${mmcpart} ${loadaddr}${script};\0" \
include/configs/nitrogen6x.h +0
-3-"bootscript=echo Running bootscript from mmc ...; " \ -"source\0" \ - "loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr}${uimage}\0" \
include/configs/nitrogen6x.h +0
-1- "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr}${fdt_file}\0" \
include/configs/nitrogen6x.h +0
-3-"mmcboot=echo Booting from mmc ...; " \ -"run mmcargs; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} =try; then " \
include/configs/nitrogen6x.h +0
-2-"if run loadfdt; then " \ -"bootm ${loadaddr} - ${fdt_addr}; " \
include/configs/nitrogen6x.h +0
-5-"else " \ -"if test ${boot_fdt} = try; then " \ -"bootm; " \ -"else " \ - "echo WARN: Cannot load theDT; " \
include/configs/nitrogen6x.h +0
-17-"fi; " \ -"fi; " \ -"else " \ -"bootm; " \ -"fi;\0" \ -"netargs=setenv bootargs console=${console},${baudrate} " \ -"root=/dev/nfs " \ -"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ -"netboot=echo Booting from net ...; " \ -"run netargs; " \ -"if test ${ip_dyn} = yes; then " \ -"setenv get_cmd dhcp; " \ -"else " \ -"setenv get_cmd tftp; " \ -"fi; " \ -"${get_cmd} ${uimage}; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} =try; then " \
include/configs/nitrogen6x.h +0
-1- "if ${get_cmd} ${fdt_addr} ${fdt_file}; then" \
include/configs/nitrogen6x.h +0
-1-"bootm ${loadaddr} - ${fdt_addr}; " \
include/configs/nitrogen6x.h +0
-5-"else " \ -"if test ${boot_fdt} = try; then " \ -"bootm; " \ -"else " \ - "echo WARN: Cannot load theDT; " \
include/configs/nitrogen6x.h +0
-2-"fi; " \ -"fi; " \include/configs/nitrogen6x.h line 126
Quoted 10 lines
include/configs/nitrogen6x.h +7
-3-"else " \ -"bootm; " \ -"fi;\0" +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na)You probably don't want to toss out all the legacy boot stuff. See commit
bc3199fd1875f89e9e1fb2af45665c4a718217b9for an example of how to integrate older hardcoded boot commands with the distro boot commands.
Quoted 4 lines
Do take special care about the ordering, It's probably undesirable to have attempts for network booting happening before e.g. trying to do an upgrade.
Yes I see the commit but the problem with the nitrogen6x.h is that there is two different env. So if we add LEGACY_MMC, we need to redefine mmcboot depending on what board is used. The goal is to simplify so I prefer not to add this legacy stuff.
I you think it is mandatory, I can add it and redefine mmcboot if necessary.
PATCH v3 1/1 nitrogen6x : Use generic distro configuration
In reply to Sjoerd SimonsIn order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in /boot/. Then create /boot/extlinux/extlinux.conf with for example:
default Buildroot
label Buildroot
kernel /boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /boot
---
Changes for V2:
- reintegration of deleted env
- changes are applied only if CONFIG_DISTRO_DEFAULTS=y
Changes for V3:
- remove undefined device tree
configs/mx6qsabrelite_defconfig | 1 + configs/nitrogen6dl2g_defconfig | 1 + configs/nitrogen6dl_defconfig | 1 + configs/nitrogen6q2g_defconfig | 1 + configs/nitrogen6q_defconfig | 1 + configs/nitrogen6s1g_defconfig | 1 + configs/nitrogen6s_defconfig | 1 + doc/README.imx6 | 47 +++++++++++++++++++++++++++++++++++++++++ include/configs/mx6_common.h | 24 +++++++++++++++++++++ include/configs/nitrogen6x.h | 36 +++++++++++++++++++++++++------ 10 files changed, 108 insertions(+), 6 deletions(-)
configs/mx6qsabrelite_defconfig +1 -0
@@ -36,3 +36,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6dl_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q2g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6q_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s1g_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
configs/nitrogen6s_defconfig +1 -0
@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=y
doc/README.imx6 +47 -0
50 lines not on this page · raw message
include/configs/mx6_common.h +24 -0
@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000 +#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE
@@ -93,4 +99,22 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif
include/configs/nitrogen6x.h +30 -6
@@ -10,8 +10,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#include "mx6_common.h" -#define CONFIG_MACH_TYPE 3769/* Size of malloc() pool */
@@ -38,9 +36,9 @@/* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ +#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ #define CONFIG_SYS_I2C_SPEED 100000#define CONFIG_I2C_EDID
@@ -113,6 +111,8 @@#define CONFIG_PREBOOT "" +#ifndef CONFIG_DISTRO_DEFAULTS +#ifdef CONFIG_CMD_SATA #define CONFIG_DRIVE_SATA "sata "#else
@@ -266,6 +266,30 @@ "done\0" \#endif + +#else + +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb" +#else +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb" +#endif + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +#define CONFIG_EXTRA_ENV_SETTINGS \ + CONFIG_EXTRA_DEFAULT_ENV_SETTINGS + +#endif + +#include "mx6_common.h" +/* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x10000000#define CONFIG_SYS_MEMTEST_END 0x10010000
@@ -327,4 +351,4 @@#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 -#endif /* __CONFIG_H */ +#endif /* __CONFIG_H */
Signature · 1 line
2.1.4
PATCH v3 1/1 nitrogen6x : Use generic distro configuration
Hi Fabien,
Quoted 166 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>---
Changes for V2:
- reintegration of deleted env
- changes are applied only ifCONFIG_DISTRO_DEFAULTS=yChanges for V3:
- remove undefined device treeconfigs/mx6qsabrelite_defconfig | 1 + configs/nitrogen6dl2g_defconfig | 1 + configs/nitrogen6dl_defconfig | 1 + configs/nitrogen6q2g_defconfig | 1 + configs/nitrogen6q_defconfig | 1 + configs/nitrogen6s1g_defconfig | 1 + configs/nitrogen6s_defconfig | 1 + doc/README.imx6 | 47 +++++++++++++++++++++++++++++++++++++++++ include/configs/mx6_common.h | 24 +++++++++++++++++++++ include/configs/nitrogen6x.h | 36 +++++++++++++++++++++++++------ 10 files changed, 108 insertions(+), 6 deletions(-)configs/mx6qsabrelite_defconfig +1
-0@@ -36,3 +36,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6dl2g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6dl_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6q2g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6q_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6s1g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6s_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=ydoc/README.imx6 +47
-0@@ -138,3 +138,50 @@ c The last "c" command tells kermit (from ckermit package in most distros) to switch from command line mode to communication mode, and when the script is finished, the U-Boot prompt is shown in the same shell. + +3. Using generic distro configuration +------------------------------------- + +In order to simplify the use of various images on various media +for imx6 boards, the configuration of the board must follow the +generic distro configuration (doc/README.distro). + +3.1. Setup uboot configuration for your board +--------------------------------------------- + +First, you have to set 'CONFIG_DISTRO_DEFAULTS=y' in your board defconfig + +Some mandatory variable are set in mx6_common.h but can be overwritten like: + - fdtfile with CONFIG_FDTFILE + - fdt_addr_r and fdt_addr with CONFIG_FDTADDR + - ramdisk_addr_r, ramdiskaddr CONFIG_RAMDISKADDR + +You also have to define BOOT_TARGET_DEVICES with available media. +For example added in include/configs/nitrogen6x.h: +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +All this configuration should be done before '#include "mx6_common.h"' + +3.2. Setup your distribution +---------------------------- + +Set the partition containing /boot/ bootable. +Copy your kernel and device tree in /boot. +Create /boot/extlinux/extlinux.conf on your rootfs and fill it according to specification +at http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ + +For example: + +default Buildroot + +label Buildroot + kernel /boot/zImage + append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw + fdtdir /boot +include/configs/mx6_common.h +0
-0
include/configs/mx6_common.h line 62
Quoted 5 lines
include/configs/mx6_common.h +2
-0@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000
I am afraid that this can be a problem. I am not sure that all boards can share the same address.
On most boards, mx6_common is included at the beginning of the configuration file. This means that CONFIG_FDTADDR is surely not set, and it will be set to 0x18000000.
For some boards this could be flawless: for example, I see the "aristainetos" board, it uses as address 0x14000000. But it is set later. It remains just confusing that a CONFIG_FDTADDR is set to a different address as used.
But for other boards I am quite unsure - it could generate some problems.
Quoted 98 lines
include/configs/mx6_common.h +22
-0+#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE @@ -93,4 +99,22 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif include/configs/nitrogen6x.h +29
-5@@ -10,8 +10,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#include "mx6_common.h" -#define CONFIG_MACH_TYPE 3769/* Size of malloc() pool */ @@ -38,9 +36,9 @@/* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ +#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ #define CONFIG_SYS_I2C_SPEED 100000#define CONFIG_I2C_EDID @@ -113,6 +111,8 @@#define CONFIG_PREBOOT "" +#ifndef CONFIG_DISTRO_DEFAULTS +#ifdef CONFIG_CMD_SATA #define CONFIG_DRIVE_SATA "sata "#else @@ -266,6 +266,30 @@ "done\0" \#endif + +#else + +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb" +#else +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb" +#endif + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +#define CONFIG_EXTRA_ENV_SETTINGS \ + CONFIG_EXTRA_DEFAULT_ENV_SETTINGS + +#endif + +#include "mx6_common.h" +/* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x10000000#define CONFIG_SYS_MEMTEST_END 0x10010000
include/configs/nitrogen6x.h line 354
Quoted 5 lines
include/configs/nitrogen6x.h +1
-1@@ -327,4 +351,4 @@#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 -#endif /* __CONFIG_H */ +#endif /* __CONFIG_H */
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 =====================================================================
PATCH v3 1/1 nitrogen6x : Use generic distro configuration
Hi Stefano,
Thank you for your comments.
Quoted 181 lines · Stefano Babic
Hi Fabien,
Quoted 166 lines · Fabien Lahoudere
In order to simplify the use of various images on various media for nitrogen6x, the configuration of the board must follow the generic distro configuration (doc/README.distro).
In order to boot your old rootfs, move your kernel and your device tree in
/boot/. Then create/boot/extlinux/extlinux.confwith for example:default Buildroot
label Buildroot
kernel/boot/zImage
append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw fdtdir /bootSigned-off-by Fabien Lahoudere <[email protected]>---
Changes for V2:
- reintegration of deleted env
- changes are applied only ifCONFIG_DISTRO_DEFAULTS=yChanges for V3:
- remove undefined device treeconfigs/mx6qsabrelite_defconfig | 1 + configs/nitrogen6dl2g_defconfig | 1 + configs/nitrogen6dl_defconfig | 1 + configs/nitrogen6q2g_defconfig | 1 + configs/nitrogen6q_defconfig | 1 + configs/nitrogen6s1g_defconfig | 1 + configs/nitrogen6s_defconfig | 1 + doc/README.imx6 | 47 +++++++++++++++++++++++++++++++++++++++++ include/configs/mx6_common.h | 24 +++++++++++++++++++++ include/configs/nitrogen6x.h | 36 +++++++++++++++++++++++++------ 10 files changed, 108 insertions(+), 6 deletions(-)configs/mx6qsabrelite_defconfig +1
-0@@ -36,3 +36,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6dl2g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6dl_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6q2g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6q_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6s1g_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=yconfigs/nitrogen6s_defconfig +1
-0@@ -34,3 +34,4 @@ CONFIG_G_DNL_MANUFACTURER="Boundary" CONFIG_G_DNL_VENDOR_NUM=0x0525 CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 CONFIG_OF_LIBFDT=y +CONFIG_DISTRO_DEFAULTS=ydoc/README.imx6 +47
-0@@ -138,3 +138,50 @@ c The last "c" command tells kermit (from ckermit package in most distros) to switch from command line mode to communication mode, and when the script is finished, the U-Boot prompt is shown in the same shell. + +3. Using generic distro configuration +------------------------------------- + +In order to simplify the use of various images on various media +for imx6 boards, the configuration of the board must follow the +generic distro configuration (doc/README.distro). + +3.1. Setup uboot configuration for your board +--------------------------------------------- + +First, you have to set 'CONFIG_DISTRO_DEFAULTS=y' in your board defconfig + +Some mandatory variable are set in mx6_common.h but can be overwritten like: + - fdtfile with CONFIG_FDTFILE + - fdt_addr_r and fdt_addr with CONFIG_FDTADDR + - ramdisk_addr_r, ramdiskaddr CONFIG_RAMDISKADDR + +You also have to define BOOT_TARGET_DEVICES with available media. +For example added in include/configs/nitrogen6x.h: +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +All this configuration should be done before '#include "mx6_common.h"' + +3.2. Setup your distribution +---------------------------- + +Set the partition containing /boot/ bootable. +Copy your kernel and device tree in /boot. +Create /boot/extlinux/extlinux.conf on your rootfs and fill it according to specification +at http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ + +For example: + +default Buildroot + +label Buildroot + kernel /boot/zImage + append console=ttymxc1,115200 root=/dev/mmcblk0p1 rootwait rw + fdtdir /boot +include/configs/mx6_common.h +0
-0include/configs/mx6_common.h line 62
Quoted 5 lines
include/configs/mx6_common.h +2
-0@@ -58,6 +58,12 @@#endif #endif #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR +#ifndef CONFIG_FDTADDR +#define CONFIG_FDTADDR 0x18000000I am afraid that this can be a problem. I am not sure that all boards can share the same address.
On most boards,
mx6_commonis included at the beginning of the configuration file. This means thatCONFIG_FDTADDRis surely not set, and it will be set to0x18000000.
Quoted 6 lines
For some boards this could be flawless: for example, I see the "aristainetos" board, it uses as address
0x14000000. But it is set later. It remains just confusing that aCONFIG_FDTADDRis set to a different address as used.But for other boards I am quite unsure - it could generate some problems.
I will remove those lines that just lead to a compilation error only if we forgot to set CONFIG_FDTADDR when CONFIG_DISTRO_DEFAULTS=y. Is this change acceptable for you?
Quoted 106 lines
Quoted 98 lines
include/configs/mx6_common.h +22
-0+#endif +#ifndef CONFIG_RAMDISKADDR +#define CONFIG_RAMDISKADDR 0x13000000 +#endif /* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE @@ -93,4 +99,22 @@#define CONFIG_CMD_FUSE #define CONFIG_MXC_OCOTP +#ifdef CONFIG_DISTRO_DEFAULTS +#include <config_distro_defaults.h> + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_DEFAULT_ENV_SETTINGS \ + "fdtfile=" CONFIG_FDTFILE "\0" \ + "fdt_addr_r=" __stringify(CONFIG_FDTADDR) "\0" \ + "fdt_addr=" __stringify(CONFIG_FDTADDR) "\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + "ramdiskaddr=" __stringify(CONFIG_RAMDISKADDR) "\0" \ + BOOTENV + +#endif +#endif include/configs/nitrogen6x.h +29
-5@@ -10,8 +10,6 @@#ifndef __CONFIG_H#define __CONFIG_H -#include "mx6_common.h" -#define CONFIG_MACH_TYPE 3769/* Size of malloc() pool */ @@ -38,9 +36,9 @@/* I2C Configs */ #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC -#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ -#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ -#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ +#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ +#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ +#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ #define CONFIG_SYS_I2C_SPEED 100000#define CONFIG_I2C_EDID @@ -113,6 +111,8 @@#define CONFIG_PREBOOT "" +#ifndef CONFIG_DISTRO_DEFAULTS +#ifdef CONFIG_CMD_SATA #define CONFIG_DRIVE_SATA "sata "#else @@ -266,6 +266,30 @@ "done\0" \#endif + +#else + +#if defined(CONFIG_SABRELITE ) +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb" +#else +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb" +#endif + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 0) \ + func(MMC, mmc, 1) \ + func(SATA, sata, 0) \ + func(USB, usb, 0) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) + +#define CONFIG_EXTRA_ENV_SETTINGS \ + CONFIG_EXTRA_DEFAULT_ENV_SETTINGS + +#endif + +#include "mx6_common.h" +/* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x10000000#define CONFIG_SYS_MEMTEST_END 0x10010000include/configs/nitrogen6x.h line 354
Quoted 5 lines
include/configs/nitrogen6x.h +1
-1@@ -327,4 +351,4 @@#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000 -#endif /* __CONFIG_H */ +#endif /* __CONFIG_H */ Best regards,
Stefano Babic
Signature · 2 lines
Fabien Lahoudere Collabora Ltd.
PATCH v3 1/1 nitrogen6x : Use generic distro configuration
Hi Fabien,
Quoted 10 lines · Fabien Lahoudere
Quoted 10 lines
On most boards,
mx6_commonis included at the beginning of the configuration file. This means thatCONFIG_FDTADDRis surely not set, and it will be set to0x18000000.For some boards this could be flawless: for example, I see the "aristainetos" board, it uses as address
0x14000000. But it is set later. It remains just confusing that aCONFIG_FDTADDRis set to a different address as used.
Quoted 4 lines
Quoted 1 line
But for other boards I am quite unsure - it could generate some problems.
I will remove those lines that just lead to a compilation error only if we forgot to set
CONFIG_FDTADDRwhenCONFIG_DISTRO_DEFAULTS=y. Is this change acceptable for you?
I agree - this lets boards that do not use CONFIG_DISTRO unchanged.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 =====================================================================