os/kernelhwsrv/bsptemplate/asspandvariant/template_assp/template_assp_priv.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/bsptemplate/asspandvariant/template_assp/template_assp_priv.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,155 @@
     1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// template\template_assp\template_assp_priv.h
    1.18 +// Template ASSP architecture private header file
    1.19 +// 
    1.20 +// WARNING: This file contains some APIs which are internal and are subject
    1.21 +//          to change without notice. Such APIs should therefore not be used
    1.22 +//          outside the Kernel and Hardware Services package.
    1.23 +//
    1.24 +
    1.25 +#ifndef __KA_TEMPLATE_H__
    1.26 +#define __KA_TEMPLATE_H__
    1.27 +#include <e32const.h>
    1.28 +#include <arm.h>
    1.29 +#include <assp.h>
    1.30 +#include <template_assp.h>
    1.31 +
    1.32 +// Example only
    1.33 +const TInt KNumTemplateInts=EAsspIntIdZ+1;
    1.34 +
    1.35 +class TemplateInterrupt : public Interrupt
    1.36 +	{
    1.37 +public:
    1.38 +	/**
    1.39 +	 * These functions are required to initialise the Interrupt controller,or perform housekeeping
    1.40 +	 * functions, or dispatch the incoming IRQ or FIQ interrupts.
    1.41 +	 */
    1.42 +
    1.43 +	/**
    1.44 +	 * initialisation
    1.45 +	 */
    1.46 +	static void Init1();
    1.47 +	static void Init3();
    1.48 +	/**
    1.49 +	 * IRQ/FIQ dispatchers
    1.50 +	 */
    1.51 +	static void IrqDispatch();
    1.52 +	static void FiqDispatch();
    1.53 +	/**
    1.54 +	 * Housekeeping (disable and clear all hardware interrupt sources)
    1.55 +	 */
    1.56 +	static void DisableAndClearAll();
    1.57 +	/**
    1.58 +	 * Empty interrupt handler
    1.59 +	 */
    1.60 +	static void Spurious(TAny* anId);
    1.61 +public:
    1.62 +	static SInterruptHandler Handlers[KNumTemplateInts];
    1.63 +	};
    1.64 +
    1.65 +class TemplateAssp : public Asic
    1.66 +	{
    1.67 +public:
    1.68 +	IMPORT_C TemplateAssp();
    1.69 +
    1.70 +public:
    1.71 +	/**
    1.72 +	 * These are the mandatory Asic class functions which are implemented here rather than in the Variant.
    1.73 +	 * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common
    1.74 +	 * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations
    1.75 +	 * of the same family of devices.
    1.76 +	 * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers,
    1.77 +	 * and timing functions
    1.78 +	 */
    1.79 +
    1.80 +	/**
    1.81 +	 * initialisation
    1.82 +	 */
    1.83 +	IMPORT_C virtual void Init1();
    1.84 +	IMPORT_C virtual void Init3();
    1.85 +	/**
    1.86 +	 * Read and return the Startup reason of the Super Page (set up by Bootstrap)
    1.87 +	 * @return A TMachineStartupType enumerated value
    1.88 +	 * @see TMachineStartupType
    1.89 +	 */
    1.90 +	IMPORT_C virtual TMachineStartupType StartupReason();
    1.91 +
    1.92 +	/**
    1.93 +	 * timing functions
    1.94 +	 */
    1.95 +
    1.96 +	/**
    1.97 +	 * Obtain the period of System Tick timer in microseconds
    1.98 +	 * @return Period of System Tick timer in microseconds
    1.99 +	 */
   1.100 +	IMPORT_C virtual TInt MsTickPeriod();
   1.101 +	/**
   1.102 +	 * Obtain System Time from the RTC
   1.103 +	 * @return System Time in seconds from 00:00 hours of 1/1/2000
   1.104 +	 */
   1.105 +	IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
   1.106 +	/**
   1.107 +	 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
   1.108 +	 * @return System wide error code
   1.109 +	 */
   1.110 +	IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
   1.111 +	/**
   1.112 +	 * Obtain the time it takes to execute two processor instructions
   1.113 +	 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
   1.114 +	 */
   1.115 +	IMPORT_C virtual TUint32 NanoWaitCalibration();
   1.116 +
   1.117 +public:
   1.118 +	/**
   1.119 +	 * for derivation by Variant
   1.120 +	 */
   1.121 +
   1.122 +	/**
   1.123 +	 * external interrupt handling
   1.124 +	 * used by second-level interrupt controllers at Variant level
   1.125 +	 */
   1.126 +	virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
   1.127 +	virtual TInt InterruptUnbind(TInt anId)=0;
   1.128 +	virtual TInt InterruptEnable(TInt anId)=0;
   1.129 +	virtual TInt InterruptDisable(TInt anId)=0;
   1.130 +	virtual TInt InterruptClear(TInt anId)=0;
   1.131 +
   1.132 +	/**
   1.133 +	 * USB client controller - Some example functions for the case that USB cable detection and
   1.134 +	 * UDC connect/disconnect functionality are part of the Variant.
   1.135 +	 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
   1.136 +	 * If this functionality is part of the ASSP then these functions can be removed and calls to them
   1.137 +	 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
   1.138 +	 */
   1.139 +	virtual TBool UsbClientConnectorDetectable()=0;
   1.140 +	virtual TBool UsbClientConnectorInserted()=0;
   1.141 +	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
   1.142 +	virtual void UnregisterUsbClientConnectorCallback()=0;
   1.143 +	virtual TBool UsbSoftwareConnectable()=0;
   1.144 +	virtual TInt UsbConnect()=0;
   1.145 +	virtual TInt UsbDisconnect()=0;
   1.146 +
   1.147 +	/**
   1.148 +	 * miscellaneous
   1.149 +	 */
   1.150 +	virtual TInt VideoRamSize()=0;
   1.151 +
   1.152 +public:
   1.153 +	static TemplateAssp* Variant;
   1.154 +	static TPhysAddr VideoRamPhys;
   1.155 +	NTimerQ* iTimerQ;
   1.156 +	};
   1.157 +
   1.158 +#endif