summaryrefslogtreecommitdiff
path: root/board
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 /board
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.
Diffstat (limited to 'board')
-rw-r--r--board/toradex/colibri_vf/colibri_vf.c5
-rw-r--r--board/toradex/common/common.c12
2 files changed, 12 insertions, 5 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