[PATCH RESEND 0/5] 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.
It has a depednency on the u-boot-test-hooks patches I sent here:
https://lore.kernel.org/u-boot/20220624023420.3925916-1-joel@jms.id.au
I've given it a run on Azure and the tests passed.
Joel Stanley (5): config/ast2600: Enable CRC32 config/ast2600: Make position independent config/ast2600: Disable hash hardware accel ast2600: Configure u-boot-with-spl.bin target CI: Add Aspeed AST2600
include/configs/evb_ast2600.h | 3 +++ .azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 6 ++++++ configs/evb-ast2600_defconfig | 7 ++++--- 4 files changed, 16 insertions(+), 3 deletions(-)

Useful for testing images with the default hash type.
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 f84b723bbba3..53ba36a28374 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -35,6 +35,7 @@ CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000000 +CONFIG_SPL_CRC32=y CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_RAM_SUPPORT=y

Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
Useful for testing images with the default hash type.
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 f84b723bbba3..53ba36a28374 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -35,6 +35,7 @@ CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000000 +CONFIG_SPL_CRC32=y CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_RAM_SUPPORT=y -- 2.35.1

On 6/27/22 09:58, Joel Stanley wrote:
Useful for testing images with the default hash type.
Signed-off-by: Joel Stanley joel@jms.id.au
Reviewed-by: Cédric Le Goater clg@kaod.org
Thanks,
C.
configs/evb-ast2600_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index f84b723bbba3..53ba36a28374 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -35,6 +35,7 @@ CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000000 +CONFIG_SPL_CRC32=y CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_RAM_SUPPORT=y

Allows loading one u-boot from another. Useful for testing on hardware.
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 53ba36a28374..f3a6cb222020 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_ARCH_ASPEED=y CONFIG_SYS_TEXT_BASE=0x80000000

Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
Allows loading one u-boot from another. Useful for testing on hardware.
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 53ba36a28374..f3a6cb222020 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_ARCH_ASPEED=y CONFIG_SYS_TEXT_BASE=0x80000000 -- 2.35.1

On 6/27/22 09:58, Joel Stanley wrote:
Allows loading one u-boot from another. Useful for testing on hardware.
Signed-off-by: Joel Stanley joel@jms.id.au
Reviewed-by: Cédric Le Goater clg@kaod.org
Thanks,
C.
configs/evb-ast2600_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 53ba36a28374..f3a6cb222020 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_ARCH_ASPEED=y CONFIG_SYS_TEXT_BASE=0x80000000

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.
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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

Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

On 6/27/22 10:15, ChiaWei Wang wrote:
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven.
Great ! I was going to open a gitlab issue under :
https://gitlab.com/qemu-project/qemu/-/issues/
But we still have a couple of weeks before QEMU 7.1 soft freeze :
https://wiki.qemu.org/Planning/7.1
We should open one if not solved before, as a reminder, with some guidelines to reproduce. It
The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Thanks,
C.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
I don't think this is the right way to do it.
First, it's fine that drivers can only support some algos. There is no rules that it must support CRC32. Second, if Qemu test is failure, it should fix the Qemu HACE driver or disable it in Qemu, not in common defconfig in u-boot. This will affect lots of people who use mainline for developments and productions. Thanks,
-Neal
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

Hello Neal
On 6/27/22 10:55, Neal Liu wrote:
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
I don't think this is the right way to do it.
First, it's fine that drivers can only support some algos. There is no rules that it must support CRC32.
For CRC32, I understand that the driver should be able to fallback to the SW implementation. It is not the case today. With some debug in aspeed_hace_finish() :
U-Boot SPL 2022.07-rc5-dirty (Jun 27 2022 - 09:01:28 +0200) already initialized, Trying to boot from RAM ## Checking hash(es) for config conf-1 ... OK ## Checking hash(es) for Image firmware-1 ... crc32Unsupported hash algorithm 'crc32' error! Unsupported hash algorithm for 'hash-1' hash node in 'firmware-1' image node
The above is not related to QEMU.
Thanks,
C.
Second, if Qemu test is failure, it should fix the Qemu HACE driver or disable it in Qemu, not in common defconfig in u-boot. This will affect lots of people who use mainline for developments and productions. Thanks,
-Neal
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

Hello Neal
On 6/27/22 10:55, Neal Liu wrote:
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
I don't think this is the right way to do it.
First, it's fine that drivers can only support some algos. There is no rules that
it must support CRC32.
For CRC32, I understand that the driver should be able to fallback to the SW implementation. It is not the case today. With some debug in aspeed_hace_finish() :
U-Boot SPL 2022.07-rc5-dirty (Jun 27 2022 - 09:01:28 +0200) already initialized, Trying to boot from RAM ## Checking hash(es) for config conf-1 ... OK ## Checking hash(es) for Image firmware-1 ... crc32Unsupported hash algorithm 'crc32' error! Unsupported hash algorithm for 'hash-1' hash node in 'firmware-1' image node
The above is not related to QEMU.
Thanks,
C.
The fallback need to be fixed of course. We would send a patch to fix this. Thanks
Second, if Qemu test is failure, it should fix the Qemu HACE driver or disable
it in Qemu, not in common defconfig in u-boot.
This will affect lots of people who use mainline for developments and
productions.
Thanks,
-Neal

