meson64_android: add support for vim3/vim3l boards
v2 cover meson64_android: add support for vim3/vim3l boards
The 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.
[1] https://android.googlesource.com/device/amlogic/yukawa
[2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ
Add defconfigs for both vim3, vim3l to support
traditional and A/B booting/partitioning schemes.
Changes in v2:
* Squashed defconfig changes for initial support
* Split out partitition changes for A/B
v1:
* https://lore.kernel.org/u-boot/[email protected]/T/#t
Mattijs Korpershoek (4):
configs: meson64_android: add board specific env settings
configs: add khadas-vim3{l}_android for AOSP support
configs: prepare khadas-vim3{l}_ab_android for AOSP support
configs: khadas-vim3{l}_android_ab: enable A/B support
board/amlogic/vim3/MAINTAINERS | 4 + configs/khadas-vim3_android_ab_defconfig | 109 ++++++++++++++++++++++ configs/khadas-vim3_android_defconfig | 107 +++++++++++++++++++++ configs/khadas-vim3l_android_ab_defconfig | 109 ++++++++++++++++++++++ configs/khadas-vim3l_android_defconfig | 107 +++++++++++++++++++++ include/configs/khadas-vim3_android.h | 50 ++++++++++ include/configs/khadas-vim3l_android.h | 50 ++++++++++ include/configs/meson64_android.h | 17 ++++ 8 files changed, 553 insertions(+) create mode 100644 configs/khadas-vim3_android_ab_defconfig create mode 100644 configs/khadas-vim3_android_defconfig create mode 100644 configs/khadas-vim3l_android_ab_defconfig create mode 100644 configs/khadas-vim3l_android_defconfig create mode 100644 include/configs/khadas-vim3_android.h create mode 100644 include/configs/khadas-vim3l_android.h
Signature · 1 line
2.32.0
PATCH v2 1/4 configs: meson64_android: add board specific env settings
This allows us to define extra board variables, such as "board" and "board_name".
--- include/configs/meson64_android.h | 5 +++++ 1 file changed, 5 insertions(+)
include/configs/meson64_android.h +5 -0
@@ -23,6 +23,10 @@#define CONTROL_PARTITION "misc"#endif +#ifndef EXTRA_ANDROID_ENV_SETTINGS +#define EXTRA_ANDROID_ENV_SETTINGS "" +#endif +#if defined(CONFIG_CMD_AVB )#define AVB_VERIFY_CHECK \ "if test \"${force_avb}\" -eq 1; then " \
@@ -264,6 +268,7 @@ "fi;"#define CONFIG_EXTRA_ENV_SETTINGS \ + EXTRA_ANDROID_ENV_SETTINGS \ "partitions=" PARTS_DEFAULT "\0" \ "mmcdev=2\0" \ ANDROIDBOOT_GET_CURRENT_SLOT_CMD \
Signature · 1 line
2.32.0
PATCH v2 2/4 configs: add khadas-vim3{l}_android for AOSP support
In reply to Mattijs KorpershoekThe Khadas VIM3 and VIM3L board are well supported in AOSP[1]. However, there is no mainline U-Boot support for it. The U-Boot used in AOSP is based on a vendor tree [2]
Add all the necessary bits to flash and boot Android for both Khadas VIM3 and VIM3L boards.
For Android instructions, refer to [1]
[1] https://source.android.com/setup/build/devices#vim3_and_vim3l_boards
[2] https://gitlab.com/baylibre/amlogic/atv/u-boot
--- board/amlogic/vim3/MAINTAINERS | 2 + configs/khadas-vim3_android_defconfig | 107 +++++++++++++++++++++++++ configs/khadas-vim3l_android_defconfig | 107 +++++++++++++++++++++++++ include/configs/khadas-vim3_android.h | 34 ++++++++ include/configs/khadas-vim3l_android.h | 34 ++++++++ include/configs/meson64_android.h | 12 +++ 6 files changed, 296 insertions(+) create mode 100644 configs/khadas-vim3_android_defconfig create mode 100644 configs/khadas-vim3l_android_defconfig create mode 100644 include/configs/khadas-vim3_android.h create mode 100644 include/configs/khadas-vim3l_android.h
board/amlogic/vim3/MAINTAINERS +2 -0
@@ -4,6 +4,8 @@ S: Maintained L: [email protected] F: board/amlogic/vim3/ F: configs/khadas-vim3_defconfig +F: configs/khadas-vim3_android_defconfig F: configs/khadas-vim3l_defconfig +F: configs/khadas-vim3l_android_defconfig F: doc/board/amlogic/khadas-vim3.rst F: doc/board/amlogic/khadas-vim3l.rst
configs/khadas-vim3_android_defconfig new file +107 -0
107 lines not on this page · raw message
configs/khadas-vim3l_android_defconfig new file +107 -0
107 lines not on this page · raw message
include/configs/khadas-vim3_android.h new file +34 -0
@@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration for the khadas VIM3 Android +* +* Copyright (C) 2021 Baylibre, SAS +* Author: Guillaume LA ROQUE <[email protected]> +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;" +#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;" + +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \ + "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ + "name=dtbo,size=8M,uuid=${uuid_gpt_dtbo};" \ + "name=vbmeta,size=512K,uuid=${uuid_gpt_vbmeta};" \ + "name=boot,size=32M,bootable,uuid=${uuid_gpt_boot};" \ + "name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \ + "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ + "name=super,size=1792M,uuid=${uuid_gpt_super};" \ + "name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ + "name=rootfs,size=-,uuid=" ROOT_UUID + +#define EXTRA_ANDROID_ENV_SETTINGS \ + "board=vim3\0" \ + "board_name=vim3\0" \ + +#include <configs/meson64_android.h> + +#endif /* __CONFIG_H */
include/configs/khadas-vim3l_android.h new file +34 -0
@@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration for the khadas VIM3L Android +* +* Copyright (C) 2021 Baylibre, SAS +* Author: Guillaume LA ROQUE <[email protected]> +*/ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;" +#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;" + +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \ + "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ + "name=dtbo,size=8M,uuid=${uuid_gpt_dtbo};" \ + "name=vbmeta,size=512K,uuid=${uuid_gpt_vbmeta};" \ + "name=boot,size=32M,bootable,uuid=${uuid_gpt_boot};" \ + "name=recovery,size=32M,uuid=${uuid_gpt_recovery};" \ + "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ + "name=super,size=1792M,uuid=${uuid_gpt_super};" \ + "name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ + "name=rootfs,size=-,uuid=" ROOT_UUID + +#define EXTRA_ANDROID_ENV_SETTINGS \ + "board=vim3l\0" \ + "board_name=vim3l\0" \ + +#include <configs/meson64_android.h> + +#endif /* __CONFIG_H */
include/configs/meson64_android.h +12 -0
@@ -104,6 +104,12 @@"elif test $board_name = sei610; then " \"echo \" Reading DTB for sei610...\"; " \"setenv dtb_index 1;" \ +"elif test $board_name = vim3l; then " \ +"echo \" Reading DTB for vim3l...\"; " \ +"setenv dtb_index 2;" \ +"elif test $board_name = vim3; then " \ +"echo \" Reading DTB for vim3...\"; " \ +"setenv dtb_index 3;" \"else " \"echo Error: Android boot is not supported for $board_name; " \"exit; " \
@@ -117,6 +123,12 @@"elif test $board_name = sei610; then " \"echo \" Reading DTBO for sei610...\"; " \"setenv dtbo_index 1;" \ +"elif test $board_name = vim3l; then " \ +"echo \" Reading DTBO for vim3l...\"; " \ +"setenv dtbo_index 2;" \ +"elif test $board_name = vim3; then " \ +"echo \" Reading DTBO for vim3...\"; " \ +"setenv dtbo_index 3;" \"else " \"echo Error: Android boot is not supported for $board_name; " \"exit; " \
Signature · 1 line
2.32.0
PATCH v2 3/4 configs: prepare khadas-vim3{l}_ab_android for AOSP support
In reply to Mattijs KorpershoekIn AOSP, both VIM3 and VIM3L have 2 bootloader flavors, depending on A/B enablement.
For example, for vim3l, the naming is:
- u-boot_kvim3l_noab.bin : legacy support
- u-boot_kvim3l_ab.bin : A/B support
Prepare a defconfig to support u-boot_kvim3_ab.bin and u-boot_kvim3l_ab.bin.
This is identical to khadas-vim3{l}_ab_android but will be updated in the next commit.
Also update partitioning tables for A/B support.
--- board/amlogic/vim3/MAINTAINERS | 2 + configs/khadas-vim3_android_ab_defconfig | 107 ++++++++++++++++++++++ configs/khadas-vim3l_android_ab_defconfig | 107 ++++++++++++++++++++++ include/configs/khadas-vim3_android.h | 16 ++++ include/configs/khadas-vim3l_android.h | 16 ++++ 5 files changed, 248 insertions(+) create mode 100644 configs/khadas-vim3_android_ab_defconfig create mode 100644 configs/khadas-vim3l_android_ab_defconfig
board/amlogic/vim3/MAINTAINERS +2 -0
@@ -5,7 +5,9 @@ L: [email protected] F: board/amlogic/vim3/ F: configs/khadas-vim3_defconfig F: configs/khadas-vim3_android_defconfig +F: configs/khadas-vim3_android_ab_defconfig F: configs/khadas-vim3l_defconfig F: configs/khadas-vim3l_android_defconfig +F: configs/khadas-vim3l_android_ab_defconfig F: doc/board/amlogic/khadas-vim3.rst F: doc/board/amlogic/khadas-vim3l.rst
configs/khadas-vim3_android_ab_defconfig new file +107 -0
107 lines not on this page · raw message
configs/khadas-vim3l_android_ab_defconfig new file +107 -0
107 lines not on this page · raw message
include/configs/khadas-vim3_android.h +16 -0
@@ -12,6 +12,21 @@#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;"#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;" +#if defined(CONFIG_CMD_AB_SELECT ) +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \ + "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ + "name=dtbo_a,size=8M,uuid=${uuid_gpt_dtbo_a};" \ + "name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b};" \ + "name=vbmeta_a,size=512K,uuid=${uuid_gpt_vbmeta_a};" \ + "name=vbmeta_b,size=512K,uuid=${uuid_gpt_vbmeta_b};" \ + "name=boot_a,size=32M,bootable,uuid=${uuid_gpt_boot_a};" \ + "name=boot_b,size=32M,bootable,uuid=${uuid_gpt_boot_b};" \ + "name=super,size=3072M,uuid=${uuid_gpt_super};" \ + "name=userdata,size=11282M,uuid=${uuid_gpt_userdata};" \ + "name=rootfs,size=-,uuid=" ROOT_UUID +#else #define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \
@@ -24,6 +39,7 @@"name=super,size=1792M,uuid=${uuid_gpt_super};" \"name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ "name=rootfs,size=-,uuid=" ROOT_UUID +#endif #define EXTRA_ANDROID_ENV_SETTINGS \ "board=vim3\0" \
include/configs/khadas-vim3l_android.h +16 -0
@@ -12,6 +12,21 @@#define LOGO_UUID "43a3305d-150f-4cc9-bd3b-38fca8693846;"#define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;" +#if defined(CONFIG_CMD_AB_SELECT ) +#define PARTS_DEFAULT \ + "uuid_disk=${uuid_gpt_disk};" \ + "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \ + "name=misc,size=512K,uuid=${uuid_gpt_misc};" \ + "name=dtbo_a,size=8M,uuid=${uuid_gpt_dtbo_a};" \ + "name=dtbo_b,size=8M,uuid=${uuid_gpt_dtbo_b};" \ + "name=vbmeta_a,size=512K,uuid=${uuid_gpt_vbmeta_a};" \ + "name=vbmeta_b,size=512K,uuid=${uuid_gpt_vbmeta_b};" \ + "name=boot_a,size=32M,bootable,uuid=${uuid_gpt_boot_a};" \ + "name=boot_b,size=32M,bootable,uuid=${uuid_gpt_boot_b};" \ + "name=super,size=3072M,uuid=${uuid_gpt_super};" \ + "name=userdata,size=11282M,uuid=${uuid_gpt_userdata};" \ + "name=rootfs,size=-,uuid=" ROOT_UUID +#else #define PARTS_DEFAULT \ "uuid_disk=${uuid_gpt_disk};" \ "name=logo,start=512K,size=2M,uuid=" LOGO_UUID \
@@ -24,6 +39,7 @@"name=super,size=1792M,uuid=${uuid_gpt_super};" \"name=userdata,size=12786M,uuid=${uuid_gpt_userdata};" \ "name=rootfs,size=-,uuid=" ROOT_UUID +#endif #define EXTRA_ANDROID_ENV_SETTINGS \ "board=vim3l\0" \
Signature · 1 line
2.32.0
PATCH v2 4/4 configs: khadas-vim3{l}_android_ab: enable A/B support
In reply to Mattijs Korpershoekmeson64_android.h also relies on CMD_AB_SELECT so enable that as well.
--- configs/khadas-vim3_android_ab_defconfig | 2 ++ configs/khadas-vim3l_android_ab_defconfig | 2 ++ 2 files changed, 4 insertions(+)
configs/khadas-vim3_android_ab_defconfig +2 -0
@@ -17,6 +17,7 @@ CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_MISC_INIT_R=y CONFIG_AVB_VERIFY=y +CONFIG_ANDROID_AB=y # CONFIG_CMD_BDI is not set CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y
@@ -33,6 +34,7 @@ CONFIG_CMD_SPI=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_AB_SELECT=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_AVB=y CONFIG_OF_CONTROL=y
configs/khadas-vim3l_android_ab_defconfig +2 -0
@@ -17,6 +17,7 @@ CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_MISC_INIT_R=y CONFIG_AVB_VERIFY=y +CONFIG_ANDROID_AB=y # CONFIG_CMD_BDI is not set CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y
@@ -33,6 +34,7 @@ CONFIG_CMD_SPI=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_AB_SELECT=y CONFIG_CMD_REGULATOR=y CONFIG_CMD_AVB=y CONFIG_OF_CONTROL=y
Signature · 1 line
2.32.0
Quoted 25 lines · Mattijs Korpershoek
The 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.
[1] https://android.googlesource.com/device/amlogic/yukawa
[2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integAdd defconfigs for both vim3, vim3l to support
traditional and A/B booting/partitioning schemes.Changes in v2:
* Squashed defconfig changes for initial support
* Split out partitition changes for A/Bv1:
* https://lore.kernel.org/u-boot/[email protected]/T/#tMattijs Korpershoek (4):
configs:meson64_android: add board specific env settings
configs: add khadas-vim3{l}_android for AOSP support
configs: prepare khadas-vim3{l}_ab_android for AOSP support
configs: khadas-vim3{l}_android_ab: enable A/B support
Quoted 16 lines
board/amlogic/vim3/MAINTAINERS | 4 + configs/khadas-vim3_android_ab_defconfig | 109 ++++++++++++++++++++++ configs/khadas-vim3_android_defconfig | 107 +++++++++++++++++++++ configs/khadas-vim3l_android_ab_defconfig | 109 ++++++++++++++++++++++ configs/khadas-vim3l_android_defconfig | 107 +++++++++++++++++++++ include/configs/khadas-vim3_android.h | 50 ++++++++++ include/configs/khadas-vim3l_android.h | 50 ++++++++++ include/configs/meson64_android.h | 17 ++++ 8 files changed, 553 insertions(+) create mode 100644 configs/khadas-vim3_android_ab_defconfig create mode 100644 configs/khadas-vim3_android_defconfig create mode 100644 configs/khadas-vim3l_android_ab_defconfig create mode 100644 configs/khadas-vim3l_android_defconfig create mode 100644 include/configs/khadas-vim3_android.h create mode 100644 include/configs/khadas-vim3l_android.h
Applied to u-boot-amlogic
Thanks,
Neil