[PATCH 1/2] riscv: fu540: Use correct API to get L2 cache controller base address

Bin Meng bmeng.cn at gmail.com
Tue Aug 18 10:09:20 CEST 2020


From: Bin Meng <bin.meng at windriver.com>

At present fdtdec_get_addr() is used to get L2 cache controller base
address. This only works for a fixed #address-cells and #size-cells.
Change to use fdtdec_get_addr_size_auto_parent() instead.

Signed-off-by: Bin Meng <bin.meng at windriver.com>
---

 arch/riscv/cpu/fu540/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/cpu/fu540/cache.c b/arch/riscv/cpu/fu540/cache.c
index 54de142..78f5ad9 100644
--- a/arch/riscv/cpu/fu540/cache.c
+++ b/arch/riscv/cpu/fu540/cache.c
@@ -35,7 +35,8 @@ int cache_enable_ways(void)
 	if (node < 0)
 		return node;
 
-	base = fdtdec_get_addr(blob, node, "reg");
+	base = fdtdec_get_addr_size_auto_parent(blob, 0, node, "reg", 0,
+						NULL, false);
 	if (base == FDT_ADDR_T_NONE)
 		return FDT_ADDR_T_NONE;
 
-- 
2.7.4



More information about the U-Boot mailing list