navienginebsp/naviengine_assp/highrestimer.h
author Cheng-Shiun Tsai <cheng-shiun.tsai@accenture.com>
Fri, 08 Oct 2010 14:36:55 +0100
changeset 4 5937e08d5244
parent 0 5de814552237
permissions -rw-r--r--
Implement new version of DNE1_TBPowerResourceController::DoRegisterStaticResources, to fix Bug 3803
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     1
/*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     8
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    11
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    12
* Contributors:
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    13
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    14
* Description:  
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    15
* Defintions for High resolution timer
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    16
*
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    17
*/
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    18
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    19
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    20
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    21
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    22
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    23
#ifndef __HIGHRESTIMER_H__
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    24
#define __HIGHRESTIMER_H__
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    25
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    26
/**
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    27
 * Macro indicating that a high resolution timer is supported.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    28
 */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    29
#define HAS_HIGH_RES_TIMER
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    30
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    31
#ifdef __MEMMODEL_DIRECT__
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    32
#define HIGH_RES_COUNT_HW_ADDR 0x18036800	/* address of timer 2 counter */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    33
#else
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    34
#define HIGH_RES_COUNT_HW_ADDR 0xC6003800	/* address of timer 2 counter */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    35
#endif
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    36
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    37
/**
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    38
 * Assembler macro to get the the current value of the high res timer and place
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    39
 * it in the specified register.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    40
 */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    41
#define GET_HIGH_RES_TICK_COUNT(Rd) \
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    42
	asm("ldr	"#Rd", = %a0" : : "i" (HIGH_RES_COUNT_HW_ADDR)); \
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    43
	asm("ldr	"#Rd", ["#Rd"]")
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    44
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    45
/**
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    46
 * The frequency of the timer in Hz.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    47
 */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    48
const TInt KHighResTimerFrequency = 2083333; // 200MHz/(3*32)
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    49
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    50
/**
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    51
 * Macro indicating that the timer counts up if defined.
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    52
 */
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    53
#define HIGH_RES_TIMER_COUNTS_UP
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    54
5de814552237 Initial contribution supporting NaviEngine 1
Ryan Harkin <ryan.harkin@nokia.com>
parents:
diff changeset
    55
#endif