xref: /openbmc/qemu/include/hw/arm/fsl-imx31.h (revision dde0c4ca6b849eb5c376f255767c019bb45a1d57)
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 
20558df83dSJean-Christophe Dubois #include "hw/arm/arm.h"
21558df83dSJean-Christophe Dubois #include "hw/intc/imx_avic.h"
22558df83dSJean-Christophe Dubois #include "hw/misc/imx_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"
27*dde0c4caSJean-Christophe Dubois #include "hw/gpio/imx_gpio.h"
28558df83dSJean-Christophe Dubois #include "exec/memory.h"
29558df83dSJean-Christophe Dubois 
30558df83dSJean-Christophe Dubois #define TYPE_FSL_IMX31 "fsl,imx31"
31558df83dSJean-Christophe Dubois #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)
32558df83dSJean-Christophe Dubois 
33558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2
34558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2
35d4e26d10SJean-Christophe Dubois #define FSL_IMX31_NUM_I2CS 3
36*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_NUM_GPIOS 3
37558df83dSJean-Christophe Dubois 
38558df83dSJean-Christophe Dubois typedef struct FslIMX31State {
39558df83dSJean-Christophe Dubois     /*< private >*/
40558df83dSJean-Christophe Dubois     DeviceState parent_obj;
41558df83dSJean-Christophe Dubois 
42558df83dSJean-Christophe Dubois     /*< public >*/
43558df83dSJean-Christophe Dubois     ARMCPU         cpu;
44558df83dSJean-Christophe Dubois     IMXAVICState   avic;
45558df83dSJean-Christophe Dubois     IMXCCMState    ccm;
46558df83dSJean-Christophe Dubois     IMXSerialState uart[FSL_IMX31_NUM_UARTS];
47558df83dSJean-Christophe Dubois     IMXGPTState    gpt;
48558df83dSJean-Christophe Dubois     IMXEPITState   epit[FSL_IMX31_NUM_EPITS];
49d4e26d10SJean-Christophe Dubois     IMXI2CState    i2c[FSL_IMX31_NUM_I2CS];
50*dde0c4caSJean-Christophe Dubois     IMXGPIOState   gpio[FSL_IMX31_NUM_GPIOS];
51558df83dSJean-Christophe Dubois     MemoryRegion   secure_rom;
52558df83dSJean-Christophe Dubois     MemoryRegion   rom;
53558df83dSJean-Christophe Dubois     MemoryRegion   iram;
54558df83dSJean-Christophe Dubois     MemoryRegion   iram_alias;
55558df83dSJean-Christophe Dubois } FslIMX31State;
56558df83dSJean-Christophe Dubois 
57558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR       0x00000000
58558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE       0x4000
59558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR              0x00404000
60558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE              0x4000
61558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR       0x10000000
62558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE       0xFFC0000
63558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR             0x1FFFC000
64558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE             0x4000
65d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_ADDR             0x43F80000
66d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_SIZE             0x4000
67d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_ADDR             0x43F84000
68d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_SIZE             0x4000
69558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR            0x43F90000
70558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE            0x4000
71558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR            0x43F94000
72558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE            0x4000
73d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_ADDR             0x43F98000
74d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_SIZE             0x4000
75558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR              0x53F80000
76558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE              0x4000
77558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR              0x53F90000
78558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE              0x4000
79558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR            0x53F94000
80558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE            0x4000
81558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR            0x53F98000
82558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE            0x4000
83*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_ADDR            0x53FA4000
84*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_SIZE            0x4000
85*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_ADDR            0x53FCC000
86*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_SIZE            0x4000
87*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_ADDR            0x53FD0000
88*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_SIZE            0x4000
89558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR             0x68000000
90558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE             0x100
91558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR           0x80000000
92558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE           0x10000000
93558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR           0x90000000
94558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE           0x10000000
95558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR           0xA0000000
96558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE           0x8000000
97558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR           0xA8000000
98558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE           0x8000000
99558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR              0xB0000000
100558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE              0x2000000
101558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR              0xB2000000
102558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE              0x2000000
103558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR              0xB4000000
104558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE              0x2000000
105558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR              0xB6000000
106558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE              0x2000000
107558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR             0xB8000000
108558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE             0x1000
109558df83dSJean-Christophe Dubois 
110558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ             27
111558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ             28
112558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ               29
113558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ             32
114558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ             45
115d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_IRQ              10
116d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_IRQ              4
117d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_IRQ              3
118*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_IRQ             52
119*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_IRQ             51
120*dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_IRQ             56
121558df83dSJean-Christophe Dubois 
122558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */
123