warpme / minimyth2

Distro to make disk-less MythTV appliance
https://github.com/warpme/minimyth2/wiki
69 stars 20 forks source link

X96 tv box is not booting #40

Closed sickosarm closed 1 year ago

sickosarm commented 1 year ago

Thanks for your good work.

Last version for this device must have an incorrect u-boot because sd card is not booting but android from emmc does.

warpme commented 1 year ago

Hmm...

I assume you are reporting issue about x96-x6 tv box.

Saying

Last version for this device must have an incorrect u-boot

Do you mean: -version of tv box or -version of mm2 SD image?

If you mean tv box: -is there any older ver. of mm2 working ok for you on this exact x96-x6 box -if not - may you pls provide exact pictures of pcb?

btw: I flashed on my x96-x6 tvbox and all works as expected. u-boot on my box gives on uart log like this:

DDR Version V1.09 20210630
ln
ddrconfig:7
LPDDR4X, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=16 CS1 Row=16 CS=2 Die BW=16 Size=4096MB
tdqss: cs0 dqs0: -72ps, dqs1: -144ps, dqs2: -96ps, dqs3: -217ps, 
tdqss: cs1 dqs0: -72ps, dqs1: -144ps, dqs2: -96ps, dqs3: -217ps, 

change to: 324MHz
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x65

change to: 528MHz
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 780MHz
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 1056MHz(final freq)
PHY drv:clk:36,ca:36,DQ:29,odt:60
vrefinner:16%, vrefout:22%
dram drv:40,odt:80
vref_ca:00000071
clk skew:0x46
cs 0:
the read training result:
DQS0:0x3e, DQS1:0x3c, DQS2:0x45, DQS3:0x3b, 
min  : 0xf 0x10 0x11  0xf  0x1  0x2  0x6  0x2 , 0x9  0x8  0x3  0x1  0x9  0x7  0x9  0x5 ,
      0x14 0x13  0xf  0xd  0x5  0x2  0x4  0x5 , 0xa  0x7  0x6  0x1  0xa  0x8  0x7  0x8 ,
mid  :0x2d 0x2e 0x2f 0x2c 0x20 0x20 0x24 0x20 ,0x27 0x27 0x20 0x20 0x27 0x26 0x26 0x23 ,
      0x33 0x33 0x2e 0x2c 0x25 0x22 0x24 0x24 ,0x2a 0x27 0x25 0x21 0x2a 0x28 0x26 0x28 ,
max  :0x4c 0x4d 0x4d 0x49 0x40 0x3f 0x43 0x3f ,0x45 0x46 0x3e 0x3f 0x46 0x45 0x44 0x42 ,
      0x52 0x53 0x4d 0x4c 0x46 0x42 0x44 0x44 ,0x4a 0x48 0x45 0x41 0x4a 0x49 0x46 0x48 ,
range:0x3d 0x3d 0x3c 0x3a 0x3f 0x3d 0x3d 0x3d ,0x3c 0x3e 0x3b 0x3e 0x3d 0x3e 0x3b 0x3d ,
      0x3e 0x40 0x3e 0x3f 0x41 0x40 0x40 0x3f ,0x40 0x41 0x3f 0x40 0x40 0x41 0x3f 0x40 ,
the write training result:
DQS0:0x3d, DQS1:0x33, DQS2:0x3a, DQS3:0x29, 
min  :0x5d 0x62 0x62 0x62 0x54 0x54 0x58 0x57 0x57 ,0x51 0x50 0x4c 0x4c 0x53 0x51 0x52 0x53 0x4e ,
      0x5a 0x58 0x55 0x56 0x4e 0x4c 0x4c 0x50 0x50 ,0x4a 0x48 0x45 0x42 0x4b 0x49 0x48 0x4c 0x46 ,
mid  :0x79 0x7d 0x7d 0x7c 0x6f 0x70 0x73 0x72 0x72 ,0x6c 0x6c 0x66 0x67 0x6e 0x6a 0x6b 0x6b 0x68 ,
      0x76 0x75 0x70 0x71 0x69 0x63 0x67 0x6a 0x6b ,0x66 0x62 0x5e 0x5d 0x66 0x65 0x60 0x66 0x5e ,
