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