summaryrefslogtreecommitdiff
path: root/board/gateworks
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-23 18:58:47 -0600
committerSimon Glass <sjg@chromium.org>2014-11-21 04:43:15 +0100
commite895a4b06f9062f052d438df7f4766b3decdb3d4 (patch)
treeca82de66d4b1a0e6b21b2e360aba83267b45e39a /board/gateworks
parent4d70b34d7f721d8b1d4d628e68c3a44ab7a10dff (diff)
downloadu-boot-imx-e895a4b06f9062f052d438df7f4766b3decdb3d4.zip
u-boot-imx-e895a4b06f9062f052d438df7f4766b3decdb3d4.tar.gz
u-boot-imx-e895a4b06f9062f052d438df7f4766b3decdb3d4.tar.bz2
fdt: Allow ft_board_setup() to report failure
This function can fail if the device tree runs out of space. Rather than silently booting with an incomplete device tree, allow the failure to be detected. Unfortunately this involves changing a lot of places in the code. I have not changed behvaiour to return an error where one is not currently returned, to avoid unexpected breakage. Eventually it would be nice to allow boards to register functions to be called to update the device tree. This would avoid all the many functions to do this. However it's not clear yet if this should be done using driver model or with a linker list. This work is left for later. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'board/gateworks')
-rw-r--r--board/gateworks/gw_ventana/gw_ventana.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index df491a8..bb08cd2 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1483,7 +1483,7 @@ int misc_init_r(void)
* - board (full model from EEPROM)
* - peripherals removed from DTB if not loaded on board (per EEPROM config)
*/
-void ft_board_setup(void *blob, bd_t *bd)
+int ft_board_setup(void *blob, bd_t *bd)
{
struct ventana_board_info *info = &ventana_info;
struct ventana_eeprom_config *cfg;
@@ -1495,7 +1495,7 @@ void ft_board_setup(void *blob, bd_t *bd)
if (getenv("fdt_noauto")) {
puts(" Skiping ft_board_setup (fdt_noauto defined)\n");
- return;
+ return 0;
}
/* Update partition nodes using info from mtdparts env var */
@@ -1504,7 +1504,7 @@ void ft_board_setup(void *blob, bd_t *bd)
if (!model) {
puts("invalid board info: Leaving FDT fully enabled\n");
- return;
+ return 0;
}
printf(" Adjusting FDT per EEPROM for %s...\n", model);
@@ -1523,7 +1523,7 @@ void ft_board_setup(void *blob, bd_t *bd)
*/
if (getenv("fdt_noconfig")) {
puts(" Skiping periperhal config (fdt_noconfig defined)\n");
- return;
+ return 0;
}
cfg = econfig;
while (cfg->name) {
@@ -1533,6 +1533,8 @@ void ft_board_setup(void *blob, bd_t *bd)
}
cfg++;
}
+
+ return 0;
}
#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */