aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-06 17:02:42 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-06 17:02:42 +0100
commit76462405809d29bab65a3699686998ba124ab942 (patch)
treea00c97255db11fc654c09349c06fc3581b872e02 /include/hw
parent280b2358cd1fc88003773bff3c4d4219f8bd3ae6 (diff)
parent0c18c6c67e06859ef354b697cce567ebe29061f1 (diff)
downloadqemu-76462405809d29bab65a3699686998ba124ab942.zip
qemu-76462405809d29bab65a3699686998ba124ab942.tar.gz
qemu-76462405809d29bab65a3699686998ba124ab942.tar.bz2
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160606-1' into staging
target-arm queue: * support instruction syndrome info for data aborts from A64 to EL2 * add HSTR_EL2 register * fix incorrect ESR IL bits in various syndrome register cases * virt: fix limit of 64-bit ACPI/ECAM PCI MMIO range * gicv2: RAZ/WI non-sec access to sec interrupts * i2c: add aspeed i2c controller * virt: Reject gic-version=host for non-KVM (don't segv on aarch64 host) * xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions * xlnx-zynqmp: Support KVM on AArch64 hosts * ptimer: Various fixes for awkward corner cases * char: QOMify various ARM UART models * char: get rid of qemu_char_get_next_serial * target-arm: Fix TTBR selecting logic on AArch32 Stage 2 translation * zynqmp: Add the ZCU102 board # gpg: Signature made Mon 06 Jun 2016 17:01:11 BST # gpg: using RSA key 0x3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" * remotes/pmaydell/tags/pull-target-arm-20160606-1: (25 commits) zynqmp: Add the ZCU102 board target-arm: Fix TTBR selecting logic on AArch32 Stage 2 translation char: get rid of qemu_char_get_next_serial hw/char: QOM'ify xilinx_uartlite model hw/char: QOM'ify stm32f2xx_usart model hw/char: QOM'ify digic-uart model hw/char: QOM'ify cadence_uart model hw/char: QOM'ify pl011 model hw/ptimer: Introduce ptimer_get_limit hw/ptimer: Support "on the fly" timer mode switch hw/ptimer: Update .delta on period/freq change hw/ptimer: Perform counter wrap around if timer already expired hw/ptimer: Fix issues caused by the adjusted timer limit value xlnx-zynqmp: Use the in kernel GIC model for KVM runs xlnx-zynqmp: Delay realization of GIC until post CPU realization xlnx-zynqmp: Make the RPU subsystem optional xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions hw/arm/virt: Reject gic-version=host for non-KVM i2c: add aspeed i2c controller hw/intc/gic: RAZ/WI non-sec access to sec interrupts ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/arm/ast2400.h2
-rw-r--r--include/hw/arm/xlnx-zynqmp.h5
-rw-r--r--include/hw/char/cadence_uart.h17
-rw-r--r--include/hw/char/pl011.h52
-rw-r--r--include/hw/char/xilinx_uartlite.h35
-rw-r--r--include/hw/i2c/aspeed_i2c.h62
-rw-r--r--include/hw/ptimer.h1
7 files changed, 174 insertions, 0 deletions
diff --git a/include/hw/arm/ast2400.h b/include/hw/arm/ast2400.h
index f16a1ed..c05ed53 100644
--- a/include/hw/arm/ast2400.h
+++ b/include/hw/arm/ast2400.h
@@ -15,6 +15,7 @@
#include "hw/arm/arm.h"
#include "hw/intc/aspeed_vic.h"
#include "hw/timer/aspeed_timer.h"
+#include "hw/i2c/aspeed_i2c.h"
typedef struct AST2400State {
/*< private >*/
@@ -25,6 +26,7 @@ typedef struct AST2400State {
MemoryRegion iomem;
AspeedVICState vic;
AspeedTimerCtrlState timerctrl;
+ AspeedI2CState i2c;
} AST2400State;
#define TYPE_AST2400 "ast2400"
diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
index 2332596..68f6eb0 100644
--- a/include/hw/arm/xlnx-zynqmp.h
+++ b/include/hw/arm/xlnx-zynqmp.h
@@ -84,6 +84,11 @@ typedef struct XlnxZynqMPState {
char *boot_cpu;
ARMCPU *boot_cpu_ptr;
+
+ /* Has the ARM Security extensions? */
+ bool secure;
+ /* Has the RPU subsystem? */
+ bool has_rpu;
} XlnxZynqMPState;
#define XLNX_ZYNQMP_H
diff --git a/include/hw/char/cadence_uart.h b/include/hw/char/cadence_uart.h
index 6310f52..a12773c 100644
--- a/include/hw/char/cadence_uart.h
+++ b/include/hw/char/cadence_uart.h
@@ -49,5 +49,22 @@ typedef struct {
QEMUTimer *fifo_trigger_handle;
} CadenceUARTState;
+static inline DeviceState *cadence_uart_create(hwaddr addr,
+ qemu_irq irq,
+ CharDriverState *chr)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, TYPE_CADENCE_UART);
+ s = SYS_BUS_DEVICE(dev);
+ qdev_prop_set_chr(dev, "chardev", chr);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(s, 0, addr);
+ sysbus_connect_irq(s, 0, irq);
+
+ return dev;
+}
+
#define CADENCE_UART_H
#endif
diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h
new file mode 100644
index 0000000..93bd7ee
--- /dev/null
+++ b/include/hw/char/pl011.h
@@ -0,0 +1,52 @@
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PL011_UART_H
+#define PL011_UART_H
+
+static inline DeviceState *pl011_create(hwaddr addr,
+ qemu_irq irq,
+ CharDriverState *chr)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, "pl011");
+ s = SYS_BUS_DEVICE(dev);
+ qdev_prop_set_chr(dev, "chardev", chr);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(s, 0, addr);
+ sysbus_connect_irq(s, 0, irq);
+
+ return dev;
+}
+
+static inline DeviceState *pl011_luminary_create(hwaddr addr,
+ qemu_irq irq,
+ CharDriverState *chr)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, "pl011_luminary");
+ s = SYS_BUS_DEVICE(dev);
+ qdev_prop_set_chr(dev, "chardev", chr);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(s, 0, addr);
+ sysbus_connect_irq(s, 0, irq);
+
+ return dev;
+}
+
+#endif
diff --git a/include/hw/char/xilinx_uartlite.h b/include/hw/char/xilinx_uartlite.h
new file mode 100644
index 0000000..8b4fc54
--- /dev/null
+++ b/include/hw/char/xilinx_uartlite.h
@@ -0,0 +1,35 @@
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2 or later, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef XILINX_UARTLITE_H
+#define XILINX_UARTLITE_H
+
+static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
+ qemu_irq irq,
+ CharDriverState *chr)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, "xlnx.xps-uartlite");
+ s = SYS_BUS_DEVICE(dev);
+ qdev_prop_set_chr(dev, "chardev", chr);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(s, 0, addr);
+ sysbus_connect_irq(s, 0, irq);
+
+ return dev;
+}
+
+#endif
diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h
new file mode 100644
index 0000000..f9020ac
--- /dev/null
+++ b/include/hw/i2c/aspeed_i2c.h
@@ -0,0 +1,62 @@
+/*
+ * ASPEED AST2400 I2C Controller
+ *
+ * Copyright (C) 2016 IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifndef ASPEED_I2C_H
+#define ASPEED_I2C_H
+
+#include "hw/i2c/i2c.h"
+
+#define TYPE_ASPEED_I2C "aspeed.i2c"
+#define ASPEED_I2C(obj) \
+ OBJECT_CHECK(AspeedI2CState, (obj), TYPE_ASPEED_I2C)
+
+#define ASPEED_I2C_NR_BUSSES 14
+
+struct AspeedI2CState;
+
+typedef struct AspeedI2CBus {
+ struct AspeedI2CState *controller;
+
+ MemoryRegion mr;
+
+ I2CBus *bus;
+ uint8_t id;
+
+ uint32_t ctrl;
+ uint32_t timing[2];
+ uint32_t intr_ctrl;
+ uint32_t intr_status;
+ uint32_t cmd;
+ uint32_t buf;
+} AspeedI2CBus;
+
+typedef struct AspeedI2CState {
+ SysBusDevice parent_obj;
+
+ MemoryRegion iomem;
+ qemu_irq irq;
+
+ uint32_t intr_status;
+
+ AspeedI2CBus busses[ASPEED_I2C_NR_BUSSES];
+} AspeedI2CState;
+
+I2CBus *aspeed_i2c_get_bus(DeviceState *dev, int busnr);
+
+#endif /* ASPEED_I2C_H */
diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h
index 8ebacbb..e397db5 100644
--- a/include/hw/ptimer.h
+++ b/include/hw/ptimer.h
@@ -19,6 +19,7 @@ typedef void (*ptimer_cb)(void *opaque);
ptimer_state *ptimer_init(QEMUBH *bh);
void ptimer_set_period(ptimer_state *s, int64_t period);
void ptimer_set_freq(ptimer_state *s, uint32_t freq);
+uint64_t ptimer_get_limit(ptimer_state *s);
void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload);
uint64_t ptimer_get_count(ptimer_state *s);
void ptimer_set_count(ptimer_state *s, uint64_t count);