Skip to contentSkip to conversation

arm: am57xx/dra7xx: Boot Android from eMMC

PATCH New Sam Protsenko 3 participants 9 messages Aug 16, 2017 – Aug 26, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover arm: am57xx/dra7xx: Boot Android from eMMC

Provide a way to boot Android from eMMC for AM57xx EVM and DRA7 EVM boards.

Changes in v2:
- Do not remove the attempt to boot regular Linux from eMMC (just add Android boot in the end of the cycle)

Sam Protsenko (3):
arm: omap: Define command for booting Android from eMMC
arm: am57xx: Define Android boot arguments
arm: dra7xx: Define Android boot arguments

 configs/am57xx_evm_defconfig      |  2 ++
 configs/am57xx_evm_nodt_defconfig |  2 ++
 configs/am57xx_hs_evm_defconfig   |  2 ++
 configs/dra7xx_evm_defconfig      |  2 ++
 configs/dra7xx_hs_evm_defconfig   |  2 ++
 include/environment/ti/boot.h     | 20 +++++++++++++++++++-
 6 files changed, 29 insertions(+), 1 deletion(-)
Signature · 1 line
2.13.2
#1 lore raw

PATCH v2 1/3 arm: omap: Define command for booting Android from eMMC

If SD card is present -- try to boot from it first. If no -- try to boot Android from eMMC.

---
Changes in v2:
- Do not remove the attempt to boot regular Linux from eMMC (just add Android boot in the end of the cycle)

 include/environment/ti/boot.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
include/environment/ti/boot.h +19 -1
index 1c3ae40a99..a05f5ba9bd 100644
@@ -28,7 +28,24 @@
 	"vram=16M\0" \
 	"partitions=" PARTS_DEFAULT "\0" \
 	"optargs=\0" \
-	"dofastboot=0\0"
+	"dofastboot=0\0" \
+	"emmc_android_boot=" \
+		"setenv eval_bootargs setenv bootargs $bootargs; " \
+		"run eval_bootargs; " \
+		"setenv mmcdev 1; " \
+		"setenv fdt_part 3; " \
+		"setenv boot_part 9; " \
+		"setenv machid fe6; " \
+		"mmc dev $mmcdev; " \
+		"mmc rescan; " \
+		"part start mmc ${mmcdev} ${fdt_part} fdt_start; " \
+		"part size mmc ${mmcdev} ${fdt_part} fdt_size; " \
+		"part start mmc ${mmcdev} ${boot_part} boot_start; " \
+		"part size mmc ${mmcdev} ${boot_part} boot_size; " \
+		"mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
+		"mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
+		"echo Booting from eMMC ...; " \
+		"bootm $loadaddr $loadaddr $fdtaddr;\0"
 
 #ifdef CONFIG_OMAP54XX
 
@@ -76,6 +93,7 @@
 	"setenv bootpart 1:2; " \
 	"setenv mmcroot /dev/mmcblk0p2 rw; " \
 	"run mmcboot;" \
+	"run emmc_android_boot; " \
 	""
 
 #endif /* CONFIG_OMAP54XX */
Signature · 1 line
2.13.2
#2 lore raw

PATCH v2 1/3 arm: omap: Define command for booting Android from eMMC

Quoted 2 lines · Sam Protsenko

If SD card is present -- try to boot from it first. If no -- try to boot Android from eMMC.

Well, i didn't know exactly..but is it working?

Quoted 15 lines

---
Changes in v2:
- Do not remove the attempt to boot regular Linux from eMMC (just add Android boot in the end of the cycle)

 include/environment/ti/boot.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
include/environment/ti/boot.h +0 -0
index 1c3ae40a99..a05f5ba9bd 100644

include/environment/ti/boot.h line 35

Quoted 9 lines
include/environment/ti/boot.h +5 -1
@@ -28,7 +28,24 @@
 	"vram=16M\0" \
 	"partitions=" PARTS_DEFAULT "\0" \
 	"optargs=\0" \
-	"dofastboot=0\0"
+	"dofastboot=0\0" \
+	"emmc_android_boot=" \
+		"setenv eval_bootargs setenv bootargs $bootargs; " \
+		"run eval_bootargs; " \
+		"setenv mmcdev 1; " \

Need to do "setenv mmcdev 1"? Did it already set before doing "run emmc_android_boot;"?

include/environment/ti/boot.h line 40

Quoted 5 lines
include/environment/ti/boot.h +5 -0
+		"setenv fdt_part 3; " \
+		"setenv boot_part 9; " \
+		"setenv machid fe6; " \
+		"mmc dev $mmcdev; " \
+		"mmc rescan; " \

Why do "mmc rescan"?

Quoted 20 lines
include/environment/ti/boot.h +9 -0
+		"part start mmc ${mmcdev} ${fdt_part} fdt_start; " \
+		"part size mmc ${mmcdev} ${fdt_part} fdt_size; " \
+		"part start mmc ${mmcdev} ${boot_part} boot_start; " \
+		"part size mmc ${mmcdev} ${boot_part} boot_size; " \
+		"mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
+		"mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
+		"echo Booting from eMMC ...; " \
+		"bootm $loadaddr $loadaddr $fdtaddr;\0"
 
 #ifdef CONFIG_OMAP54XX
 
@@ -76,6 +93,7 @@
 	"setenv bootpart 1:2; " \
 	"setenv mmcroot /dev/mmcblk0p2 rw; " \
 	"run mmcboot;" \
+	"run emmc_android_boot; " \
 	""
 
 #endif /* CONFIG_OMAP54XX */
#3 lore raw

PATCH v2 1/3 arm: omap: Define command for booting Android from eMMC

