mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-02 23:11:53 -06:00
hw/arm: Connect OTP device to BCM2835
Replace stubbed OTP memory region with the new OTP device. Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
c1bf754041
commit
6bf7993921
2 changed files with 14 additions and 2 deletions
|
@ -116,6 +116,10 @@ static void raspi_peripherals_base_init(Object *obj)
|
||||||
object_property_add_const_link(OBJECT(&s->fb), "dma-mr",
|
object_property_add_const_link(OBJECT(&s->fb), "dma-mr",
|
||||||
OBJECT(&s->gpu_bus_mr));
|
OBJECT(&s->gpu_bus_mr));
|
||||||
|
|
||||||
|
/* OTP */
|
||||||
|
object_initialize_child(obj, "bcm2835-otp", &s->otp,
|
||||||
|
TYPE_BCM2835_OTP);
|
||||||
|
|
||||||
/* Property channel */
|
/* Property channel */
|
||||||
object_initialize_child(obj, "property", &s->property,
|
object_initialize_child(obj, "property", &s->property,
|
||||||
TYPE_BCM2835_PROPERTY);
|
TYPE_BCM2835_PROPERTY);
|
||||||
|
@ -374,6 +378,14 @@ void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp)
|
||||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->fb), 0,
|
sysbus_connect_irq(SYS_BUS_DEVICE(&s->fb), 0,
|
||||||
qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB));
|
qdev_get_gpio_in(DEVICE(&s->mboxes), MBOX_CHAN_FB));
|
||||||
|
|
||||||
|
/* OTP */
|
||||||
|
if (!sysbus_realize(SYS_BUS_DEVICE(&s->otp), errp)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memory_region_add_subregion(&s->peri_mr, OTP_OFFSET,
|
||||||
|
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->otp), 0));
|
||||||
|
|
||||||
/* Property channel */
|
/* Property channel */
|
||||||
if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), errp)) {
|
if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), errp)) {
|
||||||
return;
|
return;
|
||||||
|
@ -500,7 +512,6 @@ void bcm_soc_peripherals_common_realize(DeviceState *dev, Error **errp)
|
||||||
create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100);
|
create_unimp(s, &s->i2s, "bcm2835-i2s", I2S_OFFSET, 0x100);
|
||||||
create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100);
|
create_unimp(s, &s->smi, "bcm2835-smi", SMI_OFFSET, 0x100);
|
||||||
create_unimp(s, &s->bscsl, "bcm2835-spis", BSC_SL_OFFSET, 0x100);
|
create_unimp(s, &s->bscsl, "bcm2835-spis", BSC_SL_OFFSET, 0x100);
|
||||||
create_unimp(s, &s->otp, "bcm2835-otp", OTP_OFFSET, 0x80);
|
|
||||||
create_unimp(s, &s->dbus, "bcm2835-dbus", DBUS_OFFSET, 0x8000);
|
create_unimp(s, &s->dbus, "bcm2835-dbus", DBUS_OFFSET, 0x8000);
|
||||||
create_unimp(s, &s->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000);
|
create_unimp(s, &s->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000);
|
||||||
create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000);
|
create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000);
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "hw/usb/hcd-dwc2.h"
|
#include "hw/usb/hcd-dwc2.h"
|
||||||
#include "hw/ssi/bcm2835_spi.h"
|
#include "hw/ssi/bcm2835_spi.h"
|
||||||
#include "hw/i2c/bcm2835_i2c.h"
|
#include "hw/i2c/bcm2835_i2c.h"
|
||||||
|
#include "hw/nvram/bcm2835_otp.h"
|
||||||
#include "hw/misc/unimp.h"
|
#include "hw/misc/unimp.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ struct BCMSocPeripheralBaseState {
|
||||||
BCM2835SPIState spi[1];
|
BCM2835SPIState spi[1];
|
||||||
BCM2835I2CState i2c[3];
|
BCM2835I2CState i2c[3];
|
||||||
OrIRQState orgated_i2c_irq;
|
OrIRQState orgated_i2c_irq;
|
||||||
UnimplementedDeviceState otp;
|
BCM2835OTPState otp;
|
||||||
UnimplementedDeviceState dbus;
|
UnimplementedDeviceState dbus;
|
||||||
UnimplementedDeviceState ave0;
|
UnimplementedDeviceState ave0;
|
||||||
UnimplementedDeviceState v3d;
|
UnimplementedDeviceState v3d;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue