Skip to contentSkip to conversation

Add the ZynqMP PMU and IPI

PATCH Superseded Alistair Francis 3 participants 13 messages Sep 20, 2017 – Oct 12, 2017 Arm/Zynq architecture

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add the ZynqMP PMU and IPI

This series adds the ZynqMP Power Management Unit (PMU) machine with basic functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

connected, but that is enough to run some of the ROM and firmware code on the machine

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the ARM and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

 default-configs/aarch64-softmmu.mak    |   1 +
 default-configs/microblaze-softmmu.mak |   1 +
 hw/arm/Makefile.objs                   |   2 +-
 hw/arm/xlnx-zynqmp.c                   |  14 +
 hw/display/Makefile.objs               |   2 +-
 hw/dma/Makefile.objs                   |   2 +-
 hw/intc/Makefile.objs                  |   2 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 hw/intc/xlnx-zynqmp-ipi.c              | 377 ++++++++++++++++++++++
 hw/microblaze/Makefile.objs            |   1 +
 hw/microblaze/xlnx-zynqmp-pmu.c        | 200 ++++++++++++
 include/hw/arm/xlnx-zynqmp.h           |   2 +
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 include/hw/intc/xlnx-zynqmp-ipi.h      |  57 ++++
 14 files changed, 1270 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h
Signature · 1 line
2.11.0
#1 lore raw

PATCH v3 1/8 xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU

The Xilinx ZynqMP SoC has two main processing systems in it. The ARM processing system (which is already modeled in QEMU) and the MicroBlaze Power Management Unit (PMU). This is the inital work for adding support for the PMU.

The PMU susbsystem runs along side the ARM system on hardware, but due to architecture limitations in QEMU the two instances are seperate for the time being.

Let's follow the same setup we do with the ARM system, where there is an SoC device and a ZCU102 board. Although the PMU is less board specific we are still going to follow the same split as maybe in future we can connect the PMU device to the ARM ZCU102 board. As the machine will be fairly small let's keep them both together in one file.

---

 hw/microblaze/Makefile.objs     |  1 +
 hw/microblaze/xlnx-zynqmp-pmu.c | 83 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
hw/microblaze/Makefile.objs +1 -0
index b2517d87fe..ae9fd40de7 100644
@@ -1,3 +1,4 @@
 obj-y += petalogix_s3adsp1800_mmu.o
 obj-y += petalogix_ml605_mmu.o
+obj-y += xlnx-zynqmp-pmu.o
 obj-y += boot.o
hw/microblaze/xlnx-zynqmp-pmu.c new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
2.11.0
#2 lore raw

PATCH v3 2/8 xlnx-zynqmp-pmu: Add the CPU and memory

In reply to Alistair Francis

Connect the MicroBlaze CPU and the ROM and RAM memory regions.

---
V2:
- Fix the pmu-cpu name
- Use err and errp for CPU realise instead of error_fatal

 hw/microblaze/xlnx-zynqmp-pmu.c | 70 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 68 insertions(+), 2 deletions(-)
hw/microblaze/xlnx-zynqmp-pmu.c +68 -2
index fc3c8b236f..b643125704 100644
@@ -18,8 +18,11 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu-common.h"
+#include "exec/address-spaces.h"
 #include "hw/boards.h"
+#include "hw/qdev-properties.h"
 #include "cpu.h"
+#include "boot.h"
 
 /* Define the PMU device */
 
@@ -27,21 +30,56 @@
 #define XLNX_ZYNQMP_PMU(obj) OBJECT_CHECK(XlnxZynqMPPMUState, (obj), \
                                           TYPE_XLNX_ZYNQMP_PMU)
 
