summaryrefslogtreecommitdiffstats
path: root/include/hw/misc/macio/gpio.h
diff options
context:
space:
mode:
authorPeter Maydell2018-06-19 12:15:27 +0200
committerPeter Maydell2018-06-19 12:15:27 +0200
commite4a9a7303a70397a89ea23072419976032de4ddc (patch)
tree690ecdc7f52fe59230fb2e340326af5d7e4880ec /include/hw/misc/macio/gpio.h
parentMerge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request'... (diff)
parentspapr: fix xics_system_init() error path (diff)
downloadqemu-e4a9a7303a70397a89ea23072419976032de4ddc.tar.gz
qemu-e4a9a7303a70397a89ea23072419976032de4ddc.tar.xz
qemu-e4a9a7303a70397a89ea23072419976032de4ddc.zip
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.0-20180618' into staging
ppc patch queue 2018-06-18 Next batch of ppc and spapr related patches for the 3.0 release. * Improved handling of Spectre/Meltdown mitigations for POWER8 * Numerous Mac machine type cleanups and improvements * Cleanup to cpu realize/unrealize path for spapr * Create a place for machine-specific per-cpu information, and start moving some things to it * Assorted bugfixes # gpg: Signature made Mon 18 Jun 2018 04:52:37 BST # gpg: using RSA key 6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: aka "David Gibson (kernel.org) <dwg@kernel.org>" # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-3.0-20180618: (28 commits) spapr: fix xics_system_init() error path target/ppc, spapr: Move VPA information to machine_data ppc/pnv: introduce a pnv_chip_core_realize() routine spapr_cpu_core: introduce spapr_create_vcpu() spapr_cpu_core: add missing rollback on realization path spapr_cpu_core: fix potential leak in spapr_cpu_core_realize() spapr_cpu_core: convert last snprintf() to g_strdup_printf() pnv: Add cpu unrealize path pnv: Clean up cpu realize path pnv_core: Allocate cpu thread objects individually pnv: Fix some error handling cpu realize() spapr: Clean up cpu realize/unrealize paths sm501: Do not clear read only bits when writing registers mos6522: expose mos6522_update_irq() through MOS6522DeviceClass mos6522: remove additional interrupt flag filter from mos6522_update_irq() mos6522: only clear the shift register interrupt upon write xics_kvm: fix a build break mac_newworld: add PMU device adb: add property to disable direct reg 3 writes adb: fix read reg 3 byte ordering ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/misc/macio/gpio.h')
-rw-r--r--include/hw/misc/macio/gpio.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/hw/misc/macio/gpio.h b/include/hw/misc/macio/gpio.h
new file mode 100644
index 0000000000..2838ae5fde
--- /dev/null
+++ b/include/hw/misc/macio/gpio.h
@@ -0,0 +1,47 @@
+/*
+ * PowerMac NewWorld MacIO GPIO emulation
+ *
+ * Copyright (c) 2016 Benjamin Herrenschmidt
+ * Copyright (c) 2018 Mark Cave-Ayland
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MACIO_GPIO_H
+#define MACIO_GPIO_H
+
+#define TYPE_MACIO_GPIO "macio-gpio"
+#define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPIO)
+
+typedef struct MacIOGPIOState {
+ /*< private >*/
+ SysBusDevice parent;
+ /*< public >*/
+
+ OpenPICState *pic;
+
+ MemoryRegion gpiomem;
+ qemu_irq gpio_extirqs[10];
+ uint8_t gpio_levels[8];
+ uint8_t gpio_regs[36]; /* XXX Check count */
+} MacIOGPIOState;
+
+void macio_set_gpio(MacIOGPIOState *s, uint32_t gpio, bool state);
+
+#endif