max  :0x96 0x98 0x99 0x97 0x8b 0x8c 0x8f 0x8d 0x8d ,0x87 0x88 0x80 0x82 0x8a 0x83 0x85 0x84 0x83 ,
      0x92 0x92 0x8b 0x8d 0x84 0x7b 0x82 0x85 0x87 ,0x82 0x7d 0x78 0x78 0x82 0x82 0x79 0x81 0x77 ,
range:0x39 0x36 0x37 0x35 0x37 0x38 0x37 0x36 0x36 ,0x36 0x38 0x34 0x36 0x37 0x32 0x33 0x31 0x35 ,
      0x38 0x3a 0x36 0x37 0x36 0x2f 0x36 0x35 0x37 ,0x38 0x35 0x33 0x36 0x37 0x39 0x31 0x35 0x31 ,
cs 1:
the read training result:
DQS0:0x3f, DQS1:0x3e, DQS2:0x44, DQS3:0x3a, 
min  : 0xe  0xf 0x10  0xe  0x1  0x3  0x6  0x2 , 0xa  0x8  0x2  0x1  0x9  0x7  0xa  0x6 ,
      0x13 0x12  0xd  0xc  0x5  0x1  0x3  0x4 , 0xa  0x6  0x6  0x1  0x9  0x9  0x7  0x9 ,
mid  :0x2d 0x2e 0x2e 0x2b 0x20 0x22 0x25 0x21 ,0x28 0x27 0x20 0x20 0x28 0x26 0x28 0x25 ,
      0x31 0x31 0x2c 0x2b 0x25 0x20 0x22 0x23 ,0x29 0x25 0x25 0x1f 0x28 0x28 0x26 0x28 ,
max  :0x4c 0x4d 0x4d 0x49 0x40 0x41 0x45 0x40 ,0x47 0x47 0x3f 0x40 0x47 0x46 0x47 0x44 ,
      0x50 0x50 0x4c 0x4b 0x45 0x40 0x41 0x43 ,0x49 0x45 0x44 0x3e 0x48 0x48 0x45 0x47 ,
range:0x3e 0x3e 0x3d 0x3b 0x3f 0x3e 0x3f 0x3e ,0x3d 0x3f 0x3d 0x3f 0x3e 0x3f 0x3d 0x3e ,
      0x3d 0x3e 0x3f 0x3f 0x40 0x3f 0x3e 0x3f ,0x3f 0x3f 0x3e 0x3d 0x3f 0x3f 0x3e 0x3e ,
the write training result:
DQS0:0x3d, DQS1:0x33, DQS2:0x3a, DQS3:0x29, 
min  :0x5f 0x65 0x64 0x62 0x55 0x56 0x5b 0x58 0x58 ,0x54 0x54 0x4e 0x4e 0x56 0x54 0x54 0x54 0x50 ,
      0x5d 0x5d 0x59 0x58 0x50 0x50 0x4f 0x54 0x54 ,0x4c 0x4b 0x47 0x45 0x4d 0x4d 0x49 0x4e 0x48 ,
mid  :0x7b 0x7f 0x7f 0x7e 0x71 0x72 0x75 0x73 0x73 ,0x6e 0x6e 0x68 0x68 0x70 0x6d 0x6c 0x6c 0x69 ,
      0x77 0x78 0x73 0x73 0x6b 0x68 0x69 0x6d 0x6d ,0x68 0x66 0x61 0x5f 0x68 0x68 0x62 0x69 0x60 ,
max  :0x98 0x9a 0x9a 0x9a 0x8d 0x8e 0x90 0x8e 0x8e ,0x88 0x89 0x82 0x83 0x8b 0x87 0x85 0x85 0x83 ,
      0x92 0x93 0x8d 0x8e 0x86 0x81 0x83 0x87 0x87 ,0x84 0x82 0x7c 0x7a 0x83 0x83 0x7c 0x84 0x79 ,