+#define XLNX_ZYNQMP_PMU_ROM_SIZE    0x8000
+#define XLNX_ZYNQMP_PMU_ROM_ADDR    0xFFD00000
+#define XLNX_ZYNQMP_PMU_RAM_ADDR    0xFFDC0000
+
 typedef struct XlnxZynqMPPMUState {
     /*< private >*/
     DeviceState parent_obj;
 
     /*< public >*/
+    MicroBlazeCPU cpu;
 }  XlnxZynqMPPMUState;
 
 static void xlnx_zynqmp_pmu_init(Object *obj)
 {
+    XlnxZynqMPPMUState *s = XLNX_ZYNQMP_PMU(obj);
 
+    object_initialize(&s->cpu, sizeof(s->cpu),
+                      TYPE_MICROBLAZE_CPU);
+    object_property_add_child(obj, "pmu-cpu", OBJECT(&s->cpu),
+                              &error_abort);
 }
 
 static void xlnx_zynqmp_pmu_realize(DeviceState *dev, Error **errp)
 {
-
+    XlnxZynqMPPMUState *s = XLNX_ZYNQMP_PMU(dev);
+    Error *err = NULL;
+
+    object_property_set_uint(OBJECT(&s->cpu), XLNX_ZYNQMP_PMU_ROM_ADDR,
+                             "base-vectors", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-stack-protection",
+                             &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "use-fpu", &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "use-hw-mul", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-barrel",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-msr-instr",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "use-pcmp-instr",
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), false, "use-mmu", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "endianness",
+                             &error_abort);
+    object_property_set_str(OBJECT(&s->cpu), "8.40.b", "version",
+                            &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), 0, "pvr", &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), true, "realized", &err);
+    if (err) {
+        error_propagate(errp, err);
+        return;
+    }
 }
 
 static void xlnx_zynqmp_pmu_class_init(ObjectClass *oc, void *data)
@@ -70,7 +108,35 @@ type_init(xlnx_zynqmp_pmu_register_types)
 
 static void xlnx_zcu102_pmu_init(MachineState *machine)
 {
-
+    XlnxZynqMPPMUState *pmu = g_new0(XlnxZynqMPPMUState, 1);
+    MemoryRegion *address_space_mem = get_system_memory();
+    MemoryRegion *pmu_rom = g_new(MemoryRegion, 1);
+    MemoryRegion *pmu_ram = g_new(MemoryRegion, 1);
+
+    /* Create the ROM */
+    memory_region_init_rom(pmu_rom, NULL, "xlnx-zcu102-pmu.rom",
+                           XLNX_ZYNQMP_PMU_ROM_SIZE, &error_fatal);
+    memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_ROM_ADDR,
+                                pmu_rom);
+
+    /* Create the RAM */
+    memory_region_init_ram(pmu_ram, NULL, "xlnx-zcu102-pmu.ram",
+                           machine->ram_size, &error_fatal);
+    memory_region_add_subregion(address_space_mem, XLNX_ZYNQMP_PMU_RAM_ADDR,
+                                pmu_ram);
+
+    /* Create the PMU device */
+    object_initialize(pmu, sizeof(XlnxZynqMPPMUState), TYPE_XLNX_ZYNQMP_PMU);
+    object_property_add_child(OBJECT(machine), "pmu", OBJECT(pmu),
+                              &error_abort);
+    object_property_set_bool(OBJECT(pmu), true, "realized", &error_fatal);
+
+    /* Load the kernel */
+    microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR,
+                           machine->ram_size,
+                           machine->kernel_filename,
+                           machine->dtb,
+                           NULL);
 }
 
 static void xlnx_zcu102_pmu_machine_init(MachineClass *mc)
Signature · 1 line
2.11.0
#3 lore raw

PATCH v3 3/8 aarch64-softmmu.mak: Use an ARM specific config

In reply to Alistair Francis

In preperation for having an ARM and MicroBlaze ZynqMP machine let's split out the current ARM specific config options.

---

 default-configs/aarch64-softmmu.mak | 1 +
 hw/arm/Makefile.objs                | 2 +-
 hw/display/Makefile.objs            | 2 +-
 hw/dma/Makefile.objs                | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)
default-configs/aarch64-softmmu.mak +1 -0
index 24494832cf..9ddccf855e 100644
@@ -7,3 +7,4 @@ CONFIG_AUX=y
 CONFIG_DDC=y
 CONFIG_DPCD=y
 CONFIG_XLNX_ZYNQMP=y
+CONFIG_XLNX_ZYNQMP_ARM=y
hw/arm/Makefile.objs +1 -1
index 5ee6f7da5b..01138b05f5 100644
@@ -13,7 +13,7 @@ obj-y += omap1.o omap2.o strongarm.o
 obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
 obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
 obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-zcu102.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx-zynqmp.o xlnx-zcu102.o
 obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
 obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
 obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
