[PATCH v2] iommu/ipmmu-vmsa: Hook up r8a774b1 DT matching code
Support RZ/G2N (R8A774B1) IPMMU. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- V1-->V2 * Incorporated Geet's review comment * Added Geert's Reviewed-by tag --- drivers/iommu/ipmmu-vmsa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ad0098c..9285be7 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -775,6 +775,7 @@ static int ipmmu_init_platform_device(struct device *dev, static const struct soc_device_attribute soc_rcar_gen3[] = { { .soc_id = "r8a774a1", }, + { .soc_id = "r8a774b1", }, { .soc_id = "r8a774c0", }, { .soc_id = "r8a7795", }, { .soc_id = "r8a7796", }, @@ -786,6 +787,7 @@ static const struct soc_device_attribute soc_rcar_gen3[] = { }; static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = { + { .soc_id = "r8a774b1", }, { .soc_id = "r8a774c0", }, { .soc_id = "r8a7795", .revision = "ES3.*" }, { .soc_id = "r8a77965", }, @@ -1008,6 +1010,9 @@ static const struct of_device_id ipmmu_of_ids[] = { .compatible = "renesas,ipmmu-r8a774a1", .data = _features_rcar_gen3, }, { + .compatible = "renesas,ipmmu-r8a774b1", + .data = _features_rcar_gen3, + }, { .compatible = "renesas,ipmmu-r8a774c0", .data = _features_rcar_gen3, }, { -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
RE: [PATCH] iommu/ipmmu-vmsa: Hook up r8a774b1 DT matching code
Hi Geert, Thanks for the feedback. > Subject: Re: [PATCH] iommu/ipmmu-vmsa: Hook up r8a774b1 DT matching > code > > Hi Biju, > > On Tue, Sep 24, 2019 at 9:43 AM Biju Das wrote: > > Support RZ/G2N (R8A774B1) IPMMU. > > > > Signed-off-by: Biju Das > > Thanks for your patch! > > > --- a/drivers/iommu/ipmmu-vmsa.c > > +++ b/drivers/iommu/ipmmu-vmsa.c > > > static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = { > > { .soc_id = "r8a774c0", }, > > + { .soc_id = "r8a774b1", }, > > Please preserve alphabetical sort order. OK. Will send V2. > > { .soc_id = "r8a7795", .revision = "ES3.*" }, > > { .soc_id = "r8a77965", }, > > { .soc_id = "r8a77990", }, > > With the above fixed: > Reviewed-by: Geert Uytterhoeven > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux- > m68k.org > > 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 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH] iommu/ipmmu-vmsa: Hook up r8a774b1 DT matching code
Support RZ/G2N (R8A774B1) IPMMU. Signed-off-by: Biju Das --- drivers/iommu/ipmmu-vmsa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ad0098c..002561b 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -775,6 +775,7 @@ static int ipmmu_init_platform_device(struct device *dev, static const struct soc_device_attribute soc_rcar_gen3[] = { { .soc_id = "r8a774a1", }, + { .soc_id = "r8a774b1", }, { .soc_id = "r8a774c0", }, { .soc_id = "r8a7795", }, { .soc_id = "r8a7796", }, @@ -787,6 +788,7 @@ static const struct soc_device_attribute soc_rcar_gen3[] = { static const struct soc_device_attribute soc_rcar_gen3_whitelist[] = { { .soc_id = "r8a774c0", }, + { .soc_id = "r8a774b1", }, { .soc_id = "r8a7795", .revision = "ES3.*" }, { .soc_id = "r8a77965", }, { .soc_id = "r8a77990", }, @@ -1008,6 +1010,9 @@ static const struct of_device_id ipmmu_of_ids[] = { .compatible = "renesas,ipmmu-r8a774a1", .data = _features_rcar_gen3, }, { + .compatible = "renesas,ipmmu-r8a774b1", + .data = _features_rcar_gen3, + }, { .compatible = "renesas,ipmmu-r8a774c0", .data = _features_rcar_gen3, }, { -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH] dt-bindings: iommu: ipmmu-vmsa: Add r8a774b1 support
Document RZ/G2N (R8A774B1) SoC bindings. Signed-off-by: Biju Das --- Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt index b6bfbec..020d6f2 100644 --- a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt @@ -15,6 +15,7 @@ Required Properties: - "renesas,ipmmu-r8a7744" for the R8A7744 (RZ/G1N) IPMMU. - "renesas,ipmmu-r8a7745" for the R8A7745 (RZ/G1E) IPMMU. - "renesas,ipmmu-r8a774a1" for the R8A774A1 (RZ/G2M) IPMMU. +- "renesas,ipmmu-r8a774b1" for the R8A774B1 (RZ/G2N) IPMMU. - "renesas,ipmmu-r8a774c0" for the R8A774C0 (RZ/G2E) IPMMU. - "renesas,ipmmu-r8a7790" for the R8A7790 (R-Car H2) IPMMU. - "renesas,ipmmu-r8a7791" for the R8A7791 (R-Car M2-W) IPMMU. -- 2.7.4
RE: How to resolve an issue in swiotlb environment?
Hi All, Any update on the below issue. I am seeing similar issue on RZ/G2M board with Linux version 5.2.0-rc3. root@hihope-rz-g2m:~# [ 35.414177] usb 2-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd [ 35.449402] usb-storage 2-1:1.0: USB Mass Storage device detected [ 35.455915] scsi host0: usb-storage 2-1:1.0 [ 36.482585] scsi 0:0:0:0: Direct-Access SanDisk Extreme 0001 PQ: 0 ANSI: 6 [ 36.491260] sd 0:0:0:0: [sda] 125045424 512-byte logical blocks: (64.0 GB/59.6 GiB) [ 36.499823] sd 0:0:0:0: [sda] Write Protect is off [ 36.505474] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 36.518074] sda: sda1 [ 36.523163] sd 0:0:0:0: [sda] Attached SCSI disk root@hihope-rz-g2m:~# mkdir -p /tmp/rmnt/sda1 root@hihope-rz-g2m:~# mount -t auto /dev/sda1 /tmp/rmnt/sda1 root@hihope-rz-g2m:~# dd if=/dev/urandom of=/tmp/sda1-random bs=1024 count=10240 10240+0 records in 10240+0 records out 10485760 bytes (10 MB, 10 MiB) copied, 0.187696 s, 55.9 MB/s root@hihope-rz-g2m:~# cp /tmp/sda1-random /tmp/rmnt/sda1/sda1-random root@hihope-rz-g2m:~# [ 218.861212] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 218.871885] xhci-hcd ee00.usb: overflow 0x00067430b000+1003520 of DMA mask bus mask 0 [ 218.881233] WARNING: CPU: 0 PID: 258 at kernel/dma/direct.c:43 report_addr+0x38/0xa8 [ 218.888974] Modules linked in: renesas_usb3 usb_dmac phy_rcar_gen3_usb3 [ 218.895594] CPU: 0 PID: 258 Comm: usb-storage Not tainted 5.2.0-rc3-00017-gc80b083-dirty #5 [ 218.903940] Hardware name: HopeRun HiHope RZ/G2M with sub board (DT) [ 218.910291] pstate: 4005 (nZcv daif -PAN -UAO) [ 218.915078] pc : report_addr+0x38/0xa8 [ 218.918821] lr : report_addr+0xa0/0xa8 [ 218.922564] sp : 125fb970 [ 218.925872] x29: 125fb970 x28: [ 218.931180] x27: x26: 1f020280 [ 218.936487] x25: 8006394a82a8 x24: [ 218.941794] x23: 0001 x22: [ 218.947101] x21: 000f5000 x20: 11309000 [ 218.952408] x19: 80063a600010 x18: [ 218.957714] x17: x16: [ 218.963023] x15: 113096c8 x14: 4d4420666f203032 [ 218.968331] x13: 35333030312b3030 x12: 3062303334373630 [ 218.973638] x11: 3030303030307830 x10: 11309f20 [ 218.978945] x9 : 112e3018 x8 : 0123 [ 218.984252] x7 : 0005 x6 : 80063b578180 [ 218.989559] x5 : 80063b578180 x4 : [ 218.994865] x3 : 80063b57ef10 x2 : eed25f279b69f300 [ 219.000172] x1 : eed25f279b69f300 x0 : [ 219.005481] Call trace: [ 219.007923] report_addr+0x38/0xa8 [ 219.011321] dma_direct_map_page+0x148/0x158 [ 219.015586] dma_direct_map_sg+0x78/0xe0 [ 219.019510] usb_hcd_map_urb_for_dma+0x2fc/0x468 [ 219.024124] xhci_map_urb_for_dma+0x54/0x68 [ 219.028303] usb_hcd_submit_urb+0x88/0x968 [ 219.032394] usb_submit_urb+0x3b0/0x570 [ 219.036226] usb_sg_wait+0x98/0x158 [ 219.039711] usb_stor_bulk_transfer_sglist.part.3+0x94/0x128 [ 219.045366] usb_stor_bulk_srb+0x48/0x88 [ 219.049283] usb_stor_Bulk_transport+0x10c/0x390 [ 219.053896] usb_stor_invoke_transport+0x3c/0x500 [ 219.058595] usb_stor_transparent_scsi_command+0xc/0x18 [ 219.063816] usb_stor_control_thread+0x1c4/0x260 [ 219.068431] kthread+0x124/0x128 [ 219.071660] ret_from_fork+0x10/0x18 [ 219.075229] ---[ end trace dd9ef2a6b7fef860 ]--- [ 219.080087] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.090810] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.101510] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.112209] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.122901] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.133591] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.144283] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.154973] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 219.165674] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 223.861717] swiotlb_tbl_map_single: 67451 callbacks suppressed [ 223.861721] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [ 223.878249] xhci-hcd ee00.usb: swiotlb buffer is full (sz: 1003520 bytes), total 32768 (slots), used 1088 (slots) [
[PATCH] dt-bindings: iommu: ipmmu-vmsa: Add r8a7744 support
Document RZ/G1N (R8A7744) SoC bindings. Signed-off-by: Biju Das Reviewed-by: Chris Paterson --- This patch is tested against next-20181004 --- Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt index c6e2d85..377ee63 100644 --- a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt @@ -12,6 +12,7 @@ Required Properties: - "renesas,ipmmu-r8a73a4" for the R8A73A4 (R-Mobile APE6) IPMMU. - "renesas,ipmmu-r8a7743" for the R8A7743 (RZ/G1M) IPMMU. +- "renesas,ipmmu-r8a7744" for the R8A7744 (RZ/G1N) IPMMU. - "renesas,ipmmu-r8a7745" for the R8A7745 (RZ/G1E) IPMMU. - "renesas,ipmmu-r8a7790" for the R8A7790 (R-Car H2) IPMMU. - "renesas,ipmmu-r8a7791" for the R8A7791 (R-Car M2-W) IPMMU. -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH 2/3] ARM: dts: r8a7743: Add IPMMU DT nodes
Add the six IPMMU instances found in the r8a7743 to DT with a disabled status. Signed-off-by: Biju Das <biju@bp.renesas.com> Reviewed-by: Chris Paterson <chris.paters...@renesas.com> --- arch/arm/boot/dts/r8a7743.dtsi | 58 ++ 1 file changed, 58 insertions(+) diff --git a/arch/arm/boot/dts/r8a7743.dtsi b/arch/arm/boot/dts/r8a7743.dtsi index 0b74c6c..759ce97 100644 --- a/arch/arm/boot/dts/r8a7743.dtsi +++ b/arch/arm/boot/dts/r8a7743.dtsi @@ -1457,6 +1457,64 @@ status = "disabled"; }; + ipmmu_sy0: mmu@e628 { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xe628 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_sy1: mmu@e629 { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xe629 0 0x1000>; + interrupts = ; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_ds: mmu@e674 { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xe674 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_mp: mmu@ec68 { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xec68 0 0x1000>; + interrupts = ; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_mx: mmu@fe951000 { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xfe951000 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_gp: mmu@e62a { + compatible = "renesas,ipmmu-r8a7743", +"renesas,ipmmu-vmsa"; + reg = <0 0xe62a 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + rcar_sound: sound@ec50 { /* * #sound-dai-cells is required -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH 3/3] ARM: dts: r8a7745: Add IPMMU DT nodes
Add the six IPMMU instances found in the r8a7745 to DT with a disabled status. Signed-off-by: Biju Das <biju@bp.renesas.com> Reviewed-by: Chris Paterson <chris.paters...@renesas.com> --- arch/arm/boot/dts/r8a7745.dtsi | 58 ++ 1 file changed, 58 insertions(+) diff --git a/arch/arm/boot/dts/r8a7745.dtsi b/arch/arm/boot/dts/r8a7745.dtsi index ae918e9..a9da80c 100644 --- a/arch/arm/boot/dts/r8a7745.dtsi +++ b/arch/arm/boot/dts/r8a7745.dtsi @@ -1295,6 +1295,64 @@ status = "disabled"; }; + ipmmu_sy0: mmu@e628 { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xe628 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_sy1: mmu@e629 { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xe629 0 0x1000>; + interrupts = ; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_ds: mmu@e674 { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xe674 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_mp: mmu@ec68 { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xec68 0 0x1000>; + interrupts = ; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_mx: mmu@fe951000 { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xfe951000 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + + ipmmu_gp: mmu@e62a { + compatible = "renesas,ipmmu-r8a7745", +"renesas,ipmmu-vmsa"; + reg = <0 0xe62a 0 0x1000>; + interrupts = , +; + #iommu-cells = <1>; + status = "disabled"; + }; + rcar_sound: sound@ec50 { /* * #sound-dai-cells is required -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH 1/3] dt-bindings: iommu: ipmmu-vmsa: Add device tree support for r8a774[35]
Document r8a774[35] specific compatible strings. The Renesas RZ/G1[ME] (r8a774[35]) IPMMU are identical to the R-Car Gen2 family. Signed-off-by: Biju Das <biju@bp.renesas.com> Reviewed-by: Chris Paterson <chris.paters...@renesas.com> --- Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt index 857df92..7d300af 100644 --- a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt +++ b/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt @@ -11,12 +11,15 @@ Required Properties: the device is compatible with the R-Car Gen2 VMSA-compatible IPMMU. - "renesas,ipmmu-r8a73a4" for the R8A73A4 (R-Mobile APE6) IPMMU. +- "renesas,ipmmu-r8a7743" for the R8A7743 (RZ/G1M) IPMMU. +- "renesas,ipmmu-r8a7745" for the R8A7745 (RZ/G1E) IPMMU. - "renesas,ipmmu-r8a7790" for the R8A7790 (R-Car H2) IPMMU. - "renesas,ipmmu-r8a7791" for the R8A7791 (R-Car M2-W) IPMMU. - "renesas,ipmmu-r8a7793" for the R8A7793 (R-Car M2-N) IPMMU. - "renesas,ipmmu-r8a7794" for the R8A7794 (R-Car E2) IPMMU. - "renesas,ipmmu-r8a7795" for the R8A7795 (R-Car H3) IPMMU. -- "renesas,ipmmu-vmsa" for generic R-Car Gen2 VMSA-compatible IPMMU. +- "renesas,ipmmu-vmsa" for generic R-Car Gen2 or RZ/G1 VMSA-compatible + IPMMU. - reg: Base address and size of the IPMMU registers. - interrupts: Specifiers for the MMU fault interrupts. For instances that -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH 0/3] Add IPMMU support for r8a774[35]
This patch series aims to add IPMMU support for r8a774[35] SoC. It is tested with modetest utility and the patches present in the below git for enabling ipmmu support in the vsp1 and DU. git://linuxtv.org/pinchartl/media.git iommu/devel/dt It is tested against renesas-devel-20180122-v4.15-rc9 Biju Das (3): dt-bindings: iommu: ipmmu-vmsa: Add device tree support for r8a774[35] ARM: dts: r8a7743: Add IPMMU DT nodes ARM: dts: r8a7745: Add IPMMU DT nodes .../bindings/iommu/renesas,ipmmu-vmsa.txt | 5 +- arch/arm/boot/dts/r8a7743.dtsi | 58 ++ arch/arm/boot/dts/r8a7745.dtsi | 58 ++ 3 files changed, 120 insertions(+), 1 deletion(-) -- 2.7.4 ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu