toradex: common: set Toradex specific dt properties
authorStefan Agner <stefan.agner@toradex.com>
Sat, 9 May 2015 10:08:26 +0000 (12:08 +0200)
committerStefan Agner <stefan.agner@toradex.com>
Sat, 9 May 2015 10:08:26 +0000 (12:08 +0200)
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.

board/toradex/colibri_vf/colibri_vf.c
board/toradex/common/common.c
include/configs/apalis_imx6.h
include/configs/colibri_imx6.h
include/configs/colibri_vf.h

index bea269665ea97e99a9abd59e80ad504ba9feddfc..75cffc1f2a903c3dc9530884702de92a960dbeb6 100644 (file)
@@ -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
index 4cb3420240d4c6b936a5ee9fa82fd11b16a8d2ea..0869337baf3d0cdb56d0e615d7ffda155fa1c00b 100644 (file)
@@ -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
index c08b1966435ef3f69bcd7b3e1657c935f6a47c73..162be2e73874b8a177b538e5af26f22d76e4bd46 100644 (file)
 #endif
 
 #define CONFIG_OF_LIBFDT
+#define CONFIG_OF_SYSTEM_SETUP
 
 #ifndef CONFIG_SYS_DCACHE_OFF
 #define CONFIG_CMD_CACHE
index 2e8ea271f55b242d24230d0ada8eaab39ca02a65..d194d9065858fef1280cf5f8b213f168274bf164 100644 (file)
 #endif
 
 #define CONFIG_OF_LIBFDT
+#define CONFIG_OF_SYSTEM_SETUP
 
 #ifndef CONFIG_SYS_DCACHE_OFF
 #define CONFIG_CMD_CACHE
index 95e17069ae961f2878a381cc35514e7758312532..06caabdbae9c898c76390b3871e33a5543337baf 100644 (file)
@@ -35,8 +35,6 @@
 #define CONFIG_MXC_OCOTP
 #endif
 
-#define CONFIG_OF_BOARD_SETUP
-
 #define CONFIG_FSL_DCU_FB
 
 #ifdef CONFIG_FSL_DCU_FB
 #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