2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms and conditions of the GNU General Public License,
4 * version 2 or later, as published by the Free Software Foundation.
6 * This program is distributed in the hope it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * You should have received a copy of the GNU General Public License along with
12 * this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "hw/sysbus.h"
19 #include "chardev/char-fe.h"
21 #define TYPE_PL011 "pl011"
22 #define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)
24 /* This shares the same struct (and cast macro) as the base pl011 device */
25 #define TYPE_PL011_LUMINARY "pl011_luminary"
27 typedef struct PL011State
{
28 SysBusDevice parent_obj
;
39 uint32_t read_fifo
[16];
49 const unsigned char *id
;
52 static inline DeviceState
*pl011_create(hwaddr addr
,
59 dev
= qdev_create(NULL
, "pl011");
60 s
= SYS_BUS_DEVICE(dev
);
61 qdev_prop_set_chr(dev
, "chardev", chr
);
62 qdev_init_nofail(dev
);
63 sysbus_mmio_map(s
, 0, addr
);
64 sysbus_connect_irq(s
, 0, irq
);
69 static inline DeviceState
*pl011_luminary_create(hwaddr addr
,
76 dev
= qdev_create(NULL
, "pl011_luminary");
77 s
= SYS_BUS_DEVICE(dev
);
78 qdev_prop_set_chr(dev
, "chardev", chr
);
79 qdev_init_nofail(dev
);
80 sysbus_mmio_map(s
, 0, addr
);
81 sysbus_connect_irq(s
, 0, irq
);