xref: /openbmc/qemu/include/hw/arm/fsl-imx31.h (revision 7f3986278b0bc214e83111ea55c8d12bac79c4fa)
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"
26*7f398627SJean-Christophe Dubois #include "hw/i2c/imx_i2c.h"
27558df83dSJean-Christophe Dubois #include "exec/memory.h"
28558df83dSJean-Christophe Dubois 
29558df83dSJean-Christophe Dubois #define TYPE_FSL_IMX31 "fsl,imx31"
30558df83dSJean-Christophe Dubois #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)
31558df83dSJean-Christophe Dubois 
32558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2
33558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2
34558df83dSJean-Christophe Dubois 
35558df83dSJean-Christophe Dubois typedef struct FslIMX31State {
36558df83dSJean-Christophe Dubois     /*< private >*/
37558df83dSJean-Christophe Dubois     DeviceState parent_obj;
38558df83dSJean-Christophe Dubois 
39558df83dSJean-Christophe Dubois     /*< public >*/
40558df83dSJean-Christophe Dubois     ARMCPU         cpu;
41558df83dSJean-Christophe Dubois     IMXAVICState   avic;
42558df83dSJean-Christophe Dubois     IMXCCMState    ccm;
43558df83dSJean-Christophe Dubois     IMXSerialState uart[FSL_IMX31_NUM_UARTS];
44558df83dSJean-Christophe Dubois     IMXGPTState    gpt;
45558df83dSJean-Christophe Dubois     IMXEPITState   epit[FSL_IMX31_NUM_EPITS];
46558df83dSJean-Christophe Dubois     MemoryRegion   secure_rom;
47558df83dSJean-Christophe Dubois     MemoryRegion   rom;
48558df83dSJean-Christophe Dubois     MemoryRegion   iram;
49558df83dSJean-Christophe Dubois     MemoryRegion   iram_alias;
50558df83dSJean-Christophe Dubois } FslIMX31State;
51558df83dSJean-Christophe Dubois 
52558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR       0x00000000
53558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE       0x4000
54558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR              0x00404000
55558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE              0x4000
56558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR       0x10000000
57558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE       0xFFC0000
58558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR             0x1FFFC000
59558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE             0x4000
60558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR            0x43F90000
61558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE            0x4000
62558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR            0x43F94000
63558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE            0x4000
64558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR              0x53F80000
65558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE              0x4000
66558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR              0x53F90000
67558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE              0x4000
68558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR            0x53F94000
69558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE            0x4000
70558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR            0x53F98000
71558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE            0x4000
72558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR             0x68000000
73558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE             0x100
74558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR           0x80000000
75558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE           0x10000000
76558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR           0x90000000
77558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE           0x10000000
78558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR           0xA0000000
79558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE           0x8000000
80558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR           0xA8000000
81558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE           0x8000000
82558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR              0xB0000000
83558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE              0x2000000
84558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR              0xB2000000
85558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE              0x2000000
86558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR              0xB4000000
87558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE              0x2000000
88558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR              0xB6000000
89558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE              0x2000000
90558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR             0xB8000000
91558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE             0x1000
92558df83dSJean-Christophe Dubois 
93558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ             27
94558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ             28
95558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ               29
96558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ             32
97558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ             45
98558df83dSJean-Christophe Dubois 
99558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */
100