diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-21 21:17:01 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-31 13:16:55 -0400 |
commit | 91caa3bb89b112a1421ee2ee3661baf67c64bab9 (patch) | |
tree | f70b4d2452f8ca45025916cd85f0d1af684902bb /board/Marvell | |
parent | 6a32bfae61652f9dae621410ca6e094f374a1f11 (diff) | |
download | u-boot-91caa3bb89b112a1421ee2ee3661baf67c64bab9.zip u-boot-91caa3bb89b112a1421ee2ee3661baf67c64bab9.tar.gz u-boot-91caa3bb89b112a1421ee2ee3661baf67c64bab9.tar.bz2 |
event: Use an event to replace last_stage_init()WIP/2023-08-31-replace-more-init-hooks-with-events
Add a new event which handles this function. Convert existing use of
the function to use the new event instead.
Make sure that EVENT is enabled by affected boards, by selecting it from
the LAST_STAGE_INIT option. For x86, enable it by default since all boards
need it.
For controlcenterdc, inline the get_tpm() function and make sure the event
is not built in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/Marvell')
-rw-r--r-- | board/Marvell/mvebu_armada-37xx/board.c | 5 | ||||
-rw-r--r-- | board/Marvell/octeon_nic23/board.c | 4 | ||||
-rw-r--r-- | board/Marvell/octeontx2/board.c | 4 |
3 files changed, 10 insertions, 3 deletions
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 3ab6e88..3fe5319 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -8,6 +8,7 @@ #include <dm/device-internal.h> #include <env.h> #include <env_internal.h> +#include <event.h> #include <i2c.h> #include <init.h> #include <mmc.h> @@ -301,7 +302,7 @@ static int mii_multi_chip_mode_write(struct udevice *bus, int dev_smi_addr, } /* Bring-up board-specific network stuff */ -int last_stage_init(void) +static int last_stage_init(void) { struct udevice *bus; ofnode node; @@ -356,6 +357,8 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); + #endif #ifdef CONFIG_OF_BOARD_SETUP diff --git a/board/Marvell/octeon_nic23/board.c b/board/Marvell/octeon_nic23/board.c index 08b1aa4..bc9332c 100644 --- a/board/Marvell/octeon_nic23/board.c +++ b/board/Marvell/octeon_nic23/board.c @@ -5,6 +5,7 @@ #include <cyclic.h> #include <dm.h> +#include <event.h> #include <ram.h> #include <time.h> #include <asm/gpio.h> @@ -364,7 +365,7 @@ int board_late_init(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { struct gpio_desc gpio = {}; ofnode node; @@ -386,3 +387,4 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/board/Marvell/octeontx2/board.c b/board/Marvell/octeontx2/board.c index e7899f4..974e9eb 100644 --- a/board/Marvell/octeontx2/board.c +++ b/board/Marvell/octeontx2/board.c @@ -12,6 +12,7 @@ #include <asm/global_data.h> #include <dm/uclass-internal.h> #include <env.h> +#include <event.h> #include <init.h> #include <malloc.h> #include <net.h> @@ -213,11 +214,12 @@ void board_acquire_flash_arb(bool acquire) } } -int last_stage_init(void) +static int last_stage_init(void) { (void)smc_flsf_fw_booted(); return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); static int do_go_uboot(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |