projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43fa36c
)
hw/adc/stm32f2xx_adc: Correct memory region size and access size
author
Philippe Mathieu-Daudé
<f4bug@amsat.org>
Wed, 3 Jun 2020 05:59:15 +0000
(07:59 +0200)
committer
Peter Maydell
<peter.maydell@linaro.org>
Fri, 5 Jun 2020 16:23:09 +0000
(17:23 +0100)
The ADC region size is 256B, split as:
- [0x00 - 0x4f] defined
- [0x50 - 0xff] reserved
All registers are 32-bit (thus when the datasheet mentions the
last defined register is 0x4c, it means its address range is
0x4c .. 0x4f.
This model implementation is also 32-bit. Set MemoryRegionOps
'impl' fields.
See:
'RM0033 Reference manual Rev 8', Table 10.13.18 "ADC register map".
Reported-by: Seth Kintigh <skintigh@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id:
20200603055915
.17678-1-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/adc/stm32f2xx_adc.c
patch
|
blob
|
history
diff --git
a/hw/adc/stm32f2xx_adc.c
b/hw/adc/stm32f2xx_adc.c
index 4f9d485ecf29786508dbca58e1427c3bc9e104e3..01a0b14e69d6c7de7112036ebc4143af582300e9 100644
(file)
--- a/
hw/adc/stm32f2xx_adc.c
+++ b/
hw/adc/stm32f2xx_adc.c
@@
-246,6
+246,8
@@
static const MemoryRegionOps stm32f2xx_adc_ops = {
.read = stm32f2xx_adc_read,
.write = stm32f2xx_adc_write,
.endianness = DEVICE_NATIVE_ENDIAN,
+ .impl.min_access_size = 4,
+ .impl.max_access_size = 4,
};
static const VMStateDescription vmstate_stm32f2xx_adc = {
@@
-278,7
+280,7
@@
static void stm32f2xx_adc_init(Object *obj)
sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq);
memory_region_init_io(&s->mmio, obj, &stm32f2xx_adc_ops, s,
- TYPE_STM32F2XX_ADC, 0x
FF
);
+ TYPE_STM32F2XX_ADC, 0x
100
);
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
}