sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // template\template_assp\template_assp_priv.h sl@0: // Template ASSP architecture private header file sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __KA_TEMPLATE_H__ sl@0: #define __KA_TEMPLATE_H__ sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: // Example only sl@0: const TInt KNumTemplateInts=EAsspIntIdZ+1; sl@0: sl@0: class TemplateInterrupt : public Interrupt sl@0: { sl@0: public: sl@0: /** sl@0: * These functions are required to initialise the Interrupt controller,or perform housekeeping sl@0: * functions, or dispatch the incoming IRQ or FIQ interrupts. sl@0: */ sl@0: sl@0: /** sl@0: * initialisation sl@0: */ sl@0: static void Init1(); sl@0: static void Init3(); sl@0: /** sl@0: * IRQ/FIQ dispatchers sl@0: */ sl@0: static void IrqDispatch(); sl@0: static void FiqDispatch(); sl@0: /** sl@0: * Housekeeping (disable and clear all hardware interrupt sources) sl@0: */ sl@0: static void DisableAndClearAll(); sl@0: /** sl@0: * Empty interrupt handler sl@0: */ sl@0: static void Spurious(TAny* anId); sl@0: public: sl@0: static SInterruptHandler Handlers[KNumTemplateInts]; sl@0: }; sl@0: sl@0: class TemplateAssp : public Asic sl@0: { sl@0: public: sl@0: IMPORT_C TemplateAssp(); sl@0: sl@0: public: sl@0: /** sl@0: * These are the mandatory Asic class functions which are implemented here rather than in the Variant. sl@0: * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common sl@0: * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations sl@0: * of the same family of devices. sl@0: * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers, sl@0: * and timing functions sl@0: */ sl@0: sl@0: /** sl@0: * initialisation sl@0: */ sl@0: IMPORT_C virtual void Init1(); sl@0: IMPORT_C virtual void Init3(); sl@0: /** sl@0: * Read and return the Startup reason of the Super Page (set up by Bootstrap) sl@0: * @return A TMachineStartupType enumerated value sl@0: * @see TMachineStartupType sl@0: */ sl@0: IMPORT_C virtual TMachineStartupType StartupReason(); sl@0: sl@0: /** sl@0: * timing functions sl@0: */ sl@0: sl@0: /** sl@0: * Obtain the period of System Tick timer in microseconds sl@0: * @return Period of System Tick timer in microseconds sl@0: */ sl@0: IMPORT_C virtual TInt MsTickPeriod(); sl@0: /** sl@0: * Obtain System Time from the RTC sl@0: * @return System Time in seconds from 00:00 hours of 1/1/2000 sl@0: */ sl@0: IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime); sl@0: /** sl@0: * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000) sl@0: * @return System wide error code sl@0: */ sl@0: IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime); sl@0: /** sl@0: * Obtain the time it takes to execute two processor instructions sl@0: * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed sl@0: */ sl@0: IMPORT_C virtual TUint32 NanoWaitCalibration(); sl@0: sl@0: public: sl@0: /** sl@0: * for derivation by Variant sl@0: */ sl@0: sl@0: /** sl@0: * external interrupt handling sl@0: * used by second-level interrupt controllers at Variant level sl@0: */ sl@0: virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0; sl@0: virtual TInt InterruptUnbind(TInt anId)=0; sl@0: virtual TInt InterruptEnable(TInt anId)=0; sl@0: virtual TInt InterruptDisable(TInt anId)=0; sl@0: virtual TInt InterruptClear(TInt anId)=0; sl@0: sl@0: /** sl@0: * USB client controller - Some example functions for the case that USB cable detection and sl@0: * UDC connect/disconnect functionality are part of the Variant. sl@0: * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class). sl@0: * If this functionality is part of the ASSP then these functions can be removed and calls to them sl@0: * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations. sl@0: */ sl@0: virtual TBool UsbClientConnectorDetectable()=0; sl@0: virtual TBool UsbClientConnectorInserted()=0; sl@0: virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0; sl@0: virtual void UnregisterUsbClientConnectorCallback()=0; sl@0: virtual TBool UsbSoftwareConnectable()=0; sl@0: virtual TInt UsbConnect()=0; sl@0: virtual TInt UsbDisconnect()=0; sl@0: sl@0: /** sl@0: * miscellaneous sl@0: */ sl@0: virtual TInt VideoRamSize()=0; sl@0: sl@0: public: sl@0: static TemplateAssp* Variant; sl@0: static TPhysAddr VideoRamPhys; sl@0: NTimerQ* iTimerQ; sl@0: }; sl@0: sl@0: #endif