All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] VIM3: misc cleanups to prepare android support
@ 2021-07-29  7:21 Mattijs Korpershoek
  2021-07-29  7:21 ` [PATCH 1/6] configs: sei610: fix typo in header comment Mattijs Korpershoek
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

The Khadas VIM3 and VIM3L boards are well supported in the
Android Open Source project via the yukawa[1] platform.

Their U-Boot version, despite being public [2] is not in mainline.

These series a couple of cleanups to prepare to add mainline U-Boot support
for vim3 / vim3l so that we can boot Android.

[1] https://source.android.com/setup/build/devices#vim3_and_vim3l_boards
[2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ

Mattijs Korpershoek (6):
  configs: sei610: fix typo in header comment
  configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS
  configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV
  configs: meson64_android: use boot part label instead of index
  configs: meson64_android: use logo part label instead of index
  configs: meson64_android: don't set console bootargs

 include/configs/meson64_android.h | 30 +++++++++++++++++-------------
 include/configs/sei610.h          |  2 +-
 2 files changed, 18 insertions(+), 14 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] configs: sei610: fix typo in header comment
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:21   ` Neil Armstrong
  2021-07-29  7:21 ` [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS Mattijs Korpershoek
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek, Guillaume La Roque

s/510/610/

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/sei610.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/sei610.h b/include/configs/sei610.h
index 6d093161c9..9eeffdd72c 100644
--- a/include/configs/sei610.h
+++ b/include/configs/sei610.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Configuration for the SEI510
+ * Configuration for the SEI610
  *
  * Copyright (C) 2019 Baylibre, SAS
  * Author: Jerome Brunet <jbrunet@baylibre.com>
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
  2021-07-29  7:21 ` [PATCH 1/6] configs: sei610: fix typo in header comment Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:21   ` Neil Armstrong
  2021-07-29  7:21 ` [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV Mattijs Korpershoek
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

both lines seem to be joined together which is not the case for the
meson64.h EXTRA_ENV_SETTINGS.

Add a newline for consistency.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/meson64_android.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
index c47d51c853..661de76fd7 100644
--- a/include/configs/meson64_android.h
+++ b/include/configs/meson64_android.h
@@ -127,7 +127,8 @@
 	"kernel_addr_r=0x01080000\0"                                  \
 	"pxefile_addr_r=0x01080000\0"                                 \
 	"ramdisk_addr_r=0x13000000\0"                                 \
-	"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" BOOTENV
+	"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"        \
+	BOOTENV
 
 #include <configs/meson64.h>
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
  2021-07-29  7:21 ` [PATCH 1/6] configs: sei610: fix typo in header comment Mattijs Korpershoek
  2021-07-29  7:21 ` [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:22   ` Neil Armstrong
  2021-07-29  7:21 ` [PATCH 4/6] configs: meson64_android: use boot part label instead of index Mattijs Korpershoek
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

Right now, when running fastboot we use a hard-coded "0" for the
device number.

Use the Kconfig option named CONFIG_FASTBOOT_USB_DEV instead.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/meson64_android.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
index 661de76fd7..4027a7fe0d 100644
--- a/include/configs/meson64_android.h
+++ b/include/configs/meson64_android.h
@@ -38,7 +38,7 @@
 		"fi;" \
 		"if test \"${run_fastboot}\" -eq 1; then " \
 			"echo Running Fastboot...;" \
-			"fastboot 0;" \
+			"fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
 		"fi\0"
 
 #define BOOTENV_DEV_NAME_FASTBOOT(devtypeu, devtypel, instance)	\
@@ -69,7 +69,7 @@
 		"fi;" \
 		"if test \"${run_recovery}\" -eq 1; then " \
 			"echo Running Recovery...;" \
-			"fastboot 0;" \
+			"fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
 		"fi\0"
 
 #define BOOTENV_DEV_NAME_RECOVERY(devtypeu, devtypel, instance)	\
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 4/6] configs: meson64_android: use boot part label instead of index
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
                   ` (2 preceding siblings ...)
  2021-07-29  7:21 ` [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:22   ` Neil Armstrong
  2021-07-29  7:21 ` [PATCH 5/6] configs: meson64_android: use logo " Mattijs Korpershoek
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

To boot Android, we read the gpt and assume that the partition with
index "1" will be the "boot" partition.

This might not always be the case, as there are no requirements from
Android on the partition order.

However, Android does seem to use the "boot" label quite a lot on their
public documentation [1]

Load the boot partition by label instead of by index

[1] https://source.android.com/devices/bootloader/partitions
Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/meson64_android.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
index 4027a7fe0d..e22f05c889 100644
--- a/include/configs/meson64_android.h
+++ b/include/configs/meson64_android.h
@@ -9,6 +9,9 @@
 #ifndef __MESON64_ANDROID_CONFIG_H
 #define __MESON64_ANDROID_CONFIG_H
 
+#ifndef BOOT_PARTITION
+#define BOOT_PARTITION "boot"
+#endif
 
 #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
 	"bootcmd_fastboot=" \
@@ -77,11 +80,11 @@
 
 #define BOOTENV_DEV_SYSTEM(devtypeu, devtypel, instance) \
 	"bootcmd_system=" \
-		"echo Loading Android boot partition...;" \
+		"echo Loading Android " BOOT_PARTITION " partition...;" \
 		"mmc dev ${mmcdev};" \
 		"setenv bootargs ${bootargs} console=${console} androidboot.serialno=${serial#};" \
-		"part start mmc ${mmcdev} ${bootpart} boot_start;" \
-		"part size mmc ${mmcdev} ${bootpart} boot_size;" \
+		"part start mmc ${mmcdev} " BOOT_PARTITION " boot_start;" \
+		"part size mmc ${mmcdev} " BOOT_PARTITION " boot_size;" \
 		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
 			"echo Running Android...;" \
 			"bootm ${loadaddr};" \
@@ -111,7 +114,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS                                     \
 	"partitions=" PARTS_DEFAULT "\0"                              \
 	"mmcdev=2\0"                                                  \
-	"bootpart=1\0"                                                \
 	"logopart=2\0"                                                \
 	"gpio_recovery=88\0"                                          \
 	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 5/6] configs: meson64_android: use logo part label instead of index
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
                   ` (3 preceding siblings ...)
  2021-07-29  7:21 ` [PATCH 4/6] configs: meson64_android: use boot part label instead of index Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:22   ` Neil Armstrong
  2021-07-29  7:21 ` [PATCH 6/6] configs: meson64_android: don't set console bootargs Mattijs Korpershoek
  2021-07-29  9:37 ` [PATCH 0/6] VIM3: misc cleanups to prepare android support Neil Armstrong
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

To display the bootup logo, we read the gpt and assume that the
partition with index "2" will be the "logo" partition.

This might not always be the case, and it's very error-prone.

Load the logo partition by label instead of by index.

Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/meson64_android.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
index e22f05c889..56545a72f8 100644
--- a/include/configs/meson64_android.h
+++ b/include/configs/meson64_android.h
@@ -13,6 +13,10 @@
 #define BOOT_PARTITION "boot"
 #endif
 
+#ifndef LOGO_PARTITION
+#define LOGO_PARTITION "logo"
+#endif
+
 #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
 	"bootcmd_fastboot=" \
 		"sm reboot_reason reason;" \
@@ -104,8 +108,8 @@
 	"if test \"${boot_source}\" != \"usb\" && " \
 		"gpt verify mmc ${mmcdev} ${partitions}; then; " \
 		"mmc dev ${mmcdev};" \
-		"part start mmc ${mmcdev} ${logopart} boot_start;" \
-		"part size mmc ${mmcdev} ${logopart} boot_size;" \
+		"part start mmc ${mmcdev} " LOGO_PARTITION " boot_start;" \
+		"part size mmc ${mmcdev} " LOGO_PARTITION " boot_size;" \
 		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
 			"bmp display ${loadaddr} m m;" \
 		"fi;" \
@@ -114,7 +118,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS                                     \
 	"partitions=" PARTS_DEFAULT "\0"                              \
 	"mmcdev=2\0"                                                  \
-	"logopart=2\0"                                                \
 	"gpio_recovery=88\0"                                          \
 	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
 	"load_logo=" PREBOOT_LOAD_LOGO "\0"			      \
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 6/6] configs: meson64_android: don't set console bootargs
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
                   ` (4 preceding siblings ...)
  2021-07-29  7:21 ` [PATCH 5/6] configs: meson64_android: use logo " Mattijs Korpershoek
@ 2021-07-29  7:21 ` Mattijs Korpershoek
  2021-07-29  9:23   ` Neil Armstrong
  2021-07-29  9:37 ` [PATCH 0/6] VIM3: misc cleanups to prepare android support Neil Armstrong
  6 siblings, 1 reply; 14+ messages in thread
From: Mattijs Korpershoek @ 2021-07-29  7:21 UTC (permalink / raw)
  To: Neil Armstrong; +Cc: u-boot-amlogic, u-boot, Mattijs Korpershoek

The console bootargs are already set from the kernel commandline.
On Android, this is done in yukawa at [1]

Don't set it in the bootloader since it's overridden by the kernel anyways.

[1] https://android-review.googlesource.com/c/device/amlogic/yukawa/+/1112994
Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 include/configs/meson64_android.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
index 56545a72f8..3b61d5f703 100644
--- a/include/configs/meson64_android.h
+++ b/include/configs/meson64_android.h
@@ -86,7 +86,7 @@
 	"bootcmd_system=" \
 		"echo Loading Android " BOOT_PARTITION " partition...;" \
 		"mmc dev ${mmcdev};" \
-		"setenv bootargs ${bootargs} console=${console} androidboot.serialno=${serial#};" \
+		"setenv bootargs ${bootargs} androidboot.serialno=${serial#};" \
 		"part start mmc ${mmcdev} " BOOT_PARTITION " boot_start;" \
 		"part size mmc ${mmcdev} " BOOT_PARTITION " boot_size;" \
 		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
@@ -121,8 +121,6 @@
 	"gpio_recovery=88\0"                                          \
 	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
 	"load_logo=" PREBOOT_LOAD_LOGO "\0"			      \
-	"console=/dev/ttyAML0\0"                                      \
-	"bootargs=no_console_suspend\0"                               \
 	"stdin=" STDIN_CFG "\0"                                       \
 	"stdout=" STDOUT_CFG "\0"                                     \
 	"stderr=" STDOUT_CFG "\0"                                     \
-- 
2.30.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/6] configs: sei610: fix typo in header comment
  2021-07-29  7:21 ` [PATCH 1/6] configs: sei610: fix typo in header comment Mattijs Korpershoek
@ 2021-07-29  9:21   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:21 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot, Guillaume La Roque

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> s/510/610/
> 
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/sei610.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/sei610.h b/include/configs/sei610.h
> index 6d093161c9..9eeffdd72c 100644
> --- a/include/configs/sei610.h
> +++ b/include/configs/sei610.h
> @@ -1,6 +1,6 @@
>  /* SPDX-License-Identifier: GPL-2.0+ */
>  /*
> - * Configuration for the SEI510
> + * Configuration for the SEI610
>   *
>   * Copyright (C) 2019 Baylibre, SAS
>   * Author: Jerome Brunet <jbrunet@baylibre.com>
> 

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS
  2021-07-29  7:21 ` [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS Mattijs Korpershoek
@ 2021-07-29  9:21   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:21 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> both lines seem to be joined together which is not the case for the
> meson64.h EXTRA_ENV_SETTINGS.
> 
> Add a newline for consistency.
> 
> Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/meson64_android.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
> index c47d51c853..661de76fd7 100644
> --- a/include/configs/meson64_android.h
> +++ b/include/configs/meson64_android.h
> @@ -127,7 +127,8 @@
>  	"kernel_addr_r=0x01080000\0"                                  \
>  	"pxefile_addr_r=0x01080000\0"                                 \
>  	"ramdisk_addr_r=0x13000000\0"                                 \
> -	"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" BOOTENV
> +	"fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"        \
> +	BOOTENV
>  
>  #include <configs/meson64.h>
>  
> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV
  2021-07-29  7:21 ` [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV Mattijs Korpershoek
@ 2021-07-29  9:22   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:22 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> Right now, when running fastboot we use a hard-coded "0" for the
> device number.
> 
> Use the Kconfig option named CONFIG_FASTBOOT_USB_DEV instead.
> 
> Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/meson64_android.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
> index 661de76fd7..4027a7fe0d 100644
> --- a/include/configs/meson64_android.h
> +++ b/include/configs/meson64_android.h
> @@ -38,7 +38,7 @@
>  		"fi;" \
>  		"if test \"${run_fastboot}\" -eq 1; then " \
>  			"echo Running Fastboot...;" \
> -			"fastboot 0;" \
> +			"fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
>  		"fi\0"
>  
>  #define BOOTENV_DEV_NAME_FASTBOOT(devtypeu, devtypel, instance)	\
> @@ -69,7 +69,7 @@
>  		"fi;" \
>  		"if test \"${run_recovery}\" -eq 1; then " \
>  			"echo Running Recovery...;" \
> -			"fastboot 0;" \
> +			"fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
>  		"fi\0"
>  
>  #define BOOTENV_DEV_NAME_RECOVERY(devtypeu, devtypel, instance)	\
> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/6] configs: meson64_android: use boot part label instead of index
  2021-07-29  7:21 ` [PATCH 4/6] configs: meson64_android: use boot part label instead of index Mattijs Korpershoek
@ 2021-07-29  9:22   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:22 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> To boot Android, we read the gpt and assume that the partition with
> index "1" will be the "boot" partition.
> 
> This might not always be the case, as there are no requirements from
> Android on the partition order.
> 
> However, Android does seem to use the "boot" label quite a lot on their
> public documentation [1]
> 
> Load the boot partition by label instead of by index
> 
> [1] https://source.android.com/devices/bootloader/partitions
> Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/meson64_android.h | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
> index 4027a7fe0d..e22f05c889 100644
> --- a/include/configs/meson64_android.h
> +++ b/include/configs/meson64_android.h
> @@ -9,6 +9,9 @@
>  #ifndef __MESON64_ANDROID_CONFIG_H
>  #define __MESON64_ANDROID_CONFIG_H
>  
> +#ifndef BOOT_PARTITION
> +#define BOOT_PARTITION "boot"
> +#endif
>  
>  #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
>  	"bootcmd_fastboot=" \
> @@ -77,11 +80,11 @@
>  
>  #define BOOTENV_DEV_SYSTEM(devtypeu, devtypel, instance) \
>  	"bootcmd_system=" \
> -		"echo Loading Android boot partition...;" \
> +		"echo Loading Android " BOOT_PARTITION " partition...;" \
>  		"mmc dev ${mmcdev};" \
>  		"setenv bootargs ${bootargs} console=${console} androidboot.serialno=${serial#};" \
> -		"part start mmc ${mmcdev} ${bootpart} boot_start;" \
> -		"part size mmc ${mmcdev} ${bootpart} boot_size;" \
> +		"part start mmc ${mmcdev} " BOOT_PARTITION " boot_start;" \
> +		"part size mmc ${mmcdev} " BOOT_PARTITION " boot_size;" \
>  		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
>  			"echo Running Android...;" \
>  			"bootm ${loadaddr};" \
> @@ -111,7 +114,6 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS                                     \
>  	"partitions=" PARTS_DEFAULT "\0"                              \
>  	"mmcdev=2\0"                                                  \
> -	"bootpart=1\0"                                                \
>  	"logopart=2\0"                                                \
>  	"gpio_recovery=88\0"                                          \
>  	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/6] configs: meson64_android: use logo part label instead of index
  2021-07-29  7:21 ` [PATCH 5/6] configs: meson64_android: use logo " Mattijs Korpershoek
@ 2021-07-29  9:22   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:22 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> To display the bootup logo, we read the gpt and assume that the
> partition with index "2" will be the "logo" partition.
> 
> This might not always be the case, and it's very error-prone.
> 
> Load the logo partition by label instead of by index.
> 
> Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/meson64_android.h | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
> index e22f05c889..56545a72f8 100644
> --- a/include/configs/meson64_android.h
> +++ b/include/configs/meson64_android.h
> @@ -13,6 +13,10 @@
>  #define BOOT_PARTITION "boot"
>  #endif
>  
> +#ifndef LOGO_PARTITION
> +#define LOGO_PARTITION "logo"
> +#endif
> +
>  #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
>  	"bootcmd_fastboot=" \
>  		"sm reboot_reason reason;" \
> @@ -104,8 +108,8 @@
>  	"if test \"${boot_source}\" != \"usb\" && " \
>  		"gpt verify mmc ${mmcdev} ${partitions}; then; " \
>  		"mmc dev ${mmcdev};" \
> -		"part start mmc ${mmcdev} ${logopart} boot_start;" \
> -		"part size mmc ${mmcdev} ${logopart} boot_size;" \
> +		"part start mmc ${mmcdev} " LOGO_PARTITION " boot_start;" \
> +		"part size mmc ${mmcdev} " LOGO_PARTITION " boot_size;" \
>  		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
>  			"bmp display ${loadaddr} m m;" \
>  		"fi;" \
> @@ -114,7 +118,6 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS                                     \
>  	"partitions=" PARTS_DEFAULT "\0"                              \
>  	"mmcdev=2\0"                                                  \
> -	"logopart=2\0"                                                \
>  	"gpio_recovery=88\0"                                          \
>  	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
>  	"load_logo=" PREBOOT_LOAD_LOGO "\0"			      \
> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 6/6] configs: meson64_android: don't set console bootargs
  2021-07-29  7:21 ` [PATCH 6/6] configs: meson64_android: don't set console bootargs Mattijs Korpershoek
