qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/arm/bcm2835_peripherals: Use the thermal sensor block

Map the thermal sensor in the BCM2835 block.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20191019234715.25750-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Philippe Mathieu-Daudé and committed by
Peter Maydell
d442d95f 99c64137

+16
+13
hw/arm/bcm2835_peripherals.c
··· 111 111 object_property_add_const_link(OBJECT(&s->dma), "dma-mr", 112 112 OBJECT(&s->gpu_bus_mr), &error_abort); 113 113 114 + /* Thermal */ 115 + sysbus_init_child_obj(obj, "thermal", &s->thermal, sizeof(s->thermal), 116 + TYPE_BCM2835_THERMAL); 117 + 114 118 /* GPIO */ 115 119 sysbus_init_child_obj(obj, "gpio", &s->gpio, sizeof(s->gpio), 116 120 TYPE_BCM2835_GPIO); ··· 320 324 BCM2835_IC_GPU_IRQ, 321 325 INTERRUPT_DMA0 + n)); 322 326 } 327 + 328 + /* THERMAL */ 329 + object_property_set_bool(OBJECT(&s->thermal), true, "realized", &err); 330 + if (err) { 331 + error_propagate(errp, err); 332 + return; 333 + } 334 + memory_region_add_subregion(&s->peri_mr, THERMAL_OFFSET, 335 + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->thermal), 0)); 323 336 324 337 /* GPIO */ 325 338 object_property_set_bool(OBJECT(&s->gpio), true, "realized", &err);
+2
include/hw/arm/bcm2835_peripherals.h
··· 20 20 #include "hw/misc/bcm2835_property.h" 21 21 #include "hw/misc/bcm2835_rng.h" 22 22 #include "hw/misc/bcm2835_mbox.h" 23 + #include "hw/misc/bcm2835_thermal.h" 23 24 #include "hw/sd/sdhci.h" 24 25 #include "hw/sd/bcm2835_sdhost.h" 25 26 #include "hw/gpio/bcm2835_gpio.h" ··· 53 54 SDHCIState sdhci; 54 55 BCM2835SDHostState sdhost; 55 56 BCM2835GpioState gpio; 57 + Bcm2835ThermalState thermal; 56 58 UnimplementedDeviceState i2s; 57 59 UnimplementedDeviceState spi[1]; 58 60 UnimplementedDeviceState i2c[3];
+1
include/hw/arm/raspi_platform.h
··· 48 48 #define SPI0_OFFSET 0x204000 49 49 #define BSC0_OFFSET 0x205000 /* BSC0 I2C/TWI */ 50 50 #define OTP_OFFSET 0x20f000 51 + #define THERMAL_OFFSET 0x212000 51 52 #define BSC_SL_OFFSET 0x214000 /* SPI slave */ 52 53 #define AUX_OFFSET 0x215000 /* AUX: UART1/SPI1/SPI2 */ 53 54 #define EMMC1_OFFSET 0x300000