First public contribution.
1 // Copyright (c) 1998-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // template\template_assp\template_assp_priv.h
15 // Template ASSP architecture private header file
17 // WARNING: This file contains some APIs which are internal and are subject
18 // to change without notice. Such APIs should therefore not be used
19 // outside the Kernel and Hardware Services package.
22 #ifndef __KA_TEMPLATE_H__
23 #define __KA_TEMPLATE_H__
27 #include <template_assp.h>
30 const TInt KNumTemplateInts=EAsspIntIdZ+1;
32 class TemplateInterrupt : public Interrupt
36 * These functions are required to initialise the Interrupt controller,or perform housekeeping
37 * functions, or dispatch the incoming IRQ or FIQ interrupts.
48 static void IrqDispatch();
49 static void FiqDispatch();
51 * Housekeeping (disable and clear all hardware interrupt sources)
53 static void DisableAndClearAll();
55 * Empty interrupt handler
57 static void Spurious(TAny* anId);
59 static SInterruptHandler Handlers[KNumTemplateInts];
62 class TemplateAssp : public Asic
65 IMPORT_C TemplateAssp();
69 * These are the mandatory Asic class functions which are implemented here rather than in the Variant.
70 * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common
71 * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations
72 * of the same family of devices.
73 * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers,
74 * and timing functions
80 IMPORT_C virtual void Init1();
81 IMPORT_C virtual void Init3();
83 * Read and return the Startup reason of the Super Page (set up by Bootstrap)
84 * @return A TMachineStartupType enumerated value
85 * @see TMachineStartupType
87 IMPORT_C virtual TMachineStartupType StartupReason();
94 * Obtain the period of System Tick timer in microseconds
95 * @return Period of System Tick timer in microseconds
97 IMPORT_C virtual TInt MsTickPeriod();
99 * Obtain System Time from the RTC
100 * @return System Time in seconds from 00:00 hours of 1/1/2000
102 IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
104 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
105 * @return System wide error code
107 IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
109 * Obtain the time it takes to execute two processor instructions
110 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
112 IMPORT_C virtual TUint32 NanoWaitCalibration();
116 * for derivation by Variant
120 * external interrupt handling
121 * used by second-level interrupt controllers at Variant level
123 virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
124 virtual TInt InterruptUnbind(TInt anId)=0;
125 virtual TInt InterruptEnable(TInt anId)=0;
126 virtual TInt InterruptDisable(TInt anId)=0;
127 virtual TInt InterruptClear(TInt anId)=0;
130 * USB client controller - Some example functions for the case that USB cable detection and
131 * UDC connect/disconnect functionality are part of the Variant.
132 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
133 * If this functionality is part of the ASSP then these functions can be removed and calls to them
134 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
136 virtual TBool UsbClientConnectorDetectable()=0;
137 virtual TBool UsbClientConnectorInserted()=0;
138 virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
139 virtual void UnregisterUsbClientConnectorCallback()=0;
140 virtual TBool UsbSoftwareConnectable()=0;
141 virtual TInt UsbConnect()=0;
142 virtual TInt UsbDisconnect()=0;
147 virtual TInt VideoRamSize()=0;
150 static TemplateAssp* Variant;
151 static TPhysAddr VideoRamPhys;