Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Canon DIGIC UART block declarations. |
| 3 | * |
| 4 | * Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #ifndef HW_CHAR_DIGIC_UART_H |
| 19 | #define HW_CHAR_DIGIC_UART_H |
| 20 | |
| 21 | #include "hw/sysbus.h" |
Marc-André Lureau | 4d43a60 | 2017-01-26 18:26:44 +0400 | [diff] [blame] | 22 | #include "chardev/char-fe.h" |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 23 | #include "qom/object.h" |
Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 24 | |
| 25 | #define TYPE_DIGIC_UART "digic-uart" |
Eduardo Habkost | 8063396 | 2020-09-16 14:25:19 -0400 | [diff] [blame] | 26 | OBJECT_DECLARE_SIMPLE_TYPE(DigicUartState, DIGIC_UART) |
Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 27 | |
| 28 | enum { |
| 29 | R_TX = 0x00, |
| 30 | R_RX, |
| 31 | R_ST = (0x14 >> 2), |
| 32 | R_MAX |
| 33 | }; |
| 34 | |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 35 | struct DigicUartState { |
Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 36 | /*< private >*/ |
| 37 | SysBusDevice parent_obj; |
| 38 | /*< public >*/ |
| 39 | |
| 40 | MemoryRegion regs_region; |
Marc-André Lureau | becdfa0 | 2016-10-22 12:52:51 +0300 | [diff] [blame] | 41 | CharBackend chr; |
Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 42 | |
| 43 | uint32_t reg_rx; |
| 44 | uint32_t reg_st; |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 45 | }; |
Antony Pavlov | 142593c | 2013-12-17 19:42:37 +0000 | [diff] [blame] | 46 | |
| 47 | #endif /* HW_CHAR_DIGIC_UART_H */ |