diff mbox series

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

Message ID 1597738161-28989-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 52dc7ae74918d01fa55ca103841a0eaa0dfa7409
Delegated to: Andes
Headers show
Series [1/2] riscv: fu540: Use correct API to get L2 cache controller base address | expand

Commit Message

Bin Meng Aug. 18, 2020, 8:09 a.m. UTC
From: Bin Meng <bin.meng@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@windriver.com>
---

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

Comments

Rick Chen Aug. 20, 2020, 7:24 a.m. UTC | #1
> From: Bin Meng [mailto:bmeng.cn@gmail.com]
> Sent: Tuesday, August 18, 2020 4:09 PM
> To: Rick Jian-Zhi Chen(陳建志); Pragnesh Patel; U-Boot Mailing List
> Cc: Bin Meng
> Subject: [PATCH 1/2] riscv: fu540: Use correct API to get L2 cache controller base address
>
> From: Bin Meng <bin.meng@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@windriver.com>
> ---
>
>  arch/riscv/cpu/fu540/cache.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Rick Chen <rick@andestech.com>
Pragnesh Patel Aug. 20, 2020, 11:53 a.m. UTC | #2
>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 18 August 2020 13:39
>To: Rick Chen <rick@andestech.com>; Pragnesh Patel
><pragnesh.patel@openfive.com>; U-Boot Mailing List <u-boot@lists.denx.de>
>Cc: Bin Meng <bin.meng@windriver.com>
>Subject: [PATCH 1/2] riscv: fu540: Use correct API to get L2 cache controller base
>address
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>From: Bin Meng <bin.meng@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@windriver.com>
>---
>
> arch/riscv/cpu/fu540/cache.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com>
diff mbox series

Patch

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;