[PATCH v2 1/3] 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 --- board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 04124d8014..1471caa9a6 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; }

Currently, Esspresobin switch is being setup directly in last_stage_init() which makes it hard to add support for any other board to be setup.
So, lets just move the switch setup 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 --- Changes in v2: * Rebase on top of current master and resolve conflicts
board/Marvell/mvebu_armada-37xx/board.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 1471caa9a6..f532486b70 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -301,14 +301,12 @@ static int mii_multi_chip_mode_write(struct udevice *bus, int dev_smi_addr, return 0; }
-/* Bring-up board-specific network stuff */ -static int last_stage_init(void) +static int espressobin_last_stage_init(void) { struct udevice *bus; ofnode node;
- if (!CONFIG_IS_ENABLED(DM_MDIO) || - !of_machine_is_compatible("globalscale,espressobin")) + if (!CONFIG_IS_ENABLED(DM_MDIO)) return 0;
node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); @@ -358,8 +356,17 @@ static int last_stage_init(void)
return 0; } -EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
+/* Bring-up board-specific network stuff */ +static int last_stage_init(void) +{ + + if (of_machine_is_compatible("globalscale,espressobin")) + return espressobin_last_stage_init(); + + return 0; +} +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); #endif
#ifdef CONFIG_OF_BOARD_SETUP

