epoc32/include/assp/omap3530_assp/omap3530_assp_priv.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of the License "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// omap3530/assp/inc/omap3530_assp_priv.h
williamr@4
    15
//
williamr@4
    16
williamr@4
    17
#ifndef __OMAP3530_PRIV_H__
williamr@4
    18
#define __OMAP3530_PRIV_H__
williamr@4
    19
williamr@4
    20
#include <e32const.h>
williamr@4
    21
#include <arm.h>
williamr@4
    22
#include <assp.h>
williamr@4
    23
#include <assp/omap3530_assp/omap3530_irqmap.h>
williamr@4
    24
#include <assp/omap3530_assp/omap3530_timer.h>
williamr@4
    25
#include <assp/omap3530_assp/omap3530_uart.h>
williamr@4
    26
williamr@4
    27
/**
williamr@4
    28
* IRQ/FIQ dispatchers
williamr@4
    29
*/
williamr@4
    30
static void IrqDispatch();
williamr@4
    31
static void FiqDispatch();
williamr@4
    32
williamr@4
    33
class TArmCpuId {
williamr@4
    34
public:
williamr@4
    35
	TInt Implementor;		// Indicates the implementor, ARM:
williamr@4
    36
	TInt Variant; 			//Indicates the variant number, or major revision, of the processor:
williamr@4
    37
	TInt Architecture; 		//Indicates that the architecture is given in the feature registers:
williamr@4
    38
	TInt Primary; 			//part number Indicates the part number, Cortex-A8:
williamr@4
    39
	TInt Revision;
williamr@4
    40
};
williamr@4
    41
williamr@4
    42
class Omap3530Interrupt : public Interrupt
williamr@4
    43
	{
williamr@4
    44
public:
williamr@4
    45
	/**
williamr@4
    46
	 * These functions are required to initialise the Interrupt controller,or perform housekeeping
williamr@4
    47
	 * functions, or dispatch the incoming IRQ or FIQ interrupts.
williamr@4
    48
	 */
williamr@4
    49
williamr@4
    50
	/**
williamr@4
    51
	 * initialisation
williamr@4
    52
	 */
williamr@4
    53
	static void Init1();
williamr@4
    54
	static void Init3();
williamr@4
    55
williamr@4
    56
	/**
williamr@4
    57
	 * Housekeeping (disable and clear all hardware interrupt sources)
williamr@4
    58
	 */
williamr@4
    59
	static void DisableAndClearAll();
williamr@4
    60
	IMPORT_C static TInt IsInterruptEnabled(TInt anId);
williamr@4
    61
	static void dumpINTCState();	
williamr@4
    62
	static void dumpIVTState();
williamr@4
    63
	static TInt GetRegisterAndBitOffset(TInt anId,TInt &aReg,TInt &aOffset);
williamr@4
    64
	static void Spurious(TAny* anId);
williamr@4
    65
williamr@4
    66
	static SInterruptHandler Handlers[KNumOmap3530Ints];
williamr@4
    67
williamr@4
    68
	TSpinLock Omap3530INTCLock;
williamr@4
    69
	TSpinLock Omap3530IVTLock;
williamr@4
    70
private:
williamr@4
    71
williamr@4
    72
williamr@4
    73
	};
williamr@4
    74
williamr@4
    75
williamr@4
    76
williamr@4
    77
class Omap3530Assp : public Asic
williamr@4
    78
	{
williamr@4
    79
public:
williamr@4
    80
	IMPORT_C Omap3530Assp();
williamr@4
    81
williamr@4
    82
public:
williamr@4
    83
	IMPORT_C virtual TInt MsTickPeriod();
williamr@4
    84
	/**
williamr@4
    85
	 * Obtain System Time from the RTC
williamr@4
    86
	 * @return System Time in seconds from 00:00 hours of 1/1/2000
williamr@4
    87
	 */
williamr@4
    88
	virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime)=0;
williamr@4
    89
	/**
williamr@4
    90
	 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
williamr@4
    91
	 * @return System wide error code
williamr@4
    92
	 */
williamr@4
    93
	virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime)=0;
williamr@4
    94
	/**
williamr@4
    95
	 * Obtain the time it takes to execute two processor instructions
williamr@4
    96
	 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
williamr@4
    97
	 */
williamr@4
    98
	IMPORT_C virtual TUint32 NanoWaitCalibration();
williamr@4
    99
	
williamr@4
   100
	/**
williamr@4
   101
	 * initialisation
williamr@4
   102
	 */
williamr@4
   103
	IMPORT_C virtual void Init1();
williamr@4
   104
	IMPORT_C virtual void Init3();
williamr@4
   105
	/**
williamr@4
   106
	 * Active waiting loop (not to be used after System Tick timer has been set up - Init3()
williamr@4
   107
	 * @param aDuration A wait time in milliseconds
williamr@4
   108
	 */	
williamr@4
   109
	IMPORT_C static void BootWaitMilliSeconds(TInt aDuration);
williamr@4
   110
	/**
williamr@4
   111
	 * Read and return the Startup reason of the Hardware
williamr@4
   112
	 * @return A TMachineStartupType enumerated value
williamr@4
   113
	 */	
