Skip to contentSkip to conversation

colibri_imx7: introduce androidboot wrapper

PATCH New Igor Opaniuk 3 participants 4 messages Jun 18, 2019 – Jul 20, 2019 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 colibri_imx7: introduce androidboot wrapper

From: Igor Opaniuk <[email protected]>

1. Introduce androidboot wrapper for booting AOSP.
2. Add partitions_android env var for simplifying the process of writing new gpt table from U-boot shell/fastboot.

---

v2:
- add proper serialnum value for bootargs instead hardcoded stub
- add invocation of m4 aux binary

 configs/colibri_imx7_emmc_defconfig |  2 +-
 include/configs/colibri_imx7.h      | 44 +++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 3 deletions(-)
configs/colibri_imx7_emmc_defconfig +1 -1
index 2fa9f1f532..864234eac4 100644
@@ -28,7 +28,7 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
-# CONFIG_RANDOM_UUID is not set
+CONFIG_RANDOM_UUID=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
include/configs/colibri_imx7.h +42 -2

62 lines not on this page · raw message

Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 colibri_imx7: introduce androidboot wrapper

+ Oleksandr, Philippe, Dominik

Quoted 103 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

1. Introduce androidboot wrapper for booting AOSP.
2. Add partitions_android env var for simplifying the process of writing new gpt table from U-boot shell/fastboot.

---

v2:
- add proper serialnum value for bootargs instead hardcoded stub
- add invocation of m4 aux binary

 configs/colibri_imx7_emmc_defconfig |  2 +-
 include/configs/colibri_imx7.h      | 44 +++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 3 deletions(-)
configs/colibri_imx7_emmc_defconfig +1 -1
index 2fa9f1f532..864234eac4 100644
@@ -28,7 +28,7 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
-# CONFIG_RANDOM_UUID is not set
+CONFIG_RANDOM_UUID=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
include/configs/colibri_imx7.h +42 -3
index 3e4f63e7ba..5655c75376 100644
@@ -48,6 +48,46 @@
 #define CONFIG_NETMASK                 255.255.255.0
 #define CONFIG_SERVERIP                        192.168.10.1
 
+#ifndef PARTS_DEFAULT
+/* Define the default GPT table for eMMC */
+#define PARTS_DEFAULT \
+       /* Android partitions */ \
+       "partitions_android=" \
+       "uuid_disk=${uuid_gpt_disk};" \
+       "name=boot,start=1M,size=32M,uuid=${uuid_gpt_boot};" \
+       "name=environment,size=4M,uuid=${uuid_gpt_environment};" \
+       "name=recovery,size=16M,uuid=${uuid_gpt_recovery};" \
+       "name=system,size=1536M,uuid=${uuid_gpt_system};" \
+       "name=cache,size=512M,uuid=${uuid_gpt_cache};" \
+       "name=device,size=8M,uuid=${uuid_gpt_device};" \
+       "name=misc,size=4M,uuid=${uuid_gpt_misc};" \
+       "name=datafooter,size=2M,uuid=${uuid_gpt_datafooter};" \
+       "name=metadata,size=2M,uuid=${uuid_gpt_metadata};" \
+       "name=persistdata,size=2M,uuid=${uuid_gpt_persistdata};" \
+       "name=userdata,size=128M,uuid=${uuid_gpt_userdata};" \
+       "name=fbmisc,size=-,uuid=${uuid_gpt_fbmisc}\0"
+#endif /* PARTS_DEFAULT */
+
+#define EMMC_ANDROID_BOOTCMD \
+       "android_args=androidboot.storage_type=emmc\0" \
+       PARTS_DEFAULT \
+       "android_fdt_addr=0x83700000\0" \
+       "android_mmc_dev=0\0" \
+       "m4binary=rpmsg_imu_freertos.elf\0" \
+       "androidboot=ext4load mmc 0:a ${loadaddr} media/0/${m4binary}; "\
+               "bootaux ${loadaddr}; " \
+               "setenv loadaddr 0x88000000; " \
+               "setenv bootm_boot_mode sec;" \
+               "setenv bootargs androidboot.serialno=${serial#} " \
+                       "$android_args; " \
+               "part start mmc ${android_mmc_dev} boot boot_start; " \
+               "part size mmc ${android_mmc_dev} boot boot_size; " \
+               "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
+               "part start mmc ${android_mmc_dev} environment env_start; " \
+               "part size mmc ${android_mmc_dev} environment env_size; " \
+               "mmc read ${android_fdt_addr} ${env_start} ${env_size}; " \
+               "bootm ${loadaddr} ${loadaddr} ${android_fdt_addr}\0 "
+
 #define EMMC_BOOTCMD \
        "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
                "rootfstype=ext4 rootwait\0" \
@@ -65,7 +105,6 @@
        "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
        "emmcrootpart=2\0"
 
-
 #define MEM_LAYOUT_ENV_SETTINGS \
        "bootm_size=0x10000000\0" \
        "fdt_addr_r=0x82000000\0" \
@@ -127,7 +166,8 @@
        "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
 #define MODULE_EXTRA_ENV_SETTINGS \
        "variant=-emmc\0" \
