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