range:0x39 0x35 0x36 0x38 0x38 0x38 0x35 0x36 0x36 ,0x34 0x35 0x34 0x35 0x35 0x33 0x31 0x31 0x33 ,
      0x35 0x36 0x34 0x36 0x36 0x31 0x34 0x33 0x33 ,0x38 0x37 0x35 0x35 0x36 0x36 0x33 0x36 0x31 ,
CA Training result:
cs:0 min  :0x51 0x47 0x49 0x3b 0x49 0x3b 0x48 ,0x4f 0x42 0x47 0x39 0x47 0x3a 0x49 ,
cs:0 mid  :0x8a 0x8c 0x81 0x80 0x82 0x7f 0x74 ,0x88 0x87 0x80 0x7e 0x80 0x7e 0x76 ,
cs:0 max  :0xc4 0xd2 0xba 0xc5 0xbb 0xc4 0xa1 ,0xc1 0xcc 0xb9 0xc4 0xb9 0xc2 0xa3 ,
cs:0 range:0x73 0x8b 0x71 0x8a 0x72 0x89 0x59 ,0x72 0x8a 0x72 0x8b 0x72 0x88 0x5a ,
cs:1 min  :0x4f 0x4a 0x48 0x41 0x46 0x42 0x4a ,0x4c 0x47 0x46 0x3e 0x46 0x3f 0x48 ,
cs:1 mid  :0x8c 0x8d 0x84 0x82 0x82 0x82 0x76 ,0x88 0x87 0x82 0x7e 0x81 0x7f 0x75 ,
cs:1 max  :0xc9 0xd0 0xc0 0xc4 0xbf 0xc2 0xa3 ,0xc4 0xc7 0xbe 0xbf 0xbd 0xbf 0xa2 ,
cs:1 range:0x7a 0x86 0x78 0x83 0x79 0x80 0x59 ,0x78 0x80 0x78 0x81 0x77 0x80 0x5a ,
out
U-Boot SPL board init
U-Boot SPL 2017.09-ga1f6fc00a0-210413 #ldq (Apr 13 2021 - 11:35:00)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
No misc partition
Not fit magic
Trying fit image at 0x5000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256+ OK
## Checking uboot 0x00a00000 ... sha256+ OK
## Checking fdt 0x00aed1a8 ... sha256+ OK
## Checking atf-2 0x00068000 ... sha256+ OK
## Checking atf-3 0xfdcd0000 ... sha256+ OK
## Checking atf-4 0xfdcc9000 ... sha256+ OK
## Checking atf-5 0x00066000 ... sha256+ OK
## Checking optee 0x08400000 ... sha256+ OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 375.421 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= 1056MHz
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 (Sep 14 2022 - 11:52:24 +0200)

Model: X96 X6 RK3566 TV Box
PreSerial: 2, raw, 0xfe660000
DRAM:  4 GiB
Sysmem: init
Relocation Offset: ef4c4000, fdt: edbf9eb0 
no mmc device at slot 1
dwmmc@fe2b0000: 1 (SD), dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Bootdev(atags): mmc 1
MMC1: Legacy, 50Mhz
PartType: EFI
No misc partition
boot mode: None
FIT: No boot partition
No resource partition
Failed to load DTB
Failed to get kernel dtb, ret=-19
io-domain: OK
*** Warning - bad CRC, using default environment

