Compile error in pci-imx6.c - undefined reference to pcie_phy_* and dw_pcie_*

Hi,

I am trying to build my own image and am suddenly getting a lot of these compile errors - just in this one file. I have cleaned/removed all build folders and tried again so it seems not to be a caching issue of some sort

arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `pcie_phy_poll_ack':
| pci-imx6.c:(.text+0x620): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `pcie_phy_wait_ack':
| pci-imx6.c:(.text+0xa98): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xaac): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xad4): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `pcie_phy_read':
| pci-imx6.c:(.text+0xb1c): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xb40): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xb58): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `pcie_phy_write':
| pci-imx6.c:(.text+0xba0): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xbb4): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xbdc): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0xc04): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o:pci-imx6.c:(.text+0xc2c): more undefined references to `dw_pcie_write_dbi' follow
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `imx6_pcie_start_link':
| pci-imx6.c:(.text+0xd10): undefined reference to `dw_pcie_link_up'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `imx6_pcie_l1ss_quirk':
| pci-imx6.c:(.text+0x110c): undefined reference to `dw_pcie_find_ext_capability'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x111c): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1134): undefined reference to `dw_pcie_read'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1170): undefined reference to `dw_pcie_read'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x11a4): undefined reference to `dw_pcie_read'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `pci_imx_set_msi_en':
| pci-imx6.c:(.text+0x123c): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1250): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1260): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x127c): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x128c): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x12a4): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `imx6_pcie_set_l1_latency':
| pci-imx6.c:(.text+0x12d4): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x12e8): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1324): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1340): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `imx6_pcie_establish_link':
| pci-imx6.c:(.text+0x1384): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1398): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x13a8): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x13c0): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x13d0): undefined reference to `dw_pcie_wait_for_link'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x13f4): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1410): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1420): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1434): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1444): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1460): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1470): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1484): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x149c): undefined reference to `dw_pcie_wait_for_link'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x14b4): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x14c8): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x14d8): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1544): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1584): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x1598): undefined reference to `dw_pcie_write_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: drivers/pci/controller/dwc/pci-imx6.o: in function `imx6_pcie_probe':
| pci-imx6.c:(.text+0x3668): undefined reference to `dw_pcie_read_dbi'
| arm-tdx-linux-gnueabi-ld.bfd: pci-imx6.c:(.text+0x367c): undefined reference to `dw_pcie_write_dbi'
| make[1]: *** [/home/toradex/bsp/dunfell/build/tmp/work-shared/apalis-imx6/kernel-source/Makefile:1100: vmlinux] Error 1
| make: *** [/home/toradex/bsp/dunfell/build/tmp/work-shared/apalis-imx6/kernel-source/Makefile:179: sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/toradex/bsp/dunfell/build/tmp/work/apalis_imx6-tdx-linux-gnueabi/linux-toradex/5.4.193+gitAUTOINC+f782992971-r0/temp/run.do_compile.32369' failed with exit code 1
ERROR: Task (/home/toradex/bsp/dunfell/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_compile) failed with exit code '1'

any hints would be greatly apprechiated

Hi @tw.apex,

Thanks for reaching out to us. May I ask you for a few more details regarding your question:

  1. Are you building one of our reference images or a customized one from Yocto?
  2. Did you follow the instructions on these pages to build your image:
    Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center
    Build TorizonCore from Source With Yocto Project/OpenEmbedded | Toradex Developer Center
  3. Which version of BSP/TorizonCore are you trying to build?
  4. Also, are you trying to build a downstream or upstream-based image?
  5. Are you using apalis-imx6 as the MACHINE?

Hi Rudhi, thanks for helping me on this

  1. I was able to build tdx-reference-multimedia-image fine and made a copy of it to start merging our rocko layer to dunfell - so now I am building just a slightly adopted tdx-reference-multimedia-image (I am reverting change after change to be able to pinpoint the exact “change” causing the compile issue)
  2. yes (working with Reference Image)
  3. BSP Dunfell
  4. I am using the default of apalis-imx6.conf (which is PREFERRED_PROVIDER_virtual/kernel_use-nxp-bsp ??= "linux-toradex")
  5. correct (MACHINE ?= "apalis-imx6" in my local.conf)

Good to hear that you were able to build the tdx-reference-multimedia-image. Your current approach to build the image looks correct. My only concern is whether you have confirmed that you use the right drivers - drivers that are compatible with the dunfell version. Could you please verify that?