[U-Boot] [PATCH 1/3] omap5: Kconfig: Add option to select Android boot

From: Sam Protsenko semen.protsenko@linaro.org
We need to differentiate somehow if u-boot build is intended for Android or regular Linux boot. Android requires some specific details from bootloader, such as enabled fastboot and specific partition table. Using this option we can check if user chose Android boot and configure those details properly.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- arch/arm/cpu/armv7/omap5/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index bfa264e..e03daff 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -21,6 +21,14 @@ endchoice config SYS_SOC default "omap5"
+config ANDROID_BOOT + bool "Android boot" + default n + help + This option enables Android build. Different boards can rely on this + option to provide Android partition list, enable fastboot capability + and so on. + source "board/compulab/cm_t54/Kconfig" source "board/ti/omap5_uevm/Kconfig" source "board/ti/dra7xx/Kconfig"

From: Sam Protsenko semen.protsenko@linaro.org
"fastboot oem format" command reuses "gpt write" command, which in turn requires correct partitions defined in $partitions variable. This patch adds such definition of Android partitions for DRA7XX EVM board.
While at it, enable CONFIG_RANDOM_UUID to spare user from providing UUIDs for each partition manually.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- include/configs/dra7xx_evm.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 4658283..e7e074d 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -42,10 +42,29 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK
#ifndef CONFIG_SPL_BUILD + /* Define the default GPT table for eMMC */ +#ifndef CONFIG_ANDROID_BOOT #define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}" +#else +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=xloader,start=128K,size=128K,uuid=${uuid_gpt_xloader};" \ + "name=bootloader,size=384K,uuid=${uuid_gpt_bootloader};" \ + "name=environment,size=128K,uuid=${uuid_gpt_environment};" \ + "name=misc,size=128K,uuid=${uuid_gpt_misc};" \ + "name=efs,start=1280K,size=16M,uuid=${uuid_gpt_efs};" \ + "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \ + "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \ + "name=boot,size=10M,uuid=${uuid_gpt_boot};" \ + "name=system,size=768M,uuid=${uuid_gpt_system};" \ + "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ + "name=ipu1,size=1M,uuid=${uuid_gpt_ipu1};" \ + "name=ipu2,size=1M,uuid=${uuid_gpt_ipu2};" \ + "name=userdata,size=-,uuid=${uuid_gpt_userdata}" +#endif
#define DFU_ALT_INFO_MMC \ "dfu_alt_info_mmc=" \ @@ -116,6 +135,7 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION +#define CONFIG_RANDOM_UUID #define CONFIG_HSMMC2_8BIT
/* CPSW Ethernet */

On Fri, Feb 19, 2016 at 09:25:32PM +0200, Semen Protsenko wrote:
From: Sam Protsenko semen.protsenko@linaro.org
"fastboot oem format" command reuses "gpt write" command, which in turn requires correct partitions defined in $partitions variable. This patch adds such definition of Android partitions for DRA7XX EVM board.
While at it, enable CONFIG_RANDOM_UUID to spare user from providing UUIDs for each partition manually.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
include/configs/dra7xx_evm.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 4658283..e7e074d 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -42,10 +42,29 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK
#ifndef CONFIG_SPL_BUILD
/* Define the default GPT table for eMMC */ +#ifndef CONFIG_ANDROID_BOOT #define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}" +#else +#define PARTS_DEFAULT \
- "uuid_disk=${uuid_gpt_disk};" \
- "name=xloader,start=128K,size=128K,uuid=${uuid_gpt_xloader};" \
- "name=bootloader,size=384K,uuid=${uuid_gpt_bootloader};" \
- "name=environment,size=128K,uuid=${uuid_gpt_environment};" \
- "name=misc,size=128K,uuid=${uuid_gpt_misc};" \
- "name=efs,start=1280K,size=16M,uuid=${uuid_gpt_efs};" \
- "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
- "name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
- "name=boot,size=10M,uuid=${uuid_gpt_boot};" \
- "name=system,size=768M,uuid=${uuid_gpt_system};" \
- "name=cache,size=256M,uuid=${uuid_gpt_cache};" \
- "name=ipu1,size=1M,uuid=${uuid_gpt_ipu1};" \
- "name=ipu2,size=1M,uuid=${uuid_gpt_ipu2};" \
- "name=userdata,size=-,uuid=${uuid_gpt_userdata}"
+#endif
#define DFU_ALT_INFO_MMC \ "dfu_alt_info_mmc=" \ @@ -116,6 +135,7 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION +#define CONFIG_RANDOM_UUID #define CONFIG_HSMMC2_8BIT
/* CPSW Ethernet */
I'm OK with the concept here. But I think what I'd rather see instead of a 3 part series here is just changing the defaults to be what Android requires here. No one else currently relies on the default layout we offer so lets just change it for what's required here, it's still functional enough for other possible uses.

