Message ID | 1594676120-5862-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | R8A774E1 SoC enable support for IPMMU, DMAC, GPIO and AVB | expand |
Hi Prabhakar, On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > From: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > Add support for RZ/G2H (R8A774E1) SoC IPMMUs. > > Signed-off-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Thanks for your patch! > --- a/drivers/iommu/ipmmu-vmsa.c > +++ b/drivers/iommu/ipmmu-vmsa.c > @@ -751,6 +751,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 = "r8a774e1", }, Adding an entry to soc_rcar_gen3_whitelist[] doesn't do anything, unless you also add the same entry to soc_rcar_gen3[]. > { .soc_id = "r8a7795", .revision = "ES3.*" }, > { .soc_id = "r8a77961", }, > { .soc_id = "r8a77965", }, > @@ -963,6 +964,9 @@ static const struct of_device_id ipmmu_of_ids[] = { > }, { > .compatible = "renesas,ipmmu-r8a774c0", > .data = &ipmmu_features_rcar_gen3, > + }, { > + .compatible = "renesas,ipmmu-r8a774e1", > + .data = &ipmmu_features_rcar_gen3, > }, { > .compatible = "renesas,ipmmu-r8a7795", > .data = &ipmmu_features_rcar_gen3, Gr{oetje,eeting}s, Geert
Hi Geert, Thank you for the review. On Tue, Jul 14, 2020 at 9:09 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Prabhakar, > > On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar > <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > > From: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > > > Add support for RZ/G2H (R8A774E1) SoC IPMMUs. > > > > Signed-off-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Thanks for your patch! > > > --- a/drivers/iommu/ipmmu-vmsa.c > > +++ b/drivers/iommu/ipmmu-vmsa.c > > @@ -751,6 +751,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 = "r8a774e1", }, > > Adding an entry to soc_rcar_gen3_whitelist[] doesn't do anything, unless > you also add the same entry to soc_rcar_gen3[]. > I think the comment "For R-Car Gen3 use a white list to opt-in slave devices." is misleading. Booting through the kernel I do see iommu groups (attached is the logs). Also the recent patch to add "r8a77961" just adds to soc_rcar_gen3_whitelist. Cheers, --Prabhakar > > { .soc_id = "r8a7795", .revision = "ES3.*" }, > > { .soc_id = "r8a77961", }, > > { .soc_id = "r8a77965", }, > > @@ -963,6 +964,9 @@ static const struct of_device_id ipmmu_of_ids[] = { > > }, { > > .compatible = "renesas,ipmmu-r8a774c0", > > .data = &ipmmu_features_rcar_gen3, > > + }, { > > + .compatible = "renesas,ipmmu-r8a774e1", > > + .data = &ipmmu_features_rcar_gen3, > > }, { > > .compatible = "renesas,ipmmu-r8a7795", > > .data = &ipmmu_features_rcar_gen3, > > 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 [ 0.000149] NOTICE: BL2: RZ G2H Initial Program Loader(CA57) [ 0.004417] NOTICE: BL2: Initial Program Loader(Rev.2.0.6) [ 0.009949] NOTICE: BL2: PRR is RZG G2H Ver.3.0 [ 0.014530] NOTICE: BL2: Board is HiHope RZ/G2H Rev.4.0 [ 0.019796] NOTICE: BL2: Boot device is QSPI Flash(40MHz) [ 0.025236] NOTICE: BL2: LCM state is CM [ 0.029203] NOTICE: BL2: CH0: 0x400000000 - 0x47fffffff, 2 GiB [ 0.035071] NOTICE: BL2: CH1: 0x500000000 - 0x57fffffff, 2 GiB [ 0.040957] NOTICE: BL2: DDR3200(rev.0.40) [ 0.052413] NOTICE: BL2: [COLD_BOOT] [ 0.058356] NOTICE: BL2: DRAM Split is 2ch(DDR 3) [ 0.061655] NOTICE: BL2: QoS is default setting(rev.0.07) [ 0.067098] NOTICE: BL2: DRAM refresh interval 1.95 usec [ 0.072455] NOTICE: BL2: Periodic Write DQ Training [ 0.077485] NOTICE: BL2: Lossy Decomp areas [ 0.081614] NOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570 [ 0.088698] NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0 [ 0.095611] NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0 [ 0.102525] NOTICE: BL2: v1.5(release):af9f429-dirty [ 0.107534] NOTICE: BL2: Built : 13:06:47, Jun 11 2020 [ 0.112722] NOTICE: BL2: Normal boot [ 0.116360] NOTICE: BL2: dst=0xe6321100 src=0x8180000 len=512(0x200) [ 0.122850] NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800) [ 0.130588] NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000) [ 0.149490] NOTICE: BL2: dst=0x50000000 src=0x8300000 len=1048576(0x100000) [ 0.369751] NOTICE: BL2: Booting BL31 U-Boot 2018.09 (Jun 11 2020 - 13:06:59 +0000) CPU: Renesas Electronics R8A774E1 rev 3.0 Model: Hoperun Technology HiHope RZ/G2H platform (hihope-rzg2h) DRAM: 3.9 GiB Bank #0: 0x048000000 - 0x0bfffffff, 1.9 GiB Bank #1: 0x500000000 - 0x57fffffff, 2 GiB Watchdog: Not found by seq! WDT: watchdog@e6020000 Watchdog: Started! MMC: sd@ee100000: 0, sd@ee160000: 1 Loading Environment from MMC... OK In: serial@e6e88000 Out: serial@e6e88000 Err: serial@e6e88000 Net: eth0: ethernet@e6800000 Hit any key to stop autoboot: 0 ethernet@e6800000 Waiting for PHY auto negotiation to complete... done BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 BOOTP broadcast 4 DHCP client bound to address 192.168.10.136 (1798 ms) Using ethernet@e6800000 device TFTP from server 192.168.10.1; our IP address is 192.168.10.136 Filename 'g2h/Image.gz'. Load address: 0x4a080000 Loading: T ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ######### 971.7 KiB/s done Bytes transferred = 8705356 (84d54c hex) Using ethernet@e6800000 device TFTP from server 192.168.10.1; our IP address is 192.168.10.136 Filename 'g2h/r8a774e1-hihope-rzg2h-ex.dtb'. Load address: 0x48000000 Loading: ## 1.5 MiB/s done Bytes transferred = 22461 (57bd hex) Uncompressed size: 20603392 = 0x13A6200 ## Flattened Device Tree blob at 48000000 Booting using the fdt blob at 0x48000000 Using Device Tree in place at 0000000048000000, end 00000000480087bc Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd073] [ 0.000000] Linux version 5.8.0-rc4-next-20200707-00032-g98ba4606caf0 (prasmi@prasmi) (aarch64-linux-gnu-gcc (Linaro GCC 7.5-2019.12) 7.5.0, GNU ld (Linaro_Binutils-2019.12) 2.28.2.20170706) #8 SMP PREEM0 [ 0.000000] Machine model: HopeRun HiHope RZ/G2H with sub board [ 0.000000] efi: UEFI not found. [ 0.000000] cma: Reserved 32 MiB at 0x00000000be000000 [ 0.000000] NUMA: No NUMA configuration found [ 0.000000] NUMA: Faking a node at [mem 0x0000000048000000-0x000000057fffffff] [ 0.000000] NUMA: NODE_DATA [mem 0x57f81e100-0x57f81ffff] [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000048000000-0x000000007fffffff] [ 0.000000] DMA32 [mem 0x0000000080000000-0x00000000ffffffff] [ 0.000000] Normal [mem 0x0000000100000000-0x000000057fffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000048000000-0x00000000bfffffff] [ 0.000000] node 0: [mem 0x0000000500000000-0x000000057fffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000048000000-0x000000057fffffff] [ 0.000000] psci: probing for conduit method from DT. [ 0.000000] psci: PSCIv1.1 detected in firmware. [ 0.000000] psci: Using standard PSCI v0.2 function IDs [ 0.000000] psci: MIGRATE_INFO_TYPE not supported. [ 0.000000] psci: SMC Calling Convention v1.1 [ 0.000000] percpu: Embedded 22 pages/cpu s52952 r8192 d28968 u90112 [ 0.000000] Detected PIPT I-cache on CPU0 [ 0.000000] CPU features: detected: EL2 vector hardening [ 0.000000] Speculative Store Bypass Disable mitigation not required [ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 999936 [ 0.000000] Policy zone: Normal [ 0.000000] Kernel command line: ip=dhcp rw rootwait root=/dev/nfs nfsroot=192.168.10.1:/mnt/g2h,vers=4.1,tcp [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: mapped [mem 0x7bfff000-0x7ffff000] (64MB) [ 0.000000] Memory: 3863452K/4063232K available (11964K kernel code, 728K rwdata, 4936K rodata, 2432K init, 463K bss, 167012K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=8. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=8 [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] random: get_random_bytes called from start_kernel+0x314/0x4f0 with crng_init=0 [ 0.000000] arch_timer: cp15 timer(s) running at 8.33MHz (virt). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1ec02923e, max_idle_ns: 440795202125 ns [ 0.000003] sched_clock: 56 bits at 8MHz, resolution 120ns, wraps every 2199023255496ns [ 0.000091] Console: colour dummy device 80x25 [ 0.000276] printk: console [tty0] enabled [ 0.000337] Calibrating delay loop (skipped), value calculated using timer frequency.. 16.66 BogoMIPS (lpj=33333) [ 0.000352] pid_max: default: 32768 minimum: 301 [ 0.000406] LSM: Security Framework initializing [ 0.000470] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.000501] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 0.001806] rcu: Hierarchical SRCU implementation. [ 0.002315] Detected Renesas RZ/G2 r8a774e1 ES3.0 [ 0.002875] EFI services will not be available. [ 0.003171] smp: Bringing up secondary CPUs ... [ 0.003559] Detected PIPT I-cache on CPU1 [ 0.003606] CPU1: Booted secondary processor 0x0000000001 [0x411fd073] [ 0.004035] Detected PIPT I-cache on CPU2 [ 0.004060] CPU2: Booted secondary processor 0x0000000002 [0x411fd073] [ 0.004442] Detected PIPT I-cache on CPU3 [ 0.004465] CPU3: Booted secondary processor 0x0000000003 [0x411fd073] [ 0.004845] CPU features: detected: ARM erratum 845719 [ 0.004860] Detected VIPT I-cache on CPU4 [ 0.004903] CPU4: Booted secondary processor 0x0000000100 [0x410fd034] [ 0.005342] Detected VIPT I-cache on CPU5 [ 0.005368] CPU5: Booted secondary processor 0x0000000101 [0x410fd034] [ 0.005775] Detected VIPT I-cache on CPU6 [ 0.005802] CPU6: Booted secondary processor 0x0000000102 [0x410fd034] [ 0.006205] Detected VIPT I-cache on CPU7 [ 0.006231] CPU7: Booted secondary processor 0x0000000103 [0x410fd034] [ 0.006311] smp: Brought up 1 node, 8 CPUs [ 0.006366] SMP: Total of 8 processors activated. [ 0.006373] CPU features: detected: 32-bit EL0 Support [ 0.006380] CPU features: detected: CRC32 instructions [ 0.006386] CPU features: detected: 32-bit EL1 Support [ 0.017954] CPU: All CPU(s) started at EL1 [ 0.017998] alternatives: patching kernel code [ 0.019238] devtmpfs: initialized [ 0.021384] KASLR disabled due to lack of seed [ 0.021670] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.021693] futex hash table entries: 2048 (order: 5, 131072 bytes, linear) [ 0.022345] pinctrl core: initialized pinctrl subsystem [ 0.022673] thermal_sys: Registered thermal governor 'step_wise' [ 0.022675] thermal_sys: Registered thermal governor 'power_allocator' [ 0.022857] DMI not present or invalid. [ 0.023211] NET: Registered protocol family 16 [ 0.024013] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations [ 0.024132] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.024281] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.024316] audit: initializing netlink subsys (disabled) [ 0.024474] audit: type=2000 audit(0.024:1): state=initialized audit_enabled=0 res=1 [ 0.024831] cpuidle: using governor menu [ 0.024954] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.025059] ASID allocator initialised with 65536 entries [ 0.025422] Serial: AMBA PL011 UART driver [ 0.032964] sh-pfc e6060000.pin-controller: r8a774e1_pfc support registered [ 0.037453] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages [ 0.037465] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages [ 0.037473] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages [ 0.037481] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages [ 0.038355] cryptd: max_cpu_qlen set to 1000 [ 0.039928] ACPI: Interpreter disabled. [ 0.042130] iommu: Default domain type: Translated [ 0.042558] ipmmu-vmsa e67b0000.iommu: IPMMU context 0 is reserved [ 0.043630] vgaarb: loaded [ 0.043830] SCSI subsystem initialized [ 0.044076] usbcore: registered new interface driver usbfs [ 0.044101] usbcore: registered new interface driver hub [ 0.044152] usbcore: registered new device driver usb [ 0.044478] pps_core: LinuxPPS API ver. 1 registered [ 0.044486] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.044500] PTP clock support registered [ 0.044573] EDAC MC: Ver: 3.0.0 [ 0.045067] FPGA manager framework [ 0.045116] Advanced Linux Sound Architecture Driver Initialized. [ 0.045642] clocksource: Switched to clocksource arch_sys_counter [ 0.045786] VFS: Disk quotas dquot_6.6.0 [ 0.045830] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.045959] pnp: PnP ACPI: disabled [ 0.049234] NET: Registered protocol family 2 [ 0.049495] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear) [ 0.049537] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.049704] TCP bind hash table entries: 32768 (order: 7, 524288 bytes, linear) [ 0.050012] TCP: Hash tables configured (established 32768 bind 32768) [ 0.050133] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.050196] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear) [ 0.050347] NET: Registered protocol family 1 [ 0.050668] RPC: Registered named UNIX socket transport module. [ 0.050678] RPC: Registered udp transport module. [ 0.050684] RPC: Registered tcp transport module. [ 0.050689] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.050701] PCI: CLS 0 bytes, default 64 [ 0.051525] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available [ 0.051786] hw perfevents: enabled with armv8_cortex_a57 PMU driver, 7 counters available [ 0.052003] kvm [1]: HYP mode not available [ 0.054436] Initialise system trusted keyrings [ 0.054540] workingset: timestamp_bits=44 max_order=20 bucket_order=0 [ 0.057567] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.057996] NFS: Registering the id_resolver key type [ 0.058019] Key type id_resolver registered [ 0.058025] Key type id_legacy registered [ 0.058037] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 0.058151] 9p: Installing v9fs 9p2000 file system support [ 0.084038] Key type asymmetric registered [ 0.084049] Asymmetric key parser 'x509' registered [ 0.084078] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246) [ 0.084089] io scheduler mq-deadline registered [ 0.084096] io scheduler kyber registered [ 0.085332] gpio_rcar e6050000.gpio: driving 16 GPIOs [ 0.085546] gpio_rcar e6051000.gpio: driving 29 GPIOs [ 0.085742] gpio_rcar e6052000.gpio: driving 15 GPIOs [ 0.085935] gpio_rcar e6053000.gpio: driving 16 GPIOs [ 0.086119] gpio_rcar e6054000.gpio: driving 18 GPIOs [ 0.086296] gpio_rcar e6055000.gpio: driving 26 GPIOs [ 0.086424] gpio-370 (usb1-reset): hogged as output/low [ 0.086516] gpio_rcar e6055400.gpio: driving 32 GPIOs [ 0.086689] gpio_rcar e6055800.gpio: driving 4 GPIOs [ 0.087581] EINJ: ACPI disabled. [ 0.090056] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 0.090869] SuperH (H)SCI(F) driver initialized [ 0.091211] e6e88000.serial: ttySC0 at MMIO 0xe6e88000 (irq = 106, base_baud = 0) is a scif [ 1.034137] printk: console [ttySC0] enabled [ 1.045040] loop: module loaded [ 1.048618] megasas: 07.714.04.00-rc1 [ 1.053905] libphy: Fixed MDIO Bus: probed [ 1.058336] tun: Universal TUN/TAP device driver, 1.6 [ 1.063693] thunder_xcv, ver 1.0 [ 1.066945] thunder_bgx, ver 1.0 [ 1.070191] nicpf, ver 1.0 [ 1.073103] hclge is initializing [ 1.076451] hns3: Hisilicon Ethernet Network Driver for Hip08 Family - version [ 1.083680] hns3: Copyright (c) 2017 Huawei Corporation. [ 1.089021] e1000: Intel(R) PRO/1000 Network Driver [ 1.093902] e1000: Copyright (c) 1999-2006 Intel Corporation. [ 1.099674] e1000e: Intel(R) PRO/1000 Network Driver [ 1.104643] e1000e: Copyright(c) 1999 - 2015 Intel Corporation. [ 1.110590] igb: Intel(R) Gigabit Ethernet Network Driver [ 1.115995] igb: Copyright (c) 2007-2014 Intel Corporation. [ 1.121588] igbvf: Intel(R) Gigabit Virtual Function Network Driver [ 1.127857] igbvf: Copyright (c) 2009 - 2012 Intel Corporation. [ 1.133843] sky2: driver version 1.30 [ 1.138251] VFIO - User Level meta-driver version: 0.3 [ 1.144176] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 1.150718] ehci-pci: EHCI PCI platform driver [ 1.155181] ehci-platform: EHCI generic platform driver [ 1.160474] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 1.166670] ohci-pci: OHCI PCI platform driver [ 1.171133] ohci-platform: OHCI generic platform driver [ 1.176582] usbcore: registered new interface driver usb-storage [ 1.183412] i2c /dev entries driver [ 1.187907] sdhci: Secure Digital Host Controller Interface driver [ 1.194093] sdhci: Copyright(c) Pierre Ossman [ 1.247614] renesas_sdhi_internal_dmac ee160000.sd: mmc0 base at 0x00000000ee160000, max clock rate 200 MHz [ 1.257440] Synopsys Designware Multimedia Card Interface Driver [ 1.263756] sdhci-pltfm: SDHCI platform and OF driver helper [ 1.270199] ledtrig-cpu: registered to indicate activity on CPUs [ 1.276630] usbcore: registered new interface driver usbhid [ 1.282209] usbhid: USB HID core driver [ 1.287174] NET: Registered protocol family 17 [ 1.291737] 9pnet: Installing 9P2000 support [ 1.296053] Key type dns_resolver registered [ 1.300538] registered taskstats version 1 [ 1.304650] Loading compiled-in X.509 certificates [ 1.317235] renesas_irqc e61c0000.interrupt-controller: driving 6 irqs [ 1.325052] rcar-dmac e6700000.dma-controller: Adding to iommu group 0 [ 1.331624] rcar-dmac e6700000.dma-controller: Using IPMMU context 1 [ 1.340348] rcar-dmac e7300000.dma-controller: Adding to iommu group 1 [ 1.346913] rcar-dmac e7300000.dma-controller: Using IPMMU context 2 [ 1.355464] rcar-dmac e7310000.dma-controller: Reusing IPMMU context 2 [ 1.362017] rcar-dmac e7310000.dma-controller: Adding to iommu group 1 [ 1.368557] rcar-dmac e7310000.dma-controller: Reusing IPMMU context 2 [ 1.377496] ravb e6800000.ethernet: Reusing IPMMU context 1 [ 1.383092] ravb e6800000.ethernet: Adding to iommu group 0 [ 1.385664] mmc0: new HS200 MMC card at address 0001 [ 1.388672] ravb e6800000.ethernet: Reusing IPMMU context 1 [ 1.394038] mmcblk0: mmc0:0001 S0J57X 29.6 GiB [ 1.399713] libphy: ravb_mii: probed [ 1.403847] mmcblk0boot0: mmc0:0001 S0J57X partition 1 31.5 MiB [ 1.408276] ravb e6800000.ethernet eth0: Base address at 0xe6800000, ac:13:d0:20:87:a3, IRQ 103. [ 1.413355] mmcblk0boot1: mmc0:0001 S0J57X partition 2 31.5 MiB [ 1.428051] mmcblk0rpmb: mmc0:0001 S0J57X partition 3 4.00 MiB, chardev (241:0) [ 1.439223] mmcblk0: p1 [ 1.446421] Generic PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=POLL) [ 5.534230] ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off [ 5.561659] Sending DHCP requests ., OK [ 5.581502] IP-Config: Got DHCP answer from 192.168.10.1, my address is 192.168.10.136 [ 5.589424] IP-Config: Complete: [ 5.592656] device=eth0, hwaddr=ac:13:d0:20:87:a3, ipaddr=192.168.10.136, mask=255.255.255.0, gw=192.168.10.1 [ 5.603006] host=192.168.10.136, domain=example.org, nis-domain=(none) [ 5.609967] bootserver=192.168.10.1, rootserver=192.168.10.1, rootpath= [ 5.609970] nameserver0=192.168.10.1 [ 5.621410] ALSA device list: [ 5.624389] No soundcards found. [ 5.670597] VFS: Mounted root (nfs4 filesystem) on device 0:20. [ 5.677301] devtmpfs: mounted [ 5.681559] Freeing unused kernel memory: 2432K [ 5.717706] Run /sbin/init as init process [ 5.734023] random: fast init done [ 5.952671] systemd[1]: System time before build time, advancing clock. [ 6.018870] systemd[1]: systemd 234 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 ) [ 6.040280] systemd[1]: Detected architecture arm64. Welcome to Poky (Yocto Project Reference Distro) 2.4.3 (rocko)! [ 6.067996] systemd[1]: Set hostname to <hihope-rzg2h>. [ 6.736771] random: systemd: uninitialized urandom read (16 bytes read) [ 6.743543] systemd[1]: Reached target Swap. [ OK ] Reached target Swap. [ 6.761770] random: systemd: uninitialized urandom read (16 bytes read) [ 6.769524] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe. [ OK ] Listening on /dev/initctl Compatibility Named Pipe. [ 6.793776] random: systemd: uninitialized urandom read (16 bytes read) [ 6.800651] systemd[1]: Started Dispatch Password Requests to Console Directory Watch. [ OK ] Started Dispatch Password Requests to Console Directory Watch. [ 6.826830] systemd[1]: Listening on Journal Socket (/dev/log). [ OK ] Listening on Journal Socket (/dev/log). [ 6.847599] systemd[1]: Created slice System Slice. [ OK ] Created slice System Slice. [ 6.868955] systemd[1]: Mounting POSIX Message Queue File System... Mounting POSIX Message Queue File System... [ 6.896266] systemd[1]: Mounting Temporary Directory (/tmp)... Mounting Temporary Directory (/tmp)... [ OK ] Created slice system-serial\x2dgetty.slice. [ OK ] Listening on Journal Audit Socket. [ OK ] Reached target Host and Network Name Lookups. Mounting Kernel Debug File System... [ OK ] Listening on udev Kernel Socket. [ OK ] Started Forward Password Requests to Wall Directory Watch. [ OK ] Reached target Paths. [ OK ] Listening on udev Control Socket. [ OK ] Listening on Network Service Netlink Socket. [ OK ] Reached target Remote File Systems. [ OK ] Listening on Journal Socket. Starting Load Kernel Modules... Starting Remount Root and Kernel File Systems... Starting Journal Service... [ OK ] Created slice User and Session Slice. [ OK ] Reached target Slices. [ OK ] Created slice system-getty.slice. Mounting Huge Pages File System... [ OK ] Mounted Kernel Debug File System. [ OK ] Mounted POSIX Message Queue File System. [ OK ] Mounted Huge Pages File System. [ OK ] Mounted Temporary Directory (/tmp). [ OK ] Started Journal Service. [FAILED] Failed to start Load Kernel Modules. See 'systemctl status systemd-modules-load.service' for details. [ OK ] Started Remount Root and Kernel File Systems. Starting udev Coldplug all Devices... Starting Create Static Device Nodes in /dev... Starting Apply Kernel Variables... Mounting Kernel Configuration File System... Starting Flush Journal to Persistent Storage... [ OK ] Mounted Kernel Configuration File System. [ OK ] Started Apply Kernel Variables. [ OK ] Started Create Static Device Nodes in /dev. Starting udev Kernel Device Manager... [ OK ] Reached target Local File Systems (Pre). Mounting /var/volatile... [ OK ] Mounted /var/volatile. [ 7.559899] systemd-journald[219]: Received request to flush runtime journal from PID 1 Starting Load/Save Random Seed... [ OK ] Reached target Local File Systems. [ OK ] Started Flush Journal to Persistent Storage. [ OK ] Started udev Coldplug all Devices. [ OK ] Started Load/Save Random Seed. [ OK ] Started udev Kernel Device Manager. Starting Create Volatile Files and Directories... [ OK ] Started Create Volatile Files and Directories. [ 7.772100] random: crng init done [ 7.775513] random: 7 urandom warning(s) missed due to ratelimiting [ OK ] Found device /dev/ttySC0. Starting Update UTMP about System Boot/Shutdown... [ OK ] Started Update UTMP about System Boot/Shutdown. [ OK ] Reached target System Initialization. [ OK ] Listening on D-Bus System Message Bus Socket. Starting Network Service... [ OK ] Started dnf-automatic-install timer. [ OK ] Listening on RPCbind Server Activation Socket. [ OK ] Started dnf-automatic-download timer. [ OK ] Started dnf makecache timer. [ OK ] Started Daily Cleanup of Temporary Directories. [ OK ] Started dnf-automatic-notifyonly timer. [ OK ] Reached target Timers. [ OK ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket. [ OK ] Listening on dropbear.socket. [ OK ] Reached target Sockets. [ OK ] Reached target Basic System. [ OK ] Reached target Containers. [ OK ] Started Bluetooth Audio ALSA Backend. Starting Telephony service... Starting pvrinit.service... [ OK ] Started VIN initializing setting. Starting Avahi mDNS/DNS-SD Stack... Starting PowerVR consumer services... [ OK ] Started optee services. Starting Login Service... [ OK ] Started D-Bus System Message Bus. [ OK ] Started Avahi mDNS/DNS-SD Stack. [ OK ] Started Telephony service. Starting Connection service... [ OK ] Started Network Service. [ OK ] Started pvrinit.service. [ OK ] Started PowerVR consumer services. [ OK ] Started Login Service. [ OK ] Started Connection service. [ OK ] Reached target Network. Starting Permit User Sessions... Starting Target Communication Framework agent... [ OK ] Started Permit User Sessions. Starting Hostname Service... Starting WPA supplicant... [ OK ] Started Serial Getty on ttySC0. [ OK ] Started Getty on tty1. [ OK ] Reached target Login Prompts. [ OK ] Started Target Communication Framework agent. [ OK ] Started Hostname Service. [ OK ] Started WPA supplicant. [ OK ] Reached target Multi-User System. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Weston Wayland compositor. [ OK ] Started Update UTMP about System Runlevel Changes. [ 9.434816] audit: type=1006 audit(1592389647.479:2): pid=340 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1 [ 9.447232] audit: type=1300 audit(1592389647.479:2): arch=c00000b7 syscall=64 success=yes exit=1 a0=8 a1=ffffd094e158 a2=1 a3=ffff90370640 items=0 ppid=1 pid=340 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0) [ 9.473536] audit: type=1327 audit(1592389647.479:2): proctitle="(systemd)" Poky (Yocto Project Reference Distro) 2.4.3 hihope-rzg2h ttySC0 BSP: RZG2H/HIHOPE-RZG2H/1.0.4 LSI: RZG2H Version: 1.0.4 hihope-rzg2h login: [ 35.805671] USB20_VBUS0: disabling [ 35.809083] wlan-en-regulator: disabling [ 35.813017] SDHI0 VccQ: disabling Poky (Yocto Project Reference Distro) 2.4.3 hihope-rzg2h ttySC0 BSP: RZG2H/HIHOPE-RZG2H/1.0.4 LSI: RZG2H Version: 1.0.4 hihope-rzg2h login: root Last login: Wed Jun 17 10:27:27 UTC 2020 on tty2 [ 107.151160] audit: type=1006 audit(1592389745.195:3): pid=374 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=2 res=1 [ 107.163572] audit: type=1300 audit(1592389745.195:3): arch=c00000b7 syscall=64 success=yes exit=1 a0=8 a1=ffffd094e158 a2=1 a3=ffff9049a6f0 items=0 ppid=1 pid=374 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0) [ 107.189918] audit: type=1327 audit(1592389745.195:3): proctitle="(systemd)" amixer: Mixer attach default error: No such file or directory amixer: Mixer attach default error: No such file or directory ls: cannot access /dev/media*: No such file or directory sed: -e expression #1, char 0: no previous regular expression sed: -e expression #1, char 0: no previous regular expression Extreme Low Power mode has already been disabled. root@hihope-rzg2h:~# root@hihope-rzg2h:~# root@hihope-rzg2h:~# root@hihope-rzg2h:~# dmesg | grep -i iommu [ 0.042130] iommu: Default domain type: Translated [ 0.042558] ipmmu-vmsa e67b0000.iommu: IPMMU context 0 is reserved [ 1.325052] rcar-dmac e6700000.dma-controller: Adding to iommu group 0 [ 1.340348] rcar-dmac e7300000.dma-controller: Adding to iommu group 1 [ 1.362017] rcar-dmac e7310000.dma-controller: Adding to iommu group 1 [ 1.383092] ravb e6800000.ethernet: Adding to iommu group 0 root@hihope-rzg2h:~# root@hihope-rzg2h:~# dmesg | grep -i ipmmu [ 0.042558] ipmmu-vmsa e67b0000.iommu: IPMMU context 0 is reserved [ 1.331624] rcar-dmac e6700000.dma-controller: Using IPMMU context 1 [ 1.346913] rcar-dmac e7300000.dma-controller: Using IPMMU context 2 [ 1.355464] rcar-dmac e7310000.dma-controller: Reusing IPMMU context 2 [ 1.368557] rcar-dmac e7310000.dma-controller: Reusing IPMMU context 2 [ 1.377496] ravb e6800000.ethernet: Reusing IPMMU context 1 [ 1.388672] ravb e6800000.ethernet: Reusing IPMMU context 1 root@hihope-rzg2h:~# root@hihope-rzg2h:~#
Hi Prabhakar, On Tue, Jul 14, 2020 at 10:30 AM Lad, Prabhakar <prabhakar.csengg@gmail.com> wrote: > On Tue, Jul 14, 2020 at 9:09 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar > > <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > > > From: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > > > > > Add support for RZ/G2H (R8A774E1) SoC IPMMUs. > > > > > > Signed-off-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > Thanks for your patch! > > > > > --- a/drivers/iommu/ipmmu-vmsa.c > > > +++ b/drivers/iommu/ipmmu-vmsa.c > > > @@ -751,6 +751,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 = "r8a774e1", }, > > > > Adding an entry to soc_rcar_gen3_whitelist[] doesn't do anything, unless > > you also add the same entry to soc_rcar_gen3[]. > > > I think the comment "For R-Car Gen3 use a white list to opt-in slave > devices." is misleading. Booting through the kernel I do see iommu > groups (attached is the logs). Indeed. Without an entry in soc_rcar_gen3[], the IPMMU is enabled unconditionally, and soc_rcar_gen3_whitelist[] is ignored. That's why you want an entry in both, unless you have an R-Car Gen3 SoC where the IPMMU works correctly with all slave devices present. Perhaps soc_rcar_gen3[] should be renamed to soc_rcar_gen3_greylist[] (or soc_rcar_gen3_maybelist[]) to make this clear? > Also the recent patch to add > "r8a77961" just adds to soc_rcar_gen3_whitelist. Oops, commit 17fe16181639801b ("iommu/renesas: Add support for r8a77961") did it wrong, too. > > > { .soc_id = "r8a7795", .revision = "ES3.*" }, > > > { .soc_id = "r8a77961", }, > > > { .soc_id = "r8a77965", }, Gr{oetje,eeting}s, Geert
Hi Geert-san, > From: Geert Uytterhoeven, Sent: Tuesday, July 14, 2020 5:42 PM > > Hi Prabhakar, > > On Tue, Jul 14, 2020 at 10:30 AM Lad, Prabhakar > <prabhakar.csengg@gmail.com> wrote: > > On Tue, Jul 14, 2020 at 9:09 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar > > > <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote: > > > > From: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > > > > > > > Add support for RZ/G2H (R8A774E1) SoC IPMMUs. > > > > > > > > Signed-off-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com> > > > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > > > > > Thanks for your patch! > > > > > > > --- a/drivers/iommu/ipmmu-vmsa.c > > > > +++ b/drivers/iommu/ipmmu-vmsa.c > > > > @@ -751,6 +751,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 = "r8a774e1", }, > > > > > > Adding an entry to soc_rcar_gen3_whitelist[] doesn't do anything, unless > > > you also add the same entry to soc_rcar_gen3[]. > > > > > I think the comment "For R-Car Gen3 use a white list to opt-in slave > > devices." is misleading. Booting through the kernel I do see iommu > > groups (attached is the logs). > > Indeed. Without an entry in soc_rcar_gen3[], the IPMMU is enabled > unconditionally, and soc_rcar_gen3_whitelist[] is ignored. > That's why you want an entry in both, unless you have an R-Car Gen3 > SoC where the IPMMU works correctly with all slave devices present. > Perhaps soc_rcar_gen3[] should be renamed to soc_rcar_gen3_greylist[] > (or soc_rcar_gen3_maybelist[]) to make this clear? I think so (we should rename it). > > Also the recent patch to add > > "r8a77961" just adds to soc_rcar_gen3_whitelist. > > Oops, commit 17fe16181639801b ("iommu/renesas: Add support for r8a77961") > did it wrong, too. Thank you for the point it out. We should add r8a77961 to the soc_rcar_gen3[]. However, I don't know why I could not realize this issue... So, I investigated this a little and then, IIUC, glob_match() which soc_device_match() uses seems to return true, if *pat = "r8a7796" and *str = "r8a77961". Best regards, Yoshihiro Shimoda
Hi Shimoda-san, On Tue, Jul 14, 2020 at 1:42 PM Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote: > > From: Geert Uytterhoeven, Sent: Tuesday, July 14, 2020 5:42 PM > > On Tue, Jul 14, 2020 at 10:30 AM Lad, Prabhakar > > <prabhakar.csengg@gmail.com> wrote: > > > On Tue, Jul 14, 2020 at 9:09 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > > On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar > > > Also the recent patch to add > > > "r8a77961" just adds to soc_rcar_gen3_whitelist. > > > > Oops, commit 17fe16181639801b ("iommu/renesas: Add support for r8a77961") > > did it wrong, too. > > Thank you for the point it out. We should add r8a77961 to the soc_rcar_gen3[]. > However, I don't know why I could not realize this issue... > So, I investigated this a little and then, IIUC, glob_match() which > soc_device_match() uses seems to return true, if *pat = "r8a7796" and *str = "r8a77961". Are you sure about this? I enabled CONFIG_GLOB_SELFTEST, and globtest succeeded. It does test glob_match("a", "aa"), which is a similar test. To be 100% sure, I added: --- a/lib/globtest.c +++ b/lib/globtest.c @@ -59,6 +59,7 @@ static char const glob_tests[] __initconst = "1" "a\0" "a\0" "0" "a\0" "b\0" "0" "a\0" "aa\0" + "0" "r8a7796\0" "r8a77961\0" "0" "a\0" "\0" "1" "\0" "\0" "0" "\0" "a\0" and it still succeeded. Gr{oetje,eeting}s, Geert
Hi Geert-san, > From: Geert Uytterhoeven, Sent: Tuesday, July 14, 2020 9:40 PM > > Hi Shimoda-san, > > On Tue, Jul 14, 2020 at 1:42 PM Yoshihiro Shimoda > <yoshihiro.shimoda.uh@renesas.com> wrote: > > > From: Geert Uytterhoeven, Sent: Tuesday, July 14, 2020 5:42 PM > > > On Tue, Jul 14, 2020 at 10:30 AM Lad, Prabhakar > > > <prabhakar.csengg@gmail.com> wrote: > > > > On Tue, Jul 14, 2020 at 9:09 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > > > On Mon, Jul 13, 2020 at 11:35 PM Lad Prabhakar > > > > Also the recent patch to add > > > > "r8a77961" just adds to soc_rcar_gen3_whitelist. > > > > > > Oops, commit 17fe16181639801b ("iommu/renesas: Add support for r8a77961") > > > did it wrong, too. > > > > Thank you for the point it out. We should add r8a77961 to the soc_rcar_gen3[]. > > However, I don't know why I could not realize this issue... > > So, I investigated this a little and then, IIUC, glob_match() which > > soc_device_match() uses seems to return true, if *pat = "r8a7796" and *str = "r8a77961". > > Are you sure about this? I'm very sorry. I completely misunderstood the glob_match() behavior. And, now I understood why the current code can use IPMMU on r8a77961... # Since the first soc_device_match() will return false, ipmmu_slave_whitelist() # will return true and then the ipmmu_of_xlate() will be succeeded. > I enabled CONFIG_GLOB_SELFTEST, and globtest succeeded. > It does test glob_match("a", "aa"), which is a similar test. > > To be 100% sure, I added: > > --- a/lib/globtest.c > +++ b/lib/globtest.c > @@ -59,6 +59,7 @@ static char const glob_tests[] __initconst = > "1" "a\0" "a\0" > "0" "a\0" "b\0" > "0" "a\0" "aa\0" > + "0" "r8a7796\0" "r8a77961\0" > "0" "a\0" "\0" > "1" "\0" "\0" > "0" "\0" "a\0" > > and it still succeeded. I'm very sorry to waste your time about this... Best regards, Yoshihiro Shimoda
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index b90cd9ff96f6..cbce88ac5a71 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -751,6 +751,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 = "r8a774e1", }, { .soc_id = "r8a7795", .revision = "ES3.*" }, { .soc_id = "r8a77961", }, { .soc_id = "r8a77965", }, @@ -963,6 +964,9 @@ static const struct of_device_id ipmmu_of_ids[] = { }, { .compatible = "renesas,ipmmu-r8a774c0", .data = &ipmmu_features_rcar_gen3, + }, { + .compatible = "renesas,ipmmu-r8a774e1", + .data = &ipmmu_features_rcar_gen3, }, { .compatible = "renesas,ipmmu-r8a7795", .data = &ipmmu_features_rcar_gen3,