Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-aug-20-2019' into...
[qemu/ar7.git] / include / hw / arm / fsl-imx31.h
blobac5ca9826a494ed0c3249ae953e4b8b84d2323af
1 /*
2 * Freescale i.MX31 SoC emulation
4 * Copyright (C) 2015 Jean-Christophe Dubois <jcd@tribudubois.net>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
17 #ifndef FSL_IMX31_H
18 #define FSL_IMX31_H
20 #include "hw/arm/boot.h"
21 #include "hw/intc/imx_avic.h"
22 #include "hw/misc/imx31_ccm.h"
23 #include "hw/char/imx_serial.h"
24 #include "hw/timer/imx_gpt.h"
25 #include "hw/timer/imx_epit.h"
26 #include "hw/i2c/imx_i2c.h"
27 #include "hw/gpio/imx_gpio.h"
28 #include "exec/memory.h"
29 #include "target/arm/cpu.h"
31 #define TYPE_FSL_IMX31 "fsl,imx31"
32 #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)
34 #define FSL_IMX31_NUM_UARTS 2
35 #define FSL_IMX31_NUM_EPITS 2
36 #define FSL_IMX31_NUM_I2CS 3
37 #define FSL_IMX31_NUM_GPIOS 3
39 typedef struct FslIMX31State {
40 /*< private >*/
41 DeviceState parent_obj;
43 /*< public >*/
44 ARMCPU cpu;
45 IMXAVICState avic;
46 IMX31CCMState ccm;
47 IMXSerialState uart[FSL_IMX31_NUM_UARTS];
48 IMXGPTState gpt;
49 IMXEPITState epit[FSL_IMX31_NUM_EPITS];
50 IMXI2CState i2c[FSL_IMX31_NUM_I2CS];
51 IMXGPIOState gpio[FSL_IMX31_NUM_GPIOS];
52 MemoryRegion secure_rom;
53 MemoryRegion rom;
54 MemoryRegion iram;
55 MemoryRegion iram_alias;
56 } FslIMX31State;
58 #define FSL_IMX31_SECURE_ROM_ADDR 0x00000000
59 #define FSL_IMX31_SECURE_ROM_SIZE 0x4000
60 #define FSL_IMX31_ROM_ADDR 0x00404000
61 #define FSL_IMX31_ROM_SIZE 0x4000
62 #define FSL_IMX31_IRAM_ALIAS_ADDR 0x10000000
63 #define FSL_IMX31_IRAM_ALIAS_SIZE 0xFFC0000
64 #define FSL_IMX31_IRAM_ADDR 0x1FFFC000
65 #define FSL_IMX31_IRAM_SIZE 0x4000
66 #define FSL_IMX31_I2C1_ADDR 0x43F80000
67 #define FSL_IMX31_I2C1_SIZE 0x4000
68 #define FSL_IMX31_I2C3_ADDR 0x43F84000
69 #define FSL_IMX31_I2C3_SIZE 0x4000
70 #define FSL_IMX31_UART1_ADDR 0x43F90000
71 #define FSL_IMX31_UART1_SIZE 0x4000
72 #define FSL_IMX31_UART2_ADDR 0x43F94000
73 #define FSL_IMX31_UART2_SIZE 0x4000
74 #define FSL_IMX31_I2C2_ADDR 0x43F98000
75 #define FSL_IMX31_I2C2_SIZE 0x4000
76 #define FSL_IMX31_CCM_ADDR 0x53F80000
77 #define FSL_IMX31_CCM_SIZE 0x4000
78 #define FSL_IMX31_GPT_ADDR 0x53F90000
79 #define FSL_IMX31_GPT_SIZE 0x4000
80 #define FSL_IMX31_EPIT1_ADDR 0x53F94000
81 #define FSL_IMX31_EPIT1_SIZE 0x4000
82 #define FSL_IMX31_EPIT2_ADDR 0x53F98000
83 #define FSL_IMX31_EPIT2_SIZE 0x4000
84 #define FSL_IMX31_GPIO3_ADDR 0x53FA4000
85 #define FSL_IMX31_GPIO3_SIZE 0x4000
86 #define FSL_IMX31_GPIO1_ADDR 0x53FCC000
87 #define FSL_IMX31_GPIO1_SIZE 0x4000
88 #define FSL_IMX31_GPIO2_ADDR 0x53FD0000
89 #define FSL_IMX31_GPIO2_SIZE 0x4000
90 #define FSL_IMX31_AVIC_ADDR 0x68000000
91 #define FSL_IMX31_AVIC_SIZE 0x100
92 #define FSL_IMX31_SDRAM0_ADDR 0x80000000
93 #define FSL_IMX31_SDRAM0_SIZE 0x10000000
94 #define FSL_IMX31_SDRAM1_ADDR 0x90000000
95 #define FSL_IMX31_SDRAM1_SIZE 0x10000000
96 #define FSL_IMX31_FLASH0_ADDR 0xA0000000
97 #define FSL_IMX31_FLASH0_SIZE 0x8000000
98 #define FSL_IMX31_FLASH1_ADDR 0xA8000000
99 #define FSL_IMX31_FLASH1_SIZE 0x8000000
100 #define FSL_IMX31_CS2_ADDR 0xB0000000
101 #define FSL_IMX31_CS2_SIZE 0x2000000
102 #define FSL_IMX31_CS3_ADDR 0xB2000000
103 #define FSL_IMX31_CS3_SIZE 0x2000000
104 #define FSL_IMX31_CS4_ADDR 0xB4000000
105 #define FSL_IMX31_CS4_SIZE 0x2000000
106 #define FSL_IMX31_CS5_ADDR 0xB6000000
107 #define FSL_IMX31_CS5_SIZE 0x2000000
108 #define FSL_IMX31_NAND_ADDR 0xB8000000
109 #define FSL_IMX31_NAND_SIZE 0x1000
111 #define FSL_IMX31_EPIT2_IRQ 27
112 #define FSL_IMX31_EPIT1_IRQ 28
113 #define FSL_IMX31_GPT_IRQ 29
114 #define FSL_IMX31_UART2_IRQ 32
115 #define FSL_IMX31_UART1_IRQ 45
116 #define FSL_IMX31_I2C1_IRQ 10
117 #define FSL_IMX31_I2C2_IRQ 4
118 #define FSL_IMX31_I2C3_IRQ 3
119 #define FSL_IMX31_GPIO1_IRQ 52
120 #define FSL_IMX31_GPIO2_IRQ 51
121 #define FSL_IMX31_GPIO3_IRQ 56
123 #endif /* FSL_IMX31_H */