summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2016-11-30 13:41:53 -0800
committerStefano Babic <sbabic@denx.de>2016-12-16 09:56:38 +0100
commit37fa41256bd756f3652e7479b976982092a4f9bc (patch)
tree9c08803b3c6f224801c18a85e9d05a1462766ed5
parentbeaf40688ba7303e9db50558b3852c79437eecad (diff)
downloadu-boot-imx-37fa41256bd756f3652e7479b976982092a4f9bc.zip
u-boot-imx-37fa41256bd756f3652e7479b976982092a4f9bc.tar.gz
u-boot-imx-37fa41256bd756f3652e7479b976982092a4f9bc.tar.bz2
toradex: allow custom fdt board setup in board file
The config block support currently uses the ft_board_setup function to patch the device tree with config block information. However, this does not allow to patch the device tree with board specific information. Rename the common setup function to ft_common_board_setup and use the call it from the board files directly. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--board/toradex/apalis_t30/apalis_t30.c8
-rw-r--r--board/toradex/colibri_imx7/colibri_imx7.c8
-rw-r--r--board/toradex/colibri_pxa270/colibri_pxa270.c8
-rw-r--r--board/toradex/colibri_t20/colibri_t20.c8
-rw-r--r--board/toradex/colibri_t30/colibri_t30.c8
-rw-r--r--board/toradex/colibri_vf/colibri_vf.c8
-rw-r--r--board/toradex/common/tdx-common.c8
-rw-r--r--board/toradex/common/tdx-common.h2
8 files changed, 53 insertions, 5 deletions
diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c
index 3d83491..827eefd 100644
--- a/board/toradex/apalis_t30/apalis_t30.c
+++ b/board/toradex/apalis_t30/apalis_t30.c
@@ -14,6 +14,7 @@
#include <asm/io.h>
#include <dm.h>
#include <i2c.h>
+#include "../common/tdx-common.h"
#include "pinmux-config-apalis_t30.h"
@@ -39,6 +40,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
/*
* Routine: pinmux_init
* Description: Do individual peripheral pinmux configs
diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c
index c64e31e..e1340c3 100644
--- a/board/toradex/colibri_imx7/colibri_imx7.c
+++ b/board/toradex/colibri_imx7/colibri_imx7.c
@@ -24,6 +24,7 @@
#include <power/pmic.h>
#include <power/rn5t567_pmic.h>
#include <usb/ehci-ci.h>
+#include "../common/tdx-common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -387,6 +388,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
#ifdef CONFIG_USB_EHCI_MX7
static iomux_v3_cfg_t const usb_otg2_pads[] = {
MX7D_PAD_UART3_CTS_B__USB_OTG2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
diff --git a/board/toradex/colibri_pxa270/colibri_pxa270.c b/board/toradex/colibri_pxa270/colibri_pxa270.c
index 932b900..8e94854 100644
--- a/board/toradex/colibri_pxa270/colibri_pxa270.c
+++ b/board/toradex/colibri_pxa270/colibri_pxa270.c
@@ -18,6 +18,7 @@
#include <netdev.h>
#include <serial.h>
#include <usb.h>
+#include "../common/tdx-common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -43,6 +44,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
int dram_init(void)
{
pxa2xx_dram_init();
diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c
index 01b55be..4d298e6 100644
--- a/board/toradex/colibri_t20/colibri_t20.c
+++ b/board/toradex/colibri_t20/colibri_t20.c
@@ -15,6 +15,7 @@
#include <asm/io.h>
#include <i2c.h>
#include <nand.h>
+#include "../common/tdx-common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -74,6 +75,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
#ifdef CONFIG_TEGRA_MMC
/*
* Routine: pin_mux_mmc
diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c
index 707d07e..b68d3ca 100644
--- a/board/toradex/colibri_t30/colibri_t30.c
+++ b/board/toradex/colibri_t30/colibri_t30.c
@@ -14,6 +14,7 @@
#include <asm/io.h>
#include <i2c.h>
#include "pinmux-config-colibri_t30.h"
+#include "../common/tdx-common.h"
int arch_misc_init(void)
{
@@ -31,6 +32,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
/*
* Routine: pinmux_init
* Description: Do individual peripheral pinmux configs
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c
index e65d9c3..86f52c5 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -22,6 +22,7 @@
#include <g_dnl.h>
#include <asm/gpio.h>
#include <usb.h>
+#include "../common/tdx-common.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -528,6 +529,13 @@ int checkboard(void)
return 0;
}
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ return ft_common_board_setup(blob, bd);
+}
+#endif
+
#ifdef CONFIG_USB_EHCI_VF
int board_ehci_hcd_init(int port)
{
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index d418055..2c6fc40 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -120,8 +120,8 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
}
#endif
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
+#if defined(CONFIG_OF_LIBFDT)
+int ft_common_board_setup(void *blob, bd_t *bd)
{
if (tdx_serial) {
fdt_setprop(blob, 0, "serial-number", tdx_serial_str,
@@ -158,11 +158,9 @@ u32 get_board_serial(void)
}
#endif /* CONFIG_SERIAL_TAG */
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-int ft_board_setup(void *blob, bd_t *bd)
+int ft_common_board_setup(void *blob, bd_t *bd)
{
return 0;
}
-#endif
#endif /* CONFIG_TDX_CFG_BLOCK */
diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h
index f308ebd..f8d78f0 100644
--- a/board/toradex/common/tdx-common.h
+++ b/board/toradex/common/tdx-common.h
@@ -10,4 +10,6 @@
#define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000
#define TDX_USB_VID 0x1B67
+int ft_common_board_setup(void *blob, bd_t *bd);
+
#endif /* _TDX_COMMON_H */