summaryrefslogtreecommitdiff
path: root/include/event.h
AgeCommit message (Collapse)Author
2022-10-31event: Add an event for main_loopSughosh Ganu
Add an event type EVT_MAIN_LOOP that can be used for registering events that need to be run after the platform has been initialised and before the main_loop function is called. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
2022-09-29event: Pass the images to EVT_FT_FIXUPSimon Glass
Pass the boot images along as well, in case the fixups need to look at them. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29event: Allow multiple spy declarations for each eventSimon Glass
At present only one spy is allowed per event. Update the naming to allow more than one, since some need this flexibility, e.g. the EVT_FT_FIXUP event. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12event: Add an event for device tree fixupsSimon Glass
At present there is a confusing array of functions that handle the device tree fix-ups needed for booting an OS. We should be able to switch to using events to clean this up. As a first step, create a new event type and call it from the standard place. Note that this event uses the ofnode interface only, since this can support live tree which is more efficient when making lots of updates. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12event: Change EVENT_SPY to globalSimon Glass
This creates static records at present, but it causes a problem with clang and LTO: the linker list records are sometimes dropped from the image. Fix this by making the records global. Update to use __used while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-06event: fix static events for CONFIG_NEEDS_MANUAL_RELOCOvidiu Panait
Static events do not currently work post-relocation for boards that enable CONFIG_NEEDS_MANUAL_RELOC. Relocate event handler pointers for all event spies to fix this. Tested on Microblaze. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
2022-06-06dm: fix DM_EVENT dependenciesHeinrich Schuchardt
CONFIG_DM_EVENT without CONFIG_EVENT is non-functional. Let CONFIG_DM_EVENT depend on CONFIG_EVENT. Remove superfluous stub in include/event.h. Fixes: 5b896ed5856f ("event: Add events for device probe/remove") Reported-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-03-10event: Add a commandSimon Glass
Add a command to show the available events. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10event: Convert arch_cpu_init_dm() to use eventsSimon Glass
Instead of a special function, send an event after driver model is inited and adjust the boards which use this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10event: Convert misc_init_f() to use eventsSimon Glass
This hook can be implmented using events, for the three boards that actually use it. Add the event type and event handlers. Drop CONFIG_MISC_INIT_F since we can just use CONFIG_EVENT to control this. Since sandbox always enables CONFIG_EVENT, we can drop the defconfig lines there too. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10event: Add events for device probe/removeSimon Glass
Generate events when devices are probed or removed, allowing hooks to be added for these situations. This is controlled by the DM_EVENT config option. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-03-10event: Add basic support for eventsSimon Glass
Add a way to create and dispatch events without needing to allocate memory. Also add a way to 'spy' on events, thus allowing 'hooks' to be created. Use a linker list for static events, which we can use to replace functions like arch_cpu_init_f(). Allow an EVENT_DEBUG option which makes it easier to see what is going on at runtime, but uses more code space. Dynamic events allow the creation of a spy at runtime. This is not always necessary, but can be enabled with EVENT_DYNAMIC if needed. A 'test' event is the only option for now. Signed-off-by: Simon Glass <sjg@chromium.org>