Interfacing RM500Q-GL quectel modem on RZG2N custome board using PCIE interface

Hi Renesas Team,
I hope this message finds you well.
We are working on a custom board design based on the RZG2N, where we are interfacing the RM500Q-GL Quectel modem via the PCIe interface. We have integrated the pcie-mhi driver provided by Quectel into our kernel and successfully loaded the pci_mhi.ko module.
We have enabled the following entries in the r8a774b1-hihope-rzg2n-ex.dts file:
&pciec0 {
status = "okay";
};
&pciec1 {
status = "okay";
};
Despite this, the lspci command does not list any PCI devices, indicating that the PCIe interface is not detecting the modem. We would greatly appreciate your guidance on what might be missing or how we can successfully bring up the PCIe interface on the RZG2N to interface with the modem.
I have been unable to find detailed documentation on enabling the PCIe interface on the RZG2N, so any assistance or pointers to relevant resources would be invaluable.
PCIe Hardware setting.
 In RZ/G2N boot Mode setting is taken care MD12 is made Zero.
  • We are testing Both the PCIe 0 and PCIe 1 interface on RZ/G2N, Both PCIe interface is not working.
  • Tested the PCIe clock on ( PCIE_REFCLK_M/P to PCIe model) and (PCIE_CLK_P/M on RZ/G2N) 100MHZ clock is coming correctly.