There is a new eDPU revision that uses Marvell 88E6361 switch onboard. We can rely on detecting the switch to enable and fixup the Linux DTS so a single DTS can be used.
There is currently no support for the 88E6361 switch and thus no working networking in U-Boot, so we disable both ports.
Signed-off-by: Robert Marko robert.marko@sartura.hr Reviewed-by: Stefan Roese sr@denx.de --- arch/arm/dts/armada-3720-eDPU-u-boot.dtsi | 13 ++- arch/arm/dts/armada-3720-eDPU.dts | 47 ++++++++ board/Marvell/mvebu_armada-37xx/board.c | 125 ++++++++++++++++++++++ configs/eDPU_defconfig | 1 + 4 files changed, 181 insertions(+), 5 deletions(-)
diff --git a/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi b/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi index cb02b70e54..c3d450dd83 100644 --- a/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi +++ b/arch/arm/dts/armada-3720-eDPU-u-boot.dtsi @@ -32,14 +32,17 @@ bootph-all; };
-ð0 { - /* G.hn does not work without additional configuration */ - status = "disabled"; -}; - ð1 { fixed-link { speed = <1000>; full-duplex; }; }; + +/* + * eDPU v2 has a MV88E6361 switch on the MDIO bus and U-boot is used + * to patch the Linux DTS if its found so enable MDIO by default. + */ +&mdio { + status = "okay"; +}; diff --git a/arch/arm/dts/armada-3720-eDPU.dts b/arch/arm/dts/armada-3720-eDPU.dts index 57fc698e55..d6d37a1f6f 100644 --- a/arch/arm/dts/armada-3720-eDPU.dts +++ b/arch/arm/dts/armada-3720-eDPU.dts @@ -12,3 +12,50 @@ ð0 { phy-mode = "2500base-x"; }; + +/* + * External MV88E6361 switch is only available on v2 of the board. + * U-Boot will enable the MDIO bus and switch nodes. + */ +&mdio { + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <&smi_pins>; + + /* Actual device is MV88E6361 */ + switch: switch@0 { + compatible = "marvell,mv88e6190"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "cpu"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + ethernet = <ð0>; + }; + + port@9 { + reg = <9>; + label = "downlink"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + }; + + port@a { + reg = <10>; + label = "uplink"; + phy-mode = "2500base-x"; + managed = "in-band-status"; + sfp = <&sfp_eth1>; + }; + }; + }; +}; diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index f532486b70..aeddff7468 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -14,6 +14,7 @@ #include <mmc.h> #include <miiphy.h> #include <phy.h> +#include <fdt_support.h> #include <asm/global_data.h> #include <asm/io.h> #include <asm/arch/cpu.h> @@ -50,6 +51,7 @@ DECLARE_GLOBAL_DATA_PTR; /* Single-chip mode */ /* Switch Port Registers */ #define MVEBU_SW_LINK_CTRL_REG (1) +#define MVEBU_SW_PORT_SWITCH_ID (3) #define MVEBU_SW_PORT_CTRL_REG (4) #define MVEBU_SW_PORT_BASE_VLAN (6)
@@ -57,6 +59,8 @@ DECLARE_GLOBAL_DATA_PTR; #define MVEBU_G2_SMI_PHY_CMD_REG (24) #define MVEBU_G2_SMI_PHY_DATA_REG (25)
+#define SWITCH_88E6361_PRODUCT_NUMBER 0x2610 + /* * Memory Controller Registers * @@ -73,6 +77,27 @@ DECLARE_GLOBAL_DATA_PTR; #define A3700_MC_CTRL2_SDRAM_TYPE_DDR3 2 #define A3700_MC_CTRL2_SDRAM_TYPE_DDR4 3
+static bool is_edpu_plus(void) +{ + struct udevice *bus; + ofnode node; + int val; + + node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); + if (!ofnode_valid(node) || + uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus) || + device_probe(bus)) { + printf("Cannot find MDIO bus\n"); + return -ENODEV; + } + + val = dm_mdio_read(bus, 0x0, MDIO_DEVAD_NONE, MVEBU_SW_PORT_SWITCH_ID); + if (val == SWITCH_88E6361_PRODUCT_NUMBER) + return true; + else + return false; +} + int board_early_init_f(void) { return 0; @@ -357,6 +382,41 @@ static int espressobin_last_stage_init(void) return 0; }
+static int edpu_plus_last_stage_init(void) +{ + struct udevice *dev; + int ret; + + if (is_edpu_plus()) { + ret = uclass_get_device_by_name(UCLASS_ETH, + "ethernet@40000", + &dev); + if (!ret) { + device_remove(dev, DM_REMOVE_NORMAL); + device_unbind(dev); + } + + /* Currently no networking support on the eDPU+ board */ + ret = uclass_get_device_by_name(UCLASS_ETH, + "ethernet@30000", + &dev); + if (!ret) { + device_remove(dev, DM_REMOVE_NORMAL); + device_unbind(dev); + } + } else { + ret = uclass_get_device_by_name(UCLASS_ETH, + "ethernet@30000", + &dev); + if (!ret) { + device_remove(dev, DM_REMOVE_NORMAL); + device_unbind(dev); + } + } + + return 0; +} + /* Bring-up board-specific network stuff */ static int last_stage_init(void) { @@ -364,6 +424,9 @@ static int last_stage_init(void) if (of_machine_is_compatible("globalscale,espressobin")) return espressobin_last_stage_init();
+ if (of_machine_is_compatible("methode,edpu")) + return edpu_plus_last_stage_init(); + return 0; } EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); @@ -465,12 +528,74 @@ static int espressobin_fdt_setup(void *blob) return 0; }
+static int edpu_plus_fdt_setup(void *blob) +{ + const char *ports[] = { "downlink", "uplink" }; + uint8_t mac[ETH_ALEN]; + const char *path; + int i, ret; + + if (is_edpu_plus()) { + ret = fdt_set_status_by_compatible(blob, + "marvell,orion-mdio", + FDT_STATUS_OKAY); + if (ret) + printf("Failed to enable MDIO!\n"); + + ret = fdt_set_status_by_alias(blob, + "ethernet1", + FDT_STATUS_DISABLED); + if (ret) + printf("Failed to disable ethernet1!\n"); + + path = fdt_get_alias(blob, "ethernet0"); + if (path) + do_fixup_by_path_string(blob, path, "phy-mode", "2500base-x"); + else + printf("Failed to update ethernet0 phy-mode to 2500base-x!\n"); + + ret = fdt_set_status_by_compatible(blob, + "marvell,mv88e6190", + FDT_STATUS_OKAY); + if (ret) + printf("Failed to enable MV88E6361!\n"); + + /* + * MAC-s for Uplink and Downlink ports are stored under + * non standard variable names, so lets manually fixup the + * switch port nodes to have the desired MAC-s. + */ + for (i = 0; i < 2; i++) { + if (eth_env_get_enetaddr(ports[i], mac)) { + do_fixup_by_prop(blob, + "label", + ports[i], + strlen(ports[i]) + 1, + "mac-address", + mac, ARP_HLEN, 1); + + do_fixup_by_prop(blob, + "label", + ports[i], + strlen(ports[i]) + 1, + "local-mac-address", + mac, ARP_HLEN, 1); + } + } + } + + 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 + if (of_machine_is_compatible("methode,edpu")) + return edpu_plus_fdt_setup(blob); + return 0; } #endif diff --git a/configs/eDPU_defconfig b/configs/eDPU_defconfig index f51df7861a..6bd28f9a1a 100644 --- a/configs/eDPU_defconfig +++ b/configs/eDPU_defconfig @@ -17,6 +17,7 @@ CONFIG_DEBUG_UART=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_DISTRO_DEFAULTS=y +CONFIG_OF_BOARD_SETUP=y CONFIG_USE_PREBOOT=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set

