1*19830574SJean-Christophe DUBOIS /* 2*19830574SJean-Christophe DUBOIS * IMX6 System Reset Controller 3*19830574SJean-Christophe DUBOIS * 4*19830574SJean-Christophe DUBOIS * Copyright (C) 2012 NICTA 5*19830574SJean-Christophe DUBOIS * Updated by Jean-Christophe Dubois <jcd@tribudubois.net> 6*19830574SJean-Christophe DUBOIS * 7*19830574SJean-Christophe DUBOIS * This work is licensed under the terms of the GNU GPL, version 2 or later. 8*19830574SJean-Christophe DUBOIS * See the COPYING file in the top-level directory. 9*19830574SJean-Christophe DUBOIS */ 10*19830574SJean-Christophe DUBOIS 11*19830574SJean-Christophe DUBOIS #ifndef IMX6_SRC_H 12*19830574SJean-Christophe DUBOIS #define IMX6_SRC_H 13*19830574SJean-Christophe DUBOIS 14*19830574SJean-Christophe DUBOIS #include "hw/sysbus.h" 15*19830574SJean-Christophe DUBOIS #include "qemu/bitops.h" 16*19830574SJean-Christophe DUBOIS 17*19830574SJean-Christophe DUBOIS #define SRC_SCR 0 18*19830574SJean-Christophe DUBOIS #define SRC_SBMR1 1 19*19830574SJean-Christophe DUBOIS #define SRC_SRSR 2 20*19830574SJean-Christophe DUBOIS #define SRC_SISR 5 21*19830574SJean-Christophe DUBOIS #define SRC_SIMR 6 22*19830574SJean-Christophe DUBOIS #define SRC_SBMR2 7 23*19830574SJean-Christophe DUBOIS #define SRC_GPR1 8 24*19830574SJean-Christophe DUBOIS #define SRC_GPR2 9 25*19830574SJean-Christophe DUBOIS #define SRC_GPR3 10 26*19830574SJean-Christophe DUBOIS #define SRC_GPR4 11 27*19830574SJean-Christophe DUBOIS #define SRC_GPR5 12 28*19830574SJean-Christophe DUBOIS #define SRC_GPR6 13 29*19830574SJean-Christophe DUBOIS #define SRC_GPR7 14 30*19830574SJean-Christophe DUBOIS #define SRC_GPR8 15 31*19830574SJean-Christophe DUBOIS #define SRC_GPR9 16 32*19830574SJean-Christophe DUBOIS #define SRC_GPR10 17 33*19830574SJean-Christophe DUBOIS #define SRC_MAX 18 34*19830574SJean-Christophe DUBOIS 35*19830574SJean-Christophe DUBOIS /* SRC_SCR */ 36*19830574SJean-Christophe DUBOIS #define CORE3_ENABLE_SHIFT 24 37*19830574SJean-Christophe DUBOIS #define CORE3_ENABLE_LENGTH 1 38*19830574SJean-Christophe DUBOIS #define CORE2_ENABLE_SHIFT 23 39*19830574SJean-Christophe DUBOIS #define CORE2_ENABLE_LENGTH 1 40*19830574SJean-Christophe DUBOIS #define CORE1_ENABLE_SHIFT 22 41*19830574SJean-Christophe DUBOIS #define CORE1_ENABLE_LENGTH 1 42*19830574SJean-Christophe DUBOIS #define CORE3_RST_SHIFT 16 43*19830574SJean-Christophe DUBOIS #define CORE3_RST_LENGTH 1 44*19830574SJean-Christophe DUBOIS #define CORE2_RST_SHIFT 15 45*19830574SJean-Christophe DUBOIS #define CORE2_RST_LENGTH 1 46*19830574SJean-Christophe DUBOIS #define CORE1_RST_SHIFT 14 47*19830574SJean-Christophe DUBOIS #define CORE1_RST_LENGTH 1 48*19830574SJean-Christophe DUBOIS #define CORE0_RST_SHIFT 13 49*19830574SJean-Christophe DUBOIS #define CORE0_RST_LENGTH 1 50*19830574SJean-Christophe DUBOIS #define SW_IPU1_RST_SHIFT 3 51*19830574SJean-Christophe DUBOIS #define SW_IPU1_RST_LENGTH 1 52*19830574SJean-Christophe DUBOIS #define SW_IPU2_RST_SHIFT 12 53*19830574SJean-Christophe DUBOIS #define SW_IPU2_RST_LENGTH 1 54*19830574SJean-Christophe DUBOIS #define WARM_RST_ENABLE_SHIFT 0 55*19830574SJean-Christophe DUBOIS #define WARM_RST_ENABLE_LENGTH 1 56*19830574SJean-Christophe DUBOIS 57*19830574SJean-Christophe DUBOIS #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH) 58*19830574SJean-Christophe DUBOIS 59*19830574SJean-Christophe DUBOIS #define TYPE_IMX6_SRC "imx6.src" 60*19830574SJean-Christophe DUBOIS #define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC) 61*19830574SJean-Christophe DUBOIS 62*19830574SJean-Christophe DUBOIS typedef struct IMX6SRCState { 63*19830574SJean-Christophe DUBOIS /* <private> */ 64*19830574SJean-Christophe DUBOIS SysBusDevice parent_obj; 65*19830574SJean-Christophe DUBOIS 66*19830574SJean-Christophe DUBOIS /* <public> */ 67*19830574SJean-Christophe DUBOIS MemoryRegion iomem; 68*19830574SJean-Christophe DUBOIS 69*19830574SJean-Christophe DUBOIS uint32_t regs[SRC_MAX]; 70*19830574SJean-Christophe DUBOIS 71*19830574SJean-Christophe DUBOIS } IMX6SRCState; 72*19830574SJean-Christophe DUBOIS 73*19830574SJean-Christophe DUBOIS #endif /* IMX6_SRC_H */ 74