Skip to contentSkip to conversation

riscv: fu540: Use correct API to get L2 cache controller base address

PATCH New Bin Meng 3 participants 6 messages Aug 18, 2020 – Aug 20, 2020 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

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

From: Bin Meng <[email protected]>

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.

---

 arch/riscv/cpu/fu540/cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/cpu/fu540/cache.c +2 -1
index 54de142..78f5ad9 100644
@@ -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;
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 ram: sifive: Fix compiler warnings for 32-bit

From: Bin Meng <[email protected]>

priv->info.size is of type 'size_t' but the length modifier is l. Fix this by casting priv->info.size. Note 'z' cannot be used as the modifier as SPL does not support that.

---

 drivers/ram/sifive/fu540_ddr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ram/sifive/fu540_ddr.c +2 -2
index 2eef1e7..5ff8869 100644
@@ -316,12 +316,12 @@ static int fu540_ddr_setup(struct udevice *dev)
 	priv->info.size = get_ram_size((long *)priv->info.base,
 				       ddr_size);
 
-	debug("%s : %lx\n", __func__, priv->info.size);
+	debug("%s : %lx\n", __func__, (uintptr_t)priv->info.size);
 
 	/* check memory access for all memory */
 	if (priv->info.size != ddr_size) {
 		printf("DDR invalid size : 0x%lx, expected 0x%lx\n",
-		       priv->info.size, (uintptr_t)ddr_size);
+		       (uintptr_t)priv->info.size, (uintptr_t)ddr_size);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.7.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 2/2 ram: sifive: Fix compiler warnings for 32-bit

Quoted 12 lines

From: Bin Meng [mailto:bmeng.cn at 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 2/2] ram: sifive: Fix compiler warnings for 32-bit

From: Bin Meng <[email protected]>

priv->info.size is of type 'size_t' but the length modifier is l. Fix this by casting priv->info.size. Note 'z' cannot be used as the modifier as SPL does not support that.

Quoted 5 lines

---

 drivers/ram/sifive/fu540_ddr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#4 lore raw

PATCH 2/2 ram: sifive: Fix compiler warnings for 32-bit

In reply to Bin Meng
Quoted 17 lines

-----Original Message-----
From: Bin Meng <[email protected]>
Sent: 18 August 2020 13:39
To: Rick Chen <[email protected]>; Pragnesh Patel <[email protected]>; U-Boot Mailing List <[email protected]>
Cc: Bin Meng <[email protected]>
Subject: [PATCH 2/2] ram: sifive: Fix compiler warnings for 32-bit

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

From: Bin Meng <[email protected]>

priv->info.size is of type 'size_t' but the length modifier is l.
Fix this by casting priv->info.size. Note 'z' cannot be used as the modifier as SPL does not support that.

Quoted 5 lines

---

drivers/ram/sifive/fu540_ddr.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

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

Quoted 12 lines

From: Bin Meng [mailto:bmeng.cn at 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 <[email protected]>

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.

Quoted 5 lines

---

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

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

In reply to Bin Meng
Quoted 18 lines

-----Original Message-----
From: Bin Meng <[email protected]>
Sent: 18 August 2020 13:39
To: Rick Chen <[email protected]>; Pragnesh Patel <[email protected]>; U-Boot Mailing List <[email protected]>
Cc: Bin Meng <[email protected]>
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 <[email protected]>

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.

Quoted 5 lines

---

arch/riscv/cpu/fu540/cache.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)