[PATCH 00/14] event: Replace some more init hooks

This series replaces some more of the init hooks in board_f.c and board_r.c with events. Notably it converts last_state_init() over.
It also provides a 'simple' event spy, which takes no arguments. It turns out that this is quite a common case, so it is worth optimising for this, to reduce code size, before events become too commonly used.
Finally, it introduces a way of emitting an event in an initcall, instead of calling a function. This is likely to be used at least as often as the functions, as we convert more of these initcalls.
As part of this, the initcall code is brought back into a C file. Somehow the compiler has changed or something else, so that this does not confer any benefits now.
For boards with EVENT enabled, this unfortunately results in small growth, e.g. for firefly:
aarch64: (for 1/1 boards) all +114.0 data +16.0 rodata +22.0 text +76.0 arm: (for 1/1 boards) all +82.0 rodata +18.0 text +64.0
For boards without EVENT enabled the growth is smaller, e.g. nokia_rx51:
arm: (for 1/1 boards) all +32.0 data +8.0 rodata -8.0 text +32.0
I cannot find a good way to avoid the latter, other than macro magic with an embedded comma (to completely remove an event entry), which seems nasty.
Simon Glass (14): event: Support a simple spy record Revert "initcall: Move to inline function" initcall: Factor out reloc_off calculation initcall: Adjust the loop logic initcall: Adjust the failure message and return value event: Export event_type_name() initcall: Support emitting events initcall: Support manual relocation event: Convert existing spy records to simple event: Rename EVENT_SPY to EVENT_SPY_FULL event: Update documentation for simple spy x86: Convert arch_fsp_init() to use events freescale: Drop call to init_func_vid() in the init sequence event: Use an event to replace last_stage_init()
arch/Kconfig | 1 + arch/arm/cpu/armv8/fsl-layerscape/spl.c | 5 + arch/arm/mach-imx/imx8/cpu.c | 4 +- arch/arm/mach-imx/imx8m/soc.c | 4 +- arch/arm/mach-imx/imx8ulp/soc.c | 7 +- arch/arm/mach-imx/imx9/soc.c | 4 +- arch/arm/mach-omap2/am33xx/board.c | 4 +- arch/arm/mach-omap2/hwinit-common.c | 12 +- arch/mips/mach-mtmips/cpu.c | 6 +- arch/mips/mach-pic32/cpu.c | 12 +- arch/nios2/cpu/cpu.c | 4 +- arch/riscv/cpu/cpu.c | 4 +- arch/riscv/include/asm/system.h | 2 +- arch/riscv/lib/spl.c | 2 +- arch/sandbox/cpu/start.c | 7 +- arch/x86/cpu/baytrail/cpu.c | 4 +- arch/x86/cpu/broadwell/cpu.c | 4 +- arch/x86/cpu/coreboot/coreboot.c | 7 +- arch/x86/cpu/cpu.c | 10 +- arch/x86/cpu/efi/payload.c | 4 +- arch/x86/cpu/ivybridge/cpu.c | 4 +- arch/x86/cpu/quark/quark.c | 30 +++-- arch/x86/lib/fsp1/fsp_common.c | 1 + arch/x86/lib/fsp2/fsp_common.c | 5 - arch/x86/lib/fsp2/fsp_init.c | 4 +- board/CZ.NIC/turris_mox/turris_mox.c | 4 +- board/Marvell/mvebu_armada-37xx/board.c | 5 +- board/Marvell/octeon_nic23/board.c | 4 +- board/Marvell/octeontx2/board.c | 4 +- board/cortina/presidio-asic/presidio.c | 4 +- board/emulation/qemu-ppce500/qemu-ppce500.c | 4 +- board/freescale/ls1088a/ls1088a.c | 3 +- board/freescale/lx2160a/lx2160a.c | 2 + board/gdsys/a38x/controlcenterdc.c | 31 +++-- board/gdsys/mpc8308/gazerbeam.c | 4 +- board/ge/bx50v3/bx50v3.c | 4 +- board/google/chromebook_coral/coral.c | 4 +- board/keymile/km83xx/km83xx.c | 4 +- board/keymile/kmcent2/kmcent2.c | 7 +- .../keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 10 +- board/phytium/durian/durian.c | 4 +- board/phytium/pomelo/pomelo.c | 4 +- board/starfive/visionfive2/spl.c | 2 +- boot/vbe_request.c | 2 +- boot/vbe_simple_os.c | 2 +- common/Kconfig | 1 + common/board_f.c | 21 +--- common/board_r.c | 20 ++-- common/event.c | 13 ++- configs/bayleybay_defconfig | 1 - configs/cherryhill_defconfig | 1 - configs/chromebook_coral_defconfig | 1 - configs/chromebook_link64_defconfig | 1 - configs/chromebook_link_defconfig | 1 - configs/chromebook_samus_defconfig | 1 - configs/chromebook_samus_tpl_defconfig | 1 - configs/chromebox_panther_defconfig | 1 - ...-qeval20-qa3-e3845-internal-uart_defconfig | 1 - configs/conga-qeval20-qa3-e3845_defconfig | 1 - configs/coreboot64_defconfig | 1 - configs/coreboot_defconfig | 1 - configs/cougarcanyon2_defconfig | 1 - configs/crownbay_defconfig | 1 - configs/dfi-bt700-q7x-151_defconfig | 1 - configs/edison_defconfig | 1 - configs/efi-x86_app32_defconfig | 1 - configs/efi-x86_app64_defconfig | 1 - configs/efi-x86_payload32_defconfig | 1 - configs/efi-x86_payload64_defconfig | 1 - configs/galileo_defconfig | 1 - configs/minnowmax_defconfig | 1 - configs/qemu-x86_64_defconfig | 3 +- configs/qemu-x86_defconfig | 1 - configs/som-db5800-som-6867_defconfig | 1 - ...able-x86-conga-qa3-e3845-pcie-x4_defconfig | 1 - .../theadorable-x86-conga-qa3-e3845_defconfig | 1 - configs/theadorable-x86-dfi-bt700_defconfig | 1 - doc/develop/event.rst | 23 +++- drivers/cpu/microblaze_cpu.c | 4 +- include/event.h | 72 +++++++++++- include/init.h | 15 --- include/initcall.h | 72 +++++------- lib/Makefile | 1 + lib/fwu_updates/fwu.c | 4 +- lib/initcall.c | 109 ++++++++++++++++++ scripts/event_dump.py | 12 +- test/common/event.c | 22 ++++ test/py/tests/test_event_dump.py | 3 +- test/py/tests/test_trace.py | 11 +- 89 files changed, 431 insertions(+), 261 deletions(-) create mode 100644 lib/initcall.c

