|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * ne1_tb\inc\variant.h |
|
16 * NE1_TBVariant Variant Header |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __VA_STD_H__ |
|
23 #define __VA_STD_H__ |
|
24 #include "naviengine_priv.h" |
|
25 #include "iolines.h" |
|
26 |
|
27 NONSHARABLE_CLASS(NE1_TBVariant) : public NaviEngineAssp |
|
28 { |
|
29 public: |
|
30 NE1_TBVariant(); |
|
31 public: |
|
32 /** |
|
33 * These are the mandatory Asic class functions which need to be implemented here. The other mandatory |
|
34 * functions are implemented in NaviEngineAssp |
|
35 */ |
|
36 |
|
37 /** |
|
38 * initialisation |
|
39 */ |
|
40 virtual void Init1(); |
|
41 #ifdef __SMP__ |
|
42 virtual void Init2AP(); |
|
43 #endif |
|
44 virtual void Init3(); |
|
45 |
|
46 /** |
|
47 * power management |
|
48 * Device specific Idle: prepares the CPU to go into Idle and sets out the conditions to come out of it |
|
49 */ |
|
50 virtual void Idle(); |
|
51 |
|
52 /** |
|
53 * HAL |
|
54 * @param aFunction A TVariantHalFunction enumerated value |
|
55 * @param a1 Optional input/output parameter |
|
56 * @param a2 Optional input/output parameter |
|
57 * @return System wide error code. |
|
58 * @see TVariantHalFunction |
|
59 */ |
|
60 virtual TInt VariantHal(TInt aFunction, TAny* a1, TAny* a2); |
|
61 |
|
62 /** |
|
63 * Machine configuration |
|
64 * @return Pointer to a device configuration information |
|
65 * @see TTemplateMachineConfig |
|
66 */ |
|
67 virtual TPtr8 MachineConfiguration(); |
|
68 |
|
69 public: |
|
70 /** |
|
71 * external interrupt handling |
|
72 * These are used to model second-level interrupt controllers at Variant level |
|
73 * @param anId An interrupt identification number (TTemplateInterruptId enumerated value) |
|
74 * @param an Isr Address of an Interrupt Service Routine |
|
75 * @param aPtr Extra parameter to be passed to ISR function |
|
76 * @return System wide error code |
|
77 * @see TTemplateInterruptId |
|
78 */ |
|
79 |
|
80 virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr); |
|
81 virtual TInt InterruptUnbind(TInt anId); |
|
82 virtual TInt InterruptEnable(TInt anId); |
|
83 virtual TInt InterruptDisable(TInt anId); |
|
84 virtual TInt InterruptClear(TInt anId); |
|
85 |
|
86 /** |
|
87 * USB client controller - Some example functions for the case that USB cable detection and |
|
88 * UDC connect/disconnect functionality are part of the Variant. |
|
89 * These virtual functions are called by the USB PSL (pa_usbc.cpp). |
|
90 * If this functionality is part of the ASSP then these functions can be removed as calls to them |
|
91 * in the PSL will have been replaced by the appropriate internal operations. |
|
92 */ |
|
93 virtual TBool UsbClientConnectorDetectable(); |
|
94 virtual TBool UsbClientConnectorInserted(); |
|
95 virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr); |
|
96 virtual void UnregisterUsbClientConnectorCallback(); |
|
97 virtual TBool UsbSoftwareConnectable(); |
|
98 virtual TInt UsbConnect(); |
|
99 virtual TInt UsbDisconnect(); |
|
100 |
|
101 /** |
|
102 * miscellaneous if Video buffer is allocated in the main System memory during ASSP/Variant initialisation |
|
103 * this will return the required size @return Size (in bytes) of required RAM for Video buffer |
|
104 */ |
|
105 virtual TInt VideoRamSize(); |
|
106 |
|
107 /** |
|
108 * RAM zone callback functions that will be invoked by the kernel when a RAM zone |
|
109 * operation should be performed. |
|
110 */ |
|
111 static TInt RamZoneCallback(TRamZoneOp aOp, TAny* aId, const TAny* aMasks); |
|
112 TInt DoRamZoneCallback(TRamZoneOp aOp, TUint aId, const TUint* aMasks); |
|
113 |
|
114 IMPORT_C static TUint16 SetSerialNumber( TUint32 aSerialNum ); |
|
115 IMPORT_C static TUint32 GetSerialNumber( ); |
|
116 |
|
117 private: // or public: |
|
118 static void InitInterrupts(); |
|
119 static void Spurious(TAny* aId); |
|
120 public: |
|
121 // TLinAddr iIdleFunction; // may be used to point to a Bootstrap routine which prepares the CPU to Sleep |
|
122 static TUint32 HandlerData[3]; |
|
123 static SInterruptHandler Handlers[ENumXInts]; |
|
124 TUint32 iSerialNumber; |
|
125 |
|
126 private: |
|
127 static void UsbClientConnectorIsr(TAny *); |
|
128 |
|
129 private: |
|
130 TInt (*iUsbClientConnectorCallback)(TAny*); |
|
131 TAny* iUsbClientConnectorCallbackArg; |
|
132 }; |
|
133 |
|
134 GLREF_D NE1_TBVariant TheVariant; |
|
135 |
|
136 #endif |