九鼎创展论坛

标题: x3399 uboot出现“mmc: ERROR”错误无法正常启动 [打印本页]

作者: sks    时间: 2018-10-11 14:20
标题: x3399 uboot出现“mmc: ERROR”错误无法正常启动
x3399板子,修改了u-boot/include/configs/rk33plat.h,在配置文件的最后增加以下几行:/* modified for Lava Music */
#if defined(CONFIG_RKCHIP_RK3399)
#define CONFIG_PREBOOT  
#undef CONFIG_DISPLAY_CPUINFO
#undef CONFIG_POWER_FG_CW201X
#endif
如图所示



源码目录下执行命令./mk.sh -u编译uboot,更新uboot分区启动后出现了mmc:ERROR错误,无法正常启动,启动信息如下:
U-Boot 2014.10-RK3399-10 (Oct 11 2018 - 10:42:07)

Board:  Rockchip platform Board
Uboot as second level loader
DRAM:  Found dram banks: 1
Adding bank:0000000000200000(000000007fe00000)
128 MiB
SdmmcInit = 0 20
mmc: ERROR: SDHCI:Transfer data timeout
mmc: ERROR: SDHCI ERR:cmd:0x153a,stat:0x0
mmc: ERROR: Tuning procedure failed, falling back to fixed sampling clock
mmc: ERROR: tuning execution failed
SdhciInit3 Error!
storage init fail!
Using default environment

read_env failed at 0
GetParam
read parameter fail
No pmic detect.
SecureBootEn = 0, SecureBootLock = 0
empty serial no.
Writing env to storage...
write_env failed at 0
failed
normal boot.
checkKey
vbus = 1
no fuel gauge found
no fuel gauge found
read logo on state from dts [0]
no fuel gauge found
misc partition not found!
Hit any key to stop autoboot:  0
'boot' does not seem to be a partition nor an address
Unable to boot:boot
try to start recovery
'recovery' does not seem to be a partition nor an address
Unable to boot:recovery
try to start backup
'backup' does not seem to be a partition nor an address
Unable to boot:backup
try to start rockusb

修改的宏定义似乎跟emmc没有关系,不知道什么原因在这里出错。
长按VOL-再按reset键复位尝试进入loader模式更新uboot,此时uboot打印信息如下:
U-Boot 2014.10-RK3399-10 (Oct 11 2018 - 10:42:07)

Board:  Rockchip platform Board
Uboot as second level loader
DRAM:  Found dram banks: 1
Adding bank:0000000000200000(000000007fe00000)
128 MiB
SdmmcInit = 0 20
mmc: ERROR: SDHCI:Transfer data timeout
mmc: ERROR: SDHCI ERR:cmd:0x153a,stat:0x0
mmc: ERROR: Tuning procedure failed, falling back to fixed sampling clock
mmc: ERROR: tuning execution failed
SdhciInit3 Error!
storage init fail!
Using default environment

read_env failed at 0
GetParam
read parameter fail
No pmic detect.
SecureBootEn = 0, SecureBootLock = 0
empty serial no.
Writing env to storage...
write_env failed at 0
failed
normal boot.
checkKey
vbus = 1
rockusb key pressed.

然后主机ubuntu终端通过upgrade_tool工具尝试更新系统固件
sks@sks-:~/Debug/tools/Linux_Upgrade_Tool_v1.24$ sudo ./upgrade_tool
List of rockusb connected
DevNo=1        Vid=0x2207,Pid=0x330c,LocationID=101        Loader
Found 1 rockusb,Select input DevNo,Rescan press <R>,Quit press <Q>:1

---------------------Tool Usage ---------------------
Help:             H
Quit:             Q
Version:          V
Clear Screen:     CS
------------------Upgrade Command ------------------
ChooseDevice:                CD
SwitchDevice:                SD
UpgradeFirmware:        UF <Firmware>
UpgradeLoader:                UL <Loader>
DownloadImage:                DI <-p|-b|-k|-s|-r|-m image> [parameter file]
DownloadBoot:                DB <Loader>
EraseFlash:                EF <Loader|firmware>
LowerFormat:                LF
----------------Professional Command -----------------
TestDevice:                TD
ResetDevice:                RD [subcode]
ResetPipe:                RP [pipe]
ReadFlashID:                RID
ReadFlashInfo:                RFI
ReadChipInfo:                RCI
ReadSector:                RS  <BeginSec> <SectorLen> [-decode] [File]
WriteSector:                WS  <BeginSec> <File>
ReadLBA:                RL  <BeginSec> <SectorLen> [File]
WriteLBA:                WL  <BeginSec> <File>
EraseBlock:                EB <CS> <BeginBlock> <BlokcLen> [--Force]
-------------------------------------------------------

Rockusb>uf update-android.img
Loading firmware...
Support Type:RK330C        FW Ver:6.0.01        FW Time:2018-10-09 11:05:01
Loader ver:1.05        Loader Time:2018-10-09 10:38:26
Test Device Total(1),Current(1)

一直停留在Test Device Total(1),Current(1)这里没有任何更新信息,似乎无法通过upgrade_tool来更新固件,lf低格命令也没有响应。
这个改过的uboot在两块板子更新都出现问题,似乎不是板子问题了,九鼎的大神,如何解决这个变砖问题?谢谢!

作者: sks    时间: 2018-10-11 15:06
通过maskrom模式更新了uboot,但是出现问题的原因待查
作者: sks    时间: 2018-10-11 15:25
可以调试了,查了一下,跟RK的平台架构文件有关,原因在于取消CONFIG_DISPLAY_CPUINFO的定义这里,u-boot/arch/arm/cpu/armv8/rk33xx/cpu.c使用了该宏,本意是不打印CPU信息,但是却意外的把其它的gd成员变量赋值与rkclk_get_pll()调用都注释掉了,emmc数据传输错误跟这时钟设置有关。
#ifdef CONFIG_DISPLAY_CPUINFO
int print_cpuinfo(void)
{
        if (gd->arch.chiptype == RKCHIP_UNKNOWN)
                rk_get_chiptype();

#if defined(CONFIG_RKCHIP_RK3368)
        if (gd->arch.chiptype == CONFIG_RK3368)
        #if defined(CONFIG_RKCHIP_PX5)
                printf("CPU: px5\n");
        #else
                printf("CPU: rk3368\n");
        #endif
#endif

#if defined(CONFIG_RKCHIP_RK3366)
        if (gd->arch.chiptype == CONFIG_RK3366)
                printf("CPU: rk3366\n");
#endif

#if defined(CONFIG_RKCHIP_RK3399)
        if (gd->arch.chiptype == CONFIG_RK3399)
                printf("CPU: rk3399\n");
#endif

        rkclk_get_pll();
        rkclk_dump_pll();

        return 0;
}
#endif
作者: sks    时间: 2018-10-11 16:10
补充说明一下,gd成员变量赋值这里眼快没细看说错了,但是这个rkclk_get_pll()关键的CPU、外设时钟设置调用实在不应该在CONFIG_DISPLAY_CPUINFO的作用范围内。




欢迎光临 九鼎创展论坛 (http://bbs.9tripod.com/) Powered by Discuz! X3.2