From 12c75c8886a0ee69d7e279a48cbeb8d1602826b3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 10 Jul 2021 17:59:05 +0200 Subject: [PATCH] feat(plat/rcar3): emit RPC status to DT fragment if RPC unlocked In case the RCAR_RPC_HYPERFLASH_LOCKED is 0, emit DT node /soc/rpc@ee200000 with property status = "okay" into the DT fragment passed to subsequent software, to indicate the RPC is unlocked. Signed-off-by: Marek Vasut Change-Id: Id93c4573ab1c62cf13fa5a803dc5818584a2c13a --- plat/renesas/rcar/bl2_plat_setup.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/plat/renesas/rcar/bl2_plat_setup.c b/plat/renesas/rcar/bl2_plat_setup.c index 1d2977a93..41b2d11e7 100644 --- a/plat/renesas/rcar/bl2_plat_setup.c +++ b/plat/renesas/rcar/bl2_plat_setup.c @@ -565,6 +565,33 @@ static void bl2_populate_compatible_string(void *dt) } } +static void bl2_add_rpc_node(void) +{ +#if (RCAR_RPC_HYPERFLASH_LOCKED == 0) + int ret, node; + + node = ret = fdt_add_subnode(fdt, 0, "soc"); + if (ret < 0) { + goto err; + } + + node = ret = fdt_add_subnode(fdt, node, "rpc@ee200000"); + if (ret < 0) { + goto err; + } + + ret = fdt_setprop_string(fdt, node, "status", "okay"); + if (ret < 0) { + goto err; + } + + return; +err: + NOTICE("BL2: Cannot add RPC node to FDT (ret=%i)\n", ret); + panic(); +#endif +} + static void bl2_add_dram_entry(uint64_t start, uint64_t size) { char nodename[32] = { 0 }; @@ -1010,6 +1037,9 @@ lcm_state: /* Add platform compatible string */ bl2_populate_compatible_string(fdt); + /* Enable RPC if unlocked */ + bl2_add_rpc_node(); + /* Print DRAM layout */ bl2_advertise_dram_size(product);