The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used.
Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use.
Update the event script to find these in the image.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/event.c | 9 ++++++- include/event.h | 41 ++++++++++++++++++++++++++++++-- scripts/event_dump.py | 12 ++++++---- test/common/event.c | 22 +++++++++++++++++ test/py/tests/test_event_dump.py | 3 ++- 5 files changed, 79 insertions(+), 8 deletions(-)
diff --git a/common/event.c b/common/event.c index 3224e2812224..7e2590eb0400 100644 --- a/common/event.c +++ b/common/event.c @@ -71,7 +71,14 @@ static int notify_static(struct event *ev)
log_debug("Sending event %x/%s to spy '%s'\n", ev->type, event_type_name(ev->type), event_spy_id(spy)); - ret = spy->func(NULL, ev); + if (spy->flags & EVSPYF_SIMPLE) { + const struct evspy_info_simple *simple; + + simple = (struct evspy_info_simple *)spy; + ret = simple->func(); + } else { + ret = spy->func(NULL, ev); + }
/* * TODO: Handle various return codes to diff --git a/include/event.h b/include/event.h index daf44bf8a83b..0e3222c2e243 100644 --- a/include/event.h +++ b/include/event.h @@ -99,19 +99,48 @@ struct event { union event_data data; };
+/* Flags for event spy */ +enum evspy_flags { + EVSPYF_SIMPLE = 1 << 0, +}; + /** Function type for event handlers */ typedef int (*event_handler_t)(void *ctx, struct event *event);
+/** Function type for simple event handlers */ +typedef int (*event_handler_simple_t)(void); + /** * struct evspy_info - information about an event spy * * @func: Function to call when the event is activated (must be first) * @type: Event type + * @flag: Flags for this spy * @id: Event id string */ struct evspy_info { event_handler_t func; - enum event_t type; + u8 type; + u8 flags; +#if CONFIG_IS_ENABLED(EVENT_DEBUG) + const char *id; +#endif +}; + +/** + * struct evspy_info_simple - information about an event spy + * + * THis is the 'simple' record, the only difference being the handler function + * + * @func: Function to call when the event is activated (must be first) + * @type: Event type + * @flag: Flags for this spy + * @id: Event id string + */ +struct evspy_info_simple { + event_handler_simple_t func; + u8 type; + u8 flags; #if CONFIG_IS_ENABLED(EVENT_DEBUG) const char *id; #endif @@ -119,9 +148,11 @@ struct evspy_info {
/* Declare a new event spy */ #if CONFIG_IS_ENABLED(EVENT_DEBUG) -#define _ESPY_REC(_type, _func) { _func, _type, #_func, } +#define _ESPY_REC(_type, _func) { _func, _type, 0, #_func, } +#define _ESPY_REC_SIMPLE(_type, _func) { _func, _type, EVSPYF_SIMPLE, #_func, } #else #define _ESPY_REC(_type, _func) { _func, _type, } +#define _ESPY_REC_SIMPLE(_type, _func) { _func, _type, EVSPYF_SIMPLE } #endif
static inline const char *event_spy_id(struct evspy_info *spy) @@ -168,6 +199,12 @@ static inline const char *event_spy_id(struct evspy_info *spy) __used ll_entry_declare(struct evspy_info, _type ## _3_ ## _func, \ evspy_info) = _ESPY_REC(_type, _func)
+/* Simple spy with no function arguemnts */ +#define EVENT_SPY_SIMPLE(_type, _func) \ + __used ll_entry_declare(struct evspy_info_simple, \ + _type ## _3_ ## _func, \ + evspy_info) = _ESPY_REC_SIMPLE(_type, _func) + /** * event_register - register a new spy * diff --git a/scripts/event_dump.py b/scripts/event_dump.py index 0117457526ef..24dfe2bda91f 100755 --- a/scripts/event_dump.py +++ b/scripts/event_dump.py @@ -19,8 +19,10 @@ from u_boot_pylib import tools
# A typical symbol looks like this: # _u_boot_list_2_evspy_info_2_EVT_MISC_INIT_F_3_sandbox_misc_init_f -PREFIX = '_u_boot_list_2_evspy_info_2_' -RE_EVTYPE = re.compile('%s(.*)_3_.*' % PREFIX) +PREFIX_FULL = '_u_boot_list_2_evspy_info_2_' +PREFIX_SIMPLE = '_u_boot_list_2_evspy_info_simple_2_' +RE_EVTYPE_FULL = re.compile('%s(.*)_3_.*' % PREFIX_FULL) +RE_EVTYPE_SIMPLE = re.compile('%s(.*)_3_.*' % PREFIX_SIMPLE)
def show_sym(fname, data, endian, evtype, sym): """Show information about an evspy entry @@ -88,12 +90,14 @@ def show_event_spy_list(fname, endian): fname (str): Filename of ELF file endian (str): Endianness to use ('little', 'big', 'auto') """ - syms = elf.GetSymbolFileOffset(fname, [PREFIX]) + syms = elf.GetSymbolFileOffset(fname, [PREFIX_FULL, PREFIX_SIMPLE]) data = tools.read_file(fname) print('%-20s %-30s %s' % ('Event type', 'Id', 'Source location')) print('%-20s %-30s %s' % ('-' * 20, '-' * 30, '-' * 30)) for name, sym in syms.items(): - m_evtype = RE_EVTYPE.search(name) + m_evtype = RE_EVTYPE_FULL.search(name) + if not m_evtype: + m_evtype = RE_EVTYPE_SIMPLE.search(name) evtype = m_evtype .group(1) show_sym(fname, data, endian, evtype, sym)
diff --git a/test/common/event.c b/test/common/event.c index 6037ae2ce3bc..c0912a3437bb 100644 --- a/test/common/event.c +++ b/test/common/event.c @@ -18,6 +18,8 @@ struct test_state { int val; };
+static bool called; + static int h_adder(void *ctx, struct event *event) { struct event_data_test *data = &event->data.test; @@ -28,6 +30,14 @@ static int h_adder(void *ctx, struct event *event) return 0; }
+static int h_adder_simple(void) +{ + called = true; + + return 0; +} +EVENT_SPY_SIMPLE(EVT_TEST, h_adder_simple); + static int test_event_base(struct unit_test_state *uts) { struct test_state state; @@ -46,6 +56,18 @@ static int test_event_base(struct unit_test_state *uts) } COMMON_TEST(test_event_base, 0);
+static int test_event_simple(struct unit_test_state *uts) +{ + called = false; + + /* Check that the handler is called */ + ut_assertok(event_notify_null(EVT_TEST)); + ut_assert(called); + + return 0; +} +COMMON_TEST(test_event_simple, 0); + static int h_probe(void *ctx, struct event *event) { struct test_state *test_state = ctx; diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py index da196df4c3e6..041f8f9c9790 100644 --- a/test/py/tests/test_event_dump.py +++ b/test/py/tests/test_event_dump.py @@ -18,5 +18,6 @@ def test_event_dump(u_boot_console): -------------------- ------------------------------ ------------------------------ EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*boot/vbe_request.c:.* EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*boot/vbe_simple_os.c:.* -EVT_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:''' +EVT_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:.* +EVT_TEST h_adder_simple .*test/common/event.c:''' assert re.match(expect, out, re.MULTILINE) is not None

Somehow I do not see any inlining with initcalls now. I was sure I saw it when this commit went in, but now it seems to make things worse.
This reverts commit 47870afab92fca6e672c03d0dea802a55e200675.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_r.c | 5 ++++- include/initcall.h | 46 +--------------------------------------- lib/Makefile | 1 + lib/initcall.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 46 deletions(-) create mode 100644 lib/initcall.c
diff --git a/common/board_r.c b/common/board_r.c index 598155c7753d..85860861f0ac 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -583,7 +583,10 @@ static int run_main_loop(void) }
/* - * We hope to remove most of the driver-related init and do it if/when + * Over time we hope to remove these functions with code fragments and + * stub functions, and instead call the relevant function directly. + * + * We also hope to remove most of the driver-related init and do it if/when * the driver is later used. * * TODO: perhaps reset the watchdog in the initcall function after each call? diff --git a/include/initcall.h b/include/initcall.h index 69ce26807051..01f3f2833f10 100644 --- a/include/initcall.h +++ b/include/initcall.h @@ -8,50 +8,6 @@
typedef int (*init_fnc_t)(void);
-#include <log.h> -#ifdef CONFIG_EFI_APP -#include <efi.h> -#endif -#include <asm/global_data.h> - -/* - * To enable debugging. add #define DEBUG at the top of the including file. - * - * To find a symbol, use grep on u-boot.map - */ -static inline int initcall_run_list(const init_fnc_t init_sequence[]) -{ - const init_fnc_t *init_fnc_ptr; - - for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { - unsigned long reloc_ofs = 0; - int ret; - - /* - * Sandbox is relocated by the OS, so symbols always appear at - * the relocated address. - */ - if (IS_ENABLED(CONFIG_SANDBOX) || (gd->flags & GD_FLG_RELOC)) - reloc_ofs = gd->reloc_off; -#ifdef CONFIG_EFI_APP - reloc_ofs = (unsigned long)image_base; -#endif - if (reloc_ofs) - debug("initcall: %p (relocated to %p)\n", - (char *)*init_fnc_ptr - reloc_ofs, - (char *)*init_fnc_ptr); - else - debug("initcall: %p\n", (char *)*init_fnc_ptr - reloc_ofs); - - ret = (*init_fnc_ptr)(); - if (ret) { - printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, - (char *)*init_fnc_ptr - reloc_ofs, ret); - return -1; - } - } - return 0; -} +int initcall_run_list(const init_fnc_t init_sequence[]);
#endif diff --git a/lib/Makefile b/lib/Makefile index 8d8ccc8bbc39..839872d804b5 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -44,6 +44,7 @@ obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o obj-$(CONFIG_SMBIOS_PARSER) += smbios-parser.o obj-$(CONFIG_IMAGE_SPARSE) += image-sparse.o +obj-y += initcall.o obj-y += ldiv.o obj-$(CONFIG_XXHASH) += xxhash.o obj-y += net_utils.o diff --git a/lib/initcall.c b/lib/initcall.c new file mode 100644 index 000000000000..eedb0fbf1d5c --- /dev/null +++ b/lib/initcall.c @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) 2013 The Chromium OS Authors. + */ + +#include <common.h> +#include <efi.h> +#include <initcall.h> +#include <log.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +/* + * To enable debugging. add #define DEBUG at the top of the including file. + * + * To find a symbol, use grep on u-boot.map + */ +int initcall_run_list(const init_fnc_t init_sequence[]) +{ + const init_fnc_t *init_fnc_ptr; + + for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { + unsigned long reloc_ofs = 0; + int ret; + + /* + * Sandbox is relocated by the OS, so symbols always appear at + * the relocated address. + */ + if (IS_ENABLED(CONFIG_SANDBOX) || (gd->flags & GD_FLG_RELOC)) + reloc_ofs = gd->reloc_off; +#ifdef CONFIG_EFI_APP + reloc_ofs = (unsigned long)image_base; +#endif + if (reloc_ofs) + debug("initcall: %p (relocated to %p)\n", + (char *)*init_fnc_ptr - reloc_ofs, + (char *)*init_fnc_ptr); + else + debug("initcall: %p\n", (char *)*init_fnc_ptr - reloc_ofs); + + ret = (*init_fnc_ptr)(); + if (ret) { + printf("initcall sequence %p failed at call %p (err=%d)\n", + init_sequence, + (char *)*init_fnc_ptr - reloc_ofs, ret); + return -1; + } + } + return 0; +}

Move this into a function and do it once, not each time around the loop.
Signed-off-by: Simon Glass sjg@chromium.org ---
lib/initcall.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/lib/initcall.c b/lib/initcall.c index eedb0fbf1d5c..89a68b2444fe 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -11,6 +11,20 @@
DECLARE_GLOBAL_DATA_PTR;
+static ulong calc_reloc_ofs(void) +{ +#ifdef CONFIG_EFI_APP + return (ulong)image_base; +#endif + /* + * Sandbox is relocated by the OS, so symbols always appear at + * the relocated address. + */ + if (IS_ENABLED(CONFIG_SANDBOX) || (gd->flags & GD_FLG_RELOC)) + return gd->reloc_off; + + return 0; +} /* * To enable debugging. add #define DEBUG at the top of the including file. * @@ -18,21 +32,12 @@ DECLARE_GLOBAL_DATA_PTR; */ int initcall_run_list(const init_fnc_t init_sequence[]) { + ulong reloc_ofs = calc_reloc_ofs(); const init_fnc_t *init_fnc_ptr;
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { - unsigned long reloc_ofs = 0; int ret;
- /* - * Sandbox is relocated by the OS, so symbols always appear at - * the relocated address. - */ - if (IS_ENABLED(CONFIG_SANDBOX) || (gd->flags & GD_FLG_RELOC)) - reloc_ofs = gd->reloc_off; -#ifdef CONFIG_EFI_APP - reloc_ofs = (unsigned long)image_base; -#endif if (reloc_ofs) debug("initcall: %p (relocated to %p)\n", (char *)*init_fnc_ptr - reloc_ofs,

Use a variable to hold the function, so we don't need to repeat the pointer access each time. Rename the init pointer to 'ptr' since we only refer to it in the for() statement now.
Signed-off-by: Simon Glass sjg@chromium.org ---
lib/initcall.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/initcall.c b/lib/initcall.c index 89a68b2444fe..81c5d2450735 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -33,25 +33,25 @@ static ulong calc_reloc_ofs(void) int initcall_run_list(const init_fnc_t init_sequence[]) { ulong reloc_ofs = calc_reloc_ofs(); - const init_fnc_t *init_fnc_ptr; + const init_fnc_t *ptr; + init_fnc_t func; + int ret = 0;
- for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { - int ret; - - if (reloc_ofs) + for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) { + if (reloc_ofs) { debug("initcall: %p (relocated to %p)\n", - (char *)*init_fnc_ptr - reloc_ofs, - (char *)*init_fnc_ptr); - else - debug("initcall: %p\n", (char *)*init_fnc_ptr - reloc_ofs); + (char *)func - reloc_ofs, func); + } else { + debug("initcall: %p\n", (char *)func - reloc_ofs); + }
- ret = (*init_fnc_ptr)(); + ret = func(); if (ret) { printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, - (char *)*init_fnc_ptr - reloc_ofs, ret); + init_sequence, (char *)func - reloc_ofs, ret); return -1; } } + return 0; }

Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along.
Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with:
grep -A1 -B1 serial_init u-boot.map
Signed-off-by: Simon Glass sjg@chromium.org ---
lib/initcall.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/initcall.c b/lib/initcall.c index 81c5d2450735..0f74cef32f85 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[]) }
ret = func(); - if (ret) { - printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, (char *)func - reloc_ofs, ret); - return -1; - } + } + + if (ret) { + printf("initcall failed at call %p (err=%dE)\n", + (char *)func - reloc_ofs, ret); + + return ret; }
return 0;

