[PATCH v1 20/21] tests/function/aspeed: Replace manual loader with vbootrom for ast2700fc test

2025-07-16 Thread Jamin Lin via
SSP and TSP now boot in a powered-off state by default. Enabling them requires the PSP (Cortex-A35) to explicitly set SCU control registers at runtime. This behavior aligns with real hardware. However, the current functional test framework design does not support switching the active VM console af

[PATCH v1 14/21] hw/arm/ast27x0: Start TSP in powered-off state to match hardware behavior

2025-07-16 Thread Jamin Lin via
In the previous design, both the PSP and TSP were started together during SoC initialization. However, on real hardware, the TSP begins in a powered-off state. The typical boot sequence involves the PSP powering up first, loading the TSP firmware binary into shared memory via DRAM remap, and then r

[PATCH v1 19/21] pc-bios: Update AST27x0 vBootrom with SSP/TSP SCU initialization support

2025-07-16 Thread Jamin Lin via
The updated boot ROM includes logic to initialize and enable SSP/TSP using SCU registers, based on reserved-memory regions defined in the device tree. Its source code is available at: https://github.com/google/vbootrom/commit/f9eb0bb57decbab860a81712c56132c2102fa98e Build Information: Build Date

[PATCH v1 18/21] hw/misc/aspeed_scu: Implement TSP reset and power-on control via SCU registers

