Re: [PATCH v2 3/5] configs: khadas-vim3l_android{_ab}: move on bootmeth android
Hi Guillaume, Thank you for the patch. On jeu., nov. 14, 2024 at 22:29, Guillaume La Roque <glaroque@...> wrote: Actually khadas vim3l use distro command to boot android image. Move on new bootmeth android for A/B and non-A/B vim3l android.
Signed-off-by: Guillaume La Roque <glaroque@...> --- configs/khadas-vim3l_android_ab_defconfig | 7 ++++++- configs/khadas-vim3l_android_defconfig | 7 ++++++- include/configs/khadas-vim3l_android.h | 26 ++++++++++++++++++++++---- include/configs/meson64_android.h | 3 --- 4 files changed, 34 insertions(+), 9 deletions(-) [...] CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/include/configs/khadas-vim3l_android.h b/include/configs/khadas-vim3l_android.h index f39a3782d663..31068c59d5ed 100644 --- a/include/configs/khadas-vim3l_android.h +++ b/include/configs/khadas-vim3l_android.h @@ -41,10 +41,28 @@ "name=rootfs,size=-,uuid=" ROOT_UUID #endif -#define EXTRA_ANDROID_ENV_SETTINGS \ - "board=vim3l\0" \ - "board_name=vim3l\0" \ +#define CFG_EXTRA_ENV_SETTINGS \ + "board=vim3l\0" \ + "board_name=vim3l\0" \ + "bootmeths=android\0" \ + "bootcmd=bootflow scan\0" \ + "adtb_idx=2\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "mmcdev=2\0" \ + "fastboot_raw_partition_bootloader=0x1 0xfff mmcpart 1\0" \ + "fastboot_raw_partition_bootenv=0x0 0xfff mmcpart 2\0" \ + "gpio_recovery=88\0" \
gpio_recovery is not used anywhere. Can we please drop this? With that addressed, please add: Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> + "stdin=" STDIN_CFG "\0" \ + "stdout=" STDOUT_CFG "\0" \ + "stderr=" STDOUT_CFG "\0" \ + "dtboaddr=0x08200000\0" \ + "loadaddr=0x01080000\0" \ + "fdt_addr_r=0x01000000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x01080000\0" \ + "pxefile_addr_r=0x01080000\0" \ + "ramdisk_addr_r=0x13000000\0" \ -#include <configs/meson64_android.h> +#include <configs/meson64.h> #endif /* __CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 77364bbf9cf0..37ef8b8f7a7e 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -104,9 +104,6 @@ "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;" \
-- 2.34.1
|
Re: [PATCH v2 0/5] Add support of Android Boot Image version 2 and non-AB image
Hi, On 14/11/2024 22:29, Guillaume La Roque wrote: Actually bootmethod android only support android boot image version 4 and with AB image, some old platform wtill use android boot image version 2 with AB or without AB slot. This patchset add support of both version 2 and non-AB slot images. It's fixed in same time a boot issue seen on khadas vim3{l} board with 16GB eMMC patchset was tested on khadas VIM3 and VIM3L with AOSP main branch and android-mainline kernel and with TI AM62P with android release provided by TI. Signed-off-by: Guillaume La Roque <glaroque@...> --- Changes in v2: - Drop patch 3 (configs: khadas-vim3{l}: fix userdata size) already applied - Apply Tested-by and Reviewed-by from v1 - Fix comments - Revert malloc/free for slot_suffix - Remove vim3/vim3l stuff in meson64_android.h - Link to v1: --- Guillaume La Roque (5): bootstd: android: add support of bootimage v2 bootstd: android: add non-A/B image support configs: khadas-vim3l_android{_ab}: move on bootmeth android configs: khadas-vim3_android{_ab}: move on bootmeth android bootstd: Add test for Android boot image v2 arch/sandbox/dts/test.dts | 10 +++- boot/Kconfig | 1 - boot/bootmeth_android.c | 78 +++++++++++++++++++++---------- configs/am62x_a53_android.config | 1 + configs/khadas-vim3_android_ab_defconfig | 7 ++- configs/khadas-vim3_android_defconfig | 7 ++- configs/khadas-vim3l_android_ab_defconfig | 7 ++- configs/khadas-vim3l_android_defconfig | 7 ++- configs/sandbox_defconfig | 1 + include/configs/khadas-vim3_android.h | 26 +++++++++-- include/configs/khadas-vim3l_android.h | 26 +++++++++-- include/configs/meson64_android.h | 6 --- test/boot/bootflow.c | 29 ++++++++++-- test/py/tests/test_ut.py | 49 +++++++++++++++++++ 14 files changed, 208 insertions(+), 47 deletions(-) --- base-commit: ce427e40a2422b75374ee3404e3f5c6536e8984a change-id: 20241015-adnroidv2-a01dca609707 Best regards, To whoever applies this patchset, please take the configs patches at the same time! Neil
|
Re: [PATCH v2 2/5] bootstd: android: add non-A/B image support
Hi Guillaume, Thank you for the patch. On jeu., nov. 14, 2024 at 22:29, Guillaume La Roque <glaroque@...> wrote: Update android bootmeth to support non-A/B image. Enable AB support only when ANDROID_AB is enabled.
Signed-off-by: Guillaume La Roque <glaroque@...> Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> --- boot/Kconfig | 1 - boot/bootmeth_android.c | 51 +++++++++++++++++++++++++++++++++------- configs/am62x_a53_android.config | 1 + configs/sandbox_defconfig | 1 + 4 files changed, 44 insertions(+), 10 deletions(-)
[...]
|
Re: [PATCH v2 4/5] configs: khadas-vim3_android{_ab}: move on bootmeth android
On 14/11/2024 22:29, Guillaume La Roque wrote: Actually khadas vim3 use distro command to boot android image. Move on new bootmeth android for A/B and non-A/B vim3 android. Signed-off-by: Guillaume La Roque <glaroque@...> --- configs/khadas-vim3_android_ab_defconfig | 7 ++++++- configs/khadas-vim3_android_defconfig | 7 ++++++- include/configs/khadas-vim3_android.h | 26 ++++++++++++++++++++++---- include/configs/meson64_android.h | 3 --- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/configs/khadas-vim3_android_ab_defconfig b/configs/khadas-vim3_android_ab_defconfig index de5357c45cbf..a078c5d363ae 100644 --- a/configs/khadas-vim3_android_ab_defconfig +++ b/configs/khadas-vim3_android_ab_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -35,7 +41,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/configs/khadas-vim3_android_defconfig b/configs/khadas-vim3_android_defconfig index a0d9c423c3c3..b77a44ce859b 100644 --- a/configs/khadas-vim3_android_defconfig +++ b/configs/khadas-vim3_android_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -34,7 +40,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/include/configs/khadas-vim3_android.h b/include/configs/khadas-vim3_android.h index 0e2953fe71b3..096ab4e5fb1f 100644 --- a/include/configs/khadas-vim3_android.h +++ b/include/configs/khadas-vim3_android.h @@ -41,10 +41,28 @@ "name=rootfs,size=-,uuid=" ROOT_UUID #endif -#define EXTRA_ANDROID_ENV_SETTINGS \ - "board=vim3\0" \ - "board_name=vim3\0" \ +#define CFG_EXTRA_ENV_SETTINGS \ + "board=vim3\0" \ + "board_name=vim3\0" \ + "bootmeths=android\0" \ + "bootcmd=bootflow scan\0" \ + "adtb_idx=3\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "mmcdev=2\0" \ + "fastboot_raw_partition_bootloader=0x1 0xfff mmcpart 1\0" \ + "fastboot_raw_partition_bootenv=0x0 0xfff mmcpart 2\0" \ + "gpio_recovery=88\0" \ + "stdin=" STDIN_CFG "\0" \ + "stdout=" STDOUT_CFG "\0" \ + "stderr=" STDOUT_CFG "\0" \ + "dtboaddr=0x08200000\0" \ + "loadaddr=0x01080000\0" \ + "fdt_addr_r=0x01000000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x01080000\0" \ + "pxefile_addr_r=0x01080000\0" \ + "ramdisk_addr_r=0x13000000\0" \ -#include <configs/meson64_android.h> +#include <configs/meson64.h> #endif /* __CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 37ef8b8f7a7e..d6ef0a83a686 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -104,9 +104,6 @@ "elif test $board_name = sei610; then " \ "echo \" Reading DTB for sei610...\"; " \ "setenv dtb_index 1;" \ - "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; " \
Acked-by: Neil Armstrong <neil.armstrong@...>
|
Re: [PATCH v2 3/5] configs: khadas-vim3l_android{_ab}: move on bootmeth android
On 14/11/2024 22:29, Guillaume La Roque wrote: Actually khadas vim3l use distro command to boot android image. Move on new bootmeth android for A/B and non-A/B vim3l android. Signed-off-by: Guillaume La Roque <glaroque@...> --- configs/khadas-vim3l_android_ab_defconfig | 7 ++++++- configs/khadas-vim3l_android_defconfig | 7 ++++++- include/configs/khadas-vim3l_android.h | 26 ++++++++++++++++++++++---- include/configs/meson64_android.h | 3 --- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/configs/khadas-vim3l_android_ab_defconfig b/configs/khadas-vim3l_android_ab_defconfig index 4d7b90f23002..43db61056baf 100644 --- a/configs/khadas-vim3l_android_ab_defconfig +++ b/configs/khadas-vim3l_android_ab_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -35,7 +41,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/configs/khadas-vim3l_android_defconfig b/configs/khadas-vim3l_android_defconfig index 4ec27262cdc7..32d57a5b9090 100644 --- a/configs/khadas-vim3l_android_defconfig +++ b/configs/khadas-vim3l_android_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -34,7 +40,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/include/configs/khadas-vim3l_android.h b/include/configs/khadas-vim3l_android.h index f39a3782d663..31068c59d5ed 100644 --- a/include/configs/khadas-vim3l_android.h +++ b/include/configs/khadas-vim3l_android.h @@ -41,10 +41,28 @@ "name=rootfs,size=-,uuid=" ROOT_UUID #endif -#define EXTRA_ANDROID_ENV_SETTINGS \ - "board=vim3l\0" \ - "board_name=vim3l\0" \ +#define CFG_EXTRA_ENV_SETTINGS \ + "board=vim3l\0" \ + "board_name=vim3l\0" \ + "bootmeths=android\0" \ + "bootcmd=bootflow scan\0" \ + "adtb_idx=2\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "mmcdev=2\0" \ + "fastboot_raw_partition_bootloader=0x1 0xfff mmcpart 1\0" \ + "fastboot_raw_partition_bootenv=0x0 0xfff mmcpart 2\0" \ + "gpio_recovery=88\0" \ + "stdin=" STDIN_CFG "\0" \ + "stdout=" STDOUT_CFG "\0" \ + "stderr=" STDOUT_CFG "\0" \ + "dtboaddr=0x08200000\0" \ + "loadaddr=0x01080000\0" \ + "fdt_addr_r=0x01000000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x01080000\0" \ + "pxefile_addr_r=0x01080000\0" \ + "ramdisk_addr_r=0x13000000\0" \ -#include <configs/meson64_android.h> +#include <configs/meson64.h> #endif /* __CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 77364bbf9cf0..37ef8b8f7a7e 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -104,9 +104,6 @@ "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;" \
Acked-by: Neil Armstrong <neil.armstrong@...>
|
Re: [GIT PULL] Please pull u-boot-amlogic-next-20241113
On Wed, Nov 13, 2024 at 06:45:23PM +0100, Neil Armstrong wrote: Hi Tom,
Here's a small fix for khadas-vim3{l} android config, and a drop of obsolete dtsi and include bindings in favor or the upstream ones.
Thanks, Neil
The following changes since commit 56accc56b9aab87ef4809ccc588e1257969cd271:
bios_emulator: fix first argument of pci_{read,write}_config_* function calls (2024-11-04 18:01:58 -0600)
are available in the Git repository at:
tags/u-boot-amlogic-next-20241113
for you to fetch changes up to 1cdb4e03e684d94456dee0cc30c935d7e25b263d:
dt-bindings: interrupt-controller: remove arm-gic.h from include/ (2024-11-13 17:25:07 +0100)
Applied to u-boot/next, thanks! -- Tom
|
Hi there,
I would like to know current status for NAND support in amlogic u-boot. We're using the 2015.xx version provided by the manufacturer and would like to try u-boot-amlogic.
From the status table in linux-meson.com it seems NAND is not supported yet, but it looks like there's been some work on that. I'm interested particularly in the A113X (axg).
Another important feature is whether there would be something equivalent to 'aml-flash-tool' ('update' tool) for flashing the device over USB.
Thanks a lot.
Regards, Juan
|
[PATCH v2 5/5] bootstd: Add test for Android boot image v2
Rename actual android bootmethod test to specify it's for boot image version 4. Add a unit test for testing the Android bootmethod with boot image version 2.
This requires another mmc image (mmc8) to contain the following partitions: - misc: contains the Bootloader Control Block (BCB) - boot_a: contains a fake generic kernel image
we can test this with:
$ ./test/py/test.py --bd sandbox --build -k test_ut # build the mmc8.img $ ./test/py/test.py --bd sandbox --build -k bootflow_android
Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Signed-off-by: Guillaume La Roque <glaroque@...> --- arch/sandbox/dts/test.dts | 10 +++++++++- test/boot/bootflow.c | 29 +++++++++++++++++++++++++--- test/py/tests/test_ut.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index dee280184b1b..36cfbf213e4c 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -44,6 +44,7 @@ mmc5 = "/mmc5"; mmc6 = "/mmc6"; mmc7 = "/mmc7"; + mmc8 = "/mmc8"; pci0 = &pci0; pci1 = &pci1; pci2 = &pci2; @@ -1138,13 +1139,20 @@ filename = "mmc6.img"; }; - /* This is used for Android tests */ + /* This is used for Android boot image v4 tests */ mmc7 { status = "disabled"; compatible = "sandbox,mmc"; filename = "mmc7.img"; }; + /* This is used for Android boot image v2 tests. */ + mmc8 { + status = "disabled"; + compatible = "sandbox,mmc"; + filename = "mmc8.img"; + }; + pch { compatible = "sandbox,pch"; }; diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 9397328609d0..60649886402c 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -1199,8 +1199,8 @@ static int bootflow_cros(struct unit_test_state *uts) } BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE); -/* Test Android bootmeth */ -static int bootflow_android(struct unit_test_state *uts) +/* Test Android bootmeth with boot image version 4 */ +static int bootflow_android_image_v4(struct unit_test_state *uts) { if (!IS_ENABLED(CONFIG_BOOTMETH_ANDROID)) return -EAGAIN; @@ -1220,7 +1220,30 @@ static int bootflow_android(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_android, UTF_CONSOLE); +BOOTSTD_TEST(bootflow_android_image_v4, UTF_CONSOLE); + +/* Test Android bootmeth with boot image version 2 */ +static int bootflow_android_image_v2(struct unit_test_state *uts) +{ + if (!IS_ENABLED(CONFIG_BOOTMETH_ANDROID)) + return -EAGAIN; + + ut_assertok(scan_mmc_android_bootdev(uts, "mmc8")); + ut_assertok(run_command("bootflow list", 0)); + + ut_assert_nextlinen("Showing all"); + ut_assert_nextlinen("Seq"); + ut_assert_nextlinen("---"); + ut_assert_nextlinen(" 0 extlinux"); + ut_assert_nextlinen(" 1 android ready mmc 0 mmc8.bootdev.whole "); + ut_assert_nextlinen("---"); + ut_assert_skip_to_line("(2 bootflows, 2 valid)"); + + ut_assert_console_end(); + + return 0; +} +BOOTSTD_TEST(bootflow_android_image_v2, UTF_CONSOLE); /* Test EFI bootmeth */ static int bootflow_efi(struct unit_test_state *uts) diff --git a/test/py/tests/test_ut.py b/test/py/tests/test_ut.py index 6d44191976bb..7a0bde4da256 100644 --- a/test/py/tests/test_ut.py +++ b/test/py/tests/test_ut.py @@ -501,6 +501,55 @@ def setup_android_image(cons): print(f'wrote to {fname}') + mmc_dev = 8 + fname = os.path.join(cons.config.source_dir, f'mmc{mmc_dev}.img') + u_boot_utils.run_and_log(cons, f'qemu-img create {fname} 20M') + u_boot_utils.run_and_log(cons, f'cgpt create {fname}') + + ptr = 40 + + # Number of sectors in 1MB + sect_size = 512 + sect_1mb = (1 << 20) // sect_size + + required_parts = [ + {'num': 1, 'label':'misc', 'size': '1M'}, + {'num': 2, 'label':'boot_a', 'size': '4M'}, + {'num': 3, 'label':'boot_b', 'size': '4M'}, + ] + + for part in required_parts: + size_str = part['size'] + if 'M' in size_str: + size = int(size_str[:-1]) * sect_1mb + else: + size = int(size_str) + u_boot_utils.run_and_log( + cons, + f"cgpt add -i {part['num']} -b {ptr} -s {size} -l {part['label']} -t basicdata {fname}") + ptr += size + + u_boot_utils.run_and_log(cons, f'cgpt boot -p {fname}') + out = u_boot_utils.run_and_log(cons, f'cgpt show -q {fname}') + + # Create a dict (indexed by partition number) containing the above info + for line in out.splitlines(): + start, size, num, name = line.split(maxsplit=3) + parts[int(num)] = Partition(int(start), int(size), name) + + with open(fname, 'rb') as inf: + disk_data = inf.read() + + test_abootimg.AbootimgTestDiskImage(cons, 'boot.img', test_abootimg.img_hex) + boot_img = os.path.join(cons.config.result_dir, 'boot.img') + with open(boot_img, 'rb') as inf: + set_part_data(2, inf.read()) + + with open(fname, 'wb') as outf: + outf.write(disk_data) + + print(f'wrote to {fname}') + return fname def setup_cedit_file(cons):
-- 2.34.1
|
[PATCH v2 4/5] configs: khadas-vim3_android{_ab}: move on bootmeth android
Actually khadas vim3 use distro command to boot android image. Move on new bootmeth android for A/B and non-A/B vim3 android.
Signed-off-by: Guillaume La Roque <glaroque@...> --- configs/khadas-vim3_android_ab_defconfig | 7 ++++++- configs/khadas-vim3_android_defconfig | 7 ++++++- include/configs/khadas-vim3_android.h | 26 ++++++++++++++++++++++---- include/configs/meson64_android.h | 3 --- 4 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/configs/khadas-vim3_android_ab_defconfig b/configs/khadas-vim3_android_ab_defconfig index de5357c45cbf..a078c5d363ae 100644 --- a/configs/khadas-vim3_android_ab_defconfig +++ b/configs/khadas-vim3_android_ab_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -35,7 +41,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/configs/khadas-vim3_android_defconfig b/configs/khadas-vim3_android_defconfig index a0d9c423c3c3..b77a44ce859b 100644 --- a/configs/khadas-vim3_android_defconfig +++ b/configs/khadas-vim3_android_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -34,7 +40,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/include/configs/khadas-vim3_android.h b/include/configs/khadas-vim3_android.h index 0e2953fe71b3..096ab4e5fb1f 100644 --- a/include/configs/khadas-vim3_android.h +++ b/include/configs/khadas-vim3_android.h @@ -41,10 +41,28 @@ "name=rootfs,size=-,uuid=" ROOT_UUID #endif -#define EXTRA_ANDROID_ENV_SETTINGS \ - "board=vim3\0" \ - "board_name=vim3\0" \ +#define CFG_EXTRA_ENV_SETTINGS \ + "board=vim3\0" \ + "board_name=vim3\0" \ + "bootmeths=android\0" \ + "bootcmd=bootflow scan\0" \ + "adtb_idx=3\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "mmcdev=2\0" \ + "fastboot_raw_partition_bootloader=0x1 0xfff mmcpart 1\0" \ + "fastboot_raw_partition_bootenv=0x0 0xfff mmcpart 2\0" \ + "gpio_recovery=88\0" \ + "stdin=" STDIN_CFG "\0" \ + "stdout=" STDOUT_CFG "\0" \ + "stderr=" STDOUT_CFG "\0" \ + "dtboaddr=0x08200000\0" \ + "loadaddr=0x01080000\0" \ + "fdt_addr_r=0x01000000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x01080000\0" \ + "pxefile_addr_r=0x01080000\0" \ + "ramdisk_addr_r=0x13000000\0" \ -#include <configs/meson64_android.h> +#include <configs/meson64.h> #endif /* __CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 37ef8b8f7a7e..d6ef0a83a686 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -104,9 +104,6 @@ "elif test $board_name = sei610; then " \ "echo \" Reading DTB for sei610...\"; " \ "setenv dtb_index 1;" \ - "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; " \
-- 2.34.1
|
[PATCH v2 3/5] configs: khadas-vim3l_android{_ab}: move on bootmeth android
Actually khadas vim3l use distro command to boot android image. Move on new bootmeth android for A/B and non-A/B vim3l android.
Signed-off-by: Guillaume La Roque <glaroque@...> --- configs/khadas-vim3l_android_ab_defconfig | 7 ++++++- configs/khadas-vim3l_android_defconfig | 7 ++++++- include/configs/khadas-vim3l_android.h | 26 ++++++++++++++++++++++---- include/configs/meson64_android.h | 3 --- 4 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/configs/khadas-vim3l_android_ab_defconfig b/configs/khadas-vim3l_android_ab_defconfig index 4d7b90f23002..43db61056baf 100644 --- a/configs/khadas-vim3l_android_ab_defconfig +++ b/configs/khadas-vim3l_android_ab_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -35,7 +41,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/configs/khadas-vim3l_android_defconfig b/configs/khadas-vim3l_android_defconfig index 4ec27262cdc7..32d57a5b9090 100644 --- a/configs/khadas-vim3l_android_defconfig +++ b/configs/khadas-vim3l_android_defconfig @@ -24,6 +24,12 @@ CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_FIT_VERBOSE=y +CONFIG_BOOTMETH_ANDROID=y +# CONFIG_BOOTMETH_EXTLINUX is not set +# CONFIG_BOOTMETH_EXTLINUX_PXE is not set +# CONFIG_BOOTMETH_EFILOADER is not set +# CONFIG_BOOTMETH_EFI_BOOTMGR is not set +# CONFIG_BOOTMETH_VBE is not set CONFIG_LEGACY_IMAGE_FORMAT=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set @@ -34,7 +40,6 @@ CONFIG_SYS_MAXARGS=32 CONFIG_CMD_ADTIMG=y CONFIG_CMD_ABOOTIMG=y # CONFIG_CMD_IMI is not set -CONFIG_CMD_BCB=y CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y diff --git a/include/configs/khadas-vim3l_android.h b/include/configs/khadas-vim3l_android.h index f39a3782d663..31068c59d5ed 100644 --- a/include/configs/khadas-vim3l_android.h +++ b/include/configs/khadas-vim3l_android.h @@ -41,10 +41,28 @@ "name=rootfs,size=-,uuid=" ROOT_UUID #endif -#define EXTRA_ANDROID_ENV_SETTINGS \ - "board=vim3l\0" \ - "board_name=vim3l\0" \ +#define CFG_EXTRA_ENV_SETTINGS \ + "board=vim3l\0" \ + "board_name=vim3l\0" \ + "bootmeths=android\0" \ + "bootcmd=bootflow scan\0" \ + "adtb_idx=2\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "mmcdev=2\0" \ + "fastboot_raw_partition_bootloader=0x1 0xfff mmcpart 1\0" \ + "fastboot_raw_partition_bootenv=0x0 0xfff mmcpart 2\0" \ + "gpio_recovery=88\0" \ + "stdin=" STDIN_CFG "\0" \ + "stdout=" STDOUT_CFG "\0" \ + "stderr=" STDOUT_CFG "\0" \ + "dtboaddr=0x08200000\0" \ + "loadaddr=0x01080000\0" \ + "fdt_addr_r=0x01000000\0" \ + "scriptaddr=0x08000000\0" \ + "kernel_addr_r=0x01080000\0" \ + "pxefile_addr_r=0x01080000\0" \ + "ramdisk_addr_r=0x13000000\0" \ -#include <configs/meson64_android.h> +#include <configs/meson64.h> #endif /* __CONFIG_H */ diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 77364bbf9cf0..37ef8b8f7a7e 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -104,9 +104,6 @@ "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;" \
-- 2.34.1
|
[PATCH v2 2/5] bootstd: android: add non-A/B image support
Update android bootmeth to support non-A/B image. Enable AB support only when ANDROID_AB is enabled.
Signed-off-by: Guillaume La Roque <glaroque@...> --- boot/Kconfig | 1 - boot/bootmeth_android.c | 51 +++++++++++++++++++++++++++++++++------- configs/am62x_a53_android.config | 1 + configs/sandbox_defconfig | 1 + 4 files changed, 44 insertions(+), 10 deletions(-)
diff --git a/boot/Kconfig b/boot/Kconfig index 7dd30a030e39..661e89ca05b2 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -500,7 +500,6 @@ config BOOTMETH_ANDROID bool "Bootdev support for Android" depends on X86 || ARM || SANDBOX depends on CMDLINE - select ANDROID_AB select ANDROID_BOOT_IMAGE select CMD_BCB imply CMD_FASTBOOT diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c index 2e7f85e4a708..2aac32331d3c 100644 --- a/boot/bootmeth_android.c +++ b/boot/bootmeth_android.c @@ -29,6 +29,7 @@ #define BCB_PART_NAME "misc" #define BOOT_PART_NAME "boot" #define VENDOR_BOOT_PART_NAME "vendor_boot" +#define SLOT_LEN 2 /** * struct android_priv - Private data @@ -42,7 +43,7 @@ */ struct android_priv { enum android_boot_mode boot_mode; - char slot[2]; + char *slot; u32 header_version; }; @@ -71,7 +72,11 @@ static int scan_boot_part(struct udevice *blk, struct android_priv *priv) char *buf; int ret; - sprintf(partname, BOOT_PART_NAME "_%s", priv->slot); + if (priv->slot) + sprintf(partname, BOOT_PART_NAME "_%s", priv->slot); + else + sprintf(partname, BOOT_PART_NAME); + ret = part_get_info_by_name(desc, partname, &partition); if (ret < 0) return log_msg_ret("part info", ret); @@ -108,7 +113,11 @@ static int scan_vendor_boot_part(struct udevice *blk, struct android_priv *priv) char *buf; int ret; - sprintf(partname, VENDOR_BOOT_PART_NAME "_%s", priv->slot); + if (priv->slot) + sprintf(partname, VENDOR_BOOT_PART_NAME "_%s", priv->slot); + else + sprintf(partname, VENDOR_BOOT_PART_NAME); + ret = part_get_info_by_name(desc, partname, &partition); if (ret < 0) return log_msg_ret("part info", ret); @@ -142,6 +151,11 @@ static int android_read_slot_from_bcb(struct bootflow *bflow, bool decrement) char slot_suffix[3]; int ret; + if (!CONFIG_IS_ENABLED(ANDROID_AB)) { + priv->slot = NULL; + return 0; + } + ret = part_get_info_by_name(desc, BCB_PART_NAME, &misc); if (ret < 0) return log_msg_ret("part", ret); @@ -150,6 +164,7 @@ static int android_read_slot_from_bcb(struct bootflow *bflow, bool decrement) if (ret < 0) return log_msg_ret("slot", ret); + priv->slot = malloc(SLOT_LEN); priv->slot[0] = BOOT_SLOT_NAME(ret); priv->slot[1] = '\0'; @@ -274,7 +289,7 @@ static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow) configure_serialno(bflow); configure_bootloader_version(bflow); - if (priv->boot_mode == ANDROID_BOOT_MODE_NORMAL) { + if (priv->boot_mode == ANDROID_BOOT_MODE_NORMAL && priv->slot) { ret = bootflow_cmdline_set_arg(bflow, "androidboot.force_normal_boot", "1", false); if (ret < 0) { @@ -323,14 +338,28 @@ static int read_slotted_partition(struct blk_desc *desc, const char *const name, { struct disk_partition partition; char partname[PART_NAME_LEN]; + size_t partname_len; int ret; u32 n; - /* Ensure name fits in partname it should be: <name>_<slot>\0 */ - if (strlen(name) > (PART_NAME_LEN - 2 - 1)) + /* + * Ensure name fits in partname. + * For A/B, it should be <name>_<slot>\0 + * For non A/B, it should be <name>\0 + */ + if (CONFIG_IS_ENABLED(ANDROID_AB)) + partname_len = PART_NAME_LEN - 2 - 1; + else + partname_len = PART_NAME_LEN - 1; + + if (strlen(name) > partname_len) return log_msg_ret("name too long", -EINVAL); - sprintf(partname, "%s_%s", name, slot); + if (slot) + sprintf(partname, "%s_%s", name, slot); + else + sprintf(partname, "%s", name); + ret = part_get_info_by_name(desc, partname, &partition); if (ret < 0) return log_msg_ret("part", ret); @@ -382,7 +411,7 @@ static int run_avb_verification(struct bootflow *bflow) AvbSlotVerifyData *out_data; enum avb_boot_state boot_state; char *extra_args; - char slot_suffix[3]; + char slot_suffix[3] = ""; bool unlocked = false; int ret; @@ -390,7 +419,8 @@ static int run_avb_verification(struct bootflow *bflow) if (!avb_ops) return log_msg_ret("avb ops", -ENOMEM); - sprintf(slot_suffix, "_%s", priv->slot); + if (priv->slot) + sprintf(slot_suffix, "_%s", priv->slot); ret = avb_ops->read_is_device_unlocked(avb_ops, &unlocked); if (ret != AVB_IO_RESULT_OK) @@ -480,6 +510,9 @@ static int boot_android_normal(struct bootflow *bflow) } set_abootimg_addr(loadaddr); + if (priv->slot) + free(priv->slot); + ret = bootm_boot_start(loadaddr, bflow->cmdline); return log_msg_ret("boot", ret); diff --git a/configs/am62x_a53_android.config b/configs/am62x_a53_android.config index adbe2b8e126f..2aca51e3a107 100644 --- a/configs/am62x_a53_android.config +++ b/configs/am62x_a53_android.config @@ -11,6 +11,7 @@ CONFIG_RANDOM_UUID=y # Needed for FASTBOOT_CMD_OEM_FORMAT CONFIG_FASTBOOT_CMD_OEM_FORMAT=y # Enable Android boot flow CONFIG_BOOTMETH_ANDROID=y +CONFIG_ANDROID_AB=y CONFIG_SYS_BOOTM_LEN=0x4000000 CONFIG_SYS_MALLOC_LEN=0x08000000 CONFIG_AVB_VERIFY=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index d111858082d5..6b8dedf20712 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -50,6 +50,7 @@ CONFIG_LOG_DEFAULT_LEVEL=6 CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_STACKPROTECTOR=y +CONFIG_ANDROID_AB=y CONFIG_CMD_CPU=y CONFIG_CMD_LICENSE=y CONFIG_CMD_SMBIOS=y
-- 2.34.1
|
[PATCH v2 0/5] Add support of Android Boot Image version 2 and non-AB image
Actually bootmethod android only support android boot image version 4 and with AB image, some old platform wtill use android boot image version 2 with AB or without AB slot.
This patchset add support of both version 2 and non-AB slot images. It's fixed in same time a boot issue seen on khadas vim3{l} board with 16GB eMMC
patchset was tested on khadas VIM3 and VIM3L with AOSP main branch and android-mainline kernel and with TI AM62P with android release provided by TI.
Signed-off-by: Guillaume La Roque <glaroque@...> --- Changes in v2: - Drop patch 3 (configs: khadas-vim3{l}: fix userdata size) already applied - Apply Tested-by and Reviewed-by from v1 - Fix comments - Revert malloc/free for slot_suffix - Remove vim3/vim3l stuff in meson64_android.h - Link to v1:
--- Guillaume La Roque (5): bootstd: android: add support of bootimage v2 bootstd: android: add non-A/B image support configs: khadas-vim3l_android{_ab}: move on bootmeth android configs: khadas-vim3_android{_ab}: move on bootmeth android bootstd: Add test for Android boot image v2
arch/sandbox/dts/test.dts | 10 +++- boot/Kconfig | 1 - boot/bootmeth_android.c | 78 +++++++++++++++++++++---------- configs/am62x_a53_android.config | 1 + configs/khadas-vim3_android_ab_defconfig | 7 ++- configs/khadas-vim3_android_defconfig | 7 ++- configs/khadas-vim3l_android_ab_defconfig | 7 ++- configs/khadas-vim3l_android_defconfig | 7 ++- configs/sandbox_defconfig | 1 + include/configs/khadas-vim3_android.h | 26 +++++++++-- include/configs/khadas-vim3l_android.h | 26 +++++++++-- include/configs/meson64_android.h | 6 --- test/boot/bootflow.c | 29 ++++++++++-- test/py/tests/test_ut.py | 49 +++++++++++++++++++ 14 files changed, 208 insertions(+), 47 deletions(-) --- base-commit: ce427e40a2422b75374ee3404e3f5c6536e8984a change-id: 20241015-adnroidv2-a01dca609707
Best regards, -- Guillaume La Roque <glaroque@...>
|
[PATCH v2 1/5] bootstd: android: add support of bootimage v2
Android bootmeth only support boot image v3/4.
Add support of Android Boot Image version 2 [1]. Vendor boot image is only supported in version 3 and 4 so don't try to read it when header version is less than 3.
[1]
Tested-by: Julien Masson <jmasson@...> Reviewed-by: Mattijs Korpershoek <mkorpershoek@...> Signed-off-by: Guillaume La Roque <glaroque@...> --- boot/bootmeth_android.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/boot/bootmeth_android.c b/boot/bootmeth_android.c index 19b1f2c377b9..2e7f85e4a708 100644 --- a/boot/bootmeth_android.c +++ b/boot/bootmeth_android.c @@ -259,16 +259,12 @@ static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow) goto free_priv; } - if (priv->header_version != 4) { - log_debug("only boot.img v4 is supported %u\n", priv->header_version); - ret = -EINVAL; - goto free_priv; - } - - ret = scan_vendor_boot_part(bflow->blk, priv); - if (ret < 0) { - log_debug("scan vendor_boot failed: err=%d\n", ret); - goto free_priv; + if (priv->header_version >= 3) { + ret = scan_vendor_boot_part(bflow->blk, priv); + if (ret < 0) { + log_debug("scan vendor_boot failed: err=%d\n", ret); + goto free_priv; + } } /* @@ -476,12 +472,13 @@ static int boot_android_normal(struct bootflow *bflow) if (ret < 0) return log_msg_ret("read boot", ret); - ret = read_slotted_partition(desc, "vendor_boot", priv->slot, vloadaddr); - if (ret < 0) - return log_msg_ret("read vendor_boot", ret); - + if (priv->header_version >= 3) { + ret = read_slotted_partition(desc, "vendor_boot", priv->slot, vloadaddr); + if (ret < 0) + return log_msg_ret("read vendor_boot", ret); + set_avendor_bootimg_addr(vloadaddr); + } set_abootimg_addr(loadaddr); - set_avendor_bootimg_addr(vloadaddr); ret = bootm_boot_start(loadaddr, bflow->cmdline);
-- 2.34.1
|
[GIT PULL] Please pull u-boot-amlogic-next-20241113
Hi Tom,
Here's a small fix for khadas-vim3{l} android config, and a drop of obsolete dtsi and include bindings in favor or the upstream ones.
Thanks, Neil
The following changes since commit 56accc56b9aab87ef4809ccc588e1257969cd271:
bios_emulator: fix first argument of pci_{read,write}_config_* function calls (2024-11-04 18:01:58 -0600)
are available in the Git repository at:
tags/u-boot-amlogic-next-20241113
for you to fetch changes up to 1cdb4e03e684d94456dee0cc30c935d7e25b263d:
dt-bindings: interrupt-controller: remove arm-gic.h from include/ (2024-11-13 17:25:07 +0100)
---------------------------------------------------------------- - khadas-vim3{l}: fix userdata size for android config - drop A1 dtsi and other bindings includes in favor of Upstream ones
---------------------------------------------------------------- Alexey Romanov (4): arm: dts: meson: remove meson-a1.dtsi dt-bindings: remove a1 bindings from include/ dt-bindings: remove axg bindings from include/ dt-bindings: interrupt-controller: remove arm-gic.h from include/
Guillaume La Roque (1): configs: khadas-vim3{l}: fix userdata size
arch/arm/dts/meson-a1.dtsi | 518 --------------------- include/configs/khadas-vim3_android.h | 4 +- include/configs/khadas-vim3l_android.h | 4 +- .../clock/amlogic,a1-peripherals-clkc.h | 168 ------- include/dt-bindings/clock/amlogic,a1-pll-clkc.h | 25 - include/dt-bindings/clock/axg-audio-clkc.h | 94 ---- include/dt-bindings/clock/axg-clkc.h | 100 ---- include/dt-bindings/gpio/meson-a1-gpio.h | 73 --- include/dt-bindings/interrupt-controller/arm-gic.h | 23 - include/dt-bindings/power/meson-a1-power.h | 32 -- include/dt-bindings/reset/amlogic,meson-a1-reset.h | 76 --- 11 files changed, 4 insertions(+), 1113 deletions(-) delete mode 100644 arch/arm/dts/meson-a1.dtsi delete mode 100644 include/dt-bindings/clock/amlogic,a1-peripherals-clkc.h delete mode 100644 include/dt-bindings/clock/amlogic,a1-pll-clkc.h delete mode 100644 include/dt-bindings/clock/axg-audio-clkc.h delete mode 100644 include/dt-bindings/clock/axg-clkc.h delete mode 100644 include/dt-bindings/gpio/meson-a1-gpio.h delete mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h delete mode 100644 include/dt-bindings/power/meson-a1-power.h delete mode 100644 include/dt-bindings/reset/amlogic,meson-a1-reset.h
|
Re: [PATCH v1 0/4] Remove legacy Amlogic dtsi and bindings
From: Neil Armstrong <neil.armstrong@...> Hi, On Tue, 12 Nov 2024 15:58:32 +0300, Alexey Romanov wrote: We should remove bindings and dtsi from include/ folder for A1 and AXG Amlogic devices. We have exactly the same, or with minor differences in dts/upstream folder.
I tested this changes on devices closes to reference A1 and AXG SoCs devices and didn't receive any problems.
[...] Thanks, Applied to (u-boot-amlogic) [1/4] arm: dts: meson: remove meson-a1.dtsi [2/4] dt-bindings: remove a1 bindings from include/ [3/4] dt-bindings: remove axg bindings from include/ [4/4] dt-bindings: interrupt-controller: remove arm-gic.h from include/ -- Neil
|
Re: [PATCH v5 6/6] common: android_ab: fix slot suffix for abc block
On Wed, Nov 6, 2024 at 4:02?AM Mattijs Korpershoek <mkorpershoek@...> wrote: Hi Sam,
On mar., nov. 05, 2024 at 18:58, Sam Protsenko <semen.protsenko@...> wrote:
On Tue, Nov 5, 2024 at 9:06?AM Mattijs Korpershoek <mkorpershoek@...> wrote:
Hi Sam,
Hey Mattijs,
[snip]
@@ -328,7 +328,8 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, * or the device tree. */ memset(slot_suffix, 0, sizeof(slot_suffix)); - slot_suffix[0] = BOOT_SLOT_NAME(slot); + slot_suffix[0] = '_'; + slot_suffix[1] = BOOT_SLOT_NAME(slot); AFAIU, this changes the behavior of two above functions, and consequently of "bcb ab_select" command? If so, just to double check: were all users of those reworked correspondingly? I can see next occurrences (there may be more):
$ grep -sIrHn '"_' boot/bootmeth_android.c I thought the same when first reviewing the patch. Looking a bit closer...
boot/bootmeth_android.c:74: sprintf(partname, BOOT_PART_NAME "_%s", priv->slot); boot/bootmeth_android.c:111: sprintf(partname, VENDOR_BOOT_PART_NAME "_%s", priv->slot); boot/bootmeth_android.c:156: sprintf(slot_suffix, "_%s", priv->slot); boot/bootmeth_android.c:397: sprintf(slot_suffix, "_%s", priv->slot); ... We can see that ab_select_slot() returns an integer That integer is used later on to initialize priv->slot:
""" priv->slot[0] = BOOT_SLOT_NAME(ret); priv->slot[1] = '\0'; """
The change from Dmitry only changes what we **write** to the BCB (into the misc partition), not what is returned by ab_select_slot().
Sure. Just wanted to double check that the behavior is not changed in any related parts, as the commit message doesn't mention that. Btw, BCB is an interface between the bootloader and AOSP, so if this patch changes what's being written into BCB, does it affect AOSP part of it somehow? Especially for already existing devices with particular BCB data, in case U-Boot gets updated there. Those are valid concerns.
Per my understanding, on recent Android versions the slot suffix is not read from BCB, but from the ro.boot.slot_suffix property:
That probably still leaves the possible combination of some devices running new U-Boot versions (with this patch applied) together with older Android versions. E.g. in case when U-Boot is updated but Android isn't, may be especially relevant for some dev boards out there. """ // Initialize the current_slot from the read-only property. If the property // was not set (from either the command line or the device tree), we can later // initialize it from the bootloader_control struct. So even in recent Android versions it's being initialized from BCB in case the property is not set. std::string suffix_prop = android::base::GetProperty("ro.boot.slot_suffix", ""); if (suffix_prop.empty()) { LOG(ERROR) << "Slot suffix property is not set"; return false; } current_slot_ = SlotSuffixToIndex(suffix_prop.c_str()); """
See: ;l=185;drc=86b8f575059a1799c760ca7012f540a528d68a9d;bpv=1;bpt=1
This has been the case since 2019.
If we look at earlier implementations of libboot_control (which was in bootable/recovery)
So implementations before 2019 that do not have this patch:
Will get the slot suffix from the BCB (not from the commandline)
For these older implementations, we will go through the following: BootControl::Init() LoadBootloaderControl(device.c_str(), &boot_ctrl) android::base::ReadFully(fd.get(), buffer, sizeof(bootloader_control)
And struct bootloader_control has:
struct bootloader_control { // NUL terminated active slot suffix. char slot_suffix[4];
And if we look at how the BCB is initialized from userspace in: ;l=120;drc=86b8f575059a1799c760ca7012f540a528d68a9d
We can see that we copy _a, not a (for example, if slot == 0).
So I think this is fine.
If needed, I can dig more for behaviour on older devices (<2019), let me know!
My point is, if it's possible to introduce this change but keep the same old behavior (across both U-Boot and AOSP), it's usually better to do that that way. If I'm not missing anything and that's a valid concern, maybe a separate patch can be developed on top of the merged patch series handling that. Anyways, I don't have enough time to work on this right now, so just pointing out what I noticed, if it's useful for anybody. I'll let the maintainers decide :) Thanks!
ab_select_slot() still returns an integer which needs to be converted via the BOOT_SLOT_NAME() macro.
$ grep -sIrHn 'slot_suffix _' include/configs/ include/configs/ti_omap5_common.h:107: "setenv slot_suffix _${slot_name};" include/configs/meson64_android.h:65: "setenv slot_suffix _${current_slot}; " \ Same goes for these 2 examples, we use: The "bcb ab_select current_slot" command to store the slot into the "current_slot" environment variable. Looking at cmd/bcb.c we can see:
""" ret = ab_select_slot(dev_desc, &part_info, dec_tries); if (ret < 0) { printf("Android boot failed, error %d.\n", ret); return CMD_RET_FAILURE; }
/* Android standard slot names are 'a', 'b', ... */ slot[0] = BOOT_SLOT_NAME(ret); slot[1] = '\0'; env_set(argv[1], slot); printf("ANDROID: Booting slot: %s\n", slot); """
So I think this is fine.
[snip]
|
Re: [PATCH v5 6/6] common: android_ab: fix slot suffix for abc block
On Tue, Nov 5, 2024 at 9:06?AM Mattijs Korpershoek <mkorpershoek@...> wrote: Hi Sam,
Hey Mattijs, [snip] @@ -328,7 +328,8 @@ int ab_select_slot(struct blk_desc *dev_desc, struct disk_partition *part_info, * or the device tree. */ memset(slot_suffix, 0, sizeof(slot_suffix)); - slot_suffix[0] = BOOT_SLOT_NAME(slot); + slot_suffix[0] = '_'; + slot_suffix[1] = BOOT_SLOT_NAME(slot); AFAIU, this changes the behavior of two above functions, and consequently of "bcb ab_select" command? If so, just to double check: were all users of those reworked correspondingly? I can see next occurrences (there may be more):
$ grep -sIrHn '"_' boot/bootmeth_android.c I thought the same when first reviewing the patch. Looking a bit closer...
boot/bootmeth_android.c:74: sprintf(partname, BOOT_PART_NAME "_%s", priv->slot); boot/bootmeth_android.c:111: sprintf(partname, VENDOR_BOOT_PART_NAME "_%s", priv->slot); boot/bootmeth_android.c:156: sprintf(slot_suffix, "_%s", priv->slot); boot/bootmeth_android.c:397: sprintf(slot_suffix, "_%s", priv->slot); ... We can see that ab_select_slot() returns an integer That integer is used later on to initialize priv->slot:
""" priv->slot[0] = BOOT_SLOT_NAME(ret); priv->slot[1] = '\0'; """
The change from Dmitry only changes what we **write** to the BCB (into the misc partition), not what is returned by ab_select_slot().
Sure. Just wanted to double check that the behavior is not changed in any related parts, as the commit message doesn't mention that. Btw, BCB is an interface between the bootloader and AOSP, so if this patch changes what's being written into BCB, does it affect AOSP part of it somehow? Especially for already existing devices with particular BCB data, in case U-Boot gets updated there. ab_select_slot() still returns an integer which needs to be converted via the BOOT_SLOT_NAME() macro.
$ grep -sIrHn 'slot_suffix _' include/configs/ include/configs/ti_omap5_common.h:107: "setenv slot_suffix _${slot_name};" include/configs/meson64_android.h:65: "setenv slot_suffix _${current_slot}; " \ Same goes for these 2 examples, we use: The "bcb ab_select current_slot" command to store the slot into the "current_slot" environment variable. Looking at cmd/bcb.c we can see:
""" ret = ab_select_slot(dev_desc, &part_info, dec_tries); if (ret < 0) { printf("Android boot failed, error %d.\n", ret); return CMD_RET_FAILURE; }
/* Android standard slot names are 'a', 'b', ... */ slot[0] = BOOT_SLOT_NAME(ret); slot[1] = '\0'; env_set(argv[1], slot); printf("ANDROID: Booting slot: %s\n", slot); """
So I think this is fine.
[snip]
|
[PATCH v1 4/4] dt-bindings: interrupt-controller: remove arm-gic.h from include/
We have exactly the same in upstream bindings.
Signed-off-by: Alexey Romanov <avromanov@...> --- .../interrupt-controller/arm-gic.h | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h
diff --git a/include/dt-bindings/interrupt-controller/arm-gic.h b/include/dt-bindings/interrupt-controller/arm-gic.h deleted file mode 100644 index 35b6f69b7d..0000000000 --- a/include/dt-bindings/interrupt-controller/arm-gic.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 OR MIT */ -/* - * This header provides constants for the ARM GIC. - */ - -#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H -#define _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H - -#include <dt-bindings/interrupt-controller/irq.h> - -/* interrupt specifier cell 0 */ - -#define GIC_SPI 0 -#define GIC_PPI 1 - -/* - * Interrupt specifier cell 2. - * The flags in irq.h are valid, plus those below. - */ -#define GIC_CPU_MASK_RAW(x) ((x) << 8) -#define GIC_CPU_MASK_SIMPLE(num) GIC_CPU_MASK_RAW((1 << (num)) - 1) - -#endif -- 2.34.1
|
[PATCH v1 1/4] arm: dts: meson: remove meson-a1.dtsi
For Amlogic A1, we have to use dtsi from dts/upstream folder. The only difference between this two files is the added cpu temperature node definition in upstream version and additional assigned-clock for USB. This patch is tested on a device with A113L SoC (AD401-like) and everything is okay.
So, we can remove legacy arch/arm/dts/meson-a1.dtsi file.
Signed-off-by: Alexey Romanov <avromanov@...> --- arch/arm/dts/meson-a1.dtsi | 518 ------------------------------------- 1 file changed, 518 deletions(-) delete mode 100644 arch/arm/dts/meson-a1.dtsi
diff --git a/arch/arm/dts/meson-a1.dtsi b/arch/arm/dts/meson-a1.dtsi deleted file mode 100644 index 648e7f4942..0000000000 --- a/arch/arm/dts/meson-a1.dtsi +++ /dev/null @@ -1,518 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/* - * Copyright (c) 2019 Amlogic, Inc. All rights reserved. - */ - -#include <dt-bindings/clock/amlogic,a1-pll-clkc.h> -#include <dt-bindings/clock/amlogic,a1-peripherals-clkc.h> -#include <dt-bindings/gpio/meson-a1-gpio.h> -#include <dt-bindings/interrupt-controller/arm-gic.h> -#include <dt-bindings/interrupt-controller/irq.h> -#include <dt-bindings/power/meson-a1-power.h> -#include <dt-bindings/reset/amlogic,meson-a1-reset.h> - -/ { - compatible = "amlogic,a1"; - - interrupt-parent = <&gic>; - #address-cells = <2>; - #size-cells = <2>; - - cpus { - #address-cells = <2>; - #size-cells = <0>; - - cpu0: cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a35"; - reg = <0x0 0x0>; - enable-method = "psci"; - next-level-cache = <&l2>; - }; - - cpu1: cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a35"; - reg = <0x0 0x1>; - enable-method = "psci"; - next-level-cache = <&l2>; - }; - - l2: l2-cache0 { - compatible = "cache"; - cache-level = <2>; - cache-unified; - }; - }; - - efuse: efuse { - compatible = "amlogic,meson-gxbb-efuse"; - clocks = <&clkc_periphs CLKID_OTP>; - #address-cells = <1>; - #size-cells = <1>; - secure-monitor = <&sm>; - power-domains = <&pwrc PWRC_OTP_ID>; - }; - - psci { - compatible = "arm,psci-1.0"; - method = "smc"; - }; - - reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - linux,cma { - compatible = "shared-dma-pool"; - reusable; - size = <0x0 0x800000>; - alignment = <0x0 0x400000>; - linux,cma-default; - }; - }; - - sm: secure-monitor { - compatible = "amlogic,meson-gxbb-sm"; - - pwrc: power-controller { - compatible = "amlogic,meson-a1-pwrc"; - #power-domain-cells = <1>; - }; - }; - - soc { - compatible = "simple-bus"; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - spifc: spi@fd000400 { - compatible = "amlogic,a1-spifc"; - reg = <0x0 0xfd000400 0x0 0x290>; - clocks = <&clkc_periphs CLKID_SPIFC>; - #address-cells = <1>; - #size-cells = <0>; - power-domains = <&pwrc PWRC_SPIFC_ID>; - status = "disabled"; - }; - - apb: bus@fe000000 { - compatible = "simple-bus"; - reg = <0x0 0xfe000000 0x0 0x1000000>; - #address-cells = <2>; - #size-cells = <2>; - ranges = <0x0 0x0 0x0 0xfe000000 0x0 0x1000000>; - - reset: reset-controller@0 { - compatible = "amlogic,meson-a1-reset"; - reg = <0x0 0x0 0x0 0x8c>; - #reset-cells = <1>; - }; - - periphs_pinctrl: pinctrl@400 { - compatible = "amlogic,meson-a1-periphs-pinctrl"; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - gpio: bank@400 { - reg = <0x0 0x0400 0x0 0x003c>, - <0x0 0x0480 0x0 0x0118>; - reg-names = "mux", "gpio"; - gpio-controller; - #gpio-cells = <2>; - gpio-ranges = <&periphs_pinctrl 0 0 62>; - }; - - i2c0_f11_pins: i2c0-f11 { - mux { - groups = "i2c0_sck_f11", - "i2c0_sda_f12"; - function = "i2c0"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c0_f9_pins: i2c0-f9 { - mux { - groups = "i2c0_sck_f9", - "i2c0_sda_f10"; - function = "i2c0"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c1_x_pins: i2c1-x { - mux { - groups = "i2c1_sck_x", - "i2c1_sda_x"; - function = "i2c1"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c1_a_pins: i2c1-a { - mux { - groups = "i2c1_sck_a", - "i2c1_sda_a"; - function = "i2c1"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c2_x0_pins: i2c2-x0 { - mux { - groups = "i2c2_sck_x0", - "i2c2_sda_x1"; - function = "i2c2"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c2_x15_pins: i2c2-x15 { - mux { - groups = "i2c2_sck_x15", - "i2c2_sda_x16"; - function = "i2c2"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c2_a4_pins: i2c2-a4 { - mux { - groups = "i2c2_sck_a4", - "i2c2_sda_a5"; - function = "i2c2"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c2_a8_pins: i2c2-a8 { - mux { - groups = "i2c2_sck_a8", - "i2c2_sda_a9"; - function = "i2c2"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c3_x_pins: i2c3-x { - mux { - groups = "i2c3_sck_x", - "i2c3_sda_x"; - function = "i2c3"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - i2c3_f_pins: i2c3-f { - mux { - groups = "i2c3_sck_f", - "i2c3_sda_f"; - function = "i2c3"; - bias-pull-up; - drive-strength-microamp = <3000>; - }; - }; - - uart_a_pins: uart-a { - mux { - groups = "uart_a_tx", - "uart_a_rx"; - function = "uart_a"; - }; - }; - - uart_a_cts_rts_pins: uart-a-cts-rts { - mux { - groups = "uart_a_cts", - "uart_a_rts"; - function = "uart_a"; - bias-pull-down; - }; - }; - - sdio_pins: sdio { - mux0 { - groups = "sdcard_d0_x", - "sdcard_d1_x", - "sdcard_d2_x", - "sdcard_d3_x", - "sdcard_cmd_x"; - function = "sdcard"; - bias-pull-up; - }; - - mux1 { - groups = "sdcard_clk_x"; - function = "sdcard"; - bias-disable; - }; - }; - - sdio_clk_gate_pins: sdio-clk-gate { - mux { - groups = "sdcard_clk_x"; - function = "sdcard"; - bias-pull-down; - }; - }; - - spifc_pins: spifc { - mux { - groups = "spif_mo", - "spif_mi", - "spif_clk", - "spif_cs", - "spif_hold_n", - "spif_wp_n"; - function = "spif"; - }; - }; - }; - - gpio_intc: interrupt-controller@440 { - compatible = "amlogic,meson-a1-gpio-intc", - "amlogic,meson-gpio-intc"; - reg = <0x0 0x0440 0x0 0x14>; - interrupt-controller; - #interrupt-cells = <2>; - amlogic,channel-interrupts = - <49 50 51 52 53 54 55 56>; - }; - - clkc_periphs: clock-controller@800 { - compatible = "amlogic,a1-peripherals-clkc"; - reg = <0 0x800 0 0x104>; - #clock-cells = <1>; - clocks = <&clkc_pll CLKID_FCLK_DIV2>, - <&clkc_pll CLKID_FCLK_DIV3>, - <&clkc_pll CLKID_FCLK_DIV5>, - <&clkc_pll CLKID_FCLK_DIV7>, - <&clkc_pll CLKID_HIFI_PLL>, - <&xtal>; - clock-names = "fclk_div2", "fclk_div3", - "fclk_div5", "fclk_div7", - "hifi_pll", "xtal"; - }; - - i2c0: i2c@1400 { - compatible = "amlogic,meson-axg-i2c"; - status = "disabled"; - reg = <0x0 0x1400 0x0 0x20>; - interrupts = <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&clkc_periphs CLKID_I2C_M_A>; - power-domains = <&pwrc PWRC_I2C_ID>; - }; - - uart_AO: serial@1c00 { - compatible = "amlogic,meson-a1-uart", - "amlogic,meson-ao-uart"; - reg = <0x0 0x1c00 0x0 0x18>; - interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>; - clocks = <&xtal>, <&xtal>, <&xtal>; - clock-names = "xtal", "pclk", "baud"; - status = "disabled"; - }; - - uart_AO_B: serial@2000 { - compatible = "amlogic,meson-a1-uart", - "amlogic,meson-ao-uart"; - reg = <0x0 0x2000 0x0 0x18>; - interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>; - clocks = <&xtal>, <&xtal>, <&xtal>; - clock-names = "xtal", "pclk", "baud"; - status = "disabled"; - }; - - saradc: adc@2c00 { - compatible = "amlogic,meson-g12a-saradc", - "amlogic,meson-saradc"; - reg = <0x0 0x2c00 0x0 0x48>; - #io-channel-cells = <1>; - power-domains = <&pwrc PWRC_I2C_ID>; - interrupts = <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>; - clocks = <&xtal>, - <&clkc_periphs CLKID_SARADC_EN>, - <&clkc_periphs CLKID_SARADC>, - <&clkc_periphs CLKID_SARADC_SEL>; - clock-names = "clkin", "core", - "adc_clk", "adc_sel"; - status = "disabled"; - }; - - i2c1: i2c@5c00 { - compatible = "amlogic,meson-axg-i2c"; - status = "disabled"; - reg = <0x0 0x5c00 0x0 0x20>; - interrupts = <GIC_SPI 68 IRQ_TYPE_EDGE_RISING>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&clkc_periphs CLKID_I2C_M_B>; - power-domains = <&pwrc PWRC_I2C_ID>; - }; - - i2c2: i2c@6800 { - compatible = "amlogic,meson-axg-i2c"; - status = "disabled"; - reg = <0x0 0x6800 0x0 0x20>; - interrupts = <GIC_SPI 76 IRQ_TYPE_EDGE_RISING>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&clkc_periphs CLKID_I2C_M_C>; - power-domains = <&pwrc PWRC_I2C_ID>; - }; - - i2c3: i2c@6c00 { - compatible = "amlogic,meson-axg-i2c"; - status = "disabled"; - reg = <0x0 0x6c00 0x0 0x20>; - interrupts = <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&clkc_periphs CLKID_I2C_M_D>; - power-domains = <&pwrc PWRC_I2C_ID>; - }; - - usb2_phy1: phy@4000 { - compatible = "amlogic,a1-usb2-phy"; - clocks = <&clkc_periphs CLKID_USB_PHY_IN>; - clock-names = "xtal"; - reg = <0x0 0x4000 0x0 0x60>; - resets = <&reset RESET_USBPHY>; - reset-names = "phy"; - #phy-cells = <0>; - power-domains = <&pwrc PWRC_USB_ID>; - }; - - hwrng: rng@5118 { - compatible = "amlogic,meson-rng"; - reg = <0x0 0x5118 0x0 0x4>; - power-domains = <&pwrc PWRC_OTP_ID>; - }; - - sec_AO: ao-secure@5a20 { - compatible = "amlogic,meson-gx-ao-secure", "syscon"; - reg = <0x0 0x5a20 0x0 0x140>; - amlogic,has-chip-id; - }; - - clkc_pll: pll-clock-controller@7c80 { - compatible = "amlogic,a1-pll-clkc"; - reg = <0 0x7c80 0 0x18c>; - #clock-cells = <1>; - clocks = <&clkc_periphs CLKID_FIXPLL_IN>, - <&clkc_periphs CLKID_HIFIPLL_IN>; - clock-names = "fixpll_in", "hifipll_in"; - }; - - sd_emmc: sd@10000 { - compatible = "amlogic,meson-axg-mmc"; - reg = <0x0 0x10000 0x0 0x800>; - interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&clkc_periphs CLKID_SD_EMMC_A>, - <&clkc_periphs CLKID_SD_EMMC>, - <&clkc_pll CLKID_FCLK_DIV2>; - clock-names = "core", - "clkin0", - "clkin1"; - assigned-clocks = <&clkc_periphs CLKID_SD_EMMC_SEL2>; - assigned-clock-parents = <&xtal>; - resets = <&reset RESET_SD_EMMC_A>; - power-domains = <&pwrc PWRC_SD_EMMC_ID>; - status = "disabled"; - }; - }; - - usb: usb@fe004400 { - status = "disabled"; - compatible = "amlogic,meson-a1-usb-ctrl"; - reg = <0x0 0xfe004400 0x0 0xa0>; - interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>; - #address-cells = <2>; - #size-cells = <2>; - ranges; - - clocks = <&clkc_periphs CLKID_USB_CTRL>, - <&clkc_periphs CLKID_USB_BUS>, - <&clkc_periphs CLKID_USB_CTRL_IN>; - clock-names = "usb_ctrl", "usb_bus", "xtal_usb_ctrl"; - resets = <&reset RESET_USBCTRL>; - reset-name = "usb_ctrl"; - - dr_mode = "otg"; - - phys = <&usb2_phy1>; - phy-names = "usb2-phy1"; - - dwc3: usb@ff400000 { - compatible = "snps,dwc3"; - reg = <0x0 0xff400000 0x0 0x100000>; - interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; - dr_mode = "host"; - snps,dis_u2_susphy_quirk; - snps,quirk-frame-length-adjustment = <0x20>; - snps,parkmode-disable-ss-quirk; - }; - - dwc2: usb@ff500000 { - compatible = "amlogic,meson-a1-usb", "snps,dwc2"; - reg = <0x0 0xff500000 0x0 0x40000>; - interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>; - phys = <&usb2_phy1>; - phy-names = "usb2-phy"; - clocks = <&clkc_periphs CLKID_USB_PHY>; - clock-names = "otg"; - dr_mode = "peripheral"; - g-rx-fifo-size = <192>; - g-np-tx-fifo-size = <128>; - g-tx-fifo-size = <128 128 16 16 16>; - }; - }; - - gic: interrupt-controller@ff901000 { - compatible = "arm,gic-400"; - reg = <0x0 0xff901000 0x0 0x1000>, - <0x0 0xff902000 0x0 0x2000>, - <0x0 0xff904000 0x0 0x2000>, - <0x0 0xff906000 0x0 0x2000>; - interrupt-controller; - interrupts = <GIC_PPI 9 - (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>; - #interrupt-cells = <3>; - #address-cells = <0>; - }; - }; - - timer { - compatible = "arm,armv8-timer"; - interrupts = <GIC_PPI 13 - (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 14 - (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 11 - (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>, - <GIC_PPI 10 - (GIC_CPU_MASK_RAW(0xff) | IRQ_TYPE_LEVEL_LOW)>; - }; - - xtal: xtal-clk { - compatible = "fixed-clock"; - clock-frequency = <24000000>; - clock-output-names = "xtal"; - #clock-cells = <0>; - }; -}; -- 2.34.1
|
[PATCH v1 3/4] dt-bindings: remove axg bindings from include/
We have exactly the same in upstream bindings.
Signed-off-by: Alexey Romanov <avromanov@...> --- include/dt-bindings/clock/axg-audio-clkc.h | 94 ------------------- include/dt-bindings/clock/axg-clkc.h | 100 --------------------- 2 files changed, 194 deletions(-) delete mode 100644 include/dt-bindings/clock/axg-audio-clkc.h delete mode 100644 include/dt-bindings/clock/axg-clkc.h
diff --git a/include/dt-bindings/clock/axg-audio-clkc.h b/include/dt-bindings/clock/axg-audio-clkc.h deleted file mode 100644 index f561f5c5ef..0000000000 --- a/include/dt-bindings/clock/axg-audio-clkc.h +++ /dev/null @@ -1,94 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ -/* - * Copyright (c) 2018 Baylibre SAS. - * Author: Jerome Brunet <jbrunet@...> - */ - -#ifndef __AXG_AUDIO_CLKC_BINDINGS_H -#define __AXG_AUDIO_CLKC_BINDINGS_H - -#define AUD_CLKID_DDR_ARB 29 -#define AUD_CLKID_PDM 30 -#define AUD_CLKID_TDMIN_A 31 -#define AUD_CLKID_TDMIN_B 32 -#define AUD_CLKID_TDMIN_C 33 -#define AUD_CLKID_TDMIN_LB 34 -#define AUD_CLKID_TDMOUT_A 35 -#define AUD_CLKID_TDMOUT_B 36 -#define AUD_CLKID_TDMOUT_C 37 -#define AUD_CLKID_FRDDR_A 38 -#define AUD_CLKID_FRDDR_B 39 -#define AUD_CLKID_FRDDR_C 40 -#define AUD_CLKID_TODDR_A 41 -#define AUD_CLKID_TODDR_B 42 -#define AUD_CLKID_TODDR_C 43 -#define AUD_CLKID_LOOPBACK 44 -#define AUD_CLKID_SPDIFIN 45 -#define AUD_CLKID_SPDIFOUT 46 -#define AUD_CLKID_RESAMPLE 47 -#define AUD_CLKID_POWER_DETECT 48 -#define AUD_CLKID_MST_A_MCLK 49 -#define AUD_CLKID_MST_B_MCLK 50 -#define AUD_CLKID_MST_C_MCLK 51 -#define AUD_CLKID_MST_D_MCLK 52 -#define AUD_CLKID_MST_E_MCLK 53 -#define AUD_CLKID_MST_F_MCLK 54 -#define AUD_CLKID_SPDIFOUT_CLK 55 -#define AUD_CLKID_SPDIFIN_CLK 56 -#define AUD_CLKID_PDM_DCLK 57 -#define AUD_CLKID_PDM_SYSCLK 58 -#define AUD_CLKID_MST_A_SCLK 79 -#define AUD_CLKID_MST_B_SCLK 80 -#define AUD_CLKID_MST_C_SCLK 81 -#define AUD_CLKID_MST_D_SCLK 82 -#define AUD_CLKID_MST_E_SCLK 83 -#define AUD_CLKID_MST_F_SCLK 84 -#define AUD_CLKID_MST_A_LRCLK 86 -#define AUD_CLKID_MST_B_LRCLK 87 -#define AUD_CLKID_MST_C_LRCLK 88 -#define AUD_CLKID_MST_D_LRCLK 89 -#define AUD_CLKID_MST_E_LRCLK 90 -#define AUD_CLKID_MST_F_LRCLK 91 -#define AUD_CLKID_TDMIN_A_SCLK_SEL 116 -#define AUD_CLKID_TDMIN_B_SCLK_SEL 117 -#define AUD_CLKID_TDMIN_C_SCLK_SEL 118 -#define AUD_CLKID_TDMIN_LB_SCLK_SEL 119 -#define AUD_CLKID_TDMOUT_A_SCLK_SEL 120 -#define AUD_CLKID_TDMOUT_B_SCLK_SEL 121 -#define AUD_CLKID_TDMOUT_C_SCLK_SEL 122 -#define AUD_CLKID_TDMIN_A_SCLK 123 -#define AUD_CLKID_TDMIN_B_SCLK 124 -#define AUD_CLKID_TDMIN_C_SCLK 125 -#define AUD_CLKID_TDMIN_LB_SCLK 126 -#define AUD_CLKID_TDMOUT_A_SCLK 127 -#define AUD_CLKID_TDMOUT_B_SCLK 128 -#define AUD_CLKID_TDMOUT_C_SCLK 129 -#define AUD_CLKID_TDMIN_A_LRCLK 130 -#define AUD_CLKID_TDMIN_B_LRCLK 131 -#define AUD_CLKID_TDMIN_C_LRCLK 132 -#define AUD_CLKID_TDMIN_LB_LRCLK 133 -#define AUD_CLKID_TDMOUT_A_LRCLK 134 -#define AUD_CLKID_TDMOUT_B_LRCLK 135 -#define AUD_CLKID_TDMOUT_C_LRCLK 136 -#define AUD_CLKID_SPDIFOUT_B 151 -#define AUD_CLKID_SPDIFOUT_B_CLK 152 -#define AUD_CLKID_TDM_MCLK_PAD0 155 -#define AUD_CLKID_TDM_MCLK_PAD1 156 -#define AUD_CLKID_TDM_LRCLK_PAD0 157 -#define AUD_CLKID_TDM_LRCLK_PAD1 158 -#define AUD_CLKID_TDM_LRCLK_PAD2 159 -#define AUD_CLKID_TDM_SCLK_PAD0 160 -#define AUD_CLKID_TDM_SCLK_PAD1 161 -#define AUD_CLKID_TDM_SCLK_PAD2 162 -#define AUD_CLKID_TOP 163 -#define AUD_CLKID_TORAM 164 -#define AUD_CLKID_EQDRC 165 -#define AUD_CLKID_RESAMPLE_B 166 -#define AUD_CLKID_TOVAD 167 -#define AUD_CLKID_LOCKER 168 -#define AUD_CLKID_SPDIFIN_LB 169 -#define AUD_CLKID_FRDDR_D 170 -#define AUD_CLKID_TODDR_D 171 -#define AUD_CLKID_LOOPBACK_B 172 - -#endif /* __AXG_AUDIO_CLKC_BINDINGS_H */ diff --git a/include/dt-bindings/clock/axg-clkc.h b/include/dt-bindings/clock/axg-clkc.h deleted file mode 100644 index 93752ea107..0000000000 --- a/include/dt-bindings/clock/axg-clkc.h +++ /dev/null @@ -1,100 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ -/* - * Meson-AXG clock tree IDs - * - * Copyright (c) 2017 Amlogic, Inc. All rights reserved. - */ - -#ifndef __AXG_CLKC_H -#define __AXG_CLKC_H - -#define CLKID_SYS_PLL 0 -#define CLKID_FIXED_PLL 1 -#define CLKID_FCLK_DIV2 2 -#define CLKID_FCLK_DIV3 3 -#define CLKID_FCLK_DIV4 4 -#define CLKID_FCLK_DIV5 5 -#define CLKID_FCLK_DIV7 6 -#define CLKID_GP0_PLL 7 -#define CLKID_CLK81 10 -#define CLKID_MPLL0 11 -#define CLKID_MPLL1 12 -#define CLKID_MPLL2 13 -#define CLKID_MPLL3 14 -#define CLKID_DDR 15 -#define CLKID_AUDIO_LOCKER 16 -#define CLKID_MIPI_DSI_HOST 17 -#define CLKID_ISA 18 -#define CLKID_PL301 19 -#define CLKID_PERIPHS 20 -#define CLKID_SPICC0 21 -#define CLKID_I2C 22 -#define CLKID_RNG0 23 -#define CLKID_UART0 24 -#define CLKID_MIPI_DSI_PHY 25 -#define CLKID_SPICC1 26 -#define CLKID_PCIE_A 27 -#define CLKID_PCIE_B 28 -#define CLKID_HIU_IFACE 29 -#define CLKID_ASSIST_MISC 30 -#define CLKID_SD_EMMC_B 31 -#define CLKID_SD_EMMC_C 32 -#define CLKID_DMA 33 -#define CLKID_SPI 34 -#define CLKID_AUDIO 35 -#define CLKID_ETH 36 -#define CLKID_UART1 37 -#define CLKID_G2D 38 -#define CLKID_USB0 39 -#define CLKID_USB1 40 -#define CLKID_RESET 41 -#define CLKID_USB 42 -#define CLKID_AHB_ARB0 43 -#define CLKID_EFUSE 44 -#define CLKID_BOOT_ROM 45 -#define CLKID_AHB_DATA_BUS 46 -#define CLKID_AHB_CTRL_BUS 47 -#define CLKID_USB1_DDR_BRIDGE 48 -#define CLKID_USB0_DDR_BRIDGE 49 -#define CLKID_MMC_PCLK 50 -#define CLKID_VPU_INTR 51 -#define CLKID_SEC_AHB_AHB3_BRIDGE 52 -#define CLKID_GIC 53 -#define CLKID_AO_MEDIA_CPU 54 -#define CLKID_AO_AHB_SRAM 55 -#define CLKID_AO_AHB_BUS 56 -#define CLKID_AO_IFACE 57 -#define CLKID_AO_I2C 58 -#define CLKID_SD_EMMC_B_CLK0 59 -#define CLKID_SD_EMMC_C_CLK0 60 -#define CLKID_HIFI_PLL 69 -#define CLKID_PCIE_CML_EN0 79 -#define CLKID_PCIE_CML_EN1 80 -#define CLKID_GEN_CLK 84 -#define CLKID_VPU_0_SEL 92 -#define CLKID_VPU_0 93 -#define CLKID_VPU_1_SEL 95 -#define CLKID_VPU_1 96 -#define CLKID_VPU 97 -#define CLKID_VAPB_0_SEL 99 -#define CLKID_VAPB_0 100 -#define CLKID_VAPB_1_SEL 102 -#define CLKID_VAPB_1 103 -#define CLKID_VAPB_SEL 104 -#define CLKID_VAPB 105 -#define CLKID_VCLK 106 -#define CLKID_VCLK2 107 -#define CLKID_VCLK_DIV1 122 -#define CLKID_VCLK_DIV2 123 -#define CLKID_VCLK_DIV4 124 -#define CLKID_VCLK_DIV6 125 -#define CLKID_VCLK_DIV12 126 -#define CLKID_VCLK2_DIV1 127 -#define CLKID_VCLK2_DIV2 128 -#define CLKID_VCLK2_DIV4 129 -#define CLKID_VCLK2_DIV6 130 -#define CLKID_VCLK2_DIV12 131 -#define CLKID_CTS_ENCL 133 -#define CLKID_VDIN_MEAS 136 - -#endif /* __AXG_CLKC_H */ -- 2.34.1
|