diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2015-05-09 12:08:26 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2015-05-09 12:08:26 +0200 |
commit | 0fa5ed9af80300a67c61e750205ff0c44cf516c4 (patch) | |
tree | 39ab9adfc05bba93f859c5842227fb1555cf8826 | |
parent | 1f6e33606ff7b6438f629853800cb40f63fbdfcd (diff) |
toradex: common: set Toradex specific dt properties
Use ft_system_setup to set Toradex specific device-tree properties.
At first, this is only the serial-number, which is using a property
which is about to be standardized in the binding documentation of
the Linux kernel.
-rw-r--r-- | board/toradex/colibri_vf/colibri_vf.c | 5 | ||||
-rw-r--r-- | board/toradex/common/common.c | 12 | ||||
-rw-r--r-- | include/configs/apalis_imx6.h | 1 | ||||
-rw-r--r-- | include/configs/colibri_imx6.h | 1 | ||||
-rw-r--r-- | include/configs/colibri_vf.h | 5 |
5 files changed, 17 insertions, 7 deletions
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index bea269665ea..75cffc1f2a9 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -477,11 +477,6 @@ int checkboard_fallback(void) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { -#ifdef CONFIG_TRDX_CFG_BLOCK - fdt_setprop(blob, 0, "serial-number", getenv("serial#"), - strlen(getenv("serial#")) + 1); -#endif - return fsl_dcu_fixedfb_setup(blob); } #endif diff --git a/board/toradex/common/common.c b/board/toradex/common/common.c index 4cb3420240d..0869337baf3 100644 --- a/board/toradex/common/common.c +++ b/board/toradex/common/common.c @@ -7,6 +7,7 @@ #include "configblock.h" #include <common.h> #include <g_dnl.h> +#include <libfdt.h> static char trdx_serial_str[9]; @@ -135,3 +136,14 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) return 0; } #endif /* CONFIG_USBDOWNLOAD_GADGET */ + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_SYSTEM_SETUP) && \ + defined(CONFIG_TRDX_CFG_BLOCK) +int ft_system_setup(void *blob, bd_t *bd) +{ + fdt_setprop(blob, 0, "serial-number", trdx_serial_str, + strlen(trdx_serial_str) + 1); + + return 0; +} +#endif diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h index c08b1966435..162be2e7387 100644 --- a/include/configs/apalis_imx6.h +++ b/include/configs/apalis_imx6.h @@ -350,6 +350,7 @@ #endif #define CONFIG_OF_LIBFDT +#define CONFIG_OF_SYSTEM_SETUP #ifndef CONFIG_SYS_DCACHE_OFF #define CONFIG_CMD_CACHE diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h index 2e8ea271f55..d194d906585 100644 --- a/include/configs/colibri_imx6.h +++ b/include/configs/colibri_imx6.h @@ -310,6 +310,7 @@ #endif #define CONFIG_OF_LIBFDT +#define CONFIG_OF_SYSTEM_SETUP #ifndef CONFIG_SYS_DCACHE_OFF #define CONFIG_CMD_CACHE diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h index 95e17069ae9..06caabdbae9 100644 --- a/include/configs/colibri_vf.h +++ b/include/configs/colibri_vf.h @@ -35,8 +35,6 @@ #define CONFIG_MXC_OCOTP #endif -#define CONFIG_OF_BOARD_SETUP - #define CONFIG_FSL_DCU_FB #ifdef CONFIG_FSL_DCU_FB @@ -262,6 +260,9 @@ #endif #define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP +#define CONFIG_OF_SYSTEM_SETUP + #define CONFIG_CMD_BOOTZ #define CONFIG_SUPPORT_RAW_INITRD #define CONFIG_SYS_BOOT_RAMDISK_HIGH |