artik: config: support android partition and booting
authorChanho Park <chanho61.park@samsung.com>
Thu, 20 Aug 2015 05:53:38 +0000 (14:53 +0900)
committerChanho Park <parkch98@gmail.com>
Fri, 21 Aug 2015 01:45:02 +0000 (10:45 +0900)
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 <chanho61.park@samsung.com>
include/configs/artik_common.h

index dbc42f6af244c07212962ee6fa4968191cbf9fc8..4d82714633f0b928d5def15c7e699c6d43b560d7 100644 (file)
                "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                 \
        "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"                  \
                "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;"                     \