diff mbox series

[v2,1/3] arm: omap: Define command for booting Android from eMMC

Message ID 20170816125550.26472-2-semen.protsenko@linaro.org
State Accepted
Commit a17c8b18448fe295388d9f585d9bf6472b8b81a4
Headers show
Series arm: am57xx/dra7xx: Boot Android from eMMC | expand

Commit Message

Sam Protsenko Aug. 16, 2017, 12:55 p.m. UTC
If SD card is present -- try to boot from it first. If no -- try to boot
Android from eMMC.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
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(-)

Comments

Jaehoon Chung Aug. 18, 2017, 11:42 a.m. UTC | #1
On 08/16/2017 09:55 PM, Sam Protsenko wrote:
> 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?

> 
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
> 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(-)
> 
> diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
> index 1c3ae40a99..a05f5ba9bd 100644
> --- a/include/environment/ti/boot.h
> +++ b/include/environment/ti/boot.h
> @@ -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;"?

> +		"setenv fdt_part 3; " \
> +		"setenv boot_part 9; " \
> +		"setenv machid fe6; " \
> +		"mmc dev $mmcdev; " \
> +		"mmc rescan; " \

Why do "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 */
>
Sam Protsenko Aug. 22, 2017, 3:06 p.m. UTC | #2
On 18 August 2017 at 14:42, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> On 08/16/2017 09:55 PM, Sam Protsenko wrote:
>> 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.

>>
>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>> ---
>> 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(-)
>>
>> diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
>> index 1c3ae40a99..a05f5ba9bd 100644
>> --- a/include/environment/ti/boot.h
>> +++ b/include/environment/ti/boot.h
>> @@ -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.

>> +             "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.

>> +             "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 */
>>
>
Tom Rini Aug. 26, 2017, 8:46 p.m. UTC | #3
On Wed, Aug 16, 2017 at 03:55:48PM +0300, Semen Protsenko wrote:

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

> Android from eMMC.

> 

> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h
index 1c3ae40a99..a05f5ba9bd 100644
--- a/include/environment/ti/boot.h
+++ b/include/environment/ti/boot.h
@@ -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 */