[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/29] hw/arm: Connect OTP device to BCM2835
From: |
Peter Maydell |
Subject: |
[PULL 02/29] hw/arm: Connect OTP device to BCM2835 |
Date: |
Mon, 1 Jul 2024 17:07:02 +0100 |
From: Rayhan Faizel <rayhan.faizel@gmail.com>
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>
---
include/hw/arm/bcm2835_peripherals.h | 3 ++-
hw/arm/bcm2835_peripherals.c | 13 ++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/hw/arm/bcm2835_peripherals.h
b/include/hw/arm/bcm2835_peripherals.h
index 636203baa5a..1eeaeec9e0e 100644
--- a/include/hw/arm/bcm2835_peripherals.h
+++ b/include/hw/arm/bcm2835_peripherals.h
@@ -33,6 +33,7 @@
#include "hw/usb/hcd-dwc2.h"
#include "hw/ssi/bcm2835_spi.h"
#include "hw/i2c/bcm2835_i2c.h"
+#include "hw/nvram/bcm2835_otp.h"
#include "hw/misc/unimp.h"
#include "qom/object.h"
@@ -71,7 +72,7 @@ struct BCMSocPeripheralBaseState {
BCM2835SPIState spi[1];
BCM2835I2CState i2c[3];
OrIRQState orgated_i2c_irq;
- UnimplementedDeviceState otp;
+ BCM2835OTPState otp;
UnimplementedDeviceState dbus;
UnimplementedDeviceState ave0;
UnimplementedDeviceState v3d;
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 1695d8b453a..7d735bb56cf 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -116,6 +116,10 @@ static void raspi_peripherals_base_init(Object *obj)
object_property_add_const_link(OBJECT(&s->fb), "dma-mr",
OBJECT(&s->gpu_bus_mr));
+ /* OTP */
+ object_initialize_child(obj, "bcm2835-otp", &s->otp,
+ TYPE_BCM2835_OTP);
+
/* Property channel */
object_initialize_child(obj, "property", &s->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,
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 */
if (!sysbus_realize(SYS_BUS_DEVICE(&s->property), errp)) {
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->smi, "bcm2835-smi", SMI_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->ave0, "bcm2835-ave0", AVE0_OFFSET, 0x8000);
create_unimp(s, &s->v3d, "bcm2835-v3d", V3D_OFFSET, 0x1000);
--
2.34.1
- [PULL 00/29] target-arm queue, Peter Maydell, 2024/07/01
- [PULL 05/29] tests/avocado: use default amount of cores on sbsa-ref, Peter Maydell, 2024/07/01
- [PULL 03/29] hw/misc: Implement mailbox properties for customer OTP and device specific private keys, Peter Maydell, 2024/07/01
- [PULL 26/29] docs/system/arm: Add a doc for zynq board, Peter Maydell, 2024/07/01
- [PULL 01/29] hw/nvram: Add BCM2835 OTP device, Peter Maydell, 2024/07/01
- [PULL 07/29] target/arm: Fix VCMLA Dd, Dn, Dm[idx], Peter Maydell, 2024/07/01
- [PULL 10/29] target/arm: Convert SQRDMLAH, SQRDMLSH to decodetree, Peter Maydell, 2024/07/01
- [PULL 04/29] tests/avocado: update firmware for sbsa-ref, Peter Maydell, 2024/07/01
- [PULL 02/29] hw/arm: Connect OTP device to BCM2835,
Peter Maydell <=
- [PULL 08/29] target/arm: Fix SQDMULH (by element) with Q=0, Peter Maydell, 2024/07/01
- [PULL 14/29] target/arm: Convert BFMLALB, BFMLALT to decodetree, Peter Maydell, 2024/07/01
- [PULL 06/29] hw/arm/smmu-common: Replace smmu_iommu_mr with smmu_find_sdev, Peter Maydell, 2024/07/01
- [PULL 21/29] target/arm: Move initialization of debug ID registers, Peter Maydell, 2024/07/01
- [PULL 11/29] target/arm: Convert SDOT, UDOT to decodetree, Peter Maydell, 2024/07/01
- [PULL 09/29] target/arm: Fix FJCVTZS vs flush-to-zero, Peter Maydell, 2024/07/01
- [PULL 16/29] target/arm: Add data argument to do_fp3_vector, Peter Maydell, 2024/07/01
- [PULL 22/29] target/arm: Enable FEAT_Debugv8p8 for -cpu max, Peter Maydell, 2024/07/01
- [PULL 19/29] target/arm: Delete dead code from disas_simd_indexed, Peter Maydell, 2024/07/01
- [PULL 24/29] hw/misc/zynq_slcr: Add boot-mode property, Peter Maydell, 2024/07/01