4 * Copyright (c) 2010 qiaochong@loongson.cn
5 * Copyright (c) 2010 Roland Elek <elek.roland@gmail.com>
6 * Copyright (c) 2010 Sebastian Herbszt <herbszt@gmx.de>
7 * Copyright (c) 2010 Alexander Graf <agraf@suse.de>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
27 #include "hw/sysbus.h"
28 #include "qom/object.h"
30 typedef struct AHCIDevice AHCIDevice
;
32 typedef struct AHCIControlRegs
{
40 typedef struct AHCIState
{
41 DeviceState
*container
;
44 AHCIControlRegs control_regs
;
46 MemoryRegion idp
; /* Index-Data Pair I/O port space */
47 unsigned idp_offset
; /* Offset of index in I/O port space */
48 uint32_t idp_index
; /* Current IDP index */
54 typedef struct AHCIPCIState AHCIPCIState
;
56 #define TYPE_ICH9_AHCI "ich9-ahci"
57 DECLARE_INSTANCE_CHECKER(AHCIPCIState
, ICH9_AHCI
,
60 int32_t ahci_get_num_ports(PCIDevice
*dev
);
61 void ahci_ide_create_devs(PCIDevice
*dev
, DriveInfo
**hd
);
63 #define TYPE_SYSBUS_AHCI "sysbus-ahci"
64 typedef struct SysbusAHCIState SysbusAHCIState
;
65 DECLARE_INSTANCE_CHECKER(SysbusAHCIState
, SYSBUS_AHCI
,
68 struct SysbusAHCIState
{
70 SysBusDevice parent_obj
;
77 #define TYPE_ALLWINNER_AHCI "allwinner-ahci"
78 typedef struct AllwinnerAHCIState AllwinnerAHCIState
;
79 DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState
, ALLWINNER_AHCI
,
82 #define ALLWINNER_AHCI_MMIO_OFF 0x80
83 #define ALLWINNER_AHCI_MMIO_SIZE 0x80
85 struct AllwinnerAHCIState
{
87 SysbusAHCIState parent_obj
;
91 uint32_t regs
[ALLWINNER_AHCI_MMIO_SIZE
/4];
94 #endif /* HW_IDE_AHCI_H */