NXP iMX95: ARM SMMU problem with PCIe

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

NXP iMX95: ARM SMMU problem with PCIe

Jump to solution
252 Views
pierluigi_p
Senior Contributor I

Dear NXP support,

we are trying to integrate a PCIe-USB bridge eval kit (https://www.microchip.com/en-us/development-tool/ev96n38a) with NXP iMX95 using kernel 6.12.49.

The PCIe bridge successfully completes PCIe enumeration and all endpoints (xHCI controller, i2c controller, etc.) show up when running "lspci".

When plugging in a USB device (flash drive, keyboard, etc.) to a USB port on the PCI11400 eval kit, the following messages are listed

[ 1631.912942] arm-smmu-v3 490d0000.iommu: event 0x10 received:

[ 1631.918618] arm-smmu-v3 490d0000.iommu: 0x0000001000000010

[ 1631.924188] arm-smmu-v3 490d0000.iommu: 0x0000020200000000

[ 1631.929760] arm-smmu-v3 490d0000.iommu: 0x0000000000000000

[ 1631.935326] arm-smmu-v3 490d0000.iommu: 0x0000000000000000

but no USB device is actually enumerated.

Suspecting some kind of problem with ARM SMMU translation we added "iommu.passthrough=1" to the kernel command line: with this change, the USB devices are correctly enumerated.

However, "iommu.passthrough=1" allows accessing to protected memory regions (i.e. encryption keys) and cannot be considered a valid workaround from a security perspective.

Could you propose any alternative solution ?

Thanks

Best Regards

Pier

Tags (3)
0 Kudos
Reply
1 Solution
207 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @pierluigi_p 

It looks like that the PCIe-USB bridge you are using is accessing SMMU IDs other than the SID and RID allowed by the i.MX95 PCI node.

Below are the SMMU settings for the i.mx95 PCIe. i think you should figure out the actual SID and RID mapping used by the PCI11400.

			iommu-map = <0x000 &smmu 0x10 0x1>,
				    <0x100 &smmu 0x11 0x7>;
			iommu-map-mask = <0x1ff>;



Best Regards,
Zhiming

View solution in original post

0 Kudos
Reply
2 Replies
208 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @pierluigi_p 

It looks like that the PCIe-USB bridge you are using is accessing SMMU IDs other than the SID and RID allowed by the i.MX95 PCI node.

Below are the SMMU settings for the i.mx95 PCIe. i think you should figure out the actual SID and RID mapping used by the PCI11400.

			iommu-map = <0x000 &smmu 0x10 0x1>,
				    <0x100 &smmu 0x11 0x7>;
			iommu-map-mask = <0x1ff>;



Best Regards,
Zhiming

0 Kudos
Reply
46 Views
pierluigi_p
Senior Contributor I

Hi @Zhiming_Liu,

thanks for the suggestion.

Best Regards

Pier

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2372049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENXP%20iMX95%3A%20ARM%20SMMU%20problem%20with%20PCIe%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372049%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20NXP%20support%2C%3C%2FP%3E%3CP%3Ewe%20are%20trying%20to%20integrate%20a%20PCIe-USB%20bridge%20eval%20kit%20(%3CA%20href%3D%22https%3A%2F%2Fwww.microchip.com%2Fen-us%2Fdevelopment-tool%2Fev96n38a%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.microchip.com%2Fen-us%2Fdevelopment-tool%2Fev96n38a%3C%2FA%3E)%20with%20NXP%20iMX95%20using%20kernel%206.12.49.%3C%2FP%3E%3CP%3EThe%20PCIe%20bridge%20successfully%20completes%20PCIe%20enumeration%20and%20all%20endpoints%20(xHCI%20controller%2C%20i2c%20controller%2C%20etc.)%20show%20up%20when%20running%20%22lspci%22.%3C%2FP%3E%3CP%3EWhen%20plugging%20in%20a%20USB%20device%20(flash%20drive%2C%20keyboard%2C%20etc.)%20to%20a%20USB%20port%20on%20the%20PCI11400%20eval%20kit%2C%20the%20following%20messages%20are%20listed%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%5B%201631.912942%5D%20arm-smmu-v3%20490d0000.iommu%3A%20event%200x10%20received%3A%3C%2FP%3E%3CP%3E%5B%201631.918618%5D%20arm-smmu-v3%20490d0000.iommu%3A%200x0000001000000010%3C%2FP%3E%3CP%3E%5B%201631.924188%5D%20arm-smmu-v3%20490d0000.iommu%3A%200x0000020200000000%3C%2FP%3E%3CP%3E%5B%201631.929760%5D%20arm-smmu-v3%20490d0000.iommu%3A%200x0000000000000000%3C%2FP%3E%3CP%3E%5B%201631.935326%5D%20arm-smmu-v3%20490d0000.iommu%3A%200x0000000000000000%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3Ebut%20no%20USB%20device%20is%20actually%20enumerated.%3C%2FP%3E%3CP%3ESuspecting%20some%20kind%20of%20problem%20with%20ARM%20SMMU%20translation%20we%20added%20%22iommu.passthrough%3D1%22%20to%20the%20kernel%20command%20line%3A%20with%20this%20change%2C%20the%20USB%20devices%20are%20correctly%20enumerated.%3C%2FP%3E%3CP%3EHowever%2C%20%22iommu.passthrough%3D1%22%20allows%20accessing%20to%20protected%20memory%20regions%20(i.e.%20encryption%20keys)%20and%20cannot%20be%20considered%20a%20valid%20workaround%20from%20a%20security%20perspective.%3C%2FP%3E%3CP%3ECould%20you%20propose%20any%20alternative%20solution%20%3F%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EBest%20Regards%3C%2FP%3E%3CP%3EPier%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2372262%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NXP%20iMX95%3A%20ARM%20SMMU%20problem%20with%20PCIe%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372262%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F60868%22%20target%3D%22_blank%22%3E%40pierluigi_p%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20looks%20like%20that%20the%20PCIe-USB%20bridge%20you%20are%20using%20is%20accessing%20SMMU%20IDs%20other%20than%20the%20SID%20and%20RID%20allowed%20by%20the%20i.MX95%20PCI%20node.%3C%2FP%3E%0A%3CP%3EBelow%20are%20the%20SMMU%20settings%20for%20the%20i.mx95%20PCIe.%20i%20think%20you%20should%20figure%20out%20the%20actual%20SID%20and%20RID%20mapping%20used%20by%20the%20PCI11400.%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%09%09%09iommu-map%20%3D%20%26lt%3B0x000%20%26amp%3Bsmmu%200x10%200x1%26gt%3B%2C%0A%09%09%09%09%20%20%20%20%26lt%3B0x100%20%26amp%3Bsmmu%200x11%200x7%26gt%3B%3B%0A%09%09%09iommu-map-mask%20%3D%20%26lt%3B0x1ff%26gt%3B%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2376769%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NXP%20iMX95%3A%20ARM%20SMMU%20problem%20with%20PCIe%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2376769%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151788%22%20target%3D%22_blank%22%3E%40Zhiming_Liu%3C%2FA%3E%2C%3C%2FP%3E%3CP%3Ethanks%20for%20the%20suggestion.%3C%2FP%3E%3CP%3EBest%20Regards%3C%2FP%3E%3CP%3EPier%3C%2FP%3E%3C%2FLINGO-BODY%3E