在 2025/5/7 上午10:31, Bibo Mao 写道:
This series patchset is to clean up with memory regions of loongarch pch
pic interrupt controller. Originally there are three iomem regions:
iomem32_low, iomem8, iomem32_highm. Since these regions only support
4 bytes/1 byte/4 bytes access, it is divided into three regions.
Now it is merged into one region, this regions supports 1/2/4/8 bytes
access.
Patch 1-6 is to replace register name, no function change.
Patch 7-16 is to use unifed memory region iomem, and supports 1/2/4/8
bytes access with read/write ops for this region, and merge three
regions above into one.
---
v3 ... v4:
1. Use uint8_t rather than bitfield in packed structure since there is
different definition about bitfield between gcc and MSVC.
2. Rebase patch based on latest version.
v2 ... v3:
1. Set address aligned with 8 bytes in memory region function
pch_pic_read() and pch_pic_write(), and only compare register
base address with 8 bytes aligned one.
2. Replace 0xff/0xffff with UCHAR_MAX/USHRT_MAX.
v1 ... v2:
1. Add 1/2/4/8 bytes access support with memory region read and
write ops.
2. Merge three memory regions iomem32_low, iomem8 and iomem32_high
into one region iomem.
3. Merge trace functions for ops in above three memory regions into
one trace function
---
Bibo Mao (16):
hw/intc/loongarch_pch: Modify name of some registers
hw/intc/loongarch_pch: Modify register name PCH_PIC_xxx_OFFSET with
PCH_PIC_xxx
hw/intc/loongarch_pch: Remove some duplicate macro
hw/intc/loongarch_pch: Set version information at initial stage
hw/intc/loongarch_pch: Use relative address in MemoryRegionOps
hw/intc/loongarch_pch: Discard write operation with ISR register
hw/intc/loongarch_pch: Use generic read callback for iomem32_low
region
hw/intc/loongarch_pch: Use generic read callback for iomem32_high
region
hw/intc/loongarch_pch: Use generic read callback for iomem8 region
hw/intc/loongarch_pch: Use generic write callback for iomem32_low
region
hw/intc/loongarch_pch: Use generic write callback for iomem32_high
region
hw/intc/loongarch_pch: Use generic write callback for iomem8 region
hw/intc/loongarch_pch: Use unified trace event for memory region ops
hw/intc/loongarch_pch: Rename memory region iomem32_low with iomem
hw/intc/loongarch_pch: Set flexible memory access size with iomem
region
hw/intc/loongarch_pch: Merge three memory region into one
hw/intc/loongarch_pch_pic.c | 331 ++++++++-----------------
hw/intc/loongarch_pic_common.c | 13 +
hw/intc/trace-events | 8 +-
hw/loongarch/virt.c | 6 -
include/hw/intc/loongarch_pic_common.h | 57 ++---
5 files changed, 152 insertions(+), 263 deletions(-)
Applied to loongarch-next.
thanks.
Song Gao