2025-07-16 Thread Jamin Lin via
This patch implements TSP reset and power control logic in the SCU module for AST2700. It introduces support for the following behavior: 1. TSP Reset Trigger (via SCU 0x224): - TSP reset is triggered by writing 1 to bit 9 (RW1S) of SYS_RESET_CTRL_2. 2. TSP Reset State and Source Hold (via SCU

[PATCH v1 15/21] hw/misc/aspeed_scu: Add SCU support for SSP SDRAM remap

2025-07-16 Thread Jamin Lin via
This commit adds SCU register support for SSP SDRAM remap control and runtime activation. It introduces logic for the PSP to dynamically configure the mapping of its own DRAM windows into SSP-visible SDRAM space, enabling shared memory communication via memory region aliases. Two MemoryRegion alia

[PATCH v1 08/21] hw/arm/ast27x0: Add SCU alias for SSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a single SCU hardware block, memory-mapped at 0x12C02000–0x12C03FFF from the perspective of the main CA35 processor (PSP). The SSP coprocessor accesses this same SCU block at a different address: 0x72C02000–0x72C03FFF. To support this shared SCU model, this commit introduces "ssp.scu_

[PATCH v1 21/21] docs: Add support vbootrom for ast2700fc

2025-07-16 Thread Jamin Lin via
Signed-off-by: Jamin Lin --- docs/system/arm/aspeed.rst | 41 -- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst index bf18c56347..bc836e486f 100644 --- a/docs/system/arm/aspeed.rst +++ b/do

[PATCH v1 07/21] hw/arm/ast27x0: Add SRAM alias for TSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a 128KB SRAM, physically mapped at 0x1000–0x1001 for the main CA35 processor. The TSP coprocessor accesses this same memory at a different memory address: 0x7000–0x7001. To support this shared memory model, this commit introduces "tsp.sram_mr_alias", a "MemoryRegion" al

[PATCH v1 06/21] hw/arm/ast27x0: Add SRAM alias for SSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a 128KB SRAM, physically mapped at 0x1000–0x1001 for the main CA35 processor. The SSP coprocessor accesses this same memory at a different memory address: 0x7000–0x7001. To support this shared memory model, this commit introduces "ssp.sram_mr_alias", a "MemoryRegion" al

[PATCH v1 12/21] hw/arm/ast27x0: Add DRAM alias for TSP SDRAM remap and update realization order

2025-07-16 Thread Jamin Lin via
This commit adds a MemoryRegion alias to support PSP access to TSP SDRAM through shared memory remapping, as defined by the default SCU configuration. The TSP coprocessor exposes one DRAM alias: - remap maps PSP DRAM at 0x42e00 (32MB) to TSP SDRAM offset 0x0 This region corresponds to the d

[PATCH v1 16/21] hw/misc/aspeed_scu: Add SCU support for TSP SDRAM remap

2025-07-16 Thread Jamin Lin via
This commit adds SCU register support for TSP SDRAM remap control and runtime activation. Unlike SSP, the TSP does not support configurable target address remapping through SCU registers. It only supports setting the PSP DRAM base and size, which are then aliased into the TSP-visible SDRAM window

[PATCH v1 10/21] hw/arm/ast27x0: Move DRAM and SDMC initialization earlier to support memory aliasing

2025-07-16 Thread Jamin Lin via
To support DRAM aliasing for coprocessors (SSP/TSP), this commit moves the initialization of the SDMC (SDRAM controller) and DRAM models earlier in the device realization order. In the upcoming changes, the PSP will expose a portion of its DRAM as shared memory by creating a memory region alias at

[PATCH v1 11/21] hw/arm/ast27x0: Add DRAM alias for SSP SDRAM remap and update realization order

2025-07-16 Thread Jamin Lin via
This commit adds two MemoryRegion aliases to support PSP access to SSP SDRAM through shared memory remapping, as defined by the default SCU configuration. The SSP coprocessor exposes two DRAM aliases: - remap1 maps PSP DRAM at 0x4 (32MB) to SSP SDRAM offset 0x200 - remap2 maps PSP

[PATCH v1 09/21] hw/arm/ast27x0: Add SCU alias for TSP and ensure correct device realization order

2025-07-16 Thread Jamin Lin via
AST2700 has a single SCU hardware block, memory-mapped at 0x12C02000–0x12C03FFF from the perspective of the main CA35 processor (PSP). The TSP coprocessor accesses this same SCU block at a different address: 0x72C02000–0x72C03FFF. To support this shared SCU model, this commit introduces "tsp.scu_

[PATCH v1 13/21] hw/arm/ast27x0: Start SSP in powered-off state to match hardware behavior

2025-07-16 Thread Jamin Lin via
In the previous design, both the PSP and SSP were started together during SoC initialization. However, on real hardware, the SSP begins in a powered-off state. The typical boot sequence involves the PSP powering up first, loading the SSP firmware binary into shared memory via DRAM remap, and then r

[PATCH v1 17/21] hw/misc/aspeed_scu: Implement SSP reset and power-on control via SCU registers

2025-07-16 Thread Jamin Lin via
This patch implements SSP reset and power control logic in the SCU for AST2700. It introduces support for the following behavior: 1. SSP Reset Trigger (via SCU 0x220): - SSP reset is triggered by writing 1 to bit 30 (RW1S) of SYS_RESET_CTRL_1. 2. SSP Reset State and Source Hold (via SCU 0x120)

[PATCH v1 05/21] hw/arm/aspeed_ast27x0-tsp: Switch TSP memory to SDRAM and use dram_container for remap support

2025-07-16 Thread Jamin Lin via
According to the AST2700 design, the TSP coprocessor uses its own SDRAM instead of SRAM. Additionally, all three coprocessors—SSP, TSP, and PSP—share a common SRAM block. In the previous implementation, the TSP memory region was labeled and sized as "SRAM", but in practice it was being used as TSP'

[PATCH v1 01/21] hw/arm/aspeed_ast27x0-fc: Support VBootRom

2025-07-16 Thread Jamin Lin via
Introduces support for loading a vbootrom image into the dedicated vbootrom memory region in the AST2700 Full Core machine. Additionally, it implements a mechanism to extract the content of fmc_cs0 flash data(backend file) and copy it into the memory-mapped region corresponding to ASPEED_DEV_SPI_B

[PATCH v1 02/21] hw/arm/ast27x0: Move SSP coprocessor initialization from machine to SoC leve

2025-07-16 Thread Jamin Lin via
In the previous design, the SSP coprocessor (aspeed27x0ssp-soc) was initialized and realized at the machine level (e.g., AST2700FC). However, to make sure the coprocessors can work together properly—such as using the same SRAM, sharing the SCU, and having consistent memory remapping—we need to chan

[PATCH v1 04/21] hw/arm/aspeed_ast27x0-ssp: Switch SSP memory to SDRAM and use dram_container for remap support

2025-07-16 Thread Jamin Lin via
According to the AST2700 design, the SSP coprocessor uses its own SDRAM instead of SRAM. Additionally, all three coprocessors—SSP, TSP, and PSP—share a common SRAM block. In the previous implementation, the SSP memory region was labeled and sized as "SRAM", but in practice it was being used as SSP'

[PATCH v1 03/21] hw/arm/ast27x0: Move TSP coprocessor initialization from machine to SoC leve

2025-07-16 Thread Jamin Lin via
In the previous design, the TSP coprocessor (aspeed27x0tsp-soc) was initialized and realized at the machine level (e.g., AST2700FC). To allow proper integration between coprocessors—such as shared use of SRAM, SCU, and memory remap configuration—this commit moves TSP initialization into the AST2700

[PATCH v1 00/21] Control coprocessor reset for AST2700

2025-07-16 Thread Jamin Lin via
v1 - Added support for Vboot ROM. - Moved coprocessor initialization from machine level to SoC level - Unified SCU controllers between PSP and coprocessors - Shared the same SRAM between PSP and coprocessors - Support PSP DRAM remaps coprocessor SDRAM - Added support for controlling coprocess

[PATCH v1] aspeed: Deprecate the ast2700a0-evb machine

2025-07-02 Thread Jamin Lin via
The ast2700a0-evb machine represents the first revision of the AST2700 and serves as the initial engineering sample rather than a production version. A newer revision, A1, is now supported, and the ast2700a1-evb should replace the older A0 version. Signed-off-by: Jamin Lin --- docs/about/depreca

[PATCH v1 1/2] hw/misc/aspeed_sdmc: Skipping dram_init in u-boot for AST2700

2025-06-18 Thread Jamin Lin via
On AST2700 SoC, QEMU now sets BIT6 in VGA0 SCRATCH register to indicate that DDR training has completed, thus skipping the dram_init(). To align with the recent U-Boot changes, where the Main Control Register's BIT16 is checked to skip the dram_init() process, this patch sets BIT16 in the SDMC Mai

[PATCH v1 2/2] hw/misc/aspeed_scu: Support the Frequency Counter Control register for AST2700

2025-06-18 Thread Jamin Lin via
According to the datasheet: BIT[1] (SCU_FREQ_OSC_EN) enables the oscillator frequency measurement counter. BIT[6] (SCU_FREQ_DONE) indicates the measurement is finished. Firmware polls BIT[6] to determine when measurement is complete. The flag can be cleared by writing BIT[1] to 0. To simulate this

[PATCH v1 0/2] Support the Frequency Counter Control register for AST2700

2025-06-18 Thread Jamin Lin via
v1: - Skipping dram_init in u-boot for AST2700 - Support the Frequency Counter Control register for AST2700 Jamin Lin (2): hw/misc/aspeed_sdmc: Skipping dram_init in u-boot for AST2700 hw/misc/aspeed_scu: Support the Frequency Counter Control register for AST2700 hw/misc/aspeed_scu.c |

[PATCH v2 0/3] Fix RAM size detection failure on BE hosts

2025-05-21 Thread Jamin Lin via
v1: 1. Fix RAM size detection failure on BE hosts 2. INTC: Set impl.min_access_size to 4 Fix coding style v2: Fix review issue. Jamin Lin (3): hw/intc/aspeed: Set impl.min_access_size to 4 hw/intc/aspeed Fix coding style hw/arm/aspeed_ast27x0: Fix RAM size detection failure on

[PATCH v2 2/3] hw/intc/aspeed Fix coding style

2025-05-21 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/intc/aspeed_intc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c index 19f88853d8..5cd786dee6 100644 --- a/hw/intc/

[PATCH v2 3/3] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts

2025-05-21 Thread Jamin Lin via
On big-endian hosts, the aspeed_ram_capacity_write() function previously passed the address of a 64-bit "data" variable directly to address_space_write(), assuming host and guest endianness matched. However, the data is expected to be written in little-endian format to DRAM. On big-endian hosts, t

[PATCH v2 1/3] hw/intc/aspeed: Set impl.min_access_size to 4

2025-05-21 Thread Jamin Lin via
This patch explicitly sets ".impl.min_access_size = 4" to match the declared ".valid.min_access_size = 4", enforcing stricter access size checking and preventing inconsistent partial accesses to the interrupt controller registers. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/in

[PATCH v1 3/3] hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts

2025-05-20 Thread Jamin Lin via
On big-endian hosts, the aspeed_ram_capacity_write() function previously passed the address of a 64-bit "data" variable directly to address_space_write(), assuming host and guest endianness matched. However, the data is expected to be written in little-endian format to DRAM. On big-endian hosts, t

[PATCH v1 2/3] hw/intc/aspeed Fix coding style

2025-05-20 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl. Signed-off-by: Jamin Lin --- hw/intc/aspeed_intc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/aspeed_intc.c b/hw/intc/aspeed_intc.c index 19f88853d8..5cd786dee6 100644 --- a/hw/intc/aspeed_intc.c +++ b/hw/intc/asp

[PATCH v1 1/3] hw/intc/aspeed: Set impl.min_access_size to 4

2025-05-20 Thread Jamin Lin via
This patch explicitly sets ".impl.min_access_size = 4" to match the declared ".valid.min_access_size = 4", enforcing stricter access size checking and preventing inconsistent partial accesses to the interrupt controller registers. Signed-off-by: Jamin Lin --- hw/intc/aspeed_intc.c | 6 ++ 1

[PATCH v1 0/3] Fix RAM size detection failure on BE hosts

2025-05-20 Thread Jamin Lin via
v1: 1. Fix RAM size detection failure on BE hosts 2. INTC: Set impl.min_access_size to 4 Fix coding style Jamin Lin (3): hw/intc/aspeed: Set impl.min_access_size to 4 hw/intc/aspeed Fix coding style hw/arm/aspeed_ast27x0: Fix RAM size detection failure on BE hosts hw/arm/aspeed

[PATCH v3 02/28] hw/misc/aspeed_hace: Improve readability and consistency in variable naming

2025-05-15 Thread Jamin Lin via
Currently, users define multiple local variables within different if-statements. To improve readability and maintain consistency in variable naming, rename the variables accordingly. Introduced "sg_addr" to clearly indicate the scatter-gather mode buffer address. Signed-off-by: Jamin Lin --- hw/

[PATCH v3 26/28] test/qtest/hace: Support to test upper 32 bits of digest and source addresses

2025-05-15 Thread Jamin Lin via
Added "src_hi" and "dest_hi" fields to "AspeedMasks" for 64-bit addresses test. Updated "aspeed_test_addresses" to validate "HACE_HASH_SRC_HI" and "HACE_HASH_DIGEST_HI". Ensured correct masking of 64-bit addresses by checking both lower and upper 32-bit registers. Signed-off-by: Jamin Lin Reviewe

[PATCH v3 00/28] Fix incorrect hash results on AST2700

2025-05-15 Thread Jamin Lin via
v1: 1. Added support for 64-bit DMA in the HACE model 2. Refactored the do_hash operation in the HACE model 3. Fixed a crash caused by out-of-bound memory access in HACE 4. Added more trace events and implemented dumping of source hash data and resulting digests to improve debugging 5. Ref

[PATCH v3 25/28] test/qtest/hace: Support 64-bit source and digest addresses for AST2700

2025-05-15 Thread Jamin Lin via
Added "HACE_HASH_SRC_HI" and "HACE_HASH_DIGEST_HI", "HACE_HASH_KEY_BUFF_HI" registers to store upper 32 bits. Updated "write_regs" to handle 64-bit source and digest addresses. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- tests/qtest/aspeed-hace-utils.h | 3 +++ tests/qtest/aspeed

[PATCH v3 19/28] test/qtest/hace: Specify explicit array sizes for test vectors and hash results

2025-05-15 Thread Jamin Lin via
To enhance code readability and prevent potential buffer overflows or unintended size assumptions, this commit updates all fixed-size array declarations to use explicit array sizes. Signed-off-by: Jamin Lin --- tests/qtest/aspeed-hace-utils.c | 26 +- 1 file changed, 13 i

[PATCH v3 20/28] test/qtest/hace: Adjust test address range for AST1030 due to SRAM limitations

2025-05-15 Thread Jamin Lin via
The digest_addr is set to "src_addr + 0x100", where src_addr is the DRAM base address. However, the value 0x100 (16MB) is too large because the AST1030 does not support DRAM, and its SRAM size is only 768KB. A range size of 0x1 (64KB) is sufficient for HACE test cases, as the test vect

[PATCH v3 13/28] hw/misc/aspeed_hace: Add support for source, digest, key buffer 64 bit addresses

2025-05-15 Thread Jamin Lin via
According to the AST2700 design, the data source address is 64-bit, with R_HASH_SRC_HI storing bits [63:32] and R_HASH_SRC storing bits [31:0]. Similarly, the digest address is 64-bit, with R_HASH_DIGEST_HI storing bits [63:32] and R_HASH_DIGEST storing bits [31:0]. The HMAC key buffer address is

[PATCH v3 07/28] hw/misc/aspeed_hace: Extract non-accumulation hash execution into helper function

2025-05-15 Thread Jamin Lin via
To improve code readability and maintainability of do_hash_operation(), this commit introduces a new helper function: hash_execute_non_acc_mode(). The helper encapsulate the hashing logic for non-accumulation mode. No functional changes are introduced. Signed-off-by: Jamin Lin --- hw/misc/aspe

[PATCH v3 03/28] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang

2025-05-15 Thread Jamin Lin via
Currently, if the program encounters an unsupported algorithm, it does not set the HASH_IRQ bit in the status register and send an interrupt to indicate command completion. As a result, the FW gets stuck waiting for a completion signal from the HACE module. Additionally, in do_hash_operation, if a

[PATCH v3 27/28] test/qtest/hace: Support to validate 64-bit hmac key buffer addresses

2025-05-15 Thread Jamin Lin via
Added "key" and "key_hi" fields to "AspeedMasks" for 64-bit addresses test. Updated "aspeed_test_addresses" to validate "HACE_HASH_KEY_BUFF" and "HACE_HASH_KEY_BUFF_HI". Ensured correct masking of 64-bit addresses by checking both lower and upper 32-bit registers. Signed-off-by: Jamin Lin Reviewe

[PATCH v3 15/28] hw/misc/aspeed_hace: Add trace-events for better debugging

2025-05-15 Thread Jamin Lin via
Introduced "trace_aspeed_hace_hash_addr", "trace_aspeed_hace_hash_sg", "trace_aspeed_hace_read", "trace_aspeed_hace_hash_execute_acc_mode", and "trace_aspeed_hace_write" trace events. Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 10 ++ hw/misc/trace-events | 7 +++ 2 files

[PATCH v3 28/28] test/qtest/hace: Add tests for AST2700

2025-05-15 Thread Jamin Lin via
The HACE models in AST2600 and AST2700 are nearly identical. Based on the AST2600 test cases, new tests have been added for AST2700. Implemented test functions for SHA-256, SHA-384, SHA-512, and MD5. Added scatter-gather and accumulation test variants. For AST2700, the HACE controller base address

[PATCH v3 18/28] test/qtest: Introduce a new aspeed-hace-utils.c to place common testcases

2025-05-15 Thread Jamin Lin via
The test cases for the ASPEED HACE model were originally placed in aspeed_hace-test.c. However, this test file only supports ARM32. To enable compatibility with all ASPEED SoCs, including the AST2700, which uses the AArch64 architecture, this update introduces a new source file, aspeed-hace-utils.c

[PATCH v3 21/28] test/qtest/hace: Add SHA-384 test cases for ASPEED HACE model

2025-05-15 Thread Jamin Lin via
Introduced SHA-384 test functions to verify hashing operations. Extended support for scatter-gather ("_sg") and accumulation ("_accum") tests. Updated test result vectors for SHA-384 validation. Signed-off-by: Jamin Lin --- tests/qtest/aspeed-hace-utils.h | 6 ++ tests/qtest/aspeed-hace-utils.

[PATCH v3 24/28] test/qtest/hace: Update source data and digest data type to 64-bit

2025-05-15 Thread Jamin Lin via
Currently, the hash data source and digest result buffer addresses are set to 32-bit. However, the AST2700 CPU is a 64-bit Cortex-A35 architecture, and its DRAM base address is also 64-bit. To support AST2700, update the hash data source address and digest result buffer address to use 64-bit addre

[PATCH v3 16/28] hw/misc/aspeed_hace: Support to dump plaintext and digest for better debugging

2025-05-15 Thread Jamin Lin via
1. Added "hace_hexdump()" to dump a contiguous buffer using qemu_hexdump. 2. Added "hace_iov_hexdump()" to flatten and dump scatter-gather source vectors. 3. Introduced a new trace event: "aspeed_hace_hexdump". Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 46 +

[PATCH v3 12/28] hw/misc/aspeed_hace: Move register size to instance class and dynamically allocate regs

2025-05-15 Thread Jamin Lin via
Dynamically allocate the register array by removing the hardcoded ASPEED_HACE_NR_REGS macro. To support different register sizes across SoC variants, introduce a new "nr_regs" class attribute and replace the static "regs" array with dynamically allocated memory. Add a new "aspeed_hace_unrealize"

[PATCH v3 09/28] hw/misc/aspeed_hace: Introduce 64-bit hash source address helper function

2025-05-15 Thread Jamin Lin via
The AST2700 CPU, based on the Cortex-A35, is a 64-bit processor, and its DRAM address space is also 64-bit. To support future AST2700 updates, the source hash buffer address data type is being updated to 64-bit. Introduces the "hash_get_source_addr()" helper function to extract the source hash bu

[PATCH v3 14/28] hw/misc/aspeed_hace: Support DMA 64 bits dram address

2025-05-15 Thread Jamin Lin via
According to the AST2700 design, the data source address is 64-bit, with R_HASH_SRC_HI storing bits [63:32] and R_HASH_SRC storing bits [31:0]. Similarly, the digest address is 64-bit, with R_HASH_DEST_HI storing bits [63:32] and R_HASH_DEST storing bits [31:0]. To maintain compatibility with old

[PATCH v3 08/28] hw/misc/aspeed_hace: Extract accumulation-mode hash execution into helper function

2025-05-15 Thread Jamin Lin via
To improve code readability and maintainability of do_hash_operation(), this commit introduces a new helper function: hash_execute_acc_mode(). This function encapsulates the full flow for accumulation mode, including context initialization, update, conditional finalization, and digest writeback wi

[PATCH v3 22/28] test/qtest/hace: Add SHA-384 tests for AST2600

2025-05-15 Thread Jamin Lin via
Introduced "test_sha384_ast2600" to validate SHA-384 hashing. Added "test_sha384_sg_ast2600" for scatter-gather SHA-384 verification. Implemented "test_sha384_accum_ast2600" to test SHA-384 accumulation. Registered new test cases in "main" to ensure execution. Signed-off-by: Jamin Lin Reviewed-by

[PATCH v3 23/28] test/qtest/hace: Add tests for AST1030

2025-05-15 Thread Jamin Lin via
The HACE model in AST2600 and AST1030 is identical. Referencing the AST2600 test cases, new tests have been created for AST1030. Implemented test functions for SHA-256, SHA-384, SHA-512, and MD5. Added scatter-gather and accumulation test variants. For AST1030, the HACE controller base address sta

[PATCH v3 10/28] hw/misc/aspeed_hace: Rename R_HASH_DEST to R_HASH_DIGEST and introduce 64-bit hash digest address helper

2025-05-15 Thread Jamin Lin via
Renaming R_HASH_DEST to R_HASH_DIGEST for better semantic clarity. The AST2700 CPU, based on the Cortex-A35, features a 64-bit DRAM address space. To prepare for future AST2700 support, this change introduces a new helper function hash_get_digest_addr() to encapsulate digest address extraction log

[PATCH v3 01/28] hw/misc/aspeed_hace: Remove unused code for better readability

2025-05-15 Thread Jamin Lin via
In the previous design of the hash framework, accumulative hashing was not supported. To work around this limitation, commit 5cd7d85 introduced an iov_cache array to store all the hash data from firmware. Once the ASPEED HACE model collected all the data, it passed the iov_cache to the hash API to

[PATCH v3 17/28] tests/qtest: Reorder aspeed test list

2025-05-15 Thread Jamin Lin via
Reordered the aspeed test list to keep the alphabetical order. No functional changes in test behavior. Signed-off-by: Jamin Lin --- tests/qtest/meson.build | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 3136d

[PATCH v3 04/28] hw/misc/aspeed_hace: Extract direct mode hash buffer setup into helper function

2025-05-15 Thread Jamin Lin via
To improve code readability and maintainability of do_hash_operation(), this commit introduces a new helper function: hash_prepare_direct_iov(). This function encapsulates the logic for setting up the I/O vector (iov) in direct mode (non-scatter-gather). No functional changes are introduced. Sign

[PATCH v3 06/28] hw/misc/aspeed_hace: Extract digest write and iov unmap into helper function

2025-05-15 Thread Jamin Lin via
To improve code readability and maintainability of do_hash_operation(), this commit introduces a new helper function: hash_write_digest_and_unmap_iov(). The helper consolidates the final digest writeback and subsequent unmapping of the I/O vectors into a single routine. No functional changes are

[PATCH v3 05/28] hw/misc/aspeed_hace: Extract SG-mode hash buffer setup into helper function

2025-05-15 Thread Jamin Lin via
To improve code readability and maintainability of do_hash_operation(), this commit introduces a new helper function: hash_prepare_sg_iov(). This function handles scatter-gather (SG) mode setup, including SG list parsing, address mapping, and optional accumulation mode support with padding detecti

[PATCH v3 11/28] hw/misc/aspeed_hace: Support accumulative mode for direct access mode

2025-05-15 Thread Jamin Lin via
Enable accumulative mode for direct access mode operations. In direct access mode, only a single source buffer is used, so the "iovec" count is set to 1. If "acc_mode" is enabled: 1. Accumulate "total_req_len" with the current request length ("plen"). 2. Check for padding and determine whether this

[PATCH v1] tests/qtest/aspeed_smc-test: Fix memory leaks

2025-05-13 Thread Jamin Lin via
Link: https://patchwork.kernel.org/project/qemu-devel/patch/20250509175047.26066-1-faro...@suse.de/ Signed-off-by: Jamin Lin --- tests/qtest/aspeed_smc-test.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c index 4e1389385d.

[PATCH v2 03/25] hw/misc/aspeed_hace: Ensure HASH_IRQ is always set to prevent firmware hang

2025-05-13 Thread Jamin Lin via
Currently, if the program encounters an unsupported algorithm, it does not set the HASH_IRQ bit in the status register and send an interrupt to indicate command completion. As a result, the FW gets stuck waiting for a completion signal from the HACE module. Additionally, in do_hash_operation, if a

[PATCH v2 01/25] hw/misc/aspeed_hace: Remove unused code for better readability

2025-05-13 Thread Jamin Lin via
In the previous design of the hash framework, accumulative hashing was not supported. To work around this limitation, commit 5cd7d85 introduced an iov_cache array to store all the hash data from firmware. Once the ASPEED HACE model collected all the data, it passed the iov_cache to the hash API to

[PATCH v2 15/25] test/qtest: Introduce a new aspeed-hace-utils.c to place common testcases

2025-05-12 Thread Jamin Lin via
The test cases for the ASPEED HACE model were originally placed in aspeed_hace-test.c. However, this test file only supports ARM32. To enable compatibility with all ASPEED SoCs, including the AST2700, which uses the AArch64 architecture, this update introduces a new source file, aspeed-hace-utils.c

[PATCH v2 18/25] test/qtest/hace: Add SHA-384 test cases for ASPEED HACE model

2025-05-12 Thread Jamin Lin via
Introduced SHA-384 test functions to verify hashing operations. Extended support for scatter-gather ("_sg") and accumulation ("_accum") tests. Updated test result vectors for SHA-384 validation. Signed-off-by: Jamin Lin --- tests/qtest/aspeed-hace-utils.h | 6 ++ tests/qtest/aspeed-hace-utils.

[PATCH v2 22/25] test/qtest/hace: Support 64-bit source and digest addresses for AST2700

2025-05-12 Thread Jamin Lin via
Added "HACE_HASH_SRC_HI" and "HACE_HASH_DIGEST_HI", "HACE_HASH_KEY_BUFF_HI" registers to store upper 32 bits. Updated "write_regs" to handle 64-bit source and digest addresses. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- tests/qtest/aspeed-hace-utils.h | 3 +++ tests/qtest/aspeed

[PATCH v2 21/25] test/qtest/hace: Update source data and digest data type to 64-bit

2025-05-12 Thread Jamin Lin via
Currently, the hash data source and digest result buffer addresses are set to 32-bit. However, the AST2700 CPU is a 64-bit Cortex-A35 architecture, and its DRAM base address is also 64-bit. To support AST2700, update the hash data source address and digest result buffer address to use 64-bit addre

[PATCH v2 10/25] hw/misc/aspeed_hace: Add support for source, digest, key buffer 64 bit addresses

2025-05-12 Thread Jamin Lin via
According to the AST2700 design, the data source address is 64-bit, with R_HASH_SRC_HI storing bits [63:32] and R_HASH_SRC storing bits [31:0]. Similarly, the digest address is 64-bit, with R_HASH_DIGEST_HI storing bits [63:32] and R_HASH_DIGEST storing bits [31:0]. The HMAC key buffer address is

[PATCH v2 23/25] test/qtest/hace: Support to test upper 32 bits of digest and source addresses

2025-05-12 Thread Jamin Lin via
Added "src_hi" and "dest_hi" fields to "AspeedMasks" for 64-bit addresses test. Updated "aspeed_test_addresses" to validate "HACE_HASH_SRC_HI" and "HACE_HASH_DIGEST_HI". Ensured correct masking of 64-bit addresses by checking both lower and upper 32-bit registers. Signed-off-by: Jamin Lin Reviewe

[PATCH v2 24/25] test/qtest/hace: Support to validate 64-bit hmac key buffer addresses

2025-05-12 Thread Jamin Lin via
Added "key" and "key_hi" fields to "AspeedMasks" for 64-bit addresses test. Updated "aspeed_test_addresses" to validate "HACE_HASH_KEY_BUFF" and "HACE_HASH_KEY_BUFF_HI". Ensured correct masking of 64-bit addresses by checking both lower and upper 32-bit registers. Signed-off-by: Jamin Lin Reviewe

[PATCH v2 17/25] test/qtest/hace: Adjust test address range for AST1030 due to SRAM limitations

2025-05-12 Thread Jamin Lin via
The digest_addr is set to "src_addr + 0x100", where src_addr is the DRAM base address. However, the value 0x100 (16MB) is too large because the AST1030 does not support DRAM, and its SRAM size is only 768KB. A range size of 0x1 (64KB) is sufficient for HACE test cases, as the test vect

[PATCH v2 16/25] test/qtest/hace: Specify explicit array sizes for test vectors and hash results

2025-05-12 Thread Jamin Lin via
To enhance code readability and prevent potential buffer overflows or unintended size assumptions, this commit updates all fixed-size array declarations to use explicit array sizes. Signed-off-by: Jamin Lin --- tests/qtest/aspeed-hace-utils.c | 26 +- 1 file changed, 13 i

[PATCH v2 20/25] test/qtest/hace: Add tests for AST1030

2025-05-12 Thread Jamin Lin via
The HACE model in AST2600 and AST1030 is identical. Referencing the AST2600 test cases, new tests have been created for AST1030. Implemented test functions for SHA-256, SHA-384, SHA-512, and MD5. Added scatter-gather and accumulation test variants. For AST1030, the HACE controller base address sta

[PATCH v2 25/25] test/qtest/hace: Add tests for AST2700

2025-05-12 Thread Jamin Lin via
The HACE models in AST2600 and AST2700 are nearly identical. Based on the AST2600 test cases, new tests have been added for AST2700. Implemented test functions for SHA-256, SHA-384, SHA-512, and MD5. Added scatter-gather and accumulation test variants. For AST2700, the HACE controller base address

[PATCH v2 19/25] test/qtest/hace: Add SHA-384 tests for AST2600

2025-05-12 Thread Jamin Lin via
Introduced "test_sha384_ast2600" to validate SHA-384 hashing. Added "test_sha384_sg_ast2600" for scatter-gather SHA-384 verification. Implemented "test_sha384_accum_ast2600" to test SHA-384 accumulation. Registered new test cases in "main" to ensure execution. Signed-off-by: Jamin Lin Reviewed-by

[PATCH v2 14/25] tests/qtest: Reorder aspeed test list

2025-05-12 Thread Jamin Lin via
Reordered the aspeed test list to keep the alphabetical order. No functional changes in test behavior. Signed-off-by: Jamin Lin --- tests/qtest/meson.build | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 3136d

[PATCH v2 12/25] hw/misc/aspeed_hace: Add trace-events for better debugging

2025-05-12 Thread Jamin Lin via
Introduced "trace_aspeed_hace_hash_addr", "trace_aspeed_hace_hash_sg", "trace_aspeed_hace_read", "trace_aspeed_hace_hash_execute_acc_mode", and "trace_aspeed_hace_write" trace events. Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 11 +++ hw/misc/trace-events | 7 +++ 2 files

[PATCH v2 11/25] hw/misc/aspeed_hace: Support DMA 64 bits dram address

2025-05-12 Thread Jamin Lin via
According to the AST2700 design, the data source address is 64-bit, with R_HASH_SRC_HI storing bits [63:32] and R_HASH_SRC storing bits [31:0]. Similarly, the digest address is 64-bit, with R_HASH_DEST_HI storing bits [63:32] and R_HASH_DEST storing bits [31:0]. To maintain compatibility with old

[PATCH v2 05/25] hw/misc/aspeed_hace: Split hash execution into helper functions for clarity

2025-05-12 Thread Jamin Lin via
Refactor "do_hash_operation()" by extracting hash execution and result handling into dedicated helper functions: - "hash_write_digest_and_unmap_iov()": Writes the digest result to memory and unmaps IOVs after processing. - "hash_execute_non_acc_mode()": Handles one-shot (non-accumulated) hash

[PATCH v2 13/25] hw/misc/aspeed_hace: Support to dump plaintext and digest for better debugging

2025-05-12 Thread Jamin Lin via
1. Added "hace_hexdump()" to dump a contiguous buffer using qemu_hexdump. 2. Added "hace_iov_hexdump()" to flatten and dump scatter-gather source vectors. 3. Introduced a new trace event: "aspeed_hace_hexdump". Signed-off-by: Jamin Lin --- hw/misc/aspeed_hace.c | 46 +

[PATCH v2 09/25] hw/misc/aspeed_hace: Move register size to instance class and dynamically allocate regs

2025-05-12 Thread Jamin Lin via
Dynamically allocate the register array by removing the hardcoded ASPEED_HACE_NR_REGS macro. To support different register sizes across SoC variants, introduce a new "nr_regs" class attribute and replace the static "regs" array with dynamically allocated memory. Add a new "aspeed_hace_unrealize"

[PATCH v2 08/25] hw/misc/aspeed_hace: Support accumulative mode for direct access mode

2025-05-12 Thread Jamin Lin via
Enable accumulative mode for direct access mode operations. In direct access mode, only a single source buffer is used, so the "iovec" count is set to 1. If "acc_mode" is enabled: 1. Accumulate "total_req_len" with the current request length ("plen"). 2. Check for padding and determine whether this

[PATCH v2 06/25] hw/misc/aspeed_hace: Introduce 64-bit hash source address helper function

2025-05-12 Thread Jamin Lin via
The AST2700 CPU, based on the Cortex-A35, is a 64-bit processor, and its DRAM address space is also 64-bit. To support future AST2700 updates, the source hash buffer address data type is being updated to 64-bit. Introduces the "hash_get_source_addr()" helper function to extract the source hash bu

[PATCH v2 07/25] hw/misc/aspeed_hace: Rename R_HASH_DEST to R_HASH_DIGEST and introduce 64-bit hash digest address helper

2025-05-12 Thread Jamin Lin via
Renaming R_HASH_DEST to R_HASH_DIGEST for better semantic clarity. The AST2700 CPU, based on the Cortex-A35, features a 64-bit DRAM address space. To prepare for future AST2700 support, this change introduces a new helper function hash_get_digest_addr() to encapsulate digest address extraction log

[PATCH v2 04/25] hw/misc/aspeed_hace: Refactor hash buffer setup into helper functions for clarity

2025-05-12 Thread Jamin Lin via
To improve code readability and maintainability, this commit refactors the hash buffer preparation logic from "do_hash_operation()" into two helper functions: - "hash_prepare_direct_iov()": handles non-scatter-gather (direct) mode. - "hash_prepare_sg_iov()": handles scatter-gather mode with accumu

[PATCH v2 02/25] hw/misc/aspeed_hace: Improve readability and consistency in variable naming

2025-05-12 Thread Jamin Lin via
Currently, users define multiple local variables within different if-statements. To improve readability and maintain consistency in variable naming, rename the variables accordingly. Introduced "sg_addr" to clearly indicate the scatter-gather mode buffer address. Signed-off-by: Jamin Lin --- hw/

[PATCH v2 00/25] Fix incorrect hash results on AST2700

2025-05-12 Thread Jamin Lin via
v1: 1. Added support for 64-bit DMA in the HACE model 2. Refactored the do_hash operation in the HACE model 3. Fixed a crash caused by out-of-bound memory access in HACE 4. Added more trace events and implemented dumping of source hash data and resulting digests to improve debugging 5. Ref

[PATCH v8 0/1] Support vbootrom for AST2700

2025-04-28 Thread Jamin Lin via
v1: Add initial support for AST27x0 The purpose of vbootrom here is to simulate the work of BootMCU SPL (riscv) in AST2700, because QEMU doesn't support heterogenous architecture yet. ast27x0_bootrom.bin is a simplified, free (Apache 2.0) boot ROM for ASPEED AST27x0 BMC SOC. It currently

[PATCH v8 1/1] pc-bios: Add AST27x0 vBootrom

2025-04-28 Thread Jamin Lin via
The boot ROM is a minimal implementation designed to load an AST27x0 boot image. Its source code is available at: https://github.com/google/vbootrom Commit id: d6e3386709b3e49322a94ffadc2aaab9944ab77b Build Information: ``` Build Date : Apr 29 2025 01:23:18 FW Version : git-d6e3386 ``` Signed-off-

[PATCH v7 1/1] pc-bios: Add AST27x0 vBootrom

2025-04-28 Thread Jamin Lin via
The boot ROM is a minimal implementation designed to load an AST27x0 boot image. Its source code is available at: https://github.com/google/vbootrom Commit id: d6e3386709b3e49322a94ffadc2aaab9944ab77b Build Information: ``` Build Date : Apr 29 2025 01:23:18 FW Version : git-d6e3386 ``` Signed-off-

[PATCH v7 0/1] Support vbootrom for AST2700

2025-04-28 Thread Jamin Lin via
v1: Add initial support for AST27x0 The purpose of vbootrom here is to simulate the work of BootMCU SPL (riscv) in AST2700, because QEMU doesn't support heterogenous architecture yet. ast27x0_bootrom.bin is a simplified, free (Apache 2.0) boot ROM for ASPEED AST27x0 BMC SOC. It currently

[PATCH v6 6/6] docs/system/arm/aspeed: Support vbootrom for AST2700

2025-04-24 Thread Jamin Lin via
Using the vbootrom image support and the boot ROM binary is now passed via the -bios option, using the image located in pc-bios/ast27x0_bootrom.bin. Signed-off-by: Jamin Lin Reviewed-by: Nabih Estefan Reviewed-by: Cédric Le Goater --- docs/system/arm/aspeed.rst | 29 +++

[PATCH v6 0/6] Support vbootrom for AST2700

2025-04-24 Thread Jamin Lin via
v1: Add initial support for AST27x0 The purpose of vbootrom here is to simulate the work of BootMCU SPL (riscv) in AST2700, because QEMU doesn't support heterogenous architecture yet. ast27x0_bootrom.bin is a simplified, free (Apache 2.0) boot ROM for ASPEED AST27x0 BMC SOC. It currently

[PATCH v6 3/6] hw/arm/aspeed: Add support for loading vbootrom image via "-bios"

2025-04-24 Thread Jamin Lin via
Introduce "aspeed_load_vbootrom()" to support loading a virtual boot ROM image into the vbootrom memory region, using the "-bios" command-line option. Introduce a new "vbootrom" field in the AspeedMachineClass to indicate whether a machine supports the virtual boot ROM region. Set this field to t

[PATCH v6 4/6] tests/functional/aspeed: Add to test vbootrom for AST2700

2025-04-24 Thread Jamin Lin via
Add the AST2700 functional test to boot using the vbootrom image instead of manually loading boot components with -device loader. The boot ROM binary is now passed via the -bios option, using the image located in pc-bios/ast27x0_bootrom.bin. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater

[PATCH v6 2/6] pc-bios: Add AST27x0 vBootrom

2025-04-24 Thread Jamin Lin via
The boot ROM is a minimal implementation designed to load an AST27x0 boot image. Its source code is available at: https://github.com/google/vbootrom Commit id: 82bed5ca62295228ea7bcdc721b63db178f686e8 Signed-off-by: Jamin Lin Reviewed-by: Nabih Estefan Tested-by: Nabih Estefan --- MAINTAINERS

[PATCH v6 5/6] docs/system/arm/aspeed: move AST2700 content to new section

2025-04-24 Thread Jamin Lin via
Moved AST2700-related content from the general Aspeed board list into a dedicated section for Aspeed 2700 family boards. Improves clarity and readability. Signed-off-by: Jamin Lin --- docs/system/arm/aspeed.rst | 70 ++ 1 file changed, 63 insertions(+), 7 dele

  1   2   3   4   5   6   7   >