xref: /openbmc/qemu/include/hw/misc/imx6_src.h (revision 4dad0a9aa818698e0735c8352bf7925a1660df6f)
119830574SJean-Christophe DUBOIS /*
219830574SJean-Christophe DUBOIS  * IMX6 System Reset Controller
319830574SJean-Christophe DUBOIS  *
419830574SJean-Christophe DUBOIS  * Copyright (C) 2012 NICTA
519830574SJean-Christophe DUBOIS  * Updated by Jean-Christophe Dubois <jcd@tribudubois.net>
619830574SJean-Christophe DUBOIS  *
719830574SJean-Christophe DUBOIS  * This work is licensed under the terms of the GNU GPL, version 2 or later.
819830574SJean-Christophe DUBOIS  * See the COPYING file in the top-level directory.
919830574SJean-Christophe DUBOIS  */
1019830574SJean-Christophe DUBOIS 
1119830574SJean-Christophe DUBOIS #ifndef IMX6_SRC_H
1219830574SJean-Christophe DUBOIS #define IMX6_SRC_H
1319830574SJean-Christophe DUBOIS 
1419830574SJean-Christophe DUBOIS #include "hw/sysbus.h"
1519830574SJean-Christophe DUBOIS #include "qemu/bitops.h"
16db1015e9SEduardo Habkost #include "qom/object.h"
1719830574SJean-Christophe DUBOIS 
1819830574SJean-Christophe DUBOIS #define SRC_SCR 0
1919830574SJean-Christophe DUBOIS #define SRC_SBMR1 1
2019830574SJean-Christophe DUBOIS #define SRC_SRSR 2
2119830574SJean-Christophe DUBOIS #define SRC_SISR 5
2219830574SJean-Christophe DUBOIS #define SRC_SIMR 6
2319830574SJean-Christophe DUBOIS #define SRC_SBMR2 7
2419830574SJean-Christophe DUBOIS #define SRC_GPR1 8
2519830574SJean-Christophe DUBOIS #define SRC_GPR2 9
2619830574SJean-Christophe DUBOIS #define SRC_GPR3 10
2719830574SJean-Christophe DUBOIS #define SRC_GPR4 11
2819830574SJean-Christophe DUBOIS #define SRC_GPR5 12
2919830574SJean-Christophe DUBOIS #define SRC_GPR6 13
3019830574SJean-Christophe DUBOIS #define SRC_GPR7 14
3119830574SJean-Christophe DUBOIS #define SRC_GPR8 15
3219830574SJean-Christophe DUBOIS #define SRC_GPR9 16
3319830574SJean-Christophe DUBOIS #define SRC_GPR10 17
3419830574SJean-Christophe DUBOIS #define SRC_MAX 18
3519830574SJean-Christophe DUBOIS 
3619830574SJean-Christophe DUBOIS /* SRC_SCR */
3719830574SJean-Christophe DUBOIS #define CORE3_ENABLE_SHIFT     24
3819830574SJean-Christophe DUBOIS #define CORE3_ENABLE_LENGTH    1
3919830574SJean-Christophe DUBOIS #define CORE2_ENABLE_SHIFT     23
4019830574SJean-Christophe DUBOIS #define CORE2_ENABLE_LENGTH    1
4119830574SJean-Christophe DUBOIS #define CORE1_ENABLE_SHIFT     22
4219830574SJean-Christophe DUBOIS #define CORE1_ENABLE_LENGTH    1
4319830574SJean-Christophe DUBOIS #define CORE3_RST_SHIFT        16
4419830574SJean-Christophe DUBOIS #define CORE3_RST_LENGTH       1
4519830574SJean-Christophe DUBOIS #define CORE2_RST_SHIFT        15
4619830574SJean-Christophe DUBOIS #define CORE2_RST_LENGTH       1
4719830574SJean-Christophe DUBOIS #define CORE1_RST_SHIFT        14
4819830574SJean-Christophe DUBOIS #define CORE1_RST_LENGTH       1
4919830574SJean-Christophe DUBOIS #define CORE0_RST_SHIFT        13
5019830574SJean-Christophe DUBOIS #define CORE0_RST_LENGTH       1
5119830574SJean-Christophe DUBOIS #define SW_IPU1_RST_SHIFT      3
5219830574SJean-Christophe DUBOIS #define SW_IPU1_RST_LENGTH     1
5319830574SJean-Christophe DUBOIS #define SW_IPU2_RST_SHIFT      12
5419830574SJean-Christophe DUBOIS #define SW_IPU2_RST_LENGTH     1
5519830574SJean-Christophe DUBOIS #define WARM_RST_ENABLE_SHIFT  0
5619830574SJean-Christophe DUBOIS #define WARM_RST_ENABLE_LENGTH 1
5719830574SJean-Christophe DUBOIS 
5819830574SJean-Christophe DUBOIS #define EXTRACT(value, name) extract32(value, name##_SHIFT, name##_LENGTH)
5919830574SJean-Christophe DUBOIS 
6019830574SJean-Christophe DUBOIS #define TYPE_IMX6_SRC "imx6.src"
61*8063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(IMX6SRCState, IMX6_SRC)
6219830574SJean-Christophe DUBOIS 
63db1015e9SEduardo Habkost struct IMX6SRCState {
6419830574SJean-Christophe DUBOIS     /* <private> */
6519830574SJean-Christophe DUBOIS     SysBusDevice parent_obj;
6619830574SJean-Christophe DUBOIS 
6719830574SJean-Christophe DUBOIS     /* <public> */
6819830574SJean-Christophe DUBOIS     MemoryRegion iomem;
6919830574SJean-Christophe DUBOIS 
7019830574SJean-Christophe DUBOIS     uint32_t regs[SRC_MAX];
7119830574SJean-Christophe DUBOIS 
72db1015e9SEduardo Habkost };
7319830574SJean-Christophe DUBOIS 
7419830574SJean-Christophe DUBOIS #endif /* IMX6_SRC_H */
75