On Mon, 27 Jun 2022 at 08:55, Neal Liu neal_liu@aspeedtech.com wrote:
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
I don't think this is the right way to do it.
First, it's fine that drivers can only support some algos. There is no rules that it must support CRC32. Second, if Qemu test is failure, it should fix the Qemu HACE driver or disable it in Qemu, not in common defconfig in u-boot. This will affect lots of people who use mainline for developments and productions.
While I agree with you in general, this board didn't boot until recently, and it certainly doesn't have any users. Mainline u-boot lacks drivers for the ast2600 hardware it claims to support. There's no working storage driver in the tree (SPI NOR or eMMC).
While qemu support is not required for u-boot's CI, it is a hard dependency of it being used in the OpenBMC project, which is where the majority of users come from. In that project we use a fork of the Aspeed SDK, which itself is a few thousand patches on top of u-boot v2019.04.
I propose this change as a way to get CI working for the board, so we can have a baseline set of working functionality, and make improvements from there. I've started submitting those improvements; we have changes on the list for eMMC support, I2C, and the Aspeed developers have a spi-nor driver under review.
Cheers,
Joel
Thanks,
-Neal
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

On Mon, 27 Jun 2022 at 08:55, Neal Liu neal_liu@aspeedtech.com wrote:
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
The QEMU emulation issue is under investigation by Steven. The CRC32 and MD5 SW support will be added before we re-enabling HW crypto drivers.
Chiawei
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
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.
I don't think this is the right way to do it.
First, it's fine that drivers can only support some algos. There is no rules that
it must support CRC32.
Second, if Qemu test is failure, it should fix the Qemu HACE driver or disable
it in Qemu, not in common defconfig in u-boot.
This will affect lots of people who use mainline for developments and
productions.
While I agree with you in general, this board didn't boot until recently, and it certainly doesn't have any users. Mainline u-boot lacks drivers for the ast2600 hardware it claims to support. There's no working storage driver in the tree (SPI NOR or eMMC).
While qemu support is not required for u-boot's CI, it is a hard dependency of it being used in the OpenBMC project, which is where the majority of users come from. In that project we use a fork of the Aspeed SDK, which itself is a few thousand patches on top of u-boot v2019.04.
I propose this change as a way to get CI working for the board, so we can have a baseline set of working functionality, and make improvements from there. I've started submitting those improvements; we have changes on the list for eMMC support, I2C, and the Aspeed developers have a spi-nor driver under review.
Okay, just make sure to re-enable these configs once the issue fixed. Thanks
Cheers,
Joel
Thanks,
-Neal
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 f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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 -- 2.35.1

On 6/27/22 09:58, Joel Stanley wrote:
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.
Signed-off-by: Joel Stanley joel@jms.id.au
Reviewed-by: Cédric Le Goater clg@kaod.org
Thanks,
C.
configs/evb-ast2600_defconfig | 3 --- 1 file changed, 3 deletions(-)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index f3a6cb222020..160bccff48e2 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -59,9 +59,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

For the u-boot-with-spl.bin target to be useful for the AST2600, set the maximum SPL size which also sets the padding length.
The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
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
Signed-off-by: Joel Stanley joel@jms.id.au --- include/configs/evb_ast2600.h | 3 +++ configs/evb-ast2600_defconfig | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/include/configs/evb_ast2600.h b/include/configs/evb_ast2600.h index 3c2155da46df..f5ac88447b52 100644 --- a/include/configs/evb_ast2600.h +++ b/include/configs/evb_ast2600.h @@ -10,6 +10,9 @@
#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
+/* The maximum size the AST2600 bootrom can load is 64KB */ +#define CONFIG_SPL_MAX_SIZE 65536 + /* Misc */ #define STR_HELPER(s) #s #define STR(s) STR_HELPER(s) diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 160bccff48e2..5230515f7ab6 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -20,6 +20,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

From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
For the u-boot-with-spl.bin target to be useful for the AST2600, set the maximum SPL size which also sets the padding length.
The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
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
Signed-off-by: Joel Stanley joel@jms.id.au
include/configs/evb_ast2600.h | 3 +++ configs/evb-ast2600_defconfig | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/include/configs/evb_ast2600.h b/include/configs/evb_ast2600.h index 3c2155da46df..f5ac88447b52 100644 --- a/include/configs/evb_ast2600.h +++ b/include/configs/evb_ast2600.h @@ -10,6 +10,9 @@
#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
+/* The maximum size the AST2600 bootrom can load is 64KB */ +#define CONFIG_SPL_MAX_SIZE 65536
Please have this to be synced with CONFIG_SPL_SIZE_LIMIT. Thanks.
Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com