@ 2021-07-29  9:23   ` Neil Armstrong
  0 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:23 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> The console bootargs are already set from the kernel commandline.
> On Android, this is done in yukawa at [1]
> 
> Don't set it in the bootloader since it's overridden by the kernel anyways.
> 
> [1] https://android-review.googlesource.com/c/device/amlogic/yukawa/+/1112994
> Signed-off-by: Guillaume La Roque <mkorpershoek@baylibre.com>
> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  include/configs/meson64_android.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h
> index 56545a72f8..3b61d5f703 100644
> --- a/include/configs/meson64_android.h
> +++ b/include/configs/meson64_android.h
> @@ -86,7 +86,7 @@
>  	"bootcmd_system=" \
>  		"echo Loading Android " BOOT_PARTITION " partition...;" \
>  		"mmc dev ${mmcdev};" \
> -		"setenv bootargs ${bootargs} console=${console} androidboot.serialno=${serial#};" \
> +		"setenv bootargs ${bootargs} androidboot.serialno=${serial#};" \
>  		"part start mmc ${mmcdev} " BOOT_PARTITION " boot_start;" \
>  		"part size mmc ${mmcdev} " BOOT_PARTITION " boot_size;" \
>  		"if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
> @@ -121,8 +121,6 @@
>  	"gpio_recovery=88\0"                                          \
>  	"check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
>  	"load_logo=" PREBOOT_LOAD_LOGO "\0"			      \
> -	"console=/dev/ttyAML0\0"                                      \
> -	"bootargs=no_console_suspend\0"                               \
>  	"stdin=" STDIN_CFG "\0"                                       \
>  	"stdout=" STDOUT_CFG "\0"                                     \
>  	"stderr=" STDOUT_CFG "\0"                                     \
> 


Acked-by: Neil Armstrong <narmstrong@baylibre.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] VIM3: misc cleanups to prepare android support
  2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
                   ` (5 preceding siblings ...)
  2021-07-29  7:21 ` [PATCH 6/6] configs: meson64_android: don't set console bootargs Mattijs Korpershoek
@ 2021-07-29  9:37 ` Neil Armstrong
  6 siblings, 0 replies; 14+ messages in thread
