os/kernelhwsrv/bsptemplate/asspandvariant/template_assp/template_assp_priv.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
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_assp\template_assp_priv.h
sl@0
    15
// Template ASSP architecture private header file
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 __KA_TEMPLATE_H__
sl@0
    23
#define __KA_TEMPLATE_H__
sl@0
    24
#include <e32const.h>
sl@0
    25
#include <arm.h>
sl@0
    26
#include <assp.h>
sl@0
    27
#include <template_assp.h>
sl@0
    28
sl@0
    29
// Example only
sl@0
    30
const TInt KNumTemplateInts=EAsspIntIdZ+1;
sl@0
    31
sl@0
    32
class TemplateInterrupt : public Interrupt
sl@0
    33
	{
sl@0
    34
public:
sl@0
    35
	/**
sl@0
    36
	 * These functions are required to initialise the Interrupt controller,or perform housekeeping
sl@0
    37
	 * functions, or dispatch the incoming IRQ or FIQ interrupts.
sl@0
    38
	 */
sl@0
    39
sl@0
    40
	/**
sl@0
    41
	 * initialisation
sl@0
    42
	 */
sl@0
    43
	static void Init1();
sl@0
    44
	static void Init3();
sl@0
    45
	/**
sl@0
    46
	 * IRQ/FIQ dispatchers
sl@0
    47
	 */
sl@0
    48
	static void IrqDispatch();
sl@0
    49
	static void FiqDispatch();
sl@0
    50
	/**
sl@0
    51
	 * Housekeeping (disable and clear all hardware interrupt sources)
sl@0
    52
	 */
sl@0
    53
	static void DisableAndClearAll();
sl@0
    54
	/**
sl@0
    55
	 * Empty interrupt handler
sl@0
    56
	 */
sl@0
    57
	static void Spurious(TAny* anId);
sl@0
    58
public:
sl@0
    59
	static SInterruptHandler Handlers[KNumTemplateInts];
sl@0
    60
	};
sl@0
    61
sl@0
    62
class TemplateAssp : public Asic
sl@0
    63
	{
sl@0
    64
public:
sl@0
    65
	IMPORT_C TemplateAssp();
sl@0
    66
sl@0
    67
public:
sl@0
    68
	/**
sl@0
    69
	 * These are the mandatory Asic class functions which are implemented here rather than in the Variant.
sl@0
    70
	 * It makes sense having an ASSP class when there is functionality at Variant/Core level which is common
sl@0
    71
	 * to a group of devices and is provided by an IP block(s) which is likely to be used in future generations
sl@0
    72
	 * of the same family of devices.
sl@0
    73
	 * In general the common functionality includes first-level Interrupt controllers, Power and Reset controllers,
sl@0
    74
	 * and timing functions
sl@0
    75
	 */
sl@0
    76
sl@0
    77
	/**
sl@0
    78
	 * initialisation
sl@0
    79
	 */
sl@0
    80
	IMPORT_C virtual void Init1();
sl@0
    81
	IMPORT_C virtual void Init3();
sl@0
    82
	/**
sl@0
    83
	 * Read and return the Startup reason of the Super Page (set up by Bootstrap)
sl@0
    84
	 * @return A TMachineStartupType enumerated value
sl@0
    85
	 * @see TMachineStartupType
sl@0
    86
	 */
sl@0
    87
	IMPORT_C virtual TMachineStartupType StartupReason();
sl@0
    88
sl@0
    89
	/**
sl@0
    90
	 * timing functions
sl@0
    91
	 */
sl@0
    92
sl@0
    93
	/**
sl@0
    94
	 * Obtain the period of System Tick timer in microseconds
sl@0
    95
	 * @return Period of System Tick timer in microseconds
sl@0
    96
	 */
sl@0
    97
	IMPORT_C virtual TInt MsTickPeriod();
sl@0
    98
	/**
sl@0
    99
	 * Obtain System Time from the RTC
sl@0
   100
	 * @return System Time in seconds from 00:00 hours of 1/1/2000
sl@0
   101
	 */
sl@0
   102
	IMPORT_C virtual TInt SystemTimeInSecondsFrom2000(TInt& aTime);
sl@0
   103
	/**
sl@0
   104
	 * Obtain Adjust the RTC with new System Time (from 00:00 hours of 1/1/2000)
sl@0
   105
	 * @return System wide error code
sl@0
   106
	 */
sl@0
   107
	IMPORT_C virtual TInt SetSystemTimeInSecondsFrom2000(TInt aTime);
sl@0
   108
	/**
sl@0
   109
	 * Obtain the time it takes to execute two processor instructions
sl@0
   110
	 * @return Time in nanoseconds it takes two execute 2 instructions at the processor clock speed
sl@0
   111
	 */
sl@0
   112
	IMPORT_C virtual TUint32 NanoWaitCalibration();
sl@0
   113
sl@0
   114
public:
sl@0
   115
	/**
sl@0
   116
	 * for derivation by Variant
sl@0
   117
	 */
sl@0
   118
sl@0
   119
	/**
sl@0
   120
	 * external interrupt handling
sl@0
   121
	 * used by second-level interrupt controllers at Variant level
sl@0
   122
	 */
sl@0
   123
	virtual TInt InterruptBind(TInt anId, TIsr anIsr, TAny* aPtr)=0;
sl@0
   124
	virtual TInt InterruptUnbind(TInt anId)=0;
sl@0
   125
	virtual TInt InterruptEnable(TInt anId)=0;
sl@0
   126
	virtual TInt InterruptDisable(TInt anId)=0;
sl@0
   127
	virtual TInt InterruptClear(TInt anId)=0;
sl@0
   128
sl@0
   129
	/**
sl@0
   130
	 * USB client controller - Some example functions for the case that USB cable detection and
sl@0
   131
	 * UDC connect/disconnect functionality are part of the Variant.
sl@0
   132
	 * Pure virtual functions called by the USB PSL, to be implemented by the Variant (derived class).
sl@0
   133
	 * If this functionality is part of the ASSP then these functions can be removed and calls to them
sl@0
   134
	 * in the PSL (./pa_usbc.cpp) replaced by the appropriate internal operations.
sl@0
   135
	 */
sl@0
   136
	virtual TBool UsbClientConnectorDetectable()=0;
sl@0
   137
	virtual TBool UsbClientConnectorInserted()=0;
sl@0
   138
	virtual TInt RegisterUsbClientConnectorCallback(TInt (*aCallback)(TAny*), TAny* aPtr)=0;
sl@0
   139
	virtual void UnregisterUsbClientConnectorCallback()=0;
sl@0
   140
	virtual TBool UsbSoftwareConnectable()=0;
sl@0
   141
	virtual TInt UsbConnect()=0;
sl@0
   142
	virtual TInt UsbDisconnect()=0;
sl@0
   143
sl@0
   144
	/**
sl@0
   145
	 * miscellaneous
sl@0
   146
	 */
sl@0
   147
	virtual TInt VideoRamSize()=0;
sl@0
   148
sl@0
   149
public:
sl@0
   150
	static TemplateAssp* Variant;
sl@0
   151
	static TPhysAddr VideoRamPhys;
sl@0
   152
	NTimerQ* iTimerQ;
sl@0
   153
	};
sl@0
   154
sl@0
   155
#endif