* [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration
[not found] <1469543134-23524-1-git-send-email-fabien.lahoudere@collabora.co.uk>
@ 2016-08-02 7:31 ` Fabien Lahoudere
2016-08-03 7:54 ` Stefano Babic
2016-08-03 15:51 ` Fabio Estevam
0 siblings, 2 replies; 4+ messages in thread
From: Fabien Lahoudere @ 2016-08-02 7:31 UTC (permalink / raw)
To: u-boot
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
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
---
Changes for V2:
- reintegration of deleted env
- changes are applied only if CONFIG_DISTRO_DEFAULTS=y
Changes for V3:
- remove undefined device tree
Changes for v4:
- remove default definition of CONFIG_FDTADDR in mx6_common.h
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 | 22 +++++++++++++++++++
include/configs/nitrogen6x.h | 38 +++++++++++++++++++++++++++------
10 files changed, 108 insertions(+), 6 deletions(-)
diff --git a/configs/mx6qsabrelite_defconfig
b/configs/mx6qsabrelite_defconfig
index fa6139a..27b64c4 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6dl2g_defconfig
b/configs/nitrogen6dl2g_defconfig
index 02b2462..b1344c6 100644
--- a/configs/nitrogen6dl2g_defconfig
+++ b/configs/nitrogen6dl2g_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
index 52553f6..f794c08 100644
--- a/configs/nitrogen6dl_defconfig
+++ b/configs/nitrogen6dl_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6q2g_defconfig b/configs/nitrogen6q2g_defconfig
index 11188b7..56cebe0 100644
--- a/configs/nitrogen6q2g_defconfig
+++ b/configs/nitrogen6q2g_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig
index 05bf140..c150b97 100644
--- a/configs/nitrogen6q_defconfig
+++ b/configs/nitrogen6q_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6s1g_defconfig b/configs/nitrogen6s1g_defconfig
index bb081a2..dfd096d 100644
--- a/configs/nitrogen6s1g_defconfig
+++ b/configs/nitrogen6s1g_defconfig
@@ -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
\ No newline at end of file
diff --git a/configs/nitrogen6s_defconfig b/configs/nitrogen6s_defconfig
index 08e91c9..5e2e693 100644
--- a/configs/nitrogen6s_defconfig
+++ b/configs/nitrogen6s_defconfig
@@ -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
\ No newline at end of file
diff --git a/doc/README.imx6 b/doc/README.imx6
index 1823fb2..36452f6 100644
--- a/doc/README.imx6
+++ b/doc/README.imx6
@@ -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
+
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index fb49322..3337538 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -59,6 +59,10 @@
#endif
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
+#ifndef CONFIG_RAMDISKADDR
+#define CONFIG_RAMDISKADDR 0x13000000
+#endif
+
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_CONS_INDEX 1
@@ -93,4 +97,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
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index b651eb3..b2708e9 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -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,32 @@
"done\0" \
#endif
+
+#else
+
+#if defined(CONFIG_SABRELITE)
+#define CONFIG_FDTFILE "imx6q-sabrelite.dtb"
+#else
+#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb"
+#endif
+
+#define CONFIG_FDTADDR 0x18000000
+
+#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 +353,4 @@
#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
#define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_H */
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration
2016-08-02 7:31 ` [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration Fabien Lahoudere
@ 2016-08-03 7:54 ` Stefano Babic
2016-08-03 22:10 ` Troy Kisky
2016-08-03 15:51 ` Fabio Estevam
1 sibling, 1 reply; 4+ messages in thread
From: Stefano Babic @ 2016-08-03 7:54 UTC (permalink / raw)
To: u-boot
Hi Fabien,
On 02/08/2016 09:31, Fabien Lahoudere wrote:
> 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
>
> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
> ---
> Changes for V2:
> - reintegration of deleted env
> - changes are applied only if CONFIG_DISTRO_DEFAULTS=y
>
> Changes for V3:
> - remove undefined device tree
>
> Changes for v4:
> - remove default definition of CONFIG_FDTADDR in mx6_common.h
>
> 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 | 22 +++++++++++++++++++
> include/configs/nitrogen6x.h | 38 +++++++++++++++++++++++++++------
> 10 files changed, 108 insertions(+), 6 deletions(-)
>
> diff --git a/configs/mx6qsabrelite_defconfig
> b/configs/mx6qsabrelite_defconfig
> index fa6139a..27b64c4 100644
> --- a/configs/mx6qsabrelite_defconfig
> +++ b/configs/mx6qsabrelite_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6dl2g_defconfig
> b/configs/nitrogen6dl2g_defconfig
> index 02b2462..b1344c6 100644
> --- a/configs/nitrogen6dl2g_defconfig
> +++ b/configs/nitrogen6dl2g_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
> index 52553f6..f794c08 100644
> --- a/configs/nitrogen6dl_defconfig
> +++ b/configs/nitrogen6dl_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6q2g_defconfig
> b/configs/nitrogen6q2g_defconfig
> index 11188b7..56cebe0 100644
> --- a/configs/nitrogen6q2g_defconfig
> +++ b/configs/nitrogen6q2g_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig
> index 05bf140..c150b97 100644
> --- a/configs/nitrogen6q_defconfig
> +++ b/configs/nitrogen6q_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6s1g_defconfig
> b/configs/nitrogen6s1g_defconfig
> index bb081a2..dfd096d 100644
> --- a/configs/nitrogen6s1g_defconfig
> +++ b/configs/nitrogen6s1g_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/configs/nitrogen6s_defconfig b/configs/nitrogen6s_defconfig
> index 08e91c9..5e2e693 100644
> --- a/configs/nitrogen6s_defconfig
> +++ b/configs/nitrogen6s_defconfig
> @@ -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
> \ No newline at end of file
> diff --git a/doc/README.imx6 b/doc/README.imx6
> index 1823fb2..36452f6 100644
> --- a/doc/README.imx6
> +++ b/doc/README.imx6
> @@ -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
> +
> diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
> index fb49322..3337538 100644
> --- a/include/configs/mx6_common.h
> +++ b/include/configs/mx6_common.h
> @@ -59,6 +59,10 @@
> #endif
> #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
> +#ifndef CONFIG_RAMDISKADDR
> +#define CONFIG_RAMDISKADDR 0x13000000
> +#endif
> +
> /* allow to overwrite serial and ethaddr */
> #define CONFIG_ENV_OVERWRITE
> #define CONFIG_CONS_INDEX 1
> @@ -93,4 +97,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
> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
> index b651eb3..b2708e9 100644
> --- a/include/configs/nitrogen6x.h
> +++ b/include/configs/nitrogen6x.h
> @@ -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,32 @@
> "done\0" \
> #endif
> +
> +#else
> +
> +#if defined(CONFIG_SABRELITE)
> +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb"
> +#else
> +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb"
> +#endif
> +
> +#define CONFIG_FDTADDR 0x18000000
> +
> +#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 +353,4 @@
> #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
> #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
> -#endif /* __CONFIG_H */
> +#endif /* __CONFIG_H */
CC to Troy as nitrogen's maintainer.
On my side:
Reviewed-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
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
=====================================================================
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration
2016-08-02 7:31 ` [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration Fabien Lahoudere
2016-08-03 7:54 ` Stefano Babic
@ 2016-08-03 15:51 ` Fabio Estevam
1 sibling, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2016-08-03 15:51 UTC (permalink / raw)
To: u-boot
On Tue, Aug 2, 2016 at 4:31 AM, Fabien Lahoudere
<fabien.lahoudere@collabora.co.uk> wrote:
> #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 */
This change is unrelated and should not be part of this patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration
2016-08-03 7:54 ` Stefano Babic
@ 2016-08-03 22:10 ` Troy Kisky
0 siblings, 0 replies; 4+ messages in thread
From: Troy Kisky @ 2016-08-03 22:10 UTC (permalink / raw)
To: u-boot
On 8/3/2016 12:54 AM, Stefano Babic wrote:
> Hi Fabien,
>
>
> On 02/08/2016 09:31, Fabien Lahoudere wrote:
>> 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
>>
>> Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
>> ---
>> Changes for V2:
>> - reintegration of deleted env
>> - changes are applied only if CONFIG_DISTRO_DEFAULTS=y
>>
>> Changes for V3:
>> - remove undefined device tree
>>
>> Changes for v4:
>> - remove default definition of CONFIG_FDTADDR in mx6_common.h
>>
>> 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 | 22 +++++++++++++++++++
>> include/configs/nitrogen6x.h | 38 +++++++++++++++++++++++++++------
>> 10 files changed, 108 insertions(+), 6 deletions(-)
>>
>> diff --git a/configs/mx6qsabrelite_defconfig
>> b/configs/mx6qsabrelite_defconfig
>> index fa6139a..27b64c4 100644
>> --- a/configs/mx6qsabrelite_defconfig
>> +++ b/configs/mx6qsabrelite_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6dl2g_defconfig
>> b/configs/nitrogen6dl2g_defconfig
>> index 02b2462..b1344c6 100644
>> --- a/configs/nitrogen6dl2g_defconfig
>> +++ b/configs/nitrogen6dl2g_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6dl_defconfig b/configs/nitrogen6dl_defconfig
>> index 52553f6..f794c08 100644
>> --- a/configs/nitrogen6dl_defconfig
>> +++ b/configs/nitrogen6dl_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6q2g_defconfig
>> b/configs/nitrogen6q2g_defconfig
>> index 11188b7..56cebe0 100644
>> --- a/configs/nitrogen6q2g_defconfig
>> +++ b/configs/nitrogen6q2g_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6q_defconfig b/configs/nitrogen6q_defconfig
>> index 05bf140..c150b97 100644
>> --- a/configs/nitrogen6q_defconfig
>> +++ b/configs/nitrogen6q_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6s1g_defconfig
>> b/configs/nitrogen6s1g_defconfig
>> index bb081a2..dfd096d 100644
>> --- a/configs/nitrogen6s1g_defconfig
>> +++ b/configs/nitrogen6s1g_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/configs/nitrogen6s_defconfig b/configs/nitrogen6s_defconfig
>> index 08e91c9..5e2e693 100644
>> --- a/configs/nitrogen6s_defconfig
>> +++ b/configs/nitrogen6s_defconfig
>> @@ -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
>> \ No newline at end of file
>> diff --git a/doc/README.imx6 b/doc/README.imx6
>> index 1823fb2..36452f6 100644
>> --- a/doc/README.imx6
>> +++ b/doc/README.imx6
>> @@ -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
>> +
>> diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
>> index fb49322..3337538 100644
>> --- a/include/configs/mx6_common.h
>> +++ b/include/configs/mx6_common.h
>> @@ -59,6 +59,10 @@
>> #endif
>> #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
>> +#ifndef CONFIG_RAMDISKADDR
>> +#define CONFIG_RAMDISKADDR 0x13000000
>> +#endif
>> +
>> /* allow to overwrite serial and ethaddr */
>> #define CONFIG_ENV_OVERWRITE
>> #define CONFIG_CONS_INDEX 1
>> @@ -93,4 +97,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
>> diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
>> index b651eb3..b2708e9 100644
>> --- a/include/configs/nitrogen6x.h
>> +++ b/include/configs/nitrogen6x.h
>> @@ -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,32 @@
>> "done\0" \
>> #endif
>> +
>> +#else
>> +
>> +#if defined(CONFIG_SABRELITE)
>> +#define CONFIG_FDTFILE "imx6q-sabrelite.dtb"
>> +#else
>> +#define CONFIG_FDTFILE "imx6q-nitrogen6x.dtb"
>> +#endif
>> +
>> +#define CONFIG_FDTADDR 0x18000000
>> +
>> +#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 +353,4 @@
>> #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
>> #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
>> -#endif /* __CONFIG_H */
>> +#endif /* __CONFIG_H */
>
> CC to Troy as nitrogen's maintainer.
>
> On my side:
>
> Reviewed-by: Stefano Babic <sbabic@denx.de>
>
> Best regards,
> Stefano Babic
>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-03 22:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1469543134-23524-1-git-send-email-fabien.lahoudere@collabora.co.uk>
2016-08-02 7:31 ` [U-Boot] [PATCH v4] nitrogen6x : Use generic distro configuration Fabien Lahoudere
2016-08-03 7:54 ` Stefano Babic
2016-08-03 22:10 ` Troy Kisky
2016-08-03 15:51 ` Fabio Estevam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.