最近在搞全志H3从emmc启动,调了两天还是没搞懂,想请各位大佬给的建议。
我是用的buildroot-2022.05.1 + uboot-2022.01 + linux-5.19.3。
我现在修改了kernel里的dts,把mmc2打开了,用sd卡启动,能看到有/dev/mmcblk2,并且能够正常进行读写操作。
# dd if=./sdcard.img of=/dev/mmcblk2 bs=4M
77+1 records in
77+1 records out
uboot config里加上了CONFIG_MMC_SUNXI_SLOT_EXTRA=2,使用dd命令把镜像写到emmc,拔掉sd卡启动,能看到uboot
是我重新编译的,但是找不到emmc。
uboot配置:
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-duo2"
CONFIG_SPL=y
CONFIG_MACH_SUN8I_H3=y
CONFIG_DRAM_CLK=408
CONFIG_BOOTDELAY=5
CONFIG_MMC_SUNXI_SLOT_EXTRA=2
在uboot里使用mmc list命令,发现两个mmc设备的寄存器分别是mmc0和mmc1,实际上emmc在mmc2上,寄存器是0x01c11000。
拔掉sd卡启动log如下:
U-Boot SPL 2022.01 (Jan 19 2024 - 14:18:40 +0800)
DRAM: 512 MiB
Trying to boot from MMC2
U-Boot 2022.01 (Jan 19 2024 - 14:18:40 +0800) Allwinner Technology
CPU: Allwinner H3 (SUN8I 1680)
Model: FriendlyARM NanoPi Duo2
DRAM: 512 MiB
WDT: Not starting watchdog@1c20ca0
MMC: mmc@1c0f000: 0, mmc@1c10000: 2
Loading Environment from FAT... In: serial@1c28000
Out: serial@1c28000
Err: serial@1c28000
Net: No ethernet found.
Hit any key to stop autoboot: 0
=> mmc list
mmc@1c0f000: 0
mmc@1c10000: 2
=> mmc info
MMC: no card present
=> mmc dev 2
Card did not respond to voltage select! : -110
离线