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