hw/display/Makefile.objs +1 -1
index 551c050a6a..d3a4cb396e 100644
@@ -40,4 +40,4 @@ virtio-gpu.o-libs += $(VIRGL_LIBS)
 virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS)
 virtio-gpu-3d.o-libs += $(VIRGL_LIBS)
 obj-$(CONFIG_DPCD) += dpcd.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dp.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o
hw/dma/Makefile.objs +1 -1
index 087c8e6855..be98d5d3d8 100644
@@ -9,7 +9,7 @@ common-obj-$(CONFIG_ZYNQ_DEVCFG) += xlnx-zynq-devcfg.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_dma.o
 common-obj-$(CONFIG_STP2000) += sparc32_dma.o
 common-obj-$(CONFIG_SUN4M) += sun4m_iommu.o
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx_dpdma.o
+obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dpdma.o
 
 obj-$(CONFIG_OMAP) += omap_dma.o soc_dma.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_dma.o
Signature · 1 line
2.11.0
#4 lore raw

PATCH v3 4/8 xlnx-pmu-iomod-intc: Add the PMU Interrupt controller

In reply to Alistair Francis

Add the PMU IO Module Interrupt controller device.

---

 default-configs/microblaze-softmmu.mak |   1 +
 hw/intc/Makefile.objs                  |   1 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 4 files changed, 614 insertions(+)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
default-configs/microblaze-softmmu.mak +1 -0
index ce2630818a..7fca8e4c99 100644
@@ -9,3 +9,4 @@ CONFIG_XILINX_SPI=y
 CONFIG_XILINX_ETHLITE=y
 CONFIG_SSI=y
 CONFIG_SSI_M25P80=y
+CONFIG_XLNX_ZYNQMP=y
hw/intc/Makefile.objs +1 -0
index 78426a7daf..0fce61e2ce 100644
@@ -3,6 +3,7 @@ common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-$(CONFIG_PL190) += pl190.o
 common-obj-$(CONFIG_PUV3) += puv3_intc.o
 common-obj-$(CONFIG_XILINX) += xilinx_intc.o
+common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-pmu-iomod-intc.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o
 common-obj-$(CONFIG_IMX) += imx_avic.o
 common-obj-$(CONFIG_LM32) += lm32_pic.o
hw/intc/xlnx-pmu-iomod-intc.c new file +554 -0

554 lines not on this page · raw message

include/hw/intc/xlnx-pmu-iomod-intc.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.11.0
#5 lore raw

PATCH v3 6/8 xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device

In reply to Alistair Francis

This is the initial version of the Inter Processor Interrupt device.

---

 hw/intc/Makefile.objs             |   1 +
 hw/intc/xlnx-zynqmp-ipi.c         | 377 ++++++++++++++++++++++++++++++++++++++
 include/hw/intc/xlnx-zynqmp-ipi.h |  57 ++++++
 3 files changed, 435 insertions(+)
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h
hw/intc/Makefile.objs +1 -0
index 0fce61e2ce..8497d05695 100644
@@ -4,6 +4,7 @@ common-obj-$(CONFIG_PL190) += pl190.o
 common-obj-$(CONFIG_PUV3) += puv3_intc.o
 common-obj-$(CONFIG_XILINX) += xilinx_intc.o
 common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-pmu-iomod-intc.o
+common-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp-ipi.o
 common-obj-$(CONFIG_ETRAXFS) += etraxfs_pic.o
 common-obj-$(CONFIG_IMX) += imx_avic.o
 common-obj-$(CONFIG_LM32) += lm32_pic.o
hw/intc/xlnx-zynqmp-ipi.c new file +377 -0

377 lines not on this page · raw message

include/hw/intc/xlnx-zynqmp-ipi.h new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.11.0
#6 lore raw

PATCH v3 7/8 xlnx-zynqmp-pmu: Connect the IPI device to the PMU

In reply to Alistair Francis

---

 hw/microblaze/xlnx-zynqmp-pmu.c | 40 ++++++++++++++++++++++++++++++++++------
 1 file changed, 34 insertions(+), 6 deletions(-)
hw/microblaze/xlnx-zynqmp-pmu.c +34 -6
index ca98d82e87..2016e34db6 100644
@@ -24,6 +24,7 @@
 #include "cpu.h"
 #include "boot.h"
 
