[RK3399][Android8.1] 调试记录 --- DDR问题分析

Platform: RK3399
OS: Android 8.1
DDR型号:K4F6E3S4HM-MGCJ

现象:

1.程序下载会卡住,偶尔可以下载成功

2.开机后UBOOT阶段可以正常运行,进入kernel阶段会产生EL3报错,具体log放在下方

3.开机后随机产生kernel panic,位置不固定,log放在下方

 

EL3报错部分log

Unhandled Exception in EL3.
x30 =                0x0000000000045004
x0 =                0x0f1e2d3c4b5a6978
x1 =                0x00000000ff3b1fd0
x2 =                0x0000000000000018
x3 =                0x0000000000000018
x4 =                0x0000000000000018
x5 =                0x0000000000000000
x6 =                0x0000000000000000
x7 =                0x0000000000000000
x8 =                0x0000000003011908
x9 =                0x0000000000010080
x10 =                0x0000000000020f88
x11 =                0x0000000000000400
x12 =                0x000000000000000a
x13 =                0x000000000000000f
x14 =                0x0000000000000002
x15 =                0x0000000000000004
x16 =                0x0000000008000000
x17 =                0x0000000000000000
x18 =                0x0000000000800000
x19 =                0x0f1e2d3c4b5a6978
x20 =                0x000000000004b0c0
x21 =                0x0f1e2d3c4b5a6978
x22 =                0x00000000000419e9
x23 =                0x0000000000041000
x24 =                0x000000000004b0d0
x25 =                0x0000000000000001
x26 =                0x00000000ff8c2000
x27 =                0x0000000000000110
x28 =                0x0000000000000110
x29 =                0x00000000000468c0

Kernel panic部分log

[   58.541477] Unable to handle kernel paging request at virtual address fffff7c000210830
[   58.549571] pgd = ffffffc09687c000
[   58.553019] [fffff7c000210830] *pgd=0000000000000000, *pud=0000000000000000
[   58.560101] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   58.565678] Modules linked in:
[   58.568752] CPU: 5 PID: 1571 Comm: dex2oat Not tainted 4.4.167 #408
[   58.575018] Hardware name: rockchip,android (DT)
[   58.579630] task: ffffffc096831b00 task.stack: ffffffc096988000
[   58.585554] PC is at iput+0xb0/0x1f0
[   58.589128] LR is at iput+0x40/0x1f0
[   58.592707] pc : [] lr : [] pstate: 60400145
[   58.600103] sp : ffffffc09698bcc0
[   58.603415] x29: ffffffc09698bcc0 x28: ffffffc096831b00 
[   58.608756] x27: ffffff8008ba4000 x26: 0000000000000000 
[   58.614100] x25: 0000000000000001 x24: 0000000000080040 
[   58.619434] x23: 0000000000080060 x22: ffffff8009345458 
[   58.624773] x21: fffff7c000210800 x20: ffffffc098b70838 
[   58.630116] x19: ffffffc098b707b0 x18: 0000000000000000 
[   58.635450] x17: 0000000000000000 x16: ffffff80080a37d4 
[   58.640789] x15: 0000000000000000 x14: 00000000ba09eda1 
[   58.646128] x13: 00000000ffee8d48 x12: 0000000000000001 
[   58.651462] x11: 00000000ffe01000 x10: 0000000000000000 
[   58.656797] x9 : ffffff8009338880 x8 : ffffff8009338880 
[   58.662134] x7 : 0000000000000000 x6 : 0000000000000000 
[   58.667472] x5 : 0000000000000000 x4 : 0000000000000000 
[   58.672812] x3 : 0000000000000000 x2 : 0000000000000000 
[   58.678167] x1 : 0000000000000000 x0 : 0000000000000000 

调试过程

1.kernel中修改DTS降低EMMC速率至50M,仍然会kernel panic

修改方法:

root@ubuntu:~/rd_rk3399_LPDDR4_8.1_SDK/kernel/arch/arm64/boot/dts/rockchip# vi rk3399-vop-clk-set.dtsi 

&sdhci {
                assigned-clocks = <&cru SCLK_EMMC>;
                assigned-clock-parents = <&cru PLL_GPLL>;
                assigned-clock-rates = <200000000>;//将此处200修改为50
};

