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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // template\template_assp\template_assp_priv.h
15 // Template ASSP architecture private header file
21 #ifndef __KA_TEMPLATE_H__
22 #define __KA_TEMPLATE_H__
26 #include <template_assp.h>
29 const TInt KNumTemplateInts=EAsspIntIdZ+1;
31 class TemplateInterrupt : public Interrupt
35 * These functions are required to initialise the Interrupt controller,or perform housekeeping
36 * functions, or dispatch the incoming IRQ or FIQ interrupts.
47 static void IrqDispatch();
48 static void FiqDispatch();
50 * Housekeeping (disable and clear all hardware interrupt sources)
52 static void DisableAndClearAll();
54 * Empty interrupt handler
56 static void Spurious(TAny* anId);
58 static SInterruptHandler Handlers[KNumTemplateInts];
61 class TemplateAssp : public Asic
64 IMPORT_C TemplateAssp();
68 * These are the mandatory Asic class functions which are implemented here rather than in the Variant.
69 * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common
70 * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations
71 * of the same family of devices.
72 * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers,
73 * and timing functions
79 IMPORT_C virtual void Init1();
80 IMPORT_C virtual void Init3();
82 * Read and return the Startup reason of the Super Page (set up by Bootstrap)
83 * @return A TMachineStartupType enumerated value
84 * @see TMachineStartupType
86 IMPORT_C virtual TMachineStartupType StartupReason();
93 * Obtain the period of System Tick timer in microseconds
94 * @return Period of System Tick timer in microseconds
96 IMPORT_C virtual TInt MsTickPeriod();
98 * Obtain System Time from the RTC
99 * @return System Time in seconds from 00:00 hours of 1/1/2000
101 IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
103 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
104 * @return System wide error code
106 IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
108 * Obtain the time it takes to execute two processor instructions
109 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
111 IMPORT_C virtual TUint32 NanoWaitCalibration();
115 * for derivation by Variant
119 * external interrupt handling
120 * used by second-level interrupt controllers at Variant level
122 virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
123 virtual TInt InterruptUnbind(TInt anId)=0;
124 virtual TInt InterruptEnable(TInt anId)=0;
125 virtual TInt InterruptDisable(TInt anId)=0;
126 virtual TInt InterruptClear(TInt anId)=0;
129 * USB client controller - Some example functions for the case that USB cable detection and
130 * UDC connect/disconnect functionality are part of the Variant.
131 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
132 * If this functionality is part of the ASSP then these functions can be removed and calls to them
133 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
135 virtual TBool UsbClientConnectorDetectable()=0;
136 virtual TBool UsbClientConnectorInserted()=0;
137 virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
138 virtual void UnregisterUsbClientConnectorCallback()=0;
139 virtual TBool UsbSoftwareConnectable()=0;
140 virtual TInt UsbConnect()=0;
141 virtual TInt UsbDisconnect()=0;
146 virtual TInt VideoRamSize()=0;
149 static TemplateAssp* Variant;
150 static TPhysAddr VideoRamPhys;