JeffyCN / meta-rockchip

Yocto BSP layer for the Rockchip SOC boards
Other
120 stars 93 forks source link

Luckfox Core3566 support #73

Closed argrento closed 1 year ago

argrento commented 1 year ago

Hi, I am trying to build a os image for this board (https://wiki.luckfox.com/cn/Core3566/Core3566-quick-start/). I use rk3566-evb as starting point. I build core-image-minimal and flashed it with 'upgrade_tool wl 0 core-image-minimal-rockchip-rk3566-evb.wic' It seems that board is booting as I see output in uart. But seems that something is wrong, because it's garbage.

Output sample:

[17:50:58:604] <0xab><0xfe><0xbf><0xab><0xa2><0xaf><0xa1>q<0xf1><0xac> *(<0xa3><0xfd><0xe1>␊
[17:50:58:618] (J<0xfd>)<0xa5><0xa9><0x8d><0xb5><0xd2><0x99><0xa1><0x9e><0xe5><0x8a><0xc1><0x9f>*x<0xa9>*<0xa1><0xe9>j<0xa5><0xae><0x8f><0xd5><0xbe><0x8d>=<0xa9><0xad><0xa9><0xa7>=<0xbd><0xe9><0x8a>(<0xb3><0xb3>9<0x88><0xe1><0xec><0xaa>2<0xcd><0x9d><0xe1><0xa5>+<0xa9><0xab><0xfd><0xe1><0xfd><0xc2><0xa9><0xb9><0xa3><0xff><0xff>*<0xa7>q<0xf2><0xed><0xa9><q<0xff><0xfd>"<0xa7>K<0xab><0xe1><0xf1>('␊
[17:51:01:758] <0xb5><0xeb>␊
[17:51:01:758] <0xab>7<0x0b><0x8b><0x99>(<0xca><0x8a>␊
[17:51:01:758] <0x89><0xad><0xa1><0xbd><0xb9><0x89><0x8d><0xe1><0x99>J,+<0xc9><0xe1><0xa5>(<0xa5><0x81><0xa9>n<0xa5><0xef><0xb1> <0x8d>/<0xa7><0xbc><0x8a>K<0xa5>"<0xa7>Q<0xfb><0xe2><0xe9>{␊
[17:51:01:758] <0x89><0xad><0xa1><0xe5><0xb9><0xa9><0xa5>+,<0xa9><0xe9>(+<0xad><0xa9><0xa5><0xff>

In board config it is 115200, in my serial app it is 115200 too. Maybe something is different (cpu quartz for example). Could you please help me finding out what's the problem?

chrisiberg commented 1 year ago

The default baud rate of RK3566 is 1500000.

argrento commented 1 year ago

Omg, for some reason I missed that. At 1500000 I can see output. But Linux does not boot.


=> DDR Version V1.11 20211103
ln
ddrconfig:0
LP4 MR14:0x4d
LPDDR4, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=2048MB
tdqss: cs0 dqs0: 458ps, dqs1: 361ps, dqs2: 385ps, dqs3: 289ps, 

change to: 324MHz
PHY drv:clk:38,ca:38,DQ:30,odt:0
vrefinner:41%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 528MHz
PHY drv:clk:38,ca:38,DQ:30,odt:0
vrefinner:41%, vrefout:41%
dram drv:40,odt:0
clk skew:0x72

change to: 780MHz
PHY drv:clk:38,ca:38,DQ:30,odt:0
vrefinner:41%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 1560MHz(final freq)
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:29%
dram drv:40,odt:80
vref_ca:00000068
clk skew:0x12
cs 0:
the read training result:
DQS0:0x3d, DQS1:0x3a, DQS2:0x41, DQS3:0x3a, 
min  :0x13 0x16 0x17 0x12  0x3  0x6  0xa  0x4 , 0xa  0xc  0x9  0x5  0xd  0x9 0x11  0x7 ,
      0x1d 0x19 0x17 0x10  0x6  0x2  0x8  0x7 ,0x14  0xe  0xc  0x3 0x15 0x14 0x12 0x14 ,
mid  :0x31 0x32 0x34 0x30 0x22 0x25 0x28 0x23 ,0x29 0x2b 0x27 0x24 0x2b 0x29 0x2d 0x26 ,
      0x39 0x37 0x32 0x2e 0x25 0x20 0x25 0x25 ,0x30 0x2b 0x29 0x22 0x32 0x32 0x2f 0x32 ,
max  :0x4f 0x4f 0x52 0x4e 0x42 0x45 0x47 0x43 ,0x49 0x4a 0x46 0x44 0x49 0x49 0x49 0x46 ,
      0x56 0x56 0x4d 0x4c 0x44 0x3f 0x43 0x44 ,0x4c 0x48 0x47 0x42 0x4f 0x50 0x4c 0x50 ,
range:0x3c 0x39 0x3b 0x3c 0x3f 0x3f 0x3d 0x3f ,0x3f 0x3e 0x3d 0x3f 0x3c 0x40 0x38 0x3f ,
      0x39 0x3d 0x36 0x3c 0x3e 0x3d 0x3b 0x3d ,0x38 0x3a 0x3b 0x3f 0x3a 0x3c 0x3a 0x3c ,
the write training result:
DQS0:0x6d, DQS1:0x5a, DQS2:0x5e, DQS3:0x4b, 
min  :0xb1 0xb5 0xb9 0xb6 0xa5 0xa7 0xab 0xab 0xab ,0x97 0x9c 0x97 0x99 0x9d 0x9f 0x9f 0x9d 0x98 ,
      0xa7 0xa6 0xa2 0xa2 0x97 0x95 0x97 0x9d 0x9d ,0x95 0x94 0x90 0x8b 0x99 0x99 0x94 0x9c 0x93 ,
mid  :0xcc 0xcf 0xd2 0xcf 0xbd 0xc0 0xc5 0xc3 0xc3 ,0xb0 0xb2 0xaf 0xb0 0xb4 0xb4 0xb4 0xb3 0xae ,
      0xc1 0xbf 0xb9 0xb9 0xb0 0xac 0xaf 0xb3 0xb4 ,0xaf 0xab 0xa9 0xa3 0xb1 0xb1 0xad 0xb4 0xab ,
max  :0xe7 0xe9 0xec 0xe9 0xd6 0xda 0xdf 0xdb 0xdc ,0xca 0xc9 0xc8 0xc7 0xcc 0xc9 0xc9 0xc9 0xc4 ,
      0xdb 0xd9 0xd1 0xd1 0xc9 0xc3 0xc7 0xc9 0xcc ,0xc9 0xc3 0xc3 0xbc 0xca 0xca 0xc6 0xcc 0xc4 ,
range:0x36 0x34 0x33 0x33 0x31 0x33 0x34 0x30 0x31 ,0x33 0x2d 0x31 0x2e 0x2f 0x2a 0x2a 0x2c 0x2c ,
      0x34 0x33 0x2f 0x2f 0x32 0x2e 0x30 0x2c 0x2f ,0x34 0x2f 0x33 0x31 0x31 0x31 0x32 0x30 0x31 ,
CA Training result:
cs:0 min  :0x4b 0x40 0x40 0x36 0x41 0x38 0x40 ,0x4b 0x3c 0x40 0x39 0x40 0x2e 0x3d ,
cs:0 mid  :0x83 0x82 0x75 0x76 0x75 0x77 0x6a ,0x80 0x7d 0x74 0x75 0x73 0x6e 0x69 ,
cs:0 max  :0xbb 0xc4 0xab 0xb7 0xaa 0xb6 0x94 ,0xb6 0xbf 0xa8 0xb1 0xa6 0xae 0x95 ,
cs:0 range:0x70 0x84 0x6b 0x81 0x69 0x7e 0x54 ,0x6b 0x83 0x68 0x78 0x66 0x80 0x58 ,
out
U-Boot SPL board init
U-Boot SPL 2017.09-gaaca6ffec1-211203 #zzz (Dec 03 2021 - 18:42:16)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
MMC error: The cmd index is 1, ret is -110
Card did not respond to voltage select!
mmc_init: -95, time 9
spl: mmc init failed with error: -95
Trying to boot from MMC1
No misc partition
Trying fit image at 0x4000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(fe4f274c06...) + OK
## Checking uboot 0x00a00000 ... sha256(4bd19ecd0b...) + OK
## Checking fdt 0x00b43a18 ... sha256(036cca5880...) + OK
## Checking atf-2 0x00068000 ... sha256(8d44036095...) + OK
## Checking atf-3 0xfdcd0000 ... sha256(e410275b51...) + OK
## Checking atf-4 0xfdcc9000 ... sha256(990c53fc01...) + OK
## Checking atf-5 0x00066000 ... sha256(315a4195a9...) + OK
## Checking optee 0x08400000 ... sha256(f3f0302d4c...) + OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 277.423 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-181-gc9a647cae:cl
NOTICE:  BL31: Built : 10:55:41, Oct 18 2021
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    pmu v1 is valid
INFO:    dfs DDR fsp_param[0].freq_mhz= 1560MHz
INFO:    dfs DDR fsp_param[1].freq_mhz= 324MHz
INFO:    dfs DDR fsp_param[2].freq_mhz= 528MHz
INFO:    dfs DDR fsp_param[3].freq_mhz= 780MHz
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
I/TC: 
I/TC: OP-TEE version: 3.13.0-619-g48b7c13e2 #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #7 Thu Jan  6 17:13:25 CST 2022 aarch64
I/TC: Primary CPU initializing
I/TC: Primary CPU switching to normal world boot
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0xa00000
INFO:    SPSR = 0x3c9

U-Boot 2017.09 (Apr 03 2023 - 06:43:01 +0000)

Model: Rockchip RK3568 Evaluation Board
PreSerial: 2, raw, 0xfe660000
DRAM:  2 GiB
Sysmem: init
Relocation Offset: 7d21c000
Relocation fdt: 7b9f86e8 - 7b9fecd0
CR: M/C/I
Using default environment

DM: v1
dwmmc@fe2b0000: 1, dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Bootdev(atags): mmc 0
MMC0: HS200, 200Mhz
PartType: EFI
No misc partition
boot mode: None
ces... oller
USB XHCI 1Failed to load DTB, ret=-19
No valid DTB, ret=-22
Failed to get kernel dtb, ret=-22
io-domain: OK
Failed to get scmi clk dev
dmc_fsp failed, ret=-19
Model: Rockchip RK3568 Evaluation Board
rockchip_set_serialno: could not find efuse/otp device
CLK:ces... cannot reset port 1!?
1 USB Device(s) found
scanning bus dwc3@fd000000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-rockchip
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
No ethernet found.
=> 
JeffyCN commented 1 year ago

Failed to load DTB, ret=-19 No valid DTB, ret=-22

maybe try to revert: https://github.com/JeffyCN/meta-rockchip/commit/dcdacdc1ab42cb3b0738be548c00d6d66f821c9f

or check the local conf has: https://github.com/JeffyCN/yocto-conf/commit/53a3ecd9481c3ec18c56e515fee04121b8ac39a8

JeffyCN commented 1 year ago

if still not working, maybe try to upload your .wic image somewhere then i will check it

chrisiberg commented 1 year ago

….. U-Boot 2017.09 (Apr 03 2023 - 06:43:01 +0000)

Model: Rockchip RK3568 Evaluation Board PreSerial: 2, raw, 0xfe660000 …..

Did you compile for RK3568?

argrento commented 1 year ago

Did you compile for RK3568?

No, in my config i have MACHINE ??= "rockchip-rk3566-evb"

argrento commented 1 year ago

maybe try to revert:

That helped, thanks! Now kernel boots, but stuck in bootloop.

Boot log ``` DDR Version V1.11 20211103 ln ddrconfig:0 LP4 MR14:0x4d LPDDR4, 324MHz BW=32 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=2048MB tdqss: cs0 dqs0: 434ps, dqs1: 313ps, dqs2: 361ps, dqs3: 265ps, change to: 324MHz PHY drv:clk:38,ca:38,DQ:30,odt:0 vrefinner:41%, vrefout:41% dram drv:40,odt:0 clk skew:0x58 change to: 528MHz PHY drv:clk:38,ca:38,DQ:30,odt:0 vrefinner:41%, vrefout:41% dram drv:40,odt:0 clk skew:0x75 change to: 780MHz PHY drv:clk:38,ca:38,DQ:30,odt:0 vrefinner:41%, vrefout:41% dram drv:40,odt:0 clk skew:0x58 change to: 1560MHz(final freq) PHY drv:clk:38,ca:38,DQ:30,odt:60 vrefinner:16%, vrefout:29% dram drv:40,odt:80 vref_ca:00000068 clk skew:0xf cs 0: the read training result: DQS0:0x3e, DQS1:0x3c, DQS2:0x44, DQS3:0x3c, min : 0xf 0x11 0x14 0xe 0x1 0x3 0x8 0x1 , 0x9 0xa 0x7 0x4 0xb 0x7 0xf 0x5 , 0x1a 0x18 0x16 0xf 0x6 0x2 0x8 0x6 ,0x10 0xc 0xa 0x1 0x12 0x11 0xf 0x12 , mid :0x2f 0x30 0x33 0x2f 0x21 0x24 0x28 0x22 ,0x29 0x2b 0x27 0x25 0x2b 0x29 0x2c 0x25 , 0x39 0x38 0x33 0x2f 0x26 0x21 0x27 0x26 ,0x2f 0x2b 0x29 0x22 0x31 0x31 0x2e 0x32 , max :0x50 0x50 0x53 0x50 0x42 0x46 0x48 0x43 ,0x4a 0x4c 0x48 0x46 0x4b 0x4b 0x4a 0x46 , 0x59 0x59 0x50 0x4f 0x46 0x41 0x46 0x46 ,0x4e 0x4b 0x49 0x43 0x50 0x52 0x4e 0x53 , range:0x41 0x3f 0x3f 0x42 0x41 0x43 0x40 0x42 ,0x41 0x42 0x41 0x42 0x40 0x44 0x3b 0x41 , 0x3f 0x41 0x3a 0x40 0x40 0x3f 0x3e 0x40 ,0x3e 0x3f 0x3f 0x42 0x3e 0x41 0x3f 0x41 , the write training result: DQS0:0x65, DQS1:0x4d, DQS2:0x57, DQS3:0x43, min :0xa9 0xae 0xb2 0xae 0x9d 0xa0 0xa4 0xa4 0xa4 ,0x8b 0x90 0x8a 0x8c 0x91 0x93 0x92 0x91 0x8c , 0xa0 0x9f 0x9a 0x9a 0x92 0x90 0x92 0x97 0x97 ,0x8d 0x8b 0x8a 0x85 0x91 0x91 0x8d 0x94 0x8b , mid :0xc3 0xc7 0xca 0xc8 0xb5 0xb7 0xbd 0xbb 0xbb ,0xa5 0xa7 0xa4 0xa4 0xa9 0xa9 0xa8 0xa7 0xa3 , 0xba 0xb9 0xb3 0xb2 0xaa 0xa7 0xa8 0xad 0xae ,0xa7 0xa3 0xa3 0x9e 0xaa 0xaa 0xa6 0xac 0xa5 , max :0xdd 0xe1 0xe3 0xe2 0xcd 0xcf 0xd6 0xd3 0xd3 ,0xbf 0xbf 0xbf 0xbc 0xc1 0xbf 0xbf 0xbd 0xbb , 0xd5 0xd3 0xcc 0xca 0xc2 0xbf 0xbf 0xc3 0xc6 ,0xc2 0xbc 0xbc 0xb8 0xc3 0xc3 0xbf 0xc4 0xbf , range:0x34 0x33 0x31 0x34 0x30 0x2f 0x32 0x2f 0x2f ,0x34 0x2f 0x35 0x30 0x30 0x2c 0x2d 0x2c 0x2f , 0x35 0x34 0x32 0x30 0x30 0x2f 0x2d 0x2c 0x2f ,0x35 0x31 0x32 0x33 0x32 0x32 0x32 0x30 0x34 , CA Training result: cs:0 min :0x4c 0x41 0x40 0x38 0x42 0x39 0x40 ,0x4c 0x3e 0x40 0x3b 0x40 0x31 0x3d , cs:0 mid :0x85 0x84 0x77 0x79 0x78 0x79 0x6c ,0x82 0x7e 0x75 0x78 0x74 0x71 0x6b , cs:0 max :0xbf 0xc7 0xaf 0xbb 0xae 0xba 0x98 ,0xb9 0xbf 0xab 0xb5 0xa8 0xb1 0x99 , cs:0 range:0x73 0x86 0x6f 0x83 0x6c 0x81 0x58 ,0x6d 0x81 0x6b 0x7a 0x68 0x80 0x5c , out U-Boot SPL board init U-Boot SPL 2017.09-gaaca6ffec1-211203 #zzz (Dec 03 2021 - 18:42:16) unknown raw ID phN unrecognized JEDEC id bytes: 00, 00, 00 Trying to boot from MMC2 MMC error: The cmd index is 1, ret is -110 Card did not respond to voltage select! mmc_init: -95, time 9 spl: mmc init failed with error: -95 Trying to boot from MMC1 No misc partition Trying fit image at 0x4000 sector ## Verified-boot: 0 ## Checking atf-1 0x00040000 ... sha256(fe4f274c06...) + OK ## Checking uboot 0x00a00000 ... sha256(4bd19ecd0b...) + OK ## Checking fdt 0x00b43a18 ... sha256(036cca5880...) + OK ## Checking atf-2 0x00068000 ... sha256(8d44036095...) + OK ## Checking atf-3 0xfdcd0000 ... sha256(e410275b51...) + OK ## Checking atf-4 0xfdcc9000 ... sha256(990c53fc01...) + OK ## Checking atf-5 0x00066000 ... sha256(315a4195a9...) + OK ## Checking optee 0x08400000 ... sha256(f3f0302d4c...) + OK Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000) Total: 292.907 ms INFO: Preloader serial: 2 NOTICE: BL31: v2.3():v2.3-181-gc9a647cae:cl NOTICE: BL31: Built : 10:55:41, Oct 18 2021 INFO: GICv3 without legacy support detected. INFO: ARM GICv3 driver initialized in EL3 INFO: pmu v1 is valid INFO: dfs DDR fsp_param[0].freq_mhz= 1560MHz INFO: dfs DDR fsp_param[1].freq_mhz= 324MHz INFO: dfs DDR fsp_param[2].freq_mhz= 528MHz INFO: dfs DDR fsp_param[3].freq_mhz= 780MHz INFO: Using opteed sec cpu_context! INFO: boot cpu mask: 0 INFO: BL31: Initializing runtime services INFO: BL31: Initializing BL32 I/TC: I/TC: OP-TEE version: 3.13.0-619-g48b7c13e2 #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #7 Thu Jan 6 17:13:25 CST 2022 aarch64 I/TC: Primary CPU initializing I/TC: Primary CPU switching to normal world boot INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0xa00000 INFO: SPSR = 0x3c9 U-Boot 2017.09 (Apr 03 2023 - 06:43:01 +0000) Model: Rockchip RK3568 Evaluation Board PreSerial: 2, raw, 0xfe660000 DRAM: 2 GiB Sysmem: init Relocation Offset: 7d21c000 Relocation fdt: 7b9f86e8 - 7b9fecd0 CR: M/C/I Using default environment DM: v1 dwmmc@fe2b0000: 1, dwmmc@fe2c0000: 2, sdhci@fe310000: 0 Bootdev(atags): mmc 0 MMC0: HS200, 200Mhz PartType: EFI No misc partition boot mode: None ture enabled 0.269503] rk_gmac-dwmac fe010000.ethernetTEEC: Waring: Could not find security partition /opt/yocto/rk3566/build/tmp/work/rockchip_rk3566_evb-poky-linux/u-boot-rockchip/1_2017.09-r0/git/lib/avb/libavb_user/avb_ops_user.c: trusty_read_lock_state failed Error determining whether device is unlocketure enabled [ 0.400255] mdio_bus stmmac-1: MDIO device at address 0 is missing. [ 0.401833] usbcore: registered new interface driver rndis_wlan [ 0.401895] usbcore: registered new interface driver rtl8150 [ 0.401949] usbcore: registered new interface driver r8152 [ 0.401997] usbcore: registered new interface driver asix [ 0.402043] usbcore: registered new interface driver ax88179_178a [ 0.402089] usbcore: registered new interface driver cdc_ether [ 0.402135] usbcore: registered new interface driver rndis_host [ 0.402195] usbcore: registered new interface driver cdc_ncm [ 0.402240] usbcore: registered new interface driver cdc_mbim [ 0.403410] dwc3 fcc00000.dwc3: Failed to get clk 'ref': -2 [ 0.408868] dwc3 fd000000.dwc3: Failed to get clk 'ref': -2 [ 0.413086] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 0.413121] ehci-pci: EHCI PCI platform driver [ 0.413193] ehci-platform: EHCI generic platform driver [ 0.415559] ehci-platform fd800000.usb: EHCI Host Controller [ 0.415741] ehci-platform fd800000.usb: new USB bus registered, assigned bus number 1 [ 0.416071] ehci-platform fd800000.usb: irq 11, io mem 0xfd800000 [ 0.426679] ehci-platform fd800000.usb: USB 2.0 started, EHCI 1.00 [ 0.426911] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 0.426932] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.426953] usb usb1: Product: EHCI Host Controller [ 0.426963] usb usb1: Manufacturer: Linux 4.19.232-rockchip-standard ehci_hcd [ 0.426971] usb usb1: SerialNumber: fd800000.usb [ 0.427414] hub 1-0:1.0: USB hub found [ 0.427460] hub 1-0:1.0: 1 port detected [ 0.429992] ehci-platform fd880000.usb: EHCI Host Controller [ 0.430182] ehci-platform fd880000.usb: new USB bus registered, assigned bus number 2 [ 0.430488] ehci-platform fd880000.usb: irq 13, io mem 0xfd880000 [ 0.443330] ehci-platform fd880000.usb: USB 2.0 started, EHCI 1.00 [ 0.443536] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 0.443557] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.443576] usb usb2: Product: EHCI Host Controller [ 0.443589] usb usb2: Manufacturer: Linux 4.19.232-rockchip-standard ehci_hcd [ 0.443604] usb usb2: SerialNumber: fd880000.usb [ 0.444010] hub 2-0:1.0: USB hub found [ 0.444056] hub 2-0:1.0: 1 port detected [ 0.444784] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 0.444815] ohci-platform: OHCI generic platform driver [ 0.445058] ohci-platform fd840000.usb: Generic Platform OHCI controller [ 0.445229] ohci-platform fd840000.usb: new USB bus registered, assigned bus number 3 [ 0.445461] ohci-platform fd840000.usb: irq 12, io mem 0xfd840000 [ 0.504162] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.19 [ 0.504183] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.504193] usb usb3: Product: Generic Platform OHCI controller [ 0.504202] usb usb3: Manufacturer: Linux 4.19.232-rockchip-standard ohci_hcd [ 0.504211] usb usb3: SerialNumber: fd840000.usb [ 0.504628] hub 3-0:1.0: USB hub found [ 0.504676] hub 3-0:1.0: 1 port detected [ 0.505167] ohci-platform fd8c0000.usb: Generic Platform OHCI controller [ 0.505347] ohci-platform fd8c0000.usb: new USB bus registered, assigned bus number 4 [ 0.505641] ohci-platform fd8c0000.usb: irq 14, io mem 0xfd8c0000 [ 0.564174] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 4.19 [ 0.564194] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.564204] usb usb4: Product: Generic Platform OHCI controller [ 0.564213] usb usb4: Manufacturer: Linux 4.19.232-rockchip-standard ohci_hcd [ 0.564221] usb usb4: SerialNumber: fd8c0000.usb [ 0.564620] hub 4-0:1.0: USB hub found [ 0.564667] hub 4-0:1.0: 1 port detected [ 0.566138] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller [ 0.566327] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 5 [ 0.566828] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000021022010010 [ 0.566900] xhci-hcd xhci-hcd.0.auto: irq 81, io mem 0xfcc00000 [ 0.567216] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 0.567235] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.567250] usb usb5: Product: xHCI Host Controller [ 0.567265] usb usb5: Manufacturer: Linux 4.19.232-rockchip-standard xhci-hcd [ 0.567279] usb usb5: SerialNumber: xhci-hcd.0.auto [ 0.567706] hub 5-0:1.0: USB hub found [ 0.567754] hub 5-0:1.0: 1 port detected [ 0.568072] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller [ 0.568229] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 6 [ 0.568259] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed [ 0.568358] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM. [ 0.568490] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19 [ 0.568509] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.568524] usb usb6: Product: xHCI Host Controller [ 0.568538] usb usb6: Manufacturer: Linux 4.19.232-rockchip-standard xhci-hcd [ 0.568551] usb usb6: SerialNumber: xhci-hcd.0.auto [ 0.568932] hub 6-0:1.0: USB hub found [ 0.568976] hub 6-0:1.0: 1 port detected [ 0.569449] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller [ 0.569624] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 7 [ 0.570133] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000011002010010 [ 0.570203] xhci-hcd xhci-hcd.1.auto: irq 82, io mem 0xfd000000 [ 0.570503] usb usb7: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19 [ 0.570524] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.570540] usb usb7: Product: xHCI Host Controller [ 0.570554] usb usb7: Manufacturer: Linux 4.19.232-rockchip-standard xhci-hcd [ 0.570563] usb usb7: SerialNumber: xhci-hcd.1.auto [ 0.570967] hub 7-0:1.0: USB hub found [ 0.571013] hub 7-0:1.0: 1 port detected [ 0.571322] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller [ 0.571489] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 8 [ 0.571517] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed [ 0.571594] usb usb8: We don't know the algorithms for LPM for this host, disabling LPM. [ 0.571731] usb usb8: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19 [ 0.571750] usb usb8: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 0.571760] usb usb8: Product: xHCI Host Controller [ 0.571768] usb usb8: Manufacturer: Linux 4.19.232-rockchip-standard xhci-hcd [ 0.571785] usb usb8: SerialNumber: xhci-hcd.1.auto [ 0.572164] hub 8-0:1.0: USB hub found [ 0.572209] hub 8-0:1.0: 1 port detected [ 0.572702] usbcore: registered new interface driver cdc_acm [ 0.572721] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters [ 0.572784] usbcore: registered new interface driver cdc_wdm [ 0.573040] usbcore: registered new interface driver uas [ 0.573211] usbcore: registered new interface driver usb-storage [ 0.573367] usbcore: registered new interface driver usbserial_generic [ 0.573405] usbserial: USB Serial support registered for generic [ 0.573470] usbcore: registered new interface driver cp210x [ 0.573496] usbserial: USB Serial support registered for cp210x [ 0.573606] usbcore: registered new interface driver ftdi_sio [ 0.573640] usbserial: USB Serial support registered for FTDI USB Serial Device [ 0.573928] usbcore: registered new interface driver keyspan [ 0.573963] usbserial: USB Serial support registered for Keyspan - (without firmware) [ 0.573997] usbserial: USB Serial support registered for Keyspan 1 port adapter [ 0.574029] usbserial: USB Serial support registered for Keyspan 2 port adapter [ 0.574060] usbserial: USB Serial support registered for Keyspan 4 port adapter [ 0.574125] usbcore: registered new interface driver option [ 0.574158] usbserial: USB Serial support registered for GSM modem (1-port) [ 0.574571] usbcore: registered new interface driver oti6858 [ 0.574606] usbserial: USB Serial support registered for oti6858 [ 0.574663] usbcore: registered new interface driver pl2303 [ 0.574696] usbserial: USB Serial support registered for pl2303 [ 0.574772] usbcore: registered new interface driver qcserial [ 0.574805] usbserial: USB Serial support registered for Qualcomm USB modem [ 0.574898] usbcore: registered new interface driver sierra [ 0.574932] usbserial: USB Serial support registered for Sierra USB modem [ 0.576482] usbcore: registered new interface driver usbtouchscreen [ 0.576546] cyttsp5_loader_init: Parade TTSP FW Loader Driver (Built TTDA.03.08.874312) rc=0 [ 0.576564] cyttsp5_device_access_init: Parade TTSP Device Access Driver (Built TTDA.03.08.874312) rc=0 [ 0.576952] .. rk pwm remotectl v2.0 init [ 0.577235] input: fe6e0030.pwm as /devices/platform/fe6e0030.pwm/input/input0 [ 0.577576] remotectl-pwm fe6e0030.pwm: pwm version is 0x2130000 [ 0.577646] remotectl-pwm fe6e0030.pwm: Controller support pwrkey capture [ 0.578230] i2c /dev entries driver [ 0.580021] fan53555-regulator 0-001c: FAN53555 Option[12] Rev[15] Detected! [ 0.581804] vdd_cpu: supplied by vcc5v0_sys [ 0.586572] rk808 0-0020: chip id: 0x8090 [ 0.586622] rk808 0-0020: No cache defaults, reading back from HW [ 0.610334] rk808 0-0020: source: on=0x40, off=0x00 [ 0.610361] rk808 0-0020: support dcdc3 fb mode:-22, 63 [ 0.610373] rk808 0-0020: support pmic reset mode:0,0 DDR Version V1.11 20211103 ln ddrconfig:0 ```
JeffyCN commented 1 year ago

so you are using evb's kernel and dts on a custom board?

normally the kernel(including code/defconfig/dts) should match the physic board... please check the readme of meta-rockchip to use a custom kernel

argrento commented 1 year ago

so you are using evb's kernel and dts on a custom board?

I hoped that will work to have a good starting point. Bootloop is pretty ok for me.

use a custom kernel

I contacted the board manufacturer and asked if they can provide sources. No answer yet.

argrento commented 1 year ago

Luckily I was able to find all sources and device trees. Luckfox provides them: https://wiki.luckfox.com/Core3566/Core3566-SDK/ The download link: https://drive.google.com/drive/folders/1HCNYaVqQMv0vGc4630fmHkq2Eldi9Y2z?usp=sharing

Now I need somehow to figure out what to take from Luckfox and where to put it.

argrento commented 1 year ago

I managed to solve this. I took dts files from the Luckfox and created bbappend for linux kernel. Now Core3566 boots normally.

But wifi does not work. On board there is an AP6256. So in my layer I created rkwifibt-firmware.bbappend:

PACKAGES =+ " \
    ${PN}-ap6256-wifi \
    ${PN}-ap6256-bt \
"

FILES:${PN}-ap6256-wifi = " \
    lib/firmware/fw_bcm43456c5_ag.bin \
    lib/firmware/fw_bcm43456c5_ag_mfg.bin \
    lib/firmware/nvram_ap6256.txt \
"

FILES:${PN}-ap6256-bt = " \
    lib/firmware/BCM43430B0.hcd \
"

And this is my machine config:

#@TYPE: Machine
#@NAME: Core3566

require conf/machine/include/rk356x.inc

KERNEL_DEVICETREE = "rockchip/core3566-hdmi-lp4x-v1-linux.dtb"

UBOOT_MACHINE = "rk3568_defconfig"

RK_WIFIBT_FIRMWARES = " \
    rkwifibt-firmware-ap6256-wifi11 \
    rkwifibt-firmware-ap6256-bt11 \
    brcm-tools \
"

MACHINE_EXTRA_RRECOMMENDS:append = " \
    drm-cursor \
"

MACHINE_FEATURES:append = " \
    wifi \
    bluetooth \
"

Some logs:

root@core3566-luckfox:~# dmesg | grep wlan
[    0.411760] usbcore: registered new interface driver rndis_wlan
[    0.535883] [WLAN_RFKILL]: Enter rfkill_wlan_init
[    0.536414] [WLAN_RFKILL]: Enter rfkill_wlan_probe
[    0.536470] [WLAN_RFKILL]: wlan_platdata_parse_dt: wifi_chip_type = ap6256
[    0.536486] [WLAN_RFKILL]: wlan_platdata_parse_dt: enable wifi power control.
[    0.536499] [WLAN_RFKILL]: wlan_platdata_parse_dt: wifi power controled by gpio.
[    0.536540] [WLAN_RFKILL]: wlan_platdata_parse_dt: WIFI,host_wake_irq = 74, flags = 0.
[    0.536559] [WLAN_RFKILL]: wlan_platdata_parse_dt: The ref_wifi_clk not found !
[    0.536571] [WLAN_RFKILL]: rfkill_wlan_probe: init gpio
[    0.536623] [WLAN_RFKILL]: Exit rfkill_wlan_probe
root@core3566-luckfox:~# dmesg | grep bt  
[    0.431414] usbcore: registered new interface driver usbtouchscreen
[    0.477892] usbcore: registered new interface driver btusb
[    0.536585] [WLAN_RFKILL]: rfkill_set_wifi_bt_power: 1
[    0.537394] [BT_RFKILL]: Request irq for bt wakeup host
[    0.537616] [BT_RFKILL]: bt_default device registered.
root@core3566-luckfox:~# rfkill list all
0: bt_default: Bluetooth
        Soft blocked: yes
        Hard blocked: no

Not sure what's wrong there/

JeffyCN commented 1 year ago

the firmware is at here: https://github.com/JeffyCN/mirrors/tree/rkwifibt/firmware/broadcom/AP6256

and on rockchip bsp kernel, the wifibt driver should be built into module(.ko) from: https://github.com/JeffyCN/mirrors/tree/rkwifibt/drivers

normally the wifi should be enabled after insmod, but bt needs extra tools to download firmwares