2.降低DDR频率为400M,但是无法进入系统,无法查看是否降低成功。

3.增加LPDDR4供电电压,由1.1V修改为1.17V,现象不变

4.关闭CPU及GPU变频,抬高CPU及GPU电压,现象不变

5.测量DDR核心供电的电源纹波,在20mv左右,测量CPU及GPU电源,纹波都在30mv以下,板子上的其他电源纹波也在40mv内,所以确定供电纹波不存在问题

6.因为存在EL3报错,所以怀疑DDR存在兼容性问题,修改DDR启动文件,将 rk3399_ddr_800MHz_v1.19.bin修改为

rk3399_ddr_800MHz_v1.24.bin,系统成功启动,可以进入安卓,不过依然存在一跑软件就发生kernel panic

root@ubuntu:~/rd_rk3399_LPDDR4_8.1_SDK/u-boot/tools/rk_tools/RKBOOT# vi RK3399MINIALL.ini 
​

[CHIP_NAME]
NAME=RK330C
[VERSION]
MAJOR=1
MINOR=24
[CODE471_OPTION]
NUM=1
Path1=tools/rk_tools/bin/rk33/rk3399_ddr_800MHz_v1.24.bin
Sleep=1
[CODE472_OPTION]
NUM=1
Path1=tools/rk_tools/bin/rk33/rk3399_usbplug_v1.24.bin
[LOADER_OPTION]
NUM=2
LOADER1=FlashData
LOADER2=FlashBoot
FlashData=tools/rk_tools/bin/rk33/rk3399_ddr_800MHz_v1.24.bin
FlashBoot=tools/rk_tools/bin/rk33/rk3399_miniloader_v1.24.bin
[OUTPUT]
PATH=rk3399_loader_v1.24.124.bin
~                                               

7.基本可以定位DDR的问题,修改DDR启动文件后,通过参考瑞芯微DDR开发文档,关闭DDR变频功能,尝试降低DDR频率到400M,依然会产生kernel panic

8.确定DDR硬件设计存在问题,尝试调整DDR的ODT(On-Die Termination),也就是调整阻抗,实现阻抗匹配,但是瑞芯微没有提供RK3399的deskew自动扫描工具,无法计算出具体的值

[RK3399][Android8.1] 调试记录 --- DDR问题分析_第1张图片

9.因为我们使用的是LPDDR4,所以修改如下如下内容,尝试了修改dq_odt值,现象有所改善,但是依然不够稳定。但是可以确定是DDR的阻抗匹配出现了问题


root@ubuntu:~/rd_rk3399_LPDDR4_8.1_SDK/kernel/arch/arm64/boot/dts/rockchip# vi rk3399-dram-default-timing.dtsi 

               lpddr4_odt_dis_freq = <800>;
                lpddr4_drv = ;//240
                lpddr4_dq_odt = ;//40
                lpddr4_ca_odt = ;//DIS
                phy_lpddr4_ca_drv = ;//40
                phy_lpddr4_ck_cs_drv = ;//40 ok
                phy_lpddr4_dq_drv = ;//60
                phy_lpddr4_odt = ;//40 ok

10。查看RK3399核心板的PCB,发现底层dq差分线的参考平面不完整,有跨平面的现象,如下图,高亮部分为第五层的GND,红色走线为BOTTOM层DDR走线,部分走线有跨3个平面的现象,所以确认是PCB设计问题。

[RK3399][Android8.1] 调试记录 --- DDR问题分析_第2张图片

11.优化PCB使第五层GND的完整,DDR的参考平面能够是一个完整的地平面。

 

总结

1.DDR的问题确实比较棘手,这次调试过程中压力也比较大,脑子里每天都在想是哪里出现了问题,导致自己的生活状态完全失调,希望以后自己能够调整好状态,能够更好的应对压力

2.由于公司仪器有限,无法直接测量DDR的眼图,给问题排查带来了很大的阻碍,有实力的公司可以直接查看眼图定位问题

3.目前PCB改版已经完成,调试结果还要等待板子焊接完成才能实验,后续会更新结果 。

 

 

你可能感兴趣的:(硬件,lpddr,android,电脑硬件,linux,c语言)