[PATCH v2 0/7] aspeed: Add AST2600 machine to CI

The Aspeed AST2600 is modelled in Qemu. This makes some configuration changes so it can be added to CI.
v2 changes:
The u-boot-test-hooks patches are now merged.
I reworked "ast2600: Configure u-boot-with-spl.bin target" to use the kconfig SPL_MAX_SIZE. The size is set in the previous patch as a Kconfig default.
Included in the series is also a fix to the linker script, that resolves an issue I introduced with the previous fix.
I've added the reviews from Cédric and Chia-Wei to the patches they approved in v1.
The tests have passed a CI run on Azure:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=4607
Joel Stanley (7): config/ast2600: Enable CRC32 config/ast2600: Make position independent config/ast2600: Disable hash hardware accel spl: Set SPL_MAX_SIZE default for AST2600 ast2600: Configure u-boot-with-spl.bin target aspeed/spl: Remove OVERLAY from linker script CI: Add Aspeed AST2600
.azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 6 ++++++ arch/arm/mach-aspeed/ast2600/u-boot-spl.lds | 2 +- common/spl/Kconfig | 1 + configs/evb-ast2600_defconfig | 7 ++++--- 5 files changed, 15 insertions(+), 4 deletions(-)

Useful for testing images with the default hash type.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au --- configs/evb-ast2600_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index a91a53da4fc2..867401f101dc 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -40,6 +40,7 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000000 CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_CRC32=y CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_RAM_SUPPORT=y

On Wed, Jun 29, 2022 at 04:35:19PM +0930, Joel Stanley wrote:
Useful for testing images with the default hash type.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au
For the series, applied to u-boot/next, thanks!

Allows loading one u-boot from another. Useful for testing on hardware.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au --- configs/evb-ast2600_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 867401f101dc..07784fe8ac62 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_SYS_DCACHE_OFF=y +CONFIG_POSITION_INDEPENDENT=y CONFIG_SPL_SYS_THUMB_BUILD=y CONFIG_SPL_LDSCRIPT="arch/arm/mach-aspeed/ast2600/u-boot-spl.lds" CONFIG_ARCH_ASPEED=y

The HACE driver lacks support for all the hash types, causing boot to fail with the default FIT configuration which uses CRC32.
Additionally the Qemu model or the u-boot driver is unable to correctly compute the SHA256 hash used in a FIT.
Disable HACE by default while the above issues are worked out to enable boot testing in Qemu.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au --- configs/evb-ast2600_defconfig | 3 --- 1 file changed, 3 deletions(-)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 07784fe8ac62..03f90c7818b7 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -66,9 +66,6 @@ CONFIG_REGMAP=y CONFIG_SPL_OF_TRANSLATE=y CONFIG_CLK=y CONFIG_SPL_CLK=y -CONFIG_DM_HASH=y -CONFIG_HASH_ASPEED=y -CONFIG_ASPEED_ACRY=y CONFIG_ASPEED_GPIO=y CONFIG_DM_I2C=y CONFIG_MISC=y