Quoted 6 lines · Jaehoon Chung
Quoted 2 lines · Sam Protsenko

If SD card is present -- try to boot from it first. If no -- try to boot Android from eMMC.

Well, i didn't know exactly..but is it working?

Yes, I verified it on AM57x EVM, it's working just fine. All my previous patches were meant exactly for this: booting Android from eMMC. This patch series just finishes the job.

Do you see anything suspicious about this? If so, please tell.

Quoted 10 lines
Quoted 10 lines

---
Changes in v2:
- Do not remove the attempt to boot regular Linux from eMMC (just add Android boot in the end of the cycle)

 include/environment/ti/boot.h | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
Quoted 17 lines
Quoted 5 lines
include/environment/ti/boot.h +0 -0
index 1c3ae40a99..a05f5ba9bd 100644

include/environment/ti/boot.h line 35

Quoted 9 lines
include/environment/ti/boot.h +5 -1
@@ -28,7 +28,24 @@
      "vram=16M\0" \
      "partitions=" PARTS_DEFAULT "\0" \
      "optargs=\0" \
-     "dofastboot=0\0"
+     "dofastboot=0\0" \
+     "emmc_android_boot=" \
+             "setenv eval_bootargs setenv bootargs $bootargs; " \
+             "run eval_bootargs; " \
+             "setenv mmcdev 1; " \

Need to do "setenv mmcdev 1"? Did it already set before doing "run emmc_android_boot;"?

Frankly, I want to keep "emmc_android_boot" command as explicit and independent as I can. Say, if user changes "mmcdev" variable, I want to be sure that "emmc_android_boot" will fix it.

Quoted 8 lines

include/environment/ti/boot.h line 40

Quoted 5 lines
include/environment/ti/boot.h +5 -0
+             "setenv fdt_part 3; " \
+             "setenv boot_part 9; " \
+             "setenv machid fe6; " \
+             "mmc dev $mmcdev; " \
+             "mmc rescan; " \

Why do "mmc rescan"?

The same as above. I want to keep this command independent. So that if user was using SD card, "emmc_android_boot" will switch to eMMC anyway, before trying to boot.

Quoted 21 lines
Quoted 20 lines
include/environment/ti/boot.h +9 -0
+             "part start mmc ${mmcdev} ${fdt_part} fdt_start; " \
+             "part size mmc ${mmcdev} ${fdt_part} fdt_size; " \
+             "part start mmc ${mmcdev} ${boot_part} boot_start; " \
+             "part size mmc ${mmcdev} ${boot_part} boot_size; " \
+             "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \
+             "mmc read ${loadaddr} ${boot_start} ${boot_size}; " \
+             "echo Booting from eMMC ...; " \
+             "bootm $loadaddr $loadaddr $fdtaddr;\0"
 
 #ifdef CONFIG_OMAP54XX
 
@@ -76,6 +93,7 @@
      "setenv bootpart 1:2; " \
      "setenv mmcroot /dev/mmcblk0p2 rw; " \
      "run mmcboot;" \
+     "run emmc_android_boot; " \
      ""
 
 #endif /* CONFIG_OMAP54XX */
#4 lore raw

PATCH v2 1/3 arm: omap: Define command for booting Android from eMMC

In reply to Sam Protsenko
Quoted 4 lines · Semen Protsenko

If SD card is present -- try to boot from it first. If no -- try to boot Android from eMMC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/92f756a5/attachment.sig>
#5 lore raw

PATCH v2 2/3 arm: am57xx: Define Android boot arguments

In reply to Sam Protsenko

---
Changes in v2:
- None

 configs/am57xx_evm_defconfig      | 2 ++
 configs/am57xx_evm_nodt_defconfig | 2 ++
 configs/am57xx_hs_evm_defconfig   | 2 ++
 3 files changed, 6 insertions(+)
configs/am57xx_evm_defconfig +2 -0
index 11be1ad27f..ad93602c13 100644
@@ -14,6 +14,8 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=am57xevmboard"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
configs/am57xx_evm_nodt_defconfig +2 -0
index a6ad0d36e0..e6f71e9133 100644
@@ -6,6 +6,8 @@ CONFIG_TARGET_AM57XX_EVM=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=am57xevmboard"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
configs/am57xx_hs_evm_defconfig +2 -0
index 91baa2b53e..5cd34561a7 100644
@@ -20,6 +20,8 @@ CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS2,115200 androidboot.console=ttyS2 androidboot.hardware=am57xevmboard"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
Signature · 1 line
2.13.2
#6 lore raw

PATCH v2 2/3 arm: am57xx: Define Android boot arguments

Quoted 1 line · Semen Protsenko

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/94364a3c/attachment.sig>
#7 lore raw

PATCH v2 3/3 arm: dra7xx: Define Android boot arguments

In reply to Sam Protsenko

---
Changes in v2:
- None

 configs/dra7xx_evm_defconfig    | 2 ++
 configs/dra7xx_hs_evm_defconfig | 2 ++
 2 files changed, 4 insertions(+)
configs/dra7xx_evm_defconfig +2 -0
index 4fff0cf734..0357abc6cd 100644
@@ -14,6 +14,8 @@ CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
configs/dra7xx_hs_evm_defconfig +2 -0
index 5572472d01..246de12543 100644
@@ -20,6 +20,8 @@ CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
 CONFIG_OF_BOARD_SETUP=y
 # CONFIG_ENV_IS_IN_FAT is not set
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
Signature · 1 line
2.13.2
#8 lore raw

PATCH v2 3/3 arm: dra7xx: Define Android boot arguments

Quoted 1 line · Semen Protsenko

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170826/b80c5395/attachment.sig>