author | hgs |
Fri, 09 Jul 2010 13:13:20 +0100 | |
changeset 199 | 189ece41fa29 |
parent 177 | a232af6b0b1f |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of the License "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// e32\include\nkernsmp\arm\ncern.h |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without notice. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
/** |
|
22 |
@file |
|
23 |
@publishedPartner |
|
24 |
@prototype |
|
25 |
*/ |
|
26 |
||
27 |
#ifndef __NCERN_H__ |
|
28 |
#define __NCERN_H__ |
|
29 |
||
30 |
#ifdef __FIQ_IS_UNCONTROLLED__ |
|
31 |
#define __ASM_CLI() CPSIDI /* Disable all interrupts */ |
|
32 |
#define __ASM_STI() CPSIEI /* Enable all interrupts */ |
|
33 |
#define __ASM_CLI1() CPSIDI /* Disable IRQ only */ |
|
34 |
#define __ASM_STI1() CPSIEI /* Enable IRQ only */ |
|
35 |
#define __ASM_CLI2() /* Disable FIQ only */ |
|
36 |
#define __ASM_STI2() /* Enable FIQ only */ |
|
37 |
||
38 |
#define __ASM_CLI_MODE(mode) CPSIDIM(mode) /* Disable all interrupts and change mode */ |
|
39 |
#define __ASM_STI_MODE(mode) CPSIEIM(mode) /* Enable all interrupts and change mode */ |
|
40 |
#define __ASM_CLI1_MODE(mode) CPSIDIM(mode) /* Disable IRQ only and change mode */ |
|
41 |
#define __ASM_STI1_MODE(mode) CPSIEIM(mode) /* Enable IRQ only and change mode */ |
|
42 |
#define __ASM_CLI2_MODE(mode) CPSCHM(mode) /* Disable FIQ only and change mode */ |
|
43 |
#define __ASM_STI2_MODE(mode) CPSCHM(mode) /* Enable FIQ only and change mode */ |
|
44 |
||
45 |
#else |
|
46 |
#define __ASM_CLI() CPSIDIF /* Disable all interrupts */ |
|
47 |
#define __ASM_STI() CPSIEIF /* Enable all interrupts */ |
|
48 |
#define __ASM_CLI1() CPSIDI /* Disable IRQ only */ |
|
49 |
#define __ASM_STI1() CPSIEI /* Enable IRQ only */ |
|
50 |
#define __ASM_CLI2() CPSIDF /* Disable FIQ only */ |
|
51 |
#define __ASM_STI2() CPSIEF /* Enable FIQ only */ |
|
52 |
||
53 |
#define __ASM_CLI_MODE(mode) CPSIDIFM(mode) /* Disable all interrupts and change mode */ |
|
54 |
#define __ASM_STI_MODE(mode) CPSIEIFM(mode) /* Enable all interrupts and change mode */ |
|
55 |
#define __ASM_CLI1_MODE(mode) CPSIDIM(mode) /* Disable IRQ only and change mode */ |
|
56 |
#define __ASM_STI1_MODE(mode) CPSIEIM(mode) /* Enable IRQ only and change mode */ |
|
57 |
#define __ASM_CLI2_MODE(mode) CPSIDFM(mode) /* Disable FIQ only and change mode */ |
|
58 |
#define __ASM_STI2_MODE(mode) CPSIEFM(mode) /* Enable FIQ only and change mode */ |
|
59 |
#endif |
|
60 |
||
61 |
/** Information needed to boot an AP (ARM specific) |
|
62 |
||
63 |
@internalTechnology |
|
64 |
*/ |
|
65 |
struct SArmAPBootInfo : public SAPBootInfo |
|
66 |
{ |
|
67 |
TLinAddr iAPBootLin; // linear address of AP boot page (uncached) |
|
68 |
T_UintPtr iAPBootPhys; // physical address of AP boot page (uncached) |
|
69 |
TLinAddr iAPBootCodeLin; // linear address of AP boot code (part of bootstrap) |
|
70 |
T_UintPtr iAPBootCodePhys; // physical address of AP boot code (part of bootstrap) |
|
71 |
T_UintPtr iAPBootPageDirPhys; // physical address of AP boot page directory |
|
72 |
TLinAddr iInitR13Fiq; // initial value for R13_fiq |
|
73 |
TLinAddr iInitR13Irq; // initial value for R13_irq |
|
74 |
TLinAddr iInitR13Abt; // initial value for R13_abt |
|
75 |
TLinAddr iInitR13Und; // initial value for R13_und |
|
76 |
}; |
|
77 |
||
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
typedef void (*TDetachComplete)(void); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
79 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
80 |
struct SPerCpuUncached |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
81 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
82 |
volatile TUint32 iDetachCount; // Number of times core has detached from SMP cluster |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
83 |
volatile TUint32 iAttachCount; // Number of times core has reattached to SMP cluster |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
84 |
volatile TBool iPowerOffReq; // TRUE if core needs to be powered off |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
85 |
volatile TBool iPowerOnReq; // TRUE if core needs to be powered on |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
TDetachComplete iDetachCompleteFn; // idle handler jumps to this to request power down if necessary |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
// after cleaning and disabling caches, detaching from SMP cluster |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
// and saving state required to bring the core back up again |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
volatile TUint32 iDetachCompleteCpus; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
90 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
union UPerCpuUncached |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
{ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
SPerCpuUncached iU; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
95 |
volatile TUint64 i__Dummy[8]; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
}; |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
97 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
__ASSERT_COMPILE(sizeof(SPerCpuUncached) <= 8*sizeof(TUint64)); |
0 | 99 |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
/** Function to power up a CPU |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
101 |
@publishedPartner |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
102 |
@prototype |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
103 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
104 |
typedef void (*TCpuPowerUpFn)(TInt aCpu, SPerCpuUncached* aU); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
|
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
106 |
/** Function to power down a CPU |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
107 |
@publishedPartner |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
108 |
@prototype |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
*/ |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
typedef void (*TCpuPowerDownFn)(TInt aCpu, SPerCpuUncached* aU); |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
111 |
|
177 | 112 |
/** Function to notify changes to system clock frequencies |
113 |
@publishedPartner |
|
114 |
@prototype |
|
115 |
*/ |
|
116 |
typedef TInt (*TFrequencyChangeFn)(); |
|
117 |
||
0 | 118 |
/** Variant interface block |
119 |
@internalTechnology |
|
120 |
@prototype |
|
121 |
*/ |
|
122 |
struct SVariantInterfaceBlock : public SInterfaceBlockBase |
|
123 |
{ |
|
124 |
TUint64 iMaxCpuClock; // maximum possible CPU clock frequency on this system |
|
125 |
TUint16 iTimerGap1; |
|
126 |
TUint16 iTimerGap2; |
|
127 |
TUint32 iMaxTimerClock; // maximum possible local timer clock frequency |
|
128 |
TLinAddr iScuAddr; // address of SCU |
|
129 |
TLinAddr iGicDistAddr; // address of GIC Distributor |
|
130 |
TLinAddr iGicCpuIfcAddr; // address of GIC CPU interface (must be same for all CPUs) |
|
131 |
TLinAddr iLocalTimerAddr; // address of per-CPU timer (must be same for all CPUs) |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
132 |
TLinAddr iGlobalTimerAddr; // address of global timer if it exists |
177 | 133 |
SRatio* iTimerFreqR[KMaxCpus]; // timer[i] frequency as a fraction of iMaxTimerClock |
134 |
SRatio* iCpuFreqR[KMaxCpus]; // CPU[i] frequency as a fraction of iMaxCpuClock |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
135 |
UPerCpuUncached* iUncached[KMaxCpus]; // Pointer to uncached memory for each CPU |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
136 |
TCpuPowerUpFn iCpuPowerUpFn; // function used to power up a retired CPU (NULL if core control not supported) |
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
137 |
TCpuPowerDownFn iCpuPowerDownFn; // function used to power down a CPU (NULL if power down done within idle handler itself) |
177 | 138 |
SRatio* iGTimerFreqR; // global timer frequency as a fraction of iMaxTimerClock |
139 |
TFrequencyChangeFn iFrqChgFn; // function to notify frequency changes |
|
0 | 140 |
}; |
141 |
||
142 |
// End of file |
|
143 |
#endif |