Sync up ArmPkg with patch from mailing list. Changed name of BdsLib.h to BdsUnixLib...
[mirror_edk2.git] / ArmPkg / Include / Chipset / ARM926EJ-S.h
CommitLineData
2ef2b01e
A
1/** @file\r
2\r
d6ebcab7 3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
2ef2b01e 4\r
d6ebcab7 5 This program and the accompanying materials\r
2ef2b01e
A
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __ARM926EJ_S_H__\r
16#define __ARM926EJ_S_H__\r
17\r
18// Domain Access Control Register\r
19#define DOMAIN_ACCESS_CONTROL_MASK(a) (3UL << (2 * (a)))\r
20#define DOMAIN_ACCESS_CONTROL_NONE(a) (0UL << (2 * (a)))\r
21#define DOMAIN_ACCESS_CONTROL_CLIENT(a) (1UL << (2 * (a)))\r
22#define DOMAIN_ACCESS_CONTROL_RESERVED(a) (2UL << (2 * (a)))\r
23#define DOMAIN_ACCESS_CONTROL_MANAGER(a) (3UL << (2 * (a)))\r
24\r
25#define TRANSLATION_TABLE_SIZE (16 * 1024)\r
26#define TRANSLATION_TABLE_ALIGNMENT (16 * 1024)\r
27#define TRANSLATION_TABLE_ALIGNMENT_MASK (TRANSLATION_TABLE_ALIGNMENT - 1)\r
28\r
29#define TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(table, address) ((UINT32 *)(table) + (((UINTN)(address)) >> 20))\r
30\r
31// Translation table descriptor types\r
32#define TT_DESCRIPTOR_TYPE_MASK (3UL << 0)\r
33#define TT_DESCRIPTOR_TYPE_FAULT (0UL << 0)\r
34#define TT_DESCRIPTOR_TYPE_COARSE ((1UL << 0) | (1UL << 4))\r
35#define TT_DESCRIPTOR_TYPE_SECTION ((2UL << 0) | (1UL << 4))\r
36#define TT_DESCRIPTOR_TYPE_FINE ((3UL << 0) | (1UL << 4))\r
37\r
38// Section descriptor definitions\r
39#define TT_DESCRIPTOR_SECTION_SIZE (0x00100000)\r
40\r
41#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_MASK (3UL << 2)\r
42#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_UNCACHED_UNBUFFERED (0UL << 2)\r
43#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_UNCACHED_BUFFERED (1UL << 2)\r
44#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH (2UL << 2)\r
45#define TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK (3UL << 2)\r
46\r
47#define TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_MASK (3UL << 10)\r
48#define TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_NONE (1UL << 10)\r
49#define TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_ONLY (2UL << 10)\r
50#define TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE (3UL << 10)\r
51\r
52#define TT_DESCRIPTOR_SECTION_DOMAIN_MASK (0x0FUL << 5)\r
53#define TT_DESCRIPTOR_SECTION_DOMAIN(a) (((a) & 0xF) << 5)\r
54\r
55#define TT_DESCRIPTOR_SECTION_BASE_ADDRESS_MASK (0xFFF00000)\r
56#define TT_DESCRIPTOR_SECTION_BASE_ADDRESS(a) (a & TT_DESCRIPTOR_SECTION_BASE_ADDRESS_MASK)\r
57\r
58#define TT_DESCRIPTOR_SECTION_WRITE_BACK (TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE | \\r
59 TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
60 TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK | \\r
61 TT_DESCRIPTOR_TYPE_SECTION) \r
62#define TT_DESCRIPTOR_SECTION_WRITE_THROUGH (TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE | \\r
63 TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
64 TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH | \\r
65 TT_DESCRIPTOR_TYPE_SECTION)\r
66#define TT_DESCRIPTOR_SECTION_UNCACHED_UNBUFFERED (TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE | \\r
67 TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
68 TT_DESCRIPTOR_SECTION_CACHE_POLICY_UNCACHED_UNBUFFERED | \\r
69 TT_DESCRIPTOR_TYPE_SECTION)\r
70\r
71#endif // __ARM926EJ_S_H__\r