On Fri, Oct 20, 2023 at 12:21 PM Robert Marko robert.marko@sartura.hr wrote:
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
Hi Stefan,
Is there anything I can do to get this series merged?
Regards, Robert
board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 04124d8014..1471caa9a6 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; } -- 2.41.0

Hi Robert,
On 11/28/23 11:19, Robert Marko wrote:
On Fri, Oct 20, 2023 at 12:21 PM Robert Marko robert.marko@sartura.hr wrote:
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
Hi Stefan,
Is there anything I can do to get this series merged?
I just looked at it (again). My recollection was that something was missing here - so I was waiting for a new version. Does not seem to be the case though. So I guess I forgot to pull it (sorry for that) and now with rc3 out it seems a bit too late in the release cycle. I hope you don't mind that it's postponed to the next merge window.
Thanks, Stefan
Regards, Robert
board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 04124d8014..1471caa9a6 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"))
#endif return 0; }return espressobin_fdt_setup(blob);
-- 2.41.0
Viele Grüße, Stefan Roese

Hi Robert,
On 11/28/23 16:44, Stefan Roese wrote:
Hi Robert,
On 11/28/23 11:19, Robert Marko wrote:
On Fri, Oct 20, 2023 at 12:21 PM Robert Marko robert.marko@sartura.hr wrote:
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
Hi Stefan,
Is there anything I can do to get this series merged?
I just looked at it (again). My recollection was that something was missing here - so I was waiting for a new version. Does not seem to be the case though. So I guess I forgot to pull it (sorry for that) and now with rc3 out it seems a bit too late in the release cycle. I hope you don't mind that it's postponed to the next merge window.
Seems my memory is not that bad after all. A world CI build fails with these 3 commits. Could you please have a look?
Completed: 84 total built, 84 newly), duration 1:01:11, rate 0.02 + ret=100 + [[ 100 -ne 0 ]] + tools/buildman/buildman -o /tmp -seP am33xx at91_kirkwood mvebu omap -x siemens Summary of current source for 84 boards (2 threads, 1 job per thread) aarch64: w+ x240 turris_mox mvebu_ac5_rd eDPU mvebu_espressobin-88f3720 uDPU clearfog_gt_8k mvebu_db_armada8k mvebu_mcbin-88f8040 mvebu_puzzle-m801-88f8040 mvebu_crb_cn9130 mvebu_db_cn9130 + mvebu_db-88f3720 arm: w+ am335x_shc am335x_shc_ict am335x_shc_netboot am335x_shc_sdboot brsmarc1 cm_t43 chiliboard am335x_igep003x am335x_sl50 am43xx_evm_qspiboot am43xx_hs_evm_qspi controlcenterdc db-88f6720 db-88f6820-gp igep00x0 sniper omap3_beagle omap4_panda omap4_sdp4430 +aarch64-linux-ld.bfd: board/Marvell/mvebu_armada-37xx/board.o: in function `is_edpu_plus': +board/Marvell/mvebu_armada-37xx/board.c:94:(.text.last_stage_init+0xb4): undefined reference to `dm_mdio_read' +make[1]: *** [Makefile:1765: u-boot] Error 139 +make[1]: *** Deleting file 'u-boot' +make: *** [Makefile:177: sub-make] Error 2
Thanks, Stefan
Thanks, Stefan
Regards, Robert
board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 04124d8014..1471caa9a6 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; } -- 2.41.0
Viele Grüße, Stefan Roese
Viele Grüße, Stefan Roese

