Skip to contentSkip to conversation

hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

PATCH In review Jamin Lin via 3 participants 5 messages Aug 4, 2025 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

On AST1030, reading the FMC_WDT2 register always returns 0xFFFFFFFF. This issue is due to the aspeed_smc_read function, which checks for the ASPEED_SMC_FEATURE_WDT_CONTROL feature. Since AST1030 was missing this feature flag, the read operation fails and returns -1.

To resolve this, add the WDT_CONTROL feature to AST1030's feature set so that FMC_WDT2 can be correctly accessed by firmware.

---
 hw/ssi/aspeed_smc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/ssi/aspeed_smc.c +2 -1
index 614528b8ef..e33496f502 100644
@@ -1857,7 +1857,8 @@ static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)
     asc->resets            = aspeed_1030_fmc_resets;
     asc->flash_window_base = 0x80000000;
     asc->flash_window_size = 0x10000000;
-    asc->features          = ASPEED_SMC_FEATURE_DMA;
+    asc->features          = ASPEED_SMC_FEATURE_DMA |
+                             ASPEED_SMC_FEATURE_WDT_CONTROL;
     asc->dma_flash_mask    = 0x0FFFFFFC;
     asc->dma_dram_mask     = 0x000BFFFC;
     asc->dma_start_length  = 1;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

Hello Jamin,

Quoted 18 lines · Jamin Lin

On AST1030, reading the FMC_WDT2 register always returns 0xFFFFFFFF. This issue is due to the aspeed_smc_read function, which checks for the ASPEED_SMC_FEATURE_WDT_CONTROL feature. Since AST1030 was missing this feature flag, the read operation fails and returns -1.

To resolve this, add the WDT_CONTROL feature to AST1030's feature set so that FMC_WDT2 can be correctly accessed by firmware.

---
  hw/ssi/aspeed_smc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/ssi/aspeed_smc.c +0 -0
index 614528b8ef..e33496f502 100644

hw/ssi/aspeed_smc.c static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data) · line 1864

Quoted 9 lines
hw/ssi/aspeed_smc.c +2 -1
@@ -1857,7 +1857,8 @@ static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)
      asc->resets            = aspeed_1030_fmc_resets;
      asc->flash_window_base = 0x80000000;
      asc->flash_window_size = 0x10000000;
-    asc->features          = ASPEED_SMC_FEATURE_DMA;
+    asc->features          = ASPEED_SMC_FEATURE_DMA |
+                             ASPEED_SMC_FEATURE_WDT_CONTROL;
      asc->dma_flash_mask    = 0x0FFFFFFC;
      asc->dma_dram_mask     = 0x000BFFFC;
      asc->dma_start_length  = 1;

Could you add a Fixes tag please ?

I plan to send a PR before -rc2 (Tuesday) with the vbootrom update.

Thanks,

C.

#2 lore raw

Hi Cédric,

Quoted 41 lines

From: Cédric Le Goater <[email protected]>
Sent: Monday, August 4, 2025 2:33 PM
To: Jamin Lin <[email protected]>; Alistair Francis <[email protected]>; Peter Maydell <[email protected]>; Steven Lee <[email protected]>; Troy Lee <[email protected]>; Andrew Jeffery <[email protected]>; Joel Stanley <[email protected]>; open list:ASPEED BMCs <[email protected]>; open list:All patches CC here <[email protected]>
Cc: Troy Lee <[email protected]>
Subject: Re: [PATCH v1] hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

Hello Jamin,

Quoted 3 lines · Jamin Lin

On AST1030, reading the FMC_WDT2 register always returns 0xFFFFFFFF. This issue is due to the aspeed_smc_read function, which checks for the ASPEED_SMC_FEATURE_WDT_CONTROL feature. Since AST1030 was

missing

hw/ssi/aspeed_smc.c static void

Quoted 15 lines

this feature flag, the read operation fails and returns -1.

