diff options
author | Robert Marko <robert.marko@sartura.hr> | 2023-11-29 11:11:07 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2024-01-10 09:38:55 +0100 |
commit | fde58124c3831cce0e046e0ec7cb4222d72c4fa7 (patch) | |
tree | 8515e6ecbb3b52ecd4d50091cca4a40cdfd38949 /board/Marvell | |
parent | 9a43eb12db36a5b77d904749dabe9141e67180a1 (diff) | |
download | u-boot-fde58124c3831cce0e046e0ec7cb4222d72c4fa7.zip u-boot-fde58124c3831cce0e046e0ec7cb4222d72c4fa7.tar.gz u-boot-fde58124c3831cce0e046e0ec7cb4222d72c4fa7.tar.bz2 |
arm: mvebu: Espressobin: move network setup into a separate function
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>
Diffstat (limited to 'board/Marvell')
-rw-r--r-- | board/Marvell/mvebu_armada-37xx/board.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 1471caa..f532486 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 |