kernel/eka/include/nkernsmp/arm/ncern.h
branchRCL_3
changeset 256 c1f20ce4abcf
parent 0 a41df078684a
child 257 3e88ff8f41d5
equal deleted inserted replaced
249:a179b74831c9 256:c1f20ce4abcf
    73 	TLinAddr	iInitR13Irq;		// initial value for R13_irq
    73 	TLinAddr	iInitR13Irq;		// initial value for R13_irq
    74 	TLinAddr	iInitR13Abt;		// initial value for R13_abt
    74 	TLinAddr	iInitR13Abt;		// initial value for R13_abt
    75 	TLinAddr	iInitR13Und;		// initial value for R13_und
    75 	TLinAddr	iInitR13Und;		// initial value for R13_und
    76 	};
    76 	};
    77 
    77 
       
    78 typedef void (*TDetachComplete)(void);
    78 
    79 
    79 /** Timer frequency specification
    80 struct SPerCpuUncached
       
    81 	{
       
    82 	volatile TUint32	iDetachCount;		// Number of times core has detached from SMP cluster
       
    83 	volatile TUint32	iAttachCount;		// Number of times core has reattached to SMP cluster
       
    84 	volatile TBool		iPowerOffReq;		// TRUE if core needs to be powered off
       
    85 	volatile TBool		iPowerOnReq;		// TRUE if core needs to be powered on
       
    86 	TDetachComplete		iDetachCompleteFn;	// idle handler jumps to this to request power down if necessary
       
    87 											// after cleaning and disabling caches, detaching from SMP cluster
       
    88 											// and saving state required to bring the core back up again
       
    89 	volatile TUint32	iDetachCompleteCpus;
       
    90 	};
    80 
    91 
    81 Stores a frequency as a fraction of a (separately stored) maximum.
    92 union UPerCpuUncached
    82 The frequency must be at least 1/256 of the maximum.
    93 	{
       
    94 	SPerCpuUncached		iU;
       
    95 	volatile TUint64	i__Dummy[8];
       
    96 	};
    83 
    97 
    84 @internalTechnology
    98 __ASSERT_COMPILE(sizeof(SPerCpuUncached) <= 8*sizeof(TUint64));
       
    99 
       
   100 /** Function to power up a CPU
       
   101 @publishedPartner
    85 @prototype
   102 @prototype
    86 */
   103 */
    87 struct STimerMult
   104 typedef void (*TCpuPowerUpFn)(TInt aCpu, SPerCpuUncached* aU);
    88 	{
   105 
    89 	TUint32		iFreq;						// frequency as a fraction of maximum possible, multiplied by 2^32
   106 /** Function to power down a CPU
    90 	TUint32		iInverse;					// 2^24/(iFreq/2^32) = 2^56/iFreq
   107 @publishedPartner
    91 	};
   108 @prototype
       
   109 */
       
   110 typedef void (*TCpuPowerDownFn)(TInt aCpu, SPerCpuUncached* aU);
       
   111 
       
   112 /** Function to notify changes to system clock frequencies
       
   113 @publishedPartner
       
   114 @prototype
       
   115 */
       
   116 typedef TInt (*TFrequencyChangeFn)();
    92 
   117 
    93 /** Variant interface block
   118 /** Variant interface block
    94 @internalTechnology
   119 @internalTechnology
    95 @prototype
   120 @prototype
    96 */
   121 */
   102 	TUint32		iMaxTimerClock;				// maximum possible local timer clock frequency
   127 	TUint32		iMaxTimerClock;				// maximum possible local timer clock frequency
   103 	TLinAddr	iScuAddr;					// address of SCU
   128 	TLinAddr	iScuAddr;					// address of SCU
   104 	TLinAddr	iGicDistAddr;				// address of GIC Distributor
   129 	TLinAddr	iGicDistAddr;				// address of GIC Distributor
   105 	TLinAddr	iGicCpuIfcAddr;				// address of GIC CPU interface (must be same for all CPUs)
   130 	TLinAddr	iGicCpuIfcAddr;				// address of GIC CPU interface (must be same for all CPUs)
   106 	TLinAddr	iLocalTimerAddr;			// address of per-CPU timer (must be same for all CPUs)
   131 	TLinAddr	iLocalTimerAddr;			// address of per-CPU timer (must be same for all CPUs)
   107 	volatile STimerMult* iTimerMult[KMaxCpus];	// timer[i] frequency / iMaxTimerClock * 2^32
   132 	TLinAddr	iGlobalTimerAddr;			// address of global timer if it exists
   108 	volatile TUint32* iCpuMult[KMaxCpus];	// CPU[i] frequency / iMaxCpuClock * 2^32
   133 	SRatio*		iTimerFreqR[KMaxCpus];		// timer[i] frequency as a fraction of iMaxTimerClock
       
   134 	SRatio*		iCpuFreqR[KMaxCpus];		// CPU[i] frequency as a fraction of iMaxCpuClock
       
   135 	UPerCpuUncached*		iUncached[KMaxCpus];	// Pointer to uncached memory for each CPU
       
   136 	TCpuPowerUpFn			iCpuPowerUpFn;			// function used to power up a retired CPU (NULL if core control not supported)
       
   137 	TCpuPowerDownFn			iCpuPowerDownFn;		// function used to power down a CPU (NULL if power down done within idle handler itself)
       
   138 	SRatio*		iGTimerFreqR;				// global timer frequency as a fraction of iMaxTimerClock
       
   139 	TFrequencyChangeFn		iFrqChgFn;		// function to notify frequency changes
   109 	};
   140 	};
   110 
   141 
   111 // End of file
   142 // End of file
   112 #endif
   143 #endif