i.MX8MP Yocto hardknott MSI support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MP Yocto hardknott MSI support

1,166 Views
wyorgason
Contributor II

I am using the hardknott 5.10.35 linux release of Yocto for an i.MX8MPlus EVK board. The Linux driver for PCIe being loaded is the imx6q-pcie driver. Using this driver, MSI support gets disabled during the boot process. Is there an updated driver from NXP that supports the newer hardware, including MSI, that can be used? Here is some of the console output:

Model: NXP i.MX8MPlus LPDDR4 EVK board
[ 0.110491] imx8mp-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
...
[ 1.987530] i2c i2c-2: IMX I2C adapter registered
[ 1.994341] imx8mq-usb-phy 381f0040.usb-phy: supply vbus not found, using dummy regulator
[ 2.003041] imx8mq-usb-phy 382f0040.usb-phy: supply vbus not found, using dummy regulator
...
[ 2.222849] imx6q-pcie 33800000.pcie: Link up
[ 2.231110] imx6q-pcie 33800000.pcie: Link up, Gen1
[ 2.236093] imx6q-pcie 33800000.pcie: PCI host bridge to bus 0000:00
[ 2.242453] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.247943] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 2.254128] pci_bus 0000:00: root bus resource [mem 0x18000000-0x1fefffff]
[ 2.261034] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
[ 2.261047] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[ 2.273317] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 2.280055] pci 0000:00:00.0: supports D1
[ 2.284068] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
[ 2.292705] pci 0000:01:00.0: MSI quirk detected; MSI disabled

Labels (1)
Tags (1)
0 Kudos
5 Replies

1,091 Views
wyorgason
Contributor II

I have found that for this board (i.MX8MPlus EVK) the PCIe driver that deals with the M.2 PCIe port on the back of the board is called 'pci-imx6.c', and that the corresponding host PCIe driver is 'pcie-designware-host.c'. I am porting a Qualcomm PCIe wifi driver to this platform. The wifi driver is designed to use 32 MSI interrupts. (As the PCI bus gets probed, 1 MSI interrupt is assigned.) When the wifi driver starts to load, it asks for 32 MSIs, but it fails. (The function 'dw_pcie_host_init' in the designware driver sets the number MSIs to 32 by default. The pci-imx6 driver does not have a 'set_num_vectors' function for the pcie_port ops to set the value differently.) I am guessing since the driver asks for 32 MSIs, and the pcie driver only has 31 available, the request for 32 fails. 

So the question is, can the i.mx8mp-evk board M.2 PCIe fabric and drivers handle more than 32 MSIs? If I create an ops function for the pcie_port device that will set_num_vectors to 64, will that cause problems? (A macro 'MAX_MSI_IRQS' is set at 256, so 64 seems doable.)

1,155 Views
wyorgason
Contributor II

The wcn685x PCIe device does not trigger a quirk that disables MSI for the system. That is good that the platform doesn't have this particular issue.

Now on to porting the wcn685x Qualcomm driver and it's dependent cnss platform driver ...

0 Kudos

1,139 Views
igorpadykov
NXP Employee
NXP Employee

Hi Walter

 

i.MX8M supports MSI, one can use lspci -vvvv command that show MSI support,

additional details were sent via mail.

 

Best regards
igor

0 Kudos

1,116 Views
wyorgason
Contributor II

Thanks for the feedback, Igor. I am working with Linux 5.10.35. Do you have something that applies to that a little easier?

The main problem I am having is with obtaining 32 MSIs. I used the kernel function 'pci_msi_vec_count' to see how many MSIs are available. It returns 32. But the call to 'pci_alloc_irq_vectors' only returns 1.

Here is my source for the function call:
num_vectors = pci_alloc_irq_vectors(pci_dev, 1, msi_config->total_vectors, PCI_IRQ_MSI | PCI_IRQ_MSIX);

And here is my .config file, at the IRQ subsystem:

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
CONFIG_GENERIC_IRQ_MIGRATION=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_GENERIC_IRQ_IPI=y
CONFIG_GENERIC_MSI_IRQ=y
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
CONFIG_IRQ_MSI_IOMMU=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y

And the config file at the device drivers area:

CONFIG_PCI_MSI=y
CONFIG_PCI_MSI_IRQ_DOMAIN=y
CONFIG_PCI_QUIRKS=y

And the config at PCI controller drivers:

CONFIG_PCI_XGENE=y
CONFIG_PCI_XGENE_MSI=y
CONFIG_PCIE_ALTERA=y
CONFIG_PCIE_ALTERA_MSI=y

0 Kudos

1,160 Views
wyorgason
Contributor II

Perhaps the disabled MSI is due to the following from kernel source:  ./drivers/pci/quirks.c:

DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL_EXT, 0x2b42, quirk_disable_all_msi);

and

`lspci`
01:00.0 Class 0200: 1b4b:2b42
00:00.0 Class 0604: 16c3:abcd

The PCIe device being registered is a Marvell 0x2b42 device, which appears to be declared as having a quirk to the extent that MSI for all PCIe is disabled.

Which may mean that a different PCIe device won't end up with the same disabling MSI.
I'll try a Qualcomm wcn685x PCIe radio and see if the same disabling of MSI happens.

0 Kudos