[PATCH v2] hw/arm/omap_sx1: map CS3 at the correct base

zhaoguohan@kylinos.cn posted 1 patch 1 week, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260403014441.38725-1-zhaoguohan@kylinos.cn
Maintainers: Peter Maydell <peter.maydell@linaro.org>
hw/arm/omap_sx1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] hw/arm/omap_sx1: map CS3 at the correct base
Posted by zhaoguohan@kylinos.cn 1 week, 1 day ago
From: GuoHan Zhao <zhaoguohan@kylinos.cn>

omap_sx1 wires the "sx1.cs3" region to OMAP_CS2_BASE instead of
OMAP_CS3_BASE.

That places both CS2 and CS3 at the same address and leaves the real
CS3 window unmapped. Point the CS3 region at OMAP_CS3_BASE so the
static chip-select layout matches the OMAP address definitions.

Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
---
v1 -> v2:
- Resend to qemu-devel@nongnu.org
- Keep qemu-arm@nongnu.org on Cc as requested by Peter Maydell

 hw/arm/omap_sx1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index d858dab32534..bcb7105323fd 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -146,7 +146,7 @@ static void sx1_init(MachineState *machine, const int version)
     memory_region_init_io(&cs[3], NULL, &static_ops, &cs3val,
                           "sx1.cs3", OMAP_CS3_SIZE);
     memory_region_add_subregion(address_space,
-                                OMAP_CS2_BASE, &cs[3]);
+                                OMAP_CS3_BASE, &cs[3]);
 
     fl_idx = 0;
     if ((dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
-- 
2.43.0
Re: [PATCH v2] hw/arm/omap_sx1: map CS3 at the correct base
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 3/4/26 03:44, zhaoguohan@kylinos.cn wrote:
> From: GuoHan Zhao <zhaoguohan@kylinos.cn>
> 
> omap_sx1 wires the "sx1.cs3" region to OMAP_CS2_BASE instead of
> OMAP_CS3_BASE.
> 
> That places both CS2 and CS3 at the same address and leaves the real
> CS3 window unmapped. Point the CS3 region at OMAP_CS3_BASE so the
> static chip-select layout matches the OMAP address definitions.
> 

Fixes: ba1580299d0 ("omap_sx1: convert to memory API")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Note, this got unnoticed for 15 years.

> Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
> ---
> v1 -> v2:
> - Resend to qemu-devel@nongnu.org
> - Keep qemu-arm@nongnu.org on Cc as requested by Peter Maydell
> 
>   hw/arm/omap_sx1.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)