Re: [PATCH v2] tests/qtest: Add test for ASPEED SCU

2025-06-30 Thread Tan Siewert
On 30.06.25 13:47, Cédric Le Goater wrote: On 6/30/25 13:26, Tan Siewert wrote: diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 8ad849054f..8c5fcc4fc1 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -215,7 +215,8 @@ qtests_npcm8xx = \   qtests_aspeed

[PATCH v2] tests/qtest: Add test for ASPEED SCU

2025-06-30 Thread Tan Siewert
secondary one - That writes to protected SCU registers are blocked unless protection registers are unlocked explicitly These tests ensure proper emulation of hardware locking behaviour and help catch regressions in SCU access logic. Signed-off-by: Tan Siewert --- V2: - Merge unnecessary

Re: [PATCH] tests/qtest: Add test for ASPEED SCU

2025-06-29 Thread Tan Siewert
Hi Jamin, On 30.06.25 08:37, Cédric Le Goater wrote: Hello Tan, On 6/29/25 15:54, Tan Siewert wrote: This adds basic tests for the ASPEED System Control Unit (SCU) and its protection mechanism on the AST2500 and AST2600 platforms. The tests verify:    - That SCU protection registers can be

[PATCH] tests/qtest: Add test for ASPEED SCU

2025-06-29 Thread Tan Siewert
secondary one - That writes to protected SCU registers are blocked unless protection registers are unlocked explicitly These tests ensure proper emulation of hardware locking behaviour and help catch regressions in SCU access logic. Signed-off-by: Tan Siewert --- tests/qtest/aspeed-scu

Re: [PATCH v4] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-27 Thread Tan Siewert
On 20.06.25 03:23, Jamin Lin wrote: Subject: Re: [PATCH v4] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly Jamin, On 6/19/25 10:53, Tan Siewert wrote: The AST2600 SCU has two protection key registers (0x00 and 0x10) that both need to be unlocked. (Un-)locking 0x00

[PATCH v4] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-19 Thread Tan Siewert
unlocked, matching the behaviour of real hardware. Signed-off-by: Tan Siewert --- V4: - Fix mis-understanding of or operator in lock check [Tan] - Move SCU protection data variable outside of switch case [Cedric] - Fix u32 -> uint32_t mistake (now bool as same result) [Cedric] hw/m

[PATCH v3] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-13 Thread Tan Siewert
unlocked, matching the behaviour of real hardware. Signed-off-by: Tan Siewert --- V3: - Change logic to unlock both registers on 0x00 write, while writing to 0x10 only modifies itself. [Jamin] hw/misc/aspeed_scu.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff

Re: [PATCH v2] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-13 Thread Tan Siewert
Many Thanks for your review, Jamin! On 13.06.25 05:01, Jamin Lin wrote: According to the datasheet description: it seems your changes do not match the actual hardware behavior. Protection Key This register is designed to protect SCU registers from unpredictable updates, especially when ARM CPU i

[PATCH v2] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-12 Thread Tan Siewert
real hardware. Signed-off-by: Tan Siewert --- V2: - Fix protection key register check to be an OR instead of AND - Add missing return if SCU is locked (like for AST2500) hw/misc/aspeed_scu.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/misc

Re: [PATCH] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-12 Thread Tan Siewert
On 12.06.25 08:58, Cédric Le Goater wrote: LGTM, Jamin, Steven, Troy ? On 12.06.25 01:43, Tan Siewert wrote: -    if (reg > PROT_KEY && !s->regs[PROT_KEY]) { +    if ((reg != AST2600_PROT_KEY && reg != AST2600_PROT_KEY2) && ! unlocked) {   qemu_log_mas

[PATCH] hw/misc/aspeed_scu: Handle AST2600 protection key registers correctly

2025-06-11 Thread Tan Siewert
real hardware. Signed-off-by: Tan Siewert --- hw/misc/aspeed_scu.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index 4930e00fed..8e9eac4629 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -91,6