Hi Simon,
út 22. 8. 2023 v 5:18 odesílatel Simon Glass sjg@chromium.org napsal:
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along.
Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with:
grep -A1 -B1 serial_init u-boot.map
Signed-off-by: Simon Glass sjg@chromium.org
lib/initcall.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/initcall.c b/lib/initcall.c index 81c5d2450735..0f74cef32f85 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[]) }
ret = func();
if (ret) {
printf("initcall sequence %p failed at call %p
(err=%d)\n",
init_sequence, (char *)func - reloc_ofs,
ret);
return -1;
}
}
if (ret) {
printf("initcall failed at call %p (err=%dE)\n",
(char *)func - reloc_ofs, ret);
return ret; } return 0;
-- 2.42.0.rc1.204.g551eb34607-goog
I am debugging one issue and I get output like this. And I dig into it and find out that failures are not reported on the function which is causing it but on the next one. It is because of pointer is moved to next function;
This is what I see. initcall: 0000000008072de8, 0 initcall failed at call 000000000802b14c (err=-19)
And this is the problematic part. for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) {
Fix should be of course to get that if(ret) code back but maybe you want to see different solution.
Thanks, Michal

Hi Simon,
On 3/22/24 11:22, Michal Simek wrote:
Hi Simon,
út 22. 8. 2023 v 5:18 odesílatel Simon Glass <sjg@chromium.org mailto:sjg@chromium.org> napsal:
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along. Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with: grep -A1 -B1 serial_init u-boot.map Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>> --- lib/initcall.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/initcall.c b/lib/initcall.c index 81c5d2450735..0f74cef32f85 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[]) } ret = func(); - if (ret) { - printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, (char *)func - reloc_ofs, ret); - return -1; - } + } + + if (ret) { + printf("initcall failed at call %p (err=%dE)\n", + (char *)func - reloc_ofs, ret); + + return ret; } return 0; -- 2.42.0.rc1.204.g551eb34607-goog
I am debugging one issue and I get output like this. And I dig into it and find out that failures are not reported on the function which is causing it but on the next one. It is because of pointer is moved to next function;
This is what I see. initcall: 0000000008072de8, 0 initcall failed at call 000000000802b14c (err=-19)
And this is the problematic part. for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) {
Fix should be of course to get that if(ret) code back but maybe you want to see different solution.
Any comment on this one?
M

Hi Michal,
On Fri, 2 Aug 2024 at 03:21, Michal Simek michal.simek@amd.com wrote:
Hi Simon,
On 3/22/24 11:22, Michal Simek wrote:
Hi Simon,
út 22. 8. 2023 v 5:18 odesílatel Simon Glass <sjg@chromium.org mailto:sjg@chromium.org> napsal:
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along. Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with: grep -A1 -B1 serial_init u-boot.map Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>> --- lib/initcall.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/initcall.c b/lib/initcall.c index 81c5d2450735..0f74cef32f85 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[]) } ret = func(); - if (ret) { - printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, (char *)func - reloc_ofs, ret); - return -1; - } + } + + if (ret) { + printf("initcall failed at call %p (err=%dE)\n", + (char *)func - reloc_ofs, ret); + + return ret; } return 0; -- 2.42.0.rc1.204.g551eb34607-goog
I am debugging one issue and I get output like this. And I dig into it and find out that failures are not reported on the function which is causing it but on the next one. It is because of pointer is moved to next function;
This is what I see. initcall: 0000000008072de8, 0 initcall failed at call 000000000802b14c (err=-19)
And this is the problematic part. for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) {
Fix should be of course to get that if(ret) code back but maybe you want to see different solution.
Any comment on this one?
Yes it was fixed by this, I believe, although no Fixes tag unfortunately: 7554388c1d1 initcall: break loop immediately on failure
Regards, Simon

On 8/6/24 23:50, Simon Glass wrote:
Hi Michal,
On Fri, 2 Aug 2024 at 03:21, Michal Simek michal.simek@amd.com wrote:
Hi Simon,
On 3/22/24 11:22, Michal Simek wrote:
Hi Simon,
út 22. 8. 2023 v 5:18 odesílatel Simon Glass <sjg@chromium.org mailto:sjg@chromium.org> napsal:
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along. Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with: grep -A1 -B1 serial_init u-boot.map Signed-off-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>> --- lib/initcall.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/initcall.c b/lib/initcall.c index 81c5d2450735..0f74cef32f85 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[]) } ret = func(); - if (ret) { - printf("initcall sequence %p failed at call %p (err=%d)\n", - init_sequence, (char *)func - reloc_ofs, ret); - return -1; - } + } + + if (ret) { + printf("initcall failed at call %p (err=%dE)\n", + (char *)func - reloc_ofs, ret); + + return ret; } return 0; -- 2.42.0.rc1.204.g551eb34607-goog
I am debugging one issue and I get output like this. And I dig into it and find out that failures are not reported on the function which is causing it but on the next one. It is because of pointer is moved to next function;
This is what I see. initcall: 0000000008072de8, 0 initcall failed at call 000000000802b14c (err=-19)
And this is the problematic part. for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) {
Fix should be of course to get that if(ret) code back but maybe you want to see different solution.
Any comment on this one?
Yes it was fixed by this, I believe, although no Fixes tag unfortunately: 7554388c1d1 initcall: break loop immediately on failure
perfect.
Thanks, Michal

Export this function so it can be used with initcall debugging.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/event.c | 2 +- include/event.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/common/event.c b/common/event.c index 7e2590eb0400..55f6932ef62c 100644 --- a/common/event.c +++ b/common/event.c @@ -49,7 +49,7 @@ const char *const type_name[] = { _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size"); #endif
-static const char *event_type_name(enum event_t type) +const char *event_type_name(enum event_t type) { #if CONFIG_IS_ENABLED(EVENT_DEBUG) return type_name[type]; diff --git a/include/event.h b/include/event.h index 0e3222c2e243..062b5847897e 100644 --- a/include/event.h +++ b/include/event.h @@ -230,6 +230,14 @@ void event_show_spy_list(void); */ int event_manual_reloc(void);
+/** + * event_type_name() - Get the name of an event type + * + * @type: Type to check + * Return: Name of event, or "(unknown)" if not known + */ +const char *event_type_name(enum event_t type); + /** * event_notify() - notify spies about an event *

At present the initcall list consists of a list of function pointers. Over time the initcall lists will likely change to mostly emitting events, since most of the calls are board- or arch-specific.
As a first step, allow an initcall to be an event type instead of a function pointer. Add the required macro and update initcall_run_list() to emit an event in that case, or ignore it if events are not enabled.
The bottom 8 bits of the function pointer are used to hold the event type, with the rest being all ones. This should avoid any collision, since initcalls should not be above 0xffffff00 in memory.
Convert misc_init_f over to use this mechanism.
Add comments to the initcall header file while we are here. Also fix up the trace test to handle the change.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_f.c | 7 +----- include/initcall.h | 25 +++++++++++++++++++ lib/initcall.c | 50 +++++++++++++++++++++++++++++++++---- test/py/tests/test_trace.py | 11 ++++---- 4 files changed, 77 insertions(+), 16 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c index 2f986d9b2890..a485ba62fa17 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -836,11 +836,6 @@ __weak int clear_bss(void) return 0; }
-static int misc_init_f(void) -{ - return event_notify_null(EVT_MISC_INIT_F); -} - static const init_fnc_t init_sequence_f[] = { setup_mon_len, #ifdef CONFIG_OF_CONTROL @@ -899,7 +894,7 @@ static const init_fnc_t init_sequence_f[] = { show_board_info, #endif INIT_FUNC_WATCHDOG_INIT - misc_init_f, + INITCALL_EVENT(EVT_MISC_INIT_F), INIT_FUNC_WATCHDOG_RESET #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) init_func_i2c, diff --git a/include/initcall.h b/include/initcall.h index 01f3f2833f10..62d3bb67f089 100644 --- a/include/initcall.h +++ b/include/initcall.h @@ -6,8 +6,33 @@ #ifndef __INITCALL_H #define __INITCALL_H
+#include <asm/types.h> +#include <event.h> + +_Static_assert(EVT_COUNT < 256, "Can only support 256 event types with 8 bits"); + +/** + * init_fnc_t - Init function + * + * Return: 0 if OK -ve on error + */ typedef int (*init_fnc_t)(void);
+/* Top bit indicates that the initcall is an event */ +#define INITCALL_IS_EVENT GENMASK(BITS_PER_LONG - 1, 8) +#define INITCALL_EVENT_TYPE GENMASK(7, 0) + +#define INITCALL_EVENT(_type) (void *)((_type) | INITCALL_IS_EVENT) + +/** + * initcall_run_list() - Run through a list of function calls + * + * This calls functions one after the other, stopping at the first error, or + * when NULL is obtained. + * + * @init_sequence: NULL-terminated init sequence to run + * Return: 0 if OK, or -ve error code from the first failure + */ int initcall_run_list(const init_fnc_t init_sequence[]);
#endif diff --git a/lib/initcall.c b/lib/initcall.c index 0f74cef32f85..33b7d761dc7e 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -7,6 +7,7 @@ #include <efi.h> #include <initcall.h> #include <log.h> +#include <relocate.h> #include <asm/global_data.h>
DECLARE_GLOBAL_DATA_PTR; @@ -25,6 +26,23 @@ static ulong calc_reloc_ofs(void)
return 0; } + +/** + * initcall_is_event() - Get the event number for an initcall + * + * func: Function pointer to check + * Return: Event number, if this is an event, else 0 + */ +static int initcall_is_event(init_fnc_t func) +{ + ulong val = (ulong)func; + + if ((val & INITCALL_IS_EVENT) == INITCALL_IS_EVENT) + return val & INITCALL_EVENT_TYPE; + + return 0; +} + /* * To enable debugging. add #define DEBUG at the top of the including file. * @@ -34,23 +52,45 @@ int initcall_run_list(const init_fnc_t init_sequence[]) { ulong reloc_ofs = calc_reloc_ofs(); const init_fnc_t *ptr; + enum event_t type; init_fnc_t func; int ret = 0;
for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) { - if (reloc_ofs) { + type = initcall_is_event(func); + + if (type) { + if (!CONFIG_IS_ENABLED(EVENT)) + continue; + debug("initcall: event %d/%s\n", type, + event_type_name(type)); + } else if (reloc_ofs) { debug("initcall: %p (relocated to %p)\n", - (char *)func - reloc_ofs, func); + (char *)func - reloc_ofs, (char *)func); } else { debug("initcall: %p\n", (char *)func - reloc_ofs); }
- ret = func(); + ret = type ? event_notify_null(type) : func(); }
if (ret) { - printf("initcall failed at call %p (err=%dE)\n", - (char *)func - reloc_ofs, ret); + if (CONFIG_IS_ENABLED(EVENT)) { + char buf[60]; + + /* don't worry about buf size as we are dying here */ + if (type) { + sprintf(buf, "event %d/%s", type, + event_type_name(type)); + } else { + sprintf(buf, "call %p", func); + } + + printf("initcall failed at %s (err=%dE)\n", buf, ret); + } else { + printf("initcall failed at call %p (err=%d)\n", + (char *)func - reloc_ofs, ret); + }
return ret; } diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index ac3e95925e95..326d98e0d156 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -175,7 +175,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): # Then look for this: # u-boot-1 [000] 282.101375: funcgraph_exit: 0.006 us | } # Then check for this: - # u-boot-1 [000] 282.101375: funcgraph_entry: 0.000 us | event_init(); + # u-boot-1 [000] 282.101375: funcgraph_entry: 0.000 us | initcall_is_event();
expected_indent = None found_start = False @@ -197,8 +197,9 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): elif found_start and indent == expected_indent and brace == '}': found_end = True
- # The next function after initf_bootstage() exits should be event_init() - assert upto == 'event_init()' + # The next function after initf_bootstage() exits should be + # initcall_is_event() + assert upto == 'initcall_is_event()'
# Now look for initf_dm() and dm_timer_init() so we can check the bootstage # time @@ -247,7 +248,7 @@ def check_flamegraph(cons, fname, proftool, map_fname, trace_fg): # We expect dm_timer_init() to be called twice: once before relocation and # once after look1 = 'initf_dm;dm_timer_init 1' - look2 = 'board_init_r;initr_dm_devices;dm_timer_init 1' + look2 = 'board_init_r;initcall_run_list;initr_dm_devices;dm_timer_init 1' found = 0 with open(trace_fg, 'r') as fd: for line in fd: @@ -272,7 +273,7 @@ def check_flamegraph(cons, fname, proftool, map_fname, trace_fg): total += count return total
- +check_flamegraph @pytest.mark.slow @pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec('trace')

