xref: /qemu/include/hw/char/serial-mm.h (revision fc524567087c2537b5103cdfc1d41e4f442892b6)
17e6b5497SBernhard Beschow /*
27e6b5497SBernhard Beschow  * QEMU 16550A UART emulation
37e6b5497SBernhard Beschow  *
47e6b5497SBernhard Beschow  * Copyright (c) 2003-2004 Fabrice Bellard
57e6b5497SBernhard Beschow  * Copyright (c) 2008 Citrix Systems, Inc.
67e6b5497SBernhard Beschow  *
77e6b5497SBernhard Beschow  * Permission is hereby granted, free of charge, to any person obtaining a copy
87e6b5497SBernhard Beschow  * of this software and associated documentation files (the "Software"), to deal
97e6b5497SBernhard Beschow  * in the Software without restriction, including without limitation the rights
107e6b5497SBernhard Beschow  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
117e6b5497SBernhard Beschow  * copies of the Software, and to permit persons to whom the Software is
127e6b5497SBernhard Beschow  * furnished to do so, subject to the following conditions:
137e6b5497SBernhard Beschow  *
147e6b5497SBernhard Beschow  * The above copyright notice and this permission notice shall be included in
157e6b5497SBernhard Beschow  * all copies or substantial portions of the Software.
167e6b5497SBernhard Beschow  *
177e6b5497SBernhard Beschow  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
187e6b5497SBernhard Beschow  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197e6b5497SBernhard Beschow  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
207e6b5497SBernhard Beschow  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
217e6b5497SBernhard Beschow  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
227e6b5497SBernhard Beschow  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
237e6b5497SBernhard Beschow  * THE SOFTWARE.
247e6b5497SBernhard Beschow  */
257e6b5497SBernhard Beschow 
267e6b5497SBernhard Beschow #ifndef HW_SERIAL_MM_H
277e6b5497SBernhard Beschow #define HW_SERIAL_MM_H
287e6b5497SBernhard Beschow 
297e6b5497SBernhard Beschow #include "hw/char/serial.h"
30*8be545baSRichard Henderson #include "system/memory.h"
317e6b5497SBernhard Beschow #include "chardev/char.h"
327e6b5497SBernhard Beschow #include "hw/sysbus.h"
337e6b5497SBernhard Beschow #include "qom/object.h"
347e6b5497SBernhard Beschow 
357e6b5497SBernhard Beschow #define TYPE_SERIAL_MM "serial-mm"
367e6b5497SBernhard Beschow OBJECT_DECLARE_SIMPLE_TYPE(SerialMM, SERIAL_MM)
377e6b5497SBernhard Beschow 
387e6b5497SBernhard Beschow struct SerialMM {
397e6b5497SBernhard Beschow     SysBusDevice parent;
407e6b5497SBernhard Beschow 
417e6b5497SBernhard Beschow     SerialState serial;
427e6b5497SBernhard Beschow 
437e6b5497SBernhard Beschow     uint8_t regshift;
447e6b5497SBernhard Beschow     uint8_t endianness;
457e6b5497SBernhard Beschow };
467e6b5497SBernhard Beschow 
477e6b5497SBernhard Beschow SerialMM *serial_mm_init(MemoryRegion *address_space,
487e6b5497SBernhard Beschow                          hwaddr base, int regshift,
497e6b5497SBernhard Beschow                          qemu_irq irq, int baudbase,
507e6b5497SBernhard Beschow                          Chardev *chr, enum device_endian end);
517e6b5497SBernhard Beschow 
527e6b5497SBernhard Beschow #endif
53