os/kernelhwsrv/bsptemplate/asspandvariant/template_variant/inc/iolines.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// template\template_variant\inc\iolines.h
sl@0
    15
// Variant layer header for Template Platform
sl@0
    16
// 
sl@0
    17
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    18
//          to change without notice. Such APIs should therefore not be used
sl@0
    19
//          outside the Kernel and Hardware Services package.
sl@0
    20
//
sl@0
    21
sl@0
    22
#ifndef __V32TEMPLATEV1_H__
sl@0
    23
#define __V32TEMPLATEV1_H__
sl@0
    24
#include <e32cmn.h>
sl@0
    25
#include <kernel/kpower.h>
sl@0
    26
sl@0
    27
//----------------------------------------------------------------------------
sl@0
    28
// Variant-specific constants: use #define if constant dependencies are not
sl@0
    29
// declared within this file (this breaks the dependency on other header files)
sl@0
    30
//----------------------------------------------------------------------------
sl@0
    31
sl@0
    32
// Examples of what goes in here include:
sl@0
    33
//
sl@0
    34
// - General-purpose I/O allocation such as 
sl@0
    35
//	 #define KtVariantGpio32KHzClkOut		KHtGpioPort1
sl@0
    36
//	 #define KtVariantGpioRClkOut			KHtGpioPort0
sl@0
    37
//
sl@0
    38
//	 #define KmVariantPinDirectionIn Sleep	0
sl@0
    39
//
sl@0
    40
// - Memory constants (type, geometry, wait states, etc) such as:
sl@0
    41
//	 #define KwVariantRom0Type				TTemplate::ERomTypeBurst4Rom
sl@0
    42
//	 #define KwVariantRom0Width				TTemplate::ERomWidth32
sl@0
    43
//	 const TUint KwVariantRom0WaitNs		= 150;
sl@0
    44
//	 const TUint KwVariantRom0PageNs		= 30;
sl@0
    45
//	 const TUint KwVariantRom0RecoverNs		= 55;
sl@0
    46
//
sl@0
    47
// - Specific Peripherals (Keyboard, LCD, CODECS, Serial Ports) such as 
sl@0
    48
//	 const TUint KwVariantKeyColLshift		= 7;
sl@0
    49
//	 #define KwVariantLcdBpp				TTemplate::ELcd8BitsPerPixel
sl@0
    50
//   const TUint KwVariantLcdMaxColors		= 4096;
sl@0
    51
//   const TUint KwVariantCodecMaxVolume	= 0;
sl@0
    52
//
sl@0
    53
// - Off-chip hardware control blocks (addresses, register make-up)
sl@0
    54
//
sl@0
    55
// - Interrupts (second-level Interrupt controller base address, register make-up):
sl@0
    56
//   (EXAMPLE ONLY:)
sl@0
    57
const TUint32 KHwVariantPhysBase		=	0x40000000;
sl@0
    58
const TUint32 KHoVariantRegSpacing		=	0x200;
sl@0
    59
sl@0
    60
const TUint32 KHoBaseIntCont			=	0x0B*KHoVariantRegSpacing;
sl@0
    61
sl@0
    62
const TUint32 KHoIntContEnable			=	0x00;		// offsets from KHwVariantPhysBase+KHoBaseIntCont
sl@0
    63
const TUint32 KHoIntContPending			=	0x04;
sl@0
    64
// other Variant and external blocks Base adrress offsets to KHwVariantPhysBase
sl@0
    65
sl@0
    66
sl@0
    67
// TO DO: (optional)
sl@0
    68
//
sl@0
    69
// Enumerate here all Variant (2nd level)  interrupt sources. It could be a good idea to enumerate them in a way that 
sl@0
    70
// facilitates operating on the corresponding interrupt controller registers (e.g using their value as a shift count)
sl@0
    71
//
sl@0
    72
//   (EXAMPLE ONLY:)
sl@0
    73
enum TTemplateInterruptId
sl@0
    74
	{
sl@0
    75
	// the top-level bit is set to distinguish from first level (ASSP) Interrupts
sl@0
    76
	EXIntIdA=0x80000000,
sl@0
    77
	EXIntIdB=0x80000001,
sl@0
    78
	// ...
sl@0
    79
	EXIntIdZ=0x80000019,
sl@0
    80
sl@0
    81
	ENumXInts=0x1A
sl@0
    82
	};
sl@0
    83
sl@0
    84
//
sl@0
    85
// TO DO: (optional)
sl@0
    86
//
sl@0
    87
// Define here some commonly used Variant (2nd level) interrupts
sl@0
    88
//
sl@0
    89
//   (EXAMPLE ONLY:)
sl@0
    90
const TInt KIntIdKeyboard=EXIntIdB;
sl@0
    91
sl@0
    92
class Variant
sl@0
    93
    {
sl@0
    94
	// below is a selection of functions usually implemented  at this level. This do not constitute a mandatory
sl@0
    95
	// set and it might not be relevant for your hardware...
sl@0
    96
public:
sl@0
    97
	/**
sl@0
    98
	 * initialisation
sl@0
    99
	 */
sl@0
   100
	static void Init3();
sl@0
   101
	/**
sl@0
   102
	 * Returns the Linear Base address of the Variant Hardware
sl@0
   103
	 */
sl@0
   104
	IMPORT_C static TUint BaseLinAddress();
sl@0
   105
	/**
sl@0
   106
	 * When invoked, turns off all power supplies
sl@0
   107
	 */
sl@0
   108
	IMPORT_C static void PowerReset();
sl@0
   109
	/**
sl@0
   110
	 * When invoked, it marks the Serial port used for outputting debug strings as requiring re-initialisation
sl@0
   111
	 * As in, for example, the serial port was used by a device driver or the system is coming back from Standby
sl@0
   112
	 */
sl@0
   113
	IMPORT_C static void MarkDebugPortOff();
sl@0
   114
	/**
sl@0
   115
	 * When invoked, initialises the Serial Port hardware for the serial port used to output Debug strings
sl@0
   116
	 * Called by Template::DebugInit()
sl@0
   117
	 */
sl@0
   118
	IMPORT_C static void UartInit();
sl@0
   119
	/**
sl@0
   120
	 * When invoked, read the state of on-board switches
sl@0
   121
	 * @return A bitmask with the state of on-board switches
sl@0
   122
	 */
sl@0
   123
	IMPORT_C static TUint Switches();
sl@0
   124
	// other functions to access hardware not covered by specific device-drivres, which may be called from drivers
sl@0
   125
	// or platform-specifc code
sl@0
   126
	// ...
sl@0
   127
public:
sl@0
   128
	static TUint32 iBaseAddress;
sl@0
   129
	// (optional): May need to have a follower variable to store the value of a read only register initialised at boot time
sl@0
   130
	// static TUint aFollower;
sl@0
   131
    };
sl@0
   132
sl@0
   133
#endif
sl@0
   134