+#include "hw/intc/xlnx-zynqmp-ipi.h"
 #include "hw/intc/xlnx-pmu-iomod-intc.h"
 
 /* Define the PMU device */
@@ -38,18 +39,28 @@
 
 #define XLNX_ZYNQMP_PMU_INTC_ADDR   0xFFD40000
 
+#define XLNX_ZYNQMP_PMU_NUM_IPIS    4
+static const uint64_t ipi_addr[XLNX_ZYNQMP_PMU_NUM_IPIS] = {
+    0xFF340000, 0xFF350000, 0xFF360000, 0xFF370000,
+};
+static const uint64_t ipi_irq[XLNX_ZYNQMP_PMU_NUM_IPIS] = {
+    19, 20, 21, 22,
+};
+
 typedef struct XlnxZynqMPPMUState {
     /*< private >*/
     DeviceState parent_obj;
 
     /*< public >*/
     MicroBlazeCPU cpu;
+    XlnxZynqMPIPI ipi[XLNX_ZYNQMP_PMU_NUM_IPIS];
     XlnxPMUIOIntc intc;
 }  XlnxZynqMPPMUState;
 
 static void xlnx_zynqmp_pmu_init(Object *obj)
 {
     XlnxZynqMPPMUState *s = XLNX_ZYNQMP_PMU(obj);
+    int i;
 
     object_initialize(&s->cpu, sizeof(s->cpu),
                       TYPE_MICROBLAZE_CPU);
@@ -58,12 +69,19 @@ static void xlnx_zynqmp_pmu_init(Object *obj)
 
     object_initialize(&s->intc, sizeof(s->intc), TYPE_XLNX_PMU_IO_INTC);
     qdev_set_parent_bus(DEVICE(&s->intc), sysbus_get_default());
+
+   for (i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
+        object_initialize(&s->ipi[i], sizeof(s->ipi[i]), TYPE_XLNX_ZYNQMP_IPI);
+        qdev_set_parent_bus(DEVICE(&s->ipi[i]), sysbus_get_default());
+    }
 }
 
 static void xlnx_zynqmp_pmu_realize(DeviceState *dev, Error **errp)
 {
     XlnxZynqMPPMUState *s = XLNX_ZYNQMP_PMU(dev);
     Error *err = NULL;
+    qemu_irq irq[32];
+    int i;
 
     object_property_set_uint(OBJECT(&s->cpu), XLNX_ZYNQMP_PMU_ROM_ADDR,
                              "base-vectors", &error_abort);
@@ -89,12 +107,9 @@ static void xlnx_zynqmp_pmu_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    object_property_set_uint(OBJECT(&s->intc), 0x10, "intc-intr-size",
-                             &error_abort);
-    object_property_set_uint(OBJECT(&s->intc), 0x0, "intc-level-edge",
-                             &error_abort);
-    object_property_set_uint(OBJECT(&s->intc), 0xffff, "intc-positive",
-                             &error_abort);
+    object_property_set_uint(OBJECT(&s->intc), 0x10, "intc-intr-size", &error_abort);
+    object_property_set_uint(OBJECT(&s->intc), 0x0, "intc-level-edge", &error_abort);
+    object_property_set_uint(OBJECT(&s->intc), 0xffff, "intc-positive", &error_abort);
     object_property_set_bool(OBJECT(&s->intc), true, "realized", &err);
     if (err) {
         error_propagate(errp, err);
@@ -103,6 +118,19 @@ static void xlnx_zynqmp_pmu_realize(DeviceState *dev, Error **errp)
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->intc), 0, XLNX_ZYNQMP_PMU_INTC_ADDR);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->intc), 0,
                        qdev_get_gpio_in(DEVICE(&s->cpu), MB_CPU_IRQ));
+    for (i = 0; i < 32; i++) {
+        irq[i] = qdev_get_gpio_in(DEVICE(&s->intc), i);
+    }
+
+    for (i = 0; i < XLNX_ZYNQMP_PMU_NUM_IPIS; i++) {
+        object_property_set_bool(OBJECT(&s->ipi[i]), true, "realized", &err);
+        if (err) {
+            error_propagate(errp, err);
+            return;
+        }
+        sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi[i]), 0, ipi_addr[i]);
+        sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi[i]), 0, irq[ipi_irq[i]]);
+    }
 }
 
 static void xlnx_zynqmp_pmu_class_init(ObjectClass *oc, void *data)
