xref: /openbmc/qemu/include/hw/arm/fsl-imx31.h (revision 8063396b)
1558df83dSJean-Christophe Dubois /*
2558df83dSJean-Christophe Dubois  * Freescale i.MX31 SoC emulation
3558df83dSJean-Christophe Dubois  *
4558df83dSJean-Christophe Dubois  * Copyright (C) 2015 Jean-Christophe Dubois <jcd@tribudubois.net>
5558df83dSJean-Christophe Dubois  *
6558df83dSJean-Christophe Dubois  * This program is free software; you can redistribute it and/or modify it
7558df83dSJean-Christophe Dubois  * under the terms of the GNU General Public License as published by the
8558df83dSJean-Christophe Dubois  * Free Software Foundation; either version 2 of the License, or
9558df83dSJean-Christophe Dubois  * (at your option) any later version.
10558df83dSJean-Christophe Dubois  *
11558df83dSJean-Christophe Dubois  * This program is distributed in the hope that it will be useful, but WITHOUT
12558df83dSJean-Christophe Dubois  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13558df83dSJean-Christophe Dubois  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14558df83dSJean-Christophe Dubois  * for more details.
15558df83dSJean-Christophe Dubois  */
16558df83dSJean-Christophe Dubois 
17558df83dSJean-Christophe Dubois #ifndef FSL_IMX31_H
18558df83dSJean-Christophe Dubois #define FSL_IMX31_H
19558df83dSJean-Christophe Dubois 
2012ec8bd5SPeter Maydell #include "hw/arm/boot.h"
21558df83dSJean-Christophe Dubois #include "hw/intc/imx_avic.h"
22cb54d868SJean-Christophe Dubois #include "hw/misc/imx31_ccm.h"
23558df83dSJean-Christophe Dubois #include "hw/char/imx_serial.h"
24558df83dSJean-Christophe Dubois #include "hw/timer/imx_gpt.h"
25558df83dSJean-Christophe Dubois #include "hw/timer/imx_epit.h"
267f398627SJean-Christophe Dubois #include "hw/i2c/imx_i2c.h"
27dde0c4caSJean-Christophe Dubois #include "hw/gpio/imx_gpio.h"
28b9e521ddSGuenter Roeck #include "hw/watchdog/wdt_imx2.h"
29558df83dSJean-Christophe Dubois #include "exec/memory.h"
30ec150c7eSMarkus Armbruster #include "target/arm/cpu.h"
31db1015e9SEduardo Habkost #include "qom/object.h"
32558df83dSJean-Christophe Dubois 
33558df83dSJean-Christophe Dubois #define TYPE_FSL_IMX31 "fsl,imx31"
34*8063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(FslIMX31State, FSL_IMX31)
35558df83dSJean-Christophe Dubois 
36558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2
37558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2
38d4e26d10SJean-Christophe Dubois #define FSL_IMX31_NUM_I2CS 3
39dde0c4caSJean-Christophe Dubois #define FSL_IMX31_NUM_GPIOS 3
40558df83dSJean-Christophe Dubois 
41db1015e9SEduardo Habkost struct FslIMX31State {
42558df83dSJean-Christophe Dubois     /*< private >*/
43558df83dSJean-Christophe Dubois     DeviceState parent_obj;
44558df83dSJean-Christophe Dubois 
45558df83dSJean-Christophe Dubois     /*< public >*/
46558df83dSJean-Christophe Dubois     ARMCPU         cpu;
47558df83dSJean-Christophe Dubois     IMXAVICState   avic;
48cb54d868SJean-Christophe Dubois     IMX31CCMState  ccm;
49558df83dSJean-Christophe Dubois     IMXSerialState uart[FSL_IMX31_NUM_UARTS];
50558df83dSJean-Christophe Dubois     IMXGPTState    gpt;
51558df83dSJean-Christophe Dubois     IMXEPITState   epit[FSL_IMX31_NUM_EPITS];
52d4e26d10SJean-Christophe Dubois     IMXI2CState    i2c[FSL_IMX31_NUM_I2CS];
53dde0c4caSJean-Christophe Dubois     IMXGPIOState   gpio[FSL_IMX31_NUM_GPIOS];
54b9e521ddSGuenter Roeck     IMX2WdtState   wdt;
55558df83dSJean-Christophe Dubois     MemoryRegion   secure_rom;
56558df83dSJean-Christophe Dubois     MemoryRegion   rom;
57558df83dSJean-Christophe Dubois     MemoryRegion   iram;
58558df83dSJean-Christophe Dubois     MemoryRegion   iram_alias;
59db1015e9SEduardo Habkost };
60558df83dSJean-Christophe Dubois 
61558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR       0x00000000
62558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE       0x4000
63558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR              0x00404000
64558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE              0x4000
65558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR       0x10000000
66558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE       0xFFC0000
67558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR             0x1FFFC000
68558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE             0x4000
69d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_ADDR             0x43F80000
70d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_SIZE             0x4000
71d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_ADDR             0x43F84000
72d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_SIZE             0x4000
73558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR            0x43F90000
74558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE            0x4000
75558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR            0x43F94000
76558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE            0x4000
77d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_ADDR             0x43F98000
78d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_SIZE             0x4000
79558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR              0x53F80000
80558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE              0x4000
81558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR              0x53F90000
82558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE              0x4000
83558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR            0x53F94000
84558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE            0x4000
85558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR            0x53F98000
86558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE            0x4000
87dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_ADDR            0x53FA4000
88dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_SIZE            0x4000
89dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_ADDR            0x53FCC000
90dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_SIZE            0x4000
91dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_ADDR            0x53FD0000
92dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_SIZE            0x4000
93b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_ADDR              0x53FDC000
94b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_SIZE              0x4000
95558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR             0x68000000
96558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE             0x100
97558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR           0x80000000
98558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE           0x10000000
99558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR           0x90000000
100558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE           0x10000000
101558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR           0xA0000000
102558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE           0x8000000
103558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR           0xA8000000
104558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE           0x8000000
105558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR              0xB0000000
106558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE              0x2000000
107558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR              0xB2000000
108558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE              0x2000000
109558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR              0xB4000000
110558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE              0x2000000
111558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR              0xB6000000
112558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE              0x2000000
113558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR             0xB8000000
114558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE             0x1000
115558df83dSJean-Christophe Dubois 
116558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ             27
117558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ             28
118558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ               29
119558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ             32
120558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ             45
121d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_IRQ              10
122d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_IRQ              4
123d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_IRQ              3
124dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_IRQ             52
125dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_IRQ             51
126dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_IRQ             56
127558df83dSJean-Christophe Dubois 
128558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */
129