1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/beagle/variant.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,151 @@
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 +// omap3530/beagleboard/inc/variant.h
1.18 +// Beagle Variant Header
1.19 +//
1.20 +
1.21 +
1.22 +
1.23 +#ifndef __VA_STD_H__
1.24 +#define __VA_STD_H__
1.25 +#include <assp/omap3530_assp/omap3530_assp_priv.h>
1.26 +#include <beagle/iolines.h>
1.27 +#include <arm.h>
1.28 +#include <e32const.h>
1.29 +#include <assp.h>
1.30 +
1.31 +void ExtIrqDispatch(TAny * ptr);
1.32 +
1.33 +#define DEC_TO_BCD(dec) (((dec/10)<<4)+(dec%10))
1.34 +#define BCD_TO_DEC(bcd) (((bcd>>4)*10)+bcd%16)
1.35 +
1.36 +
1.37 +NONSHARABLE_CLASS(Beagle) : public Omap3530Assp
1.38 + {
1.39 +public:
1.40 + Beagle();
1.41 +
1.42 + static inline Beagle& Variant();
1.43 +
1.44 +public:
1.45 + /**
1.46 + * These are the mandatory Asic class functions which need to be implemented here. The other mandatory
1.47 + * functions are implemented in TemplateAssp
1.48 + */
1.49 +
1.50 + /**
1.51 + * initialisation
1.52 + */
1.53 + virtual void Init1();
1.54 + virtual void Init3();
1.55 +
1.56 + /**
1.57 + * power management
1.58 + * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it
1.59 + */
1.60 + virtual void Idle();
1.61 +
1.62 + /**
1.63 + * debug
1.64 + * @param aChar Character to be output by debug serial port
1.65 + */
1.66 + virtual void DebugOutput(TUint aChar);
1.67 +
1.68 + /**
1.69 + * HAL
1.70 + * @param aFunction A TVariantHalFunction enumerated value
1.71 + * @param a1 Optional input/output parameter
1.72 + * @param a2 Optional input/output parameter
1.73 + * @return System wide error code.
1.74 + * @see TVariantHalFunction
1.75 + */
1.76 + virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2);
1.77 +
1.78 + /**
1.79 + * Machine configuration
1.80 + * @return Pointer to a device configuration information
1.81 + * @see TTemplateMachineConfig
1.82 + */
1.83 + virtual TPtr8 MachineConfiguration();
1.84 +
1.85 +public:
1.86 + virtual TInt IsExternalInterrupt(TInt anId);
1.87 + virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr);
1.88 + virtual TInt InterruptUnbind(TInt anId);
1.89 + virtual TInt InterruptEnable(TInt anId);
1.90 + virtual TInt InterruptDisable(TInt anId);
1.91 + virtual TInt InterruptClear(TInt anId);
1.92 +
1.93 + /**
1.94 + * USB client controller - Some example functions for the case that USB cable detection and
1.95 + * UDC connect/disconnect functionality are part of the Variant.
1.96 + * These virtual functions are called by the USB PSL (pa_usbc.cpp).
1.97 + * If this functionality is part of the ASSP then these functions can be removed as calls to them
1.98 + * in the PSL will have been replaced by the appropriate internal operations.
1.99 + */
1.100 + virtual TBool UsbClientConnectorDetectable();
1.101 + virtual TBool UsbClientConnectorInserted();
1.102 + virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr);
1.103 + virtual void UnregisterUsbClientConnectorCallback();
1.104 + virtual TBool UsbSoftwareConnectable();
1.105 + virtual TInt UsbConnect();
1.106 + virtual TInt UsbDisconnect();
1.107 +
1.108 + virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
1.109 + /**
1.110 + * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
1.111 + * @return System wide error code
1.112 + */
1.113 + virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
1.114 +
1.115 +
1.116 + /**
1.117 + * RAM zone callback functions that will be invoked by the kernel when a RAM zone
1.118 + * operation should be performed.
1.119 + */
1.120 + static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks);
1.121 + TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks);
1.122 +
1.123 + /** Input clock frequency information */
1.124 + virtual TUint SysClkFrequency() const;
1.125 + virtual TUint SysClk32kFrequency() const;
1.126 + virtual TUint AltClkFrequency() const;
1.127 +
1.128 +private:
1.129 + void DebugInit();
1.130 + static void UsbClientConnectorIsr(TAny *);
1.131 +
1.132 +
1.133 +public:
1.134 + TDfc * iExtInterruptDfc;
1.135 + // TLinAddr iIdleFunction; // may be used to point to a Bootstrap routine which prepares the CPU to Sleep
1.136 + TBool iDebugInitialised;
1.137 +
1.138 +private:
1.139 + TInt (*iUsbClientConnectorCallback)(TAny*);
1.140 + TAny* iUsbClientConnectorCallbackArg;
1.141 +
1.142 + TInt32 iFrameBufferSize;
1.143 + TPhysAddr iFrameBufferRamPhys;
1.144 + };
1.145 +
1.146 +GLREF_D Beagle TheVariant;
1.147 +
1.148 +
1.149 +inline Beagle& Beagle::Variant()
1.150 + {
1.151 + return *reinterpret_cast< Beagle* >( Arch::TheAsic() );
1.152 + }
1.153 +
1.154 +#endif