3 * Copyright (c) 2011, ARM Limited. All rights reserved.
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
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.
15 #ifndef __BDSLINUXLOADER_H
16 #define __BDSLINUXLOADER_H
18 #define ATAG_MAX_SIZE 0x4000
19 //PcdKernelParamsMaxMemorySize
21 /* ATAG : list of possible tags */
22 #define ATAG_NONE 0x00000000
23 #define ATAG_CORE 0x54410001
24 #define ATAG_MEM 0x54410002
25 #define ATAG_VIDEOTEXT 0x54410003
26 #define ATAG_RAMDISK 0x54410004
27 #define ATAG_INITRD2 0x54420005
28 #define ATAG_SERIAL 0x54410006
29 #define ATAG_REVISION 0x54410007
30 #define ATAG_VIDEOLFB 0x54410008
31 #define ATAG_CMDLINE 0x54410009
32 #define ATAG_ARM_MP_CORE 0x5441000A
34 // Some system addresses
35 // These should probably come from the platform header file or from pcd values
36 #define DRAM_BASE 0x10000000
37 #define ZIMAGE_LOAD_ADDRESS (DRAM_BASE + 0x8000)
38 #define INITRD_LOAD_ADDRESS (DRAM_BASE + 0x800000)
40 #define SIZE_1B 0x00000001
41 #define SIZE_2B 0x00000002
42 #define SIZE_4B 0x00000004
43 #define SIZE_8B 0x00000008
44 #define SIZE_16B 0x00000010
45 #define SIZE_32B 0x00000020
46 #define SIZE_64B 0x00000040
47 #define SIZE_128B 0x00000080
48 #define SIZE_256B 0x00000100
49 #define SIZE_512B 0x00000200
50 #define SIZE_1KB 0x00000400
51 #define SIZE_2KB 0x00000800
52 #define SIZE_4KB 0x00001000
53 #define SIZE_8KB 0x00002000
54 #define SIZE_16KB 0x00004000
55 #define SIZE_32KB 0x00008000
56 #define SIZE_64KB 0x00010000
57 #define SIZE_128KB 0x00020000
58 #define SIZE_256KB 0x00040000
59 #define SIZE_512KB 0x00080000
60 #define SIZE_1MB 0x00100000
61 #define SIZE_2MB 0x00200000
62 #define SIZE_4MB 0x00400000
63 #define SIZE_8MB 0x00800000
64 #define SIZE_16MB 0x01000000
65 #define SIZE_32MB 0x02000000
66 #define SIZE_64MB 0x04000000
67 #define SIZE_100MB 0x06400000
68 #define SIZE_128MB 0x08000000
69 #define SIZE_256MB 0x10000000
70 #define SIZE_512MB 0x20000000
71 #define SIZE_1GB 0x40000000
72 #define SIZE_2GB 0x80000000
74 /* structures for each atag */
76 UINT32 size
; /* length of tag in words including this header */
77 UINT32 type
; /* tag type */
91 struct atag_videotext
{
103 struct atag_ramdisk
{
109 struct atag_initrd2
{
114 struct atag_serialnr
{
119 struct atag_revision
{
123 struct atag_videolfb
{
127 UINT16 lfb_linelength
;
140 struct atag_cmdline
{
145 struct atag_header header
;
147 struct atag_core core_tag
;
148 struct atag_mem mem_tag
;
149 struct atag_videotext videotext_tag
;
150 struct atag_ramdisk ramdisk_tag
;
151 struct atag_initrd2 initrd2_tag
;
152 struct atag_serialnr serialnr_tag
;
153 struct atag_revision revision_tag
;
154 struct atag_videolfb videolfb_tag
;
155 struct atag_cmdline cmdline_tag
;
159 #define next_tag_address(t) ((struct atag *)((UINT32)(t) + (((t)->header.size) << 2) ))
160 #define tag_size(type) ((UINT32)((sizeof(struct atag_header) + sizeof(struct type)) >> 2))
162 STATIC
struct atag
*Params
; /* used to point at the current tag */