Signature · 1 line
2.11.0
#7 lore raw

PATCH v3 8/8 xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

In reply to Alistair Francis

---

 hw/arm/xlnx-zynqmp.c         | 14 ++++++++++++++
 include/hw/arm/xlnx-zynqmp.h |  2 ++
 2 files changed, 16 insertions(+)
hw/arm/xlnx-zynqmp.c +14 -0
index 2b27daf51d..8aa1f02c62 100644
@@ -46,6 +46,9 @@
 #define DPDMA_ADDR          0xfd4c0000
 #define DPDMA_IRQ           116
 
+#define IPI_ADDR            0xFF300000
+#define IPI_IRQ             64
+
 static const uint64_t gem_addr[XLNX_ZYNQMP_NUM_GEMS] = {
     0xFF0B0000, 0xFF0C0000, 0xFF0D0000, 0xFF0E0000,
 };
@@ -174,6 +177,9 @@ static void xlnx_zynqmp_init(Object *obj)
 
     object_initialize(&s->dpdma, sizeof(s->dpdma), TYPE_XLNX_DPDMA);
     qdev_set_parent_bus(DEVICE(&s->dpdma), sysbus_get_default());
+
+    object_initialize(&s->ipi, sizeof(s->ipi), TYPE_XLNX_ZYNQMP_IPI);
+    qdev_set_parent_bus(DEVICE(&s->ipi), sysbus_get_default());
 }
 
 static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
@@ -422,6 +428,14 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
                              &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->dpdma), 0, DPDMA_ADDR);
     sysbus_connect_irq(SYS_BUS_DEVICE(&s->dpdma), 0, gic_spi[DPDMA_IRQ]);
