mirzak / meta-coral

Yocto/OE-core BSP Layer for Coral Dev Board
MIT License
40 stars 21 forks source link

kirkstone device tree and wifi/bl issue #51

Open NIKovachev opened 1 year ago

NIKovachev commented 1 year ago

hi @mirzak, thanks for sharing your work.

With kirkstone there is no PCI reported:

root@coral-dev:~# lspci
root@coral-dev:~# 

I assume there is a problem with the device tree as we are using one from a different board. i tried to use the old device tree provided with the mendel release but this didn't work due to a bus clock error. As of that I'm unable to enable the wifi aand that makes the device in my case useless. Can you support me please with the pci and the device tree issue?

mirzak commented 1 year ago

Which branch of meta-coral did you use? Have you tried with master?

@kraj has been doing some updates recently, including updates of kernel.

NIKovachev commented 1 year ago

Hi, I used wip/kirkstone-upstream. After the changes can I build the master with kirkstone or I need to use older version?

kraj commented 1 year ago

Master works great and that’s what I test regularly with yoe distro I am not sure about kirkstone maybe you can change which kernel to use etc might help

NIKovachev commented 1 year ago

Thanks @kraj. I need kernel 5.15 at least due to some gstreamer-imx dependencies. That's why i was using kirkstone. Can I get newer kernel with yoe or yocto zeus/warrior and the master branch?

kraj commented 1 year ago

we currently use linux-fslc 6.1 kernel with master. If you want to stick to 5.15 you can change

diff --git a/conf/machine/coral-dev.conf b/conf/machine/coral-dev.conf
index e7ad7cb..6e33bbb 100644
--- a/conf/machine/coral-dev.conf
+++ b/conf/machine/coral-dev.conf
@@ -14,7 +14,7 @@ require conf/machine/include/arm/armv8a/tune-cortexa53.inc
 # inline NEON and FPU code generation
 DEFAULTTUNE:use-mainline-bsp = "cortexa53-crypto"

-PREFERRED_PROVIDER_virtual/kernel:use-mainline-bsp = "linux-fslc"
+PREFERRED_PROVIDER_virtual/kernel:use-mainline-bsp = "linux-fslc-lts"
 PREFERRED_PROVIDER_virtual/kernel:use-nxp-bsp = "linux-coral"

 MACHINE_FEATURES += "pci wifi bluetooth bcm43455 bcm4356"
NIKovachev commented 1 year ago

hi @kraj I've build the master with yoe dist and worked without issues, the kernel is 6.1 which is fine but the PCI is still missing. Do you have your wifi working and do lspci has output?

root@coral-dev:~# uname -a
Linux coral-dev 6.1.4-fslc+gb3713f4b8251 #1 SMP PREEMPT Mon Jan  9 14:42:19 UTC 2023 aarch64 GNU/Linux
root@coral-dev:~# lspci
root@coral-dev:~# iw list
root@coral-dev:~# 
kraj commented 1 year ago

My needs are ethernet only, infact so I have not tested wifi/bluetooth.

NIKovachev commented 1 year ago

can you help me please, I'm really stuck with that. I has a look at the device tree and both pci (pcie@33800000, pcie@33c00000) were disabled. I enabled them and now I have the following:

root@coral-dev:~# lspci
root@coral-dev:~# dmesg |grep pci
[    0.000000] Kernel command line: root=/dev/mmcblk1p2 rootfstype=ext4 rw rootwait net.ifnames=0 pci=pcie_bus_perf
[    1.768491] imx6q-pcie 33800000.pcie: error -ENOENT: pcie_bus clock source missing or invalid
[    1.770620] imx6q-pcie 33c00000.pcie: error -ENOENT: pcie_bus clock source missing or invalid
[    1.770645] imx6q-pcie: probe of 33c00000.pcie failed with error -2
[    1.796623] imx6q-pcie: probe of 33800000.pcie failed with error -2
root@coral-dev:~# 
NIKovachev commented 1 year ago

I tried to use the device tree from mendel but the kernel is not loading at all. The output from the kernel is not readable as well. do you have any ideas what could be the problem?

kraj commented 1 year ago

can you help me please, I'm really stuck with that. I has a look at the device tree and both pci (pcie@33800000, pcie@33c00000) were disabled. I enabled them and now I have the following:

root@coral-dev:~# lspci
root@coral-dev:~# dmesg |grep pci
[    0.000000] Kernel command line: root=/dev/mmcblk1p2 rootfstype=ext4 rw rootwait net.ifnames=0 pci=pcie_bus_perf
[    1.768491] imx6q-pcie 33800000.pcie: error -ENOENT: pcie_bus clock source missing or invalid
[    1.770620] imx6q-pcie 33c00000.pcie: error -ENOENT: pcie_bus clock source missing or invalid
[    1.770645] imx6q-pcie: probe of 33c00000.pcie failed with error -2
[    1.796623] imx6q-pcie: probe of 33800000.pcie failed with error -2
root@coral-dev:~# 

can you post your changes to device tree to enable this ?

NIKovachev commented 1 year ago

I only changed status = "okay" for pcie@0x33800000 and pcie@0x33c00000. I also tried to get the pci config from the mendel device tree but that didn't work as well.

NIKovachev commented 1 year ago

I just realise the TPU is attached to the PCI as well so even if I acces the device via ethernet its not really useful.

mirzak commented 1 year ago

The Coral Dev Board is largely based on https://github.com/Freescale/meta-freescale/blob/master/conf/machine/imx8mq-evk.conf. The WiFI part I believe is identical to that board.

So would start with comparing the dtbs of these two.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/freescale/imx8mq-evk.dts?h=v6.1.15

mirzak commented 1 year ago

I have only tested WiFi when I did the initial integration which was based on "zeus". This was still using the downstream Google Coral Linux kernel.

NIKovachev commented 1 year ago

just had a look at i.MX 8MDQLQ EVK Board Hardware User's Guide https://cache.nxp.com/secured/assets/documents/en/user-guide/IMX8MDQLQEVKHUG.pdf?fileExt=.pdfand I can confirm the wifi setup is with the same.

mirzak commented 1 year ago

Hm, I did not close this :P. It was most likely the comment in https://github.com/mirzak/meta-coral/pull/52 that did it in the merge.

@NIKovachev , can you try out the new changes and report back?

NIKovachev commented 1 year ago

sure I was planing to do that. thanks @mirzak @kraj

HadzajlicJasmin commented 8 months ago

Hi @NIKovachev, were you able to get WiFi working on linux 6.1 version in the end. We are trying to get it working, without success yet. We get "pcie: Phy link never came up" for pcie0, but pcie1 is working fine and we can see TPU connected. Thanks in advance.