2 * Copyright (C) 2004-2006 Atmel Corporation
4 * Based on linux/include/asm-arm/setup.h
5 * Copyright (C) 1997-1999 Russel King
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #ifndef __ASM_AVR32_SETUP_H__
12 #define __ASM_AVR32_SETUP_H__
14 #define COMMAND_LINE_SIZE 256
16 /* Magic number indicating that a tag table is present */
17 #define ATAG_MAGIC 0xa2a25441
22 * Generic memory range, used by several tags.
24 * addr is always physical.
25 * size is measured in bytes.
26 * next is for use by the OS, e.g. for grouping regions into
29 struct tag_mem_range {
32 struct tag_mem_range * next;
35 /* The list ends with an ATAG_NONE node. */
36 #define ATAG_NONE 0x00000000
43 /* The list must start with an ATAG_CORE node */
44 #define ATAG_CORE 0x54410001
52 /* it is allowed to have multiple ATAG_MEM nodes */
53 #define ATAG_MEM 0x54410002
54 /* ATAG_MEM uses tag_mem_range */
56 /* command line: \0 terminated string */
57 #define ATAG_CMDLINE 0x54410003
60 char cmdline[1]; /* this is the minimum size */
63 /* Ramdisk image (may be compressed) */
64 #define ATAG_RDIMG 0x54410004
65 /* ATAG_RDIMG uses tag_mem_range */
67 /* Information about various clocks present in the system */
68 #define ATAG_CLOCK 0x54410005
71 u32 clock_id; /* Which clock are we talking about? */
72 u32 clock_flags; /* Special features */
73 u64 clock_hz; /* Clock speed in Hz */
76 /* The clock types we know about */
77 #define CLOCK_BOOTCPU 0
79 /* Memory reserved for the system (e.g. the bootloader) */
80 #define ATAG_RSVD_MEM 0x54410006
81 /* ATAG_RSVD_MEM uses tag_mem_range */
83 /* Ethernet information */
85 #define ATAG_ETHERNET 0x54410007
93 #define ETH_INVALID_PHY 0xff
96 struct tag_header hdr;
99 struct tag_mem_range mem_range;
100 struct tag_cmdline cmdline;
101 struct tag_clock clock;
102 struct tag_ethernet ethernet;
108 int (*parse)(struct tag *);
111 #define __tag __attribute_used__ __attribute__((__section__(".taglist")))
112 #define __tagtable(tag, fn) \
113 static struct tagtable __tagtable_##fn __tag = { tag, fn }
115 #define tag_member_present(tag,member) \
116 ((unsigned long)(&((struct tag *)0L)->member + 1) \
117 <= (tag)->hdr.size * 4)
119 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
120 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
122 #define for_each_tag(t,base) \
123 for (t = base; t->hdr.size; t = tag_next(t))
125 extern struct tag_mem_range *mem_phys;
126 extern struct tag_mem_range *mem_reserved;
127 extern struct tag_mem_range *mem_ramdisk;
129 extern struct tag *bootloader_tags;
131 extern void setup_bootmem(void);
132 extern void setup_processor(void);
133 extern void board_setup_fbmem(unsigned long fbmem_start,
134 unsigned long fbmem_size);
136 /* Chip-specific hook to enable the use of SDRAM */
137 void chip_enable_sdram(void);
139 #endif /* !__ASSEMBLY__ */
141 #endif /* __ASM_AVR32_SETUP_H__ */