To resolve this, add the WDT_CONTROL feature to AST1030's feature set so that FMC_WDT2 can be correctly accessed by firmware.

---
  hw/ssi/aspeed_smc.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
hw/ssi/aspeed_smc.c index renamed from hw/ssi/aspeed_smc.c +0 -0

614528b8ef..e33496f502 100644

hw/ssi/aspeed_smc.c +0 -0
@@ -1857,7 +1857,8 @@ static void

aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)

hw/ssi/aspeed_smc.c static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)

Quoted 6 lines
hw/ssi/aspeed_smc.c +2 -1
      asc->resets            = aspeed_1030_fmc_resets;
      asc->flash_window_base = 0x80000000;
      asc->flash_window_size = 0x10000000;
-    asc->features          = ASPEED_SMC_FEATURE_DMA;
+    asc->features          = ASPEED_SMC_FEATURE_DMA |
+
Quoted 7 lines

ASPEED_SMC_FEATURE_WDT_CONTROL;

hw/ssi/aspeed_smc.c static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data) · line 1864

Quoted 3 lines
hw/ssi/aspeed_smc.c +0 -0
      asc->dma_flash_mask    = 0x0FFFFFFC;
      asc->dma_dram_mask     = 0x000BFFFC;
      asc->dma_start_length  = 1;

Could you add a Fixes tag please ?

Fixes 2850df6 ("aspeed/smc: Add AST1030 support ")
Quoted 2 lines

I plan to send a PR before -rc2 (Tuesday) with the vbootrom update.

Okay. Thanks for review and help.
Jamin

Quoted 6 lines

Thanks,

C.

#3 lore raw
Quoted 43 lines · Jamin Lin

Hi Cédric,

Quoted 41 lines

From: Cédric Le Goater <[email protected]>
Sent: Monday, August 4, 2025 2:33 PM
To: Jamin Lin <[email protected]>; Alistair Francis <[email protected]>; Peter Maydell <[email protected]>; Steven Lee <[email protected]>; Troy Lee <[email protected]>; Andrew Jeffery <[email protected]>; Joel Stanley <[email protected]>; open list:ASPEED BMCs <[email protected]>; open list:All patches CC here <[email protected]>
Cc: Troy Lee <[email protected]>
Subject: Re: [PATCH v1] hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

Hello Jamin,

Quoted 3 lines · Jamin Lin

On AST1030, reading the FMC_WDT2 register always returns 0xFFFFFFFF. This issue is due to the aspeed_smc_read function, which checks for the ASPEED_SMC_FEATURE_WDT_CONTROL feature. Since AST1030 was

missing

hw/ssi/aspeed_smc.c static void

Quoted 15 lines

this feature flag, the read operation fails and returns -1.

To resolve this, add the WDT_CONTROL feature to AST1030's feature set so that FMC_WDT2 can be correctly accessed by firmware.

---
   hw/ssi/aspeed_smc.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
hw/ssi/aspeed_smc.c index renamed from hw/ssi/aspeed_smc.c +0 -0

614528b8ef..e33496f502 100644

hw/ssi/aspeed_smc.c +0 -0
@@ -1857,7 +1857,8 @@ static void

aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)

Quoted 6 lines
hw/ssi/aspeed_smc.c +2 -1
       asc->resets            = aspeed_1030_fmc_resets;
       asc->flash_window_base = 0x80000000;
       asc->flash_window_size = 0x10000000;
-    asc->features          = ASPEED_SMC_FEATURE_DMA;
+    asc->features          = ASPEED_SMC_FEATURE_DMA |
+
Quoted 8 lines
Quoted 7 lines

ASPEED_SMC_FEATURE_WDT_CONTROL;

hw/ssi/aspeed_smc.c static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data) · line 1864

