From 0fa5ed9af80300a67c61e750205ff0c44cf516c4 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 9 May 2015 12:08:26 +0200 Subject: 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. --- board/toradex/colibri_vf/colibri_vf.c | 5 ----- board/toradex/common/common.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'board') 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 #include +#include 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 -- cgit v1.2.3