[U-Boot] [PATCH v5 4/6] rockchip: kylin: Enable boot with android boot image

Jeffy Chen jeffy.chen at rock-chips.com
Thu Jan 14 03:19:39 CET 2016


The android kernel is using appended dtb by default, and store
ramdisk right after kernel & dtb.

The u-boot could not touch appended dtb, so we needs to pass
params to kernel through atags. And also enable kernel's
CONFIG_ARM_ATAG_DTB_COMPAT, which would allowed kernel to merge
atags into fdt before decompress itself.

And we needs to relocate ramdisk, in case of been overwritten by
the new fdt.

We also split up bootm cmd to get BOOTM_STATE_RAMDISK, which is
not enabled in the default flow.

Signed-off-by: Jeffy Chen <jeffy.chen at rock-chips.com>

---

Changes in v5:
Remove dup CONFIG_SYS_BOOT_RAMDISK_HIGH.
Change commit message.

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/kylin_rk3036.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/configs/kylin_rk3036.h b/include/configs/kylin_rk3036.h
index b750b26..48317f9 100644
--- a/include/configs/kylin_rk3036.h
+++ b/include/configs/kylin_rk3036.h
@@ -35,6 +35,28 @@
 #undef CONFIG_EXTRA_ENV_SETTINGS
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"partitions=" PARTS_DEFAULT \
+	"mmcdev=0\0" \
+	"mmcpart=5\0" \
+	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+
+#define CONFIG_ANDROID_BOOT_IMAGE
+#define CONFIG_SYS_HUSH_PARSER
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"part start mmc ${mmcdev} ${mmcpart} boot_start;" \
+		"part size mmc ${mmcdev} ${mmcpart} boot_size;" \
+		"mmc read ${loadaddr} ${boot_start} ${boot_size};" \
+		"bootm start ${loadaddr}; bootm ramdisk;" \
+		"bootm prep; bootm go;" \
+	"fi;" \
+
+/* Enable atags */
+#define CONFIG_SYS_BOOTPARAMS_LEN	(64*1024)
+#define CONFIG_INITRD_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
 
 #endif
 
-- 
2.1.4




More information about the U-Boot mailing list