The AST2600 bootrom has a max size of 64KB. This can be overridden if the system is running the SPL from SPI NOR and not using secure boot.
Signed-off-by: Joel Stanley joel@jms.id.au --- New in v2
common/spl/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 2ad2351c6eb3..e37aece46eb7 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -82,6 +82,7 @@ config SPL_MAX_SIZE default 0x7fa0 if SUNXI_SRAM_ADDRESS = 0x20000 && !MACH_SUN50I_H616 default 0x7000 if RCAR_GEN3 default 0x5fa0 if SUNXI_SRAM_ADDRESS = 0x0 + default 0x10000 if ASPEED_AST2600 default 0x0 help Maximum size of the SPL image (text, data, rodata, and linker lists

The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
The u-boot-with-spl.bin target will add padding according to CONFIG_SPL_MAX_SIZE which defaults to 64KB on the AST2600.
With this the following simple steps can be used to build and boot a system:
make u-boot-with-spl.bin truncate -s 64M u-boot-with-spl.bin qemu-system-arm -nographic -M ast2600-evb \ -drive file=u-boot-with-spl.bin,if=mtd,format=raw
Reviewed-by: Cédric Le Goater clg@kaod.org Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Signed-off-by: Joel Stanley joel@jms.id.au --- v2: Removed the change to include/configs/evb_ast2600.h
configs/evb-ast2600_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 03f90c7818b7..51261e730f3b 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -21,6 +21,8 @@ CONFIG_SPL_SIZE_LIMIT=0x10000 CONFIG_SPL=y # CONFIG_ARMV7_NONSEC is not set CONFIG_SYS_LOAD_ADDR=0x83000000 +CONFIG_SPL_PAYLOAD="u-boot.img" +CONFIG_BUILD_TARGET="u-boot-with-spl.bin" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_FIT=y CONFIG_SPL_FIT_SIGNATURE=y

The generic arm linker script contains this section:
.bss __rel_dyn_start (OVERLAY) : { ... }
The (OVERLAY) syntax in the description causes the .bss section to be included in the NOR area of the image:
$ objdump -t -j .bss spl/u-boot-spl SYMBOL TABLE: 0000c61c l d .bss 00000000 .bss 0000c640 l O .bss 00000040 __value.0 0000c68c g O .bss 00000000 __bss_end 0000c61c g O .bss 00000000 __bss_start 0000c680 g O .bss 0000000c stdio_devices
This is what the custom linker script tries to avoid, as the NOR area is read-only.
Remove the OVERLAY syntax to fix the BSS location:
$ objdump -t -j .bss spl/u-boot-spl SYMBOL TABLE: 83000000 l d .bss 00000000 .bss 83000000 l O .bss 00000040 __value.0 0000c61c g O .bss 00000000 __image_copy_end 8300004c g O .bss 00000000 __bss_end 83000000 g O .bss 00000000 __bss_start 83000040 g O .bss 0000000c stdio_devices
This restores the state of the linker script before the patch that fixed the linker lists issue.
Fixes: f6810b749f2e ("aspeed/ast2600: Fix SPL linker script") Signed-off-by: Joel Stanley joel@jms.id.au --- I missed this in testing as I also had "image: fit: Use stack allocation macro" in my tree. The image now boots without that fix (and with it).
I don't understand why __rel_dyn_start is included in the section name. I'm removing it to restore what was there before, however the image boots regardless of it's inclusion.
arch/arm/mach-aspeed/ast2600/u-boot-spl.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds index 95a509ba3f31..37f0ccd92201 100644 --- a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds +++ b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds @@ -68,7 +68,7 @@ SECTIONS
_image_binary_end = .;
- .bss __rel_dyn_start (OVERLAY) : { + .bss : { __bss_start = .; *(.bss*) . = ALIGN(4);

The AST2600 has a Qemu model that allows testing. Create a SPI NOR image containing the combined SPL and u-boot FIT image.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au --- .azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 6 ++++++ 2 files changed, 9 insertions(+)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 915d5115b12d..bc2b437bd999 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -261,6 +261,9 @@ stages: evb_ast2500: TEST_PY_BD: "evb-ast2500" TEST_PY_ID: "--id qemu" + evb_ast2600: + TEST_PY_BD: "evb-ast2600" + TEST_PY_ID: "--id qemu" vexpress_ca9x4: TEST_PY_BD: "vexpress_ca9x4" TEST_PY_ID: "--id qemu" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6a608f7e2a7..f9cd41750791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -272,6 +272,12 @@ evb-ast2500 test.py: TEST_PY_ID: "--id qemu" <<: *buildman_and_testpy_dfn
+evb-ast2600 test.py: + variables: + TEST_PY_BD: "evb-ast2600" + TEST_PY_ID: "--id qemu" + <<: *buildman_and_testpy_dfn + sandbox_flattree test.py: variables: TEST_PY_BD: "sandbox_flattree"

Hi Joel,
On 29.06.22 09:05, Joel Stanley wrote:
The AST2600 has a Qemu model that allows testing. Create a SPI NOR image containing the combined SPL and u-boot FIT image.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org Signed-off-by: Joel Stanley joel@jms.id.au
.azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 6 ++++++ 2 files changed, 9 insertions(+)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 915d5115b12d..bc2b437bd999 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -261,6 +261,9 @@ stages: evb_ast2500: TEST_PY_BD: "evb-ast2500" TEST_PY_ID: "--id qemu"
evb_ast2600:
TEST_PY_BD: "evb-ast2600"
TEST_PY_ID: "--id qemu" vexpress_ca9x4: TEST_PY_BD: "vexpress_ca9x4" TEST_PY_ID: "--id qemu"
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6a608f7e2a7..f9cd41750791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -272,6 +272,12 @@ evb-ast2500 test.py: TEST_PY_ID: "--id qemu" <<: *buildman_and_testpy_dfn
+evb-ast2600 test.py:
- variables:
- TEST_PY_BD: "evb-ast2600"
- TEST_PY_ID: "--id qemu"
- <<: *buildman_and_testpy_dfn
- sandbox_flattree test.py: variables: TEST_PY_BD: "sandbox_flattree"
Lately I'm seeing often timeout errors while Azure CI runs this evb-ast2600 target "test.py evb_ast2600". Do you have any idea, why this might be the case? Or how to debug / test what might go wrong here?
Thanks, Stefan
participants (3)
-
Joel Stanley
-
Stefan Roese
-
Tom Rini