Re: [PATCH] configs: khadas-vim3*_android: fix AVB oom error

2024-02-23 Thread Neil Armstrong
Hi,

On Fri, 09 Feb 2024 09:58:35 +0100, Mattijs Korpershoek wrote:
> When booting Android with AVB enabled, an OOM is observed:
> 
>   => avb init ${mmcdev}
>   => avb verify _a
>   ## Android Verified Boot 2.0 version 1.1.0
>   read_is_device_unlocked not supported yet
>   read_rollback_index not supported yet
>   avb_util.c:182: ERROR: Failed to allocate memory.
>   OOM error occurred during verification
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-amlogic 
(u-boot-amlogic)

[1/1] configs: khadas-vim3*_android: fix AVB oom error
  
https://source.denx.de/u-boot/custodians/u-boot-amlogic/-/commit/fc0a7431e1729f456690468f2e9570fcc2c18175

-- 
Neil



Re: [PATCH] configs: khadas-vim3*_android: fix AVB oom error

2024-02-12 Thread Igor Opaniuk
On Fri, Feb 9, 2024 at 10:07 AM Mattijs Korpershoek
 wrote:
>
> When booting Android with AVB enabled, an OOM is observed:
>
>   => avb init ${mmcdev}
>   => avb verify _a
>   ## Android Verified Boot 2.0 version 1.1.0
>   read_is_device_unlocked not supported yet
>   read_rollback_index not supported yet
>   avb_util.c:182: ERROR: Failed to allocate memory.
>   OOM error occurred during verification
>
> A custom malloc length of 128MB is required as documented in
> commit 285a83b12bdf ("configs: meson64_android: increase SYS_MALLOC_LEN to 
> 128M for AVB")
>
> However, this 128M custom malloc length was not ported to Kconfig in
> commit 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")
>
> Add it back to fix AVB verification on VIM3/VIM3L.
>
> Fixes: 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")
> Co-developed-by: Guillaume La Roque 
> Signed-off-by: Guillaume La Roque 
> Signed-off-by: Mattijs Korpershoek 
> ---
>  configs/khadas-vim3_android_ab_defconfig  | 1 +
>  configs/khadas-vim3_android_defconfig | 1 +
>  configs/khadas-vim3l_android_ab_defconfig | 1 +
>  configs/khadas-vim3l_android_defconfig| 1 +
>  4 files changed, 4 insertions(+)
>
> diff --git a/configs/khadas-vim3_android_ab_defconfig 
> b/configs/khadas-vim3_android_ab_defconfig
> index b41c2660fff0..ee62fe36d414 100644
> --- a/configs/khadas-vim3_android_ab_defconfig
> +++ b/configs/khadas-vim3_android_ab_defconfig
> @@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
>  CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
>  CONFIG_ARCH_MESON=y
>  CONFIG_TEXT_BASE=0x0100
> +CONFIG_SYS_MALLOC_LEN=0x0800
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
> diff --git a/configs/khadas-vim3_android_defconfig 
> b/configs/khadas-vim3_android_defconfig
> index 88197f5f5e99..cecbe5061793 100644
> --- a/configs/khadas-vim3_android_defconfig
> +++ b/configs/khadas-vim3_android_defconfig
> @@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
>  CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
>  CONFIG_ARCH_MESON=y
>  CONFIG_TEXT_BASE=0x0100
> +CONFIG_SYS_MALLOC_LEN=0x0800
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
> diff --git a/configs/khadas-vim3l_android_ab_defconfig 
> b/configs/khadas-vim3l_android_ab_defconfig
> index 3381d2e92701..ec4e0dc72e22 100644
> --- a/configs/khadas-vim3l_android_ab_defconfig
> +++ b/configs/khadas-vim3l_android_ab_defconfig
> @@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
>  CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
>  CONFIG_ARCH_MESON=y
>  CONFIG_TEXT_BASE=0x0100
> +CONFIG_SYS_MALLOC_LEN=0x0800
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
> diff --git a/configs/khadas-vim3l_android_defconfig 
> b/configs/khadas-vim3l_android_defconfig
> index 3fa587ef1db5..206f8defca6b 100644
> --- a/configs/khadas-vim3l_android_defconfig
> +++ b/configs/khadas-vim3l_android_defconfig
> @@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
>  CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
>  CONFIG_ARCH_MESON=y
>  CONFIG_TEXT_BASE=0x0100
> +CONFIG_SYS_MALLOC_LEN=0x0800
>  CONFIG_NR_DRAM_BANKS=1
>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
>
> ---
> base-commit: 076529725f16f07a5cb2d5feba25d62b5f5a5872
> change-id: 20240209-vim3-avb-malloc-aa3de534d6a0
>
> Best regards,
> --
> Mattijs Korpershoek 
>

Reviewed-by: Igor Opaniuk 
-- 
Best regards - Atentamente - Meilleures salutations

Igor Opaniuk

mailto: igor.opan...@gmail.com
skype: igor.opanyuk
http://ua.linkedin.com/in/iopaniuk


Re: [PATCH] configs: khadas-vim3*_android: fix AVB oom error

2024-02-12 Thread Neil Armstrong

On 09/02/2024 09:58, Mattijs Korpershoek wrote:

When booting Android with AVB enabled, an OOM is observed:

   => avb init ${mmcdev}
   => avb verify _a
   ## Android Verified Boot 2.0 version 1.1.0
   read_is_device_unlocked not supported yet
   read_rollback_index not supported yet
   avb_util.c:182: ERROR: Failed to allocate memory.
   OOM error occurred during verification

A custom malloc length of 128MB is required as documented in
commit 285a83b12bdf ("configs: meson64_android: increase SYS_MALLOC_LEN to 128M for 
AVB")

However, this 128M custom malloc length was not ported to Kconfig in
commit 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")

Add it back to fix AVB verification on VIM3/VIM3L.

Fixes: 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")
Co-developed-by: Guillaume La Roque 
Signed-off-by: Guillaume La Roque 
Signed-off-by: Mattijs Korpershoek 
---
  configs/khadas-vim3_android_ab_defconfig  | 1 +
  configs/khadas-vim3_android_defconfig | 1 +
  configs/khadas-vim3l_android_ab_defconfig | 1 +
  configs/khadas-vim3l_android_defconfig| 1 +
  4 files changed, 4 insertions(+)

diff --git a/configs/khadas-vim3_android_ab_defconfig 
b/configs/khadas-vim3_android_ab_defconfig
index b41c2660fff0..ee62fe36d414 100644
--- a/configs/khadas-vim3_android_ab_defconfig
+++ b/configs/khadas-vim3_android_ab_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
  CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
  CONFIG_ARCH_MESON=y
  CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
  CONFIG_NR_DRAM_BANKS=1
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3_android_defconfig 
b/configs/khadas-vim3_android_defconfig
index 88197f5f5e99..cecbe5061793 100644
--- a/configs/khadas-vim3_android_defconfig
+++ b/configs/khadas-vim3_android_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
  CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
  CONFIG_ARCH_MESON=y
  CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
  CONFIG_NR_DRAM_BANKS=1
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3l_android_ab_defconfig 
b/configs/khadas-vim3l_android_ab_defconfig
index 3381d2e92701..ec4e0dc72e22 100644
--- a/configs/khadas-vim3l_android_ab_defconfig
+++ b/configs/khadas-vim3l_android_ab_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
  CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
  CONFIG_ARCH_MESON=y
  CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
  CONFIG_NR_DRAM_BANKS=1
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3l_android_defconfig 
b/configs/khadas-vim3l_android_defconfig
index 3fa587ef1db5..206f8defca6b 100644
--- a/configs/khadas-vim3l_android_defconfig
+++ b/configs/khadas-vim3l_android_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
  CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
  CONFIG_ARCH_MESON=y
  CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
  CONFIG_NR_DRAM_BANKS=1
  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000

---
base-commit: 076529725f16f07a5cb2d5feba25d62b5f5a5872
change-id: 20240209-vim3-avb-malloc-aa3de534d6a0

Best regards,


Reviewed-by: Neil Armstrong 


[PATCH] configs: khadas-vim3*_android: fix AVB oom error

2024-02-09 Thread Mattijs Korpershoek
When booting Android with AVB enabled, an OOM is observed:

  => avb init ${mmcdev}
  => avb verify _a
  ## Android Verified Boot 2.0 version 1.1.0
  read_is_device_unlocked not supported yet
  read_rollback_index not supported yet
  avb_util.c:182: ERROR: Failed to allocate memory.
  OOM error occurred during verification

A custom malloc length of 128MB is required as documented in
commit 285a83b12bdf ("configs: meson64_android: increase SYS_MALLOC_LEN to 128M 
for AVB")

However, this 128M custom malloc length was not ported to Kconfig in
commit 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")

Add it back to fix AVB verification on VIM3/VIM3L.

Fixes: 7cfbba36e9f8 ("Convert CONFIG_SYS_MALLOC_LEN to Kconfig")
Co-developed-by: Guillaume La Roque 
Signed-off-by: Guillaume La Roque 
Signed-off-by: Mattijs Korpershoek 
---
 configs/khadas-vim3_android_ab_defconfig  | 1 +
 configs/khadas-vim3_android_defconfig | 1 +
 configs/khadas-vim3l_android_ab_defconfig | 1 +
 configs/khadas-vim3l_android_defconfig| 1 +
 4 files changed, 4 insertions(+)

diff --git a/configs/khadas-vim3_android_ab_defconfig 
b/configs/khadas-vim3_android_ab_defconfig
index b41c2660fff0..ee62fe36d414 100644
--- a/configs/khadas-vim3_android_ab_defconfig
+++ b/configs/khadas-vim3_android_ab_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
 CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
 CONFIG_ARCH_MESON=y
 CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3_android_defconfig 
b/configs/khadas-vim3_android_defconfig
index 88197f5f5e99..cecbe5061793 100644
--- a/configs/khadas-vim3_android_defconfig
+++ b/configs/khadas-vim3_android_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
 CONFIG_SYS_CONFIG_NAME="khadas-vim3_android"
 CONFIG_ARCH_MESON=y
 CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3l_android_ab_defconfig 
b/configs/khadas-vim3l_android_ab_defconfig
index 3381d2e92701..ec4e0dc72e22 100644
--- a/configs/khadas-vim3l_android_ab_defconfig
+++ b/configs/khadas-vim3l_android_ab_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
 CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
 CONFIG_ARCH_MESON=y
 CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000
diff --git a/configs/khadas-vim3l_android_defconfig 
b/configs/khadas-vim3l_android_defconfig
index 3fa587ef1db5..206f8defca6b 100644
--- a/configs/khadas-vim3l_android_defconfig
+++ b/configs/khadas-vim3l_android_defconfig
@@ -3,6 +3,7 @@ CONFIG_SYS_BOARD="vim3"
 CONFIG_SYS_CONFIG_NAME="khadas-vim3l_android"
 CONFIG_ARCH_MESON=y
 CONFIG_TEXT_BASE=0x0100
+CONFIG_SYS_MALLOC_LEN=0x0800
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x2000

---
base-commit: 076529725f16f07a5cb2d5feba25d62b5f5a5872
change-id: 20240209-vim3-avb-malloc-aa3de534d6a0

Best regards,
-- 
Mattijs Korpershoek