1*558df83dSJean-Christophe Dubois /* 2*558df83dSJean-Christophe Dubois * Freescale i.MX31 SoC emulation 3*558df83dSJean-Christophe Dubois * 4*558df83dSJean-Christophe Dubois * Copyright (C) 2015 Jean-Christophe Dubois <jcd@tribudubois.net> 5*558df83dSJean-Christophe Dubois * 6*558df83dSJean-Christophe Dubois * This program is free software; you can redistribute it and/or modify it 7*558df83dSJean-Christophe Dubois * under the terms of the GNU General Public License as published by the 8*558df83dSJean-Christophe Dubois * Free Software Foundation; either version 2 of the License, or 9*558df83dSJean-Christophe Dubois * (at your option) any later version. 10*558df83dSJean-Christophe Dubois * 11*558df83dSJean-Christophe Dubois * This program is distributed in the hope that it will be useful, but WITHOUT 12*558df83dSJean-Christophe Dubois * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13*558df83dSJean-Christophe Dubois * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14*558df83dSJean-Christophe Dubois * for more details. 15*558df83dSJean-Christophe Dubois */ 16*558df83dSJean-Christophe Dubois 17*558df83dSJean-Christophe Dubois #ifndef FSL_IMX31_H 18*558df83dSJean-Christophe Dubois #define FSL_IMX31_H 19*558df83dSJean-Christophe Dubois 20*558df83dSJean-Christophe Dubois #include "hw/arm/arm.h" 21*558df83dSJean-Christophe Dubois #include "hw/intc/imx_avic.h" 22*558df83dSJean-Christophe Dubois #include "hw/misc/imx_ccm.h" 23*558df83dSJean-Christophe Dubois #include "hw/char/imx_serial.h" 24*558df83dSJean-Christophe Dubois #include "hw/timer/imx_gpt.h" 25*558df83dSJean-Christophe Dubois #include "hw/timer/imx_epit.h" 26*558df83dSJean-Christophe Dubois #include "exec/memory.h" 27*558df83dSJean-Christophe Dubois 28*558df83dSJean-Christophe Dubois #define TYPE_FSL_IMX31 "fsl,imx31" 29*558df83dSJean-Christophe Dubois #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31) 30*558df83dSJean-Christophe Dubois 31*558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2 32*558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2 33*558df83dSJean-Christophe Dubois 34*558df83dSJean-Christophe Dubois typedef struct FslIMX31State { 35*558df83dSJean-Christophe Dubois /*< private >*/ 36*558df83dSJean-Christophe Dubois DeviceState parent_obj; 37*558df83dSJean-Christophe Dubois 38*558df83dSJean-Christophe Dubois /*< public >*/ 39*558df83dSJean-Christophe Dubois ARMCPU cpu; 40*558df83dSJean-Christophe Dubois IMXAVICState avic; 41*558df83dSJean-Christophe Dubois IMXCCMState ccm; 42*558df83dSJean-Christophe Dubois IMXSerialState uart[FSL_IMX31_NUM_UARTS]; 43*558df83dSJean-Christophe Dubois IMXGPTState gpt; 44*558df83dSJean-Christophe Dubois IMXEPITState epit[FSL_IMX31_NUM_EPITS]; 45*558df83dSJean-Christophe Dubois MemoryRegion secure_rom; 46*558df83dSJean-Christophe Dubois MemoryRegion rom; 47*558df83dSJean-Christophe Dubois MemoryRegion iram; 48*558df83dSJean-Christophe Dubois MemoryRegion iram_alias; 49*558df83dSJean-Christophe Dubois } FslIMX31State; 50*558df83dSJean-Christophe Dubois 51*558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR 0x00000000 52*558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE 0x4000 53*558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR 0x00404000 54*558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE 0x4000 55*558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR 0x10000000 56*558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE 0xFFC0000 57*558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR 0x1FFFC000 58*558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE 0x4000 59*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR 0x43F90000 60*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE 0x4000 61*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR 0x43F94000 62*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE 0x4000 63*558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR 0x53F80000 64*558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE 0x4000 65*558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR 0x53F90000 66*558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE 0x4000 67*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR 0x53F94000 68*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE 0x4000 69*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR 0x53F98000 70*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE 0x4000 71*558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR 0x68000000 72*558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE 0x100 73*558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR 0x80000000 74*558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE 0x10000000 75*558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR 0x90000000 76*558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE 0x10000000 77*558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR 0xA0000000 78*558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE 0x8000000 79*558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR 0xA8000000 80*558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE 0x8000000 81*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR 0xB0000000 82*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE 0x2000000 83*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR 0xB2000000 84*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE 0x2000000 85*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR 0xB4000000 86*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE 0x2000000 87*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR 0xB6000000 88*558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE 0x2000000 89*558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR 0xB8000000 90*558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE 0x1000 91*558df83dSJean-Christophe Dubois 92*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ 27 93*558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ 28 94*558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ 29 95*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ 32 96*558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ 45 97*558df83dSJean-Christophe Dubois 98*558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */ 99