2 * Copyright (C) 2004-2006 Atmel Corporation
4 * Based on linux/include/asm-arm/setup.h
5 * Copyright (C) 1997-1999 Russel King
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #ifndef __ASM_AVR32_SETUP_H__
26 #define __ASM_AVR32_SETUP_H__
28 #define COMMAND_LINE_SIZE 256
30 /* Magic number indicating that a tag table is present */
31 #define ATAG_MAGIC 0xa2a25441
36 * Generic memory range, used by several tags.
38 * addr is always physical.
39 * size is measured in bytes.
40 * next is for use by the OS, e.g. for grouping regions into
43 struct tag_mem_range {
46 struct tag_mem_range * next;
49 /* The list ends with an ATAG_NONE node. */
50 #define ATAG_NONE 0x00000000
57 /* The list must start with an ATAG_CORE node */
58 #define ATAG_CORE 0x54410001
66 /* it is allowed to have multiple ATAG_MEM nodes */
67 #define ATAG_MEM 0x54410002
68 /* ATAG_MEM uses tag_mem_range */
70 /* command line: \0 terminated string */
71 #define ATAG_CMDLINE 0x54410003
74 char cmdline[1]; /* this is the minimum size */
77 /* Ramdisk image (may be compressed) */
78 #define ATAG_RDIMG 0x54410004
79 /* ATAG_RDIMG uses tag_mem_range */
81 /* Information about various clocks present in the system */
82 #define ATAG_CLOCK 0x54410005
85 u32 clock_id; /* Which clock are we talking about? */
86 u32 clock_flags; /* Special features */
87 u64 clock_hz; /* Clock speed in Hz */
90 /* The clock types we know about */
91 #define ACLOCK_BOOTCPU 0 /* The CPU we're booting from */
92 #define ACLOCK_HSB 1 /* Deprecated */
94 /* Memory reserved for the system (e.g. the bootloader) */
95 #define ATAG_RSVD_MEM 0x54410006
96 /* ATAG_RSVD_MEM uses tag_mem_range */
98 /* Ethernet information */
100 #define ATAG_ETHERNET 0x54410007
102 struct tag_ethernet {
108 #define AETH_INVALID_PHY 0xff
111 struct tag_header hdr;
113 struct tag_core core;
114 struct tag_mem_range mem_range;
115 struct tag_cmdline cmdline;
116 struct tag_clock clock;
117 struct tag_ethernet ethernet;
123 int (*parse)(struct tag *);
126 #define __tag __attribute_used__ __attribute__((__section__(".taglist")))
127 #define __tagtable(tag, fn) \
128 static struct tagtable __tagtable_##fn __tag = { tag, fn }
130 #define tag_member_present(tag,member) \
131 ((unsigned long)(&((struct tag *)0L)->member + 1) \
132 <= (tag)->hdr.size * 4)
134 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
135 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
137 #define for_each_tag(t,base) \
138 for (t = base; t->hdr.size; t = tag_next(t))
140 #endif /* !__ASSEMBLY__ */
142 #endif /* __ASM_AVR32_SETUP_H__ */