2017-07-17 15:36:08 +03:00
|
|
|
/*
|
|
|
|
* ARM CMSDK APB UART emulation
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Linaro Limited
|
|
|
|
* Written by Peter Maydell
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CMSDK_APB_UART_H
|
|
|
|
#define CMSDK_APB_UART_H
|
|
|
|
|
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "chardev/char-fe.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2017-07-17 15:36:08 +03:00
|
|
|
|
|
|
|
#define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(CMSDKAPBUART, CMSDK_APB_UART)
|
2017-07-17 15:36:08 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct CMSDKAPBUART {
|
2017-07-17 15:36:08 +03:00
|
|
|
/*< private >*/
|
|
|
|
SysBusDevice parent_obj;
|
|
|
|
|
|
|
|
/*< public >*/
|
|
|
|
MemoryRegion iomem;
|
|
|
|
CharBackend chr;
|
|
|
|
qemu_irq txint;
|
|
|
|
qemu_irq rxint;
|
|
|
|
qemu_irq txovrint;
|
|
|
|
qemu_irq rxovrint;
|
|
|
|
qemu_irq uartint;
|
|
|
|
guint watch_tag;
|
|
|
|
uint32_t pclk_frq;
|
|
|
|
|
|
|
|
uint32_t state;
|
|
|
|
uint32_t ctrl;
|
|
|
|
uint32_t intstatus;
|
|
|
|
uint32_t bauddiv;
|
|
|
|
/* This UART has no FIFO, only a 1-character buffer for each of Tx and Rx */
|
|
|
|
uint8_t txbuf;
|
|
|
|
uint8_t rxbuf;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2017-07-17 15:36:08 +03:00
|
|
|
|
|
|
|
#endif
|