1558df83dSJean-Christophe Dubois /* 2558df83dSJean-Christophe Dubois * Freescale i.MX31 SoC emulation 3558df83dSJean-Christophe Dubois * 4558df83dSJean-Christophe Dubois * Copyright (C) 2015 Jean-Christophe Dubois <jcd@tribudubois.net> 5558df83dSJean-Christophe Dubois * 6558df83dSJean-Christophe Dubois * This program is free software; you can redistribute it and/or modify it 7558df83dSJean-Christophe Dubois * under the terms of the GNU General Public License as published by the 8558df83dSJean-Christophe Dubois * Free Software Foundation; either version 2 of the License, or 9558df83dSJean-Christophe Dubois * (at your option) any later version. 10558df83dSJean-Christophe Dubois * 11558df83dSJean-Christophe Dubois * This program is distributed in the hope that it will be useful, but WITHOUT 12558df83dSJean-Christophe Dubois * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13558df83dSJean-Christophe Dubois * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14558df83dSJean-Christophe Dubois * for more details. 15558df83dSJean-Christophe Dubois */ 16558df83dSJean-Christophe Dubois 17558df83dSJean-Christophe Dubois #ifndef FSL_IMX31_H 18558df83dSJean-Christophe Dubois #define FSL_IMX31_H 19558df83dSJean-Christophe Dubois 20558df83dSJean-Christophe Dubois #include "hw/intc/imx_avic.h" 21cb54d868SJean-Christophe Dubois #include "hw/misc/imx31_ccm.h" 22558df83dSJean-Christophe Dubois #include "hw/char/imx_serial.h" 23558df83dSJean-Christophe Dubois #include "hw/timer/imx_gpt.h" 24558df83dSJean-Christophe Dubois #include "hw/timer/imx_epit.h" 257f398627SJean-Christophe Dubois #include "hw/i2c/imx_i2c.h" 26dde0c4caSJean-Christophe Dubois #include "hw/gpio/imx_gpio.h" 27b9e521ddSGuenter Roeck #include "hw/watchdog/wdt_imx2.h" 28558df83dSJean-Christophe Dubois #include "exec/memory.h" 29ec150c7eSMarkus Armbruster #include "target/arm/cpu.h" 30db1015e9SEduardo Habkost #include "qom/object.h" 31558df83dSJean-Christophe Dubois 32*e178113fSMarkus Armbruster #define TYPE_FSL_IMX31 "fsl-imx31" 338063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(FslIMX31State, FSL_IMX31) 34558df83dSJean-Christophe Dubois 35558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2 36558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2 37d4e26d10SJean-Christophe Dubois #define FSL_IMX31_NUM_I2CS 3 38dde0c4caSJean-Christophe Dubois #define FSL_IMX31_NUM_GPIOS 3 39558df83dSJean-Christophe Dubois 40db1015e9SEduardo Habkost struct FslIMX31State { 41558df83dSJean-Christophe Dubois /*< private >*/ 42558df83dSJean-Christophe Dubois DeviceState parent_obj; 43558df83dSJean-Christophe Dubois 44558df83dSJean-Christophe Dubois /*< public >*/ 45558df83dSJean-Christophe Dubois ARMCPU cpu; 46558df83dSJean-Christophe Dubois IMXAVICState avic; 47cb54d868SJean-Christophe Dubois IMX31CCMState ccm; 48558df83dSJean-Christophe Dubois IMXSerialState uart[FSL_IMX31_NUM_UARTS]; 49558df83dSJean-Christophe Dubois IMXGPTState gpt; 50558df83dSJean-Christophe Dubois IMXEPITState epit[FSL_IMX31_NUM_EPITS]; 51d4e26d10SJean-Christophe Dubois IMXI2CState i2c[FSL_IMX31_NUM_I2CS]; 52dde0c4caSJean-Christophe Dubois IMXGPIOState gpio[FSL_IMX31_NUM_GPIOS]; 53b9e521ddSGuenter Roeck IMX2WdtState wdt; 54558df83dSJean-Christophe Dubois MemoryRegion secure_rom; 55558df83dSJean-Christophe Dubois MemoryRegion rom; 56558df83dSJean-Christophe Dubois MemoryRegion iram; 57558df83dSJean-Christophe Dubois MemoryRegion iram_alias; 58db1015e9SEduardo Habkost }; 59558df83dSJean-Christophe Dubois 60558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR 0x00000000 61558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE 0x4000 62558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR 0x00404000 63558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE 0x4000 64558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR 0x10000000 65558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE 0xFFC0000 66558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR 0x1FFFC000 67558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE 0x4000 68d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_ADDR 0x43F80000 69d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_SIZE 0x4000 70d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_ADDR 0x43F84000 71d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_SIZE 0x4000 72558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR 0x43F90000 73558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE 0x4000 74558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR 0x43F94000 75558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE 0x4000 76d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_ADDR 0x43F98000 77d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_SIZE 0x4000 78558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR 0x53F80000 79558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE 0x4000 80558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR 0x53F90000 81558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE 0x4000 82558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR 0x53F94000 83558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE 0x4000 84558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR 0x53F98000 85558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE 0x4000 86dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_ADDR 0x53FA4000 87dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_SIZE 0x4000 88dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_ADDR 0x53FCC000 89dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_SIZE 0x4000 90dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_ADDR 0x53FD0000 91dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_SIZE 0x4000 92b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_ADDR 0x53FDC000 93b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_SIZE 0x4000 94558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR 0x68000000 95558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE 0x100 96558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR 0x80000000 97558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE 0x10000000 98558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR 0x90000000 99558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE 0x10000000 100558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR 0xA0000000 101558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE 0x8000000 102558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR 0xA8000000 103558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE 0x8000000 104558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR 0xB0000000 105558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE 0x2000000 106558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR 0xB2000000 107558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE 0x2000000 108558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR 0xB4000000 109558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE 0x2000000 110558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR 0xB6000000 111558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE 0x2000000 112558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR 0xB8000000 113558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE 0x1000 114558df83dSJean-Christophe Dubois 115558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ 27 116558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ 28 117558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ 29 118558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ 32 119558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ 45 120d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_IRQ 10 121d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_IRQ 4 122d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_IRQ 3 123dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_IRQ 52 124dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_IRQ 51 125dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_IRQ 56 126558df83dSJean-Christophe Dubois 127558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */ 128