williamr@4: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of the License "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // omap3530/beagleboard/inc/iolines.h williamr@4: // Variant layer header for Beagle Platform williamr@4: // williamr@4: williamr@4: williamr@4: williamr@4: #ifndef __V32TEMPLATEV1_H__ williamr@4: #define __V32TEMPLATEV1_H__ williamr@4: #include williamr@4: #include williamr@4: #include williamr@4: williamr@4: //---------------------------------------------------------------------------- williamr@4: // Variant-specific constants: use #define if constant dependencies are not williamr@4: // declared within this file (this breaks the dependency on other header files) williamr@4: //---------------------------------------------------------------------------- williamr@4: williamr@4: // Examples of what goes in here include: williamr@4: // williamr@4: // - General-purpose I/O allocation such as williamr@4: // #define KtVariantGpio32KHzClkOut KHtGpioPort1 williamr@4: // #define KtVariantGpioRClkOut KHtGpioPort0 williamr@4: // williamr@4: // #define KmVariantPinDirectionIn Sleep 0 williamr@4: // williamr@4: // - Memory constants (type, geometry, wait states, etc) such as: williamr@4: // #define KwVariantRom0Type TTemplate::ERomTypeBurst4Rom williamr@4: // #define KwVariantRom0Width TTemplate::ERomWidth32 williamr@4: // const TUint KwVariantRom0WaitNs = 150; williamr@4: // const TUint KwVariantRom0PageNs = 30; williamr@4: // const TUint KwVariantRom0RecoverNs = 55; williamr@4: // williamr@4: // - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as williamr@4: // const TUint KwVariantKeyColLshift = 7; williamr@4: // #define KwVariantLcdBpp TTemplate::ELcd8BitsPerPixel williamr@4: // const TUint KwVariantLcdMaxColors = 4096; williamr@4: // const TUint KwVariantCodecMaxVolume = 0; williamr@4: // williamr@4: // - Off-chip hardware control blocks (addresses, register make-up) williamr@4: // williamr@4: // - Interrupts (second-level Interrupt controller base address, register make-up): williamr@4: // (EXAMPLE ONLY:) williamr@4: const TUint32 KHwVariantPhysBase = 0x40000000; williamr@4: const TUint32 KHoVariantRegSpacing = 0x200; williamr@4: williamr@4: const TUint32 KHoBaseIntCont = 0x0B*KHoVariantRegSpacing; williamr@4: williamr@4: const TUint32 KHoIntContEnable = 0x00; // offsets from KHwVariantPhysBase+KHoBaseIntCont williamr@4: const TUint32 KHoIntContPending = 0x04; williamr@4: // other Variant and external blocks Base adrress offsets to KHwVariantPhysBase williamr@4: williamr@4: williamr@4: const TInt KIntIdKeyboard=0; williamr@4: williamr@4: williamr@4: class GpioPin; williamr@4: williamr@4: class Variant williamr@4: { williamr@4: // below is a selection of functions usually implemented at this level. This do not constitute a mandatory williamr@4: // set and it might not be relevant for your hardware... williamr@4: public: williamr@4: /** williamr@4: * initialisation williamr@4: */ williamr@4: static void Init3(); williamr@4: /** williamr@4: * Returns the Linear Base address of the Variant Hardware williamr@4: */ williamr@4: IMPORT_C static TUint BaseLinAddress(); williamr@4: /** williamr@4: * When invoked, turns off all power supplies williamr@4: */ williamr@4: IMPORT_C static void PowerReset(); williamr@4: /** williamr@4: * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation williamr@4: * As in, for example, the serial port was used by a device driver or the system is coming back from Standby williamr@4: */ williamr@4: IMPORT_C static void MarkDebugPortOff(); williamr@4: /** williamr@4: * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings williamr@4: * Called by Template::DebugInit() williamr@4: */ williamr@4: IMPORT_C static void UartInit(); williamr@4: /** williamr@4: * When invoked, read the state of on-board switches williamr@4: * @return A bitmask with the state of on-board switches williamr@4: */ williamr@4: IMPORT_C static TUint Switches(); williamr@4: // other functions to access hardware not covered by specific device-drivres, which may be called from drivers williamr@4: // or platform-specifc code williamr@4: // ... williamr@4: IMPORT_C static TInt SetGPIOPin(TInt aId,GpioPin *aPin); williamr@4: IMPORT_C static TInt GetGPIOPin(TInt aId,GpioPin * aPin); williamr@4: IMPORT_C static TInt GetMsTickPeriod(); williamr@4: williamr@4: public: williamr@4: static TUint32 iBaseAddress; williamr@4: // (optional): May need to have a follower variable to store the value of a read only register initialised at boot time williamr@4: // static TUint aFollower; williamr@4: }; williamr@4: williamr@4: #endif williamr@4: