os/kernelhwsrv/kernel/eka/include/memmodel/epoc/moving/arm/mmboot.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
// e32\include\memmodel\epoc\moving\arm\mmboot.h
sl@0
    15
// 
sl@0
    16
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    17
//          to change without notice. Such APIs should therefore not be used
sl@0
    18
//          outside the Kernel and Hardware Services package.
sl@0
    19
//
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
 @publishedPartner
sl@0
    24
 @released
sl@0
    25
*/
sl@0
    26
sl@0
    27
#ifndef __MMBOOT_H__
sl@0
    28
#define __MMBOOT_H__
sl@0
    29
#include <arm.h>
sl@0
    30
#include <memmodel.h>
sl@0
    31
#include <kernel/cache.h>
sl@0
    32
sl@0
    33
//
sl@0
    34
// Linear address map:
sl@0
    35
// 00000000-003FFFFF	Unmapped
sl@0
    36
// 00400000-2FFFFFFF	Moving process data
sl@0
    37
// 30000000-3FFFFFFF	DLL static data (=phys ram size/2 up to 128M, always ends at 40000000)
sl@0
    38
// 40000000-5FFFFFFF	RAM drive
sl@0
    39
// 60000000-60001FFF	Super page/CPU page
sl@0
    40
// 60030000-600303FF	KPageInfoMap
sl@0
    41
// 60038000-6003FFFF	IRQ, FIQ, UND, ABT stacks (4*4K for stacks + 4*4K for guard pages) 
sl@0
    42
// 61000000-61003FFF	Page directory (16K)
sl@0
    43
// 61020000-6103FFFF	Page table info (4096 * 8bytes = 32K)
sl@0
    44
// 61100000-611FFFFF	Cache flush area
sl@0
    45
// 61200000-612FFFFF	Alternate cache flush area
sl@0
    46
// 62000000-623FFFFF	Page tables (up to 4096 * 1K)
sl@0
    47
// 63000000-63FFFFFF	Primary I/O mappings
sl@0
    48
// 64000000-64FFFFFF	Kernel .data/.bss, initial stack, kernel heap
sl@0
    49
// 65000000-655FFFFF	fixed processes - usually 2 or 3Mb each.
sl@0
    50
// 65600000-F1FFFFFF	Kernel section (includes extra I/O mappings)
sl@0
    51
// F0000000-F1FFFFFF	Kernel code (RAM size/2)
sl@0
    52
// F2000000-F5FFFFFF	User code (RAM size)
sl@0
    53
// F6000000-F7FFFFFF	Page Info array
sl@0
    54
// F8000000-FFEFFFFF	ROM
sl@0
    55
// FFF00000-FFFFFFFF	Exception vectors
sl@0
    56
//
sl@0
    57
sl@0
    58
// Linear addresses
sl@0
    59
const TLinAddr	KDataSectionBase		=0x00400000u;
sl@0
    60
const TLinAddr	KDataSectionEnd			=0x40000000u;
sl@0
    61
const TLinAddr	KRamDriveStartAddress	=0x40000000u;
sl@0
    62
const TInt		KRamDriveMaxSize		=0x20000000;
sl@0
    63
const TLinAddr	KRamDriveEndAddress		=0x60000000u;
sl@0
    64
sl@0
    65
const TLinAddr	KPageInfoLinearBase		=0xF6000000u;
sl@0
    66
sl@0
    67
const TLinAddr	KRomLinearBase			=0xF8000000u;
sl@0
    68
const TLinAddr	KRomLinearEnd			=0xFFF00000u;
sl@0
    69
const TLinAddr	KSuperPageLinAddr		=0x60000000u;
sl@0
    70
const TLinAddr  KExcptStacksLinearBase	=0x60038000u;
sl@0
    71
const TLinAddr	KPageDirectoryBase		=0x61000000u;
sl@0
    72
const TLinAddr	KPageTableInfoBase		=0x61020000u;
sl@0
    73
const TLinAddr	KPageTableBase			=0x62000000u;
sl@0
    74
const TLinAddr	KPrimaryIOBase			=0x63000000u;
sl@0
    75
const TLinAddr  KKernelDataBase			=0x64000000u;
sl@0
    76
const TLinAddr  KKernelDataEnd			=0x65000000u;
sl@0
    77
const TLinAddr	KKernelSectionEnd		=0xFFF00000u;	// we always use HIVECS
sl@0
    78
sl@0
    79
const TLinAddr	KMachineConfigLinAddr	=0x60000800u;
sl@0
    80
const TLinAddr	KDummyUncachedAddr		=0x6000F000u;
sl@0
    81
const TLinAddr	KTempAddr				=0x60010000u;
sl@0
    82
const TLinAddr	KSecondTempAddr			=0x60014000u;
sl@0
    83
const TLinAddr	KDefragAltStackAddr		=0x6001F000u;
sl@0
    84
const TLinAddr	KPageInfoMap			=0x60030000u;
sl@0
    85
sl@0
    86
const TLinAddr	KDCacheFlushArea		=0x61100000u;
sl@0
    87