Move the manual-relocation code to the initcall file. Make sure to avoid manually relocating event types. Only true function pointers should be relocated.
Signed-off-by: Simon Glass sjg@chromium.org ---
common/board_r.c | 6 ++---- include/initcall.h | 7 +++++++ lib/initcall.c | 10 ++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/common/board_r.c b/common/board_r.c index 85860861f0ac..7c1fbc69ed6d 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -813,10 +813,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) #endif gd->flags &= ~GD_FLG_LOG_READY;
- if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) { - for (int i = 0; i < ARRAY_SIZE(init_sequence_r); i++) - MANUAL_RELOC(init_sequence_r[i]); - } + if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) + initcall_manual_reloc(init_sequence_r);
if (initcall_run_list(init_sequence_r)) hang(); diff --git a/include/initcall.h b/include/initcall.h index 62d3bb67f089..208effd8d13e 100644 --- a/include/initcall.h +++ b/include/initcall.h @@ -35,4 +35,11 @@ typedef int (*init_fnc_t)(void); */ int initcall_run_list(const init_fnc_t init_sequence[]);
+/** + * initcall_manual_reloc() - Do manual relocation on an initcall sequence + * + * @init_sequence: NULL-terminated init sequence to relocate + */ +void initcall_manual_reloc(init_fnc_t init_sequence[]); + #endif diff --git a/lib/initcall.c b/lib/initcall.c index 33b7d761dc7e..480490ea239d 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -97,3 +97,13 @@ int initcall_run_list(const init_fnc_t init_sequence[])
return 0; } + +void initcall_manual_reloc(init_fnc_t init_sequence[]) +{ + init_fnc_t *ptr; + + for (ptr = init_sequence; *ptr; ptr++) { + if (!initcall_is_event(*ptr)) + MANUAL_RELOC(*ptr); + } +}

