diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-01-26 08:07:09 -0500 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2012-02-03 07:33:05 -0500 |
commit | 9918ceafd4a9e013572e03983f528017c29bb1cb (patch) | |
tree | 90d7885b26b87d27ed4cdb4026e608908e8a8a4c /arch | |
parent | 57225b76864210d667b935c54babf22b6c31336b (diff) |
ARM: at91: code removal of CAP9 SoC
Following removal announce and addition to feature-removal-schedule.txt,
here is the actual source code deletion for Atmel CAP9 family.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch')
23 files changed, 15 insertions, 2580 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a48aecc17eac..92c9c79c140c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -324,7 +324,7 @@ config ARCH_AT91 | |||
324 | select CLKDEV_LOOKUP | 324 | select CLKDEV_LOOKUP |
325 | help | 325 | help |
326 | This enables support for systems based on the Atmel AT91RM9200, | 326 | This enables support for systems based on the Atmel AT91RM9200, |
327 | AT91SAM9 and AT91CAP9 processors. | 327 | AT91SAM9 processors. |
328 | 328 | ||
329 | config ARCH_BCMRING | 329 | config ARCH_BCMRING |
330 | bool "Broadcom BCMRING" | 330 | bool "Broadcom BCMRING" |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 03646c4c13d1..b895a2a92da8 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -86,7 +86,7 @@ choice | |||
86 | depends on HAVE_AT91_DBGU0 | 86 | depends on HAVE_AT91_DBGU0 |
87 | 87 | ||
88 | config AT91_DEBUG_LL_DBGU1 | 88 | config AT91_DEBUG_LL_DBGU1 |
89 | bool "Kernel low-level debugging on 9263, 9g45 and cap9" | 89 | bool "Kernel low-level debugging on 9263 and 9g45" |
90 | depends on HAVE_AT91_DBGU1 | 90 | depends on HAVE_AT91_DBGU1 |
91 | 91 | ||
92 | config DEBUG_CLPS711X_UART1 | 92 | config DEBUG_CLPS711X_UART1 |
diff --git a/arch/arm/configs/at91cap9_defconfig b/arch/arm/configs/at91cap9_defconfig deleted file mode 100644 index 8826eb218e73..000000000000 --- a/arch/arm/configs/at91cap9_defconfig +++ /dev/null | |||
@@ -1,108 +0,0 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
3 | # CONFIG_SWAP is not set | ||
4 | CONFIG_SYSVIPC=y | ||
5 | CONFIG_LOG_BUF_SHIFT=14 | ||
6 | CONFIG_BLK_DEV_INITRD=y | ||
7 | CONFIG_SLAB=y | ||
8 | CONFIG_MODULES=y | ||
9 | CONFIG_MODULE_UNLOAD=y | ||
10 | # CONFIG_BLK_DEV_BSG is not set | ||
11 | # CONFIG_IOSCHED_DEADLINE is not set | ||
12 | # CONFIG_IOSCHED_CFQ is not set | ||
13 | CONFIG_ARCH_AT91=y | ||
14 | CONFIG_ARCH_AT91CAP9=y | ||
15 | CONFIG_MACH_AT91CAP9ADK=y | ||
16 | CONFIG_MTD_AT91_DATAFLASH_CARD=y | ||
17 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
18 | # CONFIG_ARM_THUMB is not set | ||
19 | CONFIG_AEABI=y | ||
20 | CONFIG_LEDS=y | ||
21 | CONFIG_LEDS_CPU=y | ||
22 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
23 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
24 | CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 rw" | ||
25 | CONFIG_FPE_NWFPE=y | ||
26 | CONFIG_NET=y | ||
27 | CONFIG_PACKET=y | ||
28 | CONFIG_UNIX=y | ||
29 | CONFIG_INET=y | ||
30 | CONFIG_IP_PNP=y | ||
31 | CONFIG_IP_PNP_BOOTP=y | ||
32 | CONFIG_IP_PNP_RARP=y | ||
33 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
34 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
35 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
36 | # CONFIG_INET_LRO is not set | ||
37 | # CONFIG_INET_DIAG is not set | ||
38 | # CONFIG_IPV6 is not set | ||
39 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
40 | CONFIG_MTD=y | ||
41 | CONFIG_MTD_CMDLINE_PARTS=y | ||
42 | CONFIG_MTD_CHAR=y | ||
43 | CONFIG_MTD_BLOCK=y | ||
44 | CONFIG_MTD_CFI=y | ||
45 | CONFIG_MTD_JEDECPROBE=y | ||
46 | CONFIG_MTD_CFI_AMDSTD=y | ||
47 | CONFIG_MTD_PHYSMAP=y | ||
48 | CONFIG_MTD_DATAFLASH=y | ||
49 | CONFIG_MTD_NAND=y | ||
50 | CONFIG_MTD_NAND_ATMEL=y | ||
51 | CONFIG_BLK_DEV_LOOP=y | ||
52 | CONFIG_BLK_DEV_RAM=y | ||
53 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
54 | CONFIG_SCSI=y | ||
55 | CONFIG_BLK_DEV_SD=y | ||
56 | CONFIG_SCSI_MULTI_LUN=y | ||
57 | CONFIG_NETDEVICES=y | ||
58 | CONFIG_MII=y | ||
59 | CONFIG_MACB=y | ||
60 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
61 | CONFIG_INPUT_EVDEV=y | ||
62 | # CONFIG_INPUT_KEYBOARD is not set | ||
63 | # CONFIG_INPUT_MOUSE is not set | ||
64 | CONFIG_INPUT_TOUCHSCREEN=y | ||
65 | CONFIG_TOUCHSCREEN_ADS7846=y | ||
66 | # CONFIG_SERIO is not set | ||
67 | CONFIG_SERIAL_ATMEL=y | ||
68 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
69 | CONFIG_HW_RANDOM=y | ||
70 | CONFIG_I2C=y | ||
71 | CONFIG_I2C_CHARDEV=y | ||
72 | CONFIG_SPI=y | ||
73 | CONFIG_SPI_ATMEL=y | ||
74 | # CONFIG_HWMON is not set | ||
75 | CONFIG_WATCHDOG=y | ||
76 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
77 | CONFIG_FB=y | ||
78 | CONFIG_FB_ATMEL=y | ||
79 | CONFIG_LOGO=y | ||
80 | # CONFIG_LOGO_LINUX_MONO is not set | ||
81 | # CONFIG_LOGO_LINUX_CLUT224 is not set | ||
82 | # CONFIG_USB_HID is not set | ||
83 | CONFIG_USB=y | ||
84 | CONFIG_USB_DEVICEFS=y | ||
85 | CONFIG_USB_MON=y | ||
86 | CONFIG_USB_OHCI_HCD=y | ||
87 | CONFIG_USB_STORAGE=y | ||
88 | CONFIG_USB_GADGET=y | ||
89 | CONFIG_USB_ETH=m | ||
90 | CONFIG_USB_FILE_STORAGE=m | ||
91 | CONFIG_MMC=y | ||
92 | CONFIG_MMC_AT91=m | ||
93 | CONFIG_RTC_CLASS=y | ||
94 | CONFIG_RTC_DRV_AT91SAM9=y | ||
95 | CONFIG_EXT2_FS=y | ||
96 | CONFIG_VFAT_FS=y | ||
97 | CONFIG_TMPFS=y | ||
98 | CONFIG_JFFS2_FS=y | ||
99 | CONFIG_CRAMFS=y | ||
100 | CONFIG_NFS_FS=y | ||
101 | CONFIG_ROOT_NFS=y | ||
102 | CONFIG_NLS_CODEPAGE_437=y | ||
103 | CONFIG_NLS_CODEPAGE_850=y | ||
104 | CONFIG_NLS_ISO8859_1=y | ||
105 | CONFIG_DEBUG_FS=y | ||
106 | CONFIG_DEBUG_KERNEL=y | ||
107 | CONFIG_DEBUG_INFO=y | ||
108 | CONFIG_DEBUG_USER=y | ||
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 71feb00a1e99..0284e66c47f9 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -102,15 +102,6 @@ config ARCH_AT91SAM9G45 | |||
102 | select HAVE_AT91_DBGU1 | 102 | select HAVE_AT91_DBGU1 |
103 | select AT91_SAM9G45_RESET | 103 | select AT91_SAM9G45_RESET |
104 | 104 | ||
105 | config ARCH_AT91CAP9 | ||
106 | bool "AT91CAP9" | ||
107 | select CPU_ARM926T | ||
108 | select GENERIC_CLOCKEVENTS | ||
109 | select HAVE_FB_ATMEL | ||
110 | select HAVE_NET_MACB | ||
111 | select HAVE_AT91_DBGU1 | ||
112 | select AT91_SAM9G45_RESET | ||
113 | |||
114 | config ARCH_AT91X40 | 105 | config ARCH_AT91X40 |
115 | bool "AT91x40" | 106 | bool "AT91x40" |
116 | select ARCH_USES_GETTIMEOFFSET | 107 | select ARCH_USES_GETTIMEOFFSET |
@@ -447,21 +438,6 @@ endif | |||
447 | 438 | ||
448 | # ---------------------------------------------------------- | 439 | # ---------------------------------------------------------- |
449 | 440 | ||
450 | if ARCH_AT91CAP9 | ||
451 | |||
452 | comment "AT91CAP9 Board Type" | ||
453 | |||
454 | config MACH_AT91CAP9ADK | ||
455 | bool "Atmel AT91CAP9A-DK Evaluation Kit" | ||
456 | select HAVE_AT91_DATAFLASH_CARD | ||
457 | help | ||
458 | Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. | ||
459 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> | ||
460 | |||
461 | endif | ||
462 | |||
463 | # ---------------------------------------------------------- | ||
464 | |||
465 | if ARCH_AT91X40 | 441 | if ARCH_AT91X40 |
466 | 442 | ||
467 | comment "AT91X40 Board Type" | 443 | comment "AT91X40 Board Type" |
@@ -544,7 +520,7 @@ config AT91_EARLY_DBGU0 | |||
544 | depends on HAVE_AT91_DBGU0 | 520 | depends on HAVE_AT91_DBGU0 |
545 | 521 | ||
546 | config AT91_EARLY_DBGU1 | 522 | config AT91_EARLY_DBGU1 |
547 | bool "DBGU on 9263, 9g45 and cap9" | 523 | bool "DBGU on 9263 and 9g45" |
548 | depends on HAVE_AT91_DBGU1 | 524 | depends on HAVE_AT91_DBGU1 |
549 | 525 | ||
550 | config AT91_EARLY_USART0 | 526 | config AT91_EARLY_USART0 |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 705e1fbded39..aeb76f1690d9 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -20,7 +20,6 @@ obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_d | |||
20 | obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o | 20 | obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o |
21 | obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o | 21 | obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o |
22 | obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o | 22 | obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o |
23 | obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o | ||
24 | obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o | 23 | obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o |
25 | 24 | ||
26 | # AT91RM9200 board-specific support | 25 | # AT91RM9200 board-specific support |
@@ -81,9 +80,6 @@ obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o | |||
81 | # AT91SAM board with device-tree | 80 | # AT91SAM board with device-tree |
82 | obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o | 81 | obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o |
83 | 82 | ||
84 | # AT91CAP9 board-specific support | ||
85 | obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o | ||
86 | |||
87 | # AT91X40 board-specific support | 83 | # AT91X40 board-specific support |
88 | obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o | 84 | obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o |
89 | 85 | ||
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot index 8ddafadfdc7d..2fd051eb2449 100644 --- a/arch/arm/mach-at91/Makefile.boot +++ b/arch/arm/mach-at91/Makefile.boot | |||
@@ -3,11 +3,7 @@ | |||
3 | # PARAMS_PHYS must be within 4MB of ZRELADDR | 3 | # PARAMS_PHYS must be within 4MB of ZRELADDR |
4 | # INITRD_PHYS must be in RAM | 4 | # INITRD_PHYS must be in RAM |
5 | 5 | ||
6 | ifeq ($(CONFIG_ARCH_AT91CAP9),y) | 6 | ifeq ($(CONFIG_ARCH_AT91SAM9G45),y) |
7 | zreladdr-y += 0x70008000 | ||
8 | params_phys-y := 0x70000100 | ||
9 | initrd_phys-y := 0x70410000 | ||
10 | else ifeq ($(CONFIG_ARCH_AT91SAM9G45),y) | ||
11 | zreladdr-y += 0x70008000 | 7 | zreladdr-y += 0x70008000 |
12 | params_phys-y := 0x70000100 | 8 | params_phys-y := 0x70000100 |
13 | initrd_phys-y := 0x70410000 | 9 | initrd_phys-y := 0x70410000 |
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c deleted file mode 100644 index 8967d75c2ea3..000000000000 --- a/arch/arm/mach-at91/at91cap9.c +++ /dev/null | |||
@@ -1,404 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/at91cap9.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2007 Atmel Corporation. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | |||
17 | #include <asm/proc-fns.h> | ||
18 | #include <asm/irq.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | #include <asm/mach/map.h> | ||
21 | |||
22 | #include <mach/cpu.h> | ||
23 | #include <mach/at91cap9.h> | ||
24 | #include <mach/at91_pmc.h> | ||
25 | |||
26 | #include "soc.h" | ||
27 | #include "generic.h" | ||
28 | #include "clock.h" | ||
29 | #include "sam9_smc.h" | ||
30 | |||
31 | /* -------------------------------------------------------------------- | ||
32 | * Clocks | ||
33 | * -------------------------------------------------------------------- */ | ||
34 | |||
35 | /* | ||
36 | * The peripheral clocks. | ||
37 | */ | ||
38 | static struct clk pioABCD_clk = { | ||
39 | .name = "pioABCD_clk", | ||
40 | .pmc_mask = 1 << AT91CAP9_ID_PIOABCD, | ||
41 | .type = CLK_TYPE_PERIPHERAL, | ||
42 | }; | ||
43 | static struct clk mpb0_clk = { | ||
44 | .name = "mpb0_clk", | ||
45 | .pmc_mask = 1 << AT91CAP9_ID_MPB0, | ||
46 | .type = CLK_TYPE_PERIPHERAL, | ||
47 | }; | ||
48 | static struct clk mpb1_clk = { | ||
49 | .name = "mpb1_clk", | ||
50 | .pmc_mask = 1 << AT91CAP9_ID_MPB1, | ||
51 | .type = CLK_TYPE_PERIPHERAL, | ||
52 | }; | ||
53 | static struct clk mpb2_clk = { | ||
54 | .name = "mpb2_clk", | ||
55 | .pmc_mask = 1 << AT91CAP9_ID_MPB2, | ||
56 | .type = CLK_TYPE_PERIPHERAL, | ||
57 | }; | ||
58 | static struct clk mpb3_clk = { | ||
59 | .name = "mpb3_clk", | ||
60 | .pmc_mask = 1 << AT91CAP9_ID_MPB3, | ||
61 | .type = CLK_TYPE_PERIPHERAL, | ||
62 | }; | ||
63 | static struct clk mpb4_clk = { | ||
64 | .name = "mpb4_clk", | ||
65 | .pmc_mask = 1 << AT91CAP9_ID_MPB4, | ||
66 | .type = CLK_TYPE_PERIPHERAL, | ||
67 | }; | ||
68 | static struct clk usart0_clk = { | ||
69 | .name = "usart0_clk", | ||
70 | .pmc_mask = 1 << AT91CAP9_ID_US0, | ||
71 | .type = CLK_TYPE_PERIPHERAL, | ||
72 | }; | ||
73 | static struct clk usart1_clk = { | ||
74 | .name = "usart1_clk", | ||
75 | .pmc_mask = 1 << AT91CAP9_ID_US1, | ||
76 | .type = CLK_TYPE_PERIPHERAL, | ||
77 | }; | ||
78 | static struct clk usart2_clk = { | ||
79 | .name = "usart2_clk", | ||
80 | .pmc_mask = 1 << AT91CAP9_ID_US2, | ||
81 | .type = CLK_TYPE_PERIPHERAL, | ||
82 | }; | ||
83 | static struct clk mmc0_clk = { | ||
84 | .name = "mci0_clk", | ||
85 | .pmc_mask = 1 << AT91CAP9_ID_MCI0, | ||
86 | .type = CLK_TYPE_PERIPHERAL, | ||
87 | }; | ||
88 | static struct clk mmc1_clk = { | ||
89 | .name = "mci1_clk", | ||
90 | .pmc_mask = 1 << AT91CAP9_ID_MCI1, | ||
91 | .type = CLK_TYPE_PERIPHERAL, | ||
92 | }; | ||
93 | static struct clk can_clk = { | ||
94 | .name = "can_clk", | ||
95 | .pmc_mask = 1 << AT91CAP9_ID_CAN, | ||
96 | .type = CLK_TYPE_PERIPHERAL, | ||
97 | }; | ||
98 | static struct clk twi_clk = { | ||
99 | .name = "twi_clk", | ||
100 | .pmc_mask = 1 << AT91CAP9_ID_TWI, | ||
101 | .type = CLK_TYPE_PERIPHERAL, | ||
102 | }; | ||
103 | static struct clk spi0_clk = { | ||
104 | .name = "spi0_clk", | ||
105 | .pmc_mask = 1 << AT91CAP9_ID_SPI0, | ||
106 | .type = CLK_TYPE_PERIPHERAL, | ||
107 | }; | ||
108 | static struct clk spi1_clk = { | ||
109 | .name = "spi1_clk", | ||
110 | .pmc_mask = 1 << AT91CAP9_ID_SPI1, | ||
111 | .type = CLK_TYPE_PERIPHERAL, | ||
112 | }; | ||
113 | static struct clk ssc0_clk = { | ||
114 | .name = "ssc0_clk", | ||
115 | .pmc_mask = 1 << AT91CAP9_ID_SSC0, | ||
116 | .type = CLK_TYPE_PERIPHERAL, | ||
117 | }; | ||
118 | static struct clk ssc1_clk = { | ||
119 | .name = "ssc1_clk", | ||
120 | .pmc_mask = 1 << AT91CAP9_ID_SSC1, | ||
121 | .type = CLK_TYPE_PERIPHERAL, | ||
122 | }; | ||
123 | static struct clk ac97_clk = { | ||
124 | .name = "ac97_clk", | ||
125 | .pmc_mask = 1 << AT91CAP9_ID_AC97C, | ||
126 | .type = CLK_TYPE_PERIPHERAL, | ||
127 | }; | ||
128 | static struct clk tcb_clk = { | ||
129 | .name = "tcb_clk", | ||
130 | .pmc_mask = 1 << AT91CAP9_ID_TCB, | ||
131 | .type = CLK_TYPE_PERIPHERAL, | ||
132 | }; | ||
133 | static struct clk pwm_clk = { | ||
134 | .name = "pwm_clk", | ||
135 | .pmc_mask = 1 << AT91CAP9_ID_PWMC, | ||
136 | .type = CLK_TYPE_PERIPHERAL, | ||
137 | }; | ||
138 | static struct clk macb_clk = { | ||
139 | .name = "pclk", | ||
140 | .pmc_mask = 1 << AT91CAP9_ID_EMAC, | ||
141 | .type = CLK_TYPE_PERIPHERAL, | ||
142 | }; | ||
143 | static struct clk aestdes_clk = { | ||
144 | .name = "aestdes_clk", | ||
145 | .pmc_mask = 1 << AT91CAP9_ID_AESTDES, | ||
146 | .type = CLK_TYPE_PERIPHERAL, | ||
147 | }; | ||
148 | static struct clk adc_clk = { | ||
149 | .name = "adc_clk", | ||
150 | .pmc_mask = 1 << AT91CAP9_ID_ADC, | ||
151 | .type = CLK_TYPE_PERIPHERAL, | ||
152 | }; | ||
153 | static struct clk isi_clk = { | ||
154 | .name = "isi_clk", | ||
155 | .pmc_mask = 1 << AT91CAP9_ID_ISI, | ||
156 | .type = CLK_TYPE_PERIPHERAL, | ||
157 | }; | ||
158 | static struct clk lcdc_clk = { | ||
159 | .name = "lcdc_clk", | ||
160 | .pmc_mask = 1 << AT91CAP9_ID_LCDC, | ||
161 | .type = CLK_TYPE_PERIPHERAL, | ||
162 | }; | ||
163 | static struct clk dma_clk = { | ||
164 | .name = "dma_clk", | ||
165 | .pmc_mask = 1 << AT91CAP9_ID_DMA, | ||
166 | .type = CLK_TYPE_PERIPHERAL, | ||
167 | }; | ||
168 | static struct clk udphs_clk = { | ||
169 | .name = "udphs_clk", | ||
170 | .pmc_mask = 1 << AT91CAP9_ID_UDPHS, | ||
171 | .type = CLK_TYPE_PERIPHERAL, | ||
172 | }; | ||
173 | static struct clk ohci_clk = { | ||
174 | .name = "ohci_clk", | ||
175 | .pmc_mask = 1 << AT91CAP9_ID_UHP, | ||
176 | .type = CLK_TYPE_PERIPHERAL, | ||
177 | }; | ||
178 | |||
179 | static struct clk *periph_clocks[] __initdata = { | ||
180 | &pioABCD_clk, | ||
181 | &mpb0_clk, | ||
182 | &mpb1_clk, | ||
183 | &mpb2_clk, | ||
184 | &mpb3_clk, | ||
185 | &mpb4_clk, | ||
186 | &usart0_clk, | ||
187 | &usart1_clk, | ||
188 | &usart2_clk, | ||
189 | &mmc0_clk, | ||
190 | &mmc1_clk, | ||
191 | &can_clk, | ||
192 | &twi_clk, | ||
193 | &spi0_clk, | ||
194 | &spi1_clk, | ||
195 | &ssc0_clk, | ||
196 | &ssc1_clk, | ||
197 | &ac97_clk, | ||
198 | &tcb_clk, | ||
199 | &pwm_clk, | ||
200 | &macb_clk, | ||
201 | &aestdes_clk, | ||
202 | &adc_clk, | ||
203 | &isi_clk, | ||
204 | &lcdc_clk, | ||
205 | &dma_clk, | ||
206 | &udphs_clk, | ||
207 | &ohci_clk, | ||
208 | // irq0 .. irq1 | ||
209 | }; | ||
210 | |||
211 | static struct clk_lookup periph_clocks_lookups[] = { | ||
212 | /* One additional fake clock for macb_hclk */ | ||
213 | CLKDEV_CON_ID("hclk", &macb_clk), | ||
214 | CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), | ||
215 | CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), | ||
216 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), | ||
217 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), | ||
218 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | ||
219 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | ||
220 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | ||
221 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | ||
222 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | ||
223 | /* fake hclk clock */ | ||
224 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | ||
225 | CLKDEV_CON_ID("pioA", &pioABCD_clk), | ||
226 | CLKDEV_CON_ID("pioB", &pioABCD_clk), | ||
227 | CLKDEV_CON_ID("pioC", &pioABCD_clk), | ||
228 | CLKDEV_CON_ID("pioD", &pioABCD_clk), | ||
229 | }; | ||
230 | |||
231 | static struct clk_lookup usart_clocks_lookups[] = { | ||
232 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), | ||
233 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), | ||
234 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), | ||
235 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), | ||
236 | }; | ||
237 | |||
238 | /* | ||
239 | * The four programmable clocks. | ||
240 | * You must configure pin multiplexing to bring these signals out. | ||
241 | */ | ||
242 | static struct clk pck0 = { | ||
243 | .name = "pck0", | ||
244 | .pmc_mask = AT91_PMC_PCK0, | ||
245 | .type = CLK_TYPE_PROGRAMMABLE, | ||
246 | .id = 0, | ||
247 | }; | ||
248 | static struct clk pck1 = { | ||
249 | .name = "pck1", | ||
250 | .pmc_mask = AT91_PMC_PCK1, | ||
251 | .type = CLK_TYPE_PROGRAMMABLE, | ||
252 | .id = 1, | ||
253 | }; | ||
254 | static struct clk pck2 = { | ||
255 | .name = "pck2", | ||
256 | .pmc_mask = AT91_PMC_PCK2, | ||
257 | .type = CLK_TYPE_PROGRAMMABLE, | ||
258 | .id = 2, | ||
259 | }; | ||
260 | static struct clk pck3 = { | ||
261 | .name = "pck3", | ||
262 | .pmc_mask = AT91_PMC_PCK3, | ||
263 | .type = CLK_TYPE_PROGRAMMABLE, | ||
264 | .id = 3, | ||
265 | }; | ||
266 | |||
267 | static void __init at91cap9_register_clocks(void) | ||
268 | { | ||
269 | int i; | ||
270 | |||
271 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | ||
272 | clk_register(periph_clocks[i]); | ||
273 | |||
274 | clkdev_add_table(periph_clocks_lookups, | ||
275 | ARRAY_SIZE(periph_clocks_lookups)); | ||
276 | clkdev_add_table(usart_clocks_lookups, | ||
277 | ARRAY_SIZE(usart_clocks_lookups)); | ||
278 | |||
279 | clk_register(&pck0); | ||
280 | clk_register(&pck1); | ||
281 | clk_register(&pck2); | ||
282 | clk_register(&pck3); | ||
283 | } | ||
284 | |||
285 | static struct clk_lookup console_clock_lookup; | ||
286 | |||
287 | void __init at91cap9_set_console_clock(int id) | ||
288 | { | ||
289 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) | ||
290 | return; | ||
291 | |||
292 | console_clock_lookup.con_id = "usart"; | ||
293 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; | ||
294 | clkdev_add(&console_clock_lookup); | ||
295 | } | ||
296 | |||
297 | /* -------------------------------------------------------------------- | ||
298 | * GPIO | ||
299 | * -------------------------------------------------------------------- */ | ||
300 | |||
301 | static struct at91_gpio_bank at91cap9_gpio[] __initdata = { | ||
302 | { | ||
303 | .id = AT91CAP9_ID_PIOABCD, | ||
304 | .regbase = AT91CAP9_BASE_PIOA, | ||
305 | }, { | ||
306 | .id = AT91CAP9_ID_PIOABCD, | ||
307 | .regbase = AT91CAP9_BASE_PIOB, | ||
308 | }, { | ||
309 | .id = AT91CAP9_ID_PIOABCD, | ||
310 | .regbase = AT91CAP9_BASE_PIOC, | ||
311 | }, { | ||
312 | .id = AT91CAP9_ID_PIOABCD, | ||
313 | .regbase = AT91CAP9_BASE_PIOD, | ||
314 | } | ||
315 | }; | ||
316 | |||
317 | static void at91cap9_idle(void) | ||
318 | { | ||
319 | at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); | ||
320 | cpu_do_idle(); | ||
321 | } | ||
322 | |||
323 | /* -------------------------------------------------------------------- | ||
324 | * AT91CAP9 processor initialization | ||
325 | * -------------------------------------------------------------------- */ | ||
326 | |||
327 | static void __init at91cap9_map_io(void) | ||
328 | { | ||
329 | at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); | ||
330 | } | ||
331 | |||
332 | static void __init at91cap9_ioremap_registers(void) | ||
333 | { | ||
334 | at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC); | ||
335 | at91_ioremap_rstc(AT91CAP9_BASE_RSTC); | ||
336 | at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT); | ||
337 | at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC); | ||
338 | } | ||
339 | |||
340 | static void __init at91cap9_initialize(void) | ||
341 | { | ||
342 | arm_pm_idle = at91cap9_idle; | ||
343 | arm_pm_restart = at91sam9g45_restart; | ||
344 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); | ||
345 | |||
346 | /* Register GPIO subsystem */ | ||
347 | at91_gpio_init(at91cap9_gpio, 4); | ||
348 | |||
349 | /* Remember the silicon revision */ | ||
350 | if (cpu_is_at91cap9_revB()) | ||
351 | system_rev = 0xB; | ||
352 | else if (cpu_is_at91cap9_revC()) | ||
353 | system_rev = 0xC; | ||
354 | } | ||
355 | |||
356 | /* -------------------------------------------------------------------- | ||
357 | * Interrupt initialization | ||
358 | * -------------------------------------------------------------------- */ | ||
359 | |||
360 | /* | ||
361 | * The default interrupt priority levels (0 = lowest, 7 = highest). | ||
362 | */ | ||
363 | static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = { | ||
364 | 7, /* Advanced Interrupt Controller (FIQ) */ | ||
365 | 7, /* System Peripherals */ | ||
366 | 1, /* Parallel IO Controller A, B, C and D */ | ||
367 | 0, /* MP Block Peripheral 0 */ | ||
368 | 0, /* MP Block Peripheral 1 */ | ||
369 | 0, /* MP Block Peripheral 2 */ | ||
370 | 0, /* MP Block Peripheral 3 */ | ||
371 | 0, /* MP Block Peripheral 4 */ | ||
372 | 5, /* USART 0 */ | ||
373 | 5, /* USART 1 */ | ||
374 | 5, /* USART 2 */ | ||
375 | 0, /* Multimedia Card Interface 0 */ | ||
376 | 0, /* Multimedia Card Interface 1 */ | ||
377 | 3, /* CAN */ | ||
378 | 6, /* Two-Wire Interface */ | ||
379 | 5, /* Serial Peripheral Interface 0 */ | ||
380 | 5, /* Serial Peripheral Interface 1 */ | ||
381 | 4, /* Serial Synchronous Controller 0 */ | ||
382 | 4, /* Serial Synchronous Controller 1 */ | ||
383 | 5, /* AC97 Controller */ | ||
384 | 0, /* Timer Counter 0, 1 and 2 */ | ||
385 | 0, /* Pulse Width Modulation Controller */ | ||
386 | 3, /* Ethernet */ | ||
387 | 0, /* Advanced Encryption Standard, Triple DES*/ | ||
388 | 0, /* Analog-to-Digital Converter */ | ||
389 | 0, /* Image Sensor Interface */ | ||
390 | 3, /* LCD Controller */ | ||
391 | 0, /* DMA Controller */ | ||
392 | 2, /* USB Device Port */ | ||
393 | 2, /* USB Host port */ | ||
394 | 0, /* Advanced Interrupt Controller (IRQ0) */ | ||
395 | 0, /* Advanced Interrupt Controller (IRQ1) */ | ||
396 | }; | ||
397 | |||
398 | struct at91_init_soc __initdata at91cap9_soc = { | ||
399 | .map_io = at91cap9_map_io, | ||
400 | .default_irq_priority = at91cap9_default_irq_priority, | ||
401 | .ioremap_registers = at91cap9_ioremap_registers, | ||
402 | .register_clocks = at91cap9_register_clocks, | ||
403 | .init = at91cap9_initialize, | ||
404 | }; | ||
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c deleted file mode 100644 index d298fb7cb210..000000000000 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ /dev/null | |||
@@ -1,1273 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/at91cap9_devices.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2007 Atmel Corporation. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | #include <asm/mach/arch.h> | ||
15 | #include <asm/mach/map.h> | ||
16 | #include <asm/mach/irq.h> | ||
17 | |||
18 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/gpio.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/i2c-gpio.h> | ||
22 | |||
23 | #include <video/atmel_lcdc.h> | ||
24 | |||
25 | #include <mach/board.h> | ||
26 | #include <mach/cpu.h> | ||
27 | #include <mach/at91cap9.h> | ||
28 | #include <mach/at91cap9_matrix.h> | ||
29 | #include <mach/at91sam9_smc.h> | ||
30 | |||
31 | #include "generic.h" | ||
32 | |||
33 | |||
34 | /* -------------------------------------------------------------------- | ||
35 | * USB Host | ||
36 | * -------------------------------------------------------------------- */ | ||
37 | |||
38 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
39 | static u64 ohci_dmamask = DMA_BIT_MASK(32); | ||
40 | static struct at91_usbh_data usbh_data; | ||
41 | |||
42 | static struct resource usbh_resources[] = { | ||
43 | [0] = { | ||
44 | .start = AT91CAP9_UHP_BASE, | ||
45 | .end = AT91CAP9_UHP_BASE + SZ_1M - 1, | ||
46 | .flags = IORESOURCE_MEM, | ||
47 | }, | ||
48 | [1] = { | ||
49 | .start = AT91CAP9_ID_UHP, | ||
50 | .end = AT91CAP9_ID_UHP, | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | static struct platform_device at91_usbh_device = { | ||
56 | .name = "at91_ohci", | ||
57 | .id = -1, | ||
58 | .dev = { | ||
59 | .dma_mask = &ohci_dmamask, | ||
60 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
61 | .platform_data = &usbh_data, | ||
62 | }, | ||
63 | .resource = usbh_resources, | ||
64 | .num_resources = ARRAY_SIZE(usbh_resources), | ||
65 | }; | ||
66 | |||
67 | void __init at91_add_device_usbh(struct at91_usbh_data *data) | ||
68 | { | ||
69 | int i; | ||
70 | |||
71 | if (!data) | ||
72 | return; | ||
73 | |||
74 | if (cpu_is_at91cap9_revB()) | ||
75 | irq_set_irq_type(AT91CAP9_ID_UHP, IRQ_TYPE_LEVEL_HIGH); | ||
76 | |||
77 | /* Enable VBus control for UHP ports */ | ||
78 | for (i = 0; i < data->ports; i++) { | ||
79 | if (gpio_is_valid(data->vbus_pin[i])) | ||
80 | at91_set_gpio_output(data->vbus_pin[i], 0); | ||
81 | } | ||
82 | |||
83 | /* Enable overcurrent notification */ | ||
84 | for (i = 0; i < data->ports; i++) { | ||
85 | if (data->overcurrent_pin[i]) | ||
86 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | ||
87 | } | ||
88 | |||
89 | usbh_data = *data; | ||
90 | platform_device_register(&at91_usbh_device); | ||
91 | } | ||
92 | #else | ||
93 | void __init at91_add_device_usbh(struct at91_usbh_data *data) {} | ||
94 | #endif | ||
95 | |||
96 | |||
97 | /* -------------------------------------------------------------------- | ||
98 | * USB HS Device (Gadget) | ||
99 | * -------------------------------------------------------------------- */ | ||
100 | |||
101 | #if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE) | ||
102 | |||
103 | static struct resource usba_udc_resources[] = { | ||
104 | [0] = { | ||
105 | .start = AT91CAP9_UDPHS_FIFO, | ||
106 | .end = AT91CAP9_UDPHS_FIFO + SZ_512K - 1, | ||
107 | .flags = IORESOURCE_MEM, | ||
108 | }, | ||
109 | [1] = { | ||
110 | .start = AT91CAP9_BASE_UDPHS, | ||
111 | .end = AT91CAP9_BASE_UDPHS + SZ_1K - 1, | ||
112 | .flags = IORESOURCE_MEM, | ||
113 | }, | ||
114 | [2] = { | ||
115 | .start = AT91CAP9_ID_UDPHS, | ||
116 | .end = AT91CAP9_ID_UDPHS, | ||
117 | .flags = IORESOURCE_IRQ, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | #define EP(nam, idx, maxpkt, maxbk, dma, isoc) \ | ||
122 | [idx] = { \ | ||
123 | .name = nam, \ | ||
124 | .index = idx, \ | ||
125 | .fifo_size = maxpkt, \ | ||
126 | .nr_banks = maxbk, \ | ||
127 | .can_dma = dma, \ | ||
128 | .can_isoc = isoc, \ | ||
129 | } | ||
130 | |||
131 | static struct usba_ep_data usba_udc_ep[] = { | ||
132 | EP("ep0", 0, 64, 1, 0, 0), | ||
133 | EP("ep1", 1, 1024, 3, 1, 1), | ||
134 | EP("ep2", 2, 1024, 3, 1, 1), | ||
135 | EP("ep3", 3, 1024, 2, 1, 1), | ||
136 | EP("ep4", 4, 1024, 2, 1, 1), | ||
137 | EP("ep5", 5, 1024, 2, 1, 0), | ||
138 | EP("ep6", 6, 1024, 2, 1, 0), | ||
139 | EP("ep7", 7, 1024, 2, 0, 0), | ||
140 | }; | ||
141 | |||
142 | #undef EP | ||
143 | |||
144 | /* | ||
145 | * pdata doesn't have room for any endpoints, so we need to | ||
146 | * append room for the ones we need right after it. | ||
147 | */ | ||
148 | static struct { | ||
149 | struct usba_platform_data pdata; | ||
150 | struct usba_ep_data ep[8]; | ||
151 | } usba_udc_data; | ||
152 | |||
153 | static struct platform_device at91_usba_udc_device = { | ||
154 | .name = "atmel_usba_udc", | ||
155 | .id = -1, | ||
156 | .dev = { | ||
157 | .platform_data = &usba_udc_data.pdata, | ||
158 | }, | ||
159 | .resource = usba_udc_resources, | ||
160 | .num_resources = ARRAY_SIZE(usba_udc_resources), | ||
161 | }; | ||
162 | |||
163 | void __init at91_add_device_usba(struct usba_platform_data *data) | ||
164 | { | ||
165 | if (cpu_is_at91cap9_revB()) { | ||
166 | irq_set_irq_type(AT91CAP9_ID_UDPHS, IRQ_TYPE_LEVEL_HIGH); | ||
167 | at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS | | ||
168 | AT91_MATRIX_UDPHS_BYPASS_LOCK); | ||
169 | } | ||
170 | else | ||
171 | at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS); | ||
172 | |||
173 | /* | ||
174 | * Invalid pins are 0 on AT91, but the usba driver is shared | ||
175 | * with AVR32, which use negative values instead. Once/if | ||
176 | * gpio_is_valid() is ported to AT91, revisit this code. | ||
177 | */ | ||
178 | usba_udc_data.pdata.vbus_pin = -EINVAL; | ||
179 | usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep); | ||
180 | memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep)); | ||
181 | |||
182 | if (data && gpio_is_valid(data->vbus_pin)) { | ||
183 | at91_set_gpio_input(data->vbus_pin, 0); | ||
184 | at91_set_deglitch(data->vbus_pin, 1); | ||
185 | usba_udc_data.pdata.vbus_pin = data->vbus_pin; | ||
186 | } | ||
187 | |||
188 | /* Pullup pin is handled internally by USB device peripheral */ | ||
189 | |||
190 | platform_device_register(&at91_usba_udc_device); | ||
191 | } | ||
192 | #else | ||
193 | void __init at91_add_device_usba(struct usba_platform_data *data) {} | ||
194 | #endif | ||
195 | |||
196 | |||
197 | /* -------------------------------------------------------------------- | ||
198 | * Ethernet | ||
199 | * -------------------------------------------------------------------- */ | ||
200 | |||
201 | #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) | ||
202 | static u64 eth_dmamask = DMA_BIT_MASK(32); | ||
203 | static struct macb_platform_data eth_data; | ||
204 | |||
205 | static struct resource eth_resources[] = { | ||
206 | [0] = { | ||
207 | .start = AT91CAP9_BASE_EMAC, | ||
208 | .end = AT91CAP9_BASE_EMAC + SZ_16K - 1, | ||
209 | .flags = IORESOURCE_MEM, | ||
210 | }, | ||
211 | [1] = { | ||
212 | .start = AT91CAP9_ID_EMAC, | ||
213 | .end = AT91CAP9_ID_EMAC, | ||
214 | .flags = IORESOURCE_IRQ, | ||
215 | }, | ||
216 | }; | ||
217 | |||
218 | static struct platform_device at91cap9_eth_device = { | ||
219 | .name = "macb", | ||
220 | .id = -1, | ||
221 | .dev = { | ||
222 | .dma_mask = ð_dmamask, | ||
223 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
224 | .platform_data = ð_data, | ||
225 | }, | ||
226 | .resource = eth_resources, | ||
227 | .num_resources = ARRAY_SIZE(eth_resources), | ||
228 | }; | ||
229 | |||
230 | void __init at91_add_device_eth(struct macb_platform_data *data) | ||
231 | { | ||
232 | if (!data) | ||
233 | return; | ||
234 | |||
235 | if (gpio_is_valid(data->phy_irq_pin)) { | ||
236 | at91_set_gpio_input(data->phy_irq_pin, 0); | ||
237 | at91_set_deglitch(data->phy_irq_pin, 1); | ||
238 | } | ||
239 | |||
240 | /* Pins used for MII and RMII */ | ||
241 | at91_set_A_periph(AT91_PIN_PB21, 0); /* ETXCK_EREFCK */ | ||
242 | at91_set_A_periph(AT91_PIN_PB22, 0); /* ERXDV */ | ||
243 | at91_set_A_periph(AT91_PIN_PB25, 0); /* ERX0 */ | ||
244 | at91_set_A_periph(AT91_PIN_PB26, 0); /* ERX1 */ | ||
245 | at91_set_A_periph(AT91_PIN_PB27, 0); /* ERXER */ | ||
246 | at91_set_A_periph(AT91_PIN_PB28, 0); /* ETXEN */ | ||
247 | at91_set_A_periph(AT91_PIN_PB23, 0); /* ETX0 */ | ||
248 | at91_set_A_periph(AT91_PIN_PB24, 0); /* ETX1 */ | ||
249 | at91_set_A_periph(AT91_PIN_PB30, 0); /* EMDIO */ | ||
250 | at91_set_A_periph(AT91_PIN_PB29, 0); /* EMDC */ | ||
251 | |||
252 | if (!data->is_rmii) { | ||
253 | at91_set_B_periph(AT91_PIN_PC25, 0); /* ECRS */ | ||
254 | at91_set_B_periph(AT91_PIN_PC26, 0); /* ECOL */ | ||
255 | at91_set_B_periph(AT91_PIN_PC22, 0); /* ERX2 */ | ||
256 | at91_set_B_periph(AT91_PIN_PC23, 0); /* ERX3 */ | ||
257 | at91_set_B_periph(AT91_PIN_PC27, 0); /* ERXCK */ | ||
258 | at91_set_B_periph(AT91_PIN_PC20, 0); /* ETX2 */ | ||
259 | at91_set_B_periph(AT91_PIN_PC21, 0); /* ETX3 */ | ||
260 | at91_set_B_periph(AT91_PIN_PC24, 0); /* ETXER */ | ||
261 | } | ||
262 | |||
263 | eth_data = *data; | ||
264 | platform_device_register(&at91cap9_eth_device); | ||
265 | } | ||
266 | #else | ||
267 | void __init at91_add_device_eth(struct macb_platform_data *data) {} | ||
268 | #endif | ||
269 | |||
270 | |||
271 | /* -------------------------------------------------------------------- | ||
272 | * MMC / SD | ||
273 | * -------------------------------------------------------------------- */ | ||
274 | |||
275 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) | ||
276 | static u64 mmc_dmamask = DMA_BIT_MASK(32); | ||
277 | static struct at91_mmc_data mmc0_data, mmc1_data; | ||
278 | |||
279 | static struct resource mmc0_resources[] = { | ||
280 | [0] = { | ||
281 | .start = AT91CAP9_BASE_MCI0, | ||
282 | .end = AT91CAP9_BASE_MCI0 + SZ_16K - 1, | ||
283 | .flags = IORESOURCE_MEM, | ||
284 | }, | ||
285 | [1] = { | ||
286 | .start = AT91CAP9_ID_MCI0, | ||
287 | .end = AT91CAP9_ID_MCI0, | ||
288 | .flags = IORESOURCE_IRQ, | ||
289 | }, | ||
290 | }; | ||
291 | |||
292 | static struct platform_device at91cap9_mmc0_device = { | ||
293 | .name = "at91_mci", | ||
294 | .id = 0, | ||
295 | .dev = { | ||
296 | .dma_mask = &mmc_dmamask, | ||
297 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
298 | .platform_data = &mmc0_data, | ||
299 | }, | ||
300 | .resource = mmc0_resources, | ||
301 | .num_resources = ARRAY_SIZE(mmc0_resources), | ||
302 | }; | ||
303 | |||
304 | static struct resource mmc1_resources[] = { | ||
305 | [0] = { | ||
306 | .start = AT91CAP9_BASE_MCI1, | ||
307 | .end = AT91CAP9_BASE_MCI1 + SZ_16K - 1, | ||
308 | .flags = IORESOURCE_MEM, | ||
309 | }, | ||
310 | [1] = { | ||
311 | .start = AT91CAP9_ID_MCI1, | ||
312 | .end = AT91CAP9_ID_MCI1, | ||
313 | .flags = IORESOURCE_IRQ, | ||
314 | }, | ||
315 | }; | ||
316 | |||
317 | static struct platform_device at91cap9_mmc1_device = { | ||
318 | .name = "at91_mci", | ||
319 | .id = 1, | ||
320 | .dev = { | ||
321 | .dma_mask = &mmc_dmamask, | ||
322 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
323 | .platform_data = &mmc1_data, | ||
324 | }, | ||
325 | .resource = mmc1_resources, | ||
326 | .num_resources = ARRAY_SIZE(mmc1_resources), | ||
327 | }; | ||
328 | |||
329 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) | ||
330 | { | ||
331 | if (!data) | ||
332 | return; | ||
333 | |||
334 | /* input/irq */ | ||
335 | if (gpio_is_valid(data->det_pin)) { | ||
336 | at91_set_gpio_input(data->det_pin, 1); | ||
337 | at91_set_deglitch(data->det_pin, 1); | ||
338 | } | ||
339 | if (gpio_is_valid(data->wp_pin)) | ||
340 | at91_set_gpio_input(data->wp_pin, 1); | ||
341 | if (gpio_is_valid(data->vcc_pin)) | ||
342 | at91_set_gpio_output(data->vcc_pin, 0); | ||
343 | |||
344 | if (mmc_id == 0) { /* MCI0 */ | ||
345 | /* CLK */ | ||
346 | at91_set_A_periph(AT91_PIN_PA2, 0); | ||
347 | |||
348 | /* CMD */ | ||
349 | at91_set_A_periph(AT91_PIN_PA1, 1); | ||
350 | |||
351 | /* DAT0, maybe DAT1..DAT3 */ | ||
352 | at91_set_A_periph(AT91_PIN_PA0, 1); | ||
353 | if (data->wire4) { | ||
354 | at91_set_A_periph(AT91_PIN_PA3, 1); | ||
355 | at91_set_A_periph(AT91_PIN_PA4, 1); | ||
356 | at91_set_A_periph(AT91_PIN_PA5, 1); | ||
357 | } | ||
358 | |||
359 | mmc0_data = *data; | ||
360 | platform_device_register(&at91cap9_mmc0_device); | ||
361 | } else { /* MCI1 */ | ||
362 | /* CLK */ | ||
363 | at91_set_A_periph(AT91_PIN_PA16, 0); | ||
364 | |||
365 | /* CMD */ | ||
366 | at91_set_A_periph(AT91_PIN_PA17, 1); | ||
367 | |||
368 | /* DAT0, maybe DAT1..DAT3 */ | ||
369 | at91_set_A_periph(AT91_PIN_PA18, 1); | ||
370 | if (data->wire4) { | ||
371 | at91_set_A_periph(AT91_PIN_PA19, 1); | ||
372 | at91_set_A_periph(AT91_PIN_PA20, 1); | ||
373 | at91_set_A_periph(AT91_PIN_PA21, 1); | ||
374 | } | ||
375 | |||
376 | mmc1_data = *data; | ||
377 | platform_device_register(&at91cap9_mmc1_device); | ||
378 | } | ||
379 | } | ||
380 | #else | ||
381 | void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} | ||
382 | #endif | ||
383 | |||
384 | |||
385 | /* -------------------------------------------------------------------- | ||
386 | * NAND / SmartMedia | ||
387 | * -------------------------------------------------------------------- */ | ||
388 | |||
389 | #if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE) | ||
390 | static struct atmel_nand_data nand_data; | ||
391 | |||
392 | #define NAND_BASE AT91_CHIPSELECT_3 | ||
393 | |||
394 | static struct resource nand_resources[] = { | ||
395 | [0] = { | ||
396 | .start = NAND_BASE, | ||
397 | .end = NAND_BASE + SZ_256M - 1, | ||
398 | .flags = IORESOURCE_MEM, | ||
399 | }, | ||
400 | [1] = { | ||
401 | .start = AT91CAP9_BASE_ECC, | ||
402 | .end = AT91CAP9_BASE_ECC + SZ_512 - 1, | ||
403 | .flags = IORESOURCE_MEM, | ||
404 | } | ||
405 | }; | ||
406 | |||
407 | static struct platform_device at91cap9_nand_device = { | ||
408 | .name = "atmel_nand", | ||
409 | .id = -1, | ||
410 | .dev = { | ||
411 | .platform_data = &nand_data, | ||
412 | }, | ||
413 | .resource = nand_resources, | ||
414 | .num_resources = ARRAY_SIZE(nand_resources), | ||
415 | }; | ||
416 | |||
417 | void __init at91_add_device_nand(struct atmel_nand_data *data) | ||
418 | { | ||
419 | unsigned long csa; | ||
420 | |||
421 | if (!data) | ||
422 | return; | ||
423 | |||
424 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | ||
425 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); | ||
426 | |||
427 | /* enable pin */ | ||
428 | if (gpio_is_valid(data->enable_pin)) | ||
429 | at91_set_gpio_output(data->enable_pin, 1); | ||
430 | |||
431 | /* ready/busy pin */ | ||
432 | if (gpio_is_valid(data->rdy_pin)) | ||
433 | at91_set_gpio_input(data->rdy_pin, 1); | ||
434 | |||
435 | /* card detect pin */ | ||
436 | if (gpio_is_valid(data->det_pin)) | ||
437 | at91_set_gpio_input(data->det_pin, 1); | ||
438 | |||
439 | nand_data = *data; | ||
440 | platform_device_register(&at91cap9_nand_device); | ||
441 | } | ||
442 | #else | ||
443 | void __init at91_add_device_nand(struct atmel_nand_data *data) {} | ||
444 | #endif | ||
445 | |||
446 | |||
447 | /* -------------------------------------------------------------------- | ||
448 | * TWI (i2c) | ||
449 | * -------------------------------------------------------------------- */ | ||
450 | |||
451 | /* | ||
452 | * Prefer the GPIO code since the TWI controller isn't robust | ||
453 | * (gets overruns and underruns under load) and can only issue | ||
454 | * repeated STARTs in one scenario (the driver doesn't yet handle them). | ||
455 | */ | ||
456 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
457 | |||
458 | static struct i2c_gpio_platform_data pdata = { | ||
459 | .sda_pin = AT91_PIN_PB4, | ||
460 | .sda_is_open_drain = 1, | ||
461 | .scl_pin = AT91_PIN_PB5, | ||
462 | .scl_is_open_drain = 1, | ||
463 | .udelay = 2, /* ~100 kHz */ | ||
464 | }; | ||
465 | |||
466 | static struct platform_device at91cap9_twi_device = { | ||
467 | .name = "i2c-gpio", | ||
468 | .id = -1, | ||
469 | .dev.platform_data = &pdata, | ||
470 | }; | ||
471 | |||
472 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
473 | { | ||
474 | at91_set_GPIO_periph(AT91_PIN_PB4, 1); /* TWD (SDA) */ | ||
475 | at91_set_multi_drive(AT91_PIN_PB4, 1); | ||
476 | |||
477 | at91_set_GPIO_periph(AT91_PIN_PB5, 1); /* TWCK (SCL) */ | ||
478 | at91_set_multi_drive(AT91_PIN_PB5, 1); | ||
479 | |||
480 | i2c_register_board_info(0, devices, nr_devices); | ||
481 | platform_device_register(&at91cap9_twi_device); | ||
482 | } | ||
483 | |||
484 | #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE) | ||
485 | |||
486 | static struct resource twi_resources[] = { | ||
487 | [0] = { | ||
488 | .start = AT91CAP9_BASE_TWI, | ||
489 | .end = AT91CAP9_BASE_TWI + SZ_16K - 1, | ||
490 | .flags = IORESOURCE_MEM, | ||
491 | }, | ||
492 | [1] = { | ||
493 | .start = AT91CAP9_ID_TWI, | ||
494 | .end = AT91CAP9_ID_TWI, | ||
495 | .flags = IORESOURCE_IRQ, | ||
496 | }, | ||
497 | }; | ||
498 | |||
499 | static struct platform_device at91cap9_twi_device = { | ||
500 | .name = "at91_i2c", | ||
501 | .id = -1, | ||
502 | .resource = twi_resources, | ||
503 | .num_resources = ARRAY_SIZE(twi_resources), | ||
504 | }; | ||
505 | |||
506 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | ||
507 | { | ||
508 | /* pins used for TWI interface */ | ||
509 | at91_set_B_periph(AT91_PIN_PB4, 0); /* TWD */ | ||
510 | at91_set_multi_drive(AT91_PIN_PB4, 1); | ||
511 | |||
512 | at91_set_B_periph(AT91_PIN_PB5, 0); /* TWCK */ | ||
513 | at91_set_multi_drive(AT91_PIN_PB5, 1); | ||
514 | |||
515 | i2c_register_board_info(0, devices, nr_devices); | ||
516 | platform_device_register(&at91cap9_twi_device); | ||
517 | } | ||
518 | #else | ||
519 | void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {} | ||
520 | #endif | ||
521 | |||
522 | /* -------------------------------------------------------------------- | ||
523 | * SPI | ||
524 | * -------------------------------------------------------------------- */ | ||
525 | |||
526 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) | ||
527 | static u64 spi_dmamask = DMA_BIT_MASK(32); | ||
528 | |||
529 | static struct resource spi0_resources[] = { | ||
530 | [0] = { | ||
531 | .start = AT91CAP9_BASE_SPI0, | ||
532 | .end = AT91CAP9_BASE_SPI0 + SZ_16K - 1, | ||
533 | .flags = IORESOURCE_MEM, | ||
534 | }, | ||
535 | [1] = { | ||
536 | .start = AT91CAP9_ID_SPI0, | ||
537 | .end = AT91CAP9_ID_SPI0, | ||
538 | .flags = IORESOURCE_IRQ, | ||
539 | }, | ||
540 | }; | ||
541 | |||
542 | static struct platform_device at91cap9_spi0_device = { | ||
543 | .name = "atmel_spi", | ||
544 | .id = 0, | ||
545 | .dev = { | ||
546 | .dma_mask = &spi_dmamask, | ||
547 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
548 | }, | ||
549 | .resource = spi0_resources, | ||
550 | .num_resources = ARRAY_SIZE(spi0_resources), | ||
551 | }; | ||
552 | |||
553 | static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA5, AT91_PIN_PA3, AT91_PIN_PD0, AT91_PIN_PD1 }; | ||
554 | |||
555 | static struct resource spi1_resources[] = { | ||
556 | [0] = { | ||
557 | .start = AT91CAP9_BASE_SPI1, | ||
558 | .end = AT91CAP9_BASE_SPI1 + SZ_16K - 1, | ||
559 | .flags = IORESOURCE_MEM, | ||
560 | }, | ||
561 | [1] = { | ||
562 | .start = AT91CAP9_ID_SPI1, | ||
563 | .end = AT91CAP9_ID_SPI1, | ||
564 | .flags = IORESOURCE_IRQ, | ||
565 | }, | ||
566 | }; | ||
567 | |||
568 | static struct platform_device at91cap9_spi1_device = { | ||
569 | .name = "atmel_spi", | ||
570 | .id = 1, | ||
571 | .dev = { | ||
572 | .dma_mask = &spi_dmamask, | ||
573 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
574 | }, | ||
575 | .resource = spi1_resources, | ||
576 | .num_resources = ARRAY_SIZE(spi1_resources), | ||
577 | }; | ||
578 | |||
579 | static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB15, AT91_PIN_PB16, AT91_PIN_PB17, AT91_PIN_PB18 }; | ||
580 | |||
581 | void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | ||
582 | { | ||
583 | int i; | ||
584 | unsigned long cs_pin; | ||
585 | short enable_spi0 = 0; | ||
586 | short enable_spi1 = 0; | ||
587 | |||
588 | /* Choose SPI chip-selects */ | ||
589 | for (i = 0; i < nr_devices; i++) { | ||
590 | if (devices[i].controller_data) | ||
591 | cs_pin = (unsigned long) devices[i].controller_data; | ||
592 | else if (devices[i].bus_num == 0) | ||
593 | cs_pin = spi0_standard_cs[devices[i].chip_select]; | ||
594 | else | ||
595 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | ||
596 | |||
597 | if (devices[i].bus_num == 0) | ||
598 | enable_spi0 = 1; | ||
599 | else | ||
600 | enable_spi1 = 1; | ||
601 | |||
602 | /* enable chip-select pin */ | ||
603 | at91_set_gpio_output(cs_pin, 1); | ||
604 | |||
605 | /* pass chip-select pin to driver */ | ||
606 | devices[i].controller_data = (void *) cs_pin; | ||
607 | } | ||
608 | |||
609 | spi_register_board_info(devices, nr_devices); | ||
610 | |||
611 | /* Configure SPI bus(es) */ | ||
612 | if (enable_spi0) { | ||
613 | at91_set_B_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */ | ||
614 | at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ | ||
615 | at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */ | ||
616 | |||
617 | platform_device_register(&at91cap9_spi0_device); | ||
618 | } | ||
619 | if (enable_spi1) { | ||
620 | at91_set_A_periph(AT91_PIN_PB12, 0); /* SPI1_MISO */ | ||
621 | at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */ | ||
622 | at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */ | ||
623 | |||
624 | platform_device_register(&at91cap9_spi1_device); | ||
625 | } | ||
626 | } | ||
627 | #else | ||
628 | void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {} | ||
629 | #endif | ||
630 | |||
631 | |||
632 | /* -------------------------------------------------------------------- | ||
633 | * Timer/Counter block | ||
634 | * -------------------------------------------------------------------- */ | ||
635 | |||
636 | #ifdef CONFIG_ATMEL_TCLIB | ||
637 | |||
638 | static struct resource tcb_resources[] = { | ||
639 | [0] = { | ||
640 | .start = AT91CAP9_BASE_TCB0, | ||
641 | .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1, | ||
642 | .flags = IORESOURCE_MEM, | ||
643 | }, | ||
644 | [1] = { | ||
645 | .start = AT91CAP9_ID_TCB, | ||
646 | .end = AT91CAP9_ID_TCB, | ||
647 | .flags = IORESOURCE_IRQ, | ||
648 | }, | ||
649 | }; | ||
650 | |||
651 | static struct platform_device at91cap9_tcb_device = { | ||
652 | .name = "atmel_tcb", | ||
653 | .id = 0, | ||
654 | .resource = tcb_resources, | ||
655 | .num_resources = ARRAY_SIZE(tcb_resources), | ||
656 | }; | ||
657 | |||
658 | static void __init at91_add_device_tc(void) | ||
659 | { | ||
660 | platform_device_register(&at91cap9_tcb_device); | ||
661 | } | ||
662 | #else | ||
663 | static void __init at91_add_device_tc(void) { } | ||
664 | #endif | ||
665 | |||
666 | |||
667 | /* -------------------------------------------------------------------- | ||
668 | * RTT | ||
669 | * -------------------------------------------------------------------- */ | ||
670 | |||
671 | static struct resource rtt_resources[] = { | ||
672 | { | ||
673 | .start = AT91CAP9_BASE_RTT, | ||
674 | .end = AT91CAP9_BASE_RTT + SZ_16 - 1, | ||
675 | .flags = IORESOURCE_MEM, | ||
676 | } | ||
677 | }; | ||
678 | |||
679 | static struct platform_device at91cap9_rtt_device = { | ||
680 | .name = "at91_rtt", | ||
681 | .id = 0, | ||
682 | .resource = rtt_resources, | ||
683 | .num_resources = ARRAY_SIZE(rtt_resources), | ||
684 | }; | ||
685 | |||
686 | static void __init at91_add_device_rtt(void) | ||
687 | { | ||
688 | platform_device_register(&at91cap9_rtt_device); | ||
689 | } | ||
690 | |||
691 | |||
692 | /* -------------------------------------------------------------------- | ||
693 | * Watchdog | ||
694 | * -------------------------------------------------------------------- */ | ||
695 | |||
696 | #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) | ||
697 | static struct resource wdt_resources[] = { | ||
698 | { | ||
699 | .start = AT91CAP9_BASE_WDT, | ||
700 | .end = AT91CAP9_BASE_WDT + SZ_16 - 1, | ||
701 | .flags = IORESOURCE_MEM, | ||
702 | } | ||
703 | }; | ||
704 | |||
705 | static struct platform_device at91cap9_wdt_device = { | ||
706 | .name = "at91_wdt", | ||
707 | .id = -1, | ||
708 | .resource = wdt_resources, | ||
709 | .num_resources = ARRAY_SIZE(wdt_resources), | ||
710 | }; | ||
711 | |||
712 | static void __init at91_add_device_watchdog(void) | ||
713 | { | ||
714 | platform_device_register(&at91cap9_wdt_device); | ||
715 | } | ||
716 | #else | ||
717 | static void __init at91_add_device_watchdog(void) {} | ||
718 | #endif | ||
719 | |||
720 | |||
721 | /* -------------------------------------------------------------------- | ||
722 | * PWM | ||
723 | * --------------------------------------------------------------------*/ | ||
724 | |||
725 | #if defined(CONFIG_ATMEL_PWM) | ||
726 | static u32 pwm_mask; | ||
727 | |||
728 | static struct resource pwm_resources[] = { | ||
729 | [0] = { | ||
730 | .start = AT91CAP9_BASE_PWMC, | ||
731 | .end = AT91CAP9_BASE_PWMC + SZ_16K - 1, | ||
732 | .flags = IORESOURCE_MEM, | ||
733 | }, | ||
734 | [1] = { | ||
735 | .start = AT91CAP9_ID_PWMC, | ||
736 | .end = AT91CAP9_ID_PWMC, | ||
737 | .flags = IORESOURCE_IRQ, | ||
738 | }, | ||
739 | }; | ||
740 | |||
741 | static struct platform_device at91cap9_pwm0_device = { | ||
742 | .name = "atmel_pwm", | ||
743 | .id = -1, | ||
744 | .dev = { | ||
745 | .platform_data = &pwm_mask, | ||
746 | }, | ||
747 | .resource = pwm_resources, | ||
748 | .num_resources = ARRAY_SIZE(pwm_resources), | ||
749 | }; | ||
750 | |||
751 | void __init at91_add_device_pwm(u32 mask) | ||
752 | { | ||
753 | if (mask & (1 << AT91_PWM0)) | ||
754 | at91_set_A_periph(AT91_PIN_PB19, 1); /* enable PWM0 */ | ||
755 | |||
756 | if (mask & (1 << AT91_PWM1)) | ||
757 | at91_set_B_periph(AT91_PIN_PB8, 1); /* enable PWM1 */ | ||
758 | |||
759 | if (mask & (1 << AT91_PWM2)) | ||
760 | at91_set_B_periph(AT91_PIN_PC29, 1); /* enable PWM2 */ | ||
761 | |||
762 | if (mask & (1 << AT91_PWM3)) | ||
763 | at91_set_B_periph(AT91_PIN_PA11, 1); /* enable PWM3 */ | ||
764 | |||
765 | pwm_mask = mask; | ||
766 | |||
767 | platform_device_register(&at91cap9_pwm0_device); | ||
768 | } | ||
769 | #else | ||
770 | void __init at91_add_device_pwm(u32 mask) {} | ||
771 | #endif | ||
772 | |||
773 | |||
774 | |||
775 | /* -------------------------------------------------------------------- | ||
776 | * AC97 | ||
777 | * -------------------------------------------------------------------- */ | ||
778 | |||
779 | #if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE) | ||
780 | static u64 ac97_dmamask = DMA_BIT_MASK(32); | ||
781 | static struct ac97c_platform_data ac97_data; | ||
782 | |||
783 | static struct resource ac97_resources[] = { | ||
784 | [0] = { | ||
785 | .start = AT91CAP9_BASE_AC97C, | ||
786 | .end = AT91CAP9_BASE_AC97C + SZ_16K - 1, | ||
787 | .flags = IORESOURCE_MEM, | ||
788 | }, | ||
789 | [1] = { | ||
790 | .start = AT91CAP9_ID_AC97C, | ||
791 | .end = AT91CAP9_ID_AC97C, | ||
792 | .flags = IORESOURCE_IRQ, | ||
793 | }, | ||
794 | }; | ||
795 | |||
796 | static struct platform_device at91cap9_ac97_device = { | ||
797 | .name = "atmel_ac97c", | ||
798 | .id = 1, | ||
799 | .dev = { | ||
800 | .dma_mask = &ac97_dmamask, | ||
801 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
802 | .platform_data = &ac97_data, | ||
803 | }, | ||
804 | .resource = ac97_resources, | ||
805 | .num_resources = ARRAY_SIZE(ac97_resources), | ||
806 | }; | ||
807 | |||
808 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) | ||
809 | { | ||
810 | if (!data) | ||
811 | return; | ||
812 | |||
813 | at91_set_A_periph(AT91_PIN_PA6, 0); /* AC97FS */ | ||
814 | at91_set_A_periph(AT91_PIN_PA7, 0); /* AC97CK */ | ||
815 | at91_set_A_periph(AT91_PIN_PA8, 0); /* AC97TX */ | ||
816 | at91_set_A_periph(AT91_PIN_PA9, 0); /* AC97RX */ | ||
817 | |||
818 | /* reset */ | ||
819 | if (gpio_is_valid(data->reset_pin)) | ||
820 | at91_set_gpio_output(data->reset_pin, 0); | ||
821 | |||
822 | ac97_data = *data; | ||
823 | platform_device_register(&at91cap9_ac97_device); | ||
824 | } | ||
825 | #else | ||
826 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} | ||
827 | #endif | ||
828 | |||
829 | |||
830 | /* -------------------------------------------------------------------- | ||
831 | * LCD Controller | ||
832 | * -------------------------------------------------------------------- */ | ||
833 | |||
834 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | ||
835 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); | ||
836 | static struct atmel_lcdfb_info lcdc_data; | ||
837 | |||
838 | static struct resource lcdc_resources[] = { | ||
839 | [0] = { | ||
840 | .start = AT91CAP9_LCDC_BASE, | ||
841 | .end = AT91CAP9_LCDC_BASE + SZ_4K - 1, | ||
842 | .flags = IORESOURCE_MEM, | ||
843 | }, | ||
844 | [1] = { | ||
845 | .start = AT91CAP9_ID_LCDC, | ||
846 | .end = AT91CAP9_ID_LCDC, | ||
847 | .flags = IORESOURCE_IRQ, | ||
848 | }, | ||
849 | }; | ||
850 | |||
851 | static struct platform_device at91_lcdc_device = { | ||
852 | .name = "atmel_lcdfb", | ||
853 | .id = 0, | ||
854 | .dev = { | ||
855 | .dma_mask = &lcdc_dmamask, | ||
856 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
857 | .platform_data = &lcdc_data, | ||
858 | }, | ||
859 | .resource = lcdc_resources, | ||
860 | .num_resources = ARRAY_SIZE(lcdc_resources), | ||
861 | }; | ||
862 | |||
863 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | ||
864 | { | ||
865 | if (!data) | ||
866 | return; | ||
867 | |||
868 | if (cpu_is_at91cap9_revB()) | ||
869 | irq_set_irq_type(AT91CAP9_ID_LCDC, IRQ_TYPE_LEVEL_HIGH); | ||
870 | |||
871 | at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ | ||
872 | at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ | ||
873 | at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ | ||
874 | at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */ | ||
875 | at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */ | ||
876 | at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */ | ||
877 | at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */ | ||
878 | at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */ | ||
879 | at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */ | ||
880 | at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */ | ||
881 | at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */ | ||
882 | at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */ | ||
883 | at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */ | ||
884 | at91_set_A_periph(AT91_PIN_PC17, 0); /* LCDD13 */ | ||
885 | at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */ | ||
886 | at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */ | ||
887 | at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */ | ||
888 | at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */ | ||
889 | at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */ | ||
890 | at91_set_A_periph(AT91_PIN_PC25, 0); /* LCDD21 */ | ||
891 | at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */ | ||
892 | at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */ | ||
893 | |||
894 | lcdc_data = *data; | ||
895 | platform_device_register(&at91_lcdc_device); | ||
896 | } | ||
897 | #else | ||
898 | void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {} | ||
899 | #endif | ||
900 | |||
901 | |||
902 | /* -------------------------------------------------------------------- | ||
903 | * SSC -- Synchronous Serial Controller | ||
904 | * -------------------------------------------------------------------- */ | ||
905 | |||
906 | #if defined(CONFIG_ATMEL_SSC) || defined(CONFIG_ATMEL_SSC_MODULE) | ||
907 | static u64 ssc0_dmamask = DMA_BIT_MASK(32); | ||
908 | |||
909 | static struct resource ssc0_resources[] = { | ||
910 | [0] = { | ||
911 | .start = AT91CAP9_BASE_SSC0, | ||
912 | .end = AT91CAP9_BASE_SSC0 + SZ_16K - 1, | ||
913 | .flags = IORESOURCE_MEM, | ||
914 | }, | ||
915 | [1] = { | ||
916 | .start = AT91CAP9_ID_SSC0, | ||
917 | .end = AT91CAP9_ID_SSC0, | ||
918 | .flags = IORESOURCE_IRQ, | ||
919 | }, | ||
920 | }; | ||
921 | |||
922 | static struct platform_device at91cap9_ssc0_device = { | ||
923 | .name = "ssc", | ||
924 | .id = 0, | ||
925 | .dev = { | ||
926 | .dma_mask = &ssc0_dmamask, | ||
927 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
928 | }, | ||
929 | .resource = ssc0_resources, | ||
930 | .num_resources = ARRAY_SIZE(ssc0_resources), | ||
931 | }; | ||
932 | |||
933 | static inline void configure_ssc0_pins(unsigned pins) | ||
934 | { | ||
935 | if (pins & ATMEL_SSC_TF) | ||
936 | at91_set_A_periph(AT91_PIN_PB0, 1); | ||
937 | if (pins & ATMEL_SSC_TK) | ||
938 | at91_set_A_periph(AT91_PIN_PB1, 1); | ||
939 | if (pins & ATMEL_SSC_TD) | ||
940 | at91_set_A_periph(AT91_PIN_PB2, 1); | ||
941 | if (pins & ATMEL_SSC_RD) | ||
942 | at91_set_A_periph(AT91_PIN_PB3, 1); | ||
943 | if (pins & ATMEL_SSC_RK) | ||
944 | at91_set_A_periph(AT91_PIN_PB4, 1); | ||
945 | if (pins & ATMEL_SSC_RF) | ||
946 | at91_set_A_periph(AT91_PIN_PB5, 1); | ||
947 | } | ||
948 | |||
949 | static u64 ssc1_dmamask = DMA_BIT_MASK(32); | ||
950 | |||
951 | static struct resource ssc1_resources[] = { | ||
952 | [0] = { | ||
953 | .start = AT91CAP9_BASE_SSC1, | ||
954 | .end = AT91CAP9_BASE_SSC1 + SZ_16K - 1, | ||
955 | .flags = IORESOURCE_MEM, | ||
956 | }, | ||
957 | [1] = { | ||
958 | .start = AT91CAP9_ID_SSC1, | ||
959 | .end = AT91CAP9_ID_SSC1, | ||
960 | .flags = IORESOURCE_IRQ, | ||
961 | }, | ||
962 | }; | ||
963 | |||
964 | static struct platform_device at91cap9_ssc1_device = { | ||
965 | .name = "ssc", | ||
966 | .id = 1, | ||
967 | .dev = { | ||
968 | .dma_mask = &ssc1_dmamask, | ||
969 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
970 | }, | ||
971 | .resource = ssc1_resources, | ||
972 | .num_resources = ARRAY_SIZE(ssc1_resources), | ||
973 | }; | ||
974 | |||
975 | static inline void configure_ssc1_pins(unsigned pins) | ||
976 | { | ||
977 | if (pins & ATMEL_SSC_TF) | ||
978 | at91_set_A_periph(AT91_PIN_PB6, 1); | ||
979 | if (pins & ATMEL_SSC_TK) | ||
980 | at91_set_A_periph(AT91_PIN_PB7, 1); | ||
981 | if (pins & ATMEL_SSC_TD) | ||
982 | at91_set_A_periph(AT91_PIN_PB8, 1); | ||
983 | if (pins & ATMEL_SSC_RD) | ||
984 | at91_set_A_periph(AT91_PIN_PB9, 1); | ||
985 | if (pins & ATMEL_SSC_RK) | ||
986 | at91_set_A_periph(AT91_PIN_PB10, 1); | ||
987 | if (pins & ATMEL_SSC_RF) | ||
988 | at91_set_A_periph(AT91_PIN_PB11, 1); | ||
989 | } | ||
990 | |||
991 | /* | ||
992 | * SSC controllers are accessed through library code, instead of any | ||
993 | * kind of all-singing/all-dancing driver. For example one could be | ||
994 | * used by a particular I2S audio codec's driver, while another one | ||
995 | * on the same system might be used by a custom data capture driver. | ||
996 | */ | ||
997 | void __init at91_add_device_ssc(unsigned id, unsigned pins) | ||
998 | { | ||
999 | struct platform_device *pdev; | ||
1000 | |||
1001 | /* | ||
1002 | * NOTE: caller is responsible for passing information matching | ||
1003 | * "pins" to whatever will be using each particular controller. | ||
1004 | */ | ||
1005 | switch (id) { | ||
1006 | case AT91CAP9_ID_SSC0: | ||
1007 | pdev = &at91cap9_ssc0_device; | ||
1008 | configure_ssc0_pins(pins); | ||
1009 | break; | ||
1010 | case AT91CAP9_ID_SSC1: | ||
1011 | pdev = &at91cap9_ssc1_device; | ||
1012 | configure_ssc1_pins(pins); | ||
1013 | break; | ||
1014 | default: | ||
1015 | return; | ||
1016 | } | ||
1017 | |||
1018 | platform_device_register(pdev); | ||
1019 | } | ||
1020 | |||
1021 | #else | ||
1022 | void __init at91_add_device_ssc(unsigned id, unsigned pins) {} | ||
1023 | #endif | ||
1024 | |||
1025 | |||
1026 | /* -------------------------------------------------------------------- | ||
1027 | * UART | ||
1028 | * -------------------------------------------------------------------- */ | ||
1029 | |||
1030 | #if defined(CONFIG_SERIAL_ATMEL) | ||
1031 | static struct resource dbgu_resources[] = { | ||
1032 | [0] = { | ||
1033 | .start = AT91CAP9_BASE_DBGU, | ||
1034 | .end = AT91CAP9_BASE_DBGU + SZ_512 - 1, | ||
1035 | .flags = IORESOURCE_MEM, | ||
1036 | }, | ||
1037 | [1] = { | ||
1038 | .start = AT91_ID_SYS, | ||
1039 | .end = AT91_ID_SYS, | ||
1040 | .flags = IORESOURCE_IRQ, | ||
1041 | }, | ||
1042 | }; | ||
1043 | |||
1044 | static struct atmel_uart_data dbgu_data = { | ||
1045 | .use_dma_tx = 0, | ||
1046 | .use_dma_rx = 0, /* DBGU not capable of receive DMA */ | ||
1047 | }; | ||
1048 | |||
1049 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
1050 | |||
1051 | static struct platform_device at91cap9_dbgu_device = { | ||
1052 | .name = "atmel_usart", | ||
1053 | .id = 0, | ||
1054 | .dev = { | ||
1055 | .dma_mask = &dbgu_dmamask, | ||
1056 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1057 | .platform_data = &dbgu_data, | ||
1058 | }, | ||
1059 | .resource = dbgu_resources, | ||
1060 | .num_resources = ARRAY_SIZE(dbgu_resources), | ||
1061 | }; | ||
1062 | |||
1063 | static inline void configure_dbgu_pins(void) | ||
1064 | { | ||
1065 | at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */ | ||
1066 | at91_set_A_periph(AT91_PIN_PC31, 1); /* DTXD */ | ||
1067 | } | ||
1068 | |||
1069 | static struct resource uart0_resources[] = { | ||
1070 | [0] = { | ||
1071 | .start = AT91CAP9_BASE_US0, | ||
1072 | .end = AT91CAP9_BASE_US0 + SZ_16K - 1, | ||
1073 | .flags = IORESOURCE_MEM, | ||
1074 | }, | ||
1075 | [1] = { | ||
1076 | .start = AT91CAP9_ID_US0, | ||
1077 | .end = AT91CAP9_ID_US0, | ||
1078 | .flags = IORESOURCE_IRQ, | ||
1079 | }, | ||
1080 | }; | ||
1081 | |||
1082 | static struct atmel_uart_data uart0_data = { | ||
1083 | .use_dma_tx = 1, | ||
1084 | .use_dma_rx = 1, | ||
1085 | }; | ||
1086 | |||
1087 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
1088 | |||
1089 | static struct platform_device at91cap9_uart0_device = { | ||
1090 | .name = "atmel_usart", | ||
1091 | .id = 1, | ||
1092 | .dev = { | ||
1093 | .dma_mask = &uart0_dmamask, | ||
1094 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1095 | .platform_data = &uart0_data, | ||
1096 | }, | ||
1097 | .resource = uart0_resources, | ||
1098 | .num_resources = ARRAY_SIZE(uart0_resources), | ||
1099 | }; | ||
1100 | |||
1101 | static inline void configure_usart0_pins(unsigned pins) | ||
1102 | { | ||
1103 | at91_set_A_periph(AT91_PIN_PA22, 1); /* TXD0 */ | ||
1104 | at91_set_A_periph(AT91_PIN_PA23, 0); /* RXD0 */ | ||
1105 | |||
1106 | if (pins & ATMEL_UART_RTS) | ||
1107 | at91_set_A_periph(AT91_PIN_PA24, 0); /* RTS0 */ | ||
1108 | if (pins & ATMEL_UART_CTS) | ||
1109 | at91_set_A_periph(AT91_PIN_PA25, 0); /* CTS0 */ | ||
1110 | } | ||
1111 | |||
1112 | static struct resource uart1_resources[] = { | ||
1113 | [0] = { | ||
1114 | .start = AT91CAP9_BASE_US1, | ||
1115 | .end = AT91CAP9_BASE_US1 + SZ_16K - 1, | ||
1116 | .flags = IORESOURCE_MEM, | ||
1117 | }, | ||
1118 | [1] = { | ||
1119 | .start = AT91CAP9_ID_US1, | ||
1120 | .end = AT91CAP9_ID_US1, | ||
1121 | .flags = IORESOURCE_IRQ, | ||
1122 | }, | ||
1123 | }; | ||
1124 | |||
1125 | static struct atmel_uart_data uart1_data = { | ||
1126 | .use_dma_tx = 1, | ||
1127 | .use_dma_rx = 1, | ||
1128 | }; | ||
1129 | |||
1130 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
1131 | |||
1132 | static struct platform_device at91cap9_uart1_device = { | ||
1133 | .name = "atmel_usart", | ||
1134 | .id = 2, | ||
1135 | .dev = { | ||
1136 | .dma_mask = &uart1_dmamask, | ||
1137 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1138 | .platform_data = &uart1_data, | ||
1139 | }, | ||
1140 | .resource = uart1_resources, | ||
1141 | .num_resources = ARRAY_SIZE(uart1_resources), | ||
1142 | }; | ||
1143 | |||
1144 | static inline void configure_usart1_pins(unsigned pins) | ||
1145 | { | ||
1146 | at91_set_A_periph(AT91_PIN_PD0, 1); /* TXD1 */ | ||
1147 | at91_set_A_periph(AT91_PIN_PD1, 0); /* RXD1 */ | ||
1148 | |||
1149 | if (pins & ATMEL_UART_RTS) | ||
1150 | at91_set_B_periph(AT91_PIN_PD7, 0); /* RTS1 */ | ||
1151 | if (pins & ATMEL_UART_CTS) | ||
1152 | at91_set_B_periph(AT91_PIN_PD8, 0); /* CTS1 */ | ||
1153 | } | ||
1154 | |||
1155 | static struct resource uart2_resources[] = { | ||
1156 | [0] = { | ||
1157 | .start = AT91CAP9_BASE_US2, | ||
1158 | .end = AT91CAP9_BASE_US2 + SZ_16K - 1, | ||
1159 | .flags = IORESOURCE_MEM, | ||
1160 | }, | ||
1161 | [1] = { | ||
1162 | .start = AT91CAP9_ID_US2, | ||
1163 | .end = AT91CAP9_ID_US2, | ||
1164 | .flags = IORESOURCE_IRQ, | ||
1165 | }, | ||
1166 | }; | ||
1167 | |||
1168 | static struct atmel_uart_data uart2_data = { | ||
1169 | .use_dma_tx = 1, | ||
1170 | .use_dma_rx = 1, | ||
1171 | }; | ||
1172 | |||
1173 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
1174 | |||
1175 | static struct platform_device at91cap9_uart2_device = { | ||
1176 | .name = "atmel_usart", | ||
1177 | .id = 3, | ||
1178 | .dev = { | ||
1179 | .dma_mask = &uart2_dmamask, | ||
1180 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1181 | .platform_data = &uart2_data, | ||
1182 | }, | ||
1183 | .resource = uart2_resources, | ||
1184 | .num_resources = ARRAY_SIZE(uart2_resources), | ||
1185 | }; | ||
1186 | |||
1187 | static inline void configure_usart2_pins(unsigned pins) | ||
1188 | { | ||
1189 | at91_set_A_periph(AT91_PIN_PD2, 1); /* TXD2 */ | ||
1190 | at91_set_A_periph(AT91_PIN_PD3, 0); /* RXD2 */ | ||
1191 | |||
1192 | if (pins & ATMEL_UART_RTS) | ||
1193 | at91_set_B_periph(AT91_PIN_PD5, 0); /* RTS2 */ | ||
1194 | if (pins & ATMEL_UART_CTS) | ||
1195 | at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ | ||
1196 | } | ||
1197 | |||
1198 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | ||
1199 | struct platform_device *atmel_default_console_device; /* the serial console device */ | ||
1200 | |||
1201 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | ||
1202 | { | ||
1203 | struct platform_device *pdev; | ||
1204 | struct atmel_uart_data *pdata; | ||
1205 | |||
1206 | switch (id) { | ||
1207 | case 0: /* DBGU */ | ||
1208 | pdev = &at91cap9_dbgu_device; | ||
1209 | configure_dbgu_pins(); | ||
1210 | break; | ||
1211 | case AT91CAP9_ID_US0: | ||
1212 | pdev = &at91cap9_uart0_device; | ||
1213 | configure_usart0_pins(pins); | ||
1214 | break; | ||
1215 | case AT91CAP9_ID_US1: | ||
1216 | pdev = &at91cap9_uart1_device; | ||
1217 | configure_usart1_pins(pins); | ||
1218 | break; | ||
1219 | case AT91CAP9_ID_US2: | ||
1220 | pdev = &at91cap9_uart2_device; | ||
1221 | configure_usart2_pins(pins); | ||
1222 | break; | ||
1223 | default: | ||
1224 | return; | ||
1225 | } | ||
1226 | pdata = pdev->dev.platform_data; | ||
1227 | pdata->num = portnr; /* update to mapped ID */ | ||
1228 | |||
1229 | if (portnr < ATMEL_MAX_UART) | ||
1230 | at91_uarts[portnr] = pdev; | ||
1231 | } | ||
1232 | |||
1233 | void __init at91_set_serial_console(unsigned portnr) | ||
1234 | { | ||
1235 | if (portnr < ATMEL_MAX_UART) { | ||
1236 | atmel_default_console_device = at91_uarts[portnr]; | ||
1237 | at91cap9_set_console_clock(at91_uarts[portnr]->id); | ||
1238 | } | ||
1239 | } | ||
1240 | |||
1241 | void __init at91_add_device_serial(void) | ||
1242 | { | ||
1243 | int i; | ||
1244 | |||
1245 | for (i = 0; i < ATMEL_MAX_UART; i++) { | ||
1246 | if (at91_uarts[i]) | ||
1247 | platform_device_register(at91_uarts[i]); | ||
1248 | } | ||
1249 | |||
1250 | if (!atmel_default_console_device) | ||
1251 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
1252 | } | ||
1253 | #else | ||
1254 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} | ||
1255 | void __init at91_set_serial_console(unsigned portnr) {} | ||
1256 | void __init at91_add_device_serial(void) {} | ||
1257 | #endif | ||
1258 | |||
1259 | |||
1260 | /* -------------------------------------------------------------------- */ | ||
1261 | /* | ||
1262 | * These devices are always present and don't need any board-specific | ||
1263 | * setup. | ||
1264 | */ | ||
1265 | static int __init at91_add_standard_devices(void) | ||
1266 | { | ||
1267 | at91_add_device_rtt(); | ||
1268 | at91_add_device_watchdog(); | ||
1269 | at91_add_device_tc(); | ||
1270 | return 0; | ||
1271 | } | ||
1272 | |||
1273 | arch_initcall(at91_add_standard_devices); | ||
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c deleted file mode 100644 index ac3de4f7c31d..000000000000 --- a/arch/arm/mach-at91/board-cap9adk.c +++ /dev/null | |||
@@ -1,396 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-at91/board-cap9adk.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2005 SAN People | ||
7 | * Copyright (C) 2007 Atmel Corporation. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
22 | */ | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/mm.h> | ||
28 | #include <linux/module.h> | ||
29 | #include <linux/platform_device.h> | ||
30 | #include <linux/spi/spi.h> | ||
31 | #include <linux/spi/ads7846.h> | ||
32 | #include <linux/fb.h> | ||
33 | #include <linux/mtd/physmap.h> | ||
34 | |||
35 | #include <video/atmel_lcdc.h> | ||
36 | |||
37 | #include <mach/hardware.h> | ||
38 | #include <asm/setup.h> | ||
39 | #include <asm/mach-types.h> | ||
40 | |||
41 | #include <asm/mach/arch.h> | ||
42 | #include <asm/mach/map.h> | ||
43 | |||
44 | #include <mach/board.h> | ||
45 | #include <mach/at91cap9_matrix.h> | ||
46 | #include <mach/at91sam9_smc.h> | ||
47 | #include <mach/system_rev.h> | ||
48 | |||
49 | #include "sam9_smc.h" | ||
50 | #include "generic.h" | ||
51 | |||
52 | |||
53 | static void __init cap9adk_init_early(void) | ||
54 | { | ||
55 | /* Initialize processor: 12 MHz crystal */ | ||
56 | at91_initialize(12000000); | ||
57 | |||
58 | /* Setup the LEDs: USER1 and USER2 LED for cpu/timer... */ | ||
59 | at91_init_leds(AT91_PIN_PA10, AT91_PIN_PA11); | ||
60 | /* ... POWER LED always on */ | ||
61 | at91_set_gpio_output(AT91_PIN_PC29, 1); | ||
62 | |||
63 | /* Setup the serial ports and console */ | ||
64 | at91_register_uart(0, 0, 0); /* DBGU = ttyS0 */ | ||
65 | at91_set_serial_console(0); | ||
66 | } | ||
67 | |||
68 | /* | ||
69 | * USB Host port | ||
70 | */ | ||
71 | static struct at91_usbh_data __initdata cap9adk_usbh_data = { | ||
72 | .ports = 2, | ||
73 | .vbus_pin = {-EINVAL, -EINVAL}, | ||
74 | .overcurrent_pin= {-EINVAL, -EINVAL}, | ||
75 | }; | ||
76 | |||
77 | /* | ||
78 | * USB HS Device port | ||
79 | */ | ||
80 | static struct usba_platform_data __initdata cap9adk_usba_udc_data = { | ||
81 | .vbus_pin = AT91_PIN_PB31, | ||
82 | }; | ||
83 | |||
84 | /* | ||
85 | * ADS7846 Touchscreen | ||
86 | */ | ||
87 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
88 | static int ads7843_pendown_state(void) | ||
89 | { | ||
90 | return !at91_get_gpio_value(AT91_PIN_PC4); /* Touchscreen PENIRQ */ | ||
91 | } | ||
92 | |||
93 | static struct ads7846_platform_data ads_info = { | ||
94 | .model = 7843, | ||
95 | .x_min = 150, | ||
96 | .x_max = 3830, | ||
97 | .y_min = 190, | ||
98 | .y_max = 3830, | ||
99 | .vref_delay_usecs = 100, | ||
100 | .x_plate_ohms = 450, | ||
101 | .y_plate_ohms = 250, | ||
102 | .pressure_max = 15000, | ||
103 | .debounce_max = 1, | ||
104 | .debounce_rep = 0, | ||
105 | .debounce_tol = (~0), | ||
106 | .get_pendown_state = ads7843_pendown_state, | ||
107 | }; | ||
108 | |||
109 | static void __init cap9adk_add_device_ts(void) | ||
110 | { | ||
111 | at91_set_gpio_input(AT91_PIN_PC4, 1); /* Touchscreen PENIRQ */ | ||
112 | at91_set_gpio_input(AT91_PIN_PC5, 1); /* Touchscreen BUSY */ | ||
113 | } | ||
114 | #else | ||
115 | static void __init cap9adk_add_device_ts(void) {} | ||
116 | #endif | ||
117 | |||
118 | |||
119 | /* | ||
120 | * SPI devices. | ||
121 | */ | ||
122 | static struct spi_board_info cap9adk_spi_devices[] = { | ||
123 | #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) | ||
124 | { /* DataFlash card */ | ||
125 | .modalias = "mtd_dataflash", | ||
126 | .chip_select = 0, | ||
127 | .max_speed_hz = 15 * 1000 * 1000, | ||
128 | .bus_num = 0, | ||
129 | }, | ||
130 | #endif | ||
131 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | ||
132 | { | ||
133 | .modalias = "ads7846", | ||
134 | .chip_select = 3, /* can be 2 or 3, depending on J2 jumper */ | ||
135 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ | ||
136 | .bus_num = 0, | ||
137 | .platform_data = &ads_info, | ||
138 | .irq = AT91_PIN_PC4, | ||
139 | }, | ||
140 | #endif | ||
141 | }; | ||
142 | |||
143 | |||
144 | /* | ||
145 | * MCI (SD/MMC) | ||
146 | */ | ||
147 | static struct at91_mmc_data __initdata cap9adk_mmc_data = { | ||
148 | .wire4 = 1, | ||
149 | .det_pin = -EINVAL, | ||
150 | .wp_pin = -EINVAL, | ||
151 | .vcc_pin = -EINVAL, | ||
152 | }; | ||
153 | |||
154 | |||
155 | /* | ||
156 | * MACB Ethernet device | ||
157 | */ | ||
158 | static struct macb_platform_data __initdata cap9adk_macb_data = { | ||
159 | .phy_irq_pin = -EINVAL, | ||
160 | .is_rmii = 1, | ||
161 | }; | ||
162 | |||
163 | |||
164 | /* | ||
165 | * NAND flash | ||
166 | */ | ||
167 | static struct mtd_partition __initdata cap9adk_nand_partitions[] = { | ||
168 | { | ||
169 | .name = "NAND partition", | ||
170 | .offset = 0, | ||
171 | .size = MTDPART_SIZ_FULL, | ||
172 | }, | ||
173 | }; | ||
174 | |||
175 | static struct atmel_nand_data __initdata cap9adk_nand_data = { | ||
176 | .ale = 21, | ||
177 | .cle = 22, | ||
178 | .det_pin = -EINVAL, | ||
179 | .rdy_pin = -EINVAL, | ||
180 | .enable_pin = AT91_PIN_PD15, | ||
181 | .parts = cap9adk_nand_partitions, | ||
182 | .num_parts = ARRAY_SIZE(cap9adk_nand_partitions), | ||
183 | }; | ||
184 | |||
185 | static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { | ||
186 | .ncs_read_setup = 1, | ||
187 | .nrd_setup = 2, | ||
188 | .ncs_write_setup = 1, | ||
189 | .nwe_setup = 2, | ||
190 | |||
191 | .ncs_read_pulse = 6, | ||
192 | .nrd_pulse = 4, | ||
193 | .ncs_write_pulse = 6, | ||
194 | .nwe_pulse = 4, | ||
195 | |||
196 | .read_cycle = 8, | ||
197 | .write_cycle = 8, | ||
198 | |||
199 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE, | ||
200 | .tdf_cycles = 1, | ||
201 | }; | ||
202 | |||
203 | static void __init cap9adk_add_device_nand(void) | ||
204 | { | ||
205 | unsigned long csa; | ||
206 | |||
207 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | ||
208 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); | ||
209 | |||
210 | cap9adk_nand_data.bus_width_16 = board_have_nand_16bit(); | ||
211 | /* setup bus-width (8 or 16) */ | ||
212 | if (cap9adk_nand_data.bus_width_16) | ||
213 | cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16; | ||
214 | else | ||
215 | cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8; | ||
216 | |||
217 | /* configure chip-select 3 (NAND) */ | ||
218 | sam9_smc_configure(0, 3, &cap9adk_nand_smc_config); | ||
219 | |||
220 | at91_add_device_nand(&cap9adk_nand_data); | ||
221 | } | ||
222 | |||
223 | |||
224 | /* | ||
225 | * NOR flash | ||
226 | */ | ||
227 | static struct mtd_partition cap9adk_nor_partitions[] = { | ||
228 | { | ||
229 | .name = "NOR partition", | ||
230 | .offset = 0, | ||
231 | .size = MTDPART_SIZ_FULL, | ||
232 | }, | ||
233 | }; | ||
234 | |||
235 | static struct physmap_flash_data cap9adk_nor_data = { | ||
236 | .width = 2, | ||
237 | .parts = cap9adk_nor_partitions, | ||
238 | .nr_parts = ARRAY_SIZE(cap9adk_nor_partitions), | ||
239 | }; | ||
240 | |||
241 | #define NOR_BASE AT91_CHIPSELECT_0 | ||
242 | #define NOR_SIZE SZ_8M | ||
243 | |||
244 | static struct resource nor_flash_resources[] = { | ||
245 | { | ||
246 | .start = NOR_BASE, | ||
247 | .end = NOR_BASE + NOR_SIZE - 1, | ||
248 | .flags = IORESOURCE_MEM, | ||
249 | } | ||
250 | }; | ||
251 | |||
252 | static struct platform_device cap9adk_nor_flash = { | ||
253 | .name = "physmap-flash", | ||
254 | .id = 0, | ||
255 | .dev = { | ||
256 | .platform_data = &cap9adk_nor_data, | ||
257 | }, | ||
258 | .resource = nor_flash_resources, | ||
259 | .num_resources = ARRAY_SIZE(nor_flash_resources), | ||
260 | }; | ||
261 | |||
262 | static struct sam9_smc_config __initdata cap9adk_nor_smc_config = { | ||
263 | .ncs_read_setup = 2, | ||
264 | .nrd_setup = 4, | ||
265 | .ncs_write_setup = 2, | ||
266 | .nwe_setup = 4, | ||
267 | |||
268 | .ncs_read_pulse = 10, | ||
269 | .nrd_pulse = 8, | ||
270 | .ncs_write_pulse = 10, | ||
271 | .nwe_pulse = 8, | ||
272 | |||
273 | .read_cycle = 16, | ||
274 | .write_cycle = 16, | ||
275 | |||
276 | .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16, | ||
277 | .tdf_cycles = 1, | ||
278 | }; | ||
279 | |||
280 | static __init void cap9adk_add_device_nor(void) | ||
281 | { | ||
282 | unsigned long csa; | ||
283 | |||
284 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | ||
285 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); | ||
286 | |||
287 | /* configure chip-select 0 (NOR) */ | ||
288 | sam9_smc_configure(0, 0, &cap9adk_nor_smc_config); | ||
289 | |||
290 | platform_device_register(&cap9adk_nor_flash); | ||
291 | } | ||
292 | |||
293 | |||
294 | /* | ||
295 | * LCD Controller | ||
296 | */ | ||
297 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | ||
298 | static struct fb_videomode at91_tft_vga_modes[] = { | ||
299 | { | ||
300 | .name = "TX09D50VM1CCA @ 60", | ||
301 | .refresh = 60, | ||
302 | .xres = 240, .yres = 320, | ||
303 | .pixclock = KHZ2PICOS(4965), | ||
304 | |||
305 | .left_margin = 1, .right_margin = 33, | ||
306 | .upper_margin = 1, .lower_margin = 0, | ||
307 | .hsync_len = 5, .vsync_len = 1, | ||
308 | |||
309 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
310 | .vmode = FB_VMODE_NONINTERLACED, | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static struct fb_monspecs at91fb_default_monspecs = { | ||
315 | .manufacturer = "HIT", | ||
316 | .monitor = "TX09D70VM1CCA", | ||
317 | |||
318 | .modedb = at91_tft_vga_modes, | ||
319 | .modedb_len = ARRAY_SIZE(at91_tft_vga_modes), | ||
320 | .hfmin = 15000, | ||
321 | .hfmax = 64000, | ||
322 | .vfmin = 50, | ||
323 | .vfmax = 150, | ||
324 | }; | ||
325 | |||
326 | #define AT91CAP9_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \ | ||
327 | | ATMEL_LCDC_DISTYPE_TFT \ | ||
328 | | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) | ||
329 | |||
330 | static void at91_lcdc_power_control(int on) | ||
331 | { | ||
332 | if (on) | ||
333 | at91_set_gpio_value(AT91_PIN_PC0, 0); /* power up */ | ||
334 | else | ||
335 | at91_set_gpio_value(AT91_PIN_PC0, 1); /* power down */ | ||
336 | } | ||
337 | |||
338 | /* Driver datas */ | ||
339 | static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data = { | ||
340 | .default_bpp = 16, | ||
341 | .default_dmacon = ATMEL_LCDC_DMAEN, | ||
342 | .default_lcdcon2 = AT91CAP9_DEFAULT_LCDCON2, | ||
343 | .default_monspecs = &at91fb_default_monspecs, | ||
344 | .atmel_lcdfb_power_control = at91_lcdc_power_control, | ||
345 | .guard_time = 1, | ||
346 | }; | ||
347 | |||
348 | #else | ||
349 | static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data; | ||
350 | #endif | ||
351 | |||
352 | |||
353 | /* | ||
354 | * AC97 | ||
355 | */ | ||
356 | static struct ac97c_platform_data cap9adk_ac97_data = { | ||
357 | .reset_pin = -EINVAL, | ||
358 | }; | ||
359 | |||
360 | |||
361 | static void __init cap9adk_board_init(void) | ||
362 | { | ||
363 | /* Serial */ | ||
364 | at91_add_device_serial(); | ||
365 | /* USB Host */ | ||
366 | at91_add_device_usbh(&cap9adk_usbh_data); | ||
367 | /* USB HS */ | ||
368 | at91_add_device_usba(&cap9adk_usba_udc_data); | ||
369 | /* SPI */ | ||
370 | at91_add_device_spi(cap9adk_spi_devices, ARRAY_SIZE(cap9adk_spi_devices)); | ||
371 | /* Touchscreen */ | ||
372 | cap9adk_add_device_ts(); | ||
373 | /* MMC */ | ||
374 | at91_add_device_mmc(1, &cap9adk_mmc_data); | ||
375 | /* Ethernet */ | ||
376 | at91_add_device_eth(&cap9adk_macb_data); | ||
377 | /* NAND */ | ||
378 | cap9adk_add_device_nand(); | ||
379 | /* NOR Flash */ | ||
380 | cap9adk_add_device_nor(); | ||
381 | /* I2C */ | ||
382 | at91_add_device_i2c(NULL, 0); | ||
383 | /* LCD Controller */ | ||
384 | at91_add_device_lcdc(&cap9adk_lcdc_data); | ||
385 | /* AC97 */ | ||
386 | at91_add_device_ac97(&cap9adk_ac97_data); | ||
387 | } | ||
388 | |||
389 | MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK") | ||
390 | /* Maintainer: Stelian Pop <stelian.pop@leadtechdesign.com> */ | ||
391 | .timer = &at91sam926x_timer, | ||
392 | .map_io = at91_map_io, | ||
393 | .init_early = cap9adk_init_early, | ||
394 | .init_irq = at91_init_irq_default, | ||
395 | .init_machine = cap9adk_board_init, | ||
396 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 61873f3aa92d..aa04e22a9da6 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c | |||
@@ -47,8 +47,7 @@ | |||
47 | /* | 47 | /* |
48 | * Chips have some kind of clocks : group them by functionality | 48 | * Chips have some kind of clocks : group them by functionality |
49 | */ | 49 | */ |
50 | #define cpu_has_utmi() ( cpu_is_at91cap9() \ | 50 | #define cpu_has_utmi() ( cpu_is_at91sam9rl() \ |
51 | || cpu_is_at91sam9rl() \ | ||
52 | || cpu_is_at91sam9g45()) | 51 | || cpu_is_at91sam9g45()) |
53 | 52 | ||
54 | #define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \ | 53 | #define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \ |
@@ -602,8 +601,6 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock) | |||
602 | cpu_is_at91sam9g10()) { | 601 | cpu_is_at91sam9g10()) { |
603 | uhpck.pmc_mask = AT91SAM926x_PMC_UHP; | 602 | uhpck.pmc_mask = AT91SAM926x_PMC_UHP; |
604 | udpck.pmc_mask = AT91SAM926x_PMC_UDP; | 603 | udpck.pmc_mask = AT91SAM926x_PMC_UDP; |
605 | } else if (cpu_is_at91cap9()) { | ||
606 | uhpck.pmc_mask = AT91CAP9_PMC_UHP; | ||
607 | } | 604 | } |
608 | at91_sys_write(AT91_CKGR_PLLBR, 0); | 605 | at91_sys_write(AT91_CKGR_PLLBR, 0); |
609 | 606 | ||
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index 594133451c0c..7e8280e798c1 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h | |||
@@ -45,7 +45,6 @@ extern void __init at91sam9261_set_console_clock(int id); | |||
45 | extern void __init at91sam9263_set_console_clock(int id); | 45 | extern void __init at91sam9263_set_console_clock(int id); |
46 | extern void __init at91sam9rl_set_console_clock(int id); | 46 | extern void __init at91sam9rl_set_console_clock(int id); |
47 | extern void __init at91sam9g45_set_console_clock(int id); | 47 | extern void __init at91sam9g45_set_console_clock(int id); |
48 | extern void __init at91cap9_set_console_clock(int id); | ||
49 | #ifdef CONFIG_AT91_PMC_UNIT | 48 | #ifdef CONFIG_AT91_PMC_UNIT |
50 | extern int __init at91_clock_init(unsigned long main_clock); | 49 | extern int __init at91_clock_init(unsigned long main_clock); |
51 | #else | 50 | #else |
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h index e46f93e34aab..dbdd6ae473d5 100644 --- a/arch/arm/mach-at91/include/mach/at91_pmc.h +++ b/arch/arm/mach-at91/include/mach/at91_pmc.h | |||
@@ -23,10 +23,8 @@ | |||
23 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ | 23 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ |
24 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ | 24 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ |
25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ | 25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ |
26 | #define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [CAP9 revC & some SAM9 only] */ | ||
27 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ | 26 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ |
28 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ | 27 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ |
29 | #define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */ | ||
30 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ | 28 | #define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ |
31 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ | 29 | #define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ |
32 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ | 30 | #define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ |
@@ -40,7 +38,7 @@ | |||
40 | #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ | 38 | #define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ |
41 | #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ | 39 | #define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ |
42 | 40 | ||
43 | #define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9, CAP9] */ | 41 | #define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9] */ |
44 | #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ | 42 | #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ |
45 | #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ | 43 | #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ |
46 | #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ | 44 | #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ |
@@ -48,7 +46,7 @@ | |||
48 | 46 | ||
49 | #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ | 47 | #define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ |
50 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ | 48 | #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ |
51 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [SAM9x, CAP9] */ | 49 | #define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [SAM9x] */ |
52 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ | 50 | #define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ |
53 | 51 | ||
54 | #define AT91_CKGR_MCFR (AT91_PMC + 0x24) /* Main Clock Frequency Register */ | 52 | #define AT91_CKGR_MCFR (AT91_PMC + 0x24) /* Main Clock Frequency Register */ |
@@ -87,7 +85,7 @@ | |||
87 | #define AT91RM9200_PMC_MDIV_2 (1 << 8) | 85 | #define AT91RM9200_PMC_MDIV_2 (1 << 8) |
88 | #define AT91RM9200_PMC_MDIV_3 (2 << 8) | 86 | #define AT91RM9200_PMC_MDIV_3 (2 << 8) |
89 | #define AT91RM9200_PMC_MDIV_4 (3 << 8) | 87 | #define AT91RM9200_PMC_MDIV_4 (3 << 8) |
90 | #define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */ | 88 | #define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */ |
91 | #define AT91SAM9_PMC_MDIV_2 (1 << 8) | 89 | #define AT91SAM9_PMC_MDIV_2 (1 << 8) |
92 | #define AT91SAM9_PMC_MDIV_4 (2 << 8) | 90 | #define AT91SAM9_PMC_MDIV_4 (2 << 8) |
93 | #define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */ | 91 | #define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */ |
@@ -117,17 +115,15 @@ | |||
117 | #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ | 115 | #define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ |
118 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ | 116 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ |
119 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ | 117 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ |
120 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9, AT91CAP9 only] */ | 118 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */ |
121 | #define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */ | ||
122 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ | 119 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ |
123 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ | 120 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ |
124 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ | 121 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ |
125 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ | 122 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ |
126 | #define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ | 123 | #define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ |
127 | 124 | ||
128 | #define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Protect Register [AT91CAP9 revC only] */ | 125 | #define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Write Protect Mode Register [some SAM9] */ |
129 | #define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */ | 126 | #define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */ |
130 | 127 | ||
131 | #define AT91_PMC_VER (AT91_PMC + 0xfc) /* PMC Module Version [AT91CAP9 only] */ | ||
132 | 128 | ||
133 | #endif | 129 | #endif |
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h deleted file mode 100644 index 61d952902f2b..000000000000 --- a/arch/arm/mach-at91/include/mach/at91cap9.h +++ /dev/null | |||
@@ -1,122 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91cap9.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2007 Atmel Corporation. | ||
7 | * | ||
8 | * Common definitions. | ||
9 | * Based on AT91CAP9 datasheet revision B (Preliminary). | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #ifndef AT91CAP9_H | ||
18 | #define AT91CAP9_H | ||
19 | |||
20 | /* | ||
21 | * Peripheral identifiers/interrupts. | ||
22 | */ | ||
23 | #define AT91CAP9_ID_PIOABCD 2 /* Parallel IO Controller A, B, C and D */ | ||
24 | #define AT91CAP9_ID_MPB0 3 /* MP Block Peripheral 0 */ | ||
25 | #define AT91CAP9_ID_MPB1 4 /* MP Block Peripheral 1 */ | ||
26 | #define AT91CAP9_ID_MPB2 5 /* MP Block Peripheral 2 */ | ||
27 | #define AT91CAP9_ID_MPB3 6 /* MP Block Peripheral 3 */ | ||
28 | #define AT91CAP9_ID_MPB4 7 /* MP Block Peripheral 4 */ | ||
29 | #define AT91CAP9_ID_US0 8 /* USART 0 */ | ||
30 | #define AT91CAP9_ID_US1 9 /* USART 1 */ | ||
31 | #define AT91CAP9_ID_US2 10 /* USART 2 */ | ||
32 | #define AT91CAP9_ID_MCI0 11 /* Multimedia Card Interface 0 */ | ||
33 | #define AT91CAP9_ID_MCI1 12 /* Multimedia Card Interface 1 */ | ||
34 | #define AT91CAP9_ID_CAN 13 /* CAN */ | ||
35 | #define AT91CAP9_ID_TWI 14 /* Two-Wire Interface */ | ||
36 | #define AT91CAP9_ID_SPI0 15 /* Serial Peripheral Interface 0 */ | ||
37 | #define AT91CAP9_ID_SPI1 16 /* Serial Peripheral Interface 0 */ | ||
38 | #define AT91CAP9_ID_SSC0 17 /* Serial Synchronous Controller 0 */ | ||
39 | #define AT91CAP9_ID_SSC1 18 /* Serial Synchronous Controller 1 */ | ||
40 | #define AT91CAP9_ID_AC97C 19 /* AC97 Controller */ | ||
41 | #define AT91CAP9_ID_TCB 20 /* Timer Counter 0, 1 and 2 */ | ||
42 | #define AT91CAP9_ID_PWMC 21 /* Pulse Width Modulation Controller */ | ||
43 | #define AT91CAP9_ID_EMAC 22 /* Ethernet */ | ||
44 | #define AT91CAP9_ID_AESTDES 23 /* Advanced Encryption Standard, Triple DES */ | ||
45 | #define AT91CAP9_ID_ADC 24 /* Analog-to-Digital Converter */ | ||
46 | #define AT91CAP9_ID_ISI 25 /* Image Sensor Interface */ | ||
47 | #define AT91CAP9_ID_LCDC 26 /* LCD Controller */ | ||
48 | #define AT91CAP9_ID_DMA 27 /* DMA Controller */ | ||
49 | #define AT91CAP9_ID_UDPHS 28 /* USB High Speed Device Port */ | ||
50 | #define AT91CAP9_ID_UHP 29 /* USB Host Port */ | ||
51 | #define AT91CAP9_ID_IRQ0 30 /* Advanced Interrupt Controller (IRQ0) */ | ||
52 | #define AT91CAP9_ID_IRQ1 31 /* Advanced Interrupt Controller (IRQ1) */ | ||
53 | |||
54 | /* | ||
55 | * User Peripheral physical base addresses. | ||
56 | */ | ||
57 | #define AT91CAP9_BASE_UDPHS 0xfff78000 | ||
58 | #define AT91CAP9_BASE_TCB0 0xfff7c000 | ||
59 | #define AT91CAP9_BASE_TC0 0xfff7c000 | ||
60 | #define AT91CAP9_BASE_TC1 0xfff7c040 | ||
61 | #define AT91CAP9_BASE_TC2 0xfff7c080 | ||
62 | #define AT91CAP9_BASE_MCI0 0xfff80000 | ||
63 | #define AT91CAP9_BASE_MCI1 0xfff84000 | ||
64 | #define AT91CAP9_BASE_TWI 0xfff88000 | ||
65 | #define AT91CAP9_BASE_US0 0xfff8c000 | ||
66 | #define AT91CAP9_BASE_US1 0xfff90000 | ||
67 | #define AT91CAP9_BASE_US2 0xfff94000 | ||
68 | #define AT91CAP9_BASE_SSC0 0xfff98000 | ||
69 | #define AT91CAP9_BASE_SSC1 0xfff9c000 | ||
70 | #define AT91CAP9_BASE_AC97C 0xfffa0000 | ||
71 | #define AT91CAP9_BASE_SPI0 0xfffa4000 | ||
72 | #define AT91CAP9_BASE_SPI1 0xfffa8000 | ||
73 | #define AT91CAP9_BASE_CAN 0xfffac000 | ||
74 | #define AT91CAP9_BASE_PWMC 0xfffb8000 | ||
75 | #define AT91CAP9_BASE_EMAC 0xfffbc000 | ||
76 | #define AT91CAP9_BASE_ADC 0xfffc0000 | ||
77 | #define AT91CAP9_BASE_ISI 0xfffc4000 | ||
78 | |||
79 | /* | ||
80 | * System Peripherals (offset from AT91_BASE_SYS) | ||
81 | */ | ||
82 | #define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS) | ||
83 | #define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) | ||
84 | #define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) | ||
85 | #define AT91_PMC (0xfffffc00 - AT91_BASE_SYS) | ||
86 | #define AT91_GPBR (cpu_is_at91cap9_revB() ? \ | ||
87 | (0xfffffd50 - AT91_BASE_SYS) : \ | ||
88 | (0xfffffd60 - AT91_BASE_SYS)) | ||
89 | |||
90 | #define AT91CAP9_BASE_ECC 0xffffe200 | ||
91 | #define AT91CAP9_BASE_DMA 0xffffec00 | ||
92 | #define AT91CAP9_BASE_SMC 0xffffe800 | ||
93 | #define AT91CAP9_BASE_DBGU AT91_BASE_DBGU1 | ||
94 | #define AT91CAP9_BASE_PIOA 0xfffff200 | ||
95 | #define AT91CAP9_BASE_PIOB 0xfffff400 | ||
96 | #define AT91CAP9_BASE_PIOC 0xfffff600 | ||
97 | #define AT91CAP9_BASE_PIOD 0xfffff800 | ||
98 | #define AT91CAP9_BASE_RSTC 0xfffffd00 | ||
99 | #define AT91CAP9_BASE_SHDWC 0xfffffd10 | ||
100 | #define AT91CAP9_BASE_RTT 0xfffffd20 | ||
101 | #define AT91CAP9_BASE_PIT 0xfffffd30 | ||
102 | #define AT91CAP9_BASE_WDT 0xfffffd40 | ||
103 | |||
104 | #define AT91_USART0 AT91CAP9_BASE_US0 | ||
105 | #define AT91_USART1 AT91CAP9_BASE_US1 | ||
106 | #define AT91_USART2 AT91CAP9_BASE_US2 | ||
107 | |||
108 | |||
109 | /* | ||
110 | * Internal Memory. | ||
111 | */ | ||
112 | #define AT91CAP9_SRAM_BASE 0x00100000 /* Internal SRAM base address */ | ||
113 | #define AT91CAP9_SRAM_SIZE (32 * SZ_1K) /* Internal SRAM size (32Kb) */ | ||
114 | |||
115 | #define AT91CAP9_ROM_BASE 0x00400000 /* Internal ROM base address */ | ||
116 | #define AT91CAP9_ROM_SIZE (32 * SZ_1K) /* Internal ROM size (32Kb) */ | ||
117 | |||
118 | #define AT91CAP9_LCDC_BASE 0x00500000 /* LCD Controller */ | ||
119 | #define AT91CAP9_UDPHS_FIFO 0x00600000 /* USB High Speed Device Port */ | ||
120 | #define AT91CAP9_UHP_BASE 0x00700000 /* USB Host controller */ | ||
121 | |||
122 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/at91cap9_matrix.h b/arch/arm/mach-at91/include/mach/at91cap9_matrix.h deleted file mode 100644 index 4b9d4aff4b4f..000000000000 --- a/arch/arm/mach-at91/include/mach/at91cap9_matrix.h +++ /dev/null | |||
@@ -1,137 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91cap9_matrix.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com> | ||
5 | * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com> | ||
6 | * Copyright (C) 2006 Atmel Corporation. | ||
7 | * | ||
8 | * Memory Controllers (MATRIX, EBI) - System peripherals registers. | ||
9 | * Based on AT91CAP9 datasheet revision B (Preliminary). | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | */ | ||
16 | |||
17 | #ifndef AT91CAP9_MATRIX_H | ||
18 | #define AT91CAP9_MATRIX_H | ||
19 | |||
20 | #define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */ | ||
21 | #define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */ | ||
22 | #define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */ | ||
23 | #define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */ | ||
24 | #define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */ | ||
25 | #define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */ | ||
26 | #define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */ | ||
27 | #define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */ | ||
28 | #define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */ | ||
29 | #define AT91_MATRIX_MCFG9 (AT91_MATRIX + 0x24) /* Master Configuration Register 9 */ | ||
30 | #define AT91_MATRIX_MCFG10 (AT91_MATRIX + 0x28) /* Master Configuration Register 10 */ | ||
31 | #define AT91_MATRIX_MCFG11 (AT91_MATRIX + 0x2C) /* Master Configuration Register 11 */ | ||
32 | #define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */ | ||
33 | #define AT91_MATRIX_ULBT_INFINITE (0 << 0) | ||
34 | #define AT91_MATRIX_ULBT_SINGLE (1 << 0) | ||
35 | #define AT91_MATRIX_ULBT_FOUR (2 << 0) | ||
36 | #define AT91_MATRIX_ULBT_EIGHT (3 << 0) | ||
37 | #define AT91_MATRIX_ULBT_SIXTEEN (4 << 0) | ||
38 | |||
39 | #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */ | ||
40 | #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */ | ||
41 | #define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */ | ||
42 | #define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */ | ||
43 | #define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */ | ||
44 | #define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */ | ||
45 | #define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */ | ||
46 | #define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */ | ||
47 | #define AT91_MATRIX_SCFG8 (AT91_MATRIX + 0x60) /* Slave Configuration Register 8 */ | ||
48 | #define AT91_MATRIX_SCFG9 (AT91_MATRIX + 0x64) /* Slave Configuration Register 9 */ | ||
49 | #define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */ | ||
50 | #define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */ | ||
51 | #define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16) | ||
52 | #define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16) | ||
53 | #define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16) | ||
54 | #define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */ | ||
55 | #define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */ | ||
56 | #define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24) | ||
57 | #define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24) | ||
58 | |||
59 | #define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */ | ||
60 | #define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */ | ||
61 | #define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */ | ||
62 | #define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */ | ||
63 | #define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */ | ||
64 | #define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */ | ||
65 | #define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */ | ||
66 | #define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */ | ||
67 | #define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */ | ||
68 | #define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */ | ||
69 | #define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */ | ||
70 | #define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */ | ||
71 | #define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */ | ||
72 | #define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */ | ||
73 | #define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */ | ||
74 | #define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */ | ||
75 | #define AT91_MATRIX_PRAS8 (AT91_MATRIX + 0xC0) /* Priority Register A for Slave 8 */ | ||
76 | #define AT91_MATRIX_PRBS8 (AT91_MATRIX + 0xC4) /* Priority Register B for Slave 8 */ | ||
77 | #define AT91_MATRIX_PRAS9 (AT91_MATRIX + 0xC8) /* Priority Register A for Slave 9 */ | ||
78 | #define AT91_MATRIX_PRBS9 (AT91_MATRIX + 0xCC) /* Priority Register B for Slave 9 */ | ||
79 | #define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */ | ||
80 | #define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */ | ||
81 | #define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */ | ||
82 | #define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */ | ||
83 | #define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */ | ||
84 | #define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */ | ||
85 | #define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */ | ||
86 | #define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */ | ||
87 | #define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */ | ||
88 | #define AT91_MATRIX_M9PR (3 << 4) /* Master 9 Priority (in Register B) */ | ||
89 | #define AT91_MATRIX_M10PR (3 << 8) /* Master 10 Priority (in Register B) */ | ||
90 | #define AT91_MATRIX_M11PR (3 << 12) /* Master 11 Priority (in Register B) */ | ||
91 | |||
92 | #define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */ | ||
93 | #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ | ||
94 | #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ | ||
95 | #define AT91_MATRIX_RCB2 (1 << 2) | ||
96 | #define AT91_MATRIX_RCB3 (1 << 3) | ||
97 | #define AT91_MATRIX_RCB4 (1 << 4) | ||
98 | #define AT91_MATRIX_RCB5 (1 << 5) | ||
99 | #define AT91_MATRIX_RCB6 (1 << 6) | ||
100 | #define AT91_MATRIX_RCB7 (1 << 7) | ||
101 | #define AT91_MATRIX_RCB8 (1 << 8) | ||
102 | #define AT91_MATRIX_RCB9 (1 << 9) | ||
103 | #define AT91_MATRIX_RCB10 (1 << 10) | ||
104 | #define AT91_MATRIX_RCB11 (1 << 11) | ||
105 | |||
106 | #define AT91_MPBS0_SFR (AT91_MATRIX + 0x114) /* MPBlock Slave 0 Special Function Register */ | ||
107 | #define AT91_MPBS1_SFR (AT91_MATRIX + 0x11C) /* MPBlock Slave 1 Special Function Register */ | ||
108 | |||
109 | #define AT91_MATRIX_UDPHS (AT91_MATRIX + 0x118) /* USBHS Special Function Register [AT91CAP9 only] */ | ||
110 | #define AT91_MATRIX_SELECT_UDPHS (0 << 31) /* select High Speed UDP */ | ||
111 | #define AT91_MATRIX_SELECT_UDP (1 << 31) /* select standard UDP */ | ||
112 | #define AT91_MATRIX_UDPHS_BYPASS_LOCK (1 << 30) /* bypass lock bit */ | ||
113 | |||
114 | #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x120) /* EBI Chip Select Assignment Register */ | ||
115 | #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ | ||
116 | #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) | ||
117 | #define AT91_MATRIX_EBI_CS1A_BCRAMC (1 << 1) | ||
118 | #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ | ||
119 | #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) | ||
120 | #define AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA (1 << 3) | ||
121 | #define AT91_MATRIX_EBI_CS4A (1 << 4) /* Chip Select 4 Assignment */ | ||
122 | #define AT91_MATRIX_EBI_CS4A_SMC (0 << 4) | ||
123 | #define AT91_MATRIX_EBI_CS4A_SMC_CF1 (1 << 4) | ||
124 | #define AT91_MATRIX_EBI_CS5A (1 << 5) /* Chip Select 5 Assignment */ | ||
125 | #define AT91_MATRIX_EBI_CS5A_SMC (0 << 5) | ||
126 | #define AT91_MATRIX_EBI_CS5A_SMC_CF2 (1 << 5) | ||
127 | #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | ||
128 | #define AT91_MATRIX_EBI_DQSPDC (1 << 9) /* Data Qualifier Strobe Pull-Down Configuration */ | ||
129 | #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ | ||
130 | #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) | ||
131 | #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) | ||
132 | |||
133 | #define AT91_MPBS2_SFR (AT91_MATRIX + 0x12C) /* MPBlock Slave 2 Special Function Register */ | ||
134 | #define AT91_MPBS3_SFR (AT91_MATRIX + 0x130) /* MPBlock Slave 3 Special Function Register */ | ||
135 | #define AT91_APB_SFR (AT91_MATRIX + 0x134) /* APB Bridge Special Function Register */ | ||
136 | |||
137 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h index e2f8da8ce5bc..5d4a9f846584 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h +++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h | |||
@@ -59,7 +59,6 @@ | |||
59 | #define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */ | 59 | #define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */ |
60 | #define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */ | 60 | #define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */ |
61 | #define AT91_DDRSDRC_TWTR (0x7 << 24) /* Internal Write to Read delay */ | 61 | #define AT91_DDRSDRC_TWTR (0x7 << 24) /* Internal Write to Read delay */ |
62 | #define AT91CAP9_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */ | ||
63 | #define AT91_DDRSDRC_RED_WRRD (0x1 << 27) /* Reduce Write to Read Delay [SAM9 Only] */ | 62 | #define AT91_DDRSDRC_RED_WRRD (0x1 << 27) /* Reduce Write to Read Delay [SAM9 Only] */ |
64 | #define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */ | 63 | #define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */ |
65 | 64 | ||
@@ -76,7 +75,6 @@ | |||
76 | #define AT91_DDRSDRC_TRTP (0x7 << 12) /* Read to Precharge delay */ | 75 | #define AT91_DDRSDRC_TRTP (0x7 << 12) /* Read to Precharge delay */ |
77 | 76 | ||
78 | #define AT91_DDRSDRC_LPR 0x1C /* Low Power Register */ | 77 | #define AT91_DDRSDRC_LPR 0x1C /* Low Power Register */ |
79 | #define AT91CAP9_DDRSDRC_LPR 0x18 /* Low Power Register */ | ||
80 | #define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */ | 78 | #define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */ |
81 | #define AT91_DDRSDRC_LPCB_DISABLE 0 | 79 | #define AT91_DDRSDRC_LPCB_DISABLE 0 |
82 | #define AT91_DDRSDRC_LPCB_SELF_REFRESH 1 | 80 | #define AT91_DDRSDRC_LPCB_SELF_REFRESH 1 |
@@ -94,11 +92,9 @@ | |||
94 | #define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */ | 92 | #define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */ |
95 | 93 | ||
96 | #define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */ | 94 | #define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */ |
97 | #define AT91CAP9_DDRSDRC_MDR 0x1C /* Memory Device Register */ | ||
98 | #define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */ | 95 | #define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */ |
99 | #define AT91_DDRSDRC_MD_SDR 0 | 96 | #define AT91_DDRSDRC_MD_SDR 0 |
100 | #define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 | 97 | #define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 |
101 | #define AT91CAP9_DDRSDRC_MD_DDR 2 | ||
102 | #define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 | 98 | #define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 |
103 | #define AT91_DDRSDRC_MD_DDR2 6 /* [SAM9 Only] */ | 99 | #define AT91_DDRSDRC_MD_DDR2 6 /* [SAM9 Only] */ |
104 | #define AT91_DDRSDRC_DBW (1 << 4) /* Data Bus Width */ | 100 | #define AT91_DDRSDRC_DBW (1 << 4) /* Data Bus Width */ |
@@ -106,16 +102,10 @@ | |||
106 | #define AT91_DDRSDRC_DBW_16BITS (1 << 4) | 102 | #define AT91_DDRSDRC_DBW_16BITS (1 << 4) |
107 | 103 | ||
108 | #define AT91_DDRSDRC_DLL 0x24 /* DLL Information Register */ | 104 | #define AT91_DDRSDRC_DLL 0x24 /* DLL Information Register */ |
109 | #define AT91CAP9_DDRSDRC_DLL 0x20 /* DLL Information Register */ | ||
110 | #define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */ | 105 | #define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */ |
111 | #define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */ | 106 | #define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */ |
112 | #define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */ | 107 | #define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */ |
113 | #define AT91CAP9_DDRSDRC_SDCOVF (1 << 3) /* Slave Delay Correction Overflow */ | ||
114 | #define AT91CAP9_DDRSDRC_SDCUDF (1 << 4) /* Slave Delay Correction Underflow */ | ||
115 | #define AT91CAP9_DDRSDRC_SDERF (1 << 5) /* Slave Delay Correction error */ | ||
116 | #define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */ | 108 | #define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */ |
117 | #define AT91CAP9_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */ | ||
118 | #define AT91CAP9_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */ | ||
119 | 109 | ||
120 | #define AT91_DDRSDRC_HS 0x2C /* High Speed Register [SAM9 Only] */ | 110 | #define AT91_DDRSDRC_HS 0x2C /* High Speed Register [SAM9 Only] */ |
121 | #define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2) /* Anticip read access is disabled */ | 111 | #define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2) /* Anticip read access is disabled */ |
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index f6ce936dba2b..0118c3338552 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ | 25 | #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ |
26 | #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ | 26 | #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ |
27 | #define ARCH_ID_AT91SAM9X5 0x819a05a0 | 27 | #define ARCH_ID_AT91SAM9X5 0x819a05a0 |
28 | #define ARCH_ID_AT91CAP9 0x039A03A0 | ||
29 | 28 | ||
30 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 | 29 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 |
31 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 | 30 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 |
@@ -51,10 +50,6 @@ | |||
51 | #define ARCH_FAMILY_AT91SAM9 0x01900000 | 50 | #define ARCH_FAMILY_AT91SAM9 0x01900000 |
52 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 | 51 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 |
53 | 52 | ||
54 | /* PMC revision */ | ||
55 | #define ARCH_REVISION_CAP9_B 0x399 | ||
56 | #define ARCH_REVISION_CAP9_C 0x601 | ||
57 | |||
58 | /* RM9200 type */ | 53 | /* RM9200 type */ |
59 | #define ARCH_REVISON_9200_BGA (0 << 0) | 54 | #define ARCH_REVISON_9200_BGA (0 << 0) |
60 | #define ARCH_REVISON_9200_PQFP (1 << 0) | 55 | #define ARCH_REVISON_9200_PQFP (1 << 0) |
@@ -63,9 +58,6 @@ enum at91_soc_type { | |||
63 | /* 920T */ | 58 | /* 920T */ |
64 | AT91_SOC_RM9200, | 59 | AT91_SOC_RM9200, |
65 | 60 | ||
66 | /* CAP */ | ||
67 | AT91_SOC_CAP9, | ||
68 | |||
69 | /* SAM92xx */ | 61 | /* SAM92xx */ |
70 | AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, | 62 | AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, |
71 | 63 | ||
@@ -86,9 +78,6 @@ enum at91_soc_subtype { | |||
86 | /* RM9200 */ | 78 | /* RM9200 */ |
87 | AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, | 79 | AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, |
88 | 80 | ||
89 | /* CAP9 */ | ||
90 | AT91_SOC_CAP9_REV_B, AT91_SOC_CAP9_REV_C, | ||
91 | |||
92 | /* SAM9260 */ | 81 | /* SAM9260 */ |
93 | AT91_SOC_SAM9XE, | 82 | AT91_SOC_SAM9XE, |
94 | 83 | ||
@@ -195,16 +184,6 @@ static inline int at91_soc_is_detected(void) | |||
195 | #define cpu_is_at91sam9x25() (0) | 184 | #define cpu_is_at91sam9x25() (0) |
196 | #endif | 185 | #endif |
197 | 186 | ||
198 | #ifdef CONFIG_ARCH_AT91CAP9 | ||
199 | #define cpu_is_at91cap9() (at91_soc_initdata.type == AT91_SOC_CAP9) | ||
200 | #define cpu_is_at91cap9_revB() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_B) | ||
201 | #define cpu_is_at91cap9_revC() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_C) | ||
202 | #else | ||
203 | #define cpu_is_at91cap9() (0) | ||
204 | #define cpu_is_at91cap9_revB() (0) | ||
205 | #define cpu_is_at91cap9_revC() (0) | ||
206 | #endif | ||
207 | |||
208 | /* | 187 | /* |
209 | * Since this is ARM, we will never run on any AVR32 CPU. But these | 188 | * Since this is ARM, we will never run on any AVR32 CPU. But these |
210 | * definitions may reduce clutter in common drivers. | 189 | * definitions may reduce clutter in common drivers. |
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index 2d0e4e998566..c213f28628c0 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -19,7 +19,7 @@ | |||
19 | /* DBGU base */ | 19 | /* DBGU base */ |
20 | /* rm9200, 9260/9g20, 9261/9g10, 9rl */ | 20 | /* rm9200, 9260/9g20, 9261/9g10, 9rl */ |
21 | #define AT91_BASE_DBGU0 0xfffff200 | 21 | #define AT91_BASE_DBGU0 0xfffff200 |
22 | /* 9263, 9g45, cap9 */ | 22 | /* 9263, 9g45 */ |
23 | #define AT91_BASE_DBGU1 0xffffee00 | 23 | #define AT91_BASE_DBGU1 0xffffee00 |
24 | 24 | ||
25 | #if defined(CONFIG_ARCH_AT91RM9200) | 25 | #if defined(CONFIG_ARCH_AT91RM9200) |
@@ -34,8 +34,6 @@ | |||
34 | #include <mach/at91sam9rl.h> | 34 | #include <mach/at91sam9rl.h> |
35 | #elif defined(CONFIG_ARCH_AT91SAM9G45) | 35 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
36 | #include <mach/at91sam9g45.h> | 36 | #include <mach/at91sam9g45.h> |
37 | #elif defined(CONFIG_ARCH_AT91CAP9) | ||
38 | #include <mach/at91cap9.h> | ||
39 | #elif defined(CONFIG_ARCH_AT91X40) | 37 | #elif defined(CONFIG_ARCH_AT91X40) |
40 | #include <mach/at91x40.h> | 38 | #include <mach/at91x40.h> |
41 | #else | 39 | #else |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 1606379ac284..87be5aa18753 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -150,11 +150,6 @@ static int at91_pm_verify_clocks(void) | |||
150 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); | 150 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | } else if (cpu_is_at91cap9()) { | ||
154 | if ((scsr & AT91CAP9_PMC_UHP) != 0) { | ||
155 | pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); | ||
156 | return 0; | ||
157 | } | ||
158 | } | 153 | } |
159 | 154 | ||
160 | #ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS | 155 | #ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS |
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h index 7eb40d24242f..218d816427c0 100644 --- a/arch/arm/mach-at91/pm.h +++ b/arch/arm/mach-at91/pm.h | |||
@@ -24,24 +24,6 @@ static inline u32 sdram_selfrefresh_enable(void) | |||
24 | #define wait_for_interrupt_enable() asm volatile ("mcr p15, 0, %0, c7, c0, 4" \ | 24 | #define wait_for_interrupt_enable() asm volatile ("mcr p15, 0, %0, c7, c0, 4" \ |
25 | : : "r" (0)) | 25 | : : "r" (0)) |
26 | 26 | ||
27 | #elif defined(CONFIG_ARCH_AT91CAP9) | ||
28 | #include <mach/at91sam9_ddrsdr.h> | ||
29 | |||
30 | |||
31 | static inline u32 sdram_selfrefresh_enable(void) | ||
32 | { | ||
33 | u32 saved_lpr, lpr; | ||
34 | |||
35 | saved_lpr = at91_ramc_read(0, AT91CAP9_DDRSDRC_LPR); | ||
36 | |||
37 | lpr = saved_lpr & ~AT91_DDRSDRC_LPCB; | ||
38 | at91_ramc_write(0, AT91CAP9_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH); | ||
39 | return saved_lpr; | ||
40 | } | ||
41 | |||
42 | #define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91CAP9_DDRSDRC_LPR, saved_lpr) | ||
43 | #define wait_for_interrupt_enable() cpu_do_idle() | ||
44 | |||
45 | #elif defined(CONFIG_ARCH_AT91SAM9G45) | 27 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
46 | #include <mach/at91sam9_ddrsdr.h> | 28 | #include <mach/at91sam9_ddrsdr.h> |
47 | 29 | ||
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S index 92dfb8461392..f8539a8bcd6c 100644 --- a/arch/arm/mach-at91/pm_slowclock.S +++ b/arch/arm/mach-at91/pm_slowclock.S | |||
@@ -18,8 +18,7 @@ | |||
18 | 18 | ||
19 | #if defined(CONFIG_ARCH_AT91RM9200) | 19 | #if defined(CONFIG_ARCH_AT91RM9200) |
20 | #include <mach/at91rm9200_mc.h> | 20 | #include <mach/at91rm9200_mc.h> |
21 | #elif defined(CONFIG_ARCH_AT91CAP9) \ | 21 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
22 | || defined(CONFIG_ARCH_AT91SAM9G45) | ||
23 | #include <mach/at91sam9_ddrsdr.h> | 22 | #include <mach/at91sam9_ddrsdr.h> |
24 | #else | 23 | #else |
25 | #include <mach/at91sam9_sdramc.h> | 24 | #include <mach/at91sam9_sdramc.h> |
@@ -130,8 +129,7 @@ ENTRY(at91_slow_clock) | |||
130 | /* Put SDRAM in self-refresh mode */ | 129 | /* Put SDRAM in self-refresh mode */ |
131 | mov r3, #1 | 130 | mov r3, #1 |
132 | str r3, [r2, #AT91_SDRAMC_SRR] | 131 | str r3, [r2, #AT91_SDRAMC_SRR] |
133 | #elif defined(CONFIG_ARCH_AT91CAP9) \ | 132 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
134 | || defined(CONFIG_ARCH_AT91SAM9G45) | ||
135 | 133 | ||
136 | /* prepare for DDRAM self-refresh mode */ | 134 | /* prepare for DDRAM self-refresh mode */ |
137 | ldr r3, [r2, #AT91_DDRSDRC_LPR] | 135 | ldr r3, [r2, #AT91_DDRSDRC_LPR] |
@@ -263,8 +261,7 @@ ENTRY(at91_slow_clock) | |||
263 | 261 | ||
264 | #ifdef CONFIG_ARCH_AT91RM9200 | 262 | #ifdef CONFIG_ARCH_AT91RM9200 |
265 | /* Do nothing - self-refresh is automatically disabled. */ | 263 | /* Do nothing - self-refresh is automatically disabled. */ |
266 | #elif defined(CONFIG_ARCH_AT91CAP9) \ | 264 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
267 | || defined(CONFIG_ARCH_AT91SAM9G45) | ||
268 | /* Restore LPR on AT91 with DDRAM */ | 265 | /* Restore LPR on AT91 with DDRAM */ |
269 | ldr r3, .saved_sam9_lpr | 266 | ldr r3, .saved_sam9_lpr |
270 | str r3, [r2, #AT91_DDRSDRC_LPR] | 267 | str r3, [r2, #AT91_DDRSDRC_LPR] |
@@ -305,8 +302,7 @@ ENTRY(at91_slow_clock) | |||
305 | #ifdef CONFIG_ARCH_AT91RM9200 | 302 | #ifdef CONFIG_ARCH_AT91RM9200 |
306 | .at91_va_base_sdramc: | 303 | .at91_va_base_sdramc: |
307 | .word AT91_VA_BASE_SYS | 304 | .word AT91_VA_BASE_SYS |
308 | #elif defined(CONFIG_ARCH_AT91CAP9) \ | 305 | #elif defined(CONFIG_ARCH_AT91SAM9G45) |
309 | || defined(CONFIG_ARCH_AT91SAM9G45) | ||
310 | .at91_va_base_sdramc: | 306 | .at91_va_base_sdramc: |
311 | .word AT91_VA_BASE_SYS + AT91_DDRSDRC0 | 307 | .word AT91_VA_BASE_SYS + AT91_DDRSDRC0 |
312 | #else | 308 | #else |
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index 69d3fc4c46f3..620c67e8f814 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -86,20 +86,6 @@ static void __init soc_detect(u32 dbgu_base) | |||
86 | socid = cidr & ~AT91_CIDR_VERSION; | 86 | socid = cidr & ~AT91_CIDR_VERSION; |
87 | 87 | ||
88 | switch (socid) { | 88 | switch (socid) { |
89 | case ARCH_ID_AT91CAP9: { | ||
90 | #ifdef CONFIG_AT91_PMC_UNIT | ||
91 | u32 pmc_ver = at91_sys_read(AT91_PMC_VER); | ||
92 | |||
93 | if (pmc_ver == ARCH_REVISION_CAP9_B) | ||
94 | at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_B; | ||
95 | else if (pmc_ver == ARCH_REVISION_CAP9_C) | ||
96 | at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_C; | ||
97 | #endif | ||
98 | at91_soc_initdata.type = AT91_SOC_CAP9; | ||
99 | at91_boot_soc = at91cap9_soc; | ||
100 | break; | ||
101 | } | ||
102 | |||
103 | case ARCH_ID_AT91RM9200: | 89 | case ARCH_ID_AT91RM9200: |
104 | at91_soc_initdata.type = AT91_SOC_RM9200; | 90 | at91_soc_initdata.type = AT91_SOC_RM9200; |
105 | at91_boot_soc = at91rm9200_soc; | 91 | at91_boot_soc = at91rm9200_soc; |
@@ -200,7 +186,6 @@ static void __init soc_detect(u32 dbgu_base) | |||
200 | 186 | ||
201 | static const char *soc_name[] = { | 187 | static const char *soc_name[] = { |
202 | [AT91_SOC_RM9200] = "at91rm9200", | 188 | [AT91_SOC_RM9200] = "at91rm9200", |
203 | [AT91_SOC_CAP9] = "at91cap9", | ||
204 | [AT91_SOC_SAM9260] = "at91sam9260", | 189 | [AT91_SOC_SAM9260] = "at91sam9260", |
205 | [AT91_SOC_SAM9261] = "at91sam9261", | 190 | [AT91_SOC_SAM9261] = "at91sam9261", |
206 | [AT91_SOC_SAM9263] = "at91sam9263", | 191 | [AT91_SOC_SAM9263] = "at91sam9263", |
@@ -221,8 +206,6 @@ EXPORT_SYMBOL(at91_get_soc_type); | |||
221 | static const char *soc_subtype_name[] = { | 206 | static const char *soc_subtype_name[] = { |
222 | [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA", | 207 | [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA", |
223 | [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP", | 208 | [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP", |
224 | [AT91_SOC_CAP9_REV_B] = "at91cap9 revB", | ||
225 | [AT91_SOC_CAP9_REV_C] = "at91cap9 revC", | ||
226 | [AT91_SOC_SAM9XE] = "at91sam9xe", | 209 | [AT91_SOC_SAM9XE] = "at91sam9xe", |
227 | [AT91_SOC_SAM9G45ES] = "at91sam9g45es", | 210 | [AT91_SOC_SAM9G45ES] = "at91sam9g45es", |
228 | [AT91_SOC_SAM9M10] = "at91sam9m10", | 211 | [AT91_SOC_SAM9M10] = "at91sam9m10", |
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h index 4588ae6f7acd..5db4aa45404a 100644 --- a/arch/arm/mach-at91/soc.h +++ b/arch/arm/mach-at91/soc.h | |||
@@ -13,7 +13,6 @@ struct at91_init_soc { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | extern struct at91_init_soc at91_boot_soc; | 15 | extern struct at91_init_soc at91_boot_soc; |
16 | extern struct at91_init_soc at91cap9_soc; | ||
17 | extern struct at91_init_soc at91rm9200_soc; | 16 | extern struct at91_init_soc at91rm9200_soc; |
18 | extern struct at91_init_soc at91sam9260_soc; | 17 | extern struct at91_init_soc at91sam9260_soc; |
19 | extern struct at91_init_soc at91sam9261_soc; | 18 | extern struct at91_init_soc at91sam9261_soc; |
@@ -27,10 +26,6 @@ static inline int at91_soc_is_enabled(void) | |||
27 | return at91_boot_soc.init != NULL; | 26 | return at91_boot_soc.init != NULL; |
28 | } | 27 | } |
29 | 28 | ||
30 | #if !defined(CONFIG_ARCH_AT91CAP9) | ||
31 | #define at91cap9_soc at91_boot_soc | ||
32 | #endif | ||
33 | |||
34 | #if !defined(CONFIG_ARCH_AT91RM9200) | 29 | #if !defined(CONFIG_ARCH_AT91RM9200) |
35 | #define at91rm9200_soc at91_boot_soc | 30 | #define at91rm9200_soc at91_boot_soc |
36 | #endif | 31 | #endif |
diff --git a/arch/avr32/mach-at32ap/include/mach/cpu.h b/arch/avr32/mach-at32ap/include/mach/cpu.h index 8181293115e4..16a24b14146c 100644 --- a/arch/avr32/mach-at32ap/include/mach/cpu.h +++ b/arch/avr32/mach-at32ap/include/mach/cpu.h | |||
@@ -30,9 +30,6 @@ | |||
30 | #define cpu_is_at91sam9261() (0) | 30 | #define cpu_is_at91sam9261() (0) |
31 | #define cpu_is_at91sam9263() (0) | 31 | #define cpu_is_at91sam9263() (0) |
32 | #define cpu_is_at91sam9rl() (0) | 32 | #define cpu_is_at91sam9rl() (0) |
33 | #define cpu_is_at91cap9() (0) | ||
34 | #define cpu_is_at91cap9_revB() (0) | ||
35 | #define cpu_is_at91cap9_revC() (0) | ||
36 | #define cpu_is_at91sam9g10() (0) | 33 | #define cpu_is_at91sam9g10() (0) |
37 | #define cpu_is_at91sam9g20() (0) | 34 | #define cpu_is_at91sam9g20() (0) |
38 | #define cpu_is_at91sam9g45() (0) | 35 | #define cpu_is_at91sam9g45() (0) |