diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2006-09-26 02:32:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:54 -0400 |
commit | 5f97f7f9400de47ae837170bb274e90ad3934386 (patch) | |
tree | 514451e6dc6b46253293a00035d375e77b1c65ed /include/asm-avr32/setup.h | |
parent | 53e62d3aaa60590d4a69b4e07c29f448b5151047 (diff) |
[PATCH] avr32 architecture
This adds support for the Atmel AVR32 architecture as well as the AT32AP7000
CPU and the AT32STK1000 development board.
AVR32 is a new high-performance 32-bit RISC microprocessor core, designed for
cost-sensitive embedded applications, with particular emphasis on low power
consumption and high code density. The AVR32 architecture is not binary
compatible with earlier 8-bit AVR architectures.
The AVR32 architecture, including the instruction set, is described by the
AVR32 Architecture Manual, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf
The Atmel AT32AP7000 is the first CPU implementing the AVR32 architecture. It
features a 7-stage pipeline, 16KB instruction and data caches and a full
Memory Management Unit. It also comes with a large set of integrated
peripherals, many of which are shared with the AT91 ARM-based controllers from
Atmel.
Full data sheet is available from
http://www.atmel.com/dyn/resources/prod_documents/doc32003.pdf
while the CPU core implementation including caches and MMU is documented by
the AVR32 AP Technical Reference, available from
http://www.atmel.com/dyn/resources/prod_documents/doc32001.pdf
Information about the AT32STK1000 development board can be found at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3918
including a BSP CD image with an earlier version of this patch, development
tools (binaries and source/patches) and a root filesystem image suitable for
booting from SD card.
Alternatively, there's a preliminary "getting started" guide available at
http://avr32linux.org/twiki/bin/view/Main/GettingStarted which provides links
to the sources and patches you will need in order to set up a cross-compiling
environment for avr32-linux.
This patch, as well as the other patches included with the BSP and the
toolchain patches, is actively supported by Atmel Corporation.
[dmccr@us.ibm.com: Fix more pxx_page macro locations]
[bunk@stusta.de: fix `make defconfig']
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave McCracken <dmccr@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-avr32/setup.h')
-rw-r--r-- | include/asm-avr32/setup.h | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/include/asm-avr32/setup.h b/include/asm-avr32/setup.h new file mode 100644 index 000000000000..10193da4113b --- /dev/null +++ b/include/asm-avr32/setup.h | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * Based on linux/include/asm-arm/setup.h | ||
5 | * Copyright (C) 1997-1999 Russel 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 | #define COMMAND_LINE_SIZE 256 | ||
15 | |||
16 | /* Magic number indicating that a tag table is present */ | ||
17 | #define ATAG_MAGIC 0xa2a25441 | ||
18 | |||
19 | #ifndef __ASSEMBLY__ | ||
20 | |||
21 | /* | ||
22 | * Generic memory range, used by several tags. | ||
23 | * | ||
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 | ||
27 | * linked lists. | ||
28 | */ | ||
29 | struct tag_mem_range { | ||
30 | u32 addr; | ||
31 | u32 size; | ||
32 | struct tag_mem_range * next; | ||
33 | }; | ||
34 | |||
35 | /* The list ends with an ATAG_NONE node. */ | ||
36 | #define ATAG_NONE 0x00000000 | ||
37 | |||
38 | struct tag_header { | ||
39 | u32 size; | ||
40 | u32 tag; | ||
41 | }; | ||
42 | |||
43 | /* The list must start with an ATAG_CORE node */ | ||
44 | #define ATAG_CORE 0x54410001 | ||
45 | |||
46 | struct tag_core { | ||
47 | u32 flags; | ||
48 | u32 pagesize; | ||
49 | u32 rootdev; | ||
50 | }; | ||
51 | |||
52 | /* it is allowed to have multiple ATAG_MEM nodes */ | ||
53 | #define ATAG_MEM 0x54410002 | ||
54 | /* ATAG_MEM uses tag_mem_range */ | ||
55 | |||
56 | /* command line: \0 terminated string */ | ||
57 | #define ATAG_CMDLINE 0x54410003 | ||
58 | |||
59 | struct tag_cmdline { | ||
60 | char cmdline[1]; /* this is the minimum size */ | ||
61 | }; | ||
62 | |||
63 | /* Ramdisk image (may be compressed) */ | ||
64 | #define ATAG_RDIMG 0x54410004 | ||
65 | /* ATAG_RDIMG uses tag_mem_range */ | ||
66 | |||
67 | /* Information about various clocks present in the system */ | ||
68 | #define ATAG_CLOCK 0x54410005 | ||
69 | |||
70 | struct tag_clock { | ||
71 | u32 clock_id; /* Which clock are we talking about? */ | ||
72 | u32 clock_flags; /* Special features */ | ||
73 | u64 clock_hz; /* Clock speed in Hz */ | ||
74 | }; | ||
75 | |||
76 | /* The clock types we know about */ | ||
77 | #define CLOCK_BOOTCPU 0 | ||
78 | |||
79 | /* Memory reserved for the system (e.g. the bootloader) */ | ||
80 | #define ATAG_RSVD_MEM 0x54410006 | ||
81 | /* ATAG_RSVD_MEM uses tag_mem_range */ | ||
82 | |||
83 | /* Ethernet information */ | ||
84 | |||
85 | #define ATAG_ETHERNET 0x54410007 | ||
86 | |||
87 | struct tag_ethernet { | ||
88 | u8 mac_index; | ||
89 | u8 mii_phy_addr; | ||
90 | u8 hw_address[6]; | ||
91 | }; | ||
92 | |||
93 | #define ETH_INVALID_PHY 0xff | ||
94 | |||
95 | struct tag { | ||
96 | struct tag_header hdr; | ||
97 | union { | ||
98 | struct tag_core core; | ||
99 | struct tag_mem_range mem_range; | ||
100 | struct tag_cmdline cmdline; | ||
101 | struct tag_clock clock; | ||
102 | struct tag_ethernet ethernet; | ||
103 | } u; | ||
104 | }; | ||
105 | |||
106 | struct tagtable { | ||
107 | u32 tag; | ||
108 | int (*parse)(struct tag *); | ||
109 | }; | ||
110 | |||
111 | #define __tag __attribute_used__ __attribute__((__section__(".taglist"))) | ||
112 | #define __tagtable(tag, fn) \ | ||
113 | static struct tagtable __tagtable_##fn __tag = { tag, fn } | ||
114 | |||
115 | #define tag_member_present(tag,member) \ | ||
116 | ((unsigned long)(&((struct tag *)0L)->member + 1) \ | ||
117 | <= (tag)->hdr.size * 4) | ||
118 | |||
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) | ||
121 | |||
122 | #define for_each_tag(t,base) \ | ||
123 | for (t = base; t->hdr.size; t = tag_next(t)) | ||
124 | |||
125 | extern struct tag_mem_range *mem_phys; | ||
126 | extern struct tag_mem_range *mem_reserved; | ||
127 | extern struct tag_mem_range *mem_ramdisk; | ||
128 | |||
129 | extern struct tag *bootloader_tags; | ||
130 | |||
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); | ||
135 | |||
136 | /* Chip-specific hook to enable the use of SDRAM */ | ||
137 | void chip_enable_sdram(void); | ||
138 | |||
139 | #endif /* !__ASSEMBLY__ */ | ||
140 | |||
141 | #endif /* __ASM_AVR32_SETUP_H__ */ | ||