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" 200c105b26SBernhard Beschow #include "hw/net/imx_fec.h" 21f8b26121SBernhard Beschow #include "hw/or-irq.h" 22fd1deb53SBernhard Beschow #include "hw/pci-host/designware.h" 23fd1deb53SBernhard Beschow #include "hw/pci-host/fsl_imx8m_phy.h" 24a81193c3SBernhard Beschow #include "hw/sd/sdhci.h" 2506908a84SBernhard Beschow #include "hw/ssi/imx_spi.h" 26f8b26121SBernhard Beschow #include "hw/timer/imx_gpt.h" 274226c39fSBernhard Beschow #include "hw/usb/hcd-dwc3.h" 281ac21eb8SBernhard Beschow #include "hw/watchdog/wdt_imx2.h" 29*26c1c41eSBernhard Beschow #include "hw/sysbus.h" 30a4eefc69SBernhard Beschow #include "qom/object.h" 31a4eefc69SBernhard Beschow #include "qemu/units.h" 32a4eefc69SBernhard Beschow 33a4eefc69SBernhard Beschow #define TYPE_FSL_IMX8MP "fsl-imx8mp" 34a4eefc69SBernhard Beschow OBJECT_DECLARE_SIMPLE_TYPE(FslImx8mpState, FSL_IMX8MP) 35a4eefc69SBernhard Beschow 36a4eefc69SBernhard Beschow #define FSL_IMX8MP_RAM_START 0x40000000 37a4eefc69SBernhard Beschow #define FSL_IMX8MP_RAM_SIZE_MAX (8 * GiB) 38a4eefc69SBernhard Beschow 39a4eefc69SBernhard Beschow enum FslImx8mpConfiguration { 40a4eefc69SBernhard Beschow FSL_IMX8MP_NUM_CPUS = 4, 4106908a84SBernhard Beschow FSL_IMX8MP_NUM_ECSPIS = 3, 42a17c1d93SBernhard Beschow FSL_IMX8MP_NUM_GPIOS = 5, 43f8b26121SBernhard Beschow FSL_IMX8MP_NUM_GPTS = 6, 44764f18afSBernhard Beschow FSL_IMX8MP_NUM_I2CS = 6, 45a4eefc69SBernhard Beschow FSL_IMX8MP_NUM_IRQS = 160, 46a4eefc69SBernhard Beschow FSL_IMX8MP_NUM_UARTS = 4, 474226c39fSBernhard Beschow FSL_IMX8MP_NUM_USBS = 2, 48a81193c3SBernhard Beschow FSL_IMX8MP_NUM_USDHCS = 3, 491ac21eb8SBernhard Beschow FSL_IMX8MP_NUM_WDTS = 3, 50a4eefc69SBernhard Beschow }; 51a4eefc69SBernhard Beschow 52a4eefc69SBernhard Beschow struct FslImx8mpState { 53*26c1c41eSBernhard Beschow SysBusDevice parent_obj; 54a4eefc69SBernhard Beschow 55a4eefc69SBernhard Beschow ARMCPU cpu[FSL_IMX8MP_NUM_CPUS]; 56a4eefc69SBernhard Beschow GICv3State gic; 57f8b26121SBernhard Beschow IMXGPTState gpt[FSL_IMX8MP_NUM_GPTS]; 58a17c1d93SBernhard Beschow IMXGPIOState gpio[FSL_IMX8MP_NUM_GPIOS]; 5986c2dff9SBernhard Beschow IMX8MPCCMState ccm; 6086c2dff9SBernhard Beschow IMX8MPAnalogState analog; 61487967beSBernhard Beschow IMX7SNVSState snvs; 6206908a84SBernhard Beschow IMXSPIState spi[FSL_IMX8MP_NUM_ECSPIS]; 63764f18afSBernhard Beschow IMXI2CState i2c[FSL_IMX8MP_NUM_I2CS]; 64a4eefc69SBernhard Beschow IMXSerialState uart[FSL_IMX8MP_NUM_UARTS]; 650c105b26SBernhard Beschow IMXFECState enet; 66a81193c3SBernhard Beschow SDHCIState usdhc[FSL_IMX8MP_NUM_USDHCS]; 671ac21eb8SBernhard Beschow IMX2WdtState wdt[FSL_IMX8MP_NUM_WDTS]; 684226c39fSBernhard Beschow USBDWC3 usb[FSL_IMX8MP_NUM_USBS]; 69fd1deb53SBernhard Beschow DesignwarePCIEHost pcie; 70fd1deb53SBernhard Beschow FslImx8mPciePhyState pcie_phy; 71f8b26121SBernhard Beschow OrIRQState gpt5_gpt6_irq; 721aaf3478SBernhard Beschow MemoryRegion ocram; 730c105b26SBernhard Beschow 740c105b26SBernhard Beschow uint32_t phy_num; 750c105b26SBernhard Beschow bool phy_connected; 76a4eefc69SBernhard Beschow }; 77a4eefc69SBernhard Beschow 78a4eefc69SBernhard Beschow enum FslImx8mpMemoryRegions { 79a4eefc69SBernhard Beschow FSL_IMX8MP_A53_DAP, 80a4eefc69SBernhard Beschow FSL_IMX8MP_AIPS1_CONFIGURATION, 81a4eefc69SBernhard Beschow FSL_IMX8MP_AIPS2_CONFIGURATION, 82a4eefc69SBernhard Beschow FSL_IMX8MP_AIPS3_CONFIGURATION, 83a4eefc69SBernhard Beschow FSL_IMX8MP_AIPS4_CONFIGURATION, 84a4eefc69SBernhard Beschow FSL_IMX8MP_AIPS5_CONFIGURATION, 85a4eefc69SBernhard Beschow FSL_IMX8MP_ANA_OSC, 86a4eefc69SBernhard Beschow FSL_IMX8MP_ANA_PLL, 87a4eefc69SBernhard Beschow FSL_IMX8MP_ANA_TSENSOR, 88a4eefc69SBernhard Beschow FSL_IMX8MP_APBH_DMA, 89a4eefc69SBernhard Beschow FSL_IMX8MP_ASRC, 90a4eefc69SBernhard Beschow FSL_IMX8MP_AUDIO_BLK_CTRL, 91a4eefc69SBernhard Beschow FSL_IMX8MP_AUDIO_DSP, 92a4eefc69SBernhard Beschow FSL_IMX8MP_AUDIO_XCVR_RX, 93a4eefc69SBernhard Beschow FSL_IMX8MP_AUD_IRQ_STEER, 94a4eefc69SBernhard Beschow FSL_IMX8MP_BOOT_ROM, 95a4eefc69SBernhard Beschow FSL_IMX8MP_BOOT_ROM_PROTECTED, 96a4eefc69SBernhard Beschow FSL_IMX8MP_CAAM, 97a4eefc69SBernhard Beschow FSL_IMX8MP_CAAM_MEM, 98a4eefc69SBernhard Beschow FSL_IMX8MP_CCM, 99a4eefc69SBernhard Beschow FSL_IMX8MP_CSU, 100a4eefc69SBernhard Beschow FSL_IMX8MP_DDR_BLK_CTRL, 101a4eefc69SBernhard Beschow FSL_IMX8MP_DDR_CTL, 102a4eefc69SBernhard Beschow FSL_IMX8MP_DDR_PERF_MON, 103a4eefc69SBernhard Beschow FSL_IMX8MP_DDR_PHY, 104a4eefc69SBernhard Beschow FSL_IMX8MP_DDR_PHY_BROADCAST, 105a4eefc69SBernhard Beschow FSL_IMX8MP_ECSPI1, 106a4eefc69SBernhard Beschow FSL_IMX8MP_ECSPI2, 107a4eefc69SBernhard Beschow FSL_IMX8MP_ECSPI3, 108a4eefc69SBernhard Beschow FSL_IMX8MP_EDMA_CHANNELS, 109a4eefc69SBernhard Beschow FSL_IMX8MP_EDMA_MANAGEMENT_PAGE, 110a4eefc69SBernhard Beschow FSL_IMX8MP_ENET1, 111a4eefc69SBernhard Beschow FSL_IMX8MP_ENET2_TSN, 112a4eefc69SBernhard Beschow FSL_IMX8MP_FLEXCAN1, 113a4eefc69SBernhard Beschow FSL_IMX8MP_FLEXCAN2, 114a4eefc69SBernhard Beschow FSL_IMX8MP_GIC_DIST, 115a4eefc69SBernhard Beschow FSL_IMX8MP_GIC_REDIST, 116a4eefc69SBernhard Beschow FSL_IMX8MP_GPC, 117a4eefc69SBernhard Beschow FSL_IMX8MP_GPIO1, 118a4eefc69SBernhard Beschow FSL_IMX8MP_GPIO2, 119a4eefc69SBernhard Beschow FSL_IMX8MP_GPIO3, 120a4eefc69SBernhard Beschow FSL_IMX8MP_GPIO4, 121a4eefc69SBernhard Beschow FSL_IMX8MP_GPIO5, 122a4eefc69SBernhard Beschow FSL_IMX8MP_GPT1, 123a4eefc69SBernhard Beschow FSL_IMX8MP_GPT2, 124a4eefc69SBernhard Beschow FSL_IMX8MP_GPT3, 125a4eefc69SBernhard Beschow FSL_IMX8MP_GPT4, 126a4eefc69SBernhard Beschow FSL_IMX8MP_GPT5, 127a4eefc69SBernhard Beschow FSL_IMX8MP_GPT6, 128a4eefc69SBernhard Beschow FSL_IMX8MP_GPU2D, 129a4eefc69SBernhard Beschow FSL_IMX8MP_GPU3D, 130a4eefc69SBernhard Beschow FSL_IMX8MP_HDMI_TX, 131a4eefc69SBernhard Beschow FSL_IMX8MP_HDMI_TX_AUDLNK_MSTR, 132a4eefc69SBernhard Beschow FSL_IMX8MP_HSIO_BLK_CTL, 133a4eefc69SBernhard Beschow FSL_IMX8MP_I2C1, 134a4eefc69SBernhard Beschow FSL_IMX8MP_I2C2, 135a4eefc69SBernhard Beschow FSL_IMX8MP_I2C3, 136a4eefc69SBernhard Beschow FSL_IMX8MP_I2C4, 137a4eefc69SBernhard Beschow FSL_IMX8MP_I2C5, 138a4eefc69SBernhard Beschow FSL_IMX8MP_I2C6, 139a4eefc69SBernhard Beschow FSL_IMX8MP_INTERCONNECT, 140a4eefc69SBernhard Beschow FSL_IMX8MP_IOMUXC, 141a4eefc69SBernhard Beschow FSL_IMX8MP_IOMUXC_GPR, 142a4eefc69SBernhard Beschow FSL_IMX8MP_IPS_DEWARP, 143a4eefc69SBernhard Beschow FSL_IMX8MP_ISI, 144a4eefc69SBernhard Beschow FSL_IMX8MP_ISP1, 145a4eefc69SBernhard Beschow FSL_IMX8MP_ISP2, 146a4eefc69SBernhard Beschow FSL_IMX8MP_LCDIF1, 147a4eefc69SBernhard Beschow FSL_IMX8MP_LCDIF2, 148a4eefc69SBernhard Beschow FSL_IMX8MP_MEDIA_BLK_CTL, 149a4eefc69SBernhard Beschow FSL_IMX8MP_MIPI_CSI1, 150a4eefc69SBernhard Beschow FSL_IMX8MP_MIPI_CSI2, 151a4eefc69SBernhard Beschow FSL_IMX8MP_MIPI_DSI1, 152a4eefc69SBernhard Beschow FSL_IMX8MP_MU_1_A, 153a4eefc69SBernhard Beschow FSL_IMX8MP_MU_1_B, 154a4eefc69SBernhard Beschow FSL_IMX8MP_MU_2_A, 155a4eefc69SBernhard Beschow FSL_IMX8MP_MU_2_B, 156a4eefc69SBernhard Beschow FSL_IMX8MP_MU_3_A, 157a4eefc69SBernhard Beschow FSL_IMX8MP_MU_3_B, 158a4eefc69SBernhard Beschow FSL_IMX8MP_NPU, 159a4eefc69SBernhard Beschow FSL_IMX8MP_OCOTP_CTRL, 160a4eefc69SBernhard Beschow FSL_IMX8MP_OCRAM, 161a4eefc69SBernhard Beschow FSL_IMX8MP_OCRAM_S, 162a4eefc69SBernhard Beschow FSL_IMX8MP_PCIE1, 163a4eefc69SBernhard Beschow FSL_IMX8MP_PCIE1_MEM, 164a4eefc69SBernhard Beschow FSL_IMX8MP_PCIE_PHY1, 165a4eefc69SBernhard Beschow FSL_IMX8MP_PDM, 166a4eefc69SBernhard Beschow FSL_IMX8MP_PERFMON1, 167a4eefc69SBernhard Beschow FSL_IMX8MP_PERFMON2, 168a4eefc69SBernhard Beschow FSL_IMX8MP_PWM1, 169a4eefc69SBernhard Beschow FSL_IMX8MP_PWM2, 170a4eefc69SBernhard Beschow FSL_IMX8MP_PWM3, 171a4eefc69SBernhard Beschow FSL_IMX8MP_PWM4, 172a4eefc69SBernhard Beschow FSL_IMX8MP_QOSC, 173a4eefc69SBernhard Beschow FSL_IMX8MP_QSPI, 174a4eefc69SBernhard Beschow FSL_IMX8MP_QSPI1_RX_BUFFER, 175a4eefc69SBernhard Beschow FSL_IMX8MP_QSPI1_TX_BUFFER, 176a4eefc69SBernhard Beschow FSL_IMX8MP_QSPI_MEM, 177a4eefc69SBernhard Beschow FSL_IMX8MP_RAM, 178a4eefc69SBernhard Beschow FSL_IMX8MP_RDC, 179a4eefc69SBernhard Beschow FSL_IMX8MP_SAI1, 180a4eefc69SBernhard Beschow FSL_IMX8MP_SAI2, 181a4eefc69SBernhard Beschow FSL_IMX8MP_SAI3, 182a4eefc69SBernhard Beschow FSL_IMX8MP_SAI5, 183a4eefc69SBernhard Beschow FSL_IMX8MP_SAI6, 184a4eefc69SBernhard Beschow FSL_IMX8MP_SAI7, 185a4eefc69SBernhard Beschow FSL_IMX8MP_SDMA1, 186a4eefc69SBernhard Beschow FSL_IMX8MP_SDMA2, 187a4eefc69SBernhard Beschow FSL_IMX8MP_SDMA3, 188a4eefc69SBernhard Beschow FSL_IMX8MP_SEMAPHORE1, 189a4eefc69SBernhard Beschow FSL_IMX8MP_SEMAPHORE2, 190a4eefc69SBernhard Beschow FSL_IMX8MP_SEMAPHORE_HS, 191a4eefc69SBernhard Beschow FSL_IMX8MP_SNVS_HP, 192a4eefc69SBernhard Beschow FSL_IMX8MP_SPBA1, 193a4eefc69SBernhard Beschow FSL_IMX8MP_SPBA2, 194a4eefc69SBernhard Beschow FSL_IMX8MP_SRC, 195a4eefc69SBernhard Beschow FSL_IMX8MP_SYSCNT_CMP, 196a4eefc69SBernhard Beschow FSL_IMX8MP_SYSCNT_CTRL, 197a4eefc69SBernhard Beschow FSL_IMX8MP_SYSCNT_RD, 198a4eefc69SBernhard Beschow FSL_IMX8MP_TCM_DTCM, 199a4eefc69SBernhard Beschow FSL_IMX8MP_TCM_ITCM, 200a4eefc69SBernhard Beschow FSL_IMX8MP_TZASC, 201a4eefc69SBernhard Beschow FSL_IMX8MP_UART1, 202a4eefc69SBernhard Beschow FSL_IMX8MP_UART2, 203a4eefc69SBernhard Beschow FSL_IMX8MP_UART3, 204a4eefc69SBernhard Beschow FSL_IMX8MP_UART4, 205a4eefc69SBernhard Beschow FSL_IMX8MP_USB1, 206a4eefc69SBernhard Beschow FSL_IMX8MP_USB2, 2074226c39fSBernhard Beschow FSL_IMX8MP_USB1_DEV, 2084226c39fSBernhard Beschow FSL_IMX8MP_USB2_DEV, 2094226c39fSBernhard Beschow FSL_IMX8MP_USB1_OTG, 2104226c39fSBernhard Beschow FSL_IMX8MP_USB2_OTG, 2114226c39fSBernhard Beschow FSL_IMX8MP_USB1_GLUE, 2124226c39fSBernhard Beschow FSL_IMX8MP_USB2_GLUE, 213a4eefc69SBernhard Beschow FSL_IMX8MP_USDHC1, 214a4eefc69SBernhard Beschow FSL_IMX8MP_USDHC2, 215a4eefc69SBernhard Beschow FSL_IMX8MP_USDHC3, 216a4eefc69SBernhard Beschow FSL_IMX8MP_VPU, 217a4eefc69SBernhard Beschow FSL_IMX8MP_VPU_BLK_CTRL, 218a4eefc69SBernhard Beschow FSL_IMX8MP_VPU_G1_DECODER, 219a4eefc69SBernhard Beschow FSL_IMX8MP_VPU_G2_DECODER, 220a4eefc69SBernhard Beschow FSL_IMX8MP_VPU_VC8000E_ENCODER, 221a4eefc69SBernhard Beschow FSL_IMX8MP_WDOG1, 222a4eefc69SBernhard Beschow FSL_IMX8MP_WDOG2, 223a4eefc69SBernhard Beschow FSL_IMX8MP_WDOG3, 224a4eefc69SBernhard Beschow }; 225a4eefc69SBernhard Beschow 226a4eefc69SBernhard Beschow enum FslImx8mpIrqs { 227a81193c3SBernhard Beschow FSL_IMX8MP_USDHC1_IRQ = 22, 228a81193c3SBernhard Beschow FSL_IMX8MP_USDHC2_IRQ = 23, 229a81193c3SBernhard Beschow FSL_IMX8MP_USDHC3_IRQ = 24, 230a81193c3SBernhard Beschow 231a4eefc69SBernhard Beschow FSL_IMX8MP_UART1_IRQ = 26, 232a4eefc69SBernhard Beschow FSL_IMX8MP_UART2_IRQ = 27, 233a4eefc69SBernhard Beschow FSL_IMX8MP_UART3_IRQ = 28, 234a4eefc69SBernhard Beschow FSL_IMX8MP_UART4_IRQ = 29, 235a4eefc69SBernhard Beschow FSL_IMX8MP_UART5_IRQ = 30, 236a4eefc69SBernhard Beschow FSL_IMX8MP_UART6_IRQ = 16, 237fd1deb53SBernhard Beschow 23806908a84SBernhard Beschow FSL_IMX8MP_ECSPI1_IRQ = 31, 23906908a84SBernhard Beschow FSL_IMX8MP_ECSPI2_IRQ = 32, 24006908a84SBernhard Beschow FSL_IMX8MP_ECSPI3_IRQ = 33, 24106908a84SBernhard Beschow 242764f18afSBernhard Beschow FSL_IMX8MP_I2C1_IRQ = 35, 243764f18afSBernhard Beschow FSL_IMX8MP_I2C2_IRQ = 36, 244764f18afSBernhard Beschow FSL_IMX8MP_I2C3_IRQ = 37, 245764f18afSBernhard Beschow FSL_IMX8MP_I2C4_IRQ = 38, 246764f18afSBernhard Beschow 2474226c39fSBernhard Beschow FSL_IMX8MP_USB1_IRQ = 40, 2484226c39fSBernhard Beschow FSL_IMX8MP_USB2_IRQ = 41, 2494226c39fSBernhard Beschow 250f8b26121SBernhard Beschow FSL_IMX8MP_GPT1_IRQ = 55, 251f8b26121SBernhard Beschow FSL_IMX8MP_GPT2_IRQ = 54, 252f8b26121SBernhard Beschow FSL_IMX8MP_GPT3_IRQ = 53, 253f8b26121SBernhard Beschow FSL_IMX8MP_GPT4_IRQ = 52, 254f8b26121SBernhard Beschow FSL_IMX8MP_GPT5_GPT6_IRQ = 51, 255f8b26121SBernhard Beschow 256a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO1_LOW_IRQ = 64, 257a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO1_HIGH_IRQ = 65, 258a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO2_LOW_IRQ = 66, 259a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO2_HIGH_IRQ = 67, 260a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO3_LOW_IRQ = 68, 261a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO3_HIGH_IRQ = 69, 262a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO4_LOW_IRQ = 70, 263a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO4_HIGH_IRQ = 71, 264a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO5_LOW_IRQ = 72, 265a17c1d93SBernhard Beschow FSL_IMX8MP_GPIO5_HIGH_IRQ = 73, 266a17c1d93SBernhard Beschow 267764f18afSBernhard Beschow FSL_IMX8MP_I2C5_IRQ = 76, 268764f18afSBernhard Beschow FSL_IMX8MP_I2C6_IRQ = 77, 269764f18afSBernhard Beschow 2701ac21eb8SBernhard Beschow FSL_IMX8MP_WDOG1_IRQ = 78, 2711ac21eb8SBernhard Beschow FSL_IMX8MP_WDOG2_IRQ = 79, 2721ac21eb8SBernhard Beschow FSL_IMX8MP_WDOG3_IRQ = 10, 2731ac21eb8SBernhard Beschow 2740c105b26SBernhard Beschow FSL_IMX8MP_ENET1_MAC_IRQ = 118, 2750c105b26SBernhard Beschow FSL_IMX6_ENET1_MAC_1588_IRQ = 121, 2760c105b26SBernhard Beschow 277fd1deb53SBernhard Beschow FSL_IMX8MP_PCI_INTA_IRQ = 126, 278fd1deb53SBernhard Beschow FSL_IMX8MP_PCI_INTB_IRQ = 125, 279fd1deb53SBernhard Beschow FSL_IMX8MP_PCI_INTC_IRQ = 124, 280fd1deb53SBernhard Beschow FSL_IMX8MP_PCI_INTD_IRQ = 123, 281fd1deb53SBernhard Beschow FSL_IMX8MP_PCI_MSI_IRQ = 140, 282a4eefc69SBernhard Beschow }; 283a4eefc69SBernhard Beschow 284a4eefc69SBernhard Beschow #endif /* FSL_IMX8MP_H */ 285