aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Marko <robert.marko@sartura.hr>2023-11-29 11:11:06 +0100
committerStefan Roese <sr@denx.de>2024-01-10 09:38:55 +0100
commit9a43eb12db36a5b77d904749dabe9141e67180a1 (patch)
tree9c588ee92a7a729267b3f6f48d3af805e2b1b22f
parentcb71a30857db25ccfa96c144f434a370814e74a7 (diff)
downloadu-boot-9a43eb12db36a5b77d904749dabe9141e67180a1.zip
u-boot-9a43eb12db36a5b77d904749dabe9141e67180a1.tar.gz
u-boot-9a43eb12db36a5b77d904749dabe9141e67180a1.tar.bz2
arm: mvebu: Espressobin: move FDT fixup into a separate function
Currently, Esspresobin FDT is being fixed up directly in ft_board_setup() which makes it hard to add support for any other board to be fixed up. So, lets just move the FDT fixup code to a separate function and call it if compatible matches, there should be no functional change. Signed-off-by: Robert Marko <robert.marko@sartura.hr> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--board/Marvell/mvebu_armada-37xx/board.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
index 04124d8..1471caa 100644
--- a/board/Marvell/mvebu_armada-37xx/board.c
+++ b/board/Marvell/mvebu_armada-37xx/board.c
@@ -363,18 +363,14 @@ EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
#endif
#ifdef CONFIG_OF_BOARD_SETUP
-int ft_board_setup(void *blob, struct bd_info *bd)
+static int espressobin_fdt_setup(void *blob)
{
-#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
int ret;
int spi_off;
int parts_off;
int part_off;
/* Fill SPI MTD partitions for Linux kernel on Espressobin */
- if (!of_machine_is_compatible("globalscale,espressobin"))
- return 0;
-
spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor");
if (spi_off < 0)
return 0;
@@ -459,6 +455,14 @@ int ft_board_setup(void *blob, struct bd_info *bd)
return 0;
}
+ return 0;
+}
+
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
+ if (of_machine_is_compatible("globalscale,espressobin"))
+ return espressobin_fdt_setup(blob);
#endif
return 0;
}