From: Neil Armstrong @ 2021-07-29  9:37 UTC (permalink / raw)
  To: Mattijs Korpershoek; +Cc: u-boot-amlogic, u-boot

On 29/07/2021 09:21, Mattijs Korpershoek wrote:
> The Khadas VIM3 and VIM3L boards are well supported in the
> Android Open Source project via the yukawa[1] platform.
> 
> Their U-Boot version, despite being public [2] is not in mainline.
> 
> These series a couple of cleanups to prepare to add mainline U-Boot support
> for vim3 / vim3l so that we can boot Android.
> 
> [1] https://source.android.com/setup/build/devices#vim3_and_vim3l_boards
> [2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ
> 
> Mattijs Korpershoek (6):
>   configs: sei610: fix typo in header comment
>   configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS
>   configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV
>   configs: meson64_android: use boot part label instead of index
>   configs: meson64_android: use logo part label instead of index
>   configs: meson64_android: don't set console bootargs
> 
>  include/configs/meson64_android.h | 30 +++++++++++++++++-------------
>  include/configs/sei610.h          |  2 +-
>  2 files changed, 18 insertions(+), 14 deletions(-)
> 

Applied to u-boot-amlogic


Thanks,
Neil

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-29 12:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29  7:21 [PATCH 0/6] VIM3: misc cleanups to prepare android support Mattijs Korpershoek
2021-07-29  7:21 ` [PATCH 1/6] configs: sei610: fix typo in header comment Mattijs Korpershoek
2021-07-29  9:21   ` Neil Armstrong
2021-07-29  7:21 ` [PATCH 2/6] configs: meson64_android: fix bad indent in EXTRA_ENV_SETTINGS Mattijs Korpershoek
2021-07-29  9:21   ` Neil Armstrong
2021-07-29  7:21 ` [PATCH 3/6] configs: meson64_android: use CONFIG_FASTBOOT_USB_DEV Mattijs Korpershoek
2021-07-29  9:22   ` Neil Armstrong
2021-07-29  7:21 ` [PATCH 4/6] configs: meson64_android: use boot part label instead of index Mattijs Korpershoek
2021-07-29  9:22   ` Neil Armstrong
2021-07-29  7:21 ` [PATCH 5/6] configs: meson64_android: use logo " Mattijs Korpershoek
2021-07-29  9:22   ` Neil Armstrong
2021-07-29  7:21 ` [PATCH 6/6] configs: meson64_android: don't set console bootargs Mattijs Korpershoek
2021-07-29  9:23   ` Neil Armstrong
2021-07-29  9:37 ` [PATCH 0/6] VIM3: misc cleanups to prepare android support Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.