friendlyarm / uboot-rockchip

27 stars 38 forks source link

nanopc t4 can't find nvme ssd in uboot, and can't execute 'pci e' #9

Open yongwn opened 1 year ago

yongwn commented 1 year ago

I build uboot myself, and write the uboot to tf card. The uboot can run , but it can't find my nvme ssd . I execute cmd "pci e", it report failed. "rockchip_pcie pcie@f8000000: failed to get pcie-phy (ret=-19)"

resetting ...
DDR Version 1.24 20191016
In
soft reset
SRX
Channel 0: LPDDR3, 800MHz
CS = 0
MR0=0x58
MR1=0x58
MR2=0x58
MR3=0x58
MR4=0x2
MR5=0x1
MR6=0x6
MR7=0x0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11=0x1F
MR12=0x1F
MR13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1F
CS = 1
MR0=0x58
MR1=0x58
MR2=0x58
MR3=0x58
MR4=0x2
MR5=0x1
MR6=0x6
MR7=0x0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11=0x1F
MR12=0x1F
MR13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1F
Bus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=2048MB
Channel 1: LPDDR3, 800MHz
CS = 0
MR0=0x58
MR1=0x58
MR2=0x58
MR3=0x58
MR4=0x2
MR5=0x1
MR6=0x6
MR7=0x0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11=0x1F
MR12=0x1F
MR13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1F
CS = 1
MR0=0x58
MR1=0x58
MR2=0x58
MR3=0x58
MR4=0x2
MR5=0x1
MR6=0x6
MR7=0x0
MR8=0x1F
MR9=0x1F
MR10=0x1F
MR11=0x1F
MR12=0x1F
MR13=0x1F
MR14=0x1F
MR15=0x1F
MR16=0x1F
Bus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=2048MB
256B stride
ch 0 ddrconfig = 0x101, ddrsize = 0x2020
ch 1 ddrconfig = 0x101, ddrsize = 0x2020
pmugrf_os_reg[2] = 0x3AA0DAA0, stride = 0xD
OUT
Boot1 Release Time: May 29 2020 17:36:36, version: 1.26
CPUId = 0x0
ChipType = 0x10, 432
SdmmcInit=2 0
BootCapSize=100000
UserCapSize=14910MB
FwPartOffset=2000 , 100000
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=242MB
FwPartOffset=2000 , 0
StorageInit ok = 177687
SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
SecureInit read PBA: 0x1404
SecureInit read PBA: 0x1804
SecureInit read PBA: 0x1c04
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT 0x3335db8 signature is wrong
recovery gpt...
GPT 0x3335db8 signature is wrong
recovery gpt fail!
Trust Addr:0x4000, 0x58334c42
No find bl30.bin
Load uboot, ReadLba = 2000
Load OK, addr=0x200000, size=0xc8ebc
RunBL31 0x40000 @ 330971 us
NOTICE:  BL31: v1.3(release):845ee93
NOTICE:  BL31: Built : 15:51:11, Jul 22 2020
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1196): pd status 3e
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
INF [0x0] TEE-CORE:init_primary_helper:337: Initializing (1.1.0-278-gef70f120a #zhangzj #9 Fri Sep 17 09:39:24 UTC 2021 aarch64)

INF [0x0] TEE-CORE:init_primary_helper:338: Release version: 1.2

INF [0x0] TEE-CORE:init_teecore:83: teecore inits done
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9

U-Boot 2021.07-g886a84ea1a (Nov 16 2022 - 00:08:57 +0800)

SoC: Rockchip rk3399
Reset cause: RST
Model: FriendlyElec NanoPC-T4
DRAM:  3.9 GiB
PMIC:  RK808
MMC:   mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: FriendlyElec NanoPC-T4
Net:   eth0: ethernet@fe300000
Hit any key to stop autoboot:  0
=> <INTERRUPT>
=> pci e
rockchip_pcie pcie@f8000000: failed to get pcie-phy (ret=-19)
=> nvme scan
=> nvme info
=>

I use other rk3399 config , running cmd "pci e" is ok, and uboot can find my nvme ssd;

I compare dts/dtsi , found in file "uboot-rockchip/arch/arm/dts/rk3399-nanopi4.dtsi" , node "&pcie_phy" is different from others.

I try to modify

&pcie_phy {
    assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
    assigned-clock-rates = <100000000>;
    assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
    status = "okay";
};

to

&pcie_phy {
    status = "okay";
};

compile it ,and write it to tf card, it works , the cmd resule is

=> pci e
=> nvme scan
=> nvme info
Device 0: Vendor: 0x1e49 Rev: ZTA22001 Prod: ZTA41T0BA2242502CJ
Type: Hard Disk
Capacity: 976762.3 MB = 953.8 GB (2000409264 x 512)
=>

so ? why?

yongwn commented 1 year ago

I think this is the same problem https://patchwork.kernel.org/project/linux-rockchip/patch/20200330181613.29462-2-jagan@amarulasolutions.com/#23261083