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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // omap3530/beagleboard/inc/variant.h
15 // Beagle Variant Header
22 #include <assp/omap3530_assp/omap3530_assp_priv.h>
23 #include <beagle/iolines.h>
28 void ExtIrqDispatch(TAny * ptr);
30 #define DEC_TO_BCD(dec) (((dec/10)<<4)+(dec%10))
31 #define BCD_TO_DEC(bcd) (((bcd>>4)*10)+bcd%16)
34 NONSHARABLE_CLASS(Beagle) : public Omap3530Assp
39 static inline Beagle& Variant();
43 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
44 * functions are implemented in TemplateAssp
55 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
61 * @param aChar Character to be output by debug serial port
63 virtual void DebugOutput(TUint aChar);
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
73 virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
76 * Machine configuration
77 * @return Pointer to a device configuration information
78 * @see TTemplateMachineConfig
80 virtual TPtr8 MachineConfiguration();
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);
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.
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();
105 virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
107 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
108 * @return System wide error code
110 virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
114 * RAM zone callback functions that will be invoked by the kernel when a RAM zone
115 * operation should be performed.
117 static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
118 TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
120 /** Input clock frequency information */
121 virtual TUint SysClkFrequency() const;
122 virtual TUint SysClk32kFrequency() const;
123 virtual TUint AltClkFrequency() const;
127 static void UsbClientConnectorIsr(TAny *);
131 TDfc * iExtInterruptDfc;
132 // TLinAddr iIdleFunction; // may be used to point to a Bootstrap routine which prepares the CPU to Sleep
133 TBool iDebugInitialised;
136 TInt (*iUsbClientConnectorCallback)(TAny*);
137 TAny* iUsbClientConnectorCallbackArg;
139 TInt32 iFrameBufferSize;
140 TPhysAddr iFrameBufferRamPhys;
143 GLREF_D Beagle TheVariant;
146 inline Beagle& Beagle::Variant()
148 return *reinterpret_cast< Beagle* >( Arch::TheAsic() );