11b6d0781Sxiaoqiang zhao /* 21b6d0781Sxiaoqiang zhao * This program is free software; you can redistribute it and/or modify it 31b6d0781Sxiaoqiang zhao * under the terms and conditions of the GNU General Public License, 41b6d0781Sxiaoqiang zhao * version 2 or later, as published by the Free Software Foundation. 51b6d0781Sxiaoqiang zhao * 61b6d0781Sxiaoqiang zhao * This program is distributed in the hope it will be useful, but WITHOUT 71b6d0781Sxiaoqiang zhao * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 81b6d0781Sxiaoqiang zhao * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 91b6d0781Sxiaoqiang zhao * more details. 101b6d0781Sxiaoqiang zhao * 111b6d0781Sxiaoqiang zhao * You should have received a copy of the GNU General Public License along with 121b6d0781Sxiaoqiang zhao * this program. If not, see <http://www.gnu.org/licenses/>. 131b6d0781Sxiaoqiang zhao */ 141b6d0781Sxiaoqiang zhao 151b6d0781Sxiaoqiang zhao #ifndef XILINX_UARTLITE_H 161b6d0781Sxiaoqiang zhao #define XILINX_UARTLITE_H 171b6d0781Sxiaoqiang zhao 181b6d0781Sxiaoqiang zhao static inline DeviceState *xilinx_uartlite_create(hwaddr addr, 191b6d0781Sxiaoqiang zhao qemu_irq irq, 20*0ec7b3e7SMarc-André Lureau Chardev *chr) 211b6d0781Sxiaoqiang zhao { 221b6d0781Sxiaoqiang zhao DeviceState *dev; 231b6d0781Sxiaoqiang zhao SysBusDevice *s; 241b6d0781Sxiaoqiang zhao 251b6d0781Sxiaoqiang zhao dev = qdev_create(NULL, "xlnx.xps-uartlite"); 261b6d0781Sxiaoqiang zhao s = SYS_BUS_DEVICE(dev); 271b6d0781Sxiaoqiang zhao qdev_prop_set_chr(dev, "chardev", chr); 281b6d0781Sxiaoqiang zhao qdev_init_nofail(dev); 291b6d0781Sxiaoqiang zhao sysbus_mmio_map(s, 0, addr); 301b6d0781Sxiaoqiang zhao sysbus_connect_irq(s, 0, irq); 311b6d0781Sxiaoqiang zhao 321b6d0781Sxiaoqiang zhao return dev; 331b6d0781Sxiaoqiang zhao } 341b6d0781Sxiaoqiang zhao 351b6d0781Sxiaoqiang zhao #endif 36