Coral TPU on I.MX8MM

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

Coral TPU on I.MX8MM

867 Views
fclad
Contributor I

I am trying to use a Coral TPU with an i.MX8MM processor, and I am facing the following kernel Oops


[ 7.474189] apex 0000:01:00.0: enabling device (0000 -> 0002)
[ 7.492713] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000


The PCI subsystem is starting well on the system, and I face the panic only when loading the apex kernel module


[ 2.035160] imx6q-pcie 33800000.pcie: host bridge /soc@0/pcie@33800000 ranges:
[ 2.052410] imx6q-pcie 33800000.pcie: IO 0x1ff80000..0x1ff8ffff -> 0x00000000
[ 2.069472] imx6q-pcie 33800000.pcie: MEM 0x18000000..0x1fefffff -> 0x18000000
[ 2.086499] imx6q-pcie 33800000.pcie: PLL REF_CLK is used!.
[ 2.202202] imx6q-pcie 33800000.pcie: PCIe PLL locked after 20 us.
[ 2.402985] imx6q-pcie 33800000.pcie: Link up
[ 2.503382] imx6q-pcie 33800000.pcie: Link up
[ 2.503391] imx6q-pcie 33800000.pcie: Link up, Gen1
[ 2.503528] imx6q-pcie 33800000.pcie: PCI host bridge to bus 0000:00
[ 2.503536] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.503541] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 2.503546] pci_bus 0000:00: root bus resource [mem 0x18000000-0x1fefffff]
[ 2.503571] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
[ 2.503594] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[ 2.503605] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 2.503657] pci 0000:00:00.0: supports D1
[ 2.503661] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
[ 2.505890] pci 0000:01:00.0: [1ac1:089a] type 00 class 0x0000ff
[ 2.506042] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00003fff 64bit pref]
[ 2.506097] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x000fffff 64bit pref]
[ 2.506687] pci 0000:01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x1 link at 0000:00:00.0 (capable of 4.000 Gb/s with 5 GT/s x1 link)
[ 2.517518] pci 0000:00:00.0: BAR 0: assigned [mem 0x18000000-0x180fffff]
[ 2.517526] pci 0000:00:00.0: BAR 15: assigned [mem 0x18100000-0x182fffff pref]
[ 2.517534] pci 0000:00:00.0: BAR 6: assigned [mem 0x18300000-0x1830ffff pref]
[ 2.517545] pci 0000:01:00.0: BAR 2: assigned [mem 0x18100000-0x181fffff 64bit
pref]

I am using the freescale/imx8mm.dtsi provided by NXP.

Any help will be appreciated!

0 Kudos
3 Replies

756 Views
TDKamil
Contributor II

Did you solve this problem? I have the same issue. 

Is it possible to extend memory size on IMX8m Mini? (memory map from ref manual below)

TDKamil_0-1620984852982.png

 

0 Kudos

845 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello fclad,

Please run "lspci -vv" to list PCI devices. 

The problem is caused by the LAW and MMU memory allocations for PCIe in

u-boot and Linux Kernel are not enough for your PCIe devices.
Please modify the memory map in u-boot and dts.

u-boot:

#ifdef CONFIG_PCIE1
#define CONFIG_SYS_PCIE1_MEM_VIRT       0x80000000
#define CONFIG_SYS_PCIE1_MEM_BUS        0xe0000000
#define CONFIG_SYS_PCIE1_MEM_PHYS       0xc00000000ull
#define CONFIG_SYS_PCIE1_MEM_SIZE       0x10000000      /* 256M */
#define CONFIG_SYS_PCIE1_IO_VIRT        0xf8000000
#define CONFIG_SYS_PCIE1_IO_BUS         0x00000000
#define CONFIG_SYS_PCIE1_IO_PHYS        0xff8000000ull
#define CONFIG_SYS_PCIE1_IO_SIZE        0x00010000      /* 64k */
#endif

In dts:

       pci0: pcie@ffe240000 {
                reg = <0xf 0xfe240000 0 0x10000>;
                ranges = <0x02000000 0 0xe0000000 0xc 0x0 0x0 0x10000000
                          0x01000000 0 0x0 0xf 0xf8000000 0x0 0x00010000>;
                pcie@0 {
                        ranges = <0x02000000 0 0xe0000000
                                  0x02000000 0 0xe0000000
                                  0 0x10000000

                                  0x01000000 0 0x00000000
                                  0x01000000 0 0x00000000
                                  0 0x00010000>;
                };
        };

Regards

 

0 Kudos

838 Views
fclad
Contributor I

Hi @Bio_TICFSL. Thanks for your help!

 

Where should I include the u-boot configuration? In which file?

0 Kudos