ARM64, PCIe, annd ACPI
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".
Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
I might be missing something here so I'd like to send out this email and get your opinion on this. Your feedback is highly appreciated.
Regards,
Ray
Quoted 10 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
Yes. In my opinion, a PCIe host controller is generally required to support ECAM even if the platform doesn't support ACPI. I base this on PCIe r4.0, sec 7.2.2:
For systems that are PC-compatible, or that do not implement a processor-architecture-specific firmware interface standard that allows access to the Configuration Space, the ECAM is required as defined in this section.
Quoted 3 lines
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
We would treat that as a non-compliant platform that requires special quirks to work around the problem. That does mean we have to add platform-specific quirks, which of course means we can't run an old kernel on a new platform that lacks standard ECAM. There are several existing systems like this.
The notes and examples here should be a place to start:
drivers/pci/controller/Makefile
drivers/pci/controller/dwc/Makefile
drivers/acpi/pci_mcfg.c
Bjorn
Quoted 31 lines · Bjorn Helgaas
Quoted 10 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
Yes. In my opinion, a PCIe host controller is generally required to support ECAM even if the platform doesn't support ACPI. I base this on PCIe r4.0, sec 7.2.2:
For systems that are PC-compatible, or that do not implement a processor-architecture-specific firmware interface standard that allows access to the Configuration Space, the ECAM is required as defined in this section.
Quoted 3 lines
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
We would treat that as a non-compliant platform that requires special quirks to work around the problem. That does mean we have to add platform-specific quirks, which of course means we can't run an old kernel on a new platform that lacks standard ECAM. There are several existing systems like this.
Quoted 8 lines
The notes and examples here should be a place to start:
drivers/pci/controller/Makefile
drivers/pci/controller/dwc/Makefile
drivers/acpi/pci_mcfg.cBjorn
Thanks for the pointers, Bjorn! Very helpful!
Ray
Quoted 8 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".
Quoted 6 lines
Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
Yes and it is not just MMIO, config space must be ECAM compliant as described in the PCI firmware specification and enforced here:
In short: what's in the mainline (+ adequate PCI controller firmware configuration) must be sufficient to bootstrap your PCI subsystem in ACPI, it is a very simple litmus test and we won't add anything that deviates from that to the mainline kernel ARM64 ACPI PCI code support.
Thanks,
Lorenzo
Quoted 12 lines · Lorenzo Pieralisi
Quoted 11 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
Quoted 9 lines
Quoted 3 lines
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
Yes and it is not just MMIO, config space must be ECAM compliant as described in the PCI firmware specification and enforced here:
Okay, got it, the SBSA spec makes it very clear that the PCIe controller needs to support ECAM.
Quoted 5 lines
In short: what's in the mainline (+ adequate PCI controller firmware configuration) must be sufficient to bootstrap your PCI subsystem in ACPI, it is a very simple litmus test and we won't add anything that deviates from that to the mainline kernel ARM64 ACPI PCI code support.
It sounds like I'll have to look into ways to work around this at the driver level as Bjorn pointed out with some other examples.
Quoted 3 lines
Thanks,
Lorenzo
Thanks!
Ray
Quoted 28 lines · Ray Jui
Quoted 12 lines · Lorenzo Pieralisi
Quoted 11 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
Quoted 9 lines
Quoted 3 lines
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
Yes and it is not just MMIO, config space must be ECAM compliant as described in the PCI firmware specification and enforced here:
Okay, got it, the SBSA spec makes it very clear that the PCIe controller needs to support ECAM.
Quoted 8 lines
Quoted 5 lines
In short: what's in the mainline (+ adequate PCI controller firmware configuration) must be sufficient to bootstrap your PCI subsystem in ACPI, it is a very simple litmus test and we won't add anything that deviates from that to the mainline kernel ARM64 ACPI PCI code support.
It sounds like I'll have to look into ways to work around this at the driver level as Bjorn pointed out with some other examples.
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Lorenzo
Hi Lorenzo,
Quoted 38 lines · Lorenzo Pieralisi
Quoted 28 lines · Ray Jui
Quoted 12 lines · Lorenzo Pieralisi
Quoted 11 lines · Ray Jui
Hi Lorenzo/Bjorn,
I have a question on PCIe controller APCI support on ARM64 based systems.
If my understanding of the implementation of "
pci_acpi_scan_root" under "arch/arm64/kernel/pci.c" is correct, it appears "pci_acpi_setup_ecam_mapping" is called within "pci_acpi_scan_root".Does that mean for a PCIe host controller on ARM64 to support ACPI, it needs to support ECAM and MMIO based access to the configuration space registers?
Quoted 9 lines
Quoted 3 lines
If the above statement is true, does it imply that any PCIe controller on ARM64 that does not support MMIO based access to the config space register cannot have ACPI support?
Yes and it is not just MMIO, config space must be ECAM compliant as described in the PCI firmware specification and enforced here:
Okay, got it, the SBSA spec makes it very clear that the PCIe controller needs to support ECAM.
Quoted 8 lines
Quoted 5 lines
In short: what's in the mainline (+ adequate PCI controller firmware configuration) must be sufficient to bootstrap your PCI subsystem in ACPI, it is a very simple litmus test and we won't add anything that deviates from that to the mainline kernel ARM64 ACPI PCI code support.
It sounds like I'll have to look into ways to work around this at the driver level as Bjorn pointed out with some other examples.
Quoted 7 lines
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Lorenzo
I just want to make sure I interpret this properly. This means if the PCIe controller hardware does not support ECAM, there's pretty much no way around it with SW based workaround going forward with mainline kernel?
What about for the PCIe controller that was designed a few years back?
Thanks,
Ray
On Thu, Aug 09, 2018 at 07:57:52AM -0700, Ray Jui wrote:
[...]
Quoted 5 lines
Quoted 5 lines
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Quoted 7 lines
Quoted 2 lines
Lorenzo
I just want to make sure I interpret this properly. This means if the PCIe controller hardware does not support ECAM, there's pretty much no way around it with SW based workaround going forward with mainline kernel?
Yes.
Quoted 1 line
What about for the PCIe controller that was designed a few years back?
It will bootstrap with DT :)
Thanks,
Lorenzo
Hi Lorenzo,
Quoted 17 lines · Lorenzo Pieralisi
On Thu, Aug 09, 2018 at 07:57:52AM -0700, Ray Jui wrote:
[...]
Quoted 5 lines
Quoted 5 lines
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Quoted 7 lines
Quoted 2 lines
Lorenzo
I just want to make sure I interpret this properly. This means if the PCIe controller hardware does not support ECAM, there's pretty much no way around it with SW based workaround going forward with mainline kernel?
Quoted 5 lines
Yes.
Quoted 1 line
What about for the PCIe controller that was designed a few years back?
It will bootstrap with DT :)
Okay, one more quick question, what about for distributions that will eventually disable DT and force ACPI?
Quoted 4 lines
Thanks,
Lorenzo
Thanks,
Ray
Quoted 20 lines · Ray Jui
Hi Lorenzo,
Quoted 17 lines · Lorenzo Pieralisi
On Thu, Aug 09, 2018 at 07:57:52AM -0700, Ray Jui wrote:
[...]
Quoted 12 lines
Quoted 7 lines
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Lorenzo
I just want to make sure I interpret this properly. This means if the PCIe controller hardware does not support ECAM, there's pretty much no way around it with SW based workaround going forward with mainline kernel?
Quoted 8 lines
Quoted 5 lines
Yes.
Quoted 1 line
What about for the PCIe controller that was designed a few years back?
It will bootstrap with DT :)
Okay, one more quick question, what about for distributions that will eventually disable DT and force ACPI?
ACPI PCI support revolves around a FW model that requires, among other things, ECAM and its firmware description, MCFG table, to work.
If the host controller is not ECAM compliant it is not PCI firmware compliant, so it is not ACPI compliant, you can't run ACPI only distributions on it.
It is a model that has been run for decades in basically all ACPI based systems out there and there is not a reason to deviate from it, I understand the frustration but that's the way it is, sorry.
Thanks,
Lorenzo
Hi Lorenzo,
Quoted 37 lines · Lorenzo Pieralisi
Quoted 20 lines · Ray Jui
Hi Lorenzo,
Quoted 17 lines · Lorenzo Pieralisi
On Thu, Aug 09, 2018 at 07:57:52AM -0700, Ray Jui wrote:
[...]
Quoted 12 lines
Quoted 7 lines
As I said ARM64 ACPI PCI kernel support is in the mainline today and I am not willing to merge any more MCFG quirks at driver level - the information is out there, it is public and must be followed, either designers do that or no ACPI PCI support on your platform, sorry.
Lorenzo
I just want to make sure I interpret this properly. This means if the PCIe controller hardware does not support ECAM, there's pretty much no way around it with SW based workaround going forward with mainline kernel?
Quoted 8 lines
Quoted 5 lines
Yes.
Quoted 1 line
What about for the PCIe controller that was designed a few years back?
It will bootstrap with DT :)
Okay, one more quick question, what about for distributions that will eventually disable DT and force ACPI?
ACPI PCI support revolves around a FW model that requires, among other things, ECAM and its firmware description, MCFG table, to work.
If the host controller is not ECAM compliant it is not PCI firmware compliant, so it is not ACPI compliant, you can't run ACPI only distributions on it.
Quoted 8 lines
It is a model that has been run for decades in basically all ACPI based systems out there and there is not a reason to deviate from it, I understand the frustration but that's the way it is, sorry.
Thanks,
Lorenzo
Okay that draws the line. Thanks for confirming.
Ray