[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/12] hw/char/bcm2835_aux: Allow less than 32-bit accesses
From: |
Peter Maydell |
Subject: |
[PULL 05/12] hw/char/bcm2835_aux: Allow less than 32-bit accesses |
Date: |
Thu, 8 Oct 2020 15:25:50 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
The "BCM2835 ARM Peripherals" datasheet [*] chapter 2
("Auxiliaries: UART1 & SPI1, SPI2"), list the register
sizes as 3/8/16/32 bits. We assume this means this
peripheral allows 8-bit accesses.
This was not an issue until commit 5d971f9e67 which reverted
("memory: accept mismatching sizes in memory_region_access_valid").
The model is implemented as 32-bit accesses (see commit 97398d900c,
all registers are 32-bit) so replace MemoryRegionOps.valid as
MemoryRegionOps.impl, and re-introduce MemoryRegionOps.valid
with a 8/32-bit range.
[*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
Fixes: 97398d900c ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1)
block")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201002181032.1899463-1-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/char/bcm2835_aux.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c
index ee3dd40e3c7..dade2ab5fd5 100644
--- a/hw/char/bcm2835_aux.c
+++ b/hw/char/bcm2835_aux.c
@@ -249,7 +249,9 @@ static const MemoryRegionOps bcm2835_aux_ops = {
.read = bcm2835_aux_read,
.write = bcm2835_aux_write,
.endianness = DEVICE_NATIVE_ENDIAN,
- .valid.min_access_size = 4,
+ .impl.min_access_size = 4,
+ .impl.max_access_size = 4,
+ .valid.min_access_size = 1,
.valid.max_access_size = 4,
};
--
2.20.1
- [PULL 00/12] target-arm queue, Peter Maydell, 2020/10/08
- [PULL 03/12] hw/arm/sbsa-ref : Fix SMMUv3 Initialisation, Peter Maydell, 2020/10/08
- [PULL 01/12] hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer, Peter Maydell, 2020/10/08
- [PULL 06/12] linux headers: sync to 5.9-rc7, Peter Maydell, 2020/10/08
- [PULL 02/12] hw/arm/fsl-imx25: Fix a typo, Peter Maydell, 2020/10/08
- [PULL 04/12] hw/arm/sbsa-ref : allocate IRQs for SMMUv3, Peter Maydell, 2020/10/08
- [PULL 08/12] hw/arm/virt: Move post cpu realize check into its own function, Peter Maydell, 2020/10/08
- [PULL 07/12] target/arm/kvm: Make uncalled stubs explicitly unreachable, Peter Maydell, 2020/10/08
- [PULL 05/12] hw/char/bcm2835_aux: Allow less than 32-bit accesses,
Peter Maydell <=
- [PULL 09/12] hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init, Peter Maydell, 2020/10/08
- [PULL 10/12] tests/qtest: Restore aarch64 arm-cpu-features test, Peter Maydell, 2020/10/08
- [PULL 11/12] hw/arm/virt: Implement kvm-steal-time, Peter Maydell, 2020/10/08
- [PULL 12/12] target/arm: Make '-cpu max' have a 48-bit PA, Peter Maydell, 2020/10/08