omap3530/beagleboard/inc/variant.h
changeset 0 6663340f3fc9
equal deleted inserted replaced
-1:000000000000 0:6663340f3fc9
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // omap3530/beagleboard/inc/variant.h
       
    15 // Beagle Variant Header
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __VA_STD_H__
       
    21 #define __VA_STD_H__
       
    22 #include <assp/omap3530_assp/omap3530_assp_priv.h>
       
    23 #include <beagle/iolines.h>
       
    24 #include <arm.h>
       
    25 #include <e32const.h>
       
    26 #include <assp.h>
       
    27 
       
    28 void ExtIrqDispatch(TAny * ptr);
       
    29 
       
    30 #define DEC_TO_BCD(dec) (((dec/10)<<4)+(dec%10))
       
    31 #define BCD_TO_DEC(bcd) (((bcd>>4)*10)+bcd%16)
       
    32 
       
    33 
       
    34 NONSHARABLE_CLASS(Beagle) : public Omap3530Assp
       
    35 	{
       
    36 public:
       
    37 	Beagle();
       
    38 
       
    39 	static inline Beagle& Variant();
       
    40 
       
    41 public:
       
    42 	/**
       
    43 	 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
       
    44 	 * functions are implemented in TemplateAssp
       
    45 	 */
       
    46 
       
    47 	/**
       
    48 	 * initialisation
       
    49 	 */
       
    50 	virtual void Init1();
       
    51 	virtual void Init3();
       
    52 
       
    53 	/**
       
    54  	 * power management
       
    55  	 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
       
    56  	 */
       
    57  	virtual void Idle();
       
    58 
       
    59  	/**
       
    60 	 * debug
       
    61 	 * @param aChar Character to be output by debug serial port
       
    62 	 */
       
    63 	virtual void DebugOutput(TUint aChar);
       
    64 
       
    65 	/**
       
    66 	 * HAL
       
    67 	 * @param aFunction A TVariantHalFunction enumerated value
       
    68 	 * @param a1 Optional input/output parameter
       
    69 	 * @param a2 Optional input/output parameter
       
    70 	 * @return System wide error code. 
       
    71 	 * @see TVariantHalFunction
       
    72 	 */
       
    73 	virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
       
    74 
       
    75 	/**
       
    76 	 * Machine configuration
       
    77 	 * @return Pointer to a device configuration information
       
    78 	 * @see TTemplateMachineConfig
       
    79 	 */
       
    80 	virtual TPtr8 MachineConfiguration();
       
    81 
       
    82 public:
       
    83 	virtual TInt IsExternalInterrupt(TInt anId);
       
    84 	virtual	TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr);
       
    85 	virtual TInt InterruptUnbind(TInt anId);
       
    86 	virtual	TInt InterruptEnable(TInt anId);
       
    87 	virtual	TInt InterruptDisable(TInt anId);
       
    88 	virtual	TInt InterruptClear(TInt anId);
       
    89 	
       
    90 	/**
       
    91 	 * USB client controller - Some example functions for the case that USB cable detection and
       
    92 	 * UDC connect/disconnect functionality are part of the Variant.
       
    93 	 * These virtual functions are called by the USB PSL (pa_usbc.cpp).
       
    94 	 * If this functionality is part of the ASSP then these functions can be removed as calls to them
       
    95 	 * in the PSL will have been replaced by the appropriate internal operations.
       
    96 	 */
       
    97 	virtual TBool UsbClientConnectorDetectable();
       
    98 	virtual TBool UsbClientConnectorInserted();
       
    99 	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr);
       
   100 	virtual void UnregisterUsbClientConnectorCallback();
       
   101 	virtual TBool UsbSoftwareConnectable();
       
   102 	virtual TInt UsbConnect();
       
   103 	virtual TInt UsbDisconnect();
       
   104 
       
   105 	virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
       
   106 	/**
       
   107 	 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
       
   108 	 * @return System wide error code
       
   109 	 */
       
   110 	virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
       
   111 	
       
   112 
       
   113 	/**
       
   114 	 * RAM zone callback functions that will be invoked by the kernel when a RAM zone
       
   115 	 * operation should be performed.
       
   116 	 */
       
   117 	static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
       
   118 	TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
       
   119 
       
   120 	/** Input clock frequency information */
       
   121 	virtual TUint SysClkFrequency() const;
       
   122 	virtual TUint SysClk32kFrequency() const;
       
   123 	virtual TUint AltClkFrequency() const;
       
   124 
       
   125 private:
       
   126 	void DebugInit();
       
   127 	static void UsbClientConnectorIsr(TAny *);
       
   128 
       
   129 
       
   130 public:
       
   131 	TDfc *  iExtInterruptDfc;
       
   132 	// TLinAddr iIdleFunction;		// may be used to point to a Bootstrap routine which prepares the CPU to Sleep 
       
   133 	TBool iDebugInitialised;
       
   134 
       
   135 private:
       
   136 	TInt (*iUsbClientConnectorCallback)(TAny*);
       
   137 	TAny* iUsbClientConnectorCallbackArg;
       
   138 	
       
   139 	TInt32  			iFrameBufferSize;
       
   140 	TPhysAddr		iFrameBufferRamPhys;
       
   141 	};
       
   142 
       
   143 GLREF_D Beagle TheVariant;
       
   144 
       
   145 
       
   146 inline Beagle& Beagle::Variant()
       
   147 	{
       
   148 	return *reinterpret_cast< Beagle* >( Arch::TheAsic() );
       
   149 	}
       
   150 
       
   151 #endif