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