On Fri, Feb 26, 2016 at 5:37 PM, Tom Rini trini@konsulko.com wrote:
On Fri, Feb 19, 2016 at 09:25:32PM +0200, Semen Protsenko wrote:
From: Sam Protsenko semen.protsenko@linaro.org
"fastboot oem format" command reuses "gpt write" command, which in turn requires correct partitions defined in $partitions variable. This patch adds such definition of Android partitions for DRA7XX EVM board.
While at it, enable CONFIG_RANDOM_UUID to spare user from providing UUIDs for each partition manually.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
include/configs/dra7xx_evm.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h index 4658283..e7e074d 100644 --- a/include/configs/dra7xx_evm.h +++ b/include/configs/dra7xx_evm.h @@ -42,10 +42,29 @@ #define CONFIG_SYS_OMAP_ABE_SYSCK
#ifndef CONFIG_SPL_BUILD
/* Define the default GPT table for eMMC */ +#ifndef CONFIG_ANDROID_BOOT #define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}" +#else +#define PARTS_DEFAULT \
"uuid_disk=${uuid_gpt_disk};" \
"name=xloader,start=128K,size=128K,uuid=${uuid_gpt_xloader};" \
"name=bootloader,size=384K,uuid=${uuid_gpt_bootloader};" \
"name=environment,size=128K,uuid=${uuid_gpt_environment};" \
"name=misc,size=128K,uuid=${uuid_gpt_misc};" \
"name=efs,start=1280K,size=16M,uuid=${uuid_gpt_efs};" \
"name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \
"name=recovery,size=10M,uuid=${uuid_gpt_recovery};" \
"name=boot,size=10M,uuid=${uuid_gpt_boot};" \
"name=system,size=768M,uuid=${uuid_gpt_system};" \
"name=cache,size=256M,uuid=${uuid_gpt_cache};" \
"name=ipu1,size=1M,uuid=${uuid_gpt_ipu1};" \
"name=ipu2,size=1M,uuid=${uuid_gpt_ipu2};" \
"name=userdata,size=-,uuid=${uuid_gpt_userdata}"
+#endif
#define DFU_ALT_INFO_MMC \ "dfu_alt_info_mmc=" \ @@ -116,6 +135,7 @@ /* Enhance our eMMC support / experience. */ #define CONFIG_CMD_GPT #define CONFIG_EFI_PARTITION +#define CONFIG_RANDOM_UUID #define CONFIG_HSMMC2_8BIT
/* CPSW Ethernet */
I'm OK with the concept here. But I think what I'd rather see instead of a 3 part series here is just changing the defaults to be what Android requires here. No one else currently relies on the default layout we offer so lets just change it for what's required here, it's still functional enough for other possible uses.
-- Tom
Consider this patch abandoned as new version was sent aside from this patchset: http://lists.denx.de/pipermail/u-boot/2016-February/246744.html

From: Sam Protsenko semen.protsenko@linaro.org
Add defconfig for DRA7XX EVM board intended for Android build. This defconfig was derived from configs/dra7xx_evm_defconfig. The only difference for now is that this new config exports Android partition table via $partitions variable.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- configs/dra7xx_evm_android_defconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 configs/dra7xx_evm_android_defconfig
diff --git a/configs/dra7xx_evm_android_defconfig b/configs/dra7xx_evm_android_defconfig new file mode 100644 index 0000000..1e5960b --- /dev/null +++ b/configs/dra7xx_evm_android_defconfig @@ -0,0 +1,17 @@ +CONFIG_ARM=y +CONFIG_OMAP54XX=y +CONFIG_TARGET_DRA7XX_EVM=y +CONFIG_SPL_STACK_R_ADDR=0x82000000 +CONFIG_SPL=y +CONFIG_SPL_STACK_R=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +# CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_NFS is not set +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SYS_NS16550=y +CONFIG_TI_QSPI=y +CONFIG_ANDROID_BOOT=y

On Fri, Feb 19, 2016 at 9:25 PM, Semen Protsenko semen.protsenko@linaro.org wrote:
From: Sam Protsenko semen.protsenko@linaro.org
Add defconfig for DRA7XX EVM board intended for Android build. This defconfig was derived from configs/dra7xx_evm_defconfig. The only difference for now is that this new config exports Android partition table via $partitions variable.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
configs/dra7xx_evm_android_defconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 configs/dra7xx_evm_android_defconfig
diff --git a/configs/dra7xx_evm_android_defconfig b/configs/dra7xx_evm_android_defconfig new file mode 100644 index 0000000..1e5960b --- /dev/null +++ b/configs/dra7xx_evm_android_defconfig @@ -0,0 +1,17 @@ +CONFIG_ARM=y +CONFIG_OMAP54XX=y +CONFIG_TARGET_DRA7XX_EVM=y +CONFIG_SPL_STACK_R_ADDR=0x82000000 +CONFIG_SPL=y +CONFIG_SPL_STACK_R=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_GPIO=y +# CONFIG_CMD_SETEXPR is not set +# CONFIG_CMD_NFS is not set +CONFIG_SPI_FLASH=y +CONFIG_SPI_FLASH_BAR=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SYS_NS16550=y +CONFIG_TI_QSPI=y
+CONFIG_ANDROID_BOOT=y
2.7.0
Consider this patch abandoned as new version was sent aside from this patchset: http://lists.denx.de/pipermail/u-boot/2016-February/246744.html

On Fri, Feb 19, 2016 at 9:25 PM, Semen Protsenko semen.protsenko@linaro.org wrote:
From: Sam Protsenko semen.protsenko@linaro.org
We need to differentiate somehow if u-boot build is intended for Android or regular Linux boot. Android requires some specific details from bootloader, such as enabled fastboot and specific partition table. Using this option we can check if user chose Android boot and configure those details properly.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org
arch/arm/cpu/armv7/omap5/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig index bfa264e..e03daff 100644 --- a/arch/arm/cpu/armv7/omap5/Kconfig +++ b/arch/arm/cpu/armv7/omap5/Kconfig @@ -21,6 +21,14 @@ endchoice config SYS_SOC default "omap5"
+config ANDROID_BOOT
bool "Android boot"
default n
help
This option enables Android build. Different boards can rely on this
option to provide Android partition list, enable fastboot capability
and so on.
source "board/compulab/cm_t54/Kconfig" source "board/ti/omap5_uevm/Kconfig" source "board/ti/dra7xx/Kconfig" -- 2.7.0
Consider this patch abandoned as new version was sent aside from this patchset: http://lists.denx.de/pipermail/u-boot/2016-February/246744.html
participants (3)
-
Sam Protsenko
-
Semen Protsenko
-
Tom Rini