+
+    object_property_set_bool(OBJECT(&s->ipi), true, "realized", &err);
+    if (err) {
+        error_propagate(errp, err);
+        return;
+    }
+    sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi), 0, IPI_ADDR);
+    sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi), 0, gic_spi[IPI_IRQ]);
 }
 
 static Property xlnx_zynqmp_props[] = {
include/hw/arm/xlnx-zynqmp.h +2 -0
index 6eff81a995..dad2bda7b2 100644
@@ -28,6 +28,7 @@
 #include "hw/ssi/xilinx_spips.h"
 #include "hw/dma/xlnx_dpdma.h"
 #include "hw/display/xlnx_dp.h"
+#include "hw/intc/xlnx-zynqmp-ipi.h"
 
 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp"
 #define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \
@@ -85,6 +86,7 @@ typedef struct XlnxZynqMPState {
     XilinxSPIPS spi[XLNX_ZYNQMP_NUM_SPIS];
     XlnxDPState dp;
     XlnxDPDMAState dpdma;
+    XlnxZynqMPIPI ipi;
 
     char *boot_cpu;
     ARMCPU *boot_cpu_ptr;
Signature · 1 line
2.11.0
#8 lore raw
In reply to Alistair Francis
Quoted 13 lines · Alistair Francis

This series adds the ZynqMP Power Management Unit (PMU) machine with basic functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

connected, but that is enough to run some of the ROM and firmware code on the machine

Quoted 8 lines

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the ARM and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Hi Alistair,

Sorry for the super long delay...

I think this mostly looks good but I was wondering if we really need to have a board specific (zcu102) PMU?

Best regards,
Edgar

Quoted 37 lines

Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

 default-configs/aarch64-softmmu.mak    |   1 +
 default-configs/microblaze-softmmu.mak |   1 +
 hw/arm/Makefile.objs                   |   2 +-
 hw/arm/xlnx-zynqmp.c                   |  14 +
 hw/display/Makefile.objs               |   2 +-
 hw/dma/Makefile.objs                   |   2 +-
 hw/intc/Makefile.objs                  |   2 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 hw/intc/xlnx-zynqmp-ipi.c              | 377 ++++++++++++++++++++++
 hw/microblaze/Makefile.objs            |   1 +
 hw/microblaze/xlnx-zynqmp-pmu.c        | 200 ++++++++++++
 include/hw/arm/xlnx-zynqmp.h           |   2 +
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 include/hw/intc/xlnx-zynqmp-ipi.h      |  57 ++++
 14 files changed, 1270 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h
Signature · 1 line
2.11.0
#9 lore raw
Quoted 23 lines · Edgar E. Iglesias
Quoted 13 lines · Alistair Francis

This series adds the ZynqMP Power Management Unit (PMU) machine with basic functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

connected, but that is enough to run some of the ROM and firmware code on the machine

Quoted 8 lines

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the ARM and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Quoted 7 lines

Hi Alistair,

Sorry for the super long delay...

I think this mostly looks good but I was wondering if we really need to have a board specific (zcu102) PMU?

It doesn't have to be board specific. What I wanted though was an SoC and a machine so that maybe one day we could add the PMU SoC to the ARM ZCU102 machine. After that it was hard to think of a name to differentiate the SoC and the machine. Do you have a recommendation on names?

Thanks,
Alistair

Quoted 43 lines

Best regards,
Edgar

Quoted 37 lines

Alistair Francis (8):
xlnx-zynqmp-pmu: Initial commit of the ZynqMP PMU
xlnx-zynqmp-pmu: Add the CPU and memory aarch64-softmmu.mak: Use an ARM specific config
xlnx-pmu-iomod-intc: Add the PMU Interrupt controller
xlnx-zynqmp-pmu: Connect the PMU interrupt controller
xlnx-zynqmp-ipi: Initial version of the Xilinx IPI device
xlnx-zynqmp-pmu: Connect the IPI device to the PMU
xlnx-zynqmp: Connect the IPI device to the ZynqMP SoC

 default-configs/aarch64-softmmu.mak    |   1 +
 default-configs/microblaze-softmmu.mak |   1 +
 hw/arm/Makefile.objs                   |   2 +-
 hw/arm/xlnx-zynqmp.c                   |  14 +
 hw/display/Makefile.objs               |   2 +-
 hw/dma/Makefile.objs                   |   2 +-
 hw/intc/Makefile.objs                  |   2 +
 hw/intc/xlnx-pmu-iomod-intc.c          | 554 +++++++++++++++++++++++++++++++++
 hw/intc/xlnx-zynqmp-ipi.c              | 377 ++++++++++++++++++++++
 hw/microblaze/Makefile.objs            |   1 +
 hw/microblaze/xlnx-zynqmp-pmu.c        | 200 ++++++++++++
 include/hw/arm/xlnx-zynqmp.h           |   2 +
 include/hw/intc/xlnx-pmu-iomod-intc.h  |  58 ++++
 include/hw/intc/xlnx-zynqmp-ipi.h      |  57 ++++
 14 files changed, 1270 insertions(+), 3 deletions(-)
 create mode 100644 hw/intc/xlnx-pmu-iomod-intc.c
 create mode 100644 hw/intc/xlnx-zynqmp-ipi.c
 create mode 100644 hw/microblaze/xlnx-zynqmp-pmu.c
 create mode 100644 include/hw/intc/xlnx-pmu-iomod-intc.h
 create mode 100644 include/hw/intc/xlnx-zynqmp-ipi.h

--
2.11.0

#10 lore raw
Quoted 30 lines · Alistair Francis
Quoted 28 lines · Edgar E. Iglesias
Quoted 13 lines · Alistair Francis

This series adds the ZynqMP Power Management Unit (PMU) machine with basic functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

connected, but that is enough to run some of the ROM and firmware code on the machine

Quoted 8 lines

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the ARM and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Hi Alistair,

Sorry for the super long delay...

Quoted 8 lines
Quoted 2 lines

I think this mostly looks good but I was wondering if we really need to have a board specific (zcu102) PMU?

It doesn't have to be board specific. What I wanted though was an SoC and a machine so that maybe one day we could add the PMU SoC to the ARM ZCU102 machine. After that it was hard to think of a name to differentiate the SoC and the machine. Do you have a recommendation on names?

Hi Alistair,

Yes, I agree with your approach but I got a little confused by the names.

I think all the stuff that is inside the PMU subsystem architecture-wise should have generic PMU names (no ZCU102). I.e the ROM, the RAM, the IOModule, interrupt controller etc.

The IPI block can be outside of the PMU module and be instantiated by the board or perhaps better if we could reuse some of the ZynqMP modules instantiated by the ZCU102 machine to get a CPU-less PS for the PMU to interact with. Or something along those lines.
How does that sound?

Best regards,
Edgar

#11 lore raw
Quoted 41 lines · Edgar E. Iglesias
Quoted 30 lines · Alistair Francis
Quoted 28 lines · Edgar E. Iglesias
Quoted 13 lines · Alistair Francis

This series adds the ZynqMP Power Management Unit (PMU) machine with basic functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

connected, but that is enough to run some of the ROM and firmware code on the machine

Quoted 8 lines

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the ARM and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Hi Alistair,

Sorry for the super long delay...

Quoted 8 lines
Quoted 2 lines

I think this mostly looks good but I was wondering if we really need to have a board specific (zcu102) PMU?

It doesn't have to be board specific. What I wanted though was an SoC and a machine so that maybe one day we could add the PMU SoC to the ARM ZCU102 machine. After that it was hard to think of a name to differentiate the SoC and the machine. Do you have a recommendation on names?

Quoted 7 lines

Hi Alistair,

Yes, I agree with your approach but I got a little confused by the names.

I think all the stuff that is inside the PMU subsystem architecture-wise should have generic PMU names (no ZCU102). I.e the ROM, the RAM, the IOModule, interrupt controller etc.

Ok I can rename them to the ZynqMP PMU (the machine/board) and the ZynqMP PMU SoC. Does that work?

Quoted 6 lines

The IPI block can be outside of the PMU module and be instantiated by the board or perhaps better if we could reuse some of the ZynqMP modules instantiated by the ZCU102 machine to get a CPU-less PS for the PMU to interact with. Or something along those lines.
How does that sound?>

I'm a little unclear what you mean here.

Thanks,
Alistair

Quoted 3 lines

Best regards,
Edgar

#12 lore raw

On Oct 10, 2017 7:59 PM, "Alistair Francis" <[email protected]> wrote:

Quoted 6 lines · Edgar E. Iglesias
Quoted 5 lines · Alistair Francis
Quoted 3 lines · Edgar E. Iglesias
Quoted 2 lines · Alistair Francis

This series adds the ZynqMP Power Management Unit (PMU) machine with

basic

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

functionality.

The machine only has the
- CPU
- Memory
- Interrupt controller
- IPI device

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

connected, but that is enough to run some of the ROM and firmware code on the machine

The series also adds the IPI device and connects it to the ZynqMP ARM side and the ZynqMP PMU. These IPI devices don't connect between the

ARM

Quoted 22 lines
Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

and MicroBlaze instances though.

v3:
- Add the interrupt controller
- Replace some of the error_fatals with errp
- Fix the PMU CPU name

Hi Alistair,

Sorry for the super long delay...

Quoted 8 lines
Quoted 2 lines

I think this mostly looks good but I was wondering if we really need to have a board specific (zcu102) PMU?

It doesn't have to be board specific. What I wanted though was an SoC and a machine so that maybe one day we could add the PMU SoC to the ARM ZCU102 machine. After that it was hard to think of a name to differentiate the SoC and the machine. Do you have a recommendation on names?

Quoted 6 lines

Hi Alistair,

Yes, I agree with your approach but I got a little confused by the names.

I think all the stuff that is inside the PMU subsystem architecture-wise should have generic PMU names (no ZCU102). I.e the ROM, the RAM, the

IOModule,

Quoted 1 line

interrupt controller etc.

Ok I can rename them to the ZynqMP PMU (the machine/board) and the ZynqMP PMU SoC. Does that work?

Quoted 6 lines

The IPI block can be outside of the PMU module and be instantiated by the board or perhaps better if we could reuse some of the ZynqMP modules instantiated by the ZCU102 machine to get a CPU-less PS for the PMU to interact with. Or something along those lines.
How does that sound?>

I'm a little unclear what you mean here.

Thanks,
Alistair

Quoted 3 lines

Best regards,
Edgar

Hi Alistair,

To clarify, if you create a pmu object, try to only put stuff in that object that belong to the pmu subsystem. The IPI block for example doesn't, it belongs outside of the pmu object allthough you will want to instate an ipi instance in the pmu machine.

Hope that helps
Edgar

Sent from my phone