Update kernel

Is anyone using a recent kernel with the expansion board? I’ve compiled 5.5.8 successfully but it appears to be missing support for the expansion board.

The driver for the Microsemi PCIe controller on the expansion board isn’t yet upstream.
There’s some discussion on the public mailing lists:

https://lore.kernel.org/linux-pci/20200226131230.GA8160@IRD-LT-X61553B.mchp-main.com/

Have you been able to compile successfully after applying this patch?

It appears to apply cleanly.

dev01 /usr/src/linux-5.6-rc5 # patch -p1 < polarfire.patch 
patching file Documentation/devicetree/bindings/pci/microchip-pcie.txt
patching file drivers/pci/controller/Kconfig
Hunk #1 succeeded at 268 with fuzz 2 (offset -12 lines).
patching file drivers/pci/controller/Makefile
Hunk #1 succeeded at 27 with fuzz 2 (offset -1 lines).
patching file drivers/pci/controller/pcie-microchip.c

Yet I’m receiving the some errors which makes me think I’m missing a prerequisite.

  CC      drivers/pci/controller/pcie-microchip.o
drivers/pci/controller/pcie-microchip.c: In function ‘microchip_pcie_parse_pci_ranges’:
drivers/pci/controller/pcie-microchip.c:433:8: error: implicit declaration of function ‘devm_of_pci_get_host_bridge_resources’ [-Werror=implicit-function-declaration]
  433 |  ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c: At top level:
drivers/pci/controller/pcie-microchip.c:542:14: error: ‘pci_msi_mask_irq’ undeclared here (not in a function)
  542 |  .irq_mask = pci_msi_mask_irq,
      |              ^~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:543:16: error: ‘pci_msi_unmask_irq’ undeclared here (not in a function)
  543 |  .irq_unmask = pci_msi_unmask_irq,
      |                ^~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:546:15: error: variable ‘microchip_msi_domain_info’ has initializer but incomplete type
  546 | static struct msi_domain_info microchip_msi_domain_info = {
      |               ^~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:547:3: error: ‘struct msi_domain_info’ has no member named ‘flags’
  547 |  .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
      |   ^~~~~
drivers/pci/controller/pcie-microchip.c:547:12: error: ‘MSI_FLAG_USE_DEF_DOM_OPS’ undeclared here (not in a function)
  547 |  .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:547:39: error: ‘MSI_FLAG_USE_DEF_CHIP_OPS’ undeclared here (not in a function)
  547 |  .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:548:4: error: ‘MSI_FLAG_PCI_MSIX’ undeclared here (not in a function)
  548 |    MSI_FLAG_PCI_MSIX),
      |    ^~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:547:11: warning: excess elements in struct initializer
  547 |  .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
      |           ^
drivers/pci/controller/pcie-microchip.c:547:11: note: (near initialization for ‘microchip_msi_domain_info’)
drivers/pci/controller/pcie-microchip.c:549:3: error: ‘struct msi_domain_info’ has no member named ‘chip’
  549 |  .chip = &microchip_msi_irq_chip,
      |   ^~~~
drivers/pci/controller/pcie-microchip.c:549:10: warning: excess elements in struct initializer
  549 |  .chip = &microchip_msi_irq_chip,
      |          ^
drivers/pci/controller/pcie-microchip.c:549:10: note: (near initialization for ‘microchip_msi_domain_info’)
drivers/pci/controller/pcie-microchip.c: In function ‘microchip_compose_msi_msg’:
drivers/pci/controller/pcie-microchip.c:558:5: error: dereferencing pointer to incomplete type ‘struct msi_msg’
  558 |  msg->address_lo = lower_32_bits(addr);
      |     ^~
drivers/pci/controller/pcie-microchip.c: In function ‘microchip_allocate_msi_domains’:
drivers/pci/controller/pcie-microchip.c:651:3: error: implicit declaration of function ‘pci_msi_create_irq_domain’ [-Werror=implicit-function-declaration]
  651 |   pci_msi_create_irq_domain(fwnode,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/pcie-microchip.c:650:18: warning: assignment to ‘struct irq_domain *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  650 |  msi->msi_domain =
      |                  ^
drivers/pci/controller/pcie-microchip.c: At top level:
drivers/pci/controller/pcie-microchip.c:546:31: error: storage size of ‘microchip_msi_domain_info’ isn’t known
  546 | static struct msi_domain_info microchip_msi_domain_info = {
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:268: drivers/pci/controller/pcie-microchip.o] Error 1
make[2]: *** [scripts/Makefile.build:505: drivers/pci/controller] Error 2
make[1]: *** [scripts/Makefile.build:505: drivers/pci] Error 2
make: *** [Makefile:1683: drivers] Error 2