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