On 6/27/22 09:58, Joel Stanley wrote:
For the u-boot-with-spl.bin target to be useful for the AST2600, set the maximum SPL size which also sets the padding length.
The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
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
Signed-off-by: Joel Stanley joel@jms.id.au
Reviewed-by: Cédric Le Goater clg@kaod.org
Thanks,
C.
include/configs/evb_ast2600.h | 3 +++ configs/evb-ast2600_defconfig | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/include/configs/evb_ast2600.h b/include/configs/evb_ast2600.h index 3c2155da46df..f5ac88447b52 100644 --- a/include/configs/evb_ast2600.h +++ b/include/configs/evb_ast2600.h @@ -10,6 +10,9 @@
#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
+/* The maximum size the AST2600 bootrom can load is 64KB */ +#define CONFIG_SPL_MAX_SIZE 65536
- /* Misc */ #define STR_HELPER(s) #s #define STR(s) STR_HELPER(s)
diff --git a/configs/evb-ast2600_defconfig b/configs/evb-ast2600_defconfig index 160bccff48e2..5230515f7ab6 100644 --- a/configs/evb-ast2600_defconfig +++ b/configs/evb-ast2600_defconfig @@ -20,6 +20,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

On Mon, Jun 27, 2022 at 05:28:10PM +0930, Joel Stanley wrote:
For the u-boot-with-spl.bin target to be useful for the AST2600, set the maximum SPL size which also sets the padding length.
The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
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
Signed-off-by: Joel Stanley joel@jms.id.au Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org
This doesn't quite apply correct now as CONFIG_SPL_MAX_SIZE is in Kconfig. I migrated that manually but now CI doesn't run: https://source.denx.de/u-boot/u-boot/-/jobs/457298 so I wonder if I migrated it wrong, or something else. To be clear, I have applied https://patchwork.ozlabs.org/project/uboot/patch/20220628042725.217333-1-joe... first.

On Tue, 28 Jun 2022 at 14:19, Tom Rini trini@konsulko.com wrote:
On Mon, Jun 27, 2022 at 05:28:10PM +0930, Joel Stanley wrote:
For the u-boot-with-spl.bin target to be useful for the AST2600, set the maximum SPL size which also sets the padding length.
The normal way of loading u-boot is as a FIT, so configure u-boot.img as the SPL playload.
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
Signed-off-by: Joel Stanley joel@jms.id.au Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com Reviewed-by: Cédric Le Goater clg@kaod.org
This doesn't quite apply correct now as CONFIG_SPL_MAX_SIZE is in Kconfig. I migrated that manually but now CI doesn't run: https://source.denx.de/u-boot/u-boot/-/jobs/457298 so I wonder if I migrated it wrong, or something else.
Thanks for trying! I've recently worked out that development is happening on the next branch, whereas my patches last week were sent against master. I've rebased this series on next and have sent them out.
To be clear, I have applied https://patchwork.ozlabs.org/project/uboot/patch/20220628042725.217333-1-joe... first.
The linker script fix is required, but I accidentally introduced a new bug in that one. It was masked because in my testing I also had the image/fit stack allocation fix in my tree, which avoids the issue with writing to the bss.
http://patchwork.ozlabs.org/project/uboot/patch/20220620070117.3443066-1-joe...
I included a linker script fix for the new bug in v2 of the series:
https://lore.kernel.org/u-boot/20220629070525.575426-1-joel@jms.id.au/
Cheers,
Joel

The AST2600 has a Qemu model that allows testing. Create a SPI NOR image containing the combined SPL and u-boot FIT image.
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 ad540ea63536..bdc515ebcdc1 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"

Reviewed-by: Chia-Wei Wang chiawei_wang@aspeedtech.com
From: joel.stan@gmail.com joel.stan@gmail.com On Behalf Of Joel Stanley Sent: Monday, June 27, 2022 3:58 PM
The AST2600 has a Qemu model that allows testing. Create a SPI NOR image containing the combined SPL and u-boot FIT image.
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 ad540ea63536..bdc515ebcdc1 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" -- 2.35.1

On 6/27/22 09:58, 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.
Signed-off-by: Joel Stanley joel@jms.id.au
Reviewed-by: Cédric Le Goater clg@kaod.org
Thanks,
C.
.azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 6 ++++++ 2 files changed, 9 insertions(+)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index ad540ea63536..bdc515ebcdc1 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"
participants (5)
-
ChiaWei Wang
-
Cédric Le Goater
-
Joel Stanley
-
Neal Liu
-
Tom Rini