Very few of the existing event-spy records use the arguments they are passed. Update them to use a simple spy instead, to simplify the code.
Where an adaptor function is currently used, remove it where possible.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/mach-imx/imx8/cpu.c | 4 +-- arch/arm/mach-imx/imx8m/soc.c | 4 +-- arch/arm/mach-imx/imx8ulp/soc.c | 7 +---- arch/arm/mach-imx/imx9/soc.c | 4 +-- arch/arm/mach-omap2/am33xx/board.c | 4 +-- arch/arm/mach-omap2/hwinit-common.c | 12 +++------ arch/mips/mach-pic32/cpu.c | 10 ++----- arch/nios2/cpu/cpu.c | 4 +-- arch/riscv/cpu/cpu.c | 4 +-- arch/riscv/include/asm/system.h | 2 +- arch/riscv/lib/spl.c | 2 +- arch/sandbox/cpu/start.c | 7 +---- arch/x86/cpu/baytrail/cpu.c | 4 +-- arch/x86/cpu/broadwell/cpu.c | 4 +-- arch/x86/cpu/ivybridge/cpu.c | 4 +-- arch/x86/cpu/quark/quark.c | 26 +++++++------------ arch/x86/lib/fsp2/fsp_init.c | 4 +-- board/google/chromebook_coral/coral.c | 4 +-- board/keymile/kmcent2/kmcent2.c | 4 +-- .../keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 4 +-- board/starfive/visionfive2/spl.c | 2 +- drivers/cpu/microblaze_cpu.c | 4 +-- lib/fwu_updates/fwu.c | 4 +-- test/py/tests/test_event_dump.py | 2 +- 24 files changed, 52 insertions(+), 78 deletions(-)
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index c62357044e01..39ac0bc4140b 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -69,7 +69,7 @@ int arch_cpu_init(void) return 0; }
-static int imx8_init_mu(void *ctx, struct event *event) +static int imx8_init_mu(void) { struct udevice *devp; int node, ret; @@ -91,7 +91,7 @@ static int imx8_init_mu(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, imx8_init_mu); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, imx8_init_mu);
#if defined(CONFIG_ARCH_MISC_INIT) int arch_misc_init(void) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 78b775f449d9..431ad959f533 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -532,7 +532,7 @@ static void imx_set_wdog_powerdown(bool enable) writew(enable, &wdog3->wmcr); }
-static int imx8m_check_clock(void *ctx, struct event *event) +static int imx8m_check_clock(void) { struct udevice *dev; int ret; @@ -549,7 +549,7 @@ static int imx8m_check_clock(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, imx8m_check_clock); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, imx8m_check_clock);
static void imx8m_setup_snvs(void) { diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index e23cf60d126f..fd436dd88514 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -803,12 +803,7 @@ int imx8ulp_dm_post_init(void)
return 0; } - -static int imx8ulp_evt_dm_post_init(void *ctx, struct event *event) -{ - return imx8ulp_dm_post_init(); -} -EVENT_SPY(EVT_DM_POST_INIT_F, imx8ulp_evt_dm_post_init); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, imx8ulp_dm_post_init);
#if defined(CONFIG_SPL_BUILD) __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c index f43b73a6c219..5d8687b6f438 100644 --- a/arch/arm/mach-imx/imx9/soc.c +++ b/arch/arm/mach-imx/imx9/soc.c @@ -552,7 +552,7 @@ int arch_cpu_init(void) return 0; }
-int imx9_probe_mu(void *ctx, struct event *event) +int imx9_probe_mu(void) { struct udevice *devp; int node, ret; @@ -576,7 +576,7 @@ int imx9_probe_mu(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, imx9_probe_mu); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, imx9_probe_mu);
int timer_init(void) { diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index ecc0a592e993..a6307251c1fc 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -527,7 +527,7 @@ void board_init_f(ulong dummy)
#endif
-static int am33xx_dm_post_init(void *ctx, struct event *event) +static int am33xx_dm_post_init(void) { hw_data_init(); #if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) @@ -535,4 +535,4 @@ static int am33xx_dm_post_init(void *ctx, struct event *event) #endif return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, am33xx_dm_post_init); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, am33xx_dm_post_init); diff --git a/arch/arm/mach-omap2/hwinit-common.c b/arch/arm/mach-omap2/hwinit-common.c index 771533394bcd..0e4572ca41a7 100644 --- a/arch/arm/mach-omap2/hwinit-common.c +++ b/arch/arm/mach-omap2/hwinit-common.c @@ -174,7 +174,7 @@ void __weak init_package_revision(void) * done in each of these cases * This function is called with SRAM stack. */ -void early_system_init(void) +int early_system_init(void) { #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_MULTI_DTB_FIT) int ret; @@ -225,6 +225,8 @@ void early_system_init(void) debug_uart_init(); #endif prcm_init(); + + return 0; }
#ifdef CONFIG_SPL_BUILD @@ -240,13 +242,7 @@ void board_init_f(ulong dummy) } #endif
-static int omap2_system_init(void *ctx, struct event *event) -{ - early_system_init(); - - return 0; -} -EVENT_SPY(EVT_DM_POST_INIT_F, omap2_system_init); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, early_system_init);
/* * Routine: wait_for_command_complete diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index ec3c2505313c..785a87b618b6 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -95,14 +95,8 @@ static void prefetch_init(void) iounmap(regs); }
-/* arch specific CPU init after DM */ -static int pic32_flash_prefetch(void *ctx, struct event *event) -{ - /* flash prefetch */ - prefetch_init(); - return 0; -} -EVENT_SPY(EVT_DM_POST_INIT_F, pic32_flash_prefetch); +/* arch-specific CPU init after DM: flash prefetch */ +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, prefetch_init);
/* Un-gate DDR2 modules (gated by default) */ static void ddr2_pmd_ungate(void) diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index da167f4b29e9..79a54d1bc259 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -64,7 +64,7 @@ static void copy_exception_trampoline(void) } #endif
-static int nios_cpu_setup(void *ctx, struct event *event) +static int nios_cpu_setup(void) { struct udevice *dev; int ret; @@ -80,7 +80,7 @@ static int nios_cpu_setup(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, nios_cpu_setup); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, nios_cpu_setup);
static int altera_nios2_get_desc(const struct udevice *dev, char *buf, int size) diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index ecfb1fb08c4b..4c050333c29d 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -91,7 +91,7 @@ static void dummy_pending_ipi_clear(ulong hart, ulong arg0, ulong arg1) } #endif
-int riscv_cpu_setup(void *ctx, struct event *event) +int riscv_cpu_setup(void) { int ret;
@@ -145,7 +145,7 @@ int riscv_cpu_setup(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, riscv_cpu_setup); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, riscv_cpu_setup);
int arch_early_init_r(void) { diff --git a/arch/riscv/include/asm/system.h b/arch/riscv/include/asm/system.h index ffa7649f3f9e..87a804bfd5f7 100644 --- a/arch/riscv/include/asm/system.h +++ b/arch/riscv/include/asm/system.h @@ -26,6 +26,6 @@ struct event; } while (0)
/* Hook to set up the CPU (called from SPL too) */ -int riscv_cpu_setup(void *ctx, struct event *event); +int riscv_cpu_setup(void);
#endif /* __ASM_RISCV_SYSTEM_H */ diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c index f4d3b67e5dd0..9b242ed82129 100644 --- a/arch/riscv/lib/spl.c +++ b/arch/riscv/lib/spl.c @@ -28,7 +28,7 @@ __weak void board_init_f(ulong dummy) if (ret) panic("spl_early_init() failed: %d\n", ret);
- riscv_cpu_setup(NULL, NULL); + riscv_cpu_setup();
preloader_console_init();
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 234652872ecc..1026898727f5 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -119,12 +119,7 @@ int sandbox_early_getopt_check(void)
os_exit(0); } - -static int sandbox_misc_init_f(void *ctx, struct event *event) -{ - return sandbox_early_getopt_check(); -} -EVENT_SPY(EVT_MISC_INIT_F, sandbox_misc_init_f); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, sandbox_early_getopt_check);
static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char *arg) { diff --git a/arch/x86/cpu/baytrail/cpu.c b/arch/x86/cpu/baytrail/cpu.c index 4a7b4f617f8a..c270426d8208 100644 --- a/arch/x86/cpu/baytrail/cpu.c +++ b/arch/x86/cpu/baytrail/cpu.c @@ -45,7 +45,7 @@ static void hsuart_clock_set(void *base) * Configure the internal clock of both SIO HS-UARTs, if they are enabled * via FSP */ -static int baytrail_uart_init(void *ctx, struct event *event) +static int baytrail_uart_init(void) { struct udevice *dev; void *base; @@ -64,7 +64,7 @@ static int baytrail_uart_init(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, baytrail_uart_init); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, baytrail_uart_init);
static void set_max_freq(void) { diff --git a/arch/x86/cpu/broadwell/cpu.c b/arch/x86/cpu/broadwell/cpu.c index f30aebfe4c62..560b1f7893f6 100644 --- a/arch/x86/cpu/broadwell/cpu.c +++ b/arch/x86/cpu/broadwell/cpu.c @@ -25,7 +25,7 @@ #include <asm/arch/pch.h> #include <asm/arch/rcb.h>
-static int broadwell_init_cpu(void *ctx, struct event *event) +static int broadwell_init_cpu(void) { struct udevice *dev; int ret; @@ -40,7 +40,7 @@ static int broadwell_init_cpu(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, broadwell_init_cpu); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, broadwell_init_cpu);
void set_max_freq(void) { diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index c988d7ff477f..e71a10bfd441 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -54,7 +54,7 @@ int arch_cpu_init(void) return x86_cpu_init_f(); }
-static int ivybridge_cpu_init(void *ctx, struct event *ev) +static int ivybridge_cpu_init(void) { struct pci_controller *hose; struct udevice *bus, *dev; @@ -86,7 +86,7 @@ static int ivybridge_cpu_init(void *ctx, struct event *ev)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, ivybridge_cpu_init); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, ivybridge_cpu_init);
#define PCH_EHCI0_TEMP_BAR0 0xe8000000 #define PCH_EHCI1_TEMP_BAR0 0xe8000400 diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index 1be8e38cdf41..86d90d84ddba 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -248,22 +248,16 @@ int arch_cpu_init(void) return 0; }
-static int quark_init_pcie(void *ctx, struct event *event) -{ - /* - * Initialize PCIe controller - * - * Quark SoC holds the PCIe controller in reset following a power on. - * U-Boot needs to release the PCIe controller from reset. The PCIe - * controller (D23:F0/F1) will not be visible in PCI configuration - * space and any access to its PCI configuration registers will cause - * system hang while it is held in reset. - */ - quark_pcie_early_init(); - - return 0; -} -EVENT_SPY(EVT_DM_POST_INIT_F, quark_init_pcie); +/* + * Initialize PCIe controller + * + * Quark SoC holds the PCIe controller in reset following a power on. + * U-Boot needs to release the PCIe controller from reset. The PCIe + * controller (D23:F0/F1) will not be visible in PCI configuration + * space and any access to its PCI configuration registers will cause + * system hang while it is held in reset. + */ +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, quark_pcie_early_init);
int checkcpu(void) { diff --git a/arch/x86/lib/fsp2/fsp_init.c b/arch/x86/lib/fsp2/fsp_init.c index afec7d08d67f..aadc08cf3c44 100644 --- a/arch/x86/lib/fsp2/fsp_init.c +++ b/arch/x86/lib/fsp2/fsp_init.c @@ -19,7 +19,7 @@ #include <dm/uclass-internal.h> #include <asm/fsp2/fsp_internal.h>
-int fsp_setup_pinctrl(void *ctx, struct event *event) +int fsp_setup_pinctrl(void) { struct udevice *dev; ofnode node; @@ -42,7 +42,7 @@ int fsp_setup_pinctrl(void *ctx, struct event *event)
return ret; } -EVENT_SPY(EVT_DM_POST_INIT_F, fsp_setup_pinctrl); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, fsp_setup_pinctrl);
#if !defined(CONFIG_TPL_BUILD) binman_sym_declare(ulong, intel_fsp_m, image_pos); diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index 9e23f5cd31e7..9d9168d608a1 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -33,7 +33,7 @@ struct cros_gpio_info { int flags; };
-static int coral_check_ll_boot(void *ctx, struct event *event) +static int coral_check_ll_boot(void) { if (!ll_boot_init()) { printf("Running as secondary loader"); @@ -57,7 +57,7 @@ static int coral_check_ll_boot(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_MISC_INIT_F, coral_check_ll_boot); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, coral_check_ll_boot);
int arch_misc_init(void) { diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c index ed552c57b5fa..7e655175c577 100644 --- a/board/keymile/kmcent2/kmcent2.c +++ b/board/keymile/kmcent2/kmcent2.c @@ -182,7 +182,7 @@ unsigned long get_serial_clock(unsigned long dummy) return (gd->bus_clk / 2); }
-static int kmcent2_misc_init_f(void *ctx, struct event *event) +static int kmcent2_misc_init_f(void) { /* configure QRIO pis for i2c deblocking */ i2c_deblock_gpio_cfg(); @@ -210,7 +210,7 @@ static int kmcent2_misc_init_f(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_MISC_INIT_F, kmcent2_misc_init_f); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, kmcent2_misc_init_f);
#define USED_SRDS_BANK 0 #define EXPECTED_SRDS_RFCK SRDS_PLLCR0_RFCK_SEL_100 diff --git a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c index 2f1731eea6a0..d7f47959ebd7 100644 --- a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c +++ b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c @@ -110,14 +110,14 @@ int board_early_init_f(void) return 0; }
-static int pg_wcom_misc_init_f(void *ctx, struct event *event) +static int pg_wcom_misc_init_f(void) { if (IS_ENABLED(CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED)) check_for_uboot_update();
return 0; } -EVENT_SPY(EVT_MISC_INIT_F, pg_wcom_misc_init_f); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, pg_wcom_misc_init_f);
int board_init(void) { diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index 7acd3995aad8..ad5f71a20180 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -218,7 +218,7 @@ void board_init_f(ulong dummy) if (ret) panic("spl_early_init() failed: %d\n", ret);
- riscv_cpu_setup(NULL, NULL); + riscv_cpu_setup(); preloader_console_init();
/* Set the parent clock of cpu_root clock to pll0, diff --git a/drivers/cpu/microblaze_cpu.c b/drivers/cpu/microblaze_cpu.c index c97a89fbd5c8..a229f6913b07 100644 --- a/drivers/cpu/microblaze_cpu.c +++ b/drivers/cpu/microblaze_cpu.c @@ -19,7 +19,7 @@ DECLARE_GLOBAL_DATA_PTR; ci = tmp; \ }
-static int microblaze_cpu_probe_all(void *ctx, struct event *event) +static int microblaze_cpu_probe_all(void) { int ret;
@@ -29,7 +29,7 @@ static int microblaze_cpu_probe_all(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_DM_POST_INIT_F, microblaze_cpu_probe_all); +EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, microblaze_cpu_probe_all);
static void microblaze_set_cpuinfo_pvr(struct microblaze_cpuinfo *ci) { diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c index 4d0c8b84b9d0..006f6da4b9a9 100644 --- a/lib/fwu_updates/fwu.c +++ b/lib/fwu_updates/fwu.c @@ -618,7 +618,7 @@ int fwu_trial_state_ctr_start(void) return ret; }
-static int fwu_boottime_checks(void *ctx, struct event *event) +static int fwu_boottime_checks(void) { int ret; u32 boot_idx, active_idx; @@ -682,4 +682,4 @@ static int fwu_boottime_checks(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_MAIN_LOOP, fwu_boottime_checks); +EVENT_SPY_SIMPLE(EVT_MAIN_LOOP, fwu_boottime_checks); diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py index 041f8f9c9790..a6df9e10e54e 100644 --- a/test/py/tests/test_event_dump.py +++ b/test/py/tests/test_event_dump.py @@ -18,6 +18,6 @@ def test_event_dump(u_boot_console): -------------------- ------------------------------ ------------------------------ EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*boot/vbe_request.c:.* EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*boot/vbe_simple_os.c:.* -EVT_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:.* +EVT_MISC_INIT_F sandbox_early_getopt_check .*arch/sandbox/cpu/start.c:.* EVT_TEST h_adder_simple .*test/common/event.c:''' assert re.match(expect, out, re.MULTILINE) is not None

The new name makes it clearer that this is for a full spy, with access to the context and the event data.
Signed-off-by: Simon Glass sjg@chromium.org ---
boot/vbe_request.c | 2 +- boot/vbe_simple_os.c | 2 +- include/event.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/boot/vbe_request.c b/boot/vbe_request.c index 312edfa2bdb5..2f218d4bf97c 100644 --- a/boot/vbe_request.c +++ b/boot/vbe_request.c @@ -230,4 +230,4 @@ static int bootmeth_vbe_ft_fixup(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_FT_FIXUP, bootmeth_vbe_ft_fixup); +EVENT_SPY_FULL(EVT_FT_FIXUP, bootmeth_vbe_ft_fixup); diff --git a/boot/vbe_simple_os.c b/boot/vbe_simple_os.c index 8c641ec07e2d..3285e438a568 100644 --- a/boot/vbe_simple_os.c +++ b/boot/vbe_simple_os.c @@ -109,4 +109,4 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event)
return 0; } -EVENT_SPY(EVT_FT_FIXUP, bootmeth_vbe_simple_ft_fixup); +EVENT_SPY_FULL(EVT_FT_FIXUP, bootmeth_vbe_simple_ft_fixup); diff --git a/include/event.h b/include/event.h index 062b5847897e..b2cfd65c9f8b 100644 --- a/include/event.h +++ b/include/event.h @@ -195,7 +195,7 @@ static inline const char *event_spy_id(struct evspy_info *spy) * away the linker-list entry sometimes, e.g. with the EVT_FT_FIXUP entry in * vbe_simple.c - so for now, make it global. */ -#define EVENT_SPY(_type, _func) \ +#define EVENT_SPY_FULL(_type, _func) \ __used ll_entry_declare(struct evspy_info, _type ## _3_ ## _func, \ evspy_info) = _ESPY_REC(_type, _func)

Now that we have two types of spy, mention this in the documentation. Put the simple spy first, since it seems to be the common case.
Signed-off-by: Simon Glass sjg@chromium.org ---
doc/develop/event.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/doc/develop/event.rst b/doc/develop/event.rst index cb09e9c85a9a..d5043ec4f4ca 100644 --- a/doc/develop/event.rst +++ b/doc/develop/event.rst @@ -21,16 +21,31 @@ Declaring a spy
To declare a spy, use something like this::
- static int snow_setup_cpus(void *ctx, struct event *event) + static int snow_check_temperature(void) { /* do something */ return 0; } - EVENT_SPY(EVT_DM_POST_INIT_F, snow_setup_cpus); + EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, snow_check_temperature);
This function is called when EVT_DM_POST_INIT_F is emitted, i.e. after the driver model is initialized (in U-Boot proper before and after relocation).
+If you need access to the event data, use `EVENT_SPY_FULL`, like this:: + + static int snow_setup_cpus(void *ctx, struct event *event) + { + /* do something that uses event->data*/ + return 0; + } + EVENT_SPY_FULL(EVT_DM_POST_INIT_F, snow_setup_cpus); + +Note that the context is always NULL for a static spy. See below for information +about how to use a dynamic spy. + +The return value is handled by the event emitter. If non-zero, then the error +is returned to the function which emitted the event, i.e. the one that called +`event_notify()`.
Debugging --------- @@ -80,6 +95,10 @@ to be notified when a particular device is probed or removed. This can be handled by enabling `CONFIG_EVENT_DYNAMIC`. It is then possible to call `event_register()` to register a new handler for a particular event.
+If some context is need for the spy, you can pass a pointer to +`event_register()` to provide that. Note that the context is only passed to +a spy registered with `EVENT_SPY_FULL`. + Dynamic event handlers are called after all the static event spy handlers have been processed. Of course, since dynamic event handlers are created at runtime it is not possible to use the `event_dump.py` to see them.

