hw/rx: RX62N microcontroller (MCU)
[qemu/ar7.git] / include / hw / rx / rx62n.h
blob7c6023bcd6112ead9544f0d829ea2d4b47048205
1 /*
2 * RX62N MCU Object
4 * Datasheet: RX62N Group, RX621 Group User's Manual: Hardware
5 * (Rev.1.40 R01UH0033EJ0140)
7 * Copyright (c) 2019 Yoshinori Sato
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms and conditions of the GNU General Public License,
13 * version 2 or later, as published by the Free Software Foundation.
15 * This program is distributed in the hope it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * more details.
20 * You should have received a copy of the GNU General Public License along with
21 * this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef HW_RX_RX62N_MCU_H
25 #define HW_RX_RX62N_MCU_H
27 #include "target/rx/cpu.h"
28 #include "hw/intc/rx_icu.h"
29 #include "hw/timer/renesas_tmr.h"
30 #include "hw/timer/renesas_cmt.h"
31 #include "hw/char/renesas_sci.h"
32 #include "qemu/units.h"
34 #define TYPE_RX62N_MCU "rx62n-mcu"
35 #define RX62N_MCU(obj) OBJECT_CHECK(RX62NState, (obj), TYPE_RX62N_MCU)
37 #define RX62N_NR_TMR 2
38 #define RX62N_NR_CMT 2
39 #define RX62N_NR_SCI 6
41 typedef struct RX62NState {
42 /*< private >*/
43 DeviceState parent_obj;
44 /*< public >*/
46 RXCPU cpu;
47 RXICUState icu;
48 RTMRState tmr[RX62N_NR_TMR];
49 RCMTState cmt[RX62N_NR_CMT];
50 RSCIState sci[RX62N_NR_SCI];
52 MemoryRegion *sysmem;
53 bool kernel;
55 MemoryRegion iram;
56 MemoryRegion iomem1;
57 MemoryRegion d_flash;
58 MemoryRegion iomem2;
59 MemoryRegion iomem3;
60 MemoryRegion c_flash;
61 qemu_irq irq[NR_IRQS];
62 } RX62NState;
65 * RX62N Internal Memory
66 * It is the value of R5F562N8.
67 * Please change the size for R5F562N7.
69 #define RX62N_IRAM_SIZE (96 * KiB)
70 #define RX62N_DFLASH_SIZE (32 * KiB)
71 #define RX62N_CFLASH_SIZE (512 * KiB)
73 #define RX62N_PCLK (48 * 1000 * 1000)
75 #endif