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/iolines.h
|
williamr@4
|
15 |
// Variant layer header for Beagle Platform
|
williamr@4
|
16 |
//
|
williamr@4
|
17 |
|
williamr@4
|
18 |
|
williamr@4
|
19 |
|
williamr@4
|
20 |
#ifndef __V32TEMPLATEV1_H__
|
williamr@4
|
21 |
#define __V32TEMPLATEV1_H__
|
williamr@4
|
22 |
#include <e32cmn.h>
|
williamr@4
|
23 |
#include <kpower.h>
|
williamr@4
|
24 |
#include <assp/omap3530_assp/omap3530_assp_priv.h>
|
williamr@4
|
25 |
|
williamr@4
|
26 |
//----------------------------------------------------------------------------
|
williamr@4
|
27 |
// Variant-specific constants: use #define if constant dependencies are not
|
williamr@4
|
28 |
// declared within this file (this breaks the dependency on other header files)
|
williamr@4
|
29 |
//----------------------------------------------------------------------------
|
williamr@4
|
30 |
|
williamr@4
|
31 |
// Examples of what goes in here include:
|
williamr@4
|
32 |
//
|
williamr@4
|
33 |
// - General-purpose I/O allocation such as
|
williamr@4
|
34 |
// #define KtVariantGpio32KHzClkOut KHtGpioPort1
|
williamr@4
|
35 |
// #define KtVariantGpioRClkOut KHtGpioPort0
|
williamr@4
|
36 |
//
|
williamr@4
|
37 |
// #define KmVariantPinDirectionIn Sleep 0
|
williamr@4
|
38 |
//
|
williamr@4
|
39 |
// - Memory constants (type, geometry, wait states, etc) such as:
|
williamr@4
|
40 |
// #define KwVariantRom0Type TTemplate::ERomTypeBurst4Rom
|
williamr@4
|
41 |
// #define KwVariantRom0Width TTemplate::ERomWidth32
|
williamr@4
|
42 |
// const TUint KwVariantRom0WaitNs = 150;
|
williamr@4
|
43 |
// const TUint KwVariantRom0PageNs = 30;
|
williamr@4
|
44 |
// const TUint KwVariantRom0RecoverNs = 55;
|
williamr@4
|
45 |
//
|
williamr@4
|
46 |
// - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as
|
williamr@4
|
47 |
// const TUint KwVariantKeyColLshift = 7;
|
williamr@4
|
48 |
// #define KwVariantLcdBpp TTemplate::ELcd8BitsPerPixel
|
williamr@4
|
49 |
// const TUint KwVariantLcdMaxColors = 4096;
|
williamr@4
|
50 |
// const TUint KwVariantCodecMaxVolume = 0;
|
williamr@4
|
51 |
//
|
williamr@4
|
52 |
// - Off-chip hardware control blocks (addresses, register make-up)
|
williamr@4
|
53 |
//
|
williamr@4
|
54 |
// - Interrupts (second-level Interrupt controller base address, register make-up):
|
williamr@4
|
55 |
// (EXAMPLE ONLY:)
|
williamr@4
|
56 |
const TUint32 KHwVariantPhysBase = 0x40000000;
|
williamr@4
|
57 |
const TUint32 KHoVariantRegSpacing = 0x200;
|
williamr@4
|
58 |
|
williamr@4
|
59 |
const TUint32 KHoBaseIntCont = 0x0B*KHoVariantRegSpacing;
|
williamr@4
|
60 |
|
williamr@4
|
61 |
const TUint32 KHoIntContEnable = 0x00; // offsets from KHwVariantPhysBase+KHoBaseIntCont
|
williamr@4
|
62 |
const TUint32 KHoIntContPending = 0x04;
|
williamr@4
|
63 |
// other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
|
williamr@4
|
64 |
|
williamr@4
|
65 |
|
williamr@4
|
66 |
const TInt KIntIdKeyboard=0;
|
williamr@4
|
67 |
|
williamr@4
|
68 |
|
williamr@4
|
69 |
class GpioPin;
|
williamr@4
|
70 |
|
williamr@4
|
71 |
class Variant
|
williamr@4
|
72 |
{
|
williamr@4
|
73 |
// below is a selection of functions usually implemented at this level. This do not constitute a mandatory
|
williamr@4
|
74 |
// set and it might not be relevant for your hardware...
|
williamr@4
|
75 |
public:
|
williamr@4
|
76 |
/**
|
williamr@4
|
77 |
* initialisation
|
williamr@4
|
78 |
*/
|
williamr@4
|
79 |
static void Init3();
|
williamr@4
|
80 |
/**
|
williamr@4
|
81 |
* Returns the Linear Base address of the Variant Hardware
|
williamr@4
|
82 |
*/
|
williamr@4
|
83 |
IMPORT_C static TUint BaseLinAddress();
|
williamr@4
|
84 |
/**
|
williamr@4
|
85 |
* When invoked, turns off all power supplies
|
williamr@4
|
86 |
*/
|
williamr@4
|
87 |
IMPORT_C static void PowerReset();
|
williamr@4
|
88 |
/**
|
williamr@4
|
89 |
* When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
|
williamr@4
|
90 |
* As in, for example, the serial port was used by a device driver or the system is coming back from Standby
|
williamr@4
|
91 |
*/
|
williamr@4
|
92 |
IMPORT_C static void MarkDebugPortOff();
|
williamr@4
|
93 |
/**
|
williamr@4
|
94 |
* When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings
|
williamr@4
|
95 |
* Called by Template::DebugInit()
|
williamr@4
|
96 |
*/
|
williamr@4
|
97 |
IMPORT_C static void UartInit();
|
williamr@4
|
98 |
/**
|
williamr@4
|
99 |
* When invoked, read the state of on-board switches
|
williamr@4
|
100 |
* @return A bitmask with the state of on-board switches
|
williamr@4
|
101 |
*/
|
williamr@4
|
102 |
IMPORT_C static TUint Switches();
|
williamr@4
|
103 |
// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
|
williamr@4
|
104 |
// or platform-specifc code
|
williamr@4
|
105 |
// ...
|
williamr@4
|
106 |
IMPORT_C static TInt SetGPIOPin(TInt aId,GpioPin *aPin);
|
williamr@4
|
107 |
IMPORT_C static TInt GetGPIOPin(TInt aId,GpioPin * aPin);
|
williamr@4
|
108 |
IMPORT_C static TInt GetMsTickPeriod();
|
williamr@4
|
109 |
|
williamr@4
|
110 |
public:
|
williamr@4
|
111 |
static TUint32 iBaseAddress;
|
williamr@4
|
112 |
// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
|
williamr@4
|
113 |
// static TUint aFollower;
|
williamr@4
|
114 |
};
|
williamr@4
|
115 |
|
williamr@4
|
116 |
#endif
|
williamr@4
|
117 |
|