mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20230220115114.25237-5-philmd@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2 or later, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef XILINX_UARTLITE_H
|
|
#define XILINX_UARTLITE_H
|
|
|
|
#include "hw/qdev-properties.h"
|
|
#include "hw/sysbus.h"
|
|
#include "qapi/error.h"
|
|
#include "qom/object.h"
|
|
|
|
#define TYPE_XILINX_UARTLITE "xlnx.xps-uartlite"
|
|
OBJECT_DECLARE_SIMPLE_TYPE(XilinxUARTLite, XILINX_UARTLITE)
|
|
|
|
static inline DeviceState *xilinx_uartlite_create(hwaddr addr,
|
|
qemu_irq irq,
|
|
Chardev *chr)
|
|
{
|
|
DeviceState *dev;
|
|
SysBusDevice *s;
|
|
|
|
dev = qdev_new(TYPE_XILINX_UARTLITE);
|
|
s = SYS_BUS_DEVICE(dev);
|
|
qdev_prop_set_chr(dev, "chardev", chr);
|
|
sysbus_realize_and_unref(s, &error_fatal);
|
|
sysbus_mmio_map(s, 0, addr);
|
|
sysbus_connect_irq(s, 0, irq);
|
|
|
|
return dev;
|
|
}
|
|
|
|
#endif
|