Model: X96 X6 RK3566 TV Box
rockchip_set_serialno: could not find efuse/otp device
CLK: (sync kernel. arm: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
  apll 816000 KHz
  dpll 528000 KHz
  gpll 1188000 KHz
  cpll 1000000 KHz
  npll 24000 KHz
  vpll 24000 KHz
  hpll 24000 KHz
  ppll 100000 KHz
  armclk 816000 KHz
  aclk_bus 150000 KHz
  pclk_bus 50000 KHz
  aclk_top_high 300000 KHz
  aclk_top_low 200000 KHz
  hclk_top 150000 KHz
  pclk_top 50000 KHz
  aclk_perimid 300000 KHz
  hclk_perimid 150000 KHz
  pclk_pmu 50000 KHz
Net:   clk_get_by_name(master_bus) failed: -22eqos_probe_resources() failed: -22No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0 
## Booting FIT Image FIT: No boot partition
FIT: No FIT image
Could not find misc partition
ANDROID: reboot reason: "(none)"
optee api revision: 2.0
TEEC: Waring: Could not find security partition
Not AVB images, AVB skip
android_image_load_by_partname: Can't find part: boot
Android image load failed
Android boot failed, error -1.
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:4...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
401 bytes read in 4 ms (97.7 KiB/s)
1:.MiniMyth2
Retrieving file: /Image
reading /Image
31187456 bytes read in 2582 ms (11.5 MiB/s)
append: root=/dev/mmcblk0p5 rw rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 logo.nologo vt.cur_default=1
Retrieving file: /dtbs/rockchip/rk3566-x96_x6.dtb
reading /dtbs/rockchip/rk3566-x96_x6.dtb
51251 bytes read in 12 ms (4.1 MiB/s)
Fdt Ramdisk skip relocation
## Flattened Device Tree blob at 0x0a100000
   Booting using the fdt blob at 0x0a100000
   Using Device Tree in place at 000000000a100000, end 000000000a10f832
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x1f0000000 - 0x200000000 (size: 0x10000000)
Total: 3484.969 ms

Starting kernel ...
sickosarm commented 1 year ago

I am sorry for my bad explanation. The box is an x96 x6 that works with previous releases. Your release 12.9.0 is not booting and just want you to know this. I have checked your log from u-boot and is strange that is loading x96_x6 dtb instead of the quartz64 dtb that is present in the extlinux.conf. Anyway, excellent work and thanks very much again for supporting an rk3566 TV box, you are the only one I know that makes such thing.

warpme commented 1 year ago

Here i'm a bit lost... Here is extlinux.conf you should have in your SD card: https://github.com/warpme/minimyth2/blob/99931f2fe0f4255b9303e92c02aeafc4ad41ad3d/script/bootloaders/board-rk3566.x96_x6/files/extlinux.conf#L3

u-boot for this box is build with x96_x6 defconfig: https://github.com/warpme/minimyth2/blob/99931f2fe0f4255b9303e92c02aeafc4ad41ad3d/script/bootloaders/board-rk3566.x96_x6/Makefile#L10

it looks like uboot is correctly build as log says:

U-Boot 2017.09 (Sep 14 2022 - 11:52:24 +0200)

Model: X96 X6 RK3566 TV Box

also it looks like kernel gets correct DT as log says:

Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
reading /extlinux/extlinux.conf
401 bytes read in 4 ms (97.7 KiB/s)
1:.MiniMyth2
Retrieving file: /Image
reading /Image
31187456 bytes read in 2582 ms (11.5 MiB/s)
append: root=/dev/mmcblk0p5 rw rootwait earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 logo.nologo vt.cur_default=1
Retrieving file: /dtbs/rockchip/rk3566-x96_x6.dtb
reading /dtbs/rockchip/rk3566-x96_x6.dtb
51251 bytes read in 12 ms (4.1 MiB/s)

for me all looks ok. And my x96_x6 boots OK

You are saying:

I have checked your log from u-boot and is strange that is loading x96_x6 dtb instead of the quartz64 dtb that is present in the extlinux.conf.

mm2 design is that for x96_x6 tv box we are using uboot rk3566-x96_x6_defconfig and /dtbs/rockchip/rk3566-x96_x6.dtb kernel DT.

If Yours tv box is not booting with v12.9.0 then may you pls:

  1. provide me uart log from failing boot
  2. provide me exact pictures of this box pcb ?

thx!

warpme commented 1 year ago

closing as: -i can't reproduce original issue -there seems no replay from issue reporter