]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/misc/mips_cmgcr.h
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-06-24' into staging
[mirror_qemu.git] / include / hw / misc / mips_cmgcr.h
CommitLineData
3994215d
YK
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2015 Imagination Technologies
7 *
8 */
9
121d0712
MA
10#ifndef MIPS_CMGCR_H
11#define MIPS_CMGCR_H
3994215d 12
ec150c7e
MA
13#include "hw/sysbus.h"
14
3994215d
YK
15#define TYPE_MIPS_GCR "mips-gcr"
16#define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
17
18#define GCR_BASE_ADDR 0x1fbf8000ULL
19#define GCR_ADDRSPACE_SZ 0x8000
20
21/* Offsets to register blocks */
22#define MIPS_GCB_OFS 0x0000 /* Global Control Block */
23#define MIPS_CLCB_OFS 0x2000 /* Core Local Control Block */
24#define MIPS_COCB_OFS 0x4000 /* Core Other Control Block */
25#define MIPS_GDB_OFS 0x6000 /* Global Debug Block */
26
27/* Global Control Block Register Map */
28#define GCR_CONFIG_OFS 0x0000
29#define GCR_BASE_OFS 0x0008
30#define GCR_REV_OFS 0x0030
19494f81 31#define GCR_GIC_BASE_OFS 0x0080
2edd5261 32#define GCR_CPC_BASE_OFS 0x0088
19494f81 33#define GCR_GIC_STATUS_OFS 0x00D0
2edd5261 34#define GCR_CPC_STATUS_OFS 0x00F0
3994215d
YK
35#define GCR_L2_CONFIG_OFS 0x0130
36
37/* Core Local and Core Other Block Register Map */
38#define GCR_CL_CONFIG_OFS 0x0010
39#define GCR_CL_OTHER_OFS 0x0018
c09199fe 40#define GCR_CL_RESETBASE_OFS 0x0020
3994215d
YK
41
42/* GCR_L2_CONFIG register fields */
43#define GCR_L2_CONFIG_BYPASS_SHF 20
44#define GCR_L2_CONFIG_BYPASS_MSK ((0x1ULL) << GCR_L2_CONFIG_BYPASS_SHF)
45
08944be1
PB
46/* GCR_BASE register fields */
47#define GCR_BASE_GCRBASE_MSK 0xffffffff8000ULL
48
19494f81
LA
49/* GCR_GIC_BASE register fields */
50#define GCR_GIC_BASE_GICEN_MSK 1
51#define GCR_GIC_BASE_GICBASE_MSK 0xFFFFFFFE0000ULL
52#define GCR_GIC_BASE_MSK (GCR_GIC_BASE_GICEN_MSK | GCR_GIC_BASE_GICBASE_MSK)
53
2edd5261
LA
54/* GCR_CPC_BASE register fields */
55#define GCR_CPC_BASE_CPCEN_MSK 1
56#define GCR_CPC_BASE_CPCBASE_MSK 0xFFFFFFFF8000ULL
57#define GCR_CPC_BASE_MSK (GCR_CPC_BASE_CPCEN_MSK | GCR_CPC_BASE_CPCBASE_MSK)
58
c09199fe
LA
59/* GCR_CL_OTHER_OFS register fields */
60#define GCR_CL_OTHER_VPOTHER_MSK 0x7
61#define GCR_CL_OTHER_MSK GCR_CL_OTHER_VPOTHER_MSK
62
63/* GCR_CL_RESETBASE_OFS register fields */
64#define GCR_CL_RESET_BASE_RESETBASE_MSK 0xFFFFF000U
65#define GCR_CL_RESET_BASE_MSK GCR_CL_RESET_BASE_RESETBASE_MSK
66
67typedef struct MIPSGCRVPState MIPSGCRVPState;
68struct MIPSGCRVPState {
69 uint32_t other;
70 uint64_t reset_base;
71};
72
3994215d
YK
73typedef struct MIPSGCRState MIPSGCRState;
74struct MIPSGCRState {
75 SysBusDevice parent_obj;
76
77 int32_t gcr_rev;
78 int32_t num_vps;
79 hwaddr gcr_base;
80 MemoryRegion iomem;
2edd5261 81 MemoryRegion *cpc_mr;
19494f81 82 MemoryRegion *gic_mr;
2edd5261
LA
83
84 uint64_t cpc_base;
19494f81 85 uint64_t gic_base;
c09199fe
LA
86
87 /* VP Local/Other Registers */
88 MIPSGCRVPState *vps;
3994215d
YK
89};
90
121d0712 91#endif /* MIPS_CMGCR_H */