1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/assp/omap3530_assp/omap3530_assp_priv.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,203 @@
1.4 +// Copyright (c) 2004-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 +// omap3530/assp/inc/omap3530_assp_priv.h
1.18 +//
1.19 +
1.20 +#ifndef __OMAP3530_PRIV_H__
1.21 +#define __OMAP3530_PRIV_H__
1.22 +
1.23 +#include <e32const.h>
1.24 +#include <arm.h>
1.25 +#include <assp.h>
1.26 +#include <assp/omap3530_assp/omap3530_irqmap.h>
1.27 +#include <assp/omap3530_assp/omap3530_timer.h>
1.28 +#include <assp/omap3530_assp/omap3530_uart.h>
1.29 +
1.30 +/**
1.31 +* IRQ/FIQ dispatchers
1.32 +*/
1.33 +static void IrqDispatch();
1.34 +static void FiqDispatch();
1.35 +
1.36 +class TArmCpuId {
1.37 +public:
1.38 + TInt Implementor; // Indicates the implementor, ARM:
1.39 + TInt Variant; //Indicates the variant number, or major revision, of the processor:
1.40 + TInt Architecture; //Indicates that the architecture is given in the feature registers:
1.41 + TInt Primary; //part number Indicates the part number, Cortex-A8:
1.42 + TInt Revision;
1.43 +};
1.44 +
1.45 +class Omap3530Interrupt : public Interrupt
1.46 + {
1.47 +public:
1.48 + /**
1.49 + * These functions are required to initialise the Interrupt controller,or perform housekeeping
1.50 + * functions, or dispatch the incoming IRQ or FIQ interrupts.
1.51 + */
1.52 +
1.53 + /**
1.54 + * initialisation
1.55 + */
1.56 + static void Init1();
1.57 + static void Init3();
1.58 +
1.59 + /**
1.60 + * Housekeeping (disable and clear all hardware interrupt sources)
1.61 + */
1.62 + static void DisableAndClearAll();
1.63 + IMPORT_C static TInt IsInterruptEnabled(TInt anId);
1.64 + static void dumpINTCState();
1.65 + static void dumpIVTState();
1.66 + static TInt GetRegisterAndBitOffset(TInt anId,TInt &aReg,TInt &aOffset);
1.67 + static void Spurious(TAny* anId);
1.68 +
1.69 + static SInterruptHandler Handlers[KNumOmap3530Ints];
1.70 +
1.71 + TSpinLock Omap3530INTCLock;
1.72 + TSpinLock Omap3530IVTLock;
1.73 +private:
1.74 +
1.75 +
1.76 + };
1.77 +
1.78 +
1.79 +
1.80 +class Omap3530Assp : public Asic
1.81 + {
1.82 +public:
1.83 + IMPORT_C Omap3530Assp();
1.84 +
1.85 +public:
1.86 + IMPORT_C virtual TInt MsTickPeriod();
1.87 + /**
1.88 + * Obtain System Time from the RTC
1.89 + * @return System Time in seconds from 00:00 hours of 1/1/2000
1.90 + */
1.91 + virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime)=0;
1.92 + /**
1.93 + * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
1.94 + * @return System wide error code
1.95 + */
1.96 + virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime)=0;
1.97 + /**
1.98 + * Obtain the time it takes to execute two processor instructions
1.99 + * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
1.100 + */
1.101 + IMPORT_C virtual TUint32 NanoWaitCalibration();
1.102 +
1.103 + /**
1.104 + * initialisation
1.105 + */
1.106 + IMPORT_C virtual void Init1();
1.107 + IMPORT_C virtual void Init3();
1.108 + /**
1.109 + * Active waiting loop (not to be used after System Tick timer has been set up - Init3()
1.110 + * @param aDuration A wait time in milliseconds
1.111 + */
1.112 + IMPORT_C static void BootWaitMilliSeconds(TInt aDuration);
1.113 + /**
1.114 + * Read and return the Startup reason of the Hardware
1.115 + * @return A TMachineStartupType enumerated value
1.116 + */
1.117 + IMPORT_C virtual TMachineStartupType StartupReason();
1.118 + /**
1.119 + * Read and return the the CPU ID
1.120 + * @return An integer containing the CPU ID string read off the hardware
1.121 + */
1.122 + IMPORT_C static void ArmCpuVersionId(TArmCpuId &id);
1.123 + /**
1.124 + * Get debug port number enumeration
1.125 + * @return An integer containing the Omap3530Uart::TUartNumber value, with value ENone if debug port isn't a UART
1.126 + */
1.127 + IMPORT_C static Omap3530Uart::TUartNumber DebugPortNumber();
1.128 + /**
1.129 + * Read CPU clock period in picoseconds
1.130 + * @return An integer containing the CPU clock period in picoseconds
1.131 + */
1.132 + IMPORT_C static TUint ProcessorPeriodInPs();
1.133 + /**
1.134 + * Read the current time of the RTC
1.135 + * @return A value that is the real time as given by a RTC
1.136 + */
1.137 + //IMPORT_C static TUint RtcData();
1.138 + /**
1.139 + * Set the RTC time
1.140 + * @param aValue The real time to set the RTC
1.141 + */
1.142 + //IMPORT_C static void SetRtcData(TUint aValue);
1.143 + /**
1.144 + * Obtain the physical start address of Video Buffer
1.145 + * @return the physical start address of Video Buffer
1.146 + */
1.147 +
1.148 + IMPORT_C static TUint64 GetXtalFrequency();
1.149 +
1.150 +private:
1.151 + /**
1.152 + * Assp-specific implementation for Kern::NanoWait function
1.153 + */
1.154 + static void NanoWait(TUint32 aInterval);
1.155 + TInt StartMsTick();
1.156 + static void MsTickIsr(TAny* aPtr);
1.157 +
1.158 +
1.159 +public:
1.160 + /**
1.161 + * for derivation by Variant
1.162 + */
1.163 +
1.164 + /**
1.165 + * external interrupt handling
1.166 + * used by second-level interrupt controllers at Variant level
1.167 + */
1.168 + virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
1.169 + virtual TInt InterruptUnbind(TInt anId)=0;
1.170 + virtual TInt InterruptEnable(TInt anId)=0;
1.171 + virtual TInt InterruptDisable(TInt anId)=0;
1.172 + virtual TInt InterruptClear(TInt anId)=0;
1.173 + virtual TInt IsExternalInterrupt(TInt anId)=0;
1.174 +
1.175 + /**
1.176 + * USB client controller - Some example functions for the case that USB cable detection and
1.177 + * UDC connect/disconnect functionality are part of the Variant.
1.178 + * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
1.179 + * If this functionality is part of the ASSP then these functions can be removed and calls to them
1.180 + * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
1.181 + */
1.182 + virtual TBool UsbClientConnectorDetectable()=0;
1.183 + virtual TBool UsbClientConnectorInserted()=0;
1.184 + virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
1.185 + virtual void UnregisterUsbClientConnectorCallback()=0;
1.186 + virtual TBool UsbSoftwareConnectable()=0;
1.187 + virtual TInt UsbConnect()=0;
1.188 + virtual TInt UsbDisconnect()=0;
1.189 +
1.190 + /** Return the frequency in Hz of the SYSCLK source clock */
1.191 + virtual TUint SysClkFrequency() const = 0;
1.192 +
1.193 + /** Return the frequency in Hz of the SYSCLK32K source clock */
1.194 + virtual TUint SysClk32kFrequency() const = 0;
1.195 +
1.196 + /** Return the frequency in Hz of the ALTCLK source clock */
1.197 + virtual TUint AltClkFrequency() const = 0;
1.198 +
1.199 +public:
1.200 + static Omap3530Assp * Variant;
1.201 + TBool iDebugInitialised;
1.202 +
1.203 +private:
1.204 + };
1.205 +
1.206 +#endif