diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2008-04-28 12:14:26 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-04-28 12:14:26 -0400 |
commit | 39b8d5254246ac56342b72f812255c8f7a74dca9 (patch) | |
tree | a9ec6bfb5d09a8367c34cc2067328d1b49bb46c1 /include | |
parent | 308402445e005a039a72b315cd9b5ceeaea0063c (diff) |
[MIPS] Add support for MIPS CMP platform.
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/cmp.h | 18 | ||||
-rw-r--r-- | include/asm-mips/cpu.h | 7 | ||||
-rw-r--r-- | include/asm-mips/gcmpregs.h | 117 | ||||
-rw-r--r-- | include/asm-mips/gic.h | 487 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/launch.h | 35 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/malta.h | 23 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/maltaint.h | 27 | ||||
-rw-r--r-- | include/asm-mips/mips-boards/maltasmp.h | 36 | ||||
-rw-r--r-- | include/asm-mips/mipsmtregs.h | 8 | ||||
-rw-r--r-- | include/asm-mips/r4k-timer.h | 30 | ||||
-rw-r--r-- | include/asm-mips/smp-ops.h | 1 | ||||
-rw-r--r-- | include/asm-mips/smtc.h | 1 | ||||
-rw-r--r-- | include/asm-mips/smvp.h | 19 |
13 files changed, 802 insertions, 7 deletions
diff --git a/include/asm-mips/cmp.h b/include/asm-mips/cmp.h new file mode 100644 index 000000000000..89a73fb93ae6 --- /dev/null +++ b/include/asm-mips/cmp.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _ASM_CMP_H | ||
2 | #define _ASM_CMP_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for CMP multitasking on MIPS cores | ||
6 | */ | ||
7 | struct task_struct; | ||
8 | |||
9 | extern void cmp_smp_setup(void); | ||
10 | extern void cmp_smp_finish(void); | ||
11 | extern void cmp_boot_secondary(int cpu, struct task_struct *t); | ||
12 | extern void cmp_init_secondary(void); | ||
13 | extern void cmp_cpus_done(void); | ||
14 | extern void cmp_prepare_cpus(unsigned int max_cpus); | ||
15 | |||
16 | /* This is platform specific */ | ||
17 | extern void cmp_send_ipi(int cpu, unsigned int action); | ||
18 | #endif /* _ASM_CMP_H */ | ||
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index bf5bbc78a9f7..6d04ea912254 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -89,6 +89,7 @@ | |||
89 | #define PRID_IMP_34K 0x9500 | 89 | #define PRID_IMP_34K 0x9500 |
90 | #define PRID_IMP_24KE 0x9600 | 90 | #define PRID_IMP_24KE 0x9600 |
91 | #define PRID_IMP_74K 0x9700 | 91 | #define PRID_IMP_74K 0x9700 |
92 | #define PRID_IMP_1004K 0x9900 | ||
92 | #define PRID_IMP_LOONGSON1 0x4200 | 93 | #define PRID_IMP_LOONGSON1 0x4200 |
93 | #define PRID_IMP_LOONGSON2 0x6300 | 94 | #define PRID_IMP_LOONGSON2 0x6300 |
94 | 95 | ||
@@ -194,9 +195,9 @@ enum cpu_type_enum { | |||
194 | /* | 195 | /* |
195 | * MIPS32 class processors | 196 | * MIPS32 class processors |
196 | */ | 197 | */ |
197 | CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_74K, CPU_AU1000, | 198 | CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, |
198 | CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, CPU_AU1550, | 199 | CPU_AU1000, CPU_AU1100, CPU_AU1200, CPU_AU1210, CPU_AU1250, CPU_AU1500, |
199 | CPU_PR4450, CPU_BCM3302, CPU_BCM4710, | 200 | CPU_AU1550, CPU_PR4450, CPU_BCM3302, CPU_BCM4710, |
200 | 201 | ||
201 | /* | 202 | /* |
202 | * MIPS64 class processors | 203 | * MIPS64 class processors |
diff --git a/include/asm-mips/gcmpregs.h b/include/asm-mips/gcmpregs.h new file mode 100644 index 000000000000..d74a8a4ca861 --- /dev/null +++ b/include/asm-mips/gcmpregs.h | |||
@@ -0,0 +1,117 @@ | |||
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) 2000, 07 MIPS Technologies, Inc. | ||
7 | * | ||
8 | * Multiprocessor Subsystem Register Definitions | ||
9 | * | ||
10 | */ | ||
11 | #ifndef _ASM_GCMPREGS_H | ||
12 | #define _ASM_GCMPREGS_H | ||
13 | |||
14 | |||
15 | /* Offsets to major blocks within GCMP from GCMP base */ | ||
16 | #define GCMP_GCB_OFS 0x0000 /* Global Control Block */ | ||
17 | #define GCMP_CLCB_OFS 0x2000 /* Core Local Control Block */ | ||
18 | #define GCMP_COCB_OFS 0x4000 /* Core Other Control Block */ | ||
19 | #define GCMP_GDB_OFS 0x8000 /* Global Debug Block */ | ||
20 | |||
21 | /* Offsets to individual GCMP registers from GCMP base */ | ||
22 | #define GCMPOFS(block, tag, reg) (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS) | ||
23 | |||
24 | #define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg) | ||
25 | #define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg) | ||
26 | #define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg) | ||
27 | #define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg) | ||
28 | |||
29 | /* GCMP register access */ | ||
30 | #define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg)) | ||
31 | #define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg)) | ||
32 | #define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg)) | ||
33 | #define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg)) | ||
34 | |||
35 | /* Mask generation */ | ||
36 | #define GCMPMSK(block, reg, bits) (MSK(bits)<<GCMP_##block##_##reg##_SHF) | ||
37 | #define GCMPGCBMSK(reg, bits) GCMPMSK(GCB, reg, bits) | ||
38 | #define GCMPCCBMSK(reg, bits) GCMPMSK(CCB, reg, bits) | ||
39 | #define GCMPGDBMSK(reg, bits) GCMPMSK(GDB, reg, bits) | ||
40 | |||
41 | /* GCB registers */ | ||
42 | #define GCMP_GCB_GC_OFS 0x0000 /* Global Config Register */ | ||
43 | #define GCMP_GCB_GC_NUMIOCU_SHF 8 | ||
44 | #define GCMP_GCB_GC_NUMIOCU_MSK GCMPGCBMSK(GC_NUMIOCU, 4) | ||
45 | #define GCMP_GCB_GC_NUMCORES_SHF 0 | ||
46 | #define GCMP_GCB_GC_NUMCORES_MSK GCMPGCBMSK(GC_NUMCORES, 8) | ||
47 | #define GCMP_GCB_GCMPB_OFS 0x0008 /* Global GCMP Base */ | ||
48 | #define GCMP_GCB_GCMPB_GCMPBASE_SHF 15 | ||
49 | #define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17) | ||
50 | #define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0 | ||
51 | #define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2) | ||
52 | #define GCMP_GCB_GCMPB_CMDEFTGT_MEM 0 | ||
53 | #define GCMP_GCB_GCMPB_CMDEFTGT_MEM1 1 | ||
54 | #define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2 | ||
55 | #define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3 | ||
56 | #define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */ | ||
57 | #define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */ | ||
58 | #define GCMP_GCB_GCSRAP_CMACCESS_SHF 0 | ||
59 | #define GCMP_GCB_GCSRAP_CMACCESS_MSK GCMPGCBMSK(GCSRAP_CMACCESS, 8) | ||
60 | #define GCMP_GCB_GCMPREV_OFS 0x0030 /* GCMP Revision Register */ | ||
61 | #define GCMP_GCB_GCMEM_OFS 0x0040 /* Global CM Error Mask */ | ||
62 | #define GCMP_GCB_GCMEC_OFS 0x0048 /* Global CM Error Cause */ | ||
63 | #define GCMP_GCB_GMEC_ERROR_TYPE_SHF 27 | ||
64 | #define GCMP_GCB_GMEC_ERROR_TYPE_MSK GCMPGCBMSK(GMEC_ERROR_TYPE, 5) | ||
65 | #define GCMP_GCB_GMEC_ERROR_INFO_SHF 0 | ||
66 | #define GCMP_GCB_GMEC_ERROR_INFO_MSK GCMPGCBMSK(GMEC_ERROR_INFO, 27) | ||
67 | #define GCMP_GCB_GCMEA_OFS 0x0050 /* Global CM Error Address */ | ||
68 | #define GCMP_GCB_GCMEO_OFS 0x0058 /* Global CM Error Multiple */ | ||
69 | #define GCMP_GCB_GMEO_ERROR_2ND_SHF 0 | ||
70 | #define GCMP_GCB_GMEO_ERROR_2ND_MSK GCMPGCBMSK(GMEO_ERROR_2ND, 5) | ||
71 | #define GCMP_GCB_GICBA_OFS 0x0080 /* Global Interrupt Controller Base Address */ | ||
72 | #define GCMP_GCB_GICBA_BASE_SHF 17 | ||
73 | #define GCMP_GCB_GICBA_BASE_MSK GCMPGCBMSK(GICBA_BASE, 15) | ||
74 | #define GCMP_GCB_GICBA_EN_SHF 0 | ||
75 | #define GCMP_GCB_GICBA_EN_MSK GCMPGCBMSK(GICBA_EN, 1) | ||
76 | |||
77 | /* GCB Regions */ | ||
78 | #define GCMP_GCB_CMxBASE_OFS(n) (0x0090+16*(n)) /* Global Region[0-3] Base Address */ | ||
79 | #define GCMP_GCB_CMxBASE_BASE_SHF 16 | ||
80 | #define GCMP_GCB_CMxBASE_BASE_MSK GCMPGCBMSK(CMxBASE_BASE, 16) | ||
81 | #define GCMP_GCB_CMxMASK_OFS(n) (0x0098+16*(n)) /* Global Region[0-3] Address Mask */ | ||
82 | #define GCMP_GCB_CMxMASK_MASK_SHF 16 | ||
83 | #define GCMP_GCB_CMxMASK_MASK_MSK GCMPGCBMSK(CMxMASK_MASK, 16) | ||
84 | #define GCMP_GCB_CMxMASK_CMREGTGT_SHF 0 | ||
85 | #define GCMP_GCB_CMxMASK_CMREGTGT_MSK GCMPGCBMSK(CMxMASK_CMREGTGT, 2) | ||
86 | #define GCMP_GCB_CMxMASK_CMREGTGT_MEM 0 | ||
87 | #define GCMP_GCB_CMxMASK_CMREGTGT_MEM1 1 | ||
88 | #define GCMP_GCB_CMxMASK_CMREGTGT_IOCU1 2 | ||
89 | #define GCMP_GCB_CMxMASK_CMREGTGT_IOCU2 3 | ||
90 | |||
91 | |||
92 | /* Core local/Core other control block registers */ | ||
93 | #define GCMP_CCB_RESETR_OFS 0x0000 /* Reset Release */ | ||
94 | #define GCMP_CCB_RESETR_INRESET_SHF 0 | ||
95 | #define GCMP_CCB_RESETR_INRESET_MSK GCMPCCBMSK(RESETR_INRESET, 16) | ||
96 | #define GCMP_CCB_COHCTL_OFS 0x0008 /* Coherence Control */ | ||
97 | #define GCMP_CCB_COHCTL_DOMAIN_SHF 0 | ||
98 | #define GCMP_CCB_COHCTL_DOMAIN_MSK GCMPCCBMSK(COHCTL_DOMAIN, 8) | ||
99 | #define GCMP_CCB_CFG_OFS 0x0010 /* Config */ | ||
100 | #define GCMP_CCB_CFG_IOCUTYPE_SHF 10 | ||
101 | #define GCMP_CCB_CFG_IOCUTYPE_MSK GCMPCCBMSK(CFG_IOCUTYPE, 2) | ||
102 | #define GCMP_CCB_CFG_IOCUTYPE_CPU 0 | ||
103 | #define GCMP_CCB_CFG_IOCUTYPE_NCIOCU 1 | ||
104 | #define GCMP_CCB_CFG_IOCUTYPE_CIOCU 2 | ||
105 | #define GCMP_CCB_CFG_NUMVPE_SHF 0 | ||
106 | #define GCMP_CCB_CFG_NUMVPE_MSK GCMPCCBMSK(CFG_NUMVPE, 10) | ||
107 | #define GCMP_CCB_OTHER_OFS 0x0018 /* Other Address */ | ||
108 | #define GCMP_CCB_OTHER_CORENUM_SHF 16 | ||
109 | #define GCMP_CCB_OTHER_CORENUM_MSK GCMPCCBMSK(OTHER_CORENUM, 16) | ||
110 | #define GCMP_CCB_RESETBASE_OFS 0x0020 /* Reset Exception Base */ | ||
111 | #define GCMP_CCB_RESETBASE_BEV_SHF 12 | ||
112 | #define GCMP_CCB_RESETBASE_BEV_MSK GCMPCCBMSK(RESETBASE_BEV, 20) | ||
113 | #define GCMP_CCB_ID_OFS 0x0028 /* Identification */ | ||
114 | #define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ | ||
115 | #define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ | ||
116 | |||
117 | #endif /* _ASM_GCMPREGS_H */ | ||
diff --git a/include/asm-mips/gic.h b/include/asm-mips/gic.h new file mode 100644 index 000000000000..01b2f92dc33d --- /dev/null +++ b/include/asm-mips/gic.h | |||
@@ -0,0 +1,487 @@ | |||
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) 2000, 07 MIPS Technologies, Inc. | ||
7 | * | ||
8 | * GIC Register Definitions | ||
9 | * | ||
10 | */ | ||
11 | #ifndef _ASM_GICREGS_H | ||
12 | #define _ASM_GICREGS_H | ||
13 | |||
14 | #undef GICISBYTELITTLEENDIAN | ||
15 | #define GICISWORDLITTLEENDIAN | ||
16 | |||
17 | /* Constants */ | ||
18 | #define GIC_POL_POS 1 | ||
19 | #define GIC_POL_NEG 0 | ||
20 | #define GIC_TRIG_EDGE 1 | ||
21 | #define GIC_TRIG_LEVEL 0 | ||
22 | |||
23 | #define GIC_NUM_INTRS 32 | ||
24 | |||
25 | #define MSK(n) ((1 << (n)) - 1) | ||
26 | #define REG32(addr) (*(volatile unsigned int *) (addr)) | ||
27 | #define REG(base, offs) REG32((unsigned int)(base) + offs##_##OFS) | ||
28 | #define REGP(base, phys) REG32((unsigned int)(base) + (phys)) | ||
29 | |||
30 | /* Accessors */ | ||
31 | #define GIC_REG(segment, offset) \ | ||
32 | REG32(_gic_base + segment##_##SECTION_OFS + offset##_##OFS) | ||
33 | #define GIC_REG_ADDR(segment, offset) \ | ||
34 | REG32(_gic_base + segment##_##SECTION_OFS + offset) | ||
35 | |||
36 | #define GIC_ABS_REG(segment, offset) \ | ||
37 | (_gic_base + segment##_##SECTION_OFS + offset##_##OFS) | ||
38 | #define GIC_REG_ABS_ADDR(segment, offset) \ | ||
39 | (_gic_base + segment##_##SECTION_OFS + offset) | ||
40 | |||
41 | #ifdef GICISBYTELITTLEENDIAN | ||
42 | #define GICREAD(reg, data) (data) = (reg), (data) = le32_to_cpu(data) | ||
43 | #define GICWRITE(reg, data) (reg) = cpu_to_le32(data) | ||
44 | #define GICBIS(reg, bits) \ | ||
45 | ({unsigned int data; \ | ||
46 | GICREAD(reg, data); \ | ||
47 | data |= bits; \ | ||
48 | GICWRITE(reg, data); \ | ||
49 | }) | ||
50 | |||
51 | #else | ||
52 | #define GICREAD(reg, data) (data) = (reg) | ||
53 | #define GICWRITE(reg, data) (reg) = (data) | ||
54 | #define GICBIS(reg, bits) (reg) |= (bits) | ||
55 | #endif | ||
56 | |||
57 | |||
58 | /* GIC Address Space */ | ||
59 | #define SHARED_SECTION_OFS 0x0000 | ||
60 | #define SHARED_SECTION_SIZE 0x8000 | ||
61 | #define VPE_LOCAL_SECTION_OFS 0x8000 | ||
62 | #define VPE_LOCAL_SECTION_SIZE 0x4000 | ||
63 | #define VPE_OTHER_SECTION_OFS 0xc000 | ||
64 | #define VPE_OTHER_SECTION_SIZE 0x4000 | ||
65 | #define USM_VISIBLE_SECTION_OFS 0x10000 | ||
66 | #define USM_VISIBLE_SECTION_SIZE 0x10000 | ||
67 | |||
68 | /* Register Map for Shared Section */ | ||
69 | #if defined(CONFIG_CPU_LITTLE_ENDIAN) || defined(GICISWORDLITTLEENDIAN) | ||
70 | |||
71 | #define GIC_SH_CONFIG_OFS 0x0000 | ||
72 | |||
73 | /* Shared Global Counter */ | ||
74 | #define GIC_SH_COUNTER_31_00_OFS 0x0010 | ||
75 | #define GIC_SH_COUNTER_63_32_OFS 0x0014 | ||
76 | |||
77 | /* Interrupt Polarity */ | ||
78 | #define GIC_SH_POL_31_0_OFS 0x0100 | ||
79 | #define GIC_SH_POL_63_32_OFS 0x0104 | ||
80 | #define GIC_SH_POL_95_64_OFS 0x0108 | ||
81 | #define GIC_SH_POL_127_96_OFS 0x010c | ||
82 | #define GIC_SH_POL_159_128_OFS 0x0110 | ||
83 | #define GIC_SH_POL_191_160_OFS 0x0114 | ||
84 | #define GIC_SH_POL_223_192_OFS 0x0118 | ||
85 | #define GIC_SH_POL_255_224_OFS 0x011c | ||
86 | |||
87 | /* Edge/Level Triggering */ | ||
88 | #define GIC_SH_TRIG_31_0_OFS 0x0180 | ||
89 | #define GIC_SH_TRIG_63_32_OFS 0x0184 | ||
90 | #define GIC_SH_TRIG_95_64_OFS 0x0188 | ||
91 | #define GIC_SH_TRIG_127_96_OFS 0x018c | ||
92 | #define GIC_SH_TRIG_159_128_OFS 0x0190 | ||
93 | #define GIC_SH_TRIG_191_160_OFS 0x0194 | ||
94 | #define GIC_SH_TRIG_223_192_OFS 0x0198 | ||
95 | #define GIC_SH_TRIG_255_224_OFS 0x019c | ||
96 | |||
97 | /* Dual Edge Triggering */ | ||
98 | #define GIC_SH_DUAL_31_0_OFS 0x0200 | ||
99 | #define GIC_SH_DUAL_63_32_OFS 0x0204 | ||
100 | #define GIC_SH_DUAL_95_64_OFS 0x0208 | ||
101 | #define GIC_SH_DUAL_127_96_OFS 0x020c | ||
102 | #define GIC_SH_DUAL_159_128_OFS 0x0210 | ||
103 | #define GIC_SH_DUAL_191_160_OFS 0x0214 | ||
104 | #define GIC_SH_DUAL_223_192_OFS 0x0218 | ||
105 | #define GIC_SH_DUAL_255_224_OFS 0x021c | ||
106 | |||
107 | /* Set/Clear corresponding bit in Edge Detect Register */ | ||
108 | #define GIC_SH_WEDGE_OFS 0x0280 | ||
109 | |||
110 | /* Reset Mask - Disables Interrupt */ | ||
111 | #define GIC_SH_RMASK_31_0_OFS 0x0300 | ||
112 | #define GIC_SH_RMASK_63_32_OFS 0x0304 | ||
113 | #define GIC_SH_RMASK_95_64_OFS 0x0308 | ||
114 | #define GIC_SH_RMASK_127_96_OFS 0x030c | ||
115 | #define GIC_SH_RMASK_159_128_OFS 0x0310 | ||
116 | #define GIC_SH_RMASK_191_160_OFS 0x0314 | ||
117 | #define GIC_SH_RMASK_223_192_OFS 0x0318 | ||
118 | #define GIC_SH_RMASK_255_224_OFS 0x031c | ||
119 | |||
120 | /* Set Mask (WO) - Enables Interrupt */ | ||
121 | #define GIC_SH_SMASK_31_0_OFS 0x0380 | ||
122 | #define GIC_SH_SMASK_63_32_OFS 0x0384 | ||
123 | #define GIC_SH_SMASK_95_64_OFS 0x0388 | ||
124 | #define GIC_SH_SMASK_127_96_OFS 0x038c | ||
125 | #define GIC_SH_SMASK_159_128_OFS 0x0390 | ||
126 | #define GIC_SH_SMASK_191_160_OFS 0x0394 | ||
127 | #define GIC_SH_SMASK_223_192_OFS 0x0398 | ||
128 | #define GIC_SH_SMASK_255_224_OFS 0x039c | ||
129 | |||
130 | /* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */ | ||
131 | #define GIC_SH_MASK_31_0_OFS 0x0400 | ||
132 | #define GIC_SH_MASK_63_32_OFS 0x0404 | ||
133 | #define GIC_SH_MASK_95_64_OFS 0x0408 | ||
134 | #define GIC_SH_MASK_127_96_OFS 0x040c | ||
135 | #define GIC_SH_MASK_159_128_OFS 0x0410 | ||
136 | #define GIC_SH_MASK_191_160_OFS 0x0414 | ||
137 | #define GIC_SH_MASK_223_192_OFS 0x0418 | ||
138 | #define GIC_SH_MASK_255_224_OFS 0x041c | ||
139 | |||
140 | /* Pending Global Interrupts (RO) */ | ||
141 | #define GIC_SH_PEND_31_0_OFS 0x0480 | ||
142 | #define GIC_SH_PEND_63_32_OFS 0x0484 | ||
143 | #define GIC_SH_PEND_95_64_OFS 0x0488 | ||
144 | #define GIC_SH_PEND_127_96_OFS 0x048c | ||
145 | #define GIC_SH_PEND_159_128_OFS 0x0490 | ||
146 | #define GIC_SH_PEND_191_160_OFS 0x0494 | ||
147 | #define GIC_SH_PEND_223_192_OFS 0x0498 | ||
148 | #define GIC_SH_PEND_255_224_OFS 0x049c | ||
149 | |||
150 | #define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500 | ||
151 | |||
152 | /* Maps Interrupt X to a Pin */ | ||
153 | #define GIC_SH_MAP_TO_PIN(intr) \ | ||
154 | (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr)) | ||
155 | |||
156 | #define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2000 | ||
157 | |||
158 | /* Maps Interrupt X to a VPE */ | ||
159 | #define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \ | ||
160 | (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4)) | ||
161 | #define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) | ||
162 | |||
163 | /* Polarity : Reset Value is always 0 */ | ||
164 | #define GIC_SH_SET_POLARITY_OFS 0x0100 | ||
165 | #define GIC_SET_POLARITY(intr, pol) \ | ||
166 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + (((intr) / 32) * 4)), (pol) << ((intr) % 32)) | ||
167 | |||
168 | /* Triggering : Reset Value is always 0 */ | ||
169 | #define GIC_SH_SET_TRIGGER_OFS 0x0180 | ||
170 | #define GIC_SET_TRIGGER(intr, trig) \ | ||
171 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + (((intr) / 32) * 4)), (trig) << ((intr) % 32)) | ||
172 | |||
173 | /* Mask manipulation */ | ||
174 | #define GIC_SH_SMASK_OFS 0x0380 | ||
175 | #define GIC_SET_INTR_MASK(intr, val) \ | ||
176 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) | ||
177 | |||
178 | #define GIC_SH_RMASK_OFS 0x0300 | ||
179 | #define GIC_CLR_INTR_MASK(intr, val) \ | ||
180 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) | ||
181 | |||
182 | /* Register Map for Local Section */ | ||
183 | #define GIC_VPE_CTL_OFS 0x0000 | ||
184 | #define GIC_VPE_PEND_OFS 0x0004 | ||
185 | #define GIC_VPE_MASK_OFS 0x0008 | ||
186 | #define GIC_VPE_RMASK_OFS 0x000c | ||
187 | #define GIC_VPE_SMASK_OFS 0x0010 | ||
188 | #define GIC_VPE_WD_MAP_OFS 0x0040 | ||
189 | #define GIC_VPE_COMPARE_MAP_OFS 0x0044 | ||
190 | #define GIC_VPE_TIMER_MAP_OFS 0x0048 | ||
191 | #define GIC_VPE_PERFCTR_MAP_OFS 0x0050 | ||
192 | #define GIC_VPE_SWINT0_MAP_OFS 0x0054 | ||
193 | #define GIC_VPE_SWINT1_MAP_OFS 0x0058 | ||
194 | #define GIC_VPE_OTHER_ADDR_OFS 0x0080 | ||
195 | #define GIC_VPE_WD_CONFIG0_OFS 0x0090 | ||
196 | #define GIC_VPE_WD_COUNT0_OFS 0x0094 | ||
197 | #define GIC_VPE_WD_INITIAL0_OFS 0x0098 | ||
198 | #define GIC_VPE_COMPARE_LO_OFS 0x00a0 | ||
199 | #define GIC_VPE_COMPARE_HI 0x00a4 | ||
200 | |||
201 | #define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100 | ||
202 | #define GIC_VPE_EIC_SS(intr) \ | ||
203 | (GIC_EIC_SHADOW_SET_BASE + (4 * intr)) | ||
204 | |||
205 | #define GIC_VPE_EIC_VEC_BASE 0x0800 | ||
206 | #define GIC_VPE_EIC_VEC(intr) \ | ||
207 | (GIC_VPE_EIC_VEC_BASE + (4 * intr)) | ||
208 | |||
209 | #define GIC_VPE_TENABLE_NMI_OFS 0x1000 | ||
210 | #define GIC_VPE_TENABLE_YQ_OFS 0x1004 | ||
211 | #define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080 | ||
212 | #define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084 | ||
213 | |||
214 | /* User Mode Visible Section Register Map */ | ||
215 | #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000 | ||
216 | #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004 | ||
217 | |||
218 | #else /* CONFIG_CPU_BIG_ENDIAN */ | ||
219 | |||
220 | #define GIC_SH_CONFIG_OFS 0x0000 | ||
221 | |||
222 | /* Shared Global Counter */ | ||
223 | #define GIC_SH_COUNTER_31_00_OFS 0x0014 | ||
224 | #define GIC_SH_COUNTER_63_32_OFS 0x0010 | ||
225 | |||
226 | /* Interrupt Polarity */ | ||
227 | #define GIC_SH_POL_31_0_OFS 0x0104 | ||
228 | #define GIC_SH_POL_63_32_OFS 0x0100 | ||
229 | #define GIC_SH_POL_95_64_OFS 0x010c | ||
230 | #define GIC_SH_POL_127_96_OFS 0x0108 | ||
231 | #define GIC_SH_POL_159_128_OFS 0x0114 | ||
232 | #define GIC_SH_POL_191_160_OFS 0x0110 | ||
233 | #define GIC_SH_POL_223_192_OFS 0x011c | ||
234 | #define GIC_SH_POL_255_224_OFS 0x0118 | ||
235 | |||
236 | /* Edge/Level Triggering */ | ||
237 | #define GIC_SH_TRIG_31_0_OFS 0x0184 | ||
238 | #define GIC_SH_TRIG_63_32_OFS 0x0180 | ||
239 | #define GIC_SH_TRIG_95_64_OFS 0x018c | ||
240 | #define GIC_SH_TRIG_127_96_OFS 0x0188 | ||
241 | #define GIC_SH_TRIG_159_128_OFS 0x0194 | ||
242 | #define GIC_SH_TRIG_191_160_OFS 0x0190 | ||
243 | #define GIC_SH_TRIG_223_192_OFS 0x019c | ||
244 | #define GIC_SH_TRIG_255_224_OFS 0x0198 | ||
245 | |||
246 | /* Dual Edge Triggering */ | ||
247 | #define GIC_SH_DUAL_31_0_OFS 0x0204 | ||
248 | #define GIC_SH_DUAL_63_32_OFS 0x0200 | ||
249 | #define GIC_SH_DUAL_95_64_OFS 0x020c | ||
250 | #define GIC_SH_DUAL_127_96_OFS 0x0208 | ||
251 | #define GIC_SH_DUAL_159_128_OFS 0x0214 | ||
252 | #define GIC_SH_DUAL_191_160_OFS 0x0210 | ||
253 | #define GIC_SH_DUAL_223_192_OFS 0x021c | ||
254 | #define GIC_SH_DUAL_255_224_OFS 0x0218 | ||
255 | |||
256 | /* Set/Clear corresponding bit in Edge Detect Register */ | ||
257 | #define GIC_SH_WEDGE_OFS 0x0280 | ||
258 | |||
259 | /* Reset Mask - Disables Interrupt */ | ||
260 | #define GIC_SH_RMASK_31_0_OFS 0x0304 | ||
261 | #define GIC_SH_RMASK_63_32_OFS 0x0300 | ||
262 | #define GIC_SH_RMASK_95_64_OFS 0x030c | ||
263 | #define GIC_SH_RMASK_127_96_OFS 0x0308 | ||
264 | #define GIC_SH_RMASK_159_128_OFS 0x0314 | ||
265 | #define GIC_SH_RMASK_191_160_OFS 0x0310 | ||
266 | #define GIC_SH_RMASK_223_192_OFS 0x031c | ||
267 | #define GIC_SH_RMASK_255_224_OFS 0x0318 | ||
268 | |||
269 | /* Set Mask (WO) - Enables Interrupt */ | ||
270 | #define GIC_SH_SMASK_31_0_OFS 0x0384 | ||
271 | #define GIC_SH_SMASK_63_32_OFS 0x0380 | ||
272 | #define GIC_SH_SMASK_95_64_OFS 0x038c | ||
273 | #define GIC_SH_SMASK_127_96_OFS 0x0388 | ||
274 | #define GIC_SH_SMASK_159_128_OFS 0x0394 | ||
275 | #define GIC_SH_SMASK_191_160_OFS 0x0390 | ||
276 | #define GIC_SH_SMASK_223_192_OFS 0x039c | ||
277 | #define GIC_SH_SMASK_255_224_OFS 0x0398 | ||
278 | |||
279 | /* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */ | ||
280 | #define GIC_SH_MASK_31_0_OFS 0x0404 | ||
281 | #define GIC_SH_MASK_63_32_OFS 0x0400 | ||
282 | #define GIC_SH_MASK_95_64_OFS 0x040c | ||
283 | #define GIC_SH_MASK_127_96_OFS 0x0408 | ||
284 | #define GIC_SH_MASK_159_128_OFS 0x0414 | ||
285 | #define GIC_SH_MASK_191_160_OFS 0x0410 | ||
286 | #define GIC_SH_MASK_223_192_OFS 0x041c | ||
287 | #define GIC_SH_MASK_255_224_OFS 0x0418 | ||
288 | |||
289 | /* Pending Global Interrupts (RO) */ | ||
290 | #define GIC_SH_PEND_31_0_OFS 0x0484 | ||
291 | #define GIC_SH_PEND_63_32_OFS 0x0480 | ||
292 | #define GIC_SH_PEND_95_64_OFS 0x048c | ||
293 | #define GIC_SH_PEND_127_96_OFS 0x0488 | ||
294 | #define GIC_SH_PEND_159_128_OFS 0x0494 | ||
295 | #define GIC_SH_PEND_191_160_OFS 0x0490 | ||
296 | #define GIC_SH_PEND_223_192_OFS 0x049c | ||
297 | #define GIC_SH_PEND_255_224_OFS 0x0498 | ||
298 | |||
299 | #define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500 | ||
300 | |||
301 | /* Maps Interrupt X to a Pin */ | ||
302 | #define GIC_SH_MAP_TO_PIN(intr) \ | ||
303 | (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr)) | ||
304 | |||
305 | #define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2004 | ||
306 | |||
307 | /* | ||
308 | * Maps Interrupt X to a VPE. This is more complex than the LE case, as | ||
309 | * odd and even registers need to be transposed. It does work - trust me! | ||
310 | */ | ||
311 | #define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \ | ||
312 | (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + \ | ||
313 | (((((vpe) / 32) ^ 1) - 1) * 4)) | ||
314 | #define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) | ||
315 | |||
316 | /* Polarity */ | ||
317 | #define GIC_SH_SET_POLARITY_OFS 0x0100 | ||
318 | #define GIC_SET_POLARITY(intr, pol) \ | ||
319 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (pol) << ((intr) % 32)) | ||
320 | |||
321 | /* Triggering */ | ||
322 | #define GIC_SH_SET_TRIGGER_OFS 0x0180 | ||
323 | #define GIC_SET_TRIGGER(intr, trig) \ | ||
324 | GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (trig) << ((intr) % 32)) | ||
325 | |||
326 | /* Mask manipulation */ | ||
327 | #define GIC_SH_SMASK_OFS 0x0380 | ||
328 | #define GIC_SET_INTR_MASK(intr, val) \ | ||
329 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32))) | ||
330 | |||
331 | #define GIC_SH_RMASK_OFS 0x0300 | ||
332 | #define GIC_CLR_INTR_MASK(intr, val) \ | ||
333 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)) | ||
334 | |||
335 | /* Register Map for Local Section */ | ||
336 | #define GIC_VPE_CTL_OFS 0x0000 | ||
337 | #define GIC_VPE_PEND_OFS 0x0004 | ||
338 | #define GIC_VPE_MASK_OFS 0x0008 | ||
339 | #define GIC_VPE_RMASK_OFS 0x000c | ||
340 | #define GIC_VPE_SMASK_OFS 0x0010 | ||
341 | #define GIC_VPE_WD_MAP_OFS 0x0040 | ||
342 | #define GIC_VPE_COMPARE_MAP_OFS 0x0044 | ||
343 | #define GIC_VPE_TIMER_MAP_OFS 0x0048 | ||
344 | #define GIC_VPE_PERFCTR_MAP_OFS 0x0050 | ||
345 | #define GIC_VPE_SWINT0_MAP_OFS 0x0054 | ||
346 | #define GIC_VPE_SWINT1_MAP_OFS 0x0058 | ||
347 | #define GIC_VPE_OTHER_ADDR_OFS 0x0080 | ||
348 | #define GIC_VPE_WD_CONFIG0_OFS 0x0090 | ||
349 | #define GIC_VPE_WD_COUNT0_OFS 0x0094 | ||
350 | #define GIC_VPE_WD_INITIAL0_OFS 0x0098 | ||
351 | #define GIC_VPE_COMPARE_LO_OFS 0x00a4 | ||
352 | #define GIC_VPE_COMPARE_HI_OFS 0x00a0 | ||
353 | |||
354 | #define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100 | ||
355 | #define GIC_VPE_EIC_SS(intr) \ | ||
356 | (GIC_EIC_SHADOW_SET_BASE + (4 * intr)) | ||
357 | |||
358 | #define GIC_VPE_EIC_VEC_BASE 0x0800 | ||
359 | #define GIC_VPE_EIC_VEC(intr) \ | ||
360 | (GIC_VPE_EIC_VEC_BASE + (4 * intr)) | ||
361 | |||
362 | #define GIC_VPE_TENABLE_NMI_OFS 0x1000 | ||
363 | #define GIC_VPE_TENABLE_YQ_OFS 0x1004 | ||
364 | #define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080 | ||
365 | #define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084 | ||
366 | |||
367 | /* User Mode Visible Section Register Map */ | ||
368 | #define GIC_UMV_SH_COUNTER_31_00_OFS 0x0004 | ||
369 | #define GIC_UMV_SH_COUNTER_63_32_OFS 0x0000 | ||
370 | |||
371 | #endif /* !LE */ | ||
372 | |||
373 | /* Masks */ | ||
374 | #define GIC_SH_CONFIG_COUNTSTOP_SHF 28 | ||
375 | #define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF) | ||
376 | |||
377 | #define GIC_SH_CONFIG_COUNTBITS_SHF 24 | ||
378 | #define GIC_SH_CONFIG_COUNTBITS_MSK (MSK(4) << GIC_SH_CONFIG_COUNTBITS_SHF) | ||
379 | |||
380 | #define GIC_SH_CONFIG_NUMINTRS_SHF 16 | ||
381 | #define GIC_SH_CONFIG_NUMINTRS_MSK (MSK(8) << GIC_SH_CONFIG_NUMINTRS_SHF) | ||
382 | |||
383 | #define GIC_SH_CONFIG_NUMVPES_SHF 0 | ||
384 | #define GIC_SH_CONFIG_NUMVPES_MSK (MSK(8) << GIC_SH_CONFIG_NUMVPES_SHF) | ||
385 | |||
386 | #define GIC_SH_WEDGE_SET(intr) (intr | (0x1 << 31)) | ||
387 | #define GIC_SH_WEDGE_CLR(intr) (intr & ~(0x1 << 31)) | ||
388 | |||
389 | #define GIC_MAP_TO_PIN_SHF 31 | ||
390 | #define GIC_MAP_TO_PIN_MSK (MSK(1) << GIC_MAP_TO_PIN_SHF) | ||
391 | #define GIC_MAP_TO_NMI_SHF 30 | ||
392 | #define GIC_MAP_TO_NMI_MSK (MSK(1) << GIC_MAP_TO_NMI_SHF) | ||
393 | #define GIC_MAP_TO_YQ_SHF 29 | ||
394 | #define GIC_MAP_TO_YQ_MSK (MSK(1) << GIC_MAP_TO_YQ_SHF) | ||
395 | #define GIC_MAP_SHF 0 | ||
396 | #define GIC_MAP_MSK (MSK(6) << GIC_MAP_SHF) | ||
397 | |||
398 | /* GIC_VPE_CTL Masks */ | ||
399 | #define GIC_VPE_CTL_PERFCNT_RTBL_SHF 2 | ||
400 | #define GIC_VPE_CTL_PERFCNT_RTBL_MSK (MSK(1) << GIC_VPE_CTL_PERFCNT_RTBL_SHF) | ||
401 | #define GIC_VPE_CTL_TIMER_RTBL_SHF 1 | ||
402 | #define GIC_VPE_CTL_TIMER_RTBL_MSK (MSK(1) << GIC_VPE_CTL_TIMER_RTBL_SHF) | ||
403 | #define GIC_VPE_CTL_EIC_MODE_SHF 0 | ||
404 | #define GIC_VPE_CTL_EIC_MODE_MSK (MSK(1) << GIC_VPE_CTL_EIC_MODE_SHF) | ||
405 | |||
406 | /* GIC_VPE_PEND Masks */ | ||
407 | #define GIC_VPE_PEND_WD_SHF 0 | ||
408 | #define GIC_VPE_PEND_WD_MSK (MSK(1) << GIC_VPE_PEND_WD_SHF) | ||
409 | #define GIC_VPE_PEND_CMP_SHF 1 | ||
410 | #define GIC_VPE_PEND_CMP_MSK (MSK(1) << GIC_VPE_PEND_CMP_SHF) | ||
411 | #define GIC_VPE_PEND_TIMER_SHF 2 | ||
412 | #define GIC_VPE_PEND_TIMER_MSK (MSK(1) << GIC_VPE_PEND_TIMER_SHF) | ||
413 | #define GIC_VPE_PEND_PERFCOUNT_SHF 3 | ||
414 | #define GIC_VPE_PEND_PERFCOUNT_MSK (MSK(1) << GIC_VPE_PEND_PERFCOUNT_SHF) | ||
415 | #define GIC_VPE_PEND_SWINT0_SHF 4 | ||
416 | #define GIC_VPE_PEND_SWINT0_MSK (MSK(1) << GIC_VPE_PEND_SWINT0_SHF) | ||
417 | #define GIC_VPE_PEND_SWINT1_SHF 5 | ||
418 | #define GIC_VPE_PEND_SWINT1_MSK (MSK(1) << GIC_VPE_PEND_SWINT1_SHF) | ||
419 | |||
420 | /* GIC_VPE_RMASK Masks */ | ||
421 | #define GIC_VPE_RMASK_WD_SHF 0 | ||
422 | #define GIC_VPE_RMASK_WD_MSK (MSK(1) << GIC_VPE_RMASK_WD_SHF) | ||
423 | #define GIC_VPE_RMASK_CMP_SHF 1 | ||
424 | #define GIC_VPE_RMASK_CMP_MSK (MSK(1) << GIC_VPE_RMASK_CMP_SHF) | ||
425 | #define GIC_VPE_RMASK_TIMER_SHF 2 | ||
426 | #define GIC_VPE_RMASK_TIMER_MSK (MSK(1) << GIC_VPE_RMASK_TIMER_SHF) | ||
427 | #define GIC_VPE_RMASK_PERFCNT_SHF 3 | ||
428 | #define GIC_VPE_RMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_RMASK_PERFCNT_SHF) | ||
429 | #define GIC_VPE_RMASK_SWINT0_SHF 4 | ||
430 | #define GIC_VPE_RMASK_SWINT0_MSK (MSK(1) << GIC_VPE_RMASK_SWINT0_SHF) | ||
431 | #define GIC_VPE_RMASK_SWINT1_SHF 5 | ||
432 | #define GIC_VPE_RMASK_SWINT1_MSK (MSK(1) << GIC_VPE_RMASK_SWINT1_SHF) | ||
433 | |||
434 | /* GIC_VPE_SMASK Masks */ | ||
435 | #define GIC_VPE_SMASK_WD_SHF 0 | ||
436 | #define GIC_VPE_SMASK_WD_MSK (MSK(1) << GIC_VPE_SMASK_WD_SHF) | ||
437 | #define GIC_VPE_SMASK_CMP_SHF 1 | ||
438 | #define GIC_VPE_SMASK_CMP_MSK (MSK(1) << GIC_VPE_SMASK_CMP_SHF) | ||
439 | #define GIC_VPE_SMASK_TIMER_SHF 2 | ||
440 | #define GIC_VPE_SMASK_TIMER_MSK (MSK(1) << GIC_VPE_SMASK_TIMER_SHF) | ||
441 | #define GIC_VPE_SMASK_PERFCNT_SHF 3 | ||
442 | #define GIC_VPE_SMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_SMASK_PERFCNT_SHF) | ||
443 | #define GIC_VPE_SMASK_SWINT0_SHF 4 | ||
444 | #define GIC_VPE_SMASK_SWINT0_MSK (MSK(1) << GIC_VPE_SMASK_SWINT0_SHF) | ||
445 | #define GIC_VPE_SMASK_SWINT1_SHF 5 | ||
446 | #define GIC_VPE_SMASK_SWINT1_MSK (MSK(1) << GIC_VPE_SMASK_SWINT1_SHF) | ||
447 | |||
448 | /* | ||
449 | * Set the Mapping of Interrupt X to a VPE. | ||
450 | */ | ||
451 | #define GIC_SH_MAP_TO_VPE_SMASK(intr, vpe) \ | ||
452 | GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe)), \ | ||
453 | GIC_SH_MAP_TO_VPE_REG_BIT(vpe)) | ||
454 | |||
455 | struct gic_pcpu_mask { | ||
456 | DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS); | ||
457 | }; | ||
458 | |||
459 | struct gic_pending_regs { | ||
460 | DECLARE_BITMAP(pending, GIC_NUM_INTRS); | ||
461 | }; | ||
462 | |||
463 | struct gic_intrmask_regs { | ||
464 | DECLARE_BITMAP(intrmask, GIC_NUM_INTRS); | ||
465 | }; | ||
466 | |||
467 | /* | ||
468 | * Interrupt Meta-data specification. The ipiflag helps | ||
469 | * in building ipi_map. | ||
470 | */ | ||
471 | struct gic_intr_map { | ||
472 | unsigned int intrnum; /* Ext Intr Num */ | ||
473 | unsigned int cpunum; /* Directed to this CPU */ | ||
474 | unsigned int pin; /* Directed to this Pin */ | ||
475 | unsigned int polarity; /* Polarity : +/- */ | ||
476 | unsigned int trigtype; /* Trigger : Edge/Levl */ | ||
477 | unsigned int ipiflag; /* Is used for IPI ? */ | ||
478 | }; | ||
479 | |||
480 | extern void gic_init(unsigned long gic_base_addr, | ||
481 | unsigned long gic_addrspace_size, struct gic_intr_map *intrmap, | ||
482 | unsigned int intrmap_size, unsigned int irqbase); | ||
483 | |||
484 | extern unsigned int gic_get_int(void); | ||
485 | extern void gic_send_ipi(unsigned int intr); | ||
486 | |||
487 | #endif /* _ASM_GICREGS_H */ | ||
diff --git a/include/asm-mips/mips-boards/launch.h b/include/asm-mips/mips-boards/launch.h new file mode 100644 index 000000000000..d8ae7f95a522 --- /dev/null +++ b/include/asm-mips/mips-boards/launch.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASSEMBLER_ | ||
6 | |||
7 | struct cpulaunch { | ||
8 | unsigned long pc; | ||
9 | unsigned long gp; | ||
10 | unsigned long sp; | ||
11 | unsigned long a0; | ||
12 | unsigned long _pad[3]; /* pad to cache line size to avoid thrashing */ | ||
13 | unsigned long flags; | ||
14 | }; | ||
15 | |||
16 | #else | ||
17 | |||
18 | #define LOG2CPULAUNCH 5 | ||
19 | #define LAUNCH_PC 0 | ||
20 | #define LAUNCH_GP 4 | ||
21 | #define LAUNCH_SP 8 | ||
22 | #define LAUNCH_A0 12 | ||
23 | #define LAUNCH_FLAGS 28 | ||
24 | |||
25 | #endif | ||
26 | |||
27 | #define LAUNCH_FREADY 1 | ||
28 | #define LAUNCH_FGO 2 | ||
29 | #define LAUNCH_FGONE 4 | ||
30 | |||
31 | #define CPULAUNCH 0x00000f00 | ||
32 | #define NCPULAUNCH 8 | ||
33 | |||
34 | /* Polling period in count cycles for secondary CPU's */ | ||
35 | #define LAUNCHPERIOD 10000 | ||
diff --git a/include/asm-mips/mips-boards/malta.h b/include/asm-mips/mips-boards/malta.h index 93bf4e51b8a4..c1891578fa65 100644 --- a/include/asm-mips/mips-boards/malta.h +++ b/include/asm-mips/mips-boards/malta.h | |||
@@ -52,6 +52,29 @@ static inline unsigned long get_msc_port_base(unsigned long reg) | |||
52 | } | 52 | } |
53 | 53 | ||
54 | /* | 54 | /* |
55 | * GCMP Specific definitions | ||
56 | */ | ||
57 | #define GCMP_BASE_ADDR 0x1fbf8000 | ||
58 | #define GCMP_ADDRSPACE_SZ (256 * 1024) | ||
59 | |||
60 | /* | ||
61 | * GIC Specific definitions | ||
62 | */ | ||
63 | #define GIC_BASE_ADDR 0x1bdc0000 | ||
64 | #define GIC_ADDRSPACE_SZ (128 * 1024) | ||
65 | |||
66 | /* | ||
67 | * MSC01 BIU Specific definitions | ||
68 | * FIXME : These should be elsewhere ? | ||
69 | */ | ||
70 | #define MSC01_BIU_REG_BASE 0x1bc80000 | ||
71 | #define MSC01_BIU_ADDRSPACE_SZ (256 * 1024) | ||
72 | #define MSC01_SC_CFG_OFS 0x0110 | ||
73 | #define MSC01_SC_CFG_GICPRES_MSK 0x00000004 | ||
74 | #define MSC01_SC_CFG_GICPRES_SHF 2 | ||
75 | #define MSC01_SC_CFG_GICENA_SHF 3 | ||
76 | |||
77 | /* | ||
55 | * Malta RTC-device indirect register access. | 78 | * Malta RTC-device indirect register access. |
56 | */ | 79 | */ |
57 | #define MALTA_RTC_ADR_REG 0x70 | 80 | #define MALTA_RTC_ADR_REG 0x70 |
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h index 7461318f1cd1..cea872fc6f5c 100644 --- a/include/asm-mips/mips-boards/maltaint.h +++ b/include/asm-mips/mips-boards/maltaint.h | |||
@@ -39,7 +39,9 @@ | |||
39 | #define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0 | 39 | #define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0 |
40 | #define MIPSCPU_INT_MB1 3 | 40 | #define MIPSCPU_INT_MB1 3 |
41 | #define MIPSCPU_INT_SMI MIPSCPU_INT_MB1 | 41 | #define MIPSCPU_INT_SMI MIPSCPU_INT_MB1 |
42 | #define MIPSCPU_INT_IPI0 MIPSCPU_INT_MB1 /* GIC IPI */ | ||
42 | #define MIPSCPU_INT_MB2 4 | 43 | #define MIPSCPU_INT_MB2 4 |
44 | #define MIPSCPU_INT_IPI1 MIPSCPU_INT_MB2 /* GIC IPI */ | ||
43 | #define MIPSCPU_INT_MB3 5 | 45 | #define MIPSCPU_INT_MB3 5 |
44 | #define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3 | 46 | #define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3 |
45 | #define MIPSCPU_INT_MB4 6 | 47 | #define MIPSCPU_INT_MB4 6 |
@@ -76,6 +78,31 @@ | |||
76 | #define MSC01E_INT_PERFCTR 10 | 78 | #define MSC01E_INT_PERFCTR 10 |
77 | #define MSC01E_INT_CPUCTR 11 | 79 | #define MSC01E_INT_CPUCTR 11 |
78 | 80 | ||
81 | /* GIC's Nomenclature for Core Interrupt Pins on the Malta */ | ||
82 | #define GIC_CPU_INT0 0 /* Core Interrupt 2 */ | ||
83 | #define GIC_CPU_INT1 1 /* . */ | ||
84 | #define GIC_CPU_INT2 2 /* . */ | ||
85 | #define GIC_CPU_INT3 3 /* . */ | ||
86 | #define GIC_CPU_INT4 4 /* . */ | ||
87 | #define GIC_CPU_INT5 5 /* Core Interrupt 5 */ | ||
88 | |||
89 | #define GIC_EXT_INTR(x) x | ||
90 | |||
91 | /* Dummy data */ | ||
92 | #define X 0xdead | ||
93 | |||
94 | /* External Interrupts used for IPI */ | ||
95 | #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16 | ||
96 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17 | ||
97 | #define GIC_IPI_EXT_INTR_RESCHED_VPE1 18 | ||
98 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE1 19 | ||
99 | #define GIC_IPI_EXT_INTR_RESCHED_VPE2 20 | ||
100 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE2 21 | ||
101 | #define GIC_IPI_EXT_INTR_RESCHED_VPE3 22 | ||
102 | #define GIC_IPI_EXT_INTR_CALLFNC_VPE3 23 | ||
103 | |||
104 | #define MIPS_GIC_IRQ_BASE (MIPS_CPU_IRQ_BASE + 8) | ||
105 | |||
79 | #ifndef __ASSEMBLY__ | 106 | #ifndef __ASSEMBLY__ |
80 | extern void maltaint_init(void); | 107 | extern void maltaint_init(void); |
81 | #endif | 108 | #endif |
diff --git a/include/asm-mips/mips-boards/maltasmp.h b/include/asm-mips/mips-boards/maltasmp.h new file mode 100644 index 000000000000..8d7e955d506e --- /dev/null +++ b/include/asm-mips/mips-boards/maltasmp.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * There are several SMP models supported | ||
3 | * SMTC is mutually exclusive to other options (atm) | ||
4 | */ | ||
5 | #if defined(CONFIG_MIPS_MT_SMTC) | ||
6 | #define malta_smtc 1 | ||
7 | #define malta_cmp 0 | ||
8 | #define malta_smvp 0 | ||
9 | #else | ||
10 | #define malta_smtc 0 | ||
11 | #if defined(CONFIG_MIPS_CMP) | ||
12 | extern int gcmp_present; | ||
13 | #define malta_cmp gcmp_present | ||
14 | #else | ||
15 | #define malta_cmp 0 | ||
16 | #endif | ||
17 | /* FIXME: should become COMFIG_MIPS_MT_SMVP */ | ||
18 | #if defined(CONFIG_MIPS_MT_SMP) | ||
19 | #define malta_smvp 1 | ||
20 | #else | ||
21 | #define malta_smvp 0 | ||
22 | #endif | ||
23 | #endif | ||
24 | |||
25 | #include <asm/mipsregs.h> | ||
26 | #include <asm/mipsmtregs.h> | ||
27 | |||
28 | /* malta_smtc */ | ||
29 | #include <asm/smtc.h> | ||
30 | #include <asm/smtc_ipi.h> | ||
31 | |||
32 | /* malta_cmp */ | ||
33 | #include <asm/cmp.h> | ||
34 | |||
35 | /* malta_smvp */ | ||
36 | #include <asm/smvp.h> | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h index 5a2f8a3a6a1f..c9420aa97e32 100644 --- a/include/asm-mips/mipsmtregs.h +++ b/include/asm-mips/mipsmtregs.h | |||
@@ -197,8 +197,8 @@ static inline void __raw_evpe(void) | |||
197 | " .set pop \n"); | 197 | " .set pop \n"); |
198 | } | 198 | } |
199 | 199 | ||
200 | /* Enable multiMT if previous suggested it should be. | 200 | /* Enable virtual processor execution if previous suggested it should be. |
201 | EMT_ENABLE to force */ | 201 | EVPE_ENABLE to force */ |
202 | 202 | ||
203 | #define EVPE_ENABLE MVPCONTROL_EVP | 203 | #define EVPE_ENABLE MVPCONTROL_EVP |
204 | 204 | ||
@@ -238,8 +238,8 @@ static inline void __raw_emt(void) | |||
238 | " .set reorder"); | 238 | " .set reorder"); |
239 | } | 239 | } |
240 | 240 | ||
241 | /* enable multiVPE if previous suggested it should be. | 241 | /* enable multi-threaded execution if previous suggested it should be. |
242 | EVPE_ENABLE to force */ | 242 | EMT_ENABLE to force */ |
243 | 243 | ||
244 | #define EMT_ENABLE VPECONTROL_TE | 244 | #define EMT_ENABLE VPECONTROL_TE |
245 | 245 | ||
diff --git a/include/asm-mips/r4k-timer.h b/include/asm-mips/r4k-timer.h new file mode 100644 index 000000000000..a37d12b3b61c --- /dev/null +++ b/include/asm-mips/r4k-timer.h | |||
@@ -0,0 +1,30 @@ | |||
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) 2008 by Ralf Baechle (ralf@linux-mips.org) | ||
7 | */ | ||
8 | #ifndef __ASM_R4K_TYPES_H | ||
9 | #define __ASM_R4K_TYPES_H | ||
10 | |||
11 | #include <linux/compiler.h> | ||
12 | |||
13 | #ifdef CONFIG_SYNC_R4K | ||
14 | |||
15 | extern void synchronise_count_master(void); | ||
16 | extern void synchronise_count_slave(void); | ||
17 | |||
18 | #else | ||
19 | |||
20 | static inline void synchronise_count_master(void) | ||
21 | { | ||
22 | } | ||
23 | |||
24 | static inline void synchronise_count_slave(void) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif /* __ASM_R4K_TYPES_H */ | ||
diff --git a/include/asm-mips/smp-ops.h b/include/asm-mips/smp-ops.h index b17fdfb5d818..43c207e72a63 100644 --- a/include/asm-mips/smp-ops.h +++ b/include/asm-mips/smp-ops.h | |||
@@ -51,6 +51,7 @@ static inline void register_smp_ops(struct plat_smp_ops *ops) | |||
51 | #endif /* !CONFIG_SMP */ | 51 | #endif /* !CONFIG_SMP */ |
52 | 52 | ||
53 | extern struct plat_smp_ops up_smp_ops; | 53 | extern struct plat_smp_ops up_smp_ops; |
54 | extern struct plat_smp_ops cmp_smp_ops; | ||
54 | extern struct plat_smp_ops vsmp_smp_ops; | 55 | extern struct plat_smp_ops vsmp_smp_ops; |
55 | 56 | ||
56 | #endif /* __ASM_SMP_OPS_H */ | 57 | #endif /* __ASM_SMP_OPS_H */ |
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h index ff3e8936b493..3639b28f80db 100644 --- a/include/asm-mips/smtc.h +++ b/include/asm-mips/smtc.h | |||
@@ -44,6 +44,7 @@ extern int mipsmt_build_cpu_map(int startslot); | |||
44 | extern void mipsmt_prepare_cpus(void); | 44 | extern void mipsmt_prepare_cpus(void); |
45 | extern void smtc_smp_finish(void); | 45 | extern void smtc_smp_finish(void); |
46 | extern void smtc_boot_secondary(int cpu, struct task_struct *t); | 46 | extern void smtc_boot_secondary(int cpu, struct task_struct *t); |
47 | extern void smtc_cpus_done(void); | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * Sharing the TLB between multiple VPEs means that the | 50 | * Sharing the TLB between multiple VPEs means that the |
diff --git a/include/asm-mips/smvp.h b/include/asm-mips/smvp.h new file mode 100644 index 000000000000..0d0e80a39e8a --- /dev/null +++ b/include/asm-mips/smvp.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef _ASM_SMVP_H | ||
2 | #define _ASM_SMVP_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for SMVP multitasking on MIPS MT cores | ||
6 | */ | ||
7 | struct task_struct; | ||
8 | |||
9 | extern void smvp_smp_setup(void); | ||
10 | extern void smvp_smp_finish(void); | ||
11 | extern void smvp_boot_secondary(int cpu, struct task_struct *t); | ||
12 | extern void smvp_init_secondary(void); | ||
13 | extern void smvp_smp_finish(void); | ||
14 | extern void smvp_cpus_done(void); | ||
15 | extern void smvp_prepare_cpus(unsigned int max_cpus); | ||
16 | |||
17 | /* This is platform specific */ | ||
18 | extern void smvp_send_ipi(int cpu, unsigned int action); | ||
19 | #endif /* _ASM_SMVP_H */ | ||