Thank you in advance for your support.
Thanks and Regards,
Nagaraja
Parents
  • Hi,

    I had a quick look at Quectel's "RM500Q-GL Hardware Design" document, and found the following:

    - Turn on the RM500Q-GL module by setting the module's FULL_CARD_POWER_OFF# signal to HIGH (for example, by using the host CPU's GPIO).

    - Use AT commands to switch the PCIe operating mode (endpoint mode / root complex mode).

    Just to confirm, you performed the initial settings described in the RM500Q-GL manual to make the RM500Q-GL module's PCIe interface operational (for example, as mentioned above), and then tested it, right?

    BR

  • Hi Chris/egret,

    Thanks for the reply , Yes we enabled in the kernel

    CONFIG_PCIE_RCAR_HOST=y
    CONFIG_PCIE_RCAR_EP=y.

    And Also Done: Modem setings to work in PCIE mode like below

    AT+QCFG="data_interface",1,1 //Set network port communication through PCIe interface, and
                                                         diagnostic port through PCIe interface.

    AT+QCFG="pcie/mode",1        //RC Mode:

    In the kernel debug we are getting below error:

    [    0.133274] gpio-370 (usb1-reset): hogged as output/low
    [    0.133463] gpio_rcar e6055400.gpio: driving 32 GPIOs
    [    0.133770] gpio_rcar e6055800.gpio: driving 4 GPIOs
    [    0.135466] rcar-pcie fe000000.pcie: host bridge /soc/pcie@fe000000 ranges:
    [    0.135492] rcar-pcie fe000000.pcie: Parsing ranges property...
    [    0.135509] rcar-pcie fe000000.pcie:       IO 0x00fe100000..0x00fe1fffff -> 0x0000000000
    [    0.135534] rcar-pcie fe000000.pcie:      MEM 0x00fe200000..0x00fe3fffff -> 0x00fe200000
    [    0.135554] rcar-pcie fe000000.pcie:      MEM 0x0030000000..0x0037ffffff -> 0x0030000000
    [    0.135570] rcar-pcie fe000000.pcie:      MEM 0x0038000000..0x003fffffff -> 0x0038000000
    [    0.135585] rcar-pcie fe000000.pcie: Parsing dma-ranges property...
    [    0.135596] rcar-pcie fe000000.pcie:   IB MEM 0x0040000000..0x00bfffffff -> 0x0040000000
    [    0.199776] rcar-pcie fe000000.pcie: PCIe link down
    [    0.200014] rcar-pcie ee800000.pcie: host bridge /soc/pcie@ee800000 ranges:
    [    0.200029] rcar-pcie ee800000.pcie: Parsing ranges property...
    [    0.200044] rcar-pcie ee800000.pcie:       IO 0x00ee900000..0x00ee9fffff -> 0x0000000000
    [    0.200066] rcar-pcie ee800000.pcie:      MEM 0x00eea00000..0x00eebfffff -> 0x00eea00000
    [    0.200085] rcar-pcie ee800000.pcie:      MEM 0x00c0000000..0x00c7ffffff -> 0x00c0000000
    [    0.200100] rcar-pcie ee800000.pcie:      MEM 0x00c8000000..0x00cfffffff -> 0x00c8000000
    [    0.200111] rcar-pcie ee800000.pcie: Parsing dma-ranges property...
    [    0.200145] rcar-pcie ee800000.pcie:   IB MEM 0x0040000000..0x00bfffffff -> 0x0040000000
    [    0.267751] rcar-pcie ee800000.pcie: PCIe link down
    [    0.304727] SuperH (H)SCI(F) driver initialized.

    My dts entries is as below:

    &pciec1 {
            status = "okay";
    };
    &pciec0_ep {
            status = "okay";

    }.

    And I followed the instruction given in the :

    https://github.com/renesas-rz/rzg2-pcie-endpoint.

    root@hihope-rzg2n:~# ls /sys/class/pci_epc/
    fe000000.pcie-ep
    root@hihope-rzg2n:~# ls /sys/bus/pci-epf/drivers
    pci_epf_test
    root@hihope-rzg2n:~# mount -t configfs none /sys/kernel/config
    mount: /sys/kernel/config: none already mounted or mount point busy.
    root@hihope-rzg2n:~# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# mkdir functions/pci_epf_test/func1
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ls functions/pci_epf_test/func1/
    baseclass_code  cache_line_size  deviceid  interrupt_pin  msi_interrupts  msix_interrupts  progif_code  revid  subclass_code  subsys_id  subsys_vendor_id  vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cat vendorid
    0xffff
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cat interrupt_pin
    0x0001
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# ls
    baseclass_code  cache_line_size  deviceid  interrupt_pin  msi_interrupts  msix_interrupts  progif_code  revid  subclass_code  subsys_id  subsys_vendor_id  vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 0x1912 > functions/pci_epf_test/func1/vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 0x002b > functions/pci_epf_test/func1/deviceid # RZ/G2N
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 16 > functions/pci_epf_test/func1/msi_interrupts
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_test/func1/ controllers/fe000000.pcie_ep/
    ln: target `controllers/fe000000.pcie_ep/' is not a directory: No such file or directory
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_test/func1/ controllers/fe000000.pcie-ep/
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie_ep/start
    -sh: controllers/fe000000.pcie_ep/start: No such file or directory
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie-ep/     
    func1/ start  
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie-ep/start
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# lspci -vvxx
    root@hihope-rzg2n:/sys/kernel/config/pci_ep#

    SO lspci -vvxx is not showing any device attached to PCI.

    Please guide us what are we missing here.

    Thanks for your time and guidance.Please help how can we go about it.

    BR,

    Nagaraja

Reply
  • Hi Chris/egret,

    Thanks for the reply , Yes we enabled in the kernel

    CONFIG_PCIE_RCAR_HOST=y
    CONFIG_PCIE_RCAR_EP=y.

    And Also Done: Modem setings to work in PCIE mode like below

    AT+QCFG="data_interface",1,1 //Set network port communication through PCIe interface, and
                                                         diagnostic port through PCIe interface.

    AT+QCFG="pcie/mode",1        //RC Mode:

    In the kernel debug we are getting below error:

    [    0.133274] gpio-370 (usb1-reset): hogged as output/low
    [    0.133463] gpio_rcar e6055400.gpio: driving 32 GPIOs
    [    0.133770] gpio_rcar e6055800.gpio: driving 4 GPIOs
    [    0.135466] rcar-pcie fe000000.pcie: host bridge /soc/pcie@fe000000 ranges:
    [    0.135492] rcar-pcie fe000000.pcie: Parsing ranges property...
    [    0.135509] rcar-pcie fe000000.pcie:       IO 0x00fe100000..0x00fe1fffff -> 0x0000000000
    [    0.135534] rcar-pcie fe000000.pcie:      MEM 0x00fe200000..0x00fe3fffff -> 0x00fe200000
    [    0.135554] rcar-pcie fe000000.pcie:      MEM 0x0030000000..0x0037ffffff -> 0x0030000000
    [    0.135570] rcar-pcie fe000000.pcie:      MEM 0x0038000000..0x003fffffff -> 0x0038000000
    [    0.135585] rcar-pcie fe000000.pcie: Parsing dma-ranges property...
    [    0.135596] rcar-pcie fe000000.pcie:   IB MEM 0x0040000000..0x00bfffffff -> 0x0040000000
    [    0.199776] rcar-pcie fe000000.pcie: PCIe link down
    [    0.200014] rcar-pcie ee800000.pcie: host bridge /soc/pcie@ee800000 ranges:
    [    0.200029] rcar-pcie ee800000.pcie: Parsing ranges property...
    [    0.200044] rcar-pcie ee800000.pcie:       IO 0x00ee900000..0x00ee9fffff -> 0x0000000000
    [    0.200066] rcar-pcie ee800000.pcie:      MEM 0x00eea00000..0x00eebfffff -> 0x00eea00000
    [    0.200085] rcar-pcie ee800000.pcie:      MEM 0x00c0000000..0x00c7ffffff -> 0x00c0000000
    [    0.200100] rcar-pcie ee800000.pcie:      MEM 0x00c8000000..0x00cfffffff -> 0x00c8000000
    [    0.200111] rcar-pcie ee800000.pcie: Parsing dma-ranges property...
    [    0.200145] rcar-pcie ee800000.pcie:   IB MEM 0x0040000000..0x00bfffffff -> 0x0040000000
    [    0.267751] rcar-pcie ee800000.pcie: PCIe link down
    [    0.304727] SuperH (H)SCI(F) driver initialized.

    My dts entries is as below:

    &pciec1 {
            status = "okay";
    };
    &pciec0_ep {
            status = "okay";

    }.

    And I followed the instruction given in the :

    https://github.com/renesas-rz/rzg2-pcie-endpoint.

    root@hihope-rzg2n:~# ls /sys/class/pci_epc/
    fe000000.pcie-ep
    root@hihope-rzg2n:~# ls /sys/bus/pci-epf/drivers
    pci_epf_test
    root@hihope-rzg2n:~# mount -t configfs none /sys/kernel/config
    mount: /sys/kernel/config: none already mounted or mount point busy.
    root@hihope-rzg2n:~# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# mkdir functions/pci_epf_test/func1
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ls functions/pci_epf_test/func1/
    baseclass_code  cache_line_size  deviceid  interrupt_pin  msi_interrupts  msix_interrupts  progif_code  revid  subclass_code  subsys_id  subsys_vendor_id  vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cat vendorid
    0xffff
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cat interrupt_pin
    0x0001
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# ls
    baseclass_code  cache_line_size  deviceid  interrupt_pin  msi_interrupts  msix_interrupts  progif_code  revid  subclass_code  subsys_id  subsys_vendor_id  vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep/functions/pci_epf_test/func1# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 0x1912 > functions/pci_epf_test/func1/vendorid
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 0x002b > functions/pci_epf_test/func1/deviceid # RZ/G2N
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 16 > functions/pci_epf_test/func1/msi_interrupts
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_test/func1/ controllers/fe000000.pcie_ep/
    ln: target `controllers/fe000000.pcie_ep/' is not a directory: No such file or directory
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# ln -s functions/pci_epf_test/func1/ controllers/fe000000.pcie-ep/
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# cd /sys/kernel/config/pci_ep
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie_ep/start
    -sh: controllers/fe000000.pcie_ep/start: No such file or directory
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie-ep/     
    func1/ start  
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# echo 1 > controllers/fe000000.pcie-ep/start
    root@hihope-rzg2n:/sys/kernel/config/pci_ep# lspci -vvxx
    root@hihope-rzg2n:/sys/kernel/config/pci_ep#

    SO lspci -vvxx is not showing any device attached to PCI.

    Please guide us what are we missing here.

    Thanks for your time and guidance.Please help how can we go about it.

    BR,

    Nagaraja

Children
No Data