summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2015-05-09 12:08:26 +0200
committerStefan Agner <stefan.agner@toradex.com>2015-05-09 12:08:26 +0200
commit0fa5ed9af80300a67c61e750205ff0c44cf516c4 (patch)
tree39ab9adfc05bba93f859c5842227fb1555cf8826
parent1f6e33606ff7b6438f629853800cb40f63fbdfcd (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.c5
-rw-r--r--board/toradex/common/common.c12
-rw-r--r--include/configs/apalis_imx6.h1
-rw-r--r--include/configs/colibri_imx6.h1
-rw-r--r--include/configs/colibri_vf.h5
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 bea269665e..75cffc1f2a 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 4cb3420240..0869337baf 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 c08b196643..162be2e738 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 2e8ea271f5..d194d90658 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 95e17069ae..06caabdbae 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