]>
Commit | Line | Data |
---|---|---|
1bfda055 | 1 | /** @file |
2 | * | |
3 | * Copyright (c) 2011, ARM Limited. All rights reserved. | |
4 | * | |
5 | * This program and the accompanying materials | |
6 | * are licensed and made available under the terms and conditions of the BSD License | |
7 | * which accompanies this distribution. The full text of the license may be found at | |
8 | * http://opensource.org/licenses/bsd-license.php | |
9 | * | |
10 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
11 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
12 | * | |
13 | **/ | |
14 | ||
15 | #ifndef __BDSLINUXLOADER_H | |
16 | #define __BDSLINUXLOADER_H | |
17 | ||
a355a365 | 18 | #define ATAG_MAX_SIZE 0x3000 |
1bfda055 | 19 | |
20 | /* ATAG : list of possible tags */ | |
21 | #define ATAG_NONE 0x00000000 | |
22 | #define ATAG_CORE 0x54410001 | |
23 | #define ATAG_MEM 0x54410002 | |
24 | #define ATAG_VIDEOTEXT 0x54410003 | |
25 | #define ATAG_RAMDISK 0x54410004 | |
26 | #define ATAG_INITRD2 0x54420005 | |
27 | #define ATAG_SERIAL 0x54410006 | |
28 | #define ATAG_REVISION 0x54410007 | |
29 | #define ATAG_VIDEOLFB 0x54410008 | |
30 | #define ATAG_CMDLINE 0x54410009 | |
31 | #define ATAG_ARM_MP_CORE 0x5441000A | |
32 | ||
1bfda055 | 33 | /* structures for each atag */ |
a355a365 | 34 | typedef struct { |
1bfda055 | 35 | UINT32 size; /* length of tag in words including this header */ |
36 | UINT32 type; /* tag type */ | |
a355a365 | 37 | } LINUX_ATAG_HEADER; |
1bfda055 | 38 | |
a355a365 | 39 | typedef struct { |
1bfda055 | 40 | UINT32 flags; |
41 | UINT32 pagesize; | |
42 | UINT32 rootdev; | |
a355a365 | 43 | } LINUX_ATAG_CORE; |
1bfda055 | 44 | |
a355a365 | 45 | typedef struct { |
1bfda055 | 46 | UINT32 size; |
47 | UINTN start; | |
a355a365 | 48 | } LINUX_ATAG_MEM; |
1bfda055 | 49 | |
a355a365 | 50 | typedef struct { |
1bfda055 | 51 | UINT8 x; |
52 | UINT8 y; | |
53 | UINT16 video_page; | |
54 | UINT8 video_mode; | |
55 | UINT8 video_cols; | |
56 | UINT16 video_ega_bx; | |
57 | UINT8 video_lines; | |
58 | UINT8 video_isvga; | |
59 | UINT16 video_points; | |
a355a365 | 60 | } LINUX_ATAG_VIDEOTEXT; |
1bfda055 | 61 | |
a355a365 | 62 | typedef struct { |
1bfda055 | 63 | UINT32 flags; |
64 | UINT32 size; | |
65 | UINTN start; | |
a355a365 | 66 | } LINUX_ATAG_RAMDISK; |
1bfda055 | 67 | |
a355a365 | 68 | typedef struct { |
1bfda055 | 69 | UINT32 start; |
70 | UINT32 size; | |
a355a365 | 71 | } LINUX_ATAG_INITRD2; |
1bfda055 | 72 | |
a355a365 | 73 | typedef struct { |
1bfda055 | 74 | UINT32 low; |
75 | UINT32 high; | |
a355a365 | 76 | } LINUX_ATAG_SERIALNR; |
1bfda055 | 77 | |
a355a365 | 78 | typedef struct { |
1bfda055 | 79 | UINT32 rev; |
a355a365 | 80 | } LINUX_ATAG_REVISION; |
1bfda055 | 81 | |
a355a365 | 82 | typedef struct { |
1bfda055 | 83 | UINT16 lfb_width; |
84 | UINT16 lfb_height; | |
85 | UINT16 lfb_depth; | |
86 | UINT16 lfb_linelength; | |
87 | UINT32 lfb_base; | |
88 | UINT32 lfb_size; | |
89 | UINT8 red_size; | |
90 | UINT8 red_pos; | |
91 | UINT8 green_size; | |
92 | UINT8 green_pos; | |
93 | UINT8 blue_size; | |
94 | UINT8 blue_pos; | |
95 | UINT8 rsvd_size; | |
96 | UINT8 rsvd_pos; | |
a355a365 | 97 | } LINUX_ATAG_VIDEOLFB; |
1bfda055 | 98 | |
a355a365 | 99 | typedef struct { |
1bfda055 | 100 | CHAR8 cmdline[1]; |
a355a365 | 101 | } LINUX_ATAG_CMDLINE; |
1bfda055 | 102 | |
a355a365 | 103 | typedef struct { |
104 | LINUX_ATAG_HEADER header; | |
1bfda055 | 105 | union { |
a355a365 | 106 | LINUX_ATAG_CORE core_tag; |
107 | LINUX_ATAG_MEM mem_tag; | |
108 | LINUX_ATAG_VIDEOTEXT videotext_tag; | |
109 | LINUX_ATAG_RAMDISK ramdisk_tag; | |
110 | LINUX_ATAG_INITRD2 initrd2_tag; | |
111 | LINUX_ATAG_SERIALNR serialnr_tag; | |
112 | LINUX_ATAG_REVISION revision_tag; | |
113 | LINUX_ATAG_VIDEOLFB videolfb_tag; | |
114 | LINUX_ATAG_CMDLINE cmdline_tag; | |
1bfda055 | 115 | } body; |
a355a365 | 116 | } LINUX_ATAG; |
1bfda055 | 117 | |
a355a365 | 118 | typedef VOID (*LINUX_KERNEL)(UINT32 Zero, UINT32 Arch, UINTN ParametersBase); |
1bfda055 | 119 | |
a355a365 | 120 | #define next_tag_address(t) ((LINUX_ATAG*)((UINT32)(t) + (((t)->header.size) << 2) )) |
121 | #define tag_size(type) ((UINT32)((sizeof(LINUX_ATAG_HEADER) + sizeof(type)) >> 2)) | |
1bfda055 | 122 | |
123 | #endif |