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