summaryrefslogtreecommitdiff
path: root/arch/mips/mach-pic32/cpu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-10 08:28:40 -0500
committerTom Rini <trini@konsulko.com>2022-03-10 08:28:40 -0500
commitcb83a7a0c360d58a3a9bf2ba3828e576eafecb91 (patch)
tree23eeff85c6606bece47b2d99611786a3392416dc /arch/mips/mach-pic32/cpu.c
parent0bf4e0bb935e5c7fc016142e0228882610ecbf39 (diff)
parentabe5d1184f276a0789365316061a14834dbc8dc4 (diff)
Merge branch '2022-03-09-events-subsystem' into next
To quote the author: It is a common need in U-Boot to have one subsystem notify another when something happens. An example is reading a partition table when a new block device is set up. It is also common to add weak functions and 'hook' functions to modify how U-Boot works. See for example ft_board_setup() and the like. U-Boot would benefit from a generic mechanism to handle these cases, with the ability to hook into various 'events' in a subsystem-independent and transparent way. This series provides a way to create and dispatch events, with a way of registering a 'spy' which watches for events of different types. This allows 'hook' functions to be created in a generic way. It also includes a script to list the hooks in an image, which is a bit easier to debug than weak functions, as well as an 'event' command to do the same from within U-Boot. These 'static' events can be used to replace hooks like misc_init_f(), for example. Also included is basic support for 'dynamic' events, where a spy can be registered at runtime. The need for this is still being figured out.
Diffstat (limited to 'arch/mips/mach-pic32/cpu.c')
-rw-r--r--arch/mips/mach-pic32/cpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c
index eac2fe5f8c9..de449e3c6a2 100644
--- a/arch/mips/mach-pic32/cpu.c
+++ b/arch/mips/mach-pic32/cpu.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk.h>
#include <dm.h>
+#include <event.h>
#include <init.h>
#include <malloc.h>
#include <asm/global_data.h>
@@ -95,12 +96,13 @@ static void prefetch_init(void)
}
/* arch specific CPU init after DM */
-int arch_cpu_init_dm(void)
+static int pic32_flash_prefetch(void *ctx, struct event *event)
{
/* flash prefetch */
prefetch_init();
return 0;
}
+EVENT_SPY(EVT_DM_POST_INIT, pic32_flash_prefetch);
/* Un-gate DDR2 modules (gated by default) */
static void ddr2_pmd_ungate(void)