williamr@4
   114
	IMPORT_C virtual TMachineStartupType StartupReason();
williamr@4
   115
	/**
williamr@4
   116
	 * Read and return the the CPU ID
williamr@4
   117
	 * @return An integer containing the CPU ID string read off the hardware
williamr@4
   118
	 */	
williamr@4
   119
	IMPORT_C static void ArmCpuVersionId(TArmCpuId &id);
williamr@4
   120
	/**
williamr@4
   121
	 * Get debug port number enumeration
williamr@4
   122
	 * @return An integer containing the Omap3530Uart::TUartNumber value, with value ENone if debug port isn't a UART
williamr@4
   123
	 */	
williamr@4
   124
	IMPORT_C static Omap3530Uart::TUartNumber DebugPortNumber();
williamr@4
   125
	/**
williamr@4
   126
	 * Read CPU clock period in picoseconds
williamr@4
   127
	 * @return An integer containing the CPU clock period in picoseconds
williamr@4
   128
	 */	
williamr@4
   129
	IMPORT_C static TUint ProcessorPeriodInPs();
williamr@4
   130
	/**
williamr@4
   131
	 * Read the current time of the RTC
williamr@4
   132
	 * @return A value that is the real time as given by a RTC
williamr@4
   133
	 */	
williamr@4
   134
	//IMPORT_C static TUint RtcData();
williamr@4
   135
	/**
williamr@4
   136
	 * Set the RTC time 
williamr@4
   137
	 * @param aValue The real time to set the RTC
williamr@4
   138
	 */	
williamr@4
   139
	//IMPORT_C static void SetRtcData(TUint aValue);
williamr@4
   140
	/**
williamr@4
   141
	 * Obtain the physical start address of Video Buffer
williamr@4
   142
	 * @return the physical start address of Video Buffer
williamr@4
   143
	 */	
williamr@4
   144
					 
williamr@4
   145
	IMPORT_C static  TUint64 GetXtalFrequency();
williamr@4
   146
williamr@4
   147
private:
williamr@4
   148
	/**
williamr@4
   149
	 * Assp-specific implementation for Kern::NanoWait function
williamr@4
   150
	 */
williamr@4
   151
	static void NanoWait(TUint32 aInterval);
williamr@4
   152
	TInt StartMsTick();
williamr@4
   153
	static void MsTickIsr(TAny* aPtr);
williamr@4
   154
	
williamr@4
   155
williamr@4
   156
public:
williamr@4
   157
	/**
williamr@4
   158
	 * for derivation by Variant
williamr@4
   159
	 */
williamr@4
   160
williamr@4
   161
	/**
williamr@4
   162
	 * external interrupt handling
williamr@4
   163
	 * used by second-level interrupt controllers at Variant level
williamr@4
   164
	 */
williamr@4
   165
	virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
williamr@4
   166
	virtual TInt InterruptUnbind(TInt anId)=0;
williamr@4
   167
	virtual TInt InterruptEnable(TInt anId)=0;
williamr@4
   168
	virtual TInt InterruptDisable(TInt anId)=0;
williamr@4
   169
	virtual TInt InterruptClear(TInt anId)=0;
williamr@4
   170
	virtual TInt IsExternalInterrupt(TInt anId)=0;
williamr@4
   171
williamr@4
   172
	/**
williamr@4
   173
	 * USB client controller - Some example functions for the case that USB cable detection and
williamr@4
   174
	 * UDC connect/disconnect functionality are part of the Variant.
williamr@4
   175
	 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
williamr@4
   176
	 * If this functionality is part of the ASSP then these functions can be removed and calls to them
williamr@4
   177
	 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
williamr@4
   178
	 */
williamr@4
   179
	virtual TBool UsbClientConnectorDetectable()=0;
williamr@4
   180
	virtual TBool UsbClientConnectorInserted()=0;
williamr@4
   181
	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
williamr@4
   182
	virtual void UnregisterUsbClientConnectorCallback()=0;
williamr@4
   183
	virtual TBool UsbSoftwareConnectable()=0;
williamr@4
   184
	virtual TInt UsbConnect()=0;
williamr@4
   185
	virtual TInt UsbDisconnect()=0;
williamr@4
   186
williamr@4
   187
	/** Return the frequency in Hz of the SYSCLK source clock */
williamr@4
   188
	virtual TUint SysClkFrequency() const = 0;
williamr@4
   189
williamr@4
   190
	/** Return the frequency in Hz of the SYSCLK32K source clock */
williamr@4
   191
	virtual TUint SysClk32kFrequency() const = 0;
williamr@4
   192
williamr@4
   193
	/** Return the frequency in Hz of the ALTCLK source clock */
williamr@4
   194
	virtual TUint AltClkFrequency() const = 0;
williamr@4
   195
williamr@4
   196
public:
williamr@4
   197
	static Omap3530Assp * 											Variant;
williamr@4
   198
	TBool															iDebugInitialised;
williamr@4
   199
williamr@4
   200
private:
williamr@4
   201
	};
williamr@4
   202
williamr@4
   203
#endif