xref: /openbmc/qemu/include/hw/char/serial-mm.h (revision b5ab62b3c0050612c7f9b0b4baeb44ebab42775a)
1*7e6b5497SBernhard Beschow /*
2*7e6b5497SBernhard Beschow  * QEMU 16550A UART emulation
3*7e6b5497SBernhard Beschow  *
4*7e6b5497SBernhard Beschow  * Copyright (c) 2003-2004 Fabrice Bellard
5*7e6b5497SBernhard Beschow  * Copyright (c) 2008 Citrix Systems, Inc.
6*7e6b5497SBernhard Beschow  *
7*7e6b5497SBernhard Beschow  * Permission is hereby granted, free of charge, to any person obtaining a copy
8*7e6b5497SBernhard Beschow  * of this software and associated documentation files (the "Software"), to deal
9*7e6b5497SBernhard Beschow  * in the Software without restriction, including without limitation the rights
10*7e6b5497SBernhard Beschow  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11*7e6b5497SBernhard Beschow  * copies of the Software, and to permit persons to whom the Software is
12*7e6b5497SBernhard Beschow  * furnished to do so, subject to the following conditions:
13*7e6b5497SBernhard Beschow  *
14*7e6b5497SBernhard Beschow  * The above copyright notice and this permission notice shall be included in
15*7e6b5497SBernhard Beschow  * all copies or substantial portions of the Software.
16*7e6b5497SBernhard Beschow  *
17*7e6b5497SBernhard Beschow  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18*7e6b5497SBernhard Beschow  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19*7e6b5497SBernhard Beschow  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20*7e6b5497SBernhard Beschow  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21*7e6b5497SBernhard Beschow  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22*7e6b5497SBernhard Beschow  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23*7e6b5497SBernhard Beschow  * THE SOFTWARE.
24*7e6b5497SBernhard Beschow  */
25*7e6b5497SBernhard Beschow 
26*7e6b5497SBernhard Beschow #ifndef HW_SERIAL_MM_H
27*7e6b5497SBernhard Beschow #define HW_SERIAL_MM_H
28*7e6b5497SBernhard Beschow 
29*7e6b5497SBernhard Beschow #include "hw/char/serial.h"
30*7e6b5497SBernhard Beschow #include "exec/memory.h"
31*7e6b5497SBernhard Beschow #include "chardev/char.h"
32*7e6b5497SBernhard Beschow #include "hw/sysbus.h"
33*7e6b5497SBernhard Beschow #include "qom/object.h"
34*7e6b5497SBernhard Beschow 
35*7e6b5497SBernhard Beschow #define TYPE_SERIAL_MM "serial-mm"
36*7e6b5497SBernhard Beschow OBJECT_DECLARE_SIMPLE_TYPE(SerialMM, SERIAL_MM)
37*7e6b5497SBernhard Beschow 
38*7e6b5497SBernhard Beschow struct SerialMM {
39*7e6b5497SBernhard Beschow     SysBusDevice parent;
40*7e6b5497SBernhard Beschow 
41*7e6b5497SBernhard Beschow     SerialState serial;
42*7e6b5497SBernhard Beschow 
43*7e6b5497SBernhard Beschow     uint8_t regshift;
44*7e6b5497SBernhard Beschow     uint8_t endianness;
45*7e6b5497SBernhard Beschow };
46*7e6b5497SBernhard Beschow 
47*7e6b5497SBernhard Beschow SerialMM *serial_mm_init(MemoryRegion *address_space,
48*7e6b5497SBernhard Beschow                          hwaddr base, int regshift,
49*7e6b5497SBernhard Beschow                          qemu_irq irq, int baudbase,
50*7e6b5497SBernhard Beschow                          Chardev *chr, enum device_endian end);
51*7e6b5497SBernhard Beschow 
52*7e6b5497SBernhard Beschow #endif
53