$mkdir ~/sunxi
$cd ~/sunxi
$git clone https://github.com/linux-sunxi/u-boot-sunxi.git
$cd u-boot-sunxi
默认从卡 0 启动改为为卡 2 启动:
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index a0c41ac..49a19c5 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -104,7 +104,7 @@
#define CONFIG_CMD_MMC
#define CONFIG_MMC_SUNXI
#ifndef CONFIG_MMC_SUNXI_SLOT
-#define CONFIG_MMC_SUNXI_SLOT 0
+#define CONFIG_MMC_SUNXI_SLOT 2
#endif
#define CONFIG_MMC_SUNXI_USE_DMA
#define CONFIG_ENV_IS_IN_MMC
编译出来的u-boot-sunxi-with-spl.bin 能够启动双卡版bootcard
$sudo dd if=/dev/zero of=$card bs=1M count=5 //去目标卡的分区表
$sudo dd if=u-boot-sunxi-with-spl.bin of=$card bs=1024 seek=8 //写入uboot到卡头部
$sudo sync
这时候卡应该可以进入u-boot
Log 如下:
U-Boot SPL 2014.01-rc1-09165-gb4590df-dirty (May 09 2014 - 15:40:36)
Board: Cubieboard2
dram: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600
U-Boot 2014.01-rc1-09165-gb4590df-dirty (May 09 2014 - 15:40:36) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
Board: Cubieboard2
I2C: ready
DRAM: 1 GiB
WARNING: Caches not enabled
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
Net: mii0
Warning: failed to set MAC address
Hit any key to stop autoboot: 0
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
** Invalid partition 1 **
sun7i#
|