Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
setup.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2006 Atmel Corporation
3  *
4  * Based on linux/include/asm-arm/setup.h
5  * Copyright (C) 1997-1999 Russell King
6  *
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.
10  */
11 #ifndef __ASM_AVR32_SETUP_H__
12 #define __ASM_AVR32_SETUP_H__
13 
14 #include <uapi/asm/setup.h>
15 
16 
17 /* Magic number indicating that a tag table is present */
18 #define ATAG_MAGIC 0xa2a25441
19 
20 #ifndef __ASSEMBLY__
21 
22 /*
23  * Generic memory range, used by several tags.
24  *
25  * addr is always physical.
26  * size is measured in bytes.
27  * next is for use by the OS, e.g. for grouping regions into
28  * linked lists.
29  */
30 struct tag_mem_range {
33  struct tag_mem_range * next;
34 };
35 
36 /* The list ends with an ATAG_NONE node. */
37 #define ATAG_NONE 0x00000000
38 
39 struct tag_header {
42 };
43 
44 /* The list must start with an ATAG_CORE node */
45 #define ATAG_CORE 0x54410001
46 
47 struct tag_core {
51 };
52 
53 /* it is allowed to have multiple ATAG_MEM nodes */
54 #define ATAG_MEM 0x54410002
55 /* ATAG_MEM uses tag_mem_range */
56 
57 /* command line: \0 terminated string */
58 #define ATAG_CMDLINE 0x54410003
59 
60 struct tag_cmdline {
61  char cmdline[1]; /* this is the minimum size */
62 };
63 
64 /* Ramdisk image (may be compressed) */
65 #define ATAG_RDIMG 0x54410004
66 /* ATAG_RDIMG uses tag_mem_range */
67 
68 /* Information about various clocks present in the system */
69 #define ATAG_CLOCK 0x54410005
70 
71 struct tag_clock {
72  u32 clock_id; /* Which clock are we talking about? */
73  u32 clock_flags; /* Special features */
74  u64 clock_hz; /* Clock speed in Hz */
75 };
76 
77 /* The clock types we know about */
78 #define CLOCK_BOOTCPU 0
79 
80 /* Memory reserved for the system (e.g. the bootloader) */
81 #define ATAG_RSVD_MEM 0x54410006
82 /* ATAG_RSVD_MEM uses tag_mem_range */
83 
84 /* Ethernet information */
85 
86 #define ATAG_ETHERNET 0x54410007
87 
88 struct tag_ethernet {
92 };
93 
94 #define ETH_INVALID_PHY 0xff
95 
96 /* board information */
97 #define ATAG_BOARDINFO 0x54410008
98 
99 struct tag_boardinfo {
101 };
102 
103 struct tag {
104  struct tag_header hdr;
105  union {
106  struct tag_core core;
108  struct tag_cmdline cmdline;
109  struct tag_clock clock;
112  } u;
113 };
114 
115 struct tagtable {
117  int (*parse)(struct tag *);
118 };
119 
120 #define __tag __used __attribute__((__section__(".taglist.init")))
121 #define __tagtable(tag, fn) \
122  static struct tagtable __tagtable_##fn __tag = { tag, fn }
123 
124 #define tag_member_present(tag,member) \
125  ((unsigned long)(&((struct tag *)0L)->member + 1) \
126  <= (tag)->hdr.size * 4)
127 
128 #define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
129 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
130 
131 #define for_each_tag(t,base) \
132  for (t = base; t->hdr.size; t = tag_next(t))
133 
134 extern struct tag *bootloader_tags;
135 
138 extern u32 board_number;
139 
140 void setup_processor(void);
141 
142 #endif /* !__ASSEMBLY__ */
143 
144 #endif /* __ASM_AVR32_SETUP_H__ */