xref: /openbmc/qemu/include/hw/misc/mips_cmgcr.h (revision 2edd5261)
13994215dSYongbok Kim /*
23994215dSYongbok Kim  * This file is subject to the terms and conditions of the GNU General Public
33994215dSYongbok Kim  * License.  See the file "COPYING" in the main directory of this archive
43994215dSYongbok Kim  * for more details.
53994215dSYongbok Kim  *
63994215dSYongbok Kim  * Copyright (C) 2015 Imagination Technologies
73994215dSYongbok Kim  *
83994215dSYongbok Kim  */
93994215dSYongbok Kim 
103994215dSYongbok Kim #ifndef _MIPS_GCR_H
113994215dSYongbok Kim #define _MIPS_GCR_H
123994215dSYongbok Kim 
133994215dSYongbok Kim #define TYPE_MIPS_GCR "mips-gcr"
143994215dSYongbok Kim #define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
153994215dSYongbok Kim 
163994215dSYongbok Kim #define GCR_BASE_ADDR           0x1fbf8000ULL
173994215dSYongbok Kim #define GCR_ADDRSPACE_SZ        0x8000
183994215dSYongbok Kim 
193994215dSYongbok Kim /* Offsets to register blocks */
203994215dSYongbok Kim #define MIPS_GCB_OFS        0x0000 /* Global Control Block */
213994215dSYongbok Kim #define MIPS_CLCB_OFS       0x2000 /* Core Local Control Block */
223994215dSYongbok Kim #define MIPS_COCB_OFS       0x4000 /* Core Other Control Block */
233994215dSYongbok Kim #define MIPS_GDB_OFS        0x6000 /* Global Debug Block */
243994215dSYongbok Kim 
253994215dSYongbok Kim /* Global Control Block Register Map */
263994215dSYongbok Kim #define GCR_CONFIG_OFS      0x0000
273994215dSYongbok Kim #define GCR_BASE_OFS        0x0008
283994215dSYongbok Kim #define GCR_REV_OFS         0x0030
29*2edd5261SLeon Alrae #define GCR_CPC_BASE_OFS    0x0088
30*2edd5261SLeon Alrae #define GCR_CPC_STATUS_OFS  0x00F0
313994215dSYongbok Kim #define GCR_L2_CONFIG_OFS   0x0130
323994215dSYongbok Kim 
333994215dSYongbok Kim /* Core Local and Core Other Block Register Map */
343994215dSYongbok Kim #define GCR_CL_CONFIG_OFS   0x0010
353994215dSYongbok Kim #define GCR_CL_OTHER_OFS    0x0018
363994215dSYongbok Kim 
373994215dSYongbok Kim /* GCR_L2_CONFIG register fields */
383994215dSYongbok Kim #define GCR_L2_CONFIG_BYPASS_SHF    20
393994215dSYongbok Kim #define GCR_L2_CONFIG_BYPASS_MSK    ((0x1ULL) << GCR_L2_CONFIG_BYPASS_SHF)
403994215dSYongbok Kim 
41*2edd5261SLeon Alrae /* GCR_CPC_BASE register fields */
42*2edd5261SLeon Alrae #define GCR_CPC_BASE_CPCEN_MSK   1
43*2edd5261SLeon Alrae #define GCR_CPC_BASE_CPCBASE_MSK 0xFFFFFFFF8000ULL
44*2edd5261SLeon Alrae #define GCR_CPC_BASE_MSK (GCR_CPC_BASE_CPCEN_MSK | GCR_CPC_BASE_CPCBASE_MSK)
45*2edd5261SLeon Alrae 
463994215dSYongbok Kim typedef struct MIPSGCRState MIPSGCRState;
473994215dSYongbok Kim struct MIPSGCRState {
483994215dSYongbok Kim     SysBusDevice parent_obj;
493994215dSYongbok Kim 
503994215dSYongbok Kim     int32_t gcr_rev;
513994215dSYongbok Kim     int32_t num_vps;
523994215dSYongbok Kim     hwaddr gcr_base;
533994215dSYongbok Kim     MemoryRegion iomem;
54*2edd5261SLeon Alrae     MemoryRegion *cpc_mr;
55*2edd5261SLeon Alrae 
56*2edd5261SLeon Alrae     uint64_t cpc_base;
573994215dSYongbok Kim };
583994215dSYongbok Kim 
593994215dSYongbok Kim #endif /* _MIPS_GCR_H */
60