-       EMMC_BOOTCMD
+       EMMC_BOOTCMD \
+       EMMC_ANDROID_BOOTCMD
 #endif
 
 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
--

2.17.1

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
#2 lore raw

PATCH v2 1/1 colibri_imx7: introduce androidboot wrapper

Quoted 12 lines · Igor Opaniuk

+ Oleksandr, Philippe, Dominik

Quoted 8 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

1. Introduce androidboot wrapper for booting AOSP.
2. Add partitions_android env var for simplifying the process of writing new gpt table from U-boot shell/fastboot.

Quoted 110 lines
Quoted 93 lines

---

v2:
- add proper serialnum value for bootargs instead hardcoded stub
- add invocation of m4 aux binary

 configs/colibri_imx7_emmc_defconfig |  2 +-
 include/configs/colibri_imx7.h      | 44 +++++++++++++++++++++++++++--
 2 files changed, 43 insertions(+), 3 deletions(-)
configs/colibri_imx7_emmc_defconfig +1 -1
index 2fa9f1f532..864234eac4 100644
@@ -28,7 +28,7 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
-# CONFIG_RANDOM_UUID is not set
+CONFIG_RANDOM_UUID=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
include/configs/colibri_imx7.h +42 -3
index 3e4f63e7ba..5655c75376 100644
@@ -48,6 +48,46 @@
 #define CONFIG_NETMASK                 255.255.255.0
 #define CONFIG_SERVERIP                        192.168.10.1
 
+#ifndef PARTS_DEFAULT
+/* Define the default GPT table for eMMC */
+#define PARTS_DEFAULT \
+       /* Android partitions */ \
+       "partitions_android=" \
+       "uuid_disk=${uuid_gpt_disk};" \
+       "name=boot,start=1M,size=32M,uuid=${uuid_gpt_boot};" \
+       "name=environment,size=4M,uuid=${uuid_gpt_environment};" \
+       "name=recovery,size=16M,uuid=${uuid_gpt_recovery};" \
+       "name=system,size=1536M,uuid=${uuid_gpt_system};" \
+       "name=cache,size=512M,uuid=${uuid_gpt_cache};" \
+       "name=device,size=8M,uuid=${uuid_gpt_device};" \
+       "name=misc,size=4M,uuid=${uuid_gpt_misc};" \
+       "name=datafooter,size=2M,uuid=${uuid_gpt_datafooter};" \
+       "name=metadata,size=2M,uuid=${uuid_gpt_metadata};" \
+       "name=persistdata,size=2M,uuid=${uuid_gpt_persistdata};" \
+       "name=userdata,size=128M,uuid=${uuid_gpt_userdata};" \
+       "name=fbmisc,size=-,uuid=${uuid_gpt_fbmisc}\0"
+#endif /* PARTS_DEFAULT */
+
+#define EMMC_ANDROID_BOOTCMD \
+       "android_args=androidboot.storage_type=emmc\0" \
+       PARTS_DEFAULT \
+       "android_fdt_addr=0x83700000\0" \
+       "android_mmc_dev=0\0" \
+       "m4binary=rpmsg_imu_freertos.elf\0" \
+       "androidboot=ext4load mmc 0:a ${loadaddr} media/0/${m4binary}; "\
+               "bootaux ${loadaddr}; " \
+               "setenv loadaddr 0x88000000; " \
+               "setenv bootm_boot_mode sec;" \
+               "setenv bootargs androidboot.serialno=${serial#} " \
+                       "$android_args; " \
+               "part start mmc ${android_mmc_dev} boot boot_start; " \
+               "part size mmc ${android_mmc_dev} boot boot_size; " \
+               "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
+               "part start mmc ${android_mmc_dev} environment env_start; " \
+               "part size mmc ${android_mmc_dev} environment env_size; " \
+               "mmc read ${android_fdt_addr} ${env_start} ${env_size}; " \
+               "bootm ${loadaddr} ${loadaddr} ${android_fdt_addr}\0 "
+
 #define EMMC_BOOTCMD \
        "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
                "rootfstype=ext4 rootwait\0" \
@@ -65,7 +105,6 @@
        "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
        "emmcrootpart=2\0"
 
-
 #define MEM_LAYOUT_ENV_SETTINGS \
        "bootm_size=0x10000000\0" \
        "fdt_addr_r=0x82000000\0" \
@@ -127,7 +166,8 @@
        "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
 #define MODULE_EXTRA_ENV_SETTINGS \
        "variant=-emmc\0" \
-       EMMC_BOOTCMD
+       EMMC_BOOTCMD \
+       EMMC_ANDROID_BOOTCMD
 #endif
 
 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
--
Quoted 2 lines

2.17.1

--
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Signature · 6 lines
Best regards
Oleksandr Suvorov

Toradex AG
Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
4800 (main line)
#3 lore raw

PATCH v2 1/1 colibri_imx7: introduce androidboot wrapper

In reply to Igor Opaniuk
Quoted 6 lines

From: Igor Opaniuk <[email protected]>
1. Introduce androidboot wrapper for booting AOSP.
2. Add partitions_android env var for simplifying the process of writing new gpt table from U-boot shell/fastboot.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================