const TInt		KDCacheFlushAreaLimit	=0x00080000;	// 512k
sl@0
    88
const TLinAddr	KAltDCacheFlushArea		=0x61200000u;
sl@0
    89
const TInt		KAltDCacheFlushAreaLimit=0x00080000;	// 512k
sl@0
    90
sl@0
    91
// Constants for ARM MMU
sl@0
    92
const TInt KPageShift=12;
sl@0
    93
const TInt KPageSize=1<<KPageShift;
sl@0
    94
const TInt KPageMask=KPageSize-1;
sl@0
    95
const TInt KChunkShift=20;
sl@0
    96
const TInt KChunkSize=1<<KChunkShift;
sl@0
    97
const TInt KChunkMask=KChunkSize-1;
sl@0
    98
const TInt KPageTableShift=KChunkShift-KPageShift+2;	// PTE is 4 bytes
sl@0
    99
const TInt KPageTableSize=1<<KPageTableShift;
sl@0
   100
const TInt KPageTableMask=KPageTableSize-1;
sl@0
   101
const TInt KPtClusterShift=KPageShift-KPageTableShift;
sl@0
   102
const TInt KPtClusterSize=1<<KPtClusterShift;
sl@0
   103
const TInt KPtClusterMask=KPtClusterSize-1;
sl@0
   104
const TInt KPtBlockShift=KPageShift-3;					/**< @internalTechnology */	// sizeof(SPageTableInfo)=8
sl@0
   105
const TInt KPtBlockSize=1<<KPtBlockShift;				/**< @internalTechnology */
sl@0
   106
const TInt KPtBlockMask=KPtBlockSize-1;					/**< @internalTechnology */
sl@0
   107
const TInt KPagesInPDEShift=KChunkShift-KPageShift;
sl@0
   108
const TInt KPagesInPDE=1<<KPagesInPDEShift;
sl@0
   109
const TInt KPagesInPDEMask=KPagesInPDE-1;
sl@0
   110
const TInt KLargePageShift=16;
sl@0
   111
const TInt KLargePageSize=1<<KLargePageShift;
sl@0
   112
const TInt KLargePageMask=KLargePageSize-1;
sl@0
   113
sl@0
   114
const TInt KPageDirectoryShift=32-KChunkShift+2;		// PDE is 4 bytes
sl@0
   115
const TInt KPageDirectorySize=1<<KPageDirectoryShift;
sl@0
   116
const TInt KPageDirectoryMask=KPageDirectorySize-1;
sl@0
   117
sl@0
   118
const TPde KPdePresentMask=3;
sl@0
   119
const TPde KPdeTypeMask=0x3;
sl@0
   120
const TPde KPdeSectionAddrMask=0xfff00000;
sl@0
   121
const TPde KPdePageTableAddrMask=0xfffffc00;
sl@0
   122
const TPte KPteLargePageAddrMask=0xffff0000;
sl@0
   123
const TPte KPteSmallPageAddrMask=0xfffff000;
sl@0
   124
const TInt KLargeSmallPageRatio=KLargePageSize/KPageSize;
sl@0
   125
const TPde KPdeNotPresentEntry=0;
sl@0
   126
const TPte KPteNotPresentEntry=0;
sl@0
   127
const TPte KPtePresentMask=0x3;
sl@0
   128
const TPte KPteTypeMask=0x3;
sl@0
   129
sl@0
   130
sl@0
   131
// Domain usage
sl@0
   132
//
sl@0
   133
/** @internalComponent */
sl@0
   134
enum TArmDomain
sl@0
   135
	{
sl@0
   136
	EDomainVarUserRun=0,
sl@0
   137
	EDomainClient=1,
sl@0
   138
	EDomainPageTable=2,
sl@0
   139
	EDomainRamDrive=3,
sl@0
   140
sl@0
   141
	ENumDomains=16
sl@0
   142
	};
sl@0
   143
sl@0
   144
// default domain access is 0=manager, 1=client, 2,3=no access, 4-15=client
sl@0
   145
const TUint32 KDefaultDomainAccess			 = 0x55555507u;	/**< @internalComponent */
sl@0
   146
const TUint32 KSupervisorInitialDomainAccess = 0x55555557u;	/**< @internalTechnology */
sl@0
   147
sl@0
   148
const TUint32 KManzanoTTBRExtraBits		=0x00000018;	/**< @internalTechnology On Manzano, page table walk is L2 cachable*/
sl@0
   149
sl@0
   150
const TInt KPageInfoShift = 5;
sl@0
   151
sl@0
   152
const TInt KAbtStackSize=KPageSize;		/**< @internalComponent */
sl@0
   153
const TInt KUndStackSize=KPageSize;		/**< @internalComponent */
sl@0
   154
const TInt KIrqStackSize=KPageSize;		/**< @internalComponent */
sl@0
   155
const TInt KFiqStackSize=KPageSize;		/**< @internalComponent */
sl@0
   156
sl@0
   157
#endif	// __MMBOOT_H__