diff options
| author | Samuel Holland <[email protected]> | 2025-03-25 16:43:25 -0700 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-04-23 12:32:50 +0530 |
| commit | ac2e428c4be6bb876b160643984617911d60a5e6 (patch) | |
| tree | 14361bd6c88a195d1d8b7a5422211777279291a0 | |
| parent | 2a6f7ddf87f1534e03e9413fa25394435accacdd (diff) | |
platform: rzfive: Call andes_pma_setup_regions() only during cold boot
This function accesses the FDT blob, which means it is only valid to
call during cold boot, before a lower privilege level has an opportunity
to clobber that memory.
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | platform/generic/renesas/rzfive/rzfive.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/generic/renesas/rzfive/rzfive.c b/platform/generic/renesas/rzfive/rzfive.c index 59084c41..db523088 100644 --- a/platform/generic/renesas/rzfive/rzfive.c +++ b/platform/generic/renesas/rzfive/rzfive.c @@ -27,8 +27,16 @@ static const struct andes_pma_region renesas_rzfive_pma_regions[] = { static int renesas_rzfive_final_init(bool cold_boot, void *fdt, const struct fdt_match *match) { - return andes_pma_setup_regions(fdt, renesas_rzfive_pma_regions, - array_size(renesas_rzfive_pma_regions)); + int rc; + + if (cold_boot) { + rc = andes_pma_setup_regions(fdt, renesas_rzfive_pma_regions, + array_size(renesas_rzfive_pma_regions)); + if (rc) + return rc; + } + + return 0; } static int renesas_rzfive_early_init(bool cold_boot, const void *fdt, |
