Skip to contentSkip to conversation

ARM: shmobile: r8a7795 Salvator-X IPMMU 4 GiB RAM test code

PATCH In review Magnus Damm 2 participants 4 messages Jan 18, 2016 – Feb 17, 2017

Subsystems (3)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

cover ARM: shmobile: r8a7795 Salvator-X IPMMU 4 GiB RAM test code

ARM: shmobile: r8a7795 Salvator-X IPMMU 4 GiB RAM test code

[PATCH/RFC 01/02] iommu/ipmmu-vmsa: Use 64-bit masks [PATCH/RFC 02/02] arm64: dts: Salvator-X: Enable 4 GiB of RAM

This code simply enables 4 GiB of RAM on Salvator-X after adjusting the IPMMU driver to tell the Linux driver model that the device it is managing is able to do 64-bit bus mastering.

Not for upstream merge. Patch 1/2 will be rolled into a larger series for the IPMMU driver in the future. Patch 2/2 depends on firmware updates, so the integration needs to be correctly ordered to keep things smooth.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

Developed on top of renesas-drivers-2016-01-13-v4.4.

 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts |   15 +++++++++++++++
 drivers/iommu/ipmmu-vmsa.c                         |    2 ++
 2 files changed, 17 insertions(+)
author maintainer
#1 lore raw

PATCH 1/2 iommu/ipmmu-vmsa: Use 64-bit masks

From: Magnus Damm <[email protected]>

The IPMMU hardware is able to use page tables from anywhere in the memory, so set masks to 64-bits. Required to be able to use the IPMMU driver with 4 GiB of memory. Without this patch with 4 GiB enabled the following error message is spit out on the console during boot:

ipmmu-vmsa e67b0000.mmu: Cannot accommodate DMA translation
for IOMMU page tables

---

 drivers/iommu/ipmmu-vmsa.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/iommu/ipmmu-vmsa.c +2 -0
@@ -1043,6 +1043,8 @@ static int ipmmu_probe(struct platform_d
 		return -ENOMEM;
 	}
 
+	dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	
 	mmu->dev = &pdev->dev;
 	mmu->num_utlbs = 32;
 	bitmap_zero(mmu->ctx, IPMMU_CTX_MAX);
author maintainer
#2 lore raw

PATCH 2/2 arm64: dts: Salvator-X: Enable 4 GiB of RAM

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Enable all the on-board memory for the r8a7795 Salvator-X board.

Not for upstream merge. Needs to be ordered with firmware update to avoid overly complex dependencies.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts |   15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts +15 -0
@@ -57,6 +57,21 @@
 		reg = <0x0 0x48000000 0x0 0x38000000>;
 	};
 
+	memory@500000000 {
+		device_type = "memory";
+		reg = <5 0x00000000 0 0x40000000>;
+	};
+
+	memory@600000000 {
+		device_type = "memory";
+		reg = <6 0x00000000 0 0x40000000>;
+	};
+
+	memory@700000000 {
+		device_type = "memory";
+		reg = <7 0x00000000 0 0x40000000>;
+	};
+
 	x12_clk: x12_clk {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
#3 lore raw

Re: [PATCH/RFC 02/02] arm64: dts: Salvator-X: Enable 4 GiB of RAM

Hi Magnus,

Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Enable all the on-board memory for the r8a7795 Salvator-X board.

Not for upstream merge. Needs to be ordered with firmware update to avoid overly complex dependencies.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

Any chance we can get a real SoB?
Not-so-recent firmware already enables the memory in U-Boot anyway.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds