source: mainline/boot/arch/arm32/include/mm.h@ aaae6d9

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since aaae6d9 was 8f9d70b, checked in by Beniamino Galvani <b.galvani@…>, 12 years ago

Initial support for Raspberry Pi

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2 * Copyright (c) 2007 Pavel Jancik
3 * Copyright (c) 2007 Michal Kebrt
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup arm32boot
31 * @{
32 */
33/** @file
34 * @brief Memory management used while booting the kernel.
35 *
36 * So called "section" paging is used while booting the kernel. The term
37 * "section" comes from the ARM architecture specification and stands for the
38 * following: one-level paging, 1MB sized pages, 4096 entries in the page
39 * table.
40 */
41
42#ifndef BOOT_arm32__MM_H
43#define BOOT_arm32__MM_H
44
45#include <typedefs.h>
46
47/** Describe "section" page table entry (one-level paging with 1 MB sized pages). */
48#define PTE_DESCRIPTOR_SECTION 0x02
49/** Shift of memory address in section descriptor */
50#define PTE_SECTION_SHIFT 20
51
52/** Page table access rights: user - no access, kernel - read/write. */
53#define PTE_AP_USER_NO_KERNEL_RW 0x01
54
55/** Start of memory mapped I/O area for GTA02 */
56#define GTA02_IOMEM_START 0x48000000
57/** End of memory mapped I/O area for GTA02 */
58#define GTA02_IOMEM_END 0x60000000
59
60/** Start of ram memory on BBxM */
61#define BBXM_RAM_START 0x80000000
62/** Start of ram memory on BBxM */
63#define BBXM_RAM_END 0xc0000000
64
65/** Start of ram memory on AM335x */
66#define AM335x_RAM_START 0x80000000
67/** End of ram memory on AM335x */
68#define AM335x_RAM_END 0xC0000000
69
70/** Start of ram memory on BCM2835 */
71#define BCM2835_RAM_START 0
72/** End of ram memory on BCM2835 */
73#define BCM2835_RAM_END 0x20000000
74
75/* Page table level 0 entry - "section" format is used
76 * (one-level paging, 1 MB sized pages). Used only while booting the kernel.
77 */
78typedef struct {
79 unsigned int descriptor_type : 2;
80 unsigned int bufferable : 1;
81 unsigned int cacheable : 1;
82 unsigned int xn : 1;
83 unsigned int domain : 4;
84 unsigned int should_be_zero_1 : 1;
85 unsigned int access_permission_0 : 2;
86 unsigned int tex : 3;
87 unsigned int access_permission_1 : 1;
88 unsigned int shareable : 1;
89 unsigned int non_global : 1;
90 unsigned int should_be_zero_2 : 1;
91 unsigned int non_secure : 1;
92 unsigned int section_base_addr : 12;
93} __attribute__((packed)) pte_level0_section_t;
94
95extern void mmu_start(void);
96
97#endif
98
99/** @}
100 */
Note: See TracBrowser for help on using the repository browser.