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 2012ec8bd5SPeter Maydell #include "hw/arm/boot.h" 21558df83dSJean-Christophe Dubois #include "hw/intc/imx_avic.h" 22cb54d868SJean-Christophe Dubois #include "hw/misc/imx31_ccm.h" 23558df83dSJean-Christophe Dubois #include "hw/char/imx_serial.h" 24558df83dSJean-Christophe Dubois #include "hw/timer/imx_gpt.h" 25558df83dSJean-Christophe Dubois #include "hw/timer/imx_epit.h" 267f398627SJean-Christophe Dubois #include "hw/i2c/imx_i2c.h" 27dde0c4caSJean-Christophe Dubois #include "hw/gpio/imx_gpio.h" 28b9e521ddSGuenter Roeck #include "hw/watchdog/wdt_imx2.h" 29558df83dSJean-Christophe Dubois #include "exec/memory.h" 30ec150c7eSMarkus Armbruster #include "target/arm/cpu.h" 31*db1015e9SEduardo Habkost #include "qom/object.h" 32558df83dSJean-Christophe Dubois 33558df83dSJean-Christophe Dubois #define TYPE_FSL_IMX31 "fsl,imx31" 34*db1015e9SEduardo Habkost typedef struct FslIMX31State FslIMX31State; 35558df83dSJean-Christophe Dubois #define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31) 36558df83dSJean-Christophe Dubois 37558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_UARTS 2 38558df83dSJean-Christophe Dubois #define FSL_IMX31_NUM_EPITS 2 39d4e26d10SJean-Christophe Dubois #define FSL_IMX31_NUM_I2CS 3 40dde0c4caSJean-Christophe Dubois #define FSL_IMX31_NUM_GPIOS 3 41558df83dSJean-Christophe Dubois 42*db1015e9SEduardo Habkost struct FslIMX31State { 43558df83dSJean-Christophe Dubois /*< private >*/ 44558df83dSJean-Christophe Dubois DeviceState parent_obj; 45558df83dSJean-Christophe Dubois 46558df83dSJean-Christophe Dubois /*< public >*/ 47558df83dSJean-Christophe Dubois ARMCPU cpu; 48558df83dSJean-Christophe Dubois IMXAVICState avic; 49cb54d868SJean-Christophe Dubois IMX31CCMState ccm; 50558df83dSJean-Christophe Dubois IMXSerialState uart[FSL_IMX31_NUM_UARTS]; 51558df83dSJean-Christophe Dubois IMXGPTState gpt; 52558df83dSJean-Christophe Dubois IMXEPITState epit[FSL_IMX31_NUM_EPITS]; 53d4e26d10SJean-Christophe Dubois IMXI2CState i2c[FSL_IMX31_NUM_I2CS]; 54dde0c4caSJean-Christophe Dubois IMXGPIOState gpio[FSL_IMX31_NUM_GPIOS]; 55b9e521ddSGuenter Roeck IMX2WdtState wdt; 56558df83dSJean-Christophe Dubois MemoryRegion secure_rom; 57558df83dSJean-Christophe Dubois MemoryRegion rom; 58558df83dSJean-Christophe Dubois MemoryRegion iram; 59558df83dSJean-Christophe Dubois MemoryRegion iram_alias; 60*db1015e9SEduardo Habkost }; 61558df83dSJean-Christophe Dubois 62558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_ADDR 0x00000000 63558df83dSJean-Christophe Dubois #define FSL_IMX31_SECURE_ROM_SIZE 0x4000 64558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_ADDR 0x00404000 65558df83dSJean-Christophe Dubois #define FSL_IMX31_ROM_SIZE 0x4000 66558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_ADDR 0x10000000 67558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ALIAS_SIZE 0xFFC0000 68558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_ADDR 0x1FFFC000 69558df83dSJean-Christophe Dubois #define FSL_IMX31_IRAM_SIZE 0x4000 70d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_ADDR 0x43F80000 71d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_SIZE 0x4000 72d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_ADDR 0x43F84000 73d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_SIZE 0x4000 74558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_ADDR 0x43F90000 75558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_SIZE 0x4000 76558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_ADDR 0x43F94000 77558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_SIZE 0x4000 78d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_ADDR 0x43F98000 79d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_SIZE 0x4000 80558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_ADDR 0x53F80000 81558df83dSJean-Christophe Dubois #define FSL_IMX31_CCM_SIZE 0x4000 82558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_ADDR 0x53F90000 83558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_SIZE 0x4000 84558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_ADDR 0x53F94000 85558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_SIZE 0x4000 86558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_ADDR 0x53F98000 87558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_SIZE 0x4000 88dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_ADDR 0x53FA4000 89dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_SIZE 0x4000 90dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_ADDR 0x53FCC000 91dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_SIZE 0x4000 92dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_ADDR 0x53FD0000 93dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_SIZE 0x4000 94b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_ADDR 0x53FDC000 95b9e521ddSGuenter Roeck #define FSL_IMX31_WDT_SIZE 0x4000 96558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_ADDR 0x68000000 97558df83dSJean-Christophe Dubois #define FSL_IMX31_AVIC_SIZE 0x100 98558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_ADDR 0x80000000 99558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM0_SIZE 0x10000000 100558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_ADDR 0x90000000 101558df83dSJean-Christophe Dubois #define FSL_IMX31_SDRAM1_SIZE 0x10000000 102558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_ADDR 0xA0000000 103558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH0_SIZE 0x8000000 104558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_ADDR 0xA8000000 105558df83dSJean-Christophe Dubois #define FSL_IMX31_FLASH1_SIZE 0x8000000 106558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_ADDR 0xB0000000 107558df83dSJean-Christophe Dubois #define FSL_IMX31_CS2_SIZE 0x2000000 108558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_ADDR 0xB2000000 109558df83dSJean-Christophe Dubois #define FSL_IMX31_CS3_SIZE 0x2000000 110558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_ADDR 0xB4000000 111558df83dSJean-Christophe Dubois #define FSL_IMX31_CS4_SIZE 0x2000000 112558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_ADDR 0xB6000000 113558df83dSJean-Christophe Dubois #define FSL_IMX31_CS5_SIZE 0x2000000 114558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_ADDR 0xB8000000 115558df83dSJean-Christophe Dubois #define FSL_IMX31_NAND_SIZE 0x1000 116558df83dSJean-Christophe Dubois 117558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT2_IRQ 27 118558df83dSJean-Christophe Dubois #define FSL_IMX31_EPIT1_IRQ 28 119558df83dSJean-Christophe Dubois #define FSL_IMX31_GPT_IRQ 29 120558df83dSJean-Christophe Dubois #define FSL_IMX31_UART2_IRQ 32 121558df83dSJean-Christophe Dubois #define FSL_IMX31_UART1_IRQ 45 122d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C1_IRQ 10 123d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C2_IRQ 4 124d4e26d10SJean-Christophe Dubois #define FSL_IMX31_I2C3_IRQ 3 125dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO1_IRQ 52 126dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO2_IRQ 51 127dde0c4caSJean-Christophe Dubois #define FSL_IMX31_GPIO3_IRQ 56 128558df83dSJean-Christophe Dubois 129558df83dSJean-Christophe Dubois #endif /* FSL_IMX31_H */ 130