xref: /qemu/include/hw/arm/fsl-imx8mp.h (revision 764f18afb2b749a9dcfd37bac5709e7a7bcd2589)
1a4eefc69SBernhard Beschow /*
2a4eefc69SBernhard Beschow  * i.MX 8M Plus SoC Definitions
3a4eefc69SBernhard Beschow  *
4a4eefc69SBernhard Beschow  * Copyright (c) 2024, Bernhard Beschow <shentey@gmail.com>
5a4eefc69SBernhard Beschow  *
6a4eefc69SBernhard Beschow  * SPDX-License-Identifier: GPL-2.0-or-later
7a4eefc69SBernhard Beschow  */
8a4eefc69SBernhard Beschow 
9a4eefc69SBernhard Beschow #ifndef FSL_IMX8MP_H
10a4eefc69SBernhard Beschow #define FSL_IMX8MP_H
11a4eefc69SBernhard Beschow 
12a4eefc69SBernhard Beschow #include "cpu.h"
13a4eefc69SBernhard Beschow #include "hw/char/imx_serial.h"
14a17c1d93SBernhard Beschow #include "hw/gpio/imx_gpio.h"
15*764f18afSBernhard Beschow #include "hw/i2c/imx_i2c.h"
16a4eefc69SBernhard Beschow #include "hw/intc/arm_gicv3_common.h"
17487967beSBernhard Beschow #include "hw/misc/imx7_snvs.h"
1886c2dff9SBernhard Beschow #include "hw/misc/imx8mp_analog.h"
1986c2dff9SBernhard Beschow #include "hw/misc/imx8mp_ccm.h"
20fd1deb53SBernhard Beschow #include "hw/pci-host/designware.h"
21fd1deb53SBernhard Beschow #include "hw/pci-host/fsl_imx8m_phy.h"
22a81193c3SBernhard Beschow #include "hw/sd/sdhci.h"
23a4eefc69SBernhard Beschow #include "qom/object.h"
24a4eefc69SBernhard Beschow #include "qemu/units.h"
25a4eefc69SBernhard Beschow 
26a4eefc69SBernhard Beschow #define TYPE_FSL_IMX8MP "fsl-imx8mp"
27a4eefc69SBernhard Beschow OBJECT_DECLARE_SIMPLE_TYPE(FslImx8mpState, FSL_IMX8MP)
28a4eefc69SBernhard Beschow 
29a4eefc69SBernhard Beschow #define FSL_IMX8MP_RAM_START        0x40000000
30a4eefc69SBernhard Beschow #define FSL_IMX8MP_RAM_SIZE_MAX     (8 * GiB)
31a4eefc69SBernhard Beschow 
32a4eefc69SBernhard Beschow enum FslImx8mpConfiguration {
33a4eefc69SBernhard Beschow     FSL_IMX8MP_NUM_CPUS         = 4,
34a17c1d93SBernhard Beschow     FSL_IMX8MP_NUM_GPIOS        = 5,
35*764f18afSBernhard Beschow     FSL_IMX8MP_NUM_I2CS         = 6,
36a4eefc69SBernhard Beschow     FSL_IMX8MP_NUM_IRQS         = 160,
37a4eefc69SBernhard Beschow     FSL_IMX8MP_NUM_UARTS        = 4,
38a81193c3SBernhard Beschow     FSL_IMX8MP_NUM_USDHCS       = 3,
39a4eefc69SBernhard Beschow };
40a4eefc69SBernhard Beschow 
41a4eefc69SBernhard Beschow struct FslImx8mpState {
42a4eefc69SBernhard Beschow     DeviceState    parent_obj;
43a4eefc69SBernhard Beschow 
44a4eefc69SBernhard Beschow     ARMCPU             cpu[FSL_IMX8MP_NUM_CPUS];
45a4eefc69SBernhard Beschow     GICv3State         gic;
46a17c1d93SBernhard Beschow     IMXGPIOState       gpio[FSL_IMX8MP_NUM_GPIOS];
4786c2dff9SBernhard Beschow     IMX8MPCCMState     ccm;
4886c2dff9SBernhard Beschow     IMX8MPAnalogState  analog;
49487967beSBernhard Beschow     IMX7SNVSState      snvs;
50*764f18afSBernhard Beschow     IMXI2CState        i2c[FSL_IMX8MP_NUM_I2CS];
51a4eefc69SBernhard Beschow     IMXSerialState     uart[FSL_IMX8MP_NUM_UARTS];
52a81193c3SBernhard Beschow     SDHCIState         usdhc[FSL_IMX8MP_NUM_USDHCS];
53fd1deb53SBernhard Beschow     DesignwarePCIEHost pcie;
54fd1deb53SBernhard Beschow     FslImx8mPciePhyState   pcie_phy;
55a4eefc69SBernhard Beschow };
56a4eefc69SBernhard Beschow 
57a4eefc69SBernhard Beschow enum FslImx8mpMemoryRegions {
58a4eefc69SBernhard Beschow     FSL_IMX8MP_A53_DAP,
59a4eefc69SBernhard Beschow     FSL_IMX8MP_AIPS1_CONFIGURATION,
60a4eefc69SBernhard Beschow     FSL_IMX8MP_AIPS2_CONFIGURATION,
61a4eefc69SBernhard Beschow     FSL_IMX8MP_AIPS3_CONFIGURATION,
62a4eefc69SBernhard Beschow     FSL_IMX8MP_AIPS4_CONFIGURATION,
63a4eefc69SBernhard Beschow     FSL_IMX8MP_AIPS5_CONFIGURATION,
64a4eefc69SBernhard Beschow     FSL_IMX8MP_ANA_OSC,
65a4eefc69SBernhard Beschow     FSL_IMX8MP_ANA_PLL,
66a4eefc69SBernhard Beschow     FSL_IMX8MP_ANA_TSENSOR,
67a4eefc69SBernhard Beschow     FSL_IMX8MP_APBH_DMA,
68a4eefc69SBernhard Beschow     FSL_IMX8MP_ASRC,
69a4eefc69SBernhard Beschow     FSL_IMX8MP_AUDIO_BLK_CTRL,
70a4eefc69SBernhard Beschow     FSL_IMX8MP_AUDIO_DSP,
71a4eefc69SBernhard Beschow     FSL_IMX8MP_AUDIO_XCVR_RX,
72a4eefc69SBernhard Beschow     FSL_IMX8MP_AUD_IRQ_STEER,
73a4eefc69SBernhard Beschow     FSL_IMX8MP_BOOT_ROM,
74a4eefc69SBernhard Beschow     FSL_IMX8MP_BOOT_ROM_PROTECTED,
75a4eefc69SBernhard Beschow     FSL_IMX8MP_CAAM,
76a4eefc69SBernhard Beschow     FSL_IMX8MP_CAAM_MEM,
77a4eefc69SBernhard Beschow     FSL_IMX8MP_CCM,
78a4eefc69SBernhard Beschow     FSL_IMX8MP_CSU,
79a4eefc69SBernhard Beschow     FSL_IMX8MP_DDR_BLK_CTRL,
80a4eefc69SBernhard Beschow     FSL_IMX8MP_DDR_CTL,
81a4eefc69SBernhard Beschow     FSL_IMX8MP_DDR_PERF_MON,
82a4eefc69SBernhard Beschow     FSL_IMX8MP_DDR_PHY,
83a4eefc69SBernhard Beschow     FSL_IMX8MP_DDR_PHY_BROADCAST,
84a4eefc69SBernhard Beschow     FSL_IMX8MP_ECSPI1,
85a4eefc69SBernhard Beschow     FSL_IMX8MP_ECSPI2,
86a4eefc69SBernhard Beschow     FSL_IMX8MP_ECSPI3,
87a4eefc69SBernhard Beschow     FSL_IMX8MP_EDMA_CHANNELS,
88a4eefc69SBernhard Beschow     FSL_IMX8MP_EDMA_MANAGEMENT_PAGE,
89a4eefc69SBernhard Beschow     FSL_IMX8MP_ENET1,
90a4eefc69SBernhard Beschow     FSL_IMX8MP_ENET2_TSN,
91a4eefc69SBernhard Beschow     FSL_IMX8MP_FLEXCAN1,
92a4eefc69SBernhard Beschow     FSL_IMX8MP_FLEXCAN2,
93a4eefc69SBernhard Beschow     FSL_IMX8MP_GIC_DIST,
94a4eefc69SBernhard Beschow     FSL_IMX8MP_GIC_REDIST,
95a4eefc69SBernhard Beschow     FSL_IMX8MP_GPC,
96a4eefc69SBernhard Beschow     FSL_IMX8MP_GPIO1,
97a4eefc69SBernhard Beschow     FSL_IMX8MP_GPIO2,
98a4eefc69SBernhard Beschow     FSL_IMX8MP_GPIO3,
99a4eefc69SBernhard Beschow     FSL_IMX8MP_GPIO4,
100a4eefc69SBernhard Beschow     FSL_IMX8MP_GPIO5,
101a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT1,
102a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT2,
103a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT3,
104a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT4,
105a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT5,
106a4eefc69SBernhard Beschow     FSL_IMX8MP_GPT6,
107a4eefc69SBernhard Beschow     FSL_IMX8MP_GPU2D,
108a4eefc69SBernhard Beschow     FSL_IMX8MP_GPU3D,
109a4eefc69SBernhard Beschow     FSL_IMX8MP_HDMI_TX,
110a4eefc69SBernhard Beschow     FSL_IMX8MP_HDMI_TX_AUDLNK_MSTR,
111a4eefc69SBernhard Beschow     FSL_IMX8MP_HSIO_BLK_CTL,
112a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C1,
113a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C2,
114a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C3,
115a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C4,
116a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C5,
117a4eefc69SBernhard Beschow     FSL_IMX8MP_I2C6,
118a4eefc69SBernhard Beschow     FSL_IMX8MP_INTERCONNECT,
119a4eefc69SBernhard Beschow     FSL_IMX8MP_IOMUXC,
120a4eefc69SBernhard Beschow     FSL_IMX8MP_IOMUXC_GPR,
121a4eefc69SBernhard Beschow     FSL_IMX8MP_IPS_DEWARP,
122a4eefc69SBernhard Beschow     FSL_IMX8MP_ISI,
123a4eefc69SBernhard Beschow     FSL_IMX8MP_ISP1,
124a4eefc69SBernhard Beschow     FSL_IMX8MP_ISP2,
125a4eefc69SBernhard Beschow     FSL_IMX8MP_LCDIF1,
126a4eefc69SBernhard Beschow     FSL_IMX8MP_LCDIF2,
127a4eefc69SBernhard Beschow     FSL_IMX8MP_MEDIA_BLK_CTL,
128a4eefc69SBernhard Beschow     FSL_IMX8MP_MIPI_CSI1,
129a4eefc69SBernhard Beschow     FSL_IMX8MP_MIPI_CSI2,
130a4eefc69SBernhard Beschow     FSL_IMX8MP_MIPI_DSI1,
131a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_1_A,
132a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_1_B,
133a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_2_A,
134a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_2_B,
135a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_3_A,
136a4eefc69SBernhard Beschow     FSL_IMX8MP_MU_3_B,
137a4eefc69SBernhard Beschow     FSL_IMX8MP_NPU,
138a4eefc69SBernhard Beschow     FSL_IMX8MP_OCOTP_CTRL,
139a4eefc69SBernhard Beschow     FSL_IMX8MP_OCRAM,
140a4eefc69SBernhard Beschow     FSL_IMX8MP_OCRAM_S,
141a4eefc69SBernhard Beschow     FSL_IMX8MP_PCIE1,
142a4eefc69SBernhard Beschow     FSL_IMX8MP_PCIE1_MEM,
143a4eefc69SBernhard Beschow     FSL_IMX8MP_PCIE_PHY1,
144a4eefc69SBernhard Beschow     FSL_IMX8MP_PDM,
145a4eefc69SBernhard Beschow     FSL_IMX8MP_PERFMON1,
146a4eefc69SBernhard Beschow     FSL_IMX8MP_PERFMON2,
147a4eefc69SBernhard Beschow     FSL_IMX8MP_PWM1,
148a4eefc69SBernhard Beschow     FSL_IMX8MP_PWM2,
149a4eefc69SBernhard Beschow     FSL_IMX8MP_PWM3,
150a4eefc69SBernhard Beschow     FSL_IMX8MP_PWM4,
151a4eefc69SBernhard Beschow     FSL_IMX8MP_QOSC,
152a4eefc69SBernhard Beschow     FSL_IMX8MP_QSPI,
153a4eefc69SBernhard Beschow     FSL_IMX8MP_QSPI1_RX_BUFFER,
154a4eefc69SBernhard Beschow     FSL_IMX8MP_QSPI1_TX_BUFFER,
155a4eefc69SBernhard Beschow     FSL_IMX8MP_QSPI_MEM,
156a4eefc69SBernhard Beschow     FSL_IMX8MP_RAM,
157a4eefc69SBernhard Beschow     FSL_IMX8MP_RDC,
158a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI1,
159a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI2,
160a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI3,
161a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI5,
162a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI6,
163a4eefc69SBernhard Beschow     FSL_IMX8MP_SAI7,
164a4eefc69SBernhard Beschow     FSL_IMX8MP_SDMA1,
165a4eefc69SBernhard Beschow     FSL_IMX8MP_SDMA2,
166a4eefc69SBernhard Beschow     FSL_IMX8MP_SDMA3,
167a4eefc69SBernhard Beschow     FSL_IMX8MP_SEMAPHORE1,
168a4eefc69SBernhard Beschow     FSL_IMX8MP_SEMAPHORE2,
169a4eefc69SBernhard Beschow     FSL_IMX8MP_SEMAPHORE_HS,
170a4eefc69SBernhard Beschow     FSL_IMX8MP_SNVS_HP,
171a4eefc69SBernhard Beschow     FSL_IMX8MP_SPBA1,
172a4eefc69SBernhard Beschow     FSL_IMX8MP_SPBA2,
173a4eefc69SBernhard Beschow     FSL_IMX8MP_SRC,
174a4eefc69SBernhard Beschow     FSL_IMX8MP_SYSCNT_CMP,
175a4eefc69SBernhard Beschow     FSL_IMX8MP_SYSCNT_CTRL,
176a4eefc69SBernhard Beschow     FSL_IMX8MP_SYSCNT_RD,
177a4eefc69SBernhard Beschow     FSL_IMX8MP_TCM_DTCM,
178a4eefc69SBernhard Beschow     FSL_IMX8MP_TCM_ITCM,
179a4eefc69SBernhard Beschow     FSL_IMX8MP_TZASC,
180a4eefc69SBernhard Beschow     FSL_IMX8MP_UART1,
181a4eefc69SBernhard Beschow     FSL_IMX8MP_UART2,
182a4eefc69SBernhard Beschow     FSL_IMX8MP_UART3,
183a4eefc69SBernhard Beschow     FSL_IMX8MP_UART4,
184a4eefc69SBernhard Beschow     FSL_IMX8MP_USB1,
185a4eefc69SBernhard Beschow     FSL_IMX8MP_USB2,
186a4eefc69SBernhard Beschow     FSL_IMX8MP_USDHC1,
187a4eefc69SBernhard Beschow     FSL_IMX8MP_USDHC2,
188a4eefc69SBernhard Beschow     FSL_IMX8MP_USDHC3,
189a4eefc69SBernhard Beschow     FSL_IMX8MP_VPU,
190a4eefc69SBernhard Beschow     FSL_IMX8MP_VPU_BLK_CTRL,
191a4eefc69SBernhard Beschow     FSL_IMX8MP_VPU_G1_DECODER,
192a4eefc69SBernhard Beschow     FSL_IMX8MP_VPU_G2_DECODER,
193a4eefc69SBernhard Beschow     FSL_IMX8MP_VPU_VC8000E_ENCODER,
194a4eefc69SBernhard Beschow     FSL_IMX8MP_WDOG1,
195a4eefc69SBernhard Beschow     FSL_IMX8MP_WDOG2,
196a4eefc69SBernhard Beschow     FSL_IMX8MP_WDOG3,
197a4eefc69SBernhard Beschow };
198a4eefc69SBernhard Beschow 
199a4eefc69SBernhard Beschow enum FslImx8mpIrqs {
200a81193c3SBernhard Beschow     FSL_IMX8MP_USDHC1_IRQ   = 22,
201a81193c3SBernhard Beschow     FSL_IMX8MP_USDHC2_IRQ   = 23,
202a81193c3SBernhard Beschow     FSL_IMX8MP_USDHC3_IRQ   = 24,
203a81193c3SBernhard Beschow 
204a4eefc69SBernhard Beschow     FSL_IMX8MP_UART1_IRQ    = 26,
205a4eefc69SBernhard Beschow     FSL_IMX8MP_UART2_IRQ    = 27,
206a4eefc69SBernhard Beschow     FSL_IMX8MP_UART3_IRQ    = 28,
207a4eefc69SBernhard Beschow     FSL_IMX8MP_UART4_IRQ    = 29,
208a4eefc69SBernhard Beschow     FSL_IMX8MP_UART5_IRQ    = 30,
209a4eefc69SBernhard Beschow     FSL_IMX8MP_UART6_IRQ    = 16,
210fd1deb53SBernhard Beschow 
211*764f18afSBernhard Beschow     FSL_IMX8MP_I2C1_IRQ     = 35,
212*764f18afSBernhard Beschow     FSL_IMX8MP_I2C2_IRQ     = 36,
213*764f18afSBernhard Beschow     FSL_IMX8MP_I2C3_IRQ     = 37,
214*764f18afSBernhard Beschow     FSL_IMX8MP_I2C4_IRQ     = 38,
215*764f18afSBernhard Beschow 
216a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO1_LOW_IRQ  = 64,
217a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO1_HIGH_IRQ = 65,
218a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO2_LOW_IRQ  = 66,
219a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO2_HIGH_IRQ = 67,
220a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO3_LOW_IRQ  = 68,
221a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO3_HIGH_IRQ = 69,
222a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO4_LOW_IRQ  = 70,
223a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO4_HIGH_IRQ = 71,
224a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO5_LOW_IRQ  = 72,
225a17c1d93SBernhard Beschow     FSL_IMX8MP_GPIO5_HIGH_IRQ = 73,
226a17c1d93SBernhard Beschow 
227*764f18afSBernhard Beschow     FSL_IMX8MP_I2C5_IRQ     = 76,
228*764f18afSBernhard Beschow     FSL_IMX8MP_I2C6_IRQ     = 77,
229*764f18afSBernhard Beschow 
230fd1deb53SBernhard Beschow     FSL_IMX8MP_PCI_INTA_IRQ = 126,
231fd1deb53SBernhard Beschow     FSL_IMX8MP_PCI_INTB_IRQ = 125,
232fd1deb53SBernhard Beschow     FSL_IMX8MP_PCI_INTC_IRQ = 124,
233fd1deb53SBernhard Beschow     FSL_IMX8MP_PCI_INTD_IRQ = 123,
234fd1deb53SBernhard Beschow     FSL_IMX8MP_PCI_MSI_IRQ  = 140,
235a4eefc69SBernhard Beschow };
236a4eefc69SBernhard Beschow 
237a4eefc69SBernhard Beschow #endif /* FSL_IMX8MP_H */
238