On Tue, Nov 28, 2023 at 4:49 PM Stefan Roese sr@denx.de wrote:
Hi Robert,
On 11/28/23 16:44, Stefan Roese wrote:
Hi Robert,
On 11/28/23 11:19, Robert Marko wrote:
On Fri, Oct 20, 2023 at 12:21 PM Robert Marko robert.marko@sartura.hr wrote:
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
Hi Stefan,
Is there anything I can do to get this series merged?
I just looked at it (again). My recollection was that something was missing here - so I was waiting for a new version. Does not seem to be the case though. So I guess I forgot to pull it (sorry for that) and now with rc3 out it seems a bit too late in the release cycle. I hope you don't mind that it's postponed to the next merge window.
Seems my memory is not that bad after all. A world CI build fails with these 3 commits. Could you please have a look?
Completed: 84 total built, 84 newly), duration 1:01:11, rate 0.02
- ret=100
- [[ 100 -ne 0 ]]
- tools/buildman/buildman -o /tmp -seP am33xx at91_kirkwood mvebu omap
-x siemens Summary of current source for 84 boards (2 threads, 1 job per thread) aarch64: w+ x240 turris_mox mvebu_ac5_rd eDPU mvebu_espressobin-88f3720 uDPU clearfog_gt_8k mvebu_db_armada8k mvebu_mcbin-88f8040 mvebu_puzzle-m801-88f8040 mvebu_crb_cn9130 mvebu_db_cn9130 + mvebu_db-88f3720 arm: w+ am335x_shc am335x_shc_ict am335x_shc_netboot am335x_shc_sdboot brsmarc1 cm_t43 chiliboard am335x_igep003x am335x_sl50 am43xx_evm_qspiboot am43xx_hs_evm_qspi controlcenterdc db-88f6720 db-88f6820-gp igep00x0 sniper omap3_beagle omap4_panda omap4_sdp4430 +aarch64-linux-ld.bfd: board/Marvell/mvebu_armada-37xx/board.o: in function `is_edpu_plus': +board/Marvell/mvebu_armada-37xx/board.c:94:(.text.last_stage_init+0xb4): undefined reference to `dm_mdio_read' +make[1]: *** [Makefile:1765: u-boot] Error 139 +make[1]: *** Deleting file 'u-boot' +make: *** [Makefile:177: sub-make] Error 2
Ok, seems like CI doesn't have DM MDIO enabled. Will fixup today.
I am fine with pulling the fixed patchset after the stable release.
Regards, Robert
Thanks, Stefan
Thanks, Stefan
Regards, Robert
board/Marvell/mvebu_armada-37xx/board.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 04124d8014..1471caa9a6 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"))
#endif return 0; }return espressobin_fdt_setup(blob);
-- 2.41.0
Viele Grüße, Stefan Roese
Viele Grüße, Stefan Roese
-- DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
participants (2)
-
Robert Marko
-
Stefan Roese