summaryrefslogtreecommitdiffstats
path: root/hw/ide
diff options
context:
space:
mode:
authorPeter Maydell2015-09-08 19:02:36 +0200
committerPeter Maydell2015-09-08 19:02:36 +0200
commitfc04a730b7e60f4a62d6260d4eb9c537d1d3643f (patch)
tree71a0c298ca37f76a7467118aacbc8a38df0edd99 /hw/ide
parenttarget-microblaze: Use setcond for pcmp* (diff)
parentxlnx-zynqmp: Connect the sysbus AHCI to ZynqMP (diff)
downloadqemu-fc04a730b7e60f4a62d6260d4eb9c537d1d3643f.tar.gz
qemu-fc04a730b7e60f4a62d6260d4eb9c537d1d3643f.tar.xz
qemu-fc04a730b7e60f4a62d6260d4eb9c537d1d3643f.zip
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150908' into staging
target-arm queue: * Implement priority handling properly via GICC_APR * Enable TZ extensions on the GIC if we're using them * Minor preparatory patches for EL3 support * cadence_gem: Correct Marvell PHY SPCFC reset value * Support AHCI in ZynqMP # gpg: Signature made Tue 08 Sep 2015 17:48:33 BST using RSA key ID 14360CDE # 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-20150908: xlnx-zynqmp: Connect the sysbus AHCI to ZynqMP xlnx-zynqmp.c: Convert some of the error_propagate() calls to error_abort ahci.c: Don't assume AHCIState's parent is AHCIPCIState ahci: Separate the AHCI state structure into the header cadence_gem: Correct Marvell PHY SPCFC reset value target-arm: Add AArch64 access to PAR_EL1 target-arm: Correct opc1 for AT_S12Exx target-arm: Log the target EL when taking exceptions target-arm: Fix default_exception_el() function for the case when EL3 is not supported hw/arm/virt: Enable TZ extensions on the GIC if we are using them hw/arm/virt: Default to not providing TrustZone support hw/cpu/{a15mpcore, a9mpcore}: enable TrustZone in GIC if it is enabled in CPUs hw/intc/arm_gic_common: Configure IRQs as NS if doing direct NS kernel boot hw/arm: new interface for devices which need to behave differently for kernel boot qom: Add recursive version of object_child_for_each hw/intc/arm_gic: Actually set the active bits for active interrupts hw/intc/arm_gic: Drop running_irq and last_active arrays hw/intc/arm_gic: Fix handling of GICC_APR<n>, GICC_NSAPR<n> registers hw/intc/arm_gic: Running priority is group priority, not full priority armv7m_nvic: Implement ICSR without using internal GIC state Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/ahci.c26
-rw-r--r--hw/ide/ahci.h16
2 files changed, 23 insertions, 19 deletions
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 48749c1dc1..d83efa47a4 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -25,7 +25,6 @@
#include <hw/pci/msi.h>
#include <hw/i386/pc.h>
#include <hw/pci/pci.h>
-#include <hw/sysbus.h>
#include "qemu/error-report.h"
#include "sysemu/block-backend.h"
@@ -122,9 +121,9 @@ static uint32_t ahci_port_read(AHCIState *s, int port, int offset)
static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
{
- AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
- PCIDevice *pci_dev =
- (PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
+ DeviceState *dev_state = s->container;
+ PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
+ TYPE_PCI_DEVICE);
DPRINTF(0, "raise irq\n");
@@ -137,9 +136,9 @@ static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
static void ahci_irq_lower(AHCIState *s, AHCIDevice *dev)
{
- AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
- PCIDevice *pci_dev =
- (PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
+ DeviceState *dev_state = s->container;
+ PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
+ TYPE_PCI_DEVICE);
DPRINTF(0, "lower irq\n");
@@ -1437,6 +1436,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports)
s->as = as;
s->ports = ports;
s->dev = g_new0(AHCIDevice, ports);
+ s->container = qdev;
ahci_reg_init(s);
/* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
memory_region_init_io(&s->mem, OBJECT(qdev), &ahci_mem_ops, s,
@@ -1625,18 +1625,6 @@ const VMStateDescription vmstate_ahci = {
},
};
-#define TYPE_SYSBUS_AHCI "sysbus-ahci"
-#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)
-
-typedef struct SysbusAHCIState {
- /*< private >*/
- SysBusDevice parent_obj;
- /*< public >*/
-
- AHCIState ahci;
- uint32_t num_ports;
-} SysbusAHCIState;
-
static const VMStateDescription vmstate_sysbus_ahci = {
.name = "sysbus-ahci",
.fields = (VMStateField[]) {
diff --git a/hw/ide/ahci.h b/hw/ide/ahci.h
index 79a463d93c..c9b3805415 100644
--- a/hw/ide/ahci.h
+++ b/hw/ide/ahci.h
@@ -24,6 +24,8 @@
#ifndef HW_IDE_AHCI_H
#define HW_IDE_AHCI_H
+#include <hw/sysbus.h>
+
#define AHCI_MEM_BAR_SIZE 0x1000
#define AHCI_MAX_PORTS 32
#define AHCI_MAX_SG 168 /* hardware max is 64K */
@@ -285,6 +287,8 @@ struct AHCIDevice {
};
typedef struct AHCIState {
+ DeviceState *container;
+
AHCIDevice *dev;
AHCIControlRegs control_regs;
MemoryRegion mem;
@@ -369,4 +373,16 @@ void ahci_reset(AHCIState *s);
void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd);
+#define TYPE_SYSBUS_AHCI "sysbus-ahci"
+#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)
+
+typedef struct SysbusAHCIState {
+ /*< private >*/
+ SysBusDevice parent_obj;
+ /*< public >*/
+
+ AHCIState ahci;
+ uint32_t num_ports;
+} SysbusAHCIState;
+
#endif /* HW_IDE_AHCI_H */