Linux 4.1.18
[linux/fpc-iii.git] / arch / avr32 / include / asm / setup.h
blob73490ae0c47685773d08c4c502d5d66e9279cf99
1 /*
2 * Copyright (C) 2004-2006 Atmel Corporation
4 * Based on linux/include/asm-arm/setup.h
5 * Copyright (C) 1997-1999 Russell 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 #include <uapi/asm/setup.h>
17 /* Magic number indicating that a tag table is present */
18 #define ATAG_MAGIC 0xa2a25441
20 #ifndef __ASSEMBLY__
23 * Generic memory range, used by several tags.
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.
30 struct tag_mem_range {
31 u32 addr;
32 u32 size;
33 struct tag_mem_range * next;
36 /* The list ends with an ATAG_NONE node. */
37 #define ATAG_NONE 0x00000000
39 struct tag_header {
40 u32 size;
41 u32 tag;
44 /* The list must start with an ATAG_CORE node */
45 #define ATAG_CORE 0x54410001
47 struct tag_core {
48 u32 flags;
49 u32 pagesize;
50 u32 rootdev;
53 /* it is allowed to have multiple ATAG_MEM nodes */
54 #define ATAG_MEM 0x54410002
55 /* ATAG_MEM uses tag_mem_range */
57 /* command line: \0 terminated string */
58 #define ATAG_CMDLINE 0x54410003
60 struct tag_cmdline {
61 char cmdline[1]; /* this is the minimum size */
64 /* Ramdisk image (may be compressed) */
65 #define ATAG_RDIMG 0x54410004
66 /* ATAG_RDIMG uses tag_mem_range */
68 /* Information about various clocks present in the system */
69 #define ATAG_CLOCK 0x54410005
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 */
77 /* The clock types we know about */
78 #define CLOCK_BOOTCPU 0
80 /* Memory reserved for the system (e.g. the bootloader) */
81 #define ATAG_RSVD_MEM 0x54410006
82 /* ATAG_RSVD_MEM uses tag_mem_range */
84 /* Ethernet information */
86 #define ATAG_ETHERNET 0x54410007
88 struct tag_ethernet {
89 u8 mac_index;
90 u8 mii_phy_addr;
91 u8 hw_address[6];
94 #define ETH_INVALID_PHY 0xff
96 /* board information */
97 #define ATAG_BOARDINFO 0x54410008
99 struct tag_boardinfo {
100 u32 board_number;
103 struct tag {
104 struct tag_header hdr;
105 union {
106 struct tag_core core;
107 struct tag_mem_range mem_range;
108 struct tag_cmdline cmdline;
109 struct tag_clock clock;
110 struct tag_ethernet ethernet;
111 struct tag_boardinfo boardinfo;
112 } u;
115 struct tagtable {
116 u32 tag;
117 int (*parse)(struct tag *);
120 #define __tag __used __attribute__((__section__(".taglist.init")))
121 #define __tagtable(tag, fn) \
122 static struct tagtable __tagtable_##fn __tag = { tag, fn }
124 #define tag_member_present(tag,member) \
125 ((unsigned long)(&((struct tag *)0L)->member + 1) \
126 <= (tag)->hdr.size * 4)
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)
131 #define for_each_tag(t,base) \
132 for (t = base; t->hdr.size; t = tag_next(t))
134 extern struct tag *bootloader_tags;
136 extern resource_size_t fbmem_start;
137 extern resource_size_t fbmem_size;
138 extern u32 board_number;
140 void setup_processor(void);
142 #endif /* !__ASSEMBLY__ */
144 #endif /* __ASM_AVR32_SETUP_H__ */