Quoted 3 lines
hw/ssi/aspeed_smc.c +0 -0
       asc->dma_flash_mask    = 0x0FFFFFFC;
       asc->dma_dram_mask     = 0x000BFFFC;
       asc->dma_start_length  = 1;

Could you add a Fixes tag please ?

Fixes 2850df6 ("aspeed/smc: Add AST1030 support ")

The commit SHA id is a bit short. 12 is a minimum now.

Thanks,

C.

#4 lore raw

Hi Cédric,

Quoted 62 lines

From: Cédric Le Goater <[email protected]>
Sent: Monday, August 4, 2025 2:52 PM
To: Jamin Lin <[email protected]>; Alistair Francis <[email protected]>; Peter Maydell <[email protected]>; Steven Lee <[email protected]>; Troy Lee <[email protected]>; Andrew Jeffery <[email protected]>; Joel Stanley <[email protected]>; open list:ASPEED BMCs <[email protected]>; open list:All patches CC here <[email protected]>
Cc: Troy Lee <[email protected]>
Subject: Re: [PATCH v1] hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

Quoted 7 lines · Jamin Lin

Hi Cédric,

Quoted 5 lines

From: Cédric Le Goater <[email protected]>
Sent: Monday, August 4, 2025 2:33 PM
To: Jamin Lin <[email protected]>; Alistair Francis <[email protected]>; Peter Maydell <[email protected]>; Steven Lee <[email protected]>; Troy Lee

<[email protected]>;

Quoted 41 lines
Quoted 41 lines

Andrew Jeffery <[email protected]>; Joel Stanley <[email protected]>; open list:ASPEED BMCs <[email protected]>; open list:All patches CC here <[email protected]>
Cc: Troy Lee <[email protected]>
Subject: Re: [PATCH v1] hw/ssi/aspeed_smc: Fix incorrect FMC_WDT2 register read on AST1030

Hello Jamin,

Quoted 3 lines · Jamin Lin

On AST1030, reading the FMC_WDT2 register always returns 0xFFFFFFFF. This issue is due to the aspeed_smc_read function, which checks for the ASPEED_SMC_FEATURE_WDT_CONTROL feature. Since AST1030 was

missing

hw/ssi/aspeed_smc.c static void

Quoted 15 lines

this feature flag, the read operation fails and returns -1.

To resolve this, add the WDT_CONTROL feature to AST1030's feature set so that FMC_WDT2 can be correctly accessed by firmware.

---
   hw/ssi/aspeed_smc.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
hw/ssi/aspeed_smc.c index renamed from hw/ssi/aspeed_smc.c +0 -0

614528b8ef..e33496f502 100644

hw/ssi/aspeed_smc.c +0 -0
@@ -1857,7 +1857,8 @@ static void

aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)

hw/ssi/aspeed_smc.c static void aspeed_1030_fmc_class_init(ObjectClass *klass, const void *data)

Quoted 6 lines
hw/ssi/aspeed_smc.c +2 -1
       asc->resets            = aspeed_1030_fmc_resets;
       asc->flash_window_base = 0x80000000;
       asc->flash_window_size = 0x10000000;
-    asc->features          = ASPEED_SMC_FEATURE_DMA;
+    asc->features          = ASPEED_SMC_FEATURE_DMA |
+

ASPEED_SMC_FEATURE_WDT_CONTROL;

Quoted 3 lines
hw/ssi/aspeed_smc.c +0 -0
       asc->dma_flash_mask    = 0x0FFFFFFC;
       asc->dma_dram_mask     = 0x000BFFFC;
       asc->dma_start_length  = 1;
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Could you add a Fixes tag please ?

Fixes 2850df6 ("aspeed/smc: Add AST1030 support ")

The commit SHA id is a bit short. 12 is a minimum now.

Update SHA id

Fixes 2850df6a81bcdc2e063dfdd56751ee2d11c58030 ("aspeed/smc: Add AST1030 support ")

Thanks-Jamin

Quoted 4 lines

Thanks,

C.