]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/pcmcia.h
hw/char: riscv_htif: Drop useless assignment of memory region
[mirror_qemu.git] / include / hw / pcmcia.h
CommitLineData
cb9c377f 1#ifndef HW_PCMCIA_H
175de524 2#define HW_PCMCIA_H
cb9c377f 3
87ecb68b
PB
4/* PCMCIA/Cardbus */
5
a27bd6c7 6#include "hw/qdev-core.h"
db1015e9 7#include "qom/object.h"
376253ec 8
d1f2c96a 9typedef struct PCMCIASocket {
87ecb68b 10 qemu_irq irq;
d1f2c96a 11 bool attached;
bc24a225 12} PCMCIASocket;
87ecb68b 13
d1f2c96a 14#define TYPE_PCMCIA_CARD "pcmcia-card"
a489d195 15OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD)
d1f2c96a 16
db1015e9 17struct PCMCIACardState {
d1f2c96a
AF
18 /*< private >*/
19 DeviceState parent_obj;
20 /*< public >*/
21
bc24a225 22 PCMCIASocket *slot;
db1015e9 23};
d1f2c96a 24
db1015e9 25struct PCMCIACardClass {
d1f2c96a
AF
26 /*< private >*/
27 DeviceClass parent_class;
28 /*< public >*/
29
30 int (*attach)(PCMCIACardState *state);
31 int (*detach)(PCMCIACardState *state);
32
87ecb68b
PB
33 const uint8_t *cis;
34 int cis_len;
35
36 /* Only valid if attached */
d1f2c96a
AF
37 uint8_t (*attr_read)(PCMCIACardState *card, uint32_t address);
38 void (*attr_write)(PCMCIACardState *card, uint32_t address, uint8_t value);
39 uint16_t (*common_read)(PCMCIACardState *card, uint32_t address);
40 void (*common_write)(PCMCIACardState *card,
41 uint32_t address, uint16_t value);
42 uint16_t (*io_read)(PCMCIACardState *card, uint32_t address);
43 void (*io_write)(PCMCIACardState *card, uint32_t address, uint16_t value);
db1015e9 44};
87ecb68b
PB
45
46#define CISTPL_DEVICE 0x01 /* 5V Device Information Tuple */
47#define CISTPL_NO_LINK 0x14 /* No Link Tuple */
48#define CISTPL_VERS_1 0x15 /* Level 1 Version Tuple */
49#define CISTPL_JEDEC_C 0x18 /* JEDEC ID Tuple */
50#define CISTPL_JEDEC_A 0x19 /* JEDEC ID Tuple */
51#define CISTPL_CONFIG 0x1a /* Configuration Tuple */
52#define CISTPL_CFTABLE_ENTRY 0x1b /* 16-bit PCCard Configuration */
53#define CISTPL_DEVICE_OC 0x1c /* Additional Device Information */
54#define CISTPL_DEVICE_OA 0x1d /* Additional Device Information */
55#define CISTPL_DEVICE_GEO 0x1e /* Additional Device Information */
56#define CISTPL_DEVICE_GEO_A 0x1f /* Additional Device Information */
57#define CISTPL_MANFID 0x20 /* Manufacture ID Tuple */
58#define CISTPL_FUNCID 0x21 /* Function ID Tuple */
59#define CISTPL_FUNCE 0x22 /* Function Extension Tuple */
60#define CISTPL_END 0xff /* Tuple End */
61#define CISTPL_ENDMARK 0xff
62
63/* dscm1xxxx.c */
f455e98c 64PCMCIACardState *dscm1xxxx_init(DriveInfo *bdrv);
cb9c377f
PB
65
66#endif