diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-17 13:42:38 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-18 14:39:06 +0200 |
commit | 58e95ea5d2126c51bb6e00b213ae4273266e1ceb (patch) | |
tree | 180618e897f6c33b4fc8065cfc75ee80764317e9 /include/init.h | |
parent | aae80db4b58717e42ae8a0c4ad74ed78a31116a8 (diff) | |
download | barebox-58e95ea5d2126c51bb6e00b213ae4273266e1ceb.tar.gz barebox-58e95ea5d2126c51bb6e00b213ae4273266e1ceb.tar.xz |
init: define new postmem_initcall()
Memory banks are added in mem_initcall() and are used in mmu_initcall()
which directly follows it to set caching attributes for the banks.
Code that requires memory banks to be registered, thus has to use
mmu_initcall(), but this is not possible for code that reliably needs to
run before MMU init: We need to give board code and device tree parsing
code the chance to reserve_sdram_region parts of SDRAM that contain
secure firmware to avoid speculative execution into them once the MMU is
turned on. For this reason, define a new postmem_initcall() level and
already use it for add_mem_devices, which has nothing to do with
mmu_initcall. Another user that can't be mmu_initcall() will follow in a
later commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220817114244.1810531-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/init.h')
-rw-r--r-- | include/init.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/init.h b/include/init.h index c695f99867..d0343fdf05 100644 --- a/include/init.h +++ b/include/init.h @@ -58,16 +58,17 @@ typedef void (*exitcall_t)(void); #define console_initcall(fn) __define_initcall("3",fn,3) #define postconsole_initcall(fn) __define_initcall("4",fn,4) #define mem_initcall(fn) __define_initcall("5",fn,5) -#define mmu_initcall(fn) __define_initcall("6",fn,6) -#define postmmu_initcall(fn) __define_initcall("7",fn,7) -#define coredevice_initcall(fn) __define_initcall("8",fn,8) -#define fs_initcall(fn) __define_initcall("9",fn,9) -#define device_initcall(fn) __define_initcall("10",fn,10) -#define crypto_initcall(fn) __define_initcall("11",fn,11) -#define of_populate_initcall(fn) __define_initcall("12",fn,12) -#define late_initcall(fn) __define_initcall("13",fn,13) -#define environment_initcall(fn) __define_initcall("14",fn,14) -#define postenvironment_initcall(fn) __define_initcall("15",fn,15) +#define postmem_initcall(fn) __define_initcall("6",fn,6) +#define mmu_initcall(fn) __define_initcall("7",fn,7) +#define postmmu_initcall(fn) __define_initcall("8",fn,8) +#define coredevice_initcall(fn) __define_initcall("9",fn,9) +#define fs_initcall(fn) __define_initcall("10",fn,10) +#define device_initcall(fn) __define_initcall("11",fn,11) +#define crypto_initcall(fn) __define_initcall("12",fn,12) +#define of_populate_initcall(fn) __define_initcall("13",fn,13) +#define late_initcall(fn) __define_initcall("14",fn,14) +#define environment_initcall(fn) __define_initcall("15",fn,15) +#define postenvironment_initcall(fn) __define_initcall("16",fn,16) #define early_exitcall(fn) __define_exitcall("0",fn,0) #define predevshutdown_exitcall(fn) __define_exitcall("1",fn,1) |