From 1acae9643de02c4e9a741a1c3ba48b2bb064b471 Mon Sep 17 00:00:00 2001 From: Chanho Park Date: Thu, 20 Aug 2015 14:53:38 +0900 Subject: [PATCH] artik: config: support android partition and booting This patch supports android partition tables and booting to android. The system partition is 1GB and cache partiton is 128MB and userdata partition is remained size. 1. Generate uInitrd from ramdisk.img mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d ramdisk.img uInitrd 2. Create a android partition from the u-boot shell run android_format 3. flash android images fastboot flash ramdisk uInitrd fastboot flash system system.img fastboot flash cache cache.img fastboot flash userdata userdata.img 4. Build android kernel and flash the kernel ARCH=arm ./scripts/kconfig/merge_config.sh \ arch/arm/configs/artik10_defconfig android/configs/android-base.cfg \ android/configs/android-recommended.cfg \ android/configs/artik10-android-graphic.cfg make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- exynos5422-artik10.dtb fastboot flash kernel arch/arm/boot/zImage fastboot flash dtb arch/arm/boot/dts/exynos5422-artik10.dtb 5. Set up androidboot.hardware from the u-boot shell setenv opts loglevel=4 androidboot.hardware=odroidxu3 saveenv run android_boot Change-Id: Ic55fa4925b5ae9586bc2c9733e2f1f36df5d04d1 Signed-off-by: Chanho Park --- include/configs/artik_common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/configs/artik_common.h b/include/configs/artik_common.h index dbc42f6af..4d8271463 100644 --- a/include/configs/artik_common.h +++ b/include/configs/artik_common.h @@ -241,6 +241,14 @@ "MiB,uuid=${uuid_gpt_boot};" \ "name=rootfs,size=-,uuid=${uuid_gpt_rootfs}\0" +#define PARTS_ANDROID \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=boot,start=1MiB,size=" __stringify(CONFIG_BOOT_PART_SIZE) \ + "MiB,uuid=${uuid_gpt_boot};" \ + "name=system,size=1024MiB,uuid=${uuid_gpt_system};" \ + "name=cache,size=128MiB,uuid=${uuid_gpt_cache};" \ + "name=userdata,size=-,uuid=${uuid_gpt_userdata}\0" + #define CONFIG_EXTRA_ENV_SETTINGS \ "console=" CONFIG_DEFAULT_CONSOLE \ "consoleon=set console=" CONFIG_DEFAULT_CONSOLE \ @@ -248,6 +256,7 @@ "consoleoff=set console=ram; saveenv; reset\0" \ "rootfslen=" __stringify(CONFIG_ROOTFS_LEN) "\0" \ "partitions=" PARTS_DEFAULT \ + "partitions_android=" PARTS_ANDROID \ "rootdev=" __stringify(CONFIG_ROOT_DEV) "\0" \ "rootpart=" __stringify(CONFIG_ROOT_PART) "\0" \ "bootpart=" __stringify(CONFIG_BOOT_PART) "\0" \ @@ -267,6 +276,13 @@ "fatload mmc 0:1 $fdtaddr $fdtfile;" \ "fatload mmc 0:1 $initrd_addr $initrd_file;" \ "bootz $kernel_addr $initrd_addr $fdtaddr\0" \ + "android_boot=" \ + "setenv bootargs ${console} root=/dev/ram0 " \ + "${opts};" \ + "run boot_cmd_initrd\0" \ + "android_format=gpt write mmc 0 $partitions_android;" \ + "setenv bootcmd run android_boot;" \ + "saveenv; mmc rescan; fastboot\0" \ "ramfsboot=run sdrecovery;" \ "setenv bootargs ${console} root=/dev/ram0 " \ "rootfstype=ext2 ${opts} recovery;" \ -- 2.34.1