Convert this to use events instead of calling a function directly in the init sequence.
Rename it to arch_fsp_init_f() to distinguish it from the one that happens after relocation.
For FSPv2 nothing needs to be done here, so drop the empty function.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/x86/lib/fsp1/fsp_common.c | 1 + arch/x86/lib/fsp2/fsp_common.c | 5 ----- common/board_f.c | 4 +--- common/event.c | 1 + include/event.h | 9 +++++++++ include/init.h | 11 ----------- 6 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/arch/x86/lib/fsp1/fsp_common.c b/arch/x86/lib/fsp1/fsp_common.c index 20926171822d..df18f4767562 100644 --- a/arch/x86/lib/fsp1/fsp_common.c +++ b/arch/x86/lib/fsp1/fsp_common.c @@ -101,3 +101,4 @@ int arch_fsp_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_FSP_INIT_F, arch_fsp_init); diff --git a/arch/x86/lib/fsp2/fsp_common.c b/arch/x86/lib/fsp2/fsp_common.c index 20c3f6406adf..d802a86967d5 100644 --- a/arch/x86/lib/fsp2/fsp_common.c +++ b/arch/x86/lib/fsp2/fsp_common.c @@ -8,11 +8,6 @@ #include <init.h> #include <asm/fsp/fsp_support.h>
-int arch_fsp_init(void) -{ - return 0; -} - void board_final_cleanup(void) { u32 status; diff --git a/common/board_f.c b/common/board_f.c index a485ba62fa17..46008bac6595 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -855,9 +855,7 @@ static const init_fnc_t init_sequence_f[] = { #if defined(CONFIG_CONSOLE_RECORD_INIT_F) console_record_init, #endif -#if defined(CONFIG_HAVE_FSP) - arch_fsp_init, -#endif + INITCALL_EVENT(EVT_FSP_INIT_F), arch_cpu_init, /* basic arch cpu dependent setup */ mach_cpu_init, /* SoC/machine dependent CPU setup */ initf_dm, diff --git a/common/event.c b/common/event.c index 55f6932ef62c..8a6190888845 100644 --- a/common/event.c +++ b/common/event.c @@ -35,6 +35,7 @@ const char *const type_name[] = {
/* init hooks */ "misc_init_f", + "fsp_init_r",
/* Fpga load hook */ "fpga_load", diff --git a/include/event.h b/include/event.h index b2cfd65c9f8b..85269aa317aa 100644 --- a/include/event.h +++ b/include/event.h @@ -32,6 +32,15 @@ enum event_t { /* Init hooks */ EVT_MISC_INIT_F,
+ /* + * Emitted before relocation to set up Firmware Support Package + * + * Where U-Boot relies on binary blobs to handle part of the system + * init, this event can be used to set up the blobs. This is used on + * some Intel platforms + */ + EVT_FSP_INIT_F, + /* Fpga load hook */ EVT_FPGA_LOAD,
diff --git a/include/init.h b/include/init.h index 3bf30476a2e0..1bf76e4eff72 100644 --- a/include/init.h +++ b/include/init.h @@ -57,17 +57,6 @@ int arch_cpu_init(void); */ int mach_cpu_init(void);
-/** - * arch_fsp_init() - perform firmware support package init - * - * Where U-Boot relies on binary blobs to handle part of the system init, this - * function can be used to set up the blobs. This is used on some Intel - * platforms. - * - * Return: 0 - */ -int arch_fsp_init(void); - /** * arch_fsp_init() - perform post-relocation firmware support package init *

Use the misc_init_f event instead, which is designed for this purpose.
All boards with CONFIG_VID already enable CONFIG_EVENT.
Signed-off-by: Simon Glass sjg@chromium.org ---
arch/arm/cpu/armv8/fsl-layerscape/spl.c | 5 +++++ board/freescale/ls1088a/ls1088a.c | 3 ++- board/freescale/lx2160a/lx2160a.c | 2 ++ common/board_f.c | 10 ---------- include/init.h | 3 --- 5 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c index 61fced451eb5..033f48d04b90 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c @@ -78,6 +78,11 @@ void tzpc_init(void) #endif }
+__weak int init_func_vid(void) +{ + return 0; +} + void board_init_f(ulong dummy) { int ret; diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c index 7a1047a77f73..f2b8bec03729 100644 --- a/board/freescale/ls1088a/ls1088a.c +++ b/board/freescale/ls1088a/ls1088a.c @@ -181,13 +181,14 @@ unsigned long long get_qixis_addr(void) #endif
#if defined(CONFIG_VID) -int init_func_vid(void) +static int setup_core_voltage(void) { if (adjust_vdd(0) < 0) printf("core voltage not adjusted\n");
return 0; } +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, setup_core_voltage);
u16 soc_get_fuse_vid(int vid_index) { diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index d631a11ff667..2883848550af 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -13,6 +13,7 @@ #include <i2c.h> #include <malloc.h> #include <errno.h> +#include <event.h> #include <netdev.h> #include <fsl_ddr.h> #include <asm/io.h> @@ -242,6 +243,7 @@ int init_func_vid(void) return 0; } #endif +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, init_func_vid);
int checkboard(void) { diff --git a/common/board_f.c b/common/board_f.c index 46008bac6595..aef395b1354e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -280,13 +280,6 @@ static int init_func_i2c(void) } #endif
-#if defined(CONFIG_VID) -__weak int init_func_vid(void) -{ - return 0; -} -#endif - static int setup_mon_len(void) { #if defined(__ARM__) || defined(__MICROBLAZE__) @@ -896,9 +889,6 @@ static const init_fnc_t init_sequence_f[] = { INIT_FUNC_WATCHDOG_RESET #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) init_func_i2c, -#endif -#if defined(CONFIG_VID) && !defined(CONFIG_SPL) - init_func_vid, #endif announce_dram_init, dram_init, /* configure available RAM banks */ diff --git a/include/init.h b/include/init.h index 1bf76e4eff72..13579db75900 100644 --- a/include/init.h +++ b/include/init.h @@ -276,9 +276,6 @@ int set_cpu_clk_info(void); int update_flash_size(int flash_size); int arch_early_init_r(void); int misc_init_r(void); -#if defined(CONFIG_VID) -int init_func_vid(void); -#endif
/* common/board_info.c */ int checkboard(void);

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 ---
arch/Kconfig | 1 + arch/mips/mach-mtmips/cpu.c | 6 +++- arch/mips/mach-pic32/cpu.c | 4 ++- arch/x86/cpu/coreboot/coreboot.c | 7 ++++- arch/x86/cpu/cpu.c | 10 ++++-- arch/x86/cpu/efi/payload.c | 4 ++- arch/x86/cpu/quark/quark.c | 4 ++- board/CZ.NIC/turris_mox/turris_mox.c | 4 ++- board/Marvell/mvebu_armada-37xx/board.c | 5 ++- board/Marvell/octeon_nic23/board.c | 4 ++- board/Marvell/octeontx2/board.c | 4 ++- board/cortina/presidio-asic/presidio.c | 4 ++- board/emulation/qemu-ppce500/qemu-ppce500.c | 4 ++- board/gdsys/a38x/controlcenterdc.c | 31 +++++++++---------- board/gdsys/mpc8308/gazerbeam.c | 4 ++- board/ge/bx50v3/bx50v3.c | 4 ++- board/keymile/km83xx/km83xx.c | 4 ++- board/keymile/kmcent2/kmcent2.c | 3 +- .../keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 6 +--- board/phytium/durian/durian.c | 4 ++- board/phytium/pomelo/pomelo.c | 4 ++- common/Kconfig | 1 + common/board_r.c | 9 +----- common/event.c | 1 + configs/bayleybay_defconfig | 1 - configs/cherryhill_defconfig | 1 - configs/chromebook_coral_defconfig | 1 - configs/chromebook_link64_defconfig | 1 - configs/chromebook_link_defconfig | 1 - configs/chromebook_samus_defconfig | 1 - configs/chromebook_samus_tpl_defconfig | 1 - configs/chromebox_panther_defconfig | 1 - ...-qeval20-qa3-e3845-internal-uart_defconfig | 1 - configs/conga-qeval20-qa3-e3845_defconfig | 1 - configs/coreboot64_defconfig | 1 - configs/coreboot_defconfig | 1 - configs/cougarcanyon2_defconfig | 1 - configs/crownbay_defconfig | 1 - configs/dfi-bt700-q7x-151_defconfig | 1 - configs/edison_defconfig | 1 - configs/efi-x86_app32_defconfig | 1 - configs/efi-x86_app64_defconfig | 1 - configs/efi-x86_payload32_defconfig | 1 - configs/efi-x86_payload64_defconfig | 1 - configs/galileo_defconfig | 1 - configs/minnowmax_defconfig | 1 - configs/qemu-x86_64_defconfig | 3 +- configs/qemu-x86_defconfig | 1 - configs/som-db5800-som-6867_defconfig | 1 - ...able-x86-conga-qa3-e3845-pcie-x4_defconfig | 1 - .../theadorable-x86-conga-qa3-e3845_defconfig | 1 - configs/theadorable-x86-dfi-bt700_defconfig | 1 - include/event.h | 12 +++++++ include/init.h | 1 - 54 files changed, 95 insertions(+), 80 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig index c9a335922528..90345cbee0d8 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -252,6 +252,7 @@ config X86 imply DM_SPI imply DM_SPI_FLASH imply DM_USB + imply LAST_STAGE_INIT imply VIDEO imply SYSRESET imply SPL_SYSRESET diff --git a/arch/mips/mach-mtmips/cpu.c b/arch/mips/mach-mtmips/cpu.c index f1e902273863..e88dab10c76e 100644 --- a/arch/mips/mach-mtmips/cpu.c +++ b/arch/mips/mach-mtmips/cpu.c @@ -4,6 +4,7 @@ */
#include <common.h> +#include <event.h> #include <init.h> #include <malloc.h> #include <asm/addrspace.h> @@ -21,7 +22,8 @@ int dram_init(void) return 0; }
-int last_stage_init(void) +#ifndef CONFIG_SPL_BUILD +static int last_stage_init(void) { void *src, *dst;
@@ -46,3 +48,5 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); +#endif diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c index 785a87b618b6..7ed306e045ea 100644 --- a/arch/mips/mach-pic32/cpu.c +++ b/arch/mips/mach-pic32/cpu.c @@ -57,7 +57,7 @@ static ulong clk_get_cpu_rate(void) }
/* initialize prefetch module related to cpu_clk */ -static void prefetch_init(void) +static int prefetch_init(void) { struct pic32_reg_atomic *regs; const void __iomem *base; @@ -93,6 +93,8 @@ static void prefetch_init(void) /* Enable prefetch for all */ writel(0x30, ®s->set); iounmap(regs); + + return 0; }
/* arch-specific CPU init after DM: flash prefetch */ diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index d7eedbd7436e..835b2c777462 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -7,6 +7,7 @@
#include <common.h> #include <cpu_func.h> +#include <event.h> #include <fdtdec.h> #include <init.h> #include <usb.h> @@ -74,8 +75,11 @@ static void board_final_init(void) } }
-int last_stage_init(void) +static int last_stage_init(void) { + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return 0; + /* start usb so that usb keyboard can be used as input device */ if (IS_ENABLED(CONFIG_USB_KEYBOARD)) usb_init(); @@ -84,3 +88,4 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index dddd281e966c..ce55efc454bf 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -26,6 +26,7 @@ #include <cpu_func.h> #include <dm.h> #include <errno.h> +#include <event.h> #include <init.h> #include <irq.h> #include <log.h> @@ -185,7 +186,8 @@ void show_boot_progress(int val) } #endif
-#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB) +#if !defined(CONFIG_SYS_COREBOOT) && !defined(CONFIG_EFI_STUB) && \ + !defined(CONFIG_SPL_BUILD) /* * Implement a weak default function for boards that need to do some final init * before the system is ready. @@ -202,7 +204,7 @@ __weak void board_final_cleanup(void) { }
-int last_stage_init(void) +static int last_stage_init(void) { struct acpi_fadt __maybe_unused *fadt; int ret; @@ -245,7 +247,9 @@ int last_stage_init(void)
return 0; } -#endif +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); + +#endif /* !SYS_COREBOOT && !EFI_STUB && !SPL_BUILD */
static int x86_init_cpus(void) { diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c index d8920effd398..708bfbe7ee48 100644 --- a/arch/x86/cpu/efi/payload.c +++ b/arch/x86/cpu/efi/payload.c @@ -9,6 +9,7 @@ #include <efi.h> #include <efi_api.h> #include <errno.h> +#include <event.h> #include <init.h> #include <log.h> #include <usb.h> @@ -168,7 +169,7 @@ int reserve_arch(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { /* start usb so that usb keyboard can be used as input device */ if (IS_ENABLED(CONFIG_USB_KEYBOARD)) @@ -176,6 +177,7 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
unsigned int install_e820_map(unsigned int max_entries, struct e820_entry *entries) diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index 86d90d84ddba..62b83c228cfb 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -107,7 +107,7 @@ static void quark_setup_bars(void) CONFIG_PCIE_ECAM_BASE | MEM_BAR_EN); }
-static void quark_pcie_early_init(void) +static int quark_pcie_early_init(void) { /* * Step1: Assert PCIe signal PERST# @@ -146,6 +146,8 @@ static void quark_pcie_early_init(void) /* Mixer Load Lane 1 */ msg_port_io_clrbits(MSG_PORT_PCIE_AFE, PCIE_RXPICTRL0_L1, (1 << 6) | (1 << 7)); + + return 0; }
static void quark_usb_early_init(void) diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c index a52a032e4d5d..370c2668b081 100644 --- a/board/CZ.NIC/turris_mox/turris_mox.c +++ b/board/CZ.NIC/turris_mox/turris_mox.c @@ -15,6 +15,7 @@ #include <dm.h> #include <dm/of_extra.h> #include <env.h> +#include <event.h> #include <fdt_support.h> #include <init.h> #include <led.h> @@ -667,7 +668,7 @@ err: return NULL; }
-int last_stage_init(void) +static int last_stage_init(void) { struct gpio_desc reset_gpio = {};
@@ -712,6 +713,7 @@ handle_reset_btn:
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
#if defined(CONFIG_OF_BOARD_SETUP)
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 3ab6e8873d84..3fe5319437ea 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 08b1aa4b6efe..bc9332cb74a3 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 e7899f49f0c2..974e9eb82001 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[]) diff --git a/board/cortina/presidio-asic/presidio.c b/board/cortina/presidio-asic/presidio.c index aae0a5dac066..fdfa3affc3b1 100644 --- a/board/cortina/presidio-asic/presidio.c +++ b/board/cortina/presidio-asic/presidio.c @@ -4,6 +4,7 @@ * */ #include <common.h> +#include <event.h> #include <init.h> #include <malloc.h> #include <errno.h> @@ -121,7 +122,7 @@ void reset_cpu(void) }
#ifdef CONFIG_LAST_STAGE_INIT -int last_stage_init(void) +static int last_stage_init(void) { u32 val;
@@ -134,4 +135,5 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); #endif diff --git a/board/emulation/qemu-ppce500/qemu-ppce500.c b/board/emulation/qemu-ppce500/qemu-ppce500.c index a39bcb4fa0c7..7ca8773b17e5 100644 --- a/board/emulation/qemu-ppce500/qemu-ppce500.c +++ b/board/emulation/qemu-ppce500/qemu-ppce500.c @@ -9,6 +9,7 @@ #include <cpu_func.h> #include <dm.h> #include <env.h> +#include <event.h> #include <init.h> #include <log.h> #include <net.h> @@ -184,7 +185,7 @@ int misc_init_r(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { void *fdt = get_fdt_virt(); int len = 0; @@ -204,6 +205,7 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
static uint64_t get_linear_ram_size(void) { diff --git a/board/gdsys/a38x/controlcenterdc.c b/board/gdsys/a38x/controlcenterdc.c index ccebba72721f..0f620c2d9172 100644 --- a/board/gdsys/a38x/controlcenterdc.c +++ b/board/gdsys/a38x/controlcenterdc.c @@ -7,6 +7,7 @@ #include <common.h> #include <command.h> #include <dm.h> +#include <event.h> #include <init.h> #include <miiphy.h> #include <net.h> @@ -35,19 +36,6 @@ DECLARE_GLOBAL_DATA_PTR; #define DB_GP_88F68XX_GPP_POL_LOW 0x0 #define DB_GP_88F68XX_GPP_POL_MID 0x0
-static int get_tpm(struct udevice **devp) -{ - int rc; - - rc = uclass_first_device_err(UCLASS_TPM, devp); - if (rc) { - printf("Could not find TPM (ret=%d)\n", rc); - return CMD_RET_FAILURE; - } - - return 0; -} - /* * Define the DDR layout / topology here in the board file. This will * be used by the DDR3 init code in the SPL U-Boot version to configure @@ -284,15 +272,22 @@ int board_fix_fdt(void *rw_fdt_blob) return 0; }
-int last_stage_init(void) +#ifndef CONFIG_SPL_BUILD +static int last_stage_init(void) { struct udevice *tpm; int ret;
-#ifndef CONFIG_SPL_BUILD + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return 0; ccdc_eth_init(); -#endif - ret = get_tpm(&tpm); + + ret = uclass_first_device_err(UCLASS_TPM, &tpm); + if (ret) { + printf("Could not find TPM (ret=%d)\n", ret); + return ret; + } + if (ret || tpm_init(tpm) || tpm1_startup(tpm, TPM_ST_CLEAR) || tpm1_continue_self_test(tpm)) { return 1; @@ -305,3 +300,5 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); +#endif diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c index ba88401f13da..cc608c4ac434 100644 --- a/board/gdsys/mpc8308/gazerbeam.c +++ b/board/gdsys/mpc8308/gazerbeam.c @@ -9,6 +9,7 @@ #include <command.h> #include <dm.h> #include <env.h> +#include <event.h> #include <fdt_support.h> #include <fsl_esdhc.h> #include <init.h> @@ -124,7 +125,7 @@ static void display_osd_info(struct udevice *osd, osd_info->width, osd_info->height); }
-int last_stage_init(void) +static int last_stage_init(void) { int fpga_hw_rev = 0; int i; @@ -179,6 +180,7 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
#if defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 4e9d841fe291..2d8951964a85 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -5,6 +5,7 @@ * Copyright 2012 Freescale Semiconductor, Inc. */
+#include <event.h> #include <image.h> #include <init.h> #include <asm/arch/clock.h> @@ -531,7 +532,7 @@ static void remove_ethaddr_env_var(int index) env_set(env_var_name, NULL); }
-int last_stage_init(void) +static int last_stage_init(void) { int i;
@@ -544,6 +545,7 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
int checkboard(void) { diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 8f2d873bc68f..acd13105dd55 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -15,6 +15,7 @@
#include <common.h> #include <env.h> +#include <event.h> #include <fdt_support.h> #include <init.h> #include <ioports.h> @@ -184,7 +185,7 @@ int misc_init_r(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { #if defined(CONFIG_TARGET_KMCOGE5NE) /* @@ -202,6 +203,7 @@ int last_stage_init(void) set_km_env(); return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
static int fixed_sdram(void) { diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c index 7e655175c577..572cc7bbdc67 100644 --- a/board/keymile/kmcent2/kmcent2.c +++ b/board/keymile/kmcent2/kmcent2.c @@ -261,7 +261,7 @@ int hush_init_var(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { const char *kmem; /* DIP switch support on BFTIC */ @@ -287,6 +287,7 @@ int last_stage_init(void)
return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
void fdt_fixup_fman_mac_addresses(void *blob) { diff --git a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c index d7f47959ebd7..21c21aac221f 100644 --- a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c +++ b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c @@ -215,8 +215,4 @@ int hush_init_var(void) return 0; }
-int last_stage_init(void) -{ - set_km_env(); - return 0; -} +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, set_km_env); diff --git a/board/phytium/durian/durian.c b/board/phytium/durian/durian.c index ee484749bcf1..0a4048d4982f 100644 --- a/board/phytium/durian/durian.c +++ b/board/phytium/durian/durian.c @@ -8,6 +8,7 @@ #include <common.h> #include <command.h> #include <cpu_func.h> +#include <event.h> #include <init.h> #include <log.h> #include <asm/armv8/mmu.h> @@ -99,7 +100,7 @@ int __asm_flush_l3_dcache(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { int ret;
@@ -113,3 +114,4 @@ int last_stage_init(void) } return ret; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/board/phytium/pomelo/pomelo.c b/board/phytium/pomelo/pomelo.c index 75d2636bf453..960e491c7687 100644 --- a/board/phytium/pomelo/pomelo.c +++ b/board/phytium/pomelo/pomelo.c @@ -7,6 +7,7 @@
#include <stdio.h> #include <command.h> +#include <event.h> #include <init.h> #include <asm/armv8/mmu.h> #include <asm/io.h> @@ -102,7 +103,7 @@ int __asm_flush_l3_dcache(void) return 0; }
-int last_stage_init(void) +static int last_stage_init(void) { int ret;
@@ -116,3 +117,4 @@ int last_stage_init(void) } return ret; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/common/Kconfig b/common/Kconfig index 0b09bd68bd13..d916194b9423 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -720,6 +720,7 @@ config SYS_FSL_CLK
config LAST_STAGE_INIT bool "Call board-specific as last setup step" + select EVENT help Some boards need to perform initialisation immediately before control is passed to the command-line interpreter (e.g. for initializations diff --git a/common/board_r.c b/common/board_r.c index 7c1fbc69ed6d..ad9a3cf6336a 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -773,15 +773,8 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_POST initr_post, #endif -#ifdef CONFIG_LAST_STAGE_INIT INIT_FUNC_WATCHDOG_RESET - /* - * Some parts can be only initialized if all others (like - * Interrupts) are up and running (i.e. the PC-style ISA - * keyboard). - */ - last_stage_init, -#endif + INITCALL_EVENT(EVT_LAST_STAGE_INIT), #if defined(CFG_PRAM) initr_mem, #endif diff --git a/common/event.c b/common/event.c index 8a6190888845..4845104b17dc 100644 --- a/common/event.c +++ b/common/event.c @@ -36,6 +36,7 @@ const char *const type_name[] = { /* init hooks */ "misc_init_f", "fsp_init_r", + "last_stage_init",
/* Fpga load hook */ "fpga_load", diff --git a/configs/bayleybay_defconfig b/configs/bayleybay_defconfig index a44c9b714be6..573f1b48645a 100644 --- a/configs/bayleybay_defconfig +++ b/configs/bayleybay_defconfig @@ -25,7 +25,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/cherryhill_defconfig b/configs/cherryhill_defconfig index 00799715e8f9..59c3986a2e78 100644 --- a/configs/cherryhill_defconfig +++ b/configs/cherryhill_defconfig @@ -18,7 +18,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/chromebook_coral_defconfig b/configs/chromebook_coral_defconfig index 152f297c350b..5394396f8fc6 100644 --- a/configs/chromebook_coral_defconfig +++ b/configs/chromebook_coral_defconfig @@ -40,7 +40,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_LOG=y CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_BLOBLIST=y # CONFIG_TPL_BLOBLIST is not set CONFIG_BLOBLIST_ADDR=0x100000 diff --git a/configs/chromebook_link64_defconfig b/configs/chromebook_link64_defconfig index 558609e13d66..eb8923ceeff7 100644 --- a/configs/chromebook_link64_defconfig +++ b/configs/chromebook_link64_defconfig @@ -29,7 +29,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_SPL_NO_BSS_LIMIT=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y diff --git a/configs/chromebook_link_defconfig b/configs/chromebook_link_defconfig index 96c26f1c3776..4347cad33db1 100644 --- a/configs/chromebook_link_defconfig +++ b/configs/chromebook_link_defconfig @@ -25,7 +25,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 diff --git a/configs/chromebook_samus_defconfig b/configs/chromebook_samus_defconfig index 4019c169a4c7..3b6a1732c111 100644 --- a/configs/chromebook_samus_defconfig +++ b/configs/chromebook_samus_defconfig @@ -25,7 +25,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 diff --git a/configs/chromebook_samus_tpl_defconfig b/configs/chromebook_samus_tpl_defconfig index 4cfaf4bc5c79..33ada9fe4f93 100644 --- a/configs/chromebook_samus_tpl_defconfig +++ b/configs/chromebook_samus_tpl_defconfig @@ -30,7 +30,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_BLOBLIST=y CONFIG_BLOBLIST_ADDR=0xff7c0000 diff --git a/configs/chromebox_panther_defconfig b/configs/chromebox_panther_defconfig index f050d066be41..4351a811528b 100644 --- a/configs/chromebox_panther_defconfig +++ b/configs/chromebox_panther_defconfig @@ -21,7 +21,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 diff --git a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig index 656d575998c7..1515246086ea 100644 --- a/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +++ b/configs/conga-qeval20-qa3-e3845-internal-uart_defconfig @@ -31,7 +31,6 @@ CONFIG_BOOTCOMMAND="load scsi 0:2 03000000 /boot/vmlinuz-${kernel-ver}-generic;l CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/conga-qeval20-qa3-e3845_defconfig b/configs/conga-qeval20-qa3-e3845_defconfig index 54dc59e8a134..d62fb997c993 100644 --- a/configs/conga-qeval20-qa3-e3845_defconfig +++ b/configs/conga-qeval20-qa3-e3845_defconfig @@ -27,7 +27,6 @@ CONFIG_BOOTCOMMAND="load scsi 0:2 03000000 /boot/vmlinuz-${kernel-ver}-generic;l CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig index 8aadaa68c279..2793e2c0b9d1 100644 --- a/configs/coreboot64_defconfig +++ b/configs/coreboot64_defconfig @@ -19,7 +19,6 @@ CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_SPL_NO_BSS_LIMIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig index 8e11de663819..f196ed776d0b 100644 --- a/configs/coreboot_defconfig +++ b/configs/coreboot_defconfig @@ -20,7 +20,6 @@ CONFIG_LOG=y CONFIG_LOGF_LINE=y CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y diff --git a/configs/cougarcanyon2_defconfig b/configs/cougarcanyon2_defconfig index da5ff5573d05..71c79f5fb8da 100644 --- a/configs/cougarcanyon2_defconfig +++ b/configs/cougarcanyon2_defconfig @@ -20,7 +20,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/crownbay_defconfig b/configs/crownbay_defconfig index 70e1a50a244e..e734c758dac8 100644 --- a/configs/crownbay_defconfig +++ b/configs/crownbay_defconfig @@ -21,7 +21,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/dfi-bt700-q7x-151_defconfig b/configs/dfi-bt700-q7x-151_defconfig index 9313e7fbd121..79f5d74ec597 100644 --- a/configs/dfi-bt700-q7x-151_defconfig +++ b/configs/dfi-bt700-q7x-151_defconfig @@ -26,7 +26,6 @@ CONFIG_BOOTCOMMAND="load scsi 0:1 03000000 /boot/vmlinuz-${kernel-ver}-generic;l CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/edison_defconfig b/configs/edison_defconfig index 8692a8a9995a..f134680e4122 100644 --- a/configs/edison_defconfig +++ b/configs/edison_defconfig @@ -13,7 +13,6 @@ CONFIG_TARGET_EDISON=y CONFIG_SMP=y CONFIG_SYS_MONITOR_BASE=0x01101000 CONFIG_BOARD_EARLY_INIT_R=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_MAXARGS=128 CONFIG_SYS_CBSIZE=2048 diff --git a/configs/efi-x86_app32_defconfig b/configs/efi-x86_app32_defconfig index 1bfc01f060d4..dfc315774a50 100644 --- a/configs/efi-x86_app32_defconfig +++ b/configs/efi-x86_app32_defconfig @@ -16,7 +16,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_BOOTZ=y diff --git a/configs/efi-x86_app64_defconfig b/configs/efi-x86_app64_defconfig index 46a1900c704b..e0cfe3ee243a 100644 --- a/configs/efi-x86_app64_defconfig +++ b/configs/efi-x86_app64_defconfig @@ -17,7 +17,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_BOOTZ=y diff --git a/configs/efi-x86_payload32_defconfig b/configs/efi-x86_payload32_defconfig index 4149eea6cf64..15323678e314 100644 --- a/configs/efi-x86_payload32_defconfig +++ b/configs/efi-x86_payload32_defconfig @@ -15,7 +15,6 @@ CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y diff --git a/configs/efi-x86_payload64_defconfig b/configs/efi-x86_payload64_defconfig index d41f73cccfc9..80460d336fb1 100644 --- a/configs/efi-x86_payload64_defconfig +++ b/configs/efi-x86_payload64_defconfig @@ -15,7 +15,6 @@ CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y diff --git a/configs/galileo_defconfig b/configs/galileo_defconfig index c6d989ea6ef3..c226ae11a818 100644 --- a/configs/galileo_defconfig +++ b/configs/galileo_defconfig @@ -17,7 +17,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig index 8347a9dcecf9..80e6a4c12b9e 100644 --- a/configs/minnowmax_defconfig +++ b/configs/minnowmax_defconfig @@ -30,7 +30,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig index c6f30674a8fc..165f0b512c8b 100644 --- a/configs/qemu-x86_64_defconfig +++ b/configs/qemu-x86_64_defconfig @@ -33,7 +33,6 @@ CONFIG_LOG=y CONFIG_LOGF_FUNC=y CONFIG_SPL_LOG=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y CONFIG_BLOBLIST=y CONFIG_BLOBLIST_ADDR=0x10000 @@ -84,11 +83,11 @@ CONFIG_SPL_DM_RTC=y CONFIG_SYS_NS16550_PORT_MAPPED=y CONFIG_SPI=y CONFIG_USB_KEYBOARD=y -CONFIG_SPL_VIDEO=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_USER=y CONFIG_FRAMEBUFFER_VESA_MODE=0x144 CONFIG_CONSOLE_SCROLL_LINES=5 +CONFIG_SPL_VIDEO=y # CONFIG_SPL_USE_TINY_PRINTF is not set CONFIG_GENERATE_ACPI_TABLE=y # CONFIG_GZIP is not set diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig index 24682a5387df..4b2787d4aaef 100644 --- a/configs/qemu-x86_defconfig +++ b/configs/qemu-x86_defconfig @@ -23,7 +23,6 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_LOG=y CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/som-db5800-som-6867_defconfig b/configs/som-db5800-som-6867_defconfig index 4a149133db60..44db48204bd8 100644 --- a/configs/som-db5800-som-6867_defconfig +++ b/configs/som-db5800-som-6867_defconfig @@ -27,7 +27,6 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig b/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig index 69499e17f4c9..c5bd0d967366 100644 --- a/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig +++ b/configs/theadorable-x86-conga-qa3-e3845-pcie-x4_defconfig @@ -26,7 +26,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/theadorable-x86-conga-qa3-e3845_defconfig b/configs/theadorable-x86-conga-qa3-e3845_defconfig index e2e64b743494..b3afaf34a02f 100644 --- a/configs/theadorable-x86-conga-qa3-e3845_defconfig +++ b/configs/theadorable-x86-conga-qa3-e3845_defconfig @@ -25,7 +25,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/configs/theadorable-x86-dfi-bt700_defconfig b/configs/theadorable-x86-dfi-bt700_defconfig index 751ae3497ec6..8222697f7471 100644 --- a/configs/theadorable-x86-dfi-bt700_defconfig +++ b/configs/theadorable-x86-dfi-bt700_defconfig @@ -24,7 +24,6 @@ CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_LAST_STAGE_INIT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_CPU=y diff --git a/include/event.h b/include/event.h index 85269aa317aa..747a9f6c654b 100644 --- a/include/event.h +++ b/include/event.h @@ -41,6 +41,18 @@ enum event_t { */ EVT_FSP_INIT_F,
+ /* + * Emitted just before jumping to the main loop + * + * Some boards need to perform initialisation immediately before control + * is passed to the command-line interpreter (e.g. for init that depend + * on later phases in the init sequence). + * + * Some parts can be only initialized if all others (like Interrupts) + * are up and running (e.g. the PC-style ISA keyboard). + */ + EVT_LAST_STAGE_INIT, + /* Fpga load hook */ EVT_FPGA_LOAD,
diff --git a/include/init.h b/include/init.h index 13579db75900..4e7fe26c2004 100644 --- a/include/init.h +++ b/include/init.h @@ -270,7 +270,6 @@ void board_init_r(struct global_data *id, ulong dest_addr) __attribute__ ((noreturn));
int cpu_init_r(void); -int last_stage_init(void); int mac_read_from_eeprom(void); int set_cpu_clk_info(void); int update_flash_size(int flash_size);

On Mon, 21 Aug 2023 21:16:47 -0600, Simon Glass wrote:
This series replaces some more of the init hooks in board_f.c and board_r.c with events. Notably it converts last_state_init() over.
It also provides a 'simple' event spy, which takes no arguments. It turns out that this is quite a common case, so it is worth optimising for this, to reduce code size, before events become too commonly used.
[...]
Applied to u-boot/next, thanks!
participants (4)
-
Michal Simek
-
Michal Simek
-
Simon Glass
-
Tom Rini