aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-10-29 10:28:07 -0400
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2008-01-25 02:31:41 -0500
commit438ff3f3cc33833206a48492e9d6674e4e82bed8 (patch)
tree5159b43453c6a86949798af889d3cb0200818b74
parent281ef58ccf62eaa6c4e4b7e4c0a3ee6b52e84e5b (diff)
[AVR32] Add support for AT32AP7001 and AT32AP7002
These are derivatives of the AT32AP7000 chip, which means that most of the code stays the same. Rename a few files, functions, definitions and config symbols to reflect that they apply to all AP700x chips, and exclude some platform devices from chips where they aren't present. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
-rw-r--r--arch/avr32/Kconfig21
-rw-r--r--arch/avr32/Makefile2
-rw-r--r--arch/avr32/boards/atngw100/setup.c2
-rw-r--r--arch/avr32/configs/atngw100_defconfig9
-rw-r--r--arch/avr32/configs/atstk1002_defconfig8
-rw-r--r--arch/avr32/mach-at32ap/Kconfig12
-rw-r--r--arch/avr32/mach-at32ap/Makefile4
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c (renamed from arch/avr32/mach-at32ap/at32ap7000.c)14
-rw-r--r--drivers/watchdog/Kconfig2
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap700x.h (renamed from include/asm-avr32/arch-at32ap/at32ap7000.h)6
-rw-r--r--include/asm-avr32/arch-at32ap/cpu.h2
-rw-r--r--include/asm-avr32/arch-at32ap/io.h4
12 files changed, 58 insertions, 28 deletions
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 767a19cfa423..e37e6b92658d 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -84,13 +84,26 @@ config PLATFORM_AT32AP
84 select MMU 84 select MMU
85 select PERFORMANCE_COUNTERS 85 select PERFORMANCE_COUNTERS
86 86
87config CPU_AT32AP700X
88 bool
89 select PLATFORM_AT32AP
90
87choice 91choice
88 prompt "AVR32 CPU type" 92 prompt "AVR32 CPU type"
89 default CPU_AT32AP7000 93 default CPU_AT32AP7000
90 94
91config CPU_AT32AP7000 95config CPU_AT32AP7000
92 bool "AT32AP7000" 96 bool "AT32AP7000"
93 select PLATFORM_AT32AP 97 select CPU_AT32AP700X
98
99config CPU_AT32AP7001
100 bool "AT32AP7001"
101 select CPU_AT32AP700X
102
103config CPU_AT32AP7002
104 bool "AT32AP7002"
105 select CPU_AT32AP700X
106
94endchoice 107endchoice
95 108
96# 109#
@@ -126,15 +139,15 @@ source "arch/avr32/mach-at32ap/Kconfig"
126 139
127config LOAD_ADDRESS 140config LOAD_ADDRESS
128 hex 141 hex
129 default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y 142 default 0x10000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y
130 143
131config ENTRY_ADDRESS 144config ENTRY_ADDRESS
132 hex 145 hex
133 default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y 146 default 0x90000000 if LOADER_U_BOOT=y && CPU_AT32AP700X=y
134 147
135config PHYS_OFFSET 148config PHYS_OFFSET
136 hex 149 hex
137 default 0x10000000 if CPU_AT32AP7000=y 150 default 0x10000000 if CPU_AT32AP700X=y
138 151
139source "kernel/Kconfig.preempt" 152source "kernel/Kconfig.preempt"
140 153
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile
index f75d52cd2a4c..17a3529341dd 100644
--- a/arch/avr32/Makefile
+++ b/arch/avr32/Makefile
@@ -16,7 +16,7 @@ KBUILD_AFLAGS += -mrelax -mno-pic
16CFLAGS_MODULE += -mno-relax 16CFLAGS_MODULE += -mno-relax
17LDFLAGS_vmlinux += --relax 17LDFLAGS_vmlinux += --relax
18 18
19cpuflags-$(CONFIG_CPU_AT32AP7000) += -mcpu=ap7000 19cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap
20 20
21KBUILD_CFLAGS += $(cpuflags-y) 21KBUILD_CFLAGS += $(cpuflags-y)
22KBUILD_AFLAGS += $(cpuflags-y) 22KBUILD_AFLAGS += $(cpuflags-y)
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 52987c81d668..a398be284966 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -20,7 +20,7 @@
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/setup.h> 21#include <asm/setup.h>
22 22
23#include <asm/arch/at32ap7000.h> 23#include <asm/arch/at32ap700x.h>
24#include <asm/arch/board.h> 24#include <asm/arch/board.h>
25#include <asm/arch/init.h> 25#include <asm/arch/init.h>
26#include <asm/arch/portmux.h> 26#include <asm/arch/portmux.h>
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig
index b799a68ffd97..374c17bcc05e 100644
--- a/arch/avr32/configs/atngw100_defconfig
+++ b/arch/avr32/configs/atngw100_defconfig
@@ -111,7 +111,10 @@ CONFIG_SUBARCH_AVR32B=y
111CONFIG_MMU=y 111CONFIG_MMU=y
112CONFIG_PERFORMANCE_COUNTERS=y 112CONFIG_PERFORMANCE_COUNTERS=y
113CONFIG_PLATFORM_AT32AP=y 113CONFIG_PLATFORM_AT32AP=y
114CONFIG_CPU_AT32AP700X=y
114CONFIG_CPU_AT32AP7000=y 115CONFIG_CPU_AT32AP7000=y
116# CONFIG_CPU_AT32AP7001 is not set
117# CONFIG_CPU_AT32AP7002 is not set
115# CONFIG_BOARD_ATSTK1000 is not set 118# CONFIG_BOARD_ATSTK1000 is not set
116CONFIG_BOARD_ATNGW100=y 119CONFIG_BOARD_ATNGW100=y
117CONFIG_LOADER_U_BOOT=y 120CONFIG_LOADER_U_BOOT=y
@@ -119,9 +122,9 @@ CONFIG_LOADER_U_BOOT=y
119# 122#
120# Atmel AVR32 AP options 123# Atmel AVR32 AP options
121# 124#
122# CONFIG_AP7000_32_BIT_SMC is not set 125# CONFIG_AP700X_32_BIT_SMC is not set
123CONFIG_AP7000_16_BIT_SMC=y 126CONFIG_AP700X_16_BIT_SMC=y
124# CONFIG_AP7000_8_BIT_SMC is not set 127# CONFIG_AP700X_8_BIT_SMC is not set
125CONFIG_LOAD_ADDRESS=0x10000000 128CONFIG_LOAD_ADDRESS=0x10000000
126CONFIG_ENTRY_ADDRESS=0x90000000 129CONFIG_ENTRY_ADDRESS=0x90000000
127CONFIG_PHYS_OFFSET=0x10000000 130CONFIG_PHYS_OFFSET=0x10000000
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig
index 3b977fdbaa78..7614c5465cd6 100644
--- a/arch/avr32/configs/atstk1002_defconfig
+++ b/arch/avr32/configs/atstk1002_defconfig
@@ -114,6 +114,8 @@ CONFIG_MMU=y
114CONFIG_PERFORMANCE_COUNTERS=y 114CONFIG_PERFORMANCE_COUNTERS=y
115CONFIG_PLATFORM_AT32AP=y 115CONFIG_PLATFORM_AT32AP=y
116CONFIG_CPU_AT32AP7000=y 116CONFIG_CPU_AT32AP7000=y
117# CONFIG_CPU_AT32AP7001 is not set
118# CONFIG_CPU_AT32AP7002 is not set
117CONFIG_BOARD_ATSTK1002=y 119CONFIG_BOARD_ATSTK1002=y
118CONFIG_BOARD_ATSTK1000=y 120CONFIG_BOARD_ATSTK1000=y
119# CONFIG_BOARD_ATNGW100 is not set 121# CONFIG_BOARD_ATNGW100 is not set
@@ -122,9 +124,9 @@ CONFIG_LOADER_U_BOOT=y
122# 124#
123# Atmel AVR32 AP options 125# Atmel AVR32 AP options
124# 126#
125# CONFIG_AP7000_32_BIT_SMC is not set 127# CONFIG_AP700X_32_BIT_SMC is not set
126CONFIG_AP7000_16_BIT_SMC=y 128CONFIG_AP700X_16_BIT_SMC=y
127# CONFIG_AP7000_8_BIT_SMC is not set 129# CONFIG_AP700X_8_BIT_SMC is not set
128CONFIG_LOAD_ADDRESS=0x10000000 130CONFIG_LOAD_ADDRESS=0x10000000
129CONFIG_ENTRY_ADDRESS=0x90000000 131CONFIG_ENTRY_ADDRESS=0x90000000
130CONFIG_PHYS_OFFSET=0x10000000 132CONFIG_PHYS_OFFSET=0x10000000
diff --git a/arch/avr32/mach-at32ap/Kconfig b/arch/avr32/mach-at32ap/Kconfig
index eb307838457b..a7bbcc82058e 100644
--- a/arch/avr32/mach-at32ap/Kconfig
+++ b/arch/avr32/mach-at32ap/Kconfig
@@ -3,9 +3,9 @@ if PLATFORM_AT32AP
3menu "Atmel AVR32 AP options" 3menu "Atmel AVR32 AP options"
4 4
5choice 5choice
6 prompt "AT32AP7000 static memory bus width" 6 prompt "AT32AP700x static memory bus width"
7 depends on CPU_AT32AP7000 7 depends on CPU_AT32AP700X
8 default AP7000_16_BIT_SMC 8 default AP700X_16_BIT_SMC
9 help 9 help
10 Define the width of the AP7000 external static memory interface. 10 Define the width of the AP7000 external static memory interface.
11 This is used to determine how to mangle the address and/or data 11 This is used to determine how to mangle the address and/or data
@@ -15,13 +15,13 @@ choice
15 width for all chip selects, excluding the flash (which is using 15 width for all chip selects, excluding the flash (which is using
16 raw access and is thus not affected by any of this.) 16 raw access and is thus not affected by any of this.)
17 17
18config AP7000_32_BIT_SMC 18config AP700X_32_BIT_SMC
19 bool "32 bit" 19 bool "32 bit"
20 20
21config AP7000_16_BIT_SMC 21config AP700X_16_BIT_SMC
22 bool "16 bit" 22 bool "16 bit"
23 23
24config AP7000_8_BIT_SMC 24config AP700X_8_BIT_SMC
25 bool "8 bit" 25 bool "8 bit"
26 26
27endchoice 27endchoice
diff --git a/arch/avr32/mach-at32ap/Makefile b/arch/avr32/mach-at32ap/Makefile
index a8b445046e3e..5e9f8217befc 100644
--- a/arch/avr32/mach-at32ap/Makefile
+++ b/arch/avr32/mach-at32ap/Makefile
@@ -1,4 +1,4 @@
1obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o 1obj-y += at32ap.o clock.o intc.o extint.o pio.o hsmc.o
2obj-$(CONFIG_CPU_AT32AP7000) += at32ap7000.o 2obj-$(CONFIG_CPU_AT32AP700X) += at32ap700x.o
3obj-$(CONFIG_CPU_AT32AP7000) += time-tc.o 3obj-$(CONFIG_CPU_AT32AP700X) += time-tc.o
4obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o 4obj-$(CONFIG_CPU_FREQ_AT32AP) += cpufreq.o
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 7c4388f4f17f..9386e1f82fb8 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -14,7 +14,7 @@
14 14
15#include <asm/io.h> 15#include <asm/io.h>
16 16
17#include <asm/arch/at32ap7000.h> 17#include <asm/arch/at32ap700x.h>
18#include <asm/arch/board.h> 18#include <asm/arch/board.h>
19#include <asm/arch/portmux.h> 19#include <asm/arch/portmux.h>
20 20
@@ -803,6 +803,7 @@ void __init at32_setup_serial_console(unsigned int usart_id)
803 * Ethernet 803 * Ethernet
804 * -------------------------------------------------------------------- */ 804 * -------------------------------------------------------------------- */
805 805
806#ifdef CONFIG_CPU_AT32AP7000
806static struct eth_platform_data macb0_data; 807static struct eth_platform_data macb0_data;
807static struct resource macb0_resource[] = { 808static struct resource macb0_resource[] = {
808 PBMEM(0xfff01800), 809 PBMEM(0xfff01800),
@@ -890,6 +891,7 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
890 891
891 return pdev; 892 return pdev;
892} 893}
894#endif
893 895
894/* -------------------------------------------------------------------- 896/* --------------------------------------------------------------------
895 * SPI 897 * SPI
@@ -1064,6 +1066,7 @@ err_add_resources:
1064/* -------------------------------------------------------------------- 1066/* --------------------------------------------------------------------
1065 * LCDC 1067 * LCDC
1066 * -------------------------------------------------------------------- */ 1068 * -------------------------------------------------------------------- */
1069#if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002)
1067static struct atmel_lcdfb_info atmel_lcdfb0_data; 1070static struct atmel_lcdfb_info atmel_lcdfb0_data;
1068static struct resource atmel_lcdfb0_resource[] = { 1071static struct resource atmel_lcdfb0_resource[] = {
1069 { 1072 {
@@ -1179,6 +1182,7 @@ err_dup_modedb:
1179 kfree(monspecs); 1182 kfree(monspecs);
1180 return NULL; 1183 return NULL;
1181} 1184}
1185#endif
1182 1186
1183/* -------------------------------------------------------------------- 1187/* --------------------------------------------------------------------
1184 * SSC 1188 * SSC
@@ -1332,6 +1336,7 @@ out_free_pdev:
1332/* -------------------------------------------------------------------- 1336/* --------------------------------------------------------------------
1333 * IDE / CompactFlash 1337 * IDE / CompactFlash
1334 * -------------------------------------------------------------------- */ 1338 * -------------------------------------------------------------------- */
1339#if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7001)
1335static struct resource at32_smc_cs4_resource[] __initdata = { 1340static struct resource at32_smc_cs4_resource[] __initdata = {
1336 { 1341 {
1337 .start = 0x04000000, 1342 .start = 0x04000000,
@@ -1464,6 +1469,7 @@ fail:
1464 platform_device_put(pdev); 1469 platform_device_put(pdev);
1465 return NULL; 1470 return NULL;
1466} 1471}
1472#endif
1467 1473
1468/* -------------------------------------------------------------------- 1474/* --------------------------------------------------------------------
1469 * AC97C 1475 * AC97C
@@ -1639,16 +1645,20 @@ struct clk *at32_clock_list[] = {
1639 &atmel_usart1_usart, 1645 &atmel_usart1_usart,
1640 &atmel_usart2_usart, 1646 &atmel_usart2_usart,
1641 &atmel_usart3_usart, 1647 &atmel_usart3_usart,
1648#if defined(CONFIG_CPU_AT32AP7000)
1642 &macb0_hclk, 1649 &macb0_hclk,
1643 &macb0_pclk, 1650 &macb0_pclk,
1644 &macb1_hclk, 1651 &macb1_hclk,
1645 &macb1_pclk, 1652 &macb1_pclk,
1653#endif
1646 &atmel_spi0_spi_clk, 1654 &atmel_spi0_spi_clk,
1647 &atmel_spi1_spi_clk, 1655 &atmel_spi1_spi_clk,
1648 &atmel_twi0_pclk, 1656 &atmel_twi0_pclk,
1649 &atmel_mci0_pclk, 1657 &atmel_mci0_pclk,
1658#if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002)
1650 &atmel_lcdfb0_hck1, 1659 &atmel_lcdfb0_hck1,
1651 &atmel_lcdfb0_pixclk, 1660 &atmel_lcdfb0_pixclk,
1661#endif
1652 &ssc0_pclk, 1662 &ssc0_pclk,
1653 &ssc1_pclk, 1663 &ssc1_pclk,
1654 &ssc2_pclk, 1664 &ssc2_pclk,
@@ -1697,7 +1707,9 @@ void __init at32_clock_init(void)
1697 genclk_init_parent(&gclk2); 1707 genclk_init_parent(&gclk2);
1698 genclk_init_parent(&gclk3); 1708 genclk_init_parent(&gclk3);
1699 genclk_init_parent(&gclk4); 1709 genclk_init_parent(&gclk4);
1710#if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002)
1700 genclk_init_parent(&atmel_lcdfb0_pixclk); 1711 genclk_init_parent(&atmel_lcdfb0_pixclk);
1712#endif
1701 genclk_init_parent(&abdac0_sample_clk); 1713 genclk_init_parent(&abdac0_sample_clk);
1702 1714
1703 /* 1715 /*
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 52dff40ec192..fbd61127b9d9 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -223,7 +223,7 @@ config DAVINCI_WATCHDOG
223 223
224config AT32AP700X_WDT 224config AT32AP700X_WDT
225 tristate "AT32AP700x watchdog" 225 tristate "AT32AP700x watchdog"
226 depends on CPU_AT32AP7000 226 depends on CPU_AT32AP700X
227 help 227 help
228 Watchdog timer embedded into AT32AP700x devices. This will reboot 228 Watchdog timer embedded into AT32AP700x devices. This will reboot
229 your system when the timeout is reached. 229 your system when the timeout is reached.
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap700x.h
index 3914d7b94ff4..99684d6f3967 100644
--- a/include/asm-avr32/arch-at32ap/at32ap7000.h
+++ b/include/asm-avr32/arch-at32ap/at32ap700x.h
@@ -7,8 +7,8 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#ifndef __ASM_ARCH_AT32AP7000_H__ 10#ifndef __ASM_ARCH_AT32AP700X_H__
11#define __ASM_ARCH_AT32AP7000_H__ 11#define __ASM_ARCH_AT32AP700X_H__
12 12
13#define GPIO_PERIPH_A 0 13#define GPIO_PERIPH_A 0
14#define GPIO_PERIPH_B 1 14#define GPIO_PERIPH_B 1
@@ -32,4 +32,4 @@
32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N)) 32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N)) 33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
34 34
35#endif /* __ASM_ARCH_AT32AP7000_H__ */ 35#endif /* __ASM_ARCH_AT32AP700X_H__ */
diff --git a/include/asm-avr32/arch-at32ap/cpu.h b/include/asm-avr32/arch-at32ap/cpu.h
index a762f42cbb71..0dc20261c1ea 100644
--- a/include/asm-avr32/arch-at32ap/cpu.h
+++ b/include/asm-avr32/arch-at32ap/cpu.h
@@ -14,7 +14,7 @@
14 * Only AT32AP7000 is defined for now. We can identify the specific 14 * Only AT32AP7000 is defined for now. We can identify the specific
15 * chip at runtime, but I'm not sure if it's really worth it. 15 * chip at runtime, but I'm not sure if it's really worth it.
16 */ 16 */
17#ifdef CONFIG_CPU_AT32AP7000 17#ifdef CONFIG_CPU_AT32AP700X
18# define cpu_is_at32ap7000() (1) 18# define cpu_is_at32ap7000() (1)
19#else 19#else
20# define cpu_is_at32ap7000() (0) 20# define cpu_is_at32ap7000() (0)
diff --git a/include/asm-avr32/arch-at32ap/io.h b/include/asm-avr32/arch-at32ap/io.h
index ee59e401f041..4ec6abc68ea3 100644
--- a/include/asm-avr32/arch-at32ap/io.h
+++ b/include/asm-avr32/arch-at32ap/io.h
@@ -4,7 +4,7 @@
4/* For "bizarre" halfword swapping */ 4/* For "bizarre" halfword swapping */
5#include <linux/byteorder/swabb.h> 5#include <linux/byteorder/swabb.h>
6 6
7#if defined(CONFIG_AP7000_32_BIT_SMC) 7#if defined(CONFIG_AP700X_32_BIT_SMC)
8# define __swizzle_addr_b(addr) (addr ^ 3UL) 8# define __swizzle_addr_b(addr) (addr ^ 3UL)
9# define __swizzle_addr_w(addr) (addr ^ 2UL) 9# define __swizzle_addr_w(addr) (addr ^ 2UL)
10# define __swizzle_addr_l(addr) (addr) 10# define __swizzle_addr_l(addr) (addr)
@@ -14,7 +14,7 @@
14# define __mem_ioswabb(a, x) (x) 14# define __mem_ioswabb(a, x) (x)
15# define __mem_ioswabw(a, x) swab16(x) 15# define __mem_ioswabw(a, x) swab16(x)
16# define __mem_ioswabl(a, x) swab32(x) 16# define __mem_ioswabl(a, x) swab32(x)
17#elif defined(CONFIG_AP7000_16_BIT_SMC) 17#elif defined(CONFIG_AP700X_16_BIT_SMC)
18# define __swizzle_addr_b(addr) (addr ^ 1UL) 18# define __swizzle_addr_b(addr) (addr ^ 1UL)
19# define __swizzle_addr_w(addr) (addr) 19# define __swizzle_addr_w(addr) (addr)
20# define __swizzle_addr_l(addr) (addr) 20# define __swizzle_addr_l(addr) (addr)