aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-25 19:41:21 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-25 19:41:21 -0400
commitae1d3b974e091b5fc9008bd41bcbdaac68110b62 (patch)
tree82e50a66925ced79f59ed4504f6e073ef55edee3 /arch/arm
parent586893ebc42943008010b4c210cfc9167df615e5 (diff)
parent7a2207a0e1142a9b214b323e43ab2ecc592e5b0e (diff)
Merge branch 'for-rmk' of git://github.com/at91linux/linux-2.6-at91 into devel-stable
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/configs/at572d940hfek_defconfig358
-rw-r--r--arch/arm/configs/at91sam9261_defconfig (renamed from arch/arm/configs/at91sam9261ek_defconfig)85
-rw-r--r--arch/arm/configs/at91sam9263_defconfig (renamed from arch/arm/configs/at91sam9263ek_defconfig)84
-rw-r--r--arch/arm/configs/neocore926_defconfig104
-rw-r--r--arch/arm/configs/usb-a9263_defconfig106
-rw-r--r--arch/arm/kernel/vmlinux.lds.S2
-rw-r--r--arch/arm/mach-at91/Kconfig40
-rw-r--r--arch/arm/mach-at91/Makefile4
-rw-r--r--arch/arm/mach-at91/at572d940hf.c377
-rw-r--r--arch/arm/mach-at91/at572d940hf_devices.c970
-rw-r--r--arch/arm/mach-at91/at91cap9.c41
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c24
-rw-r--r--arch/arm/mach-at91/at91rm9200.c53
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c24
-rw-r--r--arch/arm/mach-at91/at91sam9260.c48
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c26
-rw-r--r--arch/arm/mach-at91/at91sam9261.c41
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c21
-rw-r--r--arch/arm/mach-at91/at91sam9263.c39
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c20
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c64
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c27
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c40
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c23
-rw-r--r--arch/arm/mach-at91/at91x40.c5
-rw-r--r--arch/arm/mach-at91/board-1arm.c12
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c6
-rw-r--r--arch/arm/mach-at91/board-at572d940hf_ek.c326
-rw-r--r--arch/arm/mach-at91/board-cam60.c6
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c13
-rw-r--r--arch/arm/mach-at91/board-carmeva.c8
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c6
-rw-r--r--arch/arm/mach-at91/board-cpuat91.c12
-rw-r--r--arch/arm/mach-at91/board-csb337.c8
-rw-r--r--arch/arm/mach-at91/board-csb637.c8
-rw-r--r--arch/arm/mach-at91/board-eb01.c4
-rw-r--r--arch/arm/mach-at91/board-eb9200.c8
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c12
-rw-r--r--arch/arm/mach-at91/board-eco920.c32
-rw-r--r--arch/arm/mach-at91/board-flexibity.c6
-rw-r--r--arch/arm/mach-at91/board-foxg20.c6
-rw-r--r--arch/arm/mach-at91/board-gsia18s.c8
-rw-r--r--arch/arm/mach-at91/board-kafa.c12
-rw-r--r--arch/arm/mach-at91/board-kb9202.c13
-rw-r--r--arch/arm/mach-at91/board-neocore926.c6
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c8
-rw-r--r--arch/arm/mach-at91/board-picotux200.c8
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c6
-rw-r--r--arch/arm/mach-at91/board-rm9200dk.c8
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c8
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c6
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c17
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c13
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c6
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c6
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c18
-rw-r--r--arch/arm/mach-at91/board-usb-a9260.c6
-rw-r--r--arch/arm/mach-at91/board-usb-a9263.c6
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c12
-rw-r--r--arch/arm/mach-at91/clock.c69
-rw-r--r--arch/arm/mach-at91/clock.h20
-rw-r--r--arch/arm/mach-at91/generic.h30
-rw-r--r--arch/arm/mach-at91/include/mach/at572d940hf.h123
-rw-r--r--arch/arm/mach-at91/include/mach/at572d940hf_matrix.h123
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9.h4
-rw-r--r--arch/arm/mach-at91/include/mach/at91rm9200.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9260.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9261.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9263.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9g45.h4
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9rl.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91x40.h2
-rw-r--r--arch/arm/mach-at91/include/mach/board.h6
-rw-r--r--arch/arm/mach-at91/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h15
-rw-r--r--arch/arm/mach-at91/include/mach/hardware.h15
-rw-r--r--arch/arm/mach-at91/include/mach/memory.h2
-rw-r--r--arch/arm/mach-at91/include/mach/stamp9g20.h2
-rw-r--r--arch/arm/mach-at91/include/mach/system_rev.h25
-rw-r--r--arch/arm/mach-at91/include/mach/timex.h5
-rw-r--r--arch/arm/mach-tegra/include/mach/kbc.h4
-rw-r--r--arch/arm/mach-ux500/board-mop500.c14
-rw-r--r--arch/arm/plat-nomadik/include/plat/i2c.h8
87 files changed, 786 insertions, 3009 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f7cce8b75f49..f59758dd86cf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -294,6 +294,8 @@ config ARCH_AT91
294 bool "Atmel AT91" 294 bool "Atmel AT91"
295 select ARCH_REQUIRE_GPIOLIB 295 select ARCH_REQUIRE_GPIOLIB
296 select HAVE_CLK 296 select HAVE_CLK
297 select CLKDEV_LOOKUP
298 select ARM_PATCH_PHYS_VIRT if MMU
297 help 299 help
298 This enables support for systems based on the Atmel AT91RM9200, 300 This enables support for systems based on the Atmel AT91RM9200,
299 AT91SAM9 and AT91CAP9 processors. 301 AT91SAM9 and AT91CAP9 processors.
diff --git a/arch/arm/configs/at572d940hfek_defconfig b/arch/arm/configs/at572d940hfek_defconfig
deleted file mode 100644
index 1b1158ae8f82..000000000000
--- a/arch/arm/configs/at572d940hfek_defconfig
+++ /dev/null
@@ -1,358 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_LOCALVERSION="-AT572D940HF"
3# CONFIG_LOCALVERSION_AUTO is not set
4CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y
6CONFIG_BSD_PROCESS_ACCT=y
7CONFIG_BSD_PROCESS_ACCT_V3=y
8CONFIG_TASKSTATS=y
9CONFIG_TASK_XACCT=y
10CONFIG_TASK_IO_ACCOUNTING=y
11CONFIG_AUDIT=y
12CONFIG_CGROUPS=y
13CONFIG_CGROUP_CPUACCT=y
14CONFIG_CGROUP_SCHED=y
15CONFIG_RT_GROUP_SCHED=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_RELAY=y
18CONFIG_BLK_DEV_INITRD=y
19# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
20CONFIG_EXPERT=y
21CONFIG_SLAB=y
22CONFIG_PROFILING=y
23CONFIG_OPROFILE=m
24CONFIG_KPROBES=y
25CONFIG_MODULES=y
26CONFIG_MODULE_UNLOAD=y
27CONFIG_MODVERSIONS=y
28CONFIG_MODULE_SRCVERSION_ALL=y
29# CONFIG_BLK_DEV_BSG is not set
30CONFIG_ARCH_AT91=y
31CONFIG_ARCH_AT572D940HF=y
32CONFIG_MACH_AT572D940HFEB=y
33CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
34CONFIG_NO_HZ=y
35CONFIG_HIGH_RES_TIMERS=y
36CONFIG_PREEMPT=y
37CONFIG_CMDLINE="mem=48M console=ttyS0 initrd=0x21100000,3145728 root=/dev/ram0 rw ip=172.16.1.181"
38CONFIG_KEXEC=y
39CONFIG_FPE_NWFPE=y
40CONFIG_FPE_NWFPE_XP=y
41CONFIG_NET=y
42CONFIG_PACKET=m
43CONFIG_UNIX=y
44CONFIG_INET=y
45# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
46# CONFIG_INET_XFRM_MODE_TUNNEL is not set
47# CONFIG_INET_XFRM_MODE_BEET is not set
48# CONFIG_INET_LRO is not set
49# CONFIG_INET_DIAG is not set
50# CONFIG_IPV6 is not set
51CONFIG_NET_PKTGEN=m
52CONFIG_NET_TCPPROBE=m
53CONFIG_CAN=m
54CONFIG_CAN_RAW=m
55CONFIG_CAN_BCM=m
56CONFIG_CAN_VCAN=m
57CONFIG_CAN_DEBUG_DEVICES=y
58CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
59CONFIG_CONNECTOR=m
60CONFIG_MTD=m
61CONFIG_MTD_DEBUG=y
62CONFIG_MTD_DEBUG_VERBOSE=1
63CONFIG_MTD_CONCAT=m
64CONFIG_MTD_PARTITIONS=y
65CONFIG_MTD_CHAR=m
66CONFIG_MTD_BLOCK=m
67CONFIG_MTD_BLOCK_RO=m
68CONFIG_FTL=m
69CONFIG_NFTL=m
70CONFIG_NFTL_RW=y
71CONFIG_INFTL=m
72CONFIG_RFD_FTL=m
73CONFIG_SSFDC=m
74CONFIG_MTD_OOPS=m
75CONFIG_MTD_CFI=m
76CONFIG_MTD_JEDECPROBE=m
77CONFIG_MTD_CFI_INTELEXT=m
78CONFIG_MTD_CFI_AMDSTD=m
79CONFIG_MTD_CFI_STAA=m
80CONFIG_MTD_ROM=m
81CONFIG_MTD_ABSENT=m
82CONFIG_MTD_COMPLEX_MAPPINGS=y
83CONFIG_MTD_PHYSMAP=m
84CONFIG_MTD_PLATRAM=m
85CONFIG_MTD_DATAFLASH=m
86CONFIG_MTD_M25P80=m
87CONFIG_MTD_SLRAM=m
88CONFIG_MTD_PHRAM=m
89CONFIG_MTD_MTDRAM=m
90CONFIG_MTD_BLOCK2MTD=m
91CONFIG_MTD_NAND=m
92CONFIG_MTD_NAND_VERIFY_WRITE=y
93CONFIG_MTD_NAND_DISKONCHIP=m
94CONFIG_MTD_NAND_NANDSIM=m
95CONFIG_MTD_NAND_PLATFORM=m
96CONFIG_MTD_ALAUDA=m
97CONFIG_MTD_UBI=m
98CONFIG_MTD_UBI_GLUEBI=m
99CONFIG_BLK_DEV_LOOP=y
100CONFIG_BLK_DEV_CRYPTOLOOP=m
101CONFIG_BLK_DEV_NBD=m
102CONFIG_BLK_DEV_RAM=y
103CONFIG_BLK_DEV_RAM_SIZE=65536
104CONFIG_ATMEL_TCLIB=y
105CONFIG_ATMEL_SSC=m
106CONFIG_SENSORS_TSL2550=m
107CONFIG_DS1682=m
108CONFIG_RAID_ATTRS=m
109CONFIG_SCSI=m
110CONFIG_SCSI_TGT=m
111# CONFIG_SCSI_PROC_FS is not set
112CONFIG_BLK_DEV_SD=m
113CONFIG_BLK_DEV_SR=m
114CONFIG_CHR_DEV_SG=m
115CONFIG_CHR_DEV_SCH=m
116CONFIG_SCSI_MULTI_LUN=y
117CONFIG_SCSI_CONSTANTS=y
118CONFIG_SCSI_LOGGING=y
119CONFIG_SCSI_SCAN_ASYNC=y
120CONFIG_SCSI_ISCSI_ATTRS=m
121CONFIG_NETDEVICES=y
122CONFIG_DUMMY=m
123CONFIG_BONDING=m
124CONFIG_MACVLAN=m
125CONFIG_EQUALIZER=m
126CONFIG_TUN=m
127CONFIG_VETH=m
128CONFIG_PHYLIB=y
129CONFIG_MARVELL_PHY=m
130CONFIG_DAVICOM_PHY=m
131CONFIG_QSEMI_PHY=m
132CONFIG_LXT_PHY=m
133CONFIG_CICADA_PHY=m
134CONFIG_VITESSE_PHY=m
135CONFIG_SMSC_PHY=m
136CONFIG_BROADCOM_PHY=m
137CONFIG_ICPLUS_PHY=m
138CONFIG_MDIO_BITBANG=m
139CONFIG_NET_ETHERNET=y
140# CONFIG_NETDEV_1000 is not set
141# CONFIG_NETDEV_10000 is not set
142CONFIG_USB_ZD1201=m
143CONFIG_HOSTAP=m
144CONFIG_HOSTAP_FIRMWARE=y
145CONFIG_HOSTAP_FIRMWARE_NVRAM=y
146CONFIG_USB_CATC=m
147CONFIG_USB_KAWETH=m
148CONFIG_USB_PEGASUS=m
149CONFIG_USB_RTL8150=m
150CONFIG_USB_USBNET=m
151CONFIG_USB_NET_DM9601=m
152CONFIG_USB_NET_GL620A=m
153CONFIG_USB_NET_PLUSB=m
154CONFIG_USB_NET_MCS7830=m
155CONFIG_USB_NET_RNDIS_HOST=m
156CONFIG_USB_ALI_M5632=y
157CONFIG_USB_AN2720=y
158CONFIG_USB_EPSON2888=y
159CONFIG_USB_KC2190=y
160# CONFIG_USB_NET_ZAURUS is not set
161CONFIG_INPUT_MOUSEDEV=m
162CONFIG_INPUT_EVDEV=m
163CONFIG_INPUT_EVBUG=m
164CONFIG_KEYBOARD_LKKBD=m
165CONFIG_KEYBOARD_GPIO=m
166CONFIG_KEYBOARD_NEWTON=m
167CONFIG_KEYBOARD_STOWAWAY=m
168CONFIG_KEYBOARD_SUNKBD=m
169CONFIG_KEYBOARD_XTKBD=m
170CONFIG_MOUSE_PS2=m
171CONFIG_MOUSE_SERIAL=m
172CONFIG_MOUSE_APPLETOUCH=m
173CONFIG_MOUSE_VSXXXAA=m
174CONFIG_MOUSE_GPIO=m
175CONFIG_INPUT_MISC=y
176CONFIG_INPUT_UINPUT=m
177CONFIG_SERIO_SERPORT=m
178CONFIG_SERIO_RAW=m
179CONFIG_VT_HW_CONSOLE_BINDING=y
180CONFIG_SERIAL_NONSTANDARD=y
181CONFIG_N_HDLC=m
182CONFIG_SPECIALIX=m
183CONFIG_STALDRV=y
184CONFIG_SERIAL_ATMEL=y
185CONFIG_SERIAL_ATMEL_CONSOLE=y
186CONFIG_IPMI_HANDLER=m
187CONFIG_IPMI_DEVICE_INTERFACE=m
188CONFIG_IPMI_SI=m
189CONFIG_IPMI_WATCHDOG=m
190CONFIG_IPMI_POWEROFF=m
191CONFIG_HW_RANDOM=y
192CONFIG_R3964=m
193CONFIG_RAW_DRIVER=m
194CONFIG_TCG_TPM=m
195CONFIG_TCG_NSC=m
196CONFIG_TCG_ATMEL=m
197CONFIG_I2C=m
198CONFIG_I2C_CHARDEV=m
199CONFIG_SPI=y
200CONFIG_SPI_ATMEL=y
201CONFIG_SPI_BITBANG=m
202CONFIG_SPI_SPIDEV=m
203# CONFIG_HWMON is not set
204# CONFIG_VGA_CONSOLE is not set
205CONFIG_SOUND=m
206CONFIG_SND=m
207CONFIG_SND_SEQUENCER=m
208CONFIG_SND_SEQ_DUMMY=m
209CONFIG_SND_MIXER_OSS=m
210CONFIG_SND_PCM_OSS=m
211# CONFIG_SND_PCM_OSS_PLUGINS is not set
212CONFIG_SND_SEQUENCER_OSS=y
213CONFIG_SND_DYNAMIC_MINORS=y
214# CONFIG_SND_VERBOSE_PROCFS is not set
215CONFIG_SND_DUMMY=m
216CONFIG_SND_VIRMIDI=m
217CONFIG_SND_USB_AUDIO=m
218CONFIG_SND_USB_CAIAQ=m
219CONFIG_SND_USB_CAIAQ_INPUT=y
220CONFIG_HID=m
221CONFIG_HIDRAW=y
222CONFIG_USB_HID=m
223CONFIG_USB_HIDDEV=y
224CONFIG_USB_KBD=m
225CONFIG_USB_MOUSE=m
226CONFIG_HID_A4TECH=m
227CONFIG_HID_APPLE=m
228CONFIG_HID_BELKIN=m
229CONFIG_HID_CHERRY=m
230CONFIG_HID_CHICONY=m
231CONFIG_HID_CYPRESS=m
232CONFIG_HID_EZKEY=m
233CONFIG_HID_GYRATION=m
234CONFIG_HID_LOGITECH=m
235CONFIG_HID_MICROSOFT=m
236CONFIG_HID_MONTEREY=m
237CONFIG_HID_PANTHERLORD=m
238CONFIG_HID_PETALYNX=m
239CONFIG_HID_SAMSUNG=m
240CONFIG_HID_SONY=m
241CONFIG_HID_SUNPLUS=m
242CONFIG_USB=y
243CONFIG_USB_DEVICEFS=y
244# CONFIG_USB_DEVICE_CLASS is not set
245CONFIG_USB_DYNAMIC_MINORS=y
246CONFIG_USB_MON=y
247CONFIG_USB_OHCI_HCD=y
248CONFIG_USB_STORAGE=m
249CONFIG_USB_STORAGE_DATAFAB=m
250CONFIG_USB_STORAGE_FREECOM=m
251CONFIG_USB_STORAGE_ISD200=m
252CONFIG_USB_STORAGE_USBAT=m
253CONFIG_USB_STORAGE_SDDR09=m
254CONFIG_USB_STORAGE_SDDR55=m
255CONFIG_USB_STORAGE_JUMPSHOT=m
256CONFIG_USB_STORAGE_ALAUDA=m
257CONFIG_USB_STORAGE_KARMA=m
258CONFIG_USB_LIBUSUAL=y
259CONFIG_USB_SERIAL=m
260CONFIG_USB_EZUSB=y
261CONFIG_USB_SERIAL_GENERIC=y
262CONFIG_USB_SERIAL_PL2303=m
263CONFIG_USB_SERIAL_SPCP8X5=m
264CONFIG_USB_SERIAL_DEBUG=m
265CONFIG_USB_EMI62=m
266CONFIG_USB_EMI26=m
267CONFIG_USB_ADUTUX=m
268CONFIG_USB_TEST=m
269CONFIG_USB_GADGET=m
270CONFIG_USB_GADGET_DEBUG_FILES=y
271CONFIG_USB_GADGET_DEBUG_FS=y
272CONFIG_USB_ZERO=m
273CONFIG_USB_ETH=m
274CONFIG_USB_GADGETFS=m
275CONFIG_USB_FILE_STORAGE=m
276CONFIG_USB_G_SERIAL=m
277CONFIG_USB_MIDI_GADGET=m
278CONFIG_MMC=y
279CONFIG_SDIO_UART=m
280CONFIG_MMC_AT91=m
281CONFIG_MMC_SPI=m
282CONFIG_NEW_LEDS=y
283CONFIG_LEDS_CLASS=m
284CONFIG_LEDS_GPIO=m
285CONFIG_LEDS_TRIGGERS=y
286CONFIG_LEDS_TRIGGER_TIMER=m
287CONFIG_LEDS_TRIGGER_HEARTBEAT=m
288CONFIG_RTC_CLASS=y
289CONFIG_RTC_INTF_DEV_UIE_EMUL=y
290CONFIG_RTC_DRV_DS1307=m
291CONFIG_RTC_DRV_DS1305=y
292CONFIG_EXT2_FS=y
293CONFIG_EXT2_FS_XATTR=y
294CONFIG_EXT2_FS_POSIX_ACL=y
295CONFIG_EXT2_FS_SECURITY=y
296CONFIG_EXT3_FS=y
297CONFIG_EXT3_FS_POSIX_ACL=y
298CONFIG_EXT3_FS_SECURITY=y
299CONFIG_JBD_DEBUG=y
300CONFIG_REISERFS_FS=m
301CONFIG_REISERFS_CHECK=y
302CONFIG_REISERFS_PROC_INFO=y
303CONFIG_REISERFS_FS_XATTR=y
304CONFIG_REISERFS_FS_POSIX_ACL=y
305CONFIG_REISERFS_FS_SECURITY=y
306CONFIG_INOTIFY=y
307CONFIG_FUSE_FS=m
308CONFIG_MSDOS_FS=m
309CONFIG_VFAT_FS=y
310CONFIG_NTFS_FS=m
311CONFIG_NTFS_RW=y
312CONFIG_TMPFS=y
313CONFIG_TMPFS_POSIX_ACL=y
314CONFIG_JFFS2_FS=m
315CONFIG_JFFS2_COMPRESSION_OPTIONS=y
316CONFIG_JFFS2_LZO=y
317CONFIG_JFFS2_CMODE_FAVOURLZO=y
318CONFIG_CRAMFS=m
319CONFIG_NFS_FS=m
320CONFIG_NFS_V3=y
321CONFIG_NFS_V3_ACL=y
322CONFIG_NFS_V4=y
323CONFIG_NFSD=m
324CONFIG_NFSD_V3_ACL=y
325CONFIG_NFSD_V4=y
326CONFIG_CIFS=m
327CONFIG_CIFS_WEAK_PW_HASH=y
328CONFIG_PARTITION_ADVANCED=y
329CONFIG_MAC_PARTITION=y
330CONFIG_BSD_DISKLABEL=y
331CONFIG_MINIX_SUBPARTITION=y
332CONFIG_SOLARIS_X86_PARTITION=y
333CONFIG_UNIXWARE_DISKLABEL=y
334CONFIG_LDM_PARTITION=y
335CONFIG_LDM_DEBUG=y
336CONFIG_SGI_PARTITION=y
337CONFIG_SUN_PARTITION=y
338CONFIG_NLS_DEFAULT="cp437"
339CONFIG_NLS_CODEPAGE_437=y
340CONFIG_NLS_CODEPAGE_850=m
341CONFIG_NLS_ASCII=y
342CONFIG_NLS_ISO8859_1=y
343CONFIG_NLS_UTF8=m
344CONFIG_DLM=m
345CONFIG_PRINTK_TIME=y
346CONFIG_MAGIC_SYSRQ=y
347CONFIG_UNUSED_SYMBOLS=y
348CONFIG_DEBUG_FS=y
349# CONFIG_RCU_CPU_STALL_DETECTOR is not set
350CONFIG_SYSCTL_SYSCALL_CHECK=y
351CONFIG_CRYPTO=y
352CONFIG_CRYPTO_GF128MUL=m
353CONFIG_CRYPTO_HMAC=y
354CONFIG_CRYPTO_MD5=y
355# CONFIG_CRYPTO_ANSI_CPRNG is not set
356# CONFIG_CRYPTO_HW is not set
357CONFIG_CRC_CCITT=m
358CONFIG_CRC16=m
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261_defconfig
index b46025b66b64..ade6b2f23116 100644
--- a/arch/arm/configs/at91sam9261ek_defconfig
+++ b/arch/arm/configs/at91sam9261_defconfig
@@ -1,9 +1,13 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_KERNEL_LZMA=y
3# CONFIG_SWAP is not set 4# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y 5CONFIG_SYSVIPC=y
6CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=14 8CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y 9CONFIG_NAMESPACES=y
10CONFIG_EMBEDDED=y
7CONFIG_SLAB=y 11CONFIG_SLAB=y
8CONFIG_MODULES=y 12CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y 13CONFIG_MODULE_UNLOAD=y
@@ -15,18 +19,27 @@ CONFIG_ARCH_AT91SAM9261=y
15CONFIG_MACH_AT91SAM9261EK=y 19CONFIG_MACH_AT91SAM9261EK=y
16CONFIG_AT91_PROGRAMMABLE_CLOCKS=y 20CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
17# CONFIG_ARM_THUMB is not set 21# CONFIG_ARM_THUMB is not set
22CONFIG_AEABI=y
23# CONFIG_OABI_COMPAT is not set
18CONFIG_ZBOOT_ROM_TEXT=0x0 24CONFIG_ZBOOT_ROM_TEXT=0x0
19CONFIG_ZBOOT_ROM_BSS=0x0 25CONFIG_ZBOOT_ROM_BSS=0x0
20CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" 26CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
21CONFIG_FPE_NWFPE=y 27CONFIG_AUTO_ZRELADDR=y
28CONFIG_VFP=y
29# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
22CONFIG_NET=y 30CONFIG_NET=y
23CONFIG_PACKET=y 31CONFIG_PACKET=y
24CONFIG_UNIX=y 32CONFIG_UNIX=y
25CONFIG_INET=y 33CONFIG_INET=y
34CONFIG_IP_MULTICAST=y
26CONFIG_IP_PNP=y 35CONFIG_IP_PNP=y
36CONFIG_IP_PNP_DHCP=y
27CONFIG_IP_PNP_BOOTP=y 37CONFIG_IP_PNP_BOOTP=y
28# CONFIG_INET_LRO is not set 38# CONFIG_INET_LRO is not set
29# CONFIG_IPV6 is not set 39# CONFIG_IPV6 is not set
40CONFIG_CFG80211=y
41CONFIG_LIB80211=y
42CONFIG_MAC80211=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 43CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31CONFIG_MTD=y 44CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y 45CONFIG_MTD_PARTITIONS=y
@@ -34,8 +47,12 @@ CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_BLOCK=y 47CONFIG_MTD_BLOCK=y
35CONFIG_MTD_NAND=y 48CONFIG_MTD_NAND=y
36CONFIG_MTD_NAND_ATMEL=y 49CONFIG_MTD_NAND_ATMEL=y
50CONFIG_MTD_UBI=y
51CONFIG_MTD_UBI_GLUEBI=y
37CONFIG_BLK_DEV_RAM=y 52CONFIG_BLK_DEV_RAM=y
38CONFIG_BLK_DEV_RAM_SIZE=8192 53CONFIG_BLK_DEV_RAM_SIZE=8192
54CONFIG_MISC_DEVICES=y
55CONFIG_ATMEL_TCLIB=y
39CONFIG_ATMEL_SSC=y 56CONFIG_ATMEL_SSC=y
40CONFIG_SCSI=y 57CONFIG_SCSI=y
41CONFIG_BLK_DEV_SD=y 58CONFIG_BLK_DEV_SD=y
@@ -45,12 +62,27 @@ CONFIG_NET_ETHERNET=y
45CONFIG_DM9000=y 62CONFIG_DM9000=y
46# CONFIG_NETDEV_1000 is not set 63# CONFIG_NETDEV_1000 is not set
47# CONFIG_NETDEV_10000 is not set 64# CONFIG_NETDEV_10000 is not set
65CONFIG_USB_ZD1201=m
66CONFIG_RTL8187=m
67CONFIG_LIBERTAS=m
68CONFIG_LIBERTAS_USB=m
69CONFIG_LIBERTAS_SDIO=m
70CONFIG_LIBERTAS_SPI=m
71CONFIG_RT2X00=m
72CONFIG_RT2500USB=m
73CONFIG_RT73USB=m
74CONFIG_ZD1211RW=m
75CONFIG_INPUT_POLLDEV=m
48# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 76# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
77CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
78CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
79CONFIG_INPUT_EVDEV=y
49# CONFIG_KEYBOARD_ATKBD is not set 80# CONFIG_KEYBOARD_ATKBD is not set
50CONFIG_KEYBOARD_GPIO=y 81CONFIG_KEYBOARD_GPIO=y
51# CONFIG_INPUT_MOUSE is not set 82# CONFIG_INPUT_MOUSE is not set
52CONFIG_INPUT_TOUCHSCREEN=y 83CONFIG_INPUT_TOUCHSCREEN=y
53CONFIG_TOUCHSCREEN_ADS7846=y 84CONFIG_TOUCHSCREEN_ADS7846=y
85CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
54CONFIG_SERIAL_ATMEL=y 86CONFIG_SERIAL_ATMEL=y
55CONFIG_SERIAL_ATMEL_CONSOLE=y 87CONFIG_SERIAL_ATMEL_CONSOLE=y
56CONFIG_HW_RANDOM=y 88CONFIG_HW_RANDOM=y
@@ -65,31 +97,62 @@ CONFIG_WATCHDOG_NOWAYOUT=y
65CONFIG_AT91SAM9X_WATCHDOG=y 97CONFIG_AT91SAM9X_WATCHDOG=y
66CONFIG_FB=y 98CONFIG_FB=y
67CONFIG_FB_ATMEL=y 99CONFIG_FB_ATMEL=y
68# CONFIG_VGA_CONSOLE is not set 100CONFIG_BACKLIGHT_LCD_SUPPORT=y
101# CONFIG_LCD_CLASS_DEVICE is not set
102CONFIG_BACKLIGHT_CLASS_DEVICE=y
103CONFIG_BACKLIGHT_ATMEL_LCDC=y
104# CONFIG_BACKLIGHT_GENERIC is not set
105CONFIG_FRAMEBUFFER_CONSOLE=y
106CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
107CONFIG_LOGO=y
108CONFIG_SOUND=y
109CONFIG_SND=y
110CONFIG_SND_SEQUENCER=y
111CONFIG_SND_MIXER_OSS=y
112CONFIG_SND_PCM_OSS=y
113# CONFIG_SND_SUPPORT_OLD_API is not set
114# CONFIG_SND_VERBOSE_PROCFS is not set
115# CONFIG_SND_DRIVERS is not set
116# CONFIG_SND_ARM is not set
117CONFIG_SND_AT73C213=y
118CONFIG_SND_USB_AUDIO=m
69# CONFIG_USB_HID is not set 119# CONFIG_USB_HID is not set
70CONFIG_USB=y 120CONFIG_USB=y
71CONFIG_USB_DEVICEFS=y 121CONFIG_USB_DEVICEFS=y
72CONFIG_USB_MON=y
73CONFIG_USB_OHCI_HCD=y 122CONFIG_USB_OHCI_HCD=y
74CONFIG_USB_STORAGE=y 123CONFIG_USB_STORAGE=y
75CONFIG_USB_STORAGE_DEBUG=y
76CONFIG_USB_GADGET=y 124CONFIG_USB_GADGET=y
77CONFIG_USB_ZERO=m 125CONFIG_USB_ZERO=m
126CONFIG_USB_ETH=m
78CONFIG_USB_GADGETFS=m 127CONFIG_USB_GADGETFS=m
79CONFIG_USB_FILE_STORAGE=m 128CONFIG_USB_FILE_STORAGE=m
80CONFIG_USB_G_SERIAL=m 129CONFIG_USB_G_SERIAL=m
81CONFIG_MMC=y 130CONFIG_MMC=y
82CONFIG_MMC_AT91=m 131CONFIG_MMC_AT91=m
132CONFIG_NEW_LEDS=y
133CONFIG_LEDS_CLASS=y
134CONFIG_LEDS_GPIO=y
135CONFIG_LEDS_TRIGGERS=y
136CONFIG_LEDS_TRIGGER_TIMER=y
137CONFIG_LEDS_TRIGGER_HEARTBEAT=y
138CONFIG_LEDS_TRIGGER_GPIO=y
83CONFIG_RTC_CLASS=y 139CONFIG_RTC_CLASS=y
84CONFIG_RTC_DRV_AT91SAM9=y 140CONFIG_RTC_DRV_AT91SAM9=y
85CONFIG_EXT2_FS=y 141CONFIG_MSDOS_FS=y
86CONFIG_INOTIFY=y
87CONFIG_VFAT_FS=y 142CONFIG_VFAT_FS=y
88CONFIG_TMPFS=y 143CONFIG_TMPFS=y
89CONFIG_CRAMFS=y 144CONFIG_UBIFS_FS=y
145CONFIG_UBIFS_FS_ADVANCED_COMPR=y
146CONFIG_SQUASHFS=y
147CONFIG_SQUASHFS_LZO=y
148CONFIG_SQUASHFS_XZ=y
149CONFIG_NFS_FS=y
150CONFIG_NFS_V3=y
151CONFIG_ROOT_NFS=y
90CONFIG_NLS_CODEPAGE_437=y 152CONFIG_NLS_CODEPAGE_437=y
91CONFIG_NLS_CODEPAGE_850=y 153CONFIG_NLS_CODEPAGE_850=y
92CONFIG_NLS_ISO8859_1=y 154CONFIG_NLS_ISO8859_1=y
93CONFIG_DEBUG_KERNEL=y 155CONFIG_NLS_ISO8859_15=y
94CONFIG_DEBUG_USER=y 156CONFIG_NLS_UTF8=y
95CONFIG_DEBUG_LL=y 157CONFIG_FTRACE=y
158CONFIG_CRC_CCITT=m
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263_defconfig
index 8a04d6f4e065..1cf96264cba1 100644
--- a/arch/arm/configs/at91sam9263ek_defconfig
+++ b/arch/arm/configs/at91sam9263_defconfig
@@ -1,9 +1,13 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_KERNEL_LZMA=y
3# CONFIG_SWAP is not set 4# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y 5CONFIG_SYSVIPC=y
6CONFIG_IKCONFIG=y
7CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=14 8CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y 9CONFIG_NAMESPACES=y
10CONFIG_EMBEDDED=y
7CONFIG_SLAB=y 11CONFIG_SLAB=y
8CONFIG_MODULES=y 12CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y 13CONFIG_MODULE_UNLOAD=y
@@ -13,53 +17,81 @@ CONFIG_MODULE_UNLOAD=y
13CONFIG_ARCH_AT91=y 17CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91SAM9263=y 18CONFIG_ARCH_AT91SAM9263=y
15CONFIG_MACH_AT91SAM9263EK=y 19CONFIG_MACH_AT91SAM9263EK=y
20CONFIG_MACH_USB_A9263=y
21CONFIG_MACH_NEOCORE926=y
16CONFIG_MTD_AT91_DATAFLASH_CARD=y 22CONFIG_MTD_AT91_DATAFLASH_CARD=y
17# CONFIG_ARM_THUMB is not set 23# CONFIG_ARM_THUMB is not set
24CONFIG_AEABI=y
25# CONFIG_OABI_COMPAT is not set
18CONFIG_ZBOOT_ROM_TEXT=0x0 26CONFIG_ZBOOT_ROM_TEXT=0x0
19CONFIG_ZBOOT_ROM_BSS=0x0 27CONFIG_ZBOOT_ROM_BSS=0x0
20CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" 28CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
21CONFIG_FPE_NWFPE=y 29CONFIG_AUTO_ZRELADDR=y
22CONFIG_NET=y 30CONFIG_NET=y
23CONFIG_PACKET=y 31CONFIG_PACKET=y
24CONFIG_UNIX=y 32CONFIG_UNIX=y
33CONFIG_NET_KEY=y
25CONFIG_INET=y 34CONFIG_INET=y
35CONFIG_IP_MULTICAST=y
36CONFIG_IP_ADVANCED_ROUTER=y
37CONFIG_IP_ROUTE_VERBOSE=y
26CONFIG_IP_PNP=y 38CONFIG_IP_PNP=y
39CONFIG_IP_PNP_DHCP=y
27CONFIG_IP_PNP_BOOTP=y 40CONFIG_IP_PNP_BOOTP=y
28CONFIG_IP_PNP_RARP=y 41CONFIG_IP_PNP_RARP=y
42CONFIG_NET_IPIP=y
43CONFIG_IP_MROUTE=y
44CONFIG_IP_PIMSM_V1=y
45CONFIG_IP_PIMSM_V2=y
29# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 46# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
30# CONFIG_INET_XFRM_MODE_TUNNEL is not set 47# CONFIG_INET_XFRM_MODE_TUNNEL is not set
31# CONFIG_INET_XFRM_MODE_BEET is not set 48# CONFIG_INET_XFRM_MODE_BEET is not set
32# CONFIG_INET_LRO is not set 49# CONFIG_INET_LRO is not set
33# CONFIG_INET_DIAG is not set 50# CONFIG_INET_DIAG is not set
34# CONFIG_IPV6 is not set 51CONFIG_IPV6=y
35CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 52CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
36CONFIG_MTD=y 53CONFIG_MTD=y
37CONFIG_MTD_PARTITIONS=y 54CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_CMDLINE_PARTS=y 55CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_CHAR=y 56CONFIG_MTD_CHAR=y
40CONFIG_MTD_BLOCK=y 57CONFIG_MTD_BLOCK=y
58CONFIG_NFTL=y
59CONFIG_NFTL_RW=y
41CONFIG_MTD_DATAFLASH=y 60CONFIG_MTD_DATAFLASH=y
61CONFIG_MTD_BLOCK2MTD=y
42CONFIG_MTD_NAND=y 62CONFIG_MTD_NAND=y
43CONFIG_MTD_NAND_ATMEL=y 63CONFIG_MTD_NAND_ATMEL=y
64CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
65CONFIG_MTD_UBI=y
66CONFIG_MTD_UBI_GLUEBI=y
44CONFIG_BLK_DEV_LOOP=y 67CONFIG_BLK_DEV_LOOP=y
45CONFIG_BLK_DEV_RAM=y 68CONFIG_BLK_DEV_RAM=y
46CONFIG_BLK_DEV_RAM_SIZE=8192 69CONFIG_BLK_DEV_RAM_SIZE=8192
47CONFIG_ATMEL_SSC=y 70CONFIG_MISC_DEVICES=y
71CONFIG_ATMEL_PWM=y
72CONFIG_ATMEL_TCLIB=y
48CONFIG_SCSI=y 73CONFIG_SCSI=y
49CONFIG_BLK_DEV_SD=y 74CONFIG_BLK_DEV_SD=y
50CONFIG_SCSI_MULTI_LUN=y 75CONFIG_SCSI_MULTI_LUN=y
51CONFIG_NETDEVICES=y 76CONFIG_NETDEVICES=y
52CONFIG_NET_ETHERNET=y
53CONFIG_MII=y 77CONFIG_MII=y
78CONFIG_SMSC_PHY=y
79CONFIG_NET_ETHERNET=y
54CONFIG_MACB=y 80CONFIG_MACB=y
81# CONFIG_NETDEV_1000 is not set
82# CONFIG_NETDEV_10000 is not set
83CONFIG_USB_ZD1201=m
84CONFIG_INPUT_POLLDEV=m
55# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 85# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
86CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
87CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
56CONFIG_INPUT_EVDEV=y 88CONFIG_INPUT_EVDEV=y
57# CONFIG_KEYBOARD_ATKBD is not set 89# CONFIG_KEYBOARD_ATKBD is not set
58CONFIG_KEYBOARD_GPIO=y 90CONFIG_KEYBOARD_GPIO=y
59# CONFIG_INPUT_MOUSE is not set 91# CONFIG_INPUT_MOUSE is not set
60CONFIG_INPUT_TOUCHSCREEN=y 92CONFIG_INPUT_TOUCHSCREEN=y
61CONFIG_TOUCHSCREEN_ADS7846=y 93CONFIG_TOUCHSCREEN_ADS7846=y
62# CONFIG_SERIO is not set 94CONFIG_LEGACY_PTY_COUNT=4
63CONFIG_SERIAL_ATMEL=y 95CONFIG_SERIAL_ATMEL=y
64CONFIG_SERIAL_ATMEL_CONSOLE=y 96CONFIG_SERIAL_ATMEL_CONSOLE=y
65CONFIG_HW_RANDOM=y 97CONFIG_HW_RANDOM=y
@@ -74,8 +106,25 @@ CONFIG_WATCHDOG_NOWAYOUT=y
74CONFIG_AT91SAM9X_WATCHDOG=y 106CONFIG_AT91SAM9X_WATCHDOG=y
75CONFIG_FB=y 107CONFIG_FB=y
76CONFIG_FB_ATMEL=y 108CONFIG_FB_ATMEL=y
77# CONFIG_VGA_CONSOLE is not set 109CONFIG_BACKLIGHT_LCD_SUPPORT=y
78# CONFIG_USB_HID is not set 110CONFIG_LCD_CLASS_DEVICE=y
111CONFIG_BACKLIGHT_CLASS_DEVICE=y
112CONFIG_BACKLIGHT_ATMEL_LCDC=y
113CONFIG_FRAMEBUFFER_CONSOLE=y
114CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
115CONFIG_LOGO=y
116CONFIG_SOUND=y
117CONFIG_SND=y
118CONFIG_SND_SEQUENCER=y
119CONFIG_SND_MIXER_OSS=y
120CONFIG_SND_PCM_OSS=y
121# CONFIG_SND_SUPPORT_OLD_API is not set
122# CONFIG_SND_VERBOSE_PROCFS is not set
123# CONFIG_SND_DRIVERS is not set
124# CONFIG_SND_ARM is not set
125CONFIG_SND_ATMEL_AC97C=y
126# CONFIG_SND_SPI is not set
127CONFIG_SND_USB_AUDIO=m
79CONFIG_USB=y 128CONFIG_USB=y
80CONFIG_USB_DEVICEFS=y 129CONFIG_USB_DEVICEFS=y
81CONFIG_USB_MON=y 130CONFIG_USB_MON=y
@@ -83,24 +132,37 @@ CONFIG_USB_OHCI_HCD=y
83CONFIG_USB_STORAGE=y 132CONFIG_USB_STORAGE=y
84CONFIG_USB_GADGET=y 133CONFIG_USB_GADGET=y
85CONFIG_USB_ZERO=m 134CONFIG_USB_ZERO=m
135CONFIG_USB_ETH=m
86CONFIG_USB_GADGETFS=m 136CONFIG_USB_GADGETFS=m
87CONFIG_USB_FILE_STORAGE=m 137CONFIG_USB_FILE_STORAGE=m
88CONFIG_USB_G_SERIAL=m 138CONFIG_USB_G_SERIAL=m
89CONFIG_MMC=y 139CONFIG_MMC=y
140CONFIG_SDIO_UART=m
90CONFIG_MMC_AT91=m 141CONFIG_MMC_AT91=m
142CONFIG_NEW_LEDS=y
143CONFIG_LEDS_CLASS=y
144CONFIG_LEDS_ATMEL_PWM=y
145CONFIG_LEDS_GPIO=y
146CONFIG_LEDS_TRIGGERS=y
147CONFIG_LEDS_TRIGGER_HEARTBEAT=y
91CONFIG_RTC_CLASS=y 148CONFIG_RTC_CLASS=y
92CONFIG_RTC_DRV_AT91SAM9=y 149CONFIG_RTC_DRV_AT91SAM9=y
93CONFIG_EXT2_FS=y 150CONFIG_EXT2_FS=y
94CONFIG_INOTIFY=y 151CONFIG_FUSE_FS=m
95CONFIG_VFAT_FS=y 152CONFIG_VFAT_FS=y
96CONFIG_TMPFS=y 153CONFIG_TMPFS=y
97CONFIG_JFFS2_FS=y 154CONFIG_JFFS2_FS=y
155CONFIG_UBIFS_FS=y
156CONFIG_UBIFS_FS_ADVANCED_COMPR=y
98CONFIG_CRAMFS=y 157CONFIG_CRAMFS=y
99CONFIG_NFS_FS=y 158CONFIG_NFS_FS=y
159CONFIG_NFS_V3=y
160CONFIG_NFS_V3_ACL=y
161CONFIG_NFS_V4=y
100CONFIG_ROOT_NFS=y 162CONFIG_ROOT_NFS=y
101CONFIG_NLS_CODEPAGE_437=y 163CONFIG_NLS_CODEPAGE_437=y
102CONFIG_NLS_CODEPAGE_850=y 164CONFIG_NLS_CODEPAGE_850=y
103CONFIG_NLS_ISO8859_1=y 165CONFIG_NLS_ISO8859_1=y
104CONFIG_DEBUG_KERNEL=y 166CONFIG_FTRACE=y
105CONFIG_DEBUG_USER=y 167CONFIG_DEBUG_USER=y
106CONFIG_DEBUG_LL=y 168CONFIG_XZ_DEC=y
diff --git a/arch/arm/configs/neocore926_defconfig b/arch/arm/configs/neocore926_defconfig
deleted file mode 100644
index 462dd1850d15..000000000000
--- a/arch/arm/configs/neocore926_defconfig
+++ /dev/null
@@ -1,104 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y
5CONFIG_BLK_DEV_INITRD=y
6# CONFIG_COMPAT_BRK is not set
7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y
9# CONFIG_BLK_DEV_BSG is not set
10# CONFIG_IOSCHED_DEADLINE is not set
11# CONFIG_IOSCHED_CFQ is not set
12CONFIG_ARCH_AT91=y
13CONFIG_ARCH_AT91SAM9263=y
14CONFIG_MACH_NEOCORE926=y
15CONFIG_MTD_AT91_DATAFLASH_CARD=y
16CONFIG_ZBOOT_ROM_TEXT=0x0
17CONFIG_ZBOOT_ROM_BSS=0x0
18CONFIG_FPE_NWFPE=y
19CONFIG_NET=y
20CONFIG_PACKET=y
21CONFIG_UNIX=y
22CONFIG_NET_KEY=y
23CONFIG_INET=y
24CONFIG_IP_PNP=y
25CONFIG_IP_PNP_DHCP=y
26CONFIG_IP_PNP_BOOTP=y
27CONFIG_IP_PNP_RARP=y
28CONFIG_NET_IPIP=y
29# CONFIG_INET_LRO is not set
30CONFIG_IPV6=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32# CONFIG_PREVENT_FIRMWARE_BUILD is not set
33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CHAR=y
36CONFIG_MTD_BLOCK=y
37CONFIG_NFTL=y
38CONFIG_NFTL_RW=y
39CONFIG_MTD_BLOCK2MTD=y
40CONFIG_MTD_NAND=y
41CONFIG_MTD_NAND_ECC_SMC=y
42CONFIG_MTD_NAND_VERIFY_WRITE=y
43CONFIG_MTD_NAND_ATMEL=y
44CONFIG_MTD_NAND_PLATFORM=y
45CONFIG_BLK_DEV_LOOP=y
46CONFIG_BLK_DEV_NBD=y
47CONFIG_ATMEL_PWM=y
48CONFIG_ATMEL_TCLIB=y
49CONFIG_SCSI=y
50CONFIG_CHR_DEV_SG=y
51CONFIG_NETDEVICES=y
52CONFIG_SMSC_PHY=y
53CONFIG_NET_ETHERNET=y
54CONFIG_MACB=y
55# CONFIG_NETDEV_1000 is not set
56# CONFIG_NETDEV_10000 is not set
57# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
58CONFIG_INPUT_EVDEV=y
59CONFIG_INPUT_TOUCHSCREEN=y
60CONFIG_TOUCHSCREEN_ADS7846=y
61CONFIG_VT_HW_CONSOLE_BINDING=y
62# CONFIG_DEVKMEM is not set
63CONFIG_SERIAL_NONSTANDARD=y
64CONFIG_SERIAL_ATMEL=y
65CONFIG_SERIAL_ATMEL_CONSOLE=y
66# CONFIG_SERIAL_ATMEL_PDC is not set
67# CONFIG_HW_RANDOM is not set
68CONFIG_I2C=y
69CONFIG_I2C_CHARDEV=y
70CONFIG_SPI=y
71CONFIG_SPI_ATMEL=y
72# CONFIG_HWMON is not set
73CONFIG_VIDEO_OUTPUT_CONTROL=y
74CONFIG_FB=y
75CONFIG_FB_ATMEL=y
76CONFIG_BACKLIGHT_LCD_SUPPORT=y
77CONFIG_LCD_CLASS_DEVICE=y
78CONFIG_BACKLIGHT_CLASS_DEVICE=y
79CONFIG_BACKLIGHT_ATMEL_LCDC=y
80# CONFIG_VGA_CONSOLE is not set
81CONFIG_FRAMEBUFFER_CONSOLE=y
82CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
83CONFIG_LOGO=y
84CONFIG_USB=y
85CONFIG_USB_DEVICEFS=y
86CONFIG_USB_MON=y
87CONFIG_USB_OHCI_HCD=y
88CONFIG_USB_STORAGE=y
89CONFIG_MMC=y
90CONFIG_SDIO_UART=y
91CONFIG_MMC_AT91=m
92CONFIG_EXT2_FS=y
93# CONFIG_DNOTIFY is not set
94CONFIG_AUTOFS_FS=y
95CONFIG_VFAT_FS=y
96CONFIG_TMPFS=y
97CONFIG_JFFS2_FS=y
98CONFIG_JFFS2_FS_WBUF_VERIFY=y
99CONFIG_NFS_FS=y
100CONFIG_ROOT_NFS=y
101# CONFIG_ENABLE_WARN_DEPRECATED is not set
102# CONFIG_ENABLE_MUST_CHECK is not set
103CONFIG_SYSCTL_SYSCALL_CHECK=y
104# CONFIG_CRYPTO_HW is not set
diff --git a/arch/arm/configs/usb-a9263_defconfig b/arch/arm/configs/usb-a9263_defconfig
deleted file mode 100644
index ee82d09249c6..000000000000
--- a/arch/arm/configs/usb-a9263_defconfig
+++ /dev/null
@@ -1,106 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14
6# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
7CONFIG_SLAB=y
8CONFIG_MODULES=y
9CONFIG_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
13CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91SAM9263=y
15CONFIG_MACH_USB_A9263=y
16CONFIG_AT91_SLOW_CLOCK=y
17# CONFIG_ARM_THUMB is not set
18CONFIG_AEABI=y
19CONFIG_ZBOOT_ROM_TEXT=0x0
20CONFIG_ZBOOT_ROM_BSS=0x0
21CONFIG_CMDLINE="mem=64M console=ttyS0,115200"
22CONFIG_FPE_NWFPE=y
23CONFIG_PM=y
24CONFIG_NET=y
25CONFIG_PACKET=y
26CONFIG_UNIX=y
27CONFIG_INET=y
28CONFIG_IP_MULTICAST=y
29CONFIG_IP_ADVANCED_ROUTER=y
30CONFIG_IP_ROUTE_VERBOSE=y
31CONFIG_IP_PNP=y
32CONFIG_IP_PNP_BOOTP=y
33CONFIG_IP_PNP_RARP=y
34CONFIG_IP_MROUTE=y
35CONFIG_IP_PIMSM_V1=y
36CONFIG_IP_PIMSM_V2=y
37# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
38# CONFIG_INET_XFRM_MODE_TUNNEL is not set
39# CONFIG_INET_XFRM_MODE_BEET is not set
40# CONFIG_INET_LRO is not set
41# CONFIG_INET_DIAG is not set
42# CONFIG_IPV6 is not set
43CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
44CONFIG_MTD=y
45CONFIG_MTD_PARTITIONS=y
46CONFIG_MTD_CMDLINE_PARTS=y
47CONFIG_MTD_CHAR=y
48CONFIG_MTD_BLOCK=y
49CONFIG_MTD_DATAFLASH=y
50CONFIG_MTD_NAND=y
51CONFIG_MTD_NAND_ATMEL=y
52CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
53CONFIG_BLK_DEV_LOOP=y
54# CONFIG_MISC_DEVICES is not set
55CONFIG_SCSI=y
56CONFIG_BLK_DEV_SD=y
57CONFIG_SCSI_MULTI_LUN=y
58CONFIG_NETDEVICES=y
59CONFIG_NET_ETHERNET=y
60CONFIG_MII=y
61CONFIG_MACB=y
62# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
63CONFIG_INPUT_EVDEV=y
64CONFIG_INPUT_EVBUG=y
65# CONFIG_KEYBOARD_ATKBD is not set
66CONFIG_KEYBOARD_GPIO=y
67# CONFIG_INPUT_MOUSE is not set
68# CONFIG_SERIO is not set
69CONFIG_SERIAL_ATMEL=y
70CONFIG_SERIAL_ATMEL_CONSOLE=y
71CONFIG_HW_RANDOM=y
72CONFIG_SPI=y
73CONFIG_SPI_ATMEL=y
74# CONFIG_HWMON is not set
75# CONFIG_VGA_CONSOLE is not set
76# CONFIG_USB_HID is not set
77CONFIG_USB=y
78CONFIG_USB_DEVICEFS=y
79CONFIG_USB_MON=y
80CONFIG_USB_OHCI_HCD=y
81CONFIG_USB_STORAGE=y
82CONFIG_USB_GADGET=y
83CONFIG_USB_ETH=m
84CONFIG_NEW_LEDS=y
85CONFIG_LEDS_CLASS=y
86CONFIG_LEDS_GPIO=y
87CONFIG_LEDS_TRIGGERS=y
88CONFIG_LEDS_TRIGGER_HEARTBEAT=y
89CONFIG_EXT2_FS=y
90CONFIG_INOTIFY=y
91CONFIG_FUSE_FS=m
92CONFIG_VFAT_FS=y
93CONFIG_TMPFS=y
94CONFIG_JFFS2_FS=y
95CONFIG_NFS_FS=y
96CONFIG_NFS_V3=y
97CONFIG_NFS_V3_ACL=y
98CONFIG_NFS_V4=y
99CONFIG_ROOT_NFS=y
100CONFIG_NLS_CODEPAGE_437=y
101CONFIG_NLS_CODEPAGE_850=y
102CONFIG_NLS_ISO8859_1=y
103CONFIG_DEBUG_KERNEL=y
104CONFIG_DEBUG_USER=y
105CONFIG_DEBUG_LL=y
106# CONFIG_CRYPTO_HW is not set
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index b4348e62ef06..e5287f21badc 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -82,7 +82,7 @@ SECTIONS
82#endif 82#endif
83 } 83 }
84 84
85 PERCPU(32, PAGE_SIZE) 85 PERCPU_SECTION(32)
86 86
87#ifndef CONFIG_XIP_KERNEL 87#ifndef CONFIG_XIP_KERNEL
88 . = ALIGN(PAGE_SIZE); 88 . = ALIGN(PAGE_SIZE);
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 2d299bf5d72f..22484670e7ba 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -3,9 +3,6 @@ if ARCH_AT91
3config HAVE_AT91_DATAFLASH_CARD 3config HAVE_AT91_DATAFLASH_CARD
4 bool 4 bool
5 5
6config HAVE_NAND_ATMEL_BUSWIDTH_16
7 bool
8
9config HAVE_AT91_USART3 6config HAVE_AT91_USART3
10 bool 7 bool
11 8
@@ -85,11 +82,6 @@ config ARCH_AT91CAP9
85 select HAVE_FB_ATMEL 82 select HAVE_FB_ATMEL
86 select HAVE_NET_MACB 83 select HAVE_NET_MACB
87 84
88config ARCH_AT572D940HF
89 bool "AT572D940HF"
90 select CPU_ARM926T
91 select GENERIC_CLOCKEVENTS
92
93config ARCH_AT91X40 85config ARCH_AT91X40
94 bool "AT91x40" 86 bool "AT91x40"
95 select ARCH_USES_GETTIMEOFFSET 87 select ARCH_USES_GETTIMEOFFSET
@@ -209,7 +201,6 @@ comment "AT91SAM9260 / AT91SAM9XE Board Type"
209config MACH_AT91SAM9260EK 201config MACH_AT91SAM9260EK
210 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" 202 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
211 select HAVE_AT91_DATAFLASH_CARD 203 select HAVE_AT91_DATAFLASH_CARD
212 select HAVE_NAND_ATMEL_BUSWIDTH_16
213 help 204 help
214 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit 205 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
215 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> 206 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
@@ -270,7 +261,6 @@ comment "AT91SAM9261 Board Type"
270config MACH_AT91SAM9261EK 261config MACH_AT91SAM9261EK
271 bool "Atmel AT91SAM9261-EK Evaluation Kit" 262 bool "Atmel AT91SAM9261-EK Evaluation Kit"
272 select HAVE_AT91_DATAFLASH_CARD 263 select HAVE_AT91_DATAFLASH_CARD
273 select HAVE_NAND_ATMEL_BUSWIDTH_16
274 help 264 help
275 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit. 265 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
276 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820> 266 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
@@ -286,7 +276,6 @@ comment "AT91SAM9G10 Board Type"
286config MACH_AT91SAM9G10EK 276config MACH_AT91SAM9G10EK
287 bool "Atmel AT91SAM9G10-EK Evaluation Kit" 277 bool "Atmel AT91SAM9G10-EK Evaluation Kit"
288 select HAVE_AT91_DATAFLASH_CARD 278 select HAVE_AT91_DATAFLASH_CARD
289 select HAVE_NAND_ATMEL_BUSWIDTH_16
290 help 279 help
291 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit. 280 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
292 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588> 281 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
@@ -302,7 +291,6 @@ comment "AT91SAM9263 Board Type"
302config MACH_AT91SAM9263EK 291config MACH_AT91SAM9263EK
303 bool "Atmel AT91SAM9263-EK Evaluation Kit" 292 bool "Atmel AT91SAM9263-EK Evaluation Kit"
304 select HAVE_AT91_DATAFLASH_CARD 293 select HAVE_AT91_DATAFLASH_CARD
305 select HAVE_NAND_ATMEL_BUSWIDTH_16
306 help 294 help
307 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit. 295 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
308 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057> 296 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
@@ -343,7 +331,6 @@ comment "AT91SAM9G20 Board Type"
343config MACH_AT91SAM9G20EK 331config MACH_AT91SAM9G20EK
344 bool "Atmel AT91SAM9G20-EK Evaluation Kit" 332 bool "Atmel AT91SAM9G20-EK Evaluation Kit"
345 select HAVE_AT91_DATAFLASH_CARD 333 select HAVE_AT91_DATAFLASH_CARD
346 select HAVE_NAND_ATMEL_BUSWIDTH_16
347 help 334 help
348 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit 335 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
349 that embeds only one SD/MMC slot. 336 that embeds only one SD/MMC slot.
@@ -351,7 +338,6 @@ config MACH_AT91SAM9G20EK
351config MACH_AT91SAM9G20EK_2MMC 338config MACH_AT91SAM9G20EK_2MMC
352 depends on MACH_AT91SAM9G20EK 339 depends on MACH_AT91SAM9G20EK
353 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" 340 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
354 select HAVE_NAND_ATMEL_BUSWIDTH_16
355 help 341 help
356 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit 342 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
357 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and 343 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
@@ -416,7 +402,6 @@ comment "AT91SAM9G45 Board Type"
416 402
417config MACH_AT91SAM9M10G45EK 403config MACH_AT91SAM9M10G45EK
418 bool "Atmel AT91SAM9M10G45-EK Evaluation Kits" 404 bool "Atmel AT91SAM9M10G45-EK Evaluation Kits"
419 select HAVE_NAND_ATMEL_BUSWIDTH_16
420 help 405 help
421 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. 406 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
422 "ES" at the end of the name means that this board is an 407 "ES" at the end of the name means that this board is an
@@ -433,7 +418,6 @@ comment "AT91CAP9 Board Type"
433config MACH_AT91CAP9ADK 418config MACH_AT91CAP9ADK
434 bool "Atmel AT91CAP9A-DK Evaluation Kit" 419 bool "Atmel AT91CAP9A-DK Evaluation Kit"
435 select HAVE_AT91_DATAFLASH_CARD 420 select HAVE_AT91_DATAFLASH_CARD
436 select HAVE_NAND_ATMEL_BUSWIDTH_16
437 help 421 help
438 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. 422 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
439 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> 423 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
@@ -442,23 +426,6 @@ endif
442 426
443# ---------------------------------------------------------- 427# ----------------------------------------------------------
444 428
445if ARCH_AT572D940HF
446
447comment "AT572D940HF Board Type"
448
449config MACH_AT572D940HFEB
450 bool "AT572D940HF-EK"
451 depends on ARCH_AT572D940HF
452 select HAVE_AT91_DATAFLASH_CARD
453 select HAVE_NAND_ATMEL_BUSWIDTH_16
454 help
455 Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
456 <http://www.atmel.com/products/diopsis/default.asp>
457
458endif
459
460# ----------------------------------------------------------
461
462if ARCH_AT91X40 429if ARCH_AT91X40
463 430
464comment "AT91X40 Board Type" 431comment "AT91X40 Board Type"
@@ -483,13 +450,6 @@ config MTD_AT91_DATAFLASH_CARD
483 help 450 help
484 Enable support for the DataFlash card. 451 Enable support for the DataFlash card.
485 452
486config MTD_NAND_ATMEL_BUSWIDTH_16
487 bool "Enable 16-bit data bus interface to NAND flash"
488 depends on HAVE_NAND_ATMEL_BUSWIDTH_16
489 help
490 On AT91SAM926x boards both types of NAND flash can be present
491 (8 and 16 bit data bus width).
492
493# ---------------------------------------------------------- 453# ----------------------------------------------------------
494 454
495comment "AT91 Feature Selections" 455comment "AT91 Feature Selections"
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index a83835e0c185..96966231920c 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -19,7 +19,6 @@ obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devi
19obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o 19obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o at91sam9_alt_reset.o
20obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o 20obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o
21obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o 21obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o
22obj-$(CONFIG_ARCH_AT572D940HF) += at572d940hf.o at91sam926x_time.o at572d940hf_devices.o sam9_smc.o
23obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o 22obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o
24 23
25# AT91RM9200 board-specific support 24# AT91RM9200 board-specific support
@@ -78,9 +77,6 @@ obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
78# AT91CAP9 board-specific support 77# AT91CAP9 board-specific support
79obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o 78obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o
80 79
81# AT572D940HF board-specific support
82obj-$(CONFIG_MACH_AT572D940HFEB) += board-at572d940hf_ek.o
83
84# AT91X40 board-specific support 80# AT91X40 board-specific support
85obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o 81obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o
86 82
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c
deleted file mode 100644
index a6b9c68c003a..000000000000
--- a/arch/arm/mach-at91/at572d940hf.c
+++ /dev/null
@@ -1,377 +0,0 @@
1/*
2 * arch/arm/mach-at91/at572d940hf.c
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
6 *
7 * Copyright (C) 2005 SAN People
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
25#include <linux/module.h>
26
27#include <asm/mach/irq.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30#include <mach/at572d940hf.h>
31#include <mach/at91_pmc.h>
32#include <mach/at91_rstc.h>
33
34#include "generic.h"
35#include "clock.h"
36
37static struct map_desc at572d940hf_io_desc[] __initdata = {
38 {
39 .virtual = AT91_VA_BASE_SYS,
40 .pfn = __phys_to_pfn(AT91_BASE_SYS),
41 .length = SZ_16K,
42 .type = MT_DEVICE,
43 }, {
44 .virtual = AT91_IO_VIRT_BASE - AT572D940HF_SRAM_SIZE,
45 .pfn = __phys_to_pfn(AT572D940HF_SRAM_BASE),
46 .length = AT572D940HF_SRAM_SIZE,
47 .type = MT_DEVICE,
48 },
49};
50
51/* --------------------------------------------------------------------
52 * Clocks
53 * -------------------------------------------------------------------- */
54
55/*
56 * The peripheral clocks.
57 */
58static struct clk pioA_clk = {
59 .name = "pioA_clk",
60 .pmc_mask = 1 << AT572D940HF_ID_PIOA,
61 .type = CLK_TYPE_PERIPHERAL,
62};
63static struct clk pioB_clk = {
64 .name = "pioB_clk",
65 .pmc_mask = 1 << AT572D940HF_ID_PIOB,
66 .type = CLK_TYPE_PERIPHERAL,
67};
68static struct clk pioC_clk = {
69 .name = "pioC_clk",
70 .pmc_mask = 1 << AT572D940HF_ID_PIOC,
71 .type = CLK_TYPE_PERIPHERAL,
72};
73static struct clk macb_clk = {
74 .name = "macb_clk",
75 .pmc_mask = 1 << AT572D940HF_ID_EMAC,
76 .type = CLK_TYPE_PERIPHERAL,
77};
78static struct clk usart0_clk = {
79 .name = "usart0_clk",
80 .pmc_mask = 1 << AT572D940HF_ID_US0,
81 .type = CLK_TYPE_PERIPHERAL,
82};
83static struct clk usart1_clk = {
84 .name = "usart1_clk",
85 .pmc_mask = 1 << AT572D940HF_ID_US1,
86 .type = CLK_TYPE_PERIPHERAL,
87};
88static struct clk usart2_clk = {
89 .name = "usart2_clk",
90 .pmc_mask = 1 << AT572D940HF_ID_US2,
91 .type = CLK_TYPE_PERIPHERAL,
92};
93static struct clk mmc_clk = {
94 .name = "mci_clk",
95 .pmc_mask = 1 << AT572D940HF_ID_MCI,
96 .type = CLK_TYPE_PERIPHERAL,
97};
98static struct clk udc_clk = {
99 .name = "udc_clk",
100 .pmc_mask = 1 << AT572D940HF_ID_UDP,
101 .type = CLK_TYPE_PERIPHERAL,
102};
103static struct clk twi0_clk = {
104 .name = "twi0_clk",
105 .pmc_mask = 1 << AT572D940HF_ID_TWI0,
106 .type = CLK_TYPE_PERIPHERAL,
107};
108static struct clk spi0_clk = {
109 .name = "spi0_clk",
110 .pmc_mask = 1 << AT572D940HF_ID_SPI0,
111 .type = CLK_TYPE_PERIPHERAL,
112};
113static struct clk spi1_clk = {
114 .name = "spi1_clk",
115 .pmc_mask = 1 << AT572D940HF_ID_SPI1,
116 .type = CLK_TYPE_PERIPHERAL,
117};
118static struct clk ssc0_clk = {
119 .name = "ssc0_clk",
120 .pmc_mask = 1 << AT572D940HF_ID_SSC0,
121 .type = CLK_TYPE_PERIPHERAL,
122};
123static struct clk ssc1_clk = {
124 .name = "ssc1_clk",
125 .pmc_mask = 1 << AT572D940HF_ID_SSC1,
126 .type = CLK_TYPE_PERIPHERAL,
127};
128static struct clk ssc2_clk = {
129 .name = "ssc2_clk",
130 .pmc_mask = 1 << AT572D940HF_ID_SSC2,
131 .type = CLK_TYPE_PERIPHERAL,
132};
133static struct clk tc0_clk = {
134 .name = "tc0_clk",
135 .pmc_mask = 1 << AT572D940HF_ID_TC0,
136 .type = CLK_TYPE_PERIPHERAL,
137};
138static struct clk tc1_clk = {
139 .name = "tc1_clk",
140 .pmc_mask = 1 << AT572D940HF_ID_TC1,
141 .type = CLK_TYPE_PERIPHERAL,
142};
143static struct clk tc2_clk = {
144 .name = "tc2_clk",
145 .pmc_mask = 1 << AT572D940HF_ID_TC2,
146 .type = CLK_TYPE_PERIPHERAL,
147};
148static struct clk ohci_clk = {
149 .name = "ohci_clk",
150 .pmc_mask = 1 << AT572D940HF_ID_UHP,
151 .type = CLK_TYPE_PERIPHERAL,
152};
153static struct clk ssc3_clk = {
154 .name = "ssc3_clk",
155 .pmc_mask = 1 << AT572D940HF_ID_SSC3,
156 .type = CLK_TYPE_PERIPHERAL,
157};
158static struct clk twi1_clk = {
159 .name = "twi1_clk",
160 .pmc_mask = 1 << AT572D940HF_ID_TWI1,
161 .type = CLK_TYPE_PERIPHERAL,
162};
163static struct clk can0_clk = {
164 .name = "can0_clk",
165 .pmc_mask = 1 << AT572D940HF_ID_CAN0,
166 .type = CLK_TYPE_PERIPHERAL,
167};
168static struct clk can1_clk = {
169 .name = "can1_clk",
170 .pmc_mask = 1 << AT572D940HF_ID_CAN1,
171 .type = CLK_TYPE_PERIPHERAL,
172};
173static struct clk mAgicV_clk = {
174 .name = "mAgicV_clk",
175 .pmc_mask = 1 << AT572D940HF_ID_MSIRQ0,
176 .type = CLK_TYPE_PERIPHERAL,
177};
178
179
180static struct clk *periph_clocks[] __initdata = {
181 &pioA_clk,
182 &pioB_clk,
183 &pioC_clk,
184 &macb_clk,
185 &usart0_clk,
186 &usart1_clk,
187 &usart2_clk,
188 &mmc_clk,
189 &udc_clk,
190 &twi0_clk,
191 &spi0_clk,
192 &spi1_clk,
193 &ssc0_clk,
194 &ssc1_clk,
195 &ssc2_clk,
196 &tc0_clk,
197 &tc1_clk,
198 &tc2_clk,
199 &ohci_clk,
200 &ssc3_clk,
201 &twi1_clk,
202 &can0_clk,
203 &can1_clk,
204 &mAgicV_clk,
205 /* irq0 .. irq2 */
206};
207
208/*
209 * The five programmable clocks.
210 * You must configure pin multiplexing to bring these signals out.
211 */
212static struct clk pck0 = {
213 .name = "pck0",
214 .pmc_mask = AT91_PMC_PCK0,
215 .type = CLK_TYPE_PROGRAMMABLE,
216 .id = 0,
217};
218static struct clk pck1 = {
219 .name = "pck1",
220 .pmc_mask = AT91_PMC_PCK1,
221 .type = CLK_TYPE_PROGRAMMABLE,
222 .id = 1,
223};
224static struct clk pck2 = {
225 .name = "pck2",
226 .pmc_mask = AT91_PMC_PCK2,
227 .type = CLK_TYPE_PROGRAMMABLE,
228 .id = 2,
229};
230static struct clk pck3 = {
231 .name = "pck3",
232 .pmc_mask = AT91_PMC_PCK3,
233 .type = CLK_TYPE_PROGRAMMABLE,
234 .id = 3,
235};
236
237static struct clk mAgicV_mem_clk = {
238 .name = "mAgicV_mem_clk",
239 .pmc_mask = AT91_PMC_PCK4,
240 .type = CLK_TYPE_PROGRAMMABLE,
241 .id = 4,
242};
243
244/* HClocks */
245static struct clk hck0 = {
246 .name = "hck0",
247 .pmc_mask = AT91_PMC_HCK0,
248 .type = CLK_TYPE_SYSTEM,
249 .id = 0,
250};
251static struct clk hck1 = {
252 .name = "hck1",
253 .pmc_mask = AT91_PMC_HCK1,
254 .type = CLK_TYPE_SYSTEM,
255 .id = 1,
256};
257
258static void __init at572d940hf_register_clocks(void)
259{
260 int i;
261
262 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
263 clk_register(periph_clocks[i]);
264
265 clk_register(&pck0);
266 clk_register(&pck1);
267 clk_register(&pck2);
268 clk_register(&pck3);
269 clk_register(&mAgicV_mem_clk);
270
271 clk_register(&hck0);
272 clk_register(&hck1);
273}
274
275/* --------------------------------------------------------------------
276 * GPIO
277 * -------------------------------------------------------------------- */
278
279static struct at91_gpio_bank at572d940hf_gpio[] = {
280 {
281 .id = AT572D940HF_ID_PIOA,
282 .offset = AT91_PIOA,
283 .clock = &pioA_clk,
284 }, {
285 .id = AT572D940HF_ID_PIOB,
286 .offset = AT91_PIOB,
287 .clock = &pioB_clk,
288 }, {
289 .id = AT572D940HF_ID_PIOC,
290 .offset = AT91_PIOC,
291 .clock = &pioC_clk,
292 }
293};
294
295static void at572d940hf_reset(void)
296{
297 at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
298}
299
300
301/* --------------------------------------------------------------------
302 * AT572D940HF processor initialization
303 * -------------------------------------------------------------------- */
304
305void __init at572d940hf_initialize(unsigned long main_clock)
306{
307 /* Map peripherals */
308 iotable_init(at572d940hf_io_desc, ARRAY_SIZE(at572d940hf_io_desc));
309
310 at91_arch_reset = at572d940hf_reset;
311 at91_extern_irq = (1 << AT572D940HF_ID_IRQ0) | (1 << AT572D940HF_ID_IRQ1)
312 | (1 << AT572D940HF_ID_IRQ2);
313
314 /* Init clock subsystem */
315 at91_clock_init(main_clock);
316
317 /* Register the processor-specific clocks */
318 at572d940hf_register_clocks();
319
320 /* Register GPIO subsystem */
321 at91_gpio_init(at572d940hf_gpio, 3);
322}
323
324/* --------------------------------------------------------------------
325 * Interrupt initialization
326 * -------------------------------------------------------------------- */
327
328/*
329 * The default interrupt priority levels (0 = lowest, 7 = highest).
330 */
331static unsigned int at572d940hf_default_irq_priority[NR_AIC_IRQS] __initdata = {
332 7, /* Advanced Interrupt Controller */
333 7, /* System Peripherals */
334 0, /* Parallel IO Controller A */
335 0, /* Parallel IO Controller B */
336 0, /* Parallel IO Controller C */
337 3, /* Ethernet */
338 6, /* USART 0 */
339 6, /* USART 1 */
340 6, /* USART 2 */
341 0, /* Multimedia Card Interface */
342 4, /* USB Device Port */
343 0, /* Two-Wire Interface 0 */
344 6, /* Serial Peripheral Interface 0 */
345 6, /* Serial Peripheral Interface 1 */
346 5, /* Serial Synchronous Controller 0 */
347 5, /* Serial Synchronous Controller 1 */
348 5, /* Serial Synchronous Controller 2 */
349 0, /* Timer Counter 0 */
350 0, /* Timer Counter 1 */
351 0, /* Timer Counter 2 */
352 3, /* USB Host port */
353 3, /* Serial Synchronous Controller 3 */
354 0, /* Two-Wire Interface 1 */
355 0, /* CAN Controller 0 */
356 0, /* CAN Controller 1 */
357 0, /* mAgicV HALT line */
358 0, /* mAgicV SIRQ0 line */
359 0, /* mAgicV exception line */
360 0, /* mAgicV end of DMA line */
361 0, /* Advanced Interrupt Controller */
362 0, /* Advanced Interrupt Controller */
363 0, /* Advanced Interrupt Controller */
364};
365
366void __init at572d940hf_init_interrupts(unsigned int priority[NR_AIC_IRQS])
367{
368 if (!priority)
369 priority = at572d940hf_default_irq_priority;
370
371 /* Initialize the AIC interrupt controller */
372 at91_aic_init(priority);
373
374 /* Enable GPIO interrupts */
375 at91_gpio_irq_setup();
376}
377
diff --git a/arch/arm/mach-at91/at572d940hf_devices.c b/arch/arm/mach-at91/at572d940hf_devices.c
deleted file mode 100644
index 0fc20a240782..000000000000
--- a/arch/arm/mach-at91/at572d940hf_devices.c
+++ /dev/null
@@ -1,970 +0,0 @@
1/*
2 * arch/arm/mach-at91/at572d940hf_devices.c
3 *
4 * Copyright (C) 2008 Atmel Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>
6 * Copyright (C) 2005 David Brownell
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 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
27#include <linux/dma-mapping.h>
28#include <linux/platform_device.h>
29
30#include <mach/board.h>
31#include <mach/gpio.h>
32#include <mach/at572d940hf.h>
33#include <mach/at572d940hf_matrix.h>
34#include <mach/at91sam9_smc.h>
35
36#include "generic.h"
37#include "sam9_smc.h"
38
39
40/* --------------------------------------------------------------------
41 * USB Host
42 * -------------------------------------------------------------------- */
43
44#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
45static u64 ohci_dmamask = DMA_BIT_MASK(32);
46static struct at91_usbh_data usbh_data;
47
48static struct resource usbh_resources[] = {
49 [0] = {
50 .start = AT572D940HF_UHP_BASE,
51 .end = AT572D940HF_UHP_BASE + SZ_1M - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = AT572D940HF_ID_UHP,
56 .end = AT572D940HF_ID_UHP,
57 .flags = IORESOURCE_IRQ,
58 },
59};
60
61static struct platform_device at572d940hf_usbh_device = {
62 .name = "at91_ohci",
63 .id = -1,
64 .dev = {
65 .dma_mask = &ohci_dmamask,
66 .coherent_dma_mask = DMA_BIT_MASK(32),
67 .platform_data = &usbh_data,
68 },
69 .resource = usbh_resources,
70 .num_resources = ARRAY_SIZE(usbh_resources),
71};
72
73void __init at91_add_device_usbh(struct at91_usbh_data *data)
74{
75 if (!data)
76 return;
77
78 usbh_data = *data;
79 platform_device_register(&at572d940hf_usbh_device);
80
81}
82#else
83void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
84#endif
85
86
87/* --------------------------------------------------------------------
88 * USB Device (Gadget)
89 * -------------------------------------------------------------------- */
90
91#ifdef CONFIG_USB_GADGET_AT91
92static struct at91_udc_data udc_data;
93
94static struct resource udc_resources[] = {
95 [0] = {
96 .start = AT572D940HF_BASE_UDP,
97 .end = AT572D940HF_BASE_UDP + SZ_16K - 1,
98 .flags = IORESOURCE_MEM,
99 },
100 [1] = {
101 .start = AT572D940HF_ID_UDP,
102 .end = AT572D940HF_ID_UDP,
103 .flags = IORESOURCE_IRQ,
104 },
105};
106
107static struct platform_device at572d940hf_udc_device = {
108 .name = "at91_udc",
109 .id = -1,
110 .dev = {
111 .platform_data = &udc_data,
112 },
113 .resource = udc_resources,
114 .num_resources = ARRAY_SIZE(udc_resources),
115};
116
117void __init at91_add_device_udc(struct at91_udc_data *data)
118{
119 if (!data)
120 return;
121
122 if (data->vbus_pin) {
123 at91_set_gpio_input(data->vbus_pin, 0);
124 at91_set_deglitch(data->vbus_pin, 1);
125 }
126
127 /* Pullup pin is handled internally */
128
129 udc_data = *data;
130 platform_device_register(&at572d940hf_udc_device);
131}
132#else
133void __init at91_add_device_udc(struct at91_udc_data *data) {}
134#endif
135
136
137/* --------------------------------------------------------------------
138 * Ethernet
139 * -------------------------------------------------------------------- */
140
141#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
142static u64 eth_dmamask = DMA_BIT_MASK(32);
143static struct at91_eth_data eth_data;
144
145static struct resource eth_resources[] = {
146 [0] = {
147 .start = AT572D940HF_BASE_EMAC,
148 .end = AT572D940HF_BASE_EMAC + SZ_16K - 1,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = AT572D940HF_ID_EMAC,
153 .end = AT572D940HF_ID_EMAC,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static struct platform_device at572d940hf_eth_device = {
159 .name = "macb",
160 .id = -1,
161 .dev = {
162 .dma_mask = &eth_dmamask,
163 .coherent_dma_mask = DMA_BIT_MASK(32),
164 .platform_data = &eth_data,
165 },
166 .resource = eth_resources,
167 .num_resources = ARRAY_SIZE(eth_resources),
168};
169
170void __init at91_add_device_eth(struct at91_eth_data *data)
171{
172 if (!data)
173 return;
174
175 if (data->phy_irq_pin) {
176 at91_set_gpio_input(data->phy_irq_pin, 0);
177 at91_set_deglitch(data->phy_irq_pin, 1);
178 }
179
180 /* Only RMII is supported */
181 data->is_rmii = 1;
182
183 /* Pins used for RMII */
184 at91_set_A_periph(AT91_PIN_PA16, 0); /* ETXCK_EREFCK */
185 at91_set_A_periph(AT91_PIN_PA17, 0); /* ERXDV */
186 at91_set_A_periph(AT91_PIN_PA18, 0); /* ERX0 */
187 at91_set_A_periph(AT91_PIN_PA19, 0); /* ERX1 */
188 at91_set_A_periph(AT91_PIN_PA20, 0); /* ERXER */
189 at91_set_A_periph(AT91_PIN_PA23, 0); /* ETXEN */
190 at91_set_A_periph(AT91_PIN_PA21, 0); /* ETX0 */
191 at91_set_A_periph(AT91_PIN_PA22, 0); /* ETX1 */
192 at91_set_A_periph(AT91_PIN_PA13, 0); /* EMDIO */
193 at91_set_A_periph(AT91_PIN_PA14, 0); /* EMDC */
194
195 eth_data = *data;
196 platform_device_register(&at572d940hf_eth_device);
197}
198#else
199void __init at91_add_device_eth(struct at91_eth_data *data) {}
200#endif
201
202
203/* --------------------------------------------------------------------
204 * MMC / SD
205 * -------------------------------------------------------------------- */
206
207#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
208static u64 mmc_dmamask = DMA_BIT_MASK(32);
209static struct at91_mmc_data mmc_data;
210
211static struct resource mmc_resources[] = {
212 [0] = {
213 .start = AT572D940HF_BASE_MCI,
214 .end = AT572D940HF_BASE_MCI + SZ_16K - 1,
215 .flags = IORESOURCE_MEM,
216 },
217 [1] = {
218 .start = AT572D940HF_ID_MCI,
219 .end = AT572D940HF_ID_MCI,
220 .flags = IORESOURCE_IRQ,
221 },
222};
223
224static struct platform_device at572d940hf_mmc_device = {
225 .name = "at91_mci",
226 .id = -1,
227 .dev = {
228 .dma_mask = &mmc_dmamask,
229 .coherent_dma_mask = DMA_BIT_MASK(32),
230 .platform_data = &mmc_data,
231 },
232 .resource = mmc_resources,
233 .num_resources = ARRAY_SIZE(mmc_resources),
234};
235
236void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
237{
238 if (!data)
239 return;
240
241 /* input/irq */
242 if (data->det_pin) {
243 at91_set_gpio_input(data->det_pin, 1);
244 at91_set_deglitch(data->det_pin, 1);
245 }
246 if (data->wp_pin)
247 at91_set_gpio_input(data->wp_pin, 1);
248 if (data->vcc_pin)
249 at91_set_gpio_output(data->vcc_pin, 0);
250
251 /* CLK */
252 at91_set_A_periph(AT91_PIN_PC22, 0);
253
254 /* CMD */
255 at91_set_A_periph(AT91_PIN_PC23, 1);
256
257 /* DAT0, maybe DAT1..DAT3 */
258 at91_set_A_periph(AT91_PIN_PC24, 1);
259 if (data->wire4) {
260 at91_set_A_periph(AT91_PIN_PC25, 1);
261 at91_set_A_periph(AT91_PIN_PC26, 1);
262 at91_set_A_periph(AT91_PIN_PC27, 1);
263 }
264
265 mmc_data = *data;
266 platform_device_register(&at572d940hf_mmc_device);
267}
268#else
269void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
270#endif
271
272
273/* --------------------------------------------------------------------
274 * NAND / SmartMedia
275 * -------------------------------------------------------------------- */
276
277#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
278static struct atmel_nand_data nand_data;
279
280#define NAND_BASE AT91_CHIPSELECT_3
281
282static struct resource nand_resources[] = {
283 {
284 .start = NAND_BASE,
285 .end = NAND_BASE + SZ_256M - 1,
286 .flags = IORESOURCE_MEM,
287 }
288};
289
290static struct platform_device at572d940hf_nand_device = {
291 .name = "atmel_nand",
292 .id = -1,
293 .dev = {
294 .platform_data = &nand_data,
295 },
296 .resource = nand_resources,
297 .num_resources = ARRAY_SIZE(nand_resources),
298};
299
300void __init at91_add_device_nand(struct atmel_nand_data *data)
301{
302 unsigned long csa;
303
304 if (!data)
305 return;
306
307 csa = at91_sys_read(AT91_MATRIX_EBICSA);
308 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
309
310 /* enable pin */
311 if (data->enable_pin)
312 at91_set_gpio_output(data->enable_pin, 1);
313
314 /* ready/busy pin */
315 if (data->rdy_pin)
316 at91_set_gpio_input(data->rdy_pin, 1);
317
318 /* card detect pin */
319 if (data->det_pin)
320 at91_set_gpio_input(data->det_pin, 1);
321
322 at91_set_A_periph(AT91_PIN_PB28, 0); /* A[22] */
323 at91_set_B_periph(AT91_PIN_PA28, 0); /* NANDOE */
324 at91_set_B_periph(AT91_PIN_PA29, 0); /* NANDWE */
325
326 nand_data = *data;
327 platform_device_register(&at572d940hf_nand_device);
328}
329
330#else
331void __init at91_add_device_nand(struct atmel_nand_data *data) {}
332#endif
333
334
335/* --------------------------------------------------------------------
336 * TWI (i2c)
337 * -------------------------------------------------------------------- */
338
339/*
340 * Prefer the GPIO code since the TWI controller isn't robust
341 * (gets overruns and underruns under load) and can only issue
342 * repeated STARTs in one scenario (the driver doesn't yet handle them).
343 */
344
345#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
346
347static struct i2c_gpio_platform_data pdata = {
348 .sda_pin = AT91_PIN_PC7,
349 .sda_is_open_drain = 1,
350 .scl_pin = AT91_PIN_PC8,
351 .scl_is_open_drain = 1,
352 .udelay = 2, /* ~100 kHz */
353};
354
355static struct platform_device at572d940hf_twi_device {
356 .name = "i2c-gpio",
357 .id = -1,
358 .dev.platform_data = &pdata,
359};
360
361void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
362{
363 at91_set_GPIO_periph(AT91_PIN_PC7, 1); /* TWD (SDA) */
364 at91_set_multi_drive(AT91_PIN_PC7, 1);
365
366 at91_set_GPIO_periph(AT91_PIN_PA8, 1); /* TWCK (SCL) */
367 at91_set_multi_drive(AT91_PIN_PC8, 1);
368
369 i2c_register_board_info(0, devices, nr_devices);
370 platform_device_register(&at572d940hf_twi_device);
371}
372
373#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
374
375static struct resource twi0_resources[] = {
376 [0] = {
377 .start = AT572D940HF_BASE_TWI0,
378 .end = AT572D940HF_BASE_TWI0 + SZ_16K - 1,
379 .flags = IORESOURCE_MEM,
380 },
381 [1] = {
382 .start = AT572D940HF_ID_TWI0,
383 .end = AT572D940HF_ID_TWI0,
384 .flags = IORESOURCE_IRQ,
385 },
386};
387
388static struct platform_device at572d940hf_twi0_device = {
389 .name = "at91_i2c",
390 .id = 0,
391 .resource = twi0_resources,
392 .num_resources = ARRAY_SIZE(twi0_resources),
393};
394
395static struct resource twi1_resources[] = {
396 [0] = {
397 .start = AT572D940HF_BASE_TWI1,
398 .end = AT572D940HF_BASE_TWI1 + SZ_16K - 1,
399 .flags = IORESOURCE_MEM,
400 },
401 [1] = {
402 .start = AT572D940HF_ID_TWI1,
403 .end = AT572D940HF_ID_TWI1,
404 .flags = IORESOURCE_IRQ,
405 },
406};
407
408static struct platform_device at572d940hf_twi1_device = {
409 .name = "at91_i2c",
410 .id = 1,
411 .resource = twi1_resources,
412 .num_resources = ARRAY_SIZE(twi1_resources),
413};
414
415void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
416{
417 /* pins used for TWI0 interface */
418 at91_set_A_periph(AT91_PIN_PC7, 0); /* TWD */
419 at91_set_multi_drive(AT91_PIN_PC7, 1);
420
421 at91_set_A_periph(AT91_PIN_PC8, 0); /* TWCK */
422 at91_set_multi_drive(AT91_PIN_PC8, 1);
423
424 /* pins used for TWI1 interface */
425 at91_set_A_periph(AT91_PIN_PC20, 0); /* TWD */
426 at91_set_multi_drive(AT91_PIN_PC20, 1);
427
428 at91_set_A_periph(AT91_PIN_PC21, 0); /* TWCK */
429 at91_set_multi_drive(AT91_PIN_PC21, 1);
430
431 i2c_register_board_info(0, devices, nr_devices);
432 platform_device_register(&at572d940hf_twi0_device);
433 platform_device_register(&at572d940hf_twi1_device);
434}
435#else
436void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
437#endif
438
439
440/* --------------------------------------------------------------------
441 * SPI
442 * -------------------------------------------------------------------- */
443
444#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
445static u64 spi_dmamask = DMA_BIT_MASK(32);
446
447static struct resource spi0_resources[] = {
448 [0] = {
449 .start = AT572D940HF_BASE_SPI0,
450 .end = AT572D940HF_BASE_SPI0 + SZ_16K - 1,
451 .flags = IORESOURCE_MEM,
452 },
453 [1] = {
454 .start = AT572D940HF_ID_SPI0,
455 .end = AT572D940HF_ID_SPI0,
456 .flags = IORESOURCE_IRQ,
457 },
458};
459
460static struct platform_device at572d940hf_spi0_device = {
461 .name = "atmel_spi",
462 .id = 0,
463 .dev = {
464 .dma_mask = &spi_dmamask,
465 .coherent_dma_mask = DMA_BIT_MASK(32),
466 },
467 .resource = spi0_resources,
468 .num_resources = ARRAY_SIZE(spi0_resources),
469};
470
471static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PA4, AT91_PIN_PA5, AT91_PIN_PA6 };
472
473static struct resource spi1_resources[] = {
474 [0] = {
475 .start = AT572D940HF_BASE_SPI1,
476 .end = AT572D940HF_BASE_SPI1 + SZ_16K - 1,
477 .flags = IORESOURCE_MEM,
478 },
479 [1] = {
480 .start = AT572D940HF_ID_SPI1,
481 .end = AT572D940HF_ID_SPI1,
482 .flags = IORESOURCE_IRQ,
483 },
484};
485
486static struct platform_device at572d940hf_spi1_device = {
487 .name = "atmel_spi",
488 .id = 1,
489 .dev = {
490 .dma_mask = &spi_dmamask,
491 .coherent_dma_mask = DMA_BIT_MASK(32),
492 },
493 .resource = spi1_resources,
494 .num_resources = ARRAY_SIZE(spi1_resources),
495};
496
497static const unsigned spi1_standard_cs[4] = { AT91_PIN_PC3, AT91_PIN_PC4, AT91_PIN_PC5, AT91_PIN_PC6 };
498
499void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
500{
501 int i;
502 unsigned long cs_pin;
503 short enable_spi0 = 0;
504 short enable_spi1 = 0;
505
506 /* Choose SPI chip-selects */
507 for (i = 0; i < nr_devices; i++) {
508 if (devices[i].controller_data)
509 cs_pin = (unsigned long) devices[i].controller_data;
510 else if (devices[i].bus_num == 0)
511 cs_pin = spi0_standard_cs[devices[i].chip_select];
512 else
513 cs_pin = spi1_standard_cs[devices[i].chip_select];
514
515 if (devices[i].bus_num == 0)
516 enable_spi0 = 1;
517 else
518 enable_spi1 = 1;
519
520 /* enable chip-select pin */
521 at91_set_gpio_output(cs_pin, 1);
522
523 /* pass chip-select pin to driver */
524 devices[i].controller_data = (void *) cs_pin;
525 }
526
527 spi_register_board_info(devices, nr_devices);
528
529 /* Configure SPI bus(es) */
530 if (enable_spi0) {
531 at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
532 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
533 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
534
535 at91_clock_associate("spi0_clk", &at572d940hf_spi0_device.dev, "spi_clk");
536 platform_device_register(&at572d940hf_spi0_device);
537 }
538 if (enable_spi1) {
539 at91_set_A_periph(AT91_PIN_PC0, 0); /* SPI1_MISO */
540 at91_set_A_periph(AT91_PIN_PC1, 0); /* SPI1_MOSI */
541 at91_set_A_periph(AT91_PIN_PC2, 0); /* SPI1_SPCK */
542
543 at91_clock_associate("spi1_clk", &at572d940hf_spi1_device.dev, "spi_clk");
544 platform_device_register(&at572d940hf_spi1_device);
545 }
546}
547#else
548void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
549#endif
550
551
552/* --------------------------------------------------------------------
553 * Timer/Counter blocks
554 * -------------------------------------------------------------------- */
555
556#ifdef CONFIG_ATMEL_TCLIB
557
558static struct resource tcb_resources[] = {
559 [0] = {
560 .start = AT572D940HF_BASE_TCB,
561 .end = AT572D940HF_BASE_TCB + SZ_16K - 1,
562 .flags = IORESOURCE_MEM,
563 },
564 [1] = {
565 .start = AT572D940HF_ID_TC0,
566 .end = AT572D940HF_ID_TC0,
567 .flags = IORESOURCE_IRQ,
568 },
569 [2] = {
570 .start = AT572D940HF_ID_TC1,
571 .end = AT572D940HF_ID_TC1,
572 .flags = IORESOURCE_IRQ,
573 },
574 [3] = {
575 .start = AT572D940HF_ID_TC2,
576 .end = AT572D940HF_ID_TC2,
577 .flags = IORESOURCE_IRQ,
578 },
579};
580
581static struct platform_device at572d940hf_tcb_device = {
582 .name = "atmel_tcb",
583 .id = 0,
584 .resource = tcb_resources,
585 .num_resources = ARRAY_SIZE(tcb_resources),
586};
587
588static void __init at91_add_device_tc(void)
589{
590 /* this chip has a separate clock and irq for each TC channel */
591 at91_clock_associate("tc0_clk", &at572d940hf_tcb_device.dev, "t0_clk");
592 at91_clock_associate("tc1_clk", &at572d940hf_tcb_device.dev, "t1_clk");
593 at91_clock_associate("tc2_clk", &at572d940hf_tcb_device.dev, "t2_clk");
594 platform_device_register(&at572d940hf_tcb_device);
595}
596#else
597static void __init at91_add_device_tc(void) { }
598#endif
599
600
601/* --------------------------------------------------------------------
602 * RTT
603 * -------------------------------------------------------------------- */
604
605static struct resource rtt_resources[] = {
606 {
607 .start = AT91_BASE_SYS + AT91_RTT,
608 .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
609 .flags = IORESOURCE_MEM,
610 }
611};
612
613static struct platform_device at572d940hf_rtt_device = {
614 .name = "at91_rtt",
615 .id = 0,
616 .resource = rtt_resources,
617 .num_resources = ARRAY_SIZE(rtt_resources),
618};
619
620static void __init at91_add_device_rtt(void)
621{
622 platform_device_register(&at572d940hf_rtt_device);
623}
624
625
626/* --------------------------------------------------------------------
627 * Watchdog
628 * -------------------------------------------------------------------- */
629
630#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
631static struct platform_device at572d940hf_wdt_device = {
632 .name = "at91_wdt",
633 .id = -1,
634 .num_resources = 0,
635};
636
637static void __init at91_add_device_watchdog(void)
638{
639 platform_device_register(&at572d940hf_wdt_device);
640}
641#else
642static void __init at91_add_device_watchdog(void) {}
643#endif
644
645
646/* --------------------------------------------------------------------
647 * UART
648 * -------------------------------------------------------------------- */
649
650#if defined(CONFIG_SERIAL_ATMEL)
651static struct resource dbgu_resources[] = {
652 [0] = {
653 .start = AT91_VA_BASE_SYS + AT91_DBGU,
654 .end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
655 .flags = IORESOURCE_MEM,
656 },
657 [1] = {
658 .start = AT91_ID_SYS,
659 .end = AT91_ID_SYS,
660 .flags = IORESOURCE_IRQ,
661 },
662};
663
664static struct atmel_uart_data dbgu_data = {
665 .use_dma_tx = 0,
666 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
667 .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
668};
669
670static u64 dbgu_dmamask = DMA_BIT_MASK(32);
671
672static struct platform_device at572d940hf_dbgu_device = {
673 .name = "atmel_usart",
674 .id = 0,
675 .dev = {
676 .dma_mask = &dbgu_dmamask,
677 .coherent_dma_mask = DMA_BIT_MASK(32),
678 .platform_data = &dbgu_data,
679 },
680 .resource = dbgu_resources,
681 .num_resources = ARRAY_SIZE(dbgu_resources),
682};
683
684static inline void configure_dbgu_pins(void)
685{
686 at91_set_A_periph(AT91_PIN_PC31, 1); /* DTXD */
687 at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */
688}
689
690static struct resource uart0_resources[] = {
691 [0] = {
692 .start = AT572D940HF_BASE_US0,
693 .end = AT572D940HF_BASE_US0 + SZ_16K - 1,
694 .flags = IORESOURCE_MEM,
695 },
696 [1] = {
697 .start = AT572D940HF_ID_US0,
698 .end = AT572D940HF_ID_US0,
699 .flags = IORESOURCE_IRQ,
700 },
701};
702
703static struct atmel_uart_data uart0_data = {
704 .use_dma_tx = 1,
705 .use_dma_rx = 1,
706};
707
708static u64 uart0_dmamask = DMA_BIT_MASK(32);
709
710static struct platform_device at572d940hf_uart0_device = {
711 .name = "atmel_usart",
712 .id = 1,
713 .dev = {
714 .dma_mask = &uart0_dmamask,
715 .coherent_dma_mask = DMA_BIT_MASK(32),
716 .platform_data = &uart0_data,
717 },
718 .resource = uart0_resources,
719 .num_resources = ARRAY_SIZE(uart0_resources),
720};
721
722static inline void configure_usart0_pins(unsigned pins)
723{
724 at91_set_A_periph(AT91_PIN_PA8, 1); /* TXD0 */
725 at91_set_A_periph(AT91_PIN_PA7, 0); /* RXD0 */
726
727 if (pins & ATMEL_UART_RTS)
728 at91_set_A_periph(AT91_PIN_PA10, 0); /* RTS0 */
729 if (pins & ATMEL_UART_CTS)
730 at91_set_A_periph(AT91_PIN_PA9, 0); /* CTS0 */
731}
732
733static struct resource uart1_resources[] = {
734 [0] = {
735 .start = AT572D940HF_BASE_US1,
736 .end = AT572D940HF_BASE_US1 + SZ_16K - 1,
737 .flags = IORESOURCE_MEM,
738 },
739 [1] = {
740 .start = AT572D940HF_ID_US1,
741 .end = AT572D940HF_ID_US1,
742 .flags = IORESOURCE_IRQ,
743 },
744};
745
746static struct atmel_uart_data uart1_data = {
747 .use_dma_tx = 1,
748 .use_dma_rx = 1,
749};
750
751static u64 uart1_dmamask = DMA_BIT_MASK(32);
752
753static struct platform_device at572d940hf_uart1_device = {
754 .name = "atmel_usart",
755 .id = 2,
756 .dev = {
757 .dma_mask = &uart1_dmamask,
758 .coherent_dma_mask = DMA_BIT_MASK(32),
759 .platform_data = &uart1_data,
760 },
761 .resource = uart1_resources,
762 .num_resources = ARRAY_SIZE(uart1_resources),
763};
764
765static inline void configure_usart1_pins(unsigned pins)
766{
767 at91_set_A_periph(AT91_PIN_PC10, 1); /* TXD1 */
768 at91_set_A_periph(AT91_PIN_PC9 , 0); /* RXD1 */
769
770 if (pins & ATMEL_UART_RTS)
771 at91_set_A_periph(AT91_PIN_PC12, 0); /* RTS1 */
772 if (pins & ATMEL_UART_CTS)
773 at91_set_A_periph(AT91_PIN_PC11, 0); /* CTS1 */
774}
775
776static struct resource uart2_resources[] = {
777 [0] = {
778 .start = AT572D940HF_BASE_US2,
779 .end = AT572D940HF_BASE_US2 + SZ_16K - 1,
780 .flags = IORESOURCE_MEM,
781 },
782 [1] = {
783 .start = AT572D940HF_ID_US2,
784 .end = AT572D940HF_ID_US2,
785 .flags = IORESOURCE_IRQ,
786 },
787};
788
789static struct atmel_uart_data uart2_data = {
790 .use_dma_tx = 1,
791 .use_dma_rx = 1,
792};
793
794static u64 uart2_dmamask = DMA_BIT_MASK(32);
795
796static struct platform_device at572d940hf_uart2_device = {
797 .name = "atmel_usart",
798 .id = 3,
799 .dev = {
800 .dma_mask = &uart2_dmamask,
801 .coherent_dma_mask = DMA_BIT_MASK(32),
802 .platform_data = &uart2_data,
803 },
804 .resource = uart2_resources,
805 .num_resources = ARRAY_SIZE(uart2_resources),
806};
807
808static inline void configure_usart2_pins(unsigned pins)
809{
810 at91_set_A_periph(AT91_PIN_PC15, 1); /* TXD2 */
811 at91_set_A_periph(AT91_PIN_PC14, 0); /* RXD2 */
812
813 if (pins & ATMEL_UART_RTS)
814 at91_set_A_periph(AT91_PIN_PC17, 0); /* RTS2 */
815 if (pins & ATMEL_UART_CTS)
816 at91_set_A_periph(AT91_PIN_PC16, 0); /* CTS2 */
817}
818
819static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
820struct platform_device *atmel_default_console_device; /* the serial console device */
821
822void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
823{
824 struct platform_device *pdev;
825
826 switch (id) {
827 case 0: /* DBGU */
828 pdev = &at572d940hf_dbgu_device;
829 configure_dbgu_pins();
830 at91_clock_associate("mck", &pdev->dev, "usart");
831 break;
832 case AT572D940HF_ID_US0:
833 pdev = &at572d940hf_uart0_device;
834 configure_usart0_pins(pins);
835 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
836 break;
837 case AT572D940HF_ID_US1:
838 pdev = &at572d940hf_uart1_device;
839 configure_usart1_pins(pins);
840 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
841 break;
842 case AT572D940HF_ID_US2:
843 pdev = &at572d940hf_uart2_device;
844 configure_usart2_pins(pins);
845 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
846 break;
847 default:
848 return;
849 }
850 pdev->id = portnr; /* update to mapped ID */
851
852 if (portnr < ATMEL_MAX_UART)
853 at91_uarts[portnr] = pdev;
854}
855
856void __init at91_set_serial_console(unsigned portnr)
857{
858 if (portnr < ATMEL_MAX_UART)
859 atmel_default_console_device = at91_uarts[portnr];
860}
861
862void __init at91_add_device_serial(void)
863{
864 int i;
865
866 for (i = 0; i < ATMEL_MAX_UART; i++) {
867 if (at91_uarts[i])
868 platform_device_register(at91_uarts[i]);
869 }
870
871 if (!atmel_default_console_device)
872 printk(KERN_INFO "AT91: No default serial console defined.\n");
873}
874
875#else
876void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
877void __init at91_set_serial_console(unsigned portnr) {}
878void __init at91_add_device_serial(void) {}
879#endif
880
881
882/* --------------------------------------------------------------------
883 * mAgic
884 * -------------------------------------------------------------------- */
885
886#ifdef CONFIG_MAGICV
887static struct resource mAgic_resources[] = {
888 {
889 .start = AT91_MAGIC_PM_BASE,
890 .end = AT91_MAGIC_PM_BASE + AT91_MAGIC_PM_SIZE - 1,
891 .flags = IORESOURCE_MEM,
892 },
893 {
894 .start = AT91_MAGIC_DM_I_BASE,
895 .end = AT91_MAGIC_DM_I_BASE + AT91_MAGIC_DM_I_SIZE - 1,
896 .flags = IORESOURCE_MEM,
897 },
898 {
899 .start = AT91_MAGIC_DM_F_BASE,
900 .end = AT91_MAGIC_DM_F_BASE + AT91_MAGIC_DM_F_SIZE - 1,
901 .flags = IORESOURCE_MEM,
902 },
903 {
904 .start = AT91_MAGIC_DM_DB_BASE,
905 .end = AT91_MAGIC_DM_DB_BASE + AT91_MAGIC_DM_DB_SIZE - 1,
906 .flags = IORESOURCE_MEM,
907 },
908 {
909 .start = AT91_MAGIC_REGS_BASE,
910 .end = AT91_MAGIC_REGS_BASE + AT91_MAGIC_REGS_SIZE - 1,
911 .flags = IORESOURCE_MEM,
912 },
913 {
914 .start = AT91_MAGIC_EXTPAGE_BASE,
915 .end = AT91_MAGIC_EXTPAGE_BASE + AT91_MAGIC_EXTPAGE_SIZE - 1,
916 .flags = IORESOURCE_MEM,
917 },
918 {
919 .start = AT572D940HF_ID_MSIRQ0,
920 .end = AT572D940HF_ID_MSIRQ0,
921 .flags = IORESOURCE_IRQ,
922 },
923 {
924 .start = AT572D940HF_ID_MHALT,
925 .end = AT572D940HF_ID_MHALT,
926 .flags = IORESOURCE_IRQ,
927 },
928 {
929 .start = AT572D940HF_ID_MEXC,
930 .end = AT572D940HF_ID_MEXC,
931 .flags = IORESOURCE_IRQ,
932 },
933 {
934 .start = AT572D940HF_ID_MEDMA,
935 .end = AT572D940HF_ID_MEDMA,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940static struct platform_device mAgic_device = {
941 .name = "mAgic",
942 .id = -1,
943 .num_resources = ARRAY_SIZE(mAgic_resources),
944 .resource = mAgic_resources,
945};
946
947void __init at91_add_device_mAgic(void)
948{
949 platform_device_register(&mAgic_device);
950}
951#else
952void __init at91_add_device_mAgic(void) {}
953#endif
954
955
956/* -------------------------------------------------------------------- */
957
958/*
959 * These devices are always present and don't need any board-specific
960 * setup.
961 */
962static int __init at91_add_standard_devices(void)
963{
964 at91_add_device_rtt();
965 at91_add_device_watchdog();
966 at91_add_device_tc();
967 return 0;
968}
969
970arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 73376170fb91..17fae4a42ab5 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -222,6 +222,25 @@ static struct clk *periph_clocks[] __initdata = {
222 // irq0 .. irq1 222 // irq0 .. irq1
223}; 223};
224 224
225static struct clk_lookup periph_clocks_lookups[] = {
226 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk),
227 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk),
228 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
229 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
230 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
231 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
232 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
233 CLKDEV_CON_DEV_ID("ssc", "ssc.0", &ssc0_clk),
234 CLKDEV_CON_DEV_ID("ssc", "ssc.1", &ssc1_clk),
235};
236
237static struct clk_lookup usart_clocks_lookups[] = {
238 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
239 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
240 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
241 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
242};
243
225/* 244/*
226 * The four programmable clocks. 245 * The four programmable clocks.
227 * You must configure pin multiplexing to bring these signals out. 246 * You must configure pin multiplexing to bring these signals out.
@@ -258,12 +277,29 @@ static void __init at91cap9_register_clocks(void)
258 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 277 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
259 clk_register(periph_clocks[i]); 278 clk_register(periph_clocks[i]);
260 279
280 clkdev_add_table(periph_clocks_lookups,
281 ARRAY_SIZE(periph_clocks_lookups));
282 clkdev_add_table(usart_clocks_lookups,
283 ARRAY_SIZE(usart_clocks_lookups));
284
261 clk_register(&pck0); 285 clk_register(&pck0);
262 clk_register(&pck1); 286 clk_register(&pck1);
263 clk_register(&pck2); 287 clk_register(&pck2);
264 clk_register(&pck3); 288 clk_register(&pck3);
265} 289}
266 290
291static struct clk_lookup console_clock_lookup;
292
293void __init at91cap9_set_console_clock(int id)
294{
295 if (id >= ARRAY_SIZE(usart_clocks_lookups))
296 return;
297
298 console_clock_lookup.con_id = "usart";
299 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
300 clkdev_add(&console_clock_lookup);
301}
302
267/* -------------------------------------------------------------------- 303/* --------------------------------------------------------------------
268 * GPIO 304 * GPIO
269 * -------------------------------------------------------------------- */ 305 * -------------------------------------------------------------------- */
@@ -303,11 +339,14 @@ static void at91cap9_poweroff(void)
303 * AT91CAP9 processor initialization 339 * AT91CAP9 processor initialization
304 * -------------------------------------------------------------------- */ 340 * -------------------------------------------------------------------- */
305 341
306void __init at91cap9_initialize(unsigned long main_clock) 342void __init at91cap9_map_io(void)
307{ 343{
308 /* Map peripherals */ 344 /* Map peripherals */
309 iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); 345 iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc));
346}
310 347
348void __init at91cap9_initialize(unsigned long main_clock)
349{
311 at91_arch_reset = at91cap9_reset; 350 at91_arch_reset = at91cap9_reset;
312 pm_power_off = at91cap9_poweroff; 351 pm_power_off = at91cap9_poweroff;
313 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); 352 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index 21020ceb2f3a..cd850ed6f335 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -181,10 +181,6 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
181 181
182 /* Pullup pin is handled internally by USB device peripheral */ 182 /* Pullup pin is handled internally by USB device peripheral */
183 183
184 /* Clocks */
185 at91_clock_associate("utmi_clk", &at91_usba_udc_device.dev, "hclk");
186 at91_clock_associate("udphs_clk", &at91_usba_udc_device.dev, "pclk");
187
188 platform_device_register(&at91_usba_udc_device); 184 platform_device_register(&at91_usba_udc_device);
189} 185}
190#else 186#else
@@ -355,7 +351,6 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
355 } 351 }
356 352
357 mmc0_data = *data; 353 mmc0_data = *data;
358 at91_clock_associate("mci0_clk", &at91cap9_mmc0_device.dev, "mci_clk");
359 platform_device_register(&at91cap9_mmc0_device); 354 platform_device_register(&at91cap9_mmc0_device);
360 } else { /* MCI1 */ 355 } else { /* MCI1 */
361 /* CLK */ 356 /* CLK */
@@ -373,7 +368,6 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
373 } 368 }
374 369
375 mmc1_data = *data; 370 mmc1_data = *data;
376 at91_clock_associate("mci1_clk", &at91cap9_mmc1_device.dev, "mci_clk");
377 platform_device_register(&at91cap9_mmc1_device); 371 platform_device_register(&at91cap9_mmc1_device);
378 } 372 }
379} 373}
@@ -614,7 +608,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
614 at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ 608 at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
615 at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */ 609 at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
616 610
617 at91_clock_associate("spi0_clk", &at91cap9_spi0_device.dev, "spi_clk");
618 platform_device_register(&at91cap9_spi0_device); 611 platform_device_register(&at91cap9_spi0_device);
619 } 612 }
620 if (enable_spi1) { 613 if (enable_spi1) {
@@ -622,7 +615,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
622 at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */ 615 at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */
623 at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */ 616 at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */
624 617
625 at91_clock_associate("spi1_clk", &at91cap9_spi1_device.dev, "spi_clk");
626 platform_device_register(&at91cap9_spi1_device); 618 platform_device_register(&at91cap9_spi1_device);
627 } 619 }
628} 620}
@@ -659,8 +651,6 @@ static struct platform_device at91cap9_tcb_device = {
659 651
660static void __init at91_add_device_tc(void) 652static void __init at91_add_device_tc(void)
661{ 653{
662 /* this chip has one clock and irq for all three TC channels */
663 at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk");
664 platform_device_register(&at91cap9_tcb_device); 654 platform_device_register(&at91cap9_tcb_device);
665} 655}
666#else 656#else
@@ -1001,12 +991,10 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
1001 case AT91CAP9_ID_SSC0: 991 case AT91CAP9_ID_SSC0:
1002 pdev = &at91cap9_ssc0_device; 992 pdev = &at91cap9_ssc0_device;
1003 configure_ssc0_pins(pins); 993 configure_ssc0_pins(pins);
1004 at91_clock_associate("ssc0_clk", &pdev->dev, "ssc");
1005 break; 994 break;
1006 case AT91CAP9_ID_SSC1: 995 case AT91CAP9_ID_SSC1:
1007 pdev = &at91cap9_ssc1_device; 996 pdev = &at91cap9_ssc1_device;
1008 configure_ssc1_pins(pins); 997 configure_ssc1_pins(pins);
1009 at91_clock_associate("ssc1_clk", &pdev->dev, "ssc");
1010 break; 998 break;
1011 default: 999 default:
1012 return; 1000 return;
@@ -1199,32 +1187,30 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1199void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1187void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1200{ 1188{
1201 struct platform_device *pdev; 1189 struct platform_device *pdev;
1190 struct atmel_uart_data *pdata;
1202 1191
1203 switch (id) { 1192 switch (id) {
1204 case 0: /* DBGU */ 1193 case 0: /* DBGU */
1205 pdev = &at91cap9_dbgu_device; 1194 pdev = &at91cap9_dbgu_device;
1206 configure_dbgu_pins(); 1195 configure_dbgu_pins();
1207 at91_clock_associate("mck", &pdev->dev, "usart");
1208 break; 1196 break;
1209 case AT91CAP9_ID_US0: 1197 case AT91CAP9_ID_US0:
1210 pdev = &at91cap9_uart0_device; 1198 pdev = &at91cap9_uart0_device;
1211 configure_usart0_pins(pins); 1199 configure_usart0_pins(pins);
1212 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1213 break; 1200 break;
1214 case AT91CAP9_ID_US1: 1201 case AT91CAP9_ID_US1:
1215 pdev = &at91cap9_uart1_device; 1202 pdev = &at91cap9_uart1_device;
1216 configure_usart1_pins(pins); 1203 configure_usart1_pins(pins);
1217 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1218 break; 1204 break;
1219 case AT91CAP9_ID_US2: 1205 case AT91CAP9_ID_US2:
1220 pdev = &at91cap9_uart2_device; 1206 pdev = &at91cap9_uart2_device;
1221 configure_usart2_pins(pins); 1207 configure_usart2_pins(pins);
1222 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1223 break; 1208 break;
1224 default: 1209 default:
1225 return; 1210 return;
1226 } 1211 }
1227 pdev->id = portnr; /* update to mapped ID */ 1212 pdata = pdev->dev.platform_data;
1213 pdata->num = portnr; /* update to mapped ID */
1228 1214
1229 if (portnr < ATMEL_MAX_UART) 1215 if (portnr < ATMEL_MAX_UART)
1230 at91_uarts[portnr] = pdev; 1216 at91_uarts[portnr] = pdev;
@@ -1232,8 +1218,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1232 1218
1233void __init at91_set_serial_console(unsigned portnr) 1219void __init at91_set_serial_console(unsigned portnr)
1234{ 1220{
1235 if (portnr < ATMEL_MAX_UART) 1221 if (portnr < ATMEL_MAX_UART) {
1236 atmel_default_console_device = at91_uarts[portnr]; 1222 atmel_default_console_device = at91_uarts[portnr];
1223 at91cap9_set_console_clock(portnr);
1224 }
1237} 1225}
1238 1226
1239void __init at91_add_device_serial(void) 1227void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 2e9ecad97f3d..b228ce9e21a1 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -18,6 +18,7 @@
18#include <mach/at91rm9200.h> 18#include <mach/at91rm9200.h>
19#include <mach/at91_pmc.h> 19#include <mach/at91_pmc.h>
20#include <mach/at91_st.h> 20#include <mach/at91_st.h>
21#include <mach/cpu.h>
21 22
22#include "generic.h" 23#include "generic.h"
23#include "clock.h" 24#include "clock.h"
@@ -191,6 +192,26 @@ static struct clk *periph_clocks[] __initdata = {
191 // irq0 .. irq6 192 // irq0 .. irq6
192}; 193};
193 194
195static struct clk_lookup periph_clocks_lookups[] = {
196 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
197 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
198 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
199 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
200 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
201 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
202 CLKDEV_CON_DEV_ID("ssc", "ssc.0", &ssc0_clk),
203 CLKDEV_CON_DEV_ID("ssc", "ssc.1", &ssc1_clk),
204 CLKDEV_CON_DEV_ID("ssc", "ssc.2", &ssc2_clk),
205};
206
207static struct clk_lookup usart_clocks_lookups[] = {
208 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
209 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
210 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
211 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
212 CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
213};
214
194/* 215/*
195 * The four programmable clocks. 216 * The four programmable clocks.
196 * You must configure pin multiplexing to bring these signals out. 217 * You must configure pin multiplexing to bring these signals out.
@@ -227,12 +248,29 @@ static void __init at91rm9200_register_clocks(void)
227 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 248 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
228 clk_register(periph_clocks[i]); 249 clk_register(periph_clocks[i]);
229 250
251 clkdev_add_table(periph_clocks_lookups,
252 ARRAY_SIZE(periph_clocks_lookups));
253 clkdev_add_table(usart_clocks_lookups,
254 ARRAY_SIZE(usart_clocks_lookups));
255
230 clk_register(&pck0); 256 clk_register(&pck0);
231 clk_register(&pck1); 257 clk_register(&pck1);
232 clk_register(&pck2); 258 clk_register(&pck2);
233 clk_register(&pck3); 259 clk_register(&pck3);
234} 260}
235 261
262static struct clk_lookup console_clock_lookup;
263
264void __init at91rm9200_set_console_clock(int id)
265{
266 if (id >= ARRAY_SIZE(usart_clocks_lookups))
267 return;
268
269 console_clock_lookup.con_id = "usart";
270 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
271 clkdev_add(&console_clock_lookup);
272}
273
236/* -------------------------------------------------------------------- 274/* --------------------------------------------------------------------
237 * GPIO 275 * GPIO
238 * -------------------------------------------------------------------- */ 276 * -------------------------------------------------------------------- */
@@ -266,15 +304,25 @@ static void at91rm9200_reset(void)
266 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST); 304 at91_sys_write(AT91_ST_CR, AT91_ST_WDRST);
267} 305}
268 306
307int rm9200_type;
308EXPORT_SYMBOL(rm9200_type);
309
310void __init at91rm9200_set_type(int type)
311{
312 rm9200_type = type;
313}
269 314
270/* -------------------------------------------------------------------- 315/* --------------------------------------------------------------------
271 * AT91RM9200 processor initialization 316 * AT91RM9200 processor initialization
272 * -------------------------------------------------------------------- */ 317 * -------------------------------------------------------------------- */
273void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks) 318void __init at91rm9200_map_io(void)
274{ 319{
275 /* Map peripherals */ 320 /* Map peripherals */
276 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc)); 321 iotable_init(at91rm9200_io_desc, ARRAY_SIZE(at91rm9200_io_desc));
322}
277 323
324void __init at91rm9200_initialize(unsigned long main_clock)
325{
278 at91_arch_reset = at91rm9200_reset; 326 at91_arch_reset = at91rm9200_reset;
279 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) 327 at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
280 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) 328 | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
@@ -288,7 +336,8 @@ void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks
288 at91rm9200_register_clocks(); 336 at91rm9200_register_clocks();
289 337
290 /* Initialize GPIO subsystem */ 338 /* Initialize GPIO subsystem */
291 at91_gpio_init(at91rm9200_gpio, banks); 339 at91_gpio_init(at91rm9200_gpio,
340 cpu_is_at91rm9200_bga() ? AT91RM9200_BGA : AT91RM9200_PQFP);
292} 341}
293 342
294 343
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 7b539228e0ef..a0ba475be04c 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -644,15 +644,7 @@ static struct platform_device at91rm9200_tcb1_device = {
644 644
645static void __init at91_add_device_tc(void) 645static void __init at91_add_device_tc(void)
646{ 646{
647 /* this chip has a separate clock and irq for each TC channel */
648 at91_clock_associate("tc0_clk", &at91rm9200_tcb0_device.dev, "t0_clk");
649 at91_clock_associate("tc1_clk", &at91rm9200_tcb0_device.dev, "t1_clk");
650 at91_clock_associate("tc2_clk", &at91rm9200_tcb0_device.dev, "t2_clk");
651 platform_device_register(&at91rm9200_tcb0_device); 647 platform_device_register(&at91rm9200_tcb0_device);
652
653 at91_clock_associate("tc3_clk", &at91rm9200_tcb1_device.dev, "t0_clk");
654 at91_clock_associate("tc4_clk", &at91rm9200_tcb1_device.dev, "t1_clk");
655 at91_clock_associate("tc5_clk", &at91rm9200_tcb1_device.dev, "t2_clk");
656 platform_device_register(&at91rm9200_tcb1_device); 648 platform_device_register(&at91rm9200_tcb1_device);
657} 649}
658#else 650#else
@@ -849,17 +841,14 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
849 case AT91RM9200_ID_SSC0: 841 case AT91RM9200_ID_SSC0:
850 pdev = &at91rm9200_ssc0_device; 842 pdev = &at91rm9200_ssc0_device;
851 configure_ssc0_pins(pins); 843 configure_ssc0_pins(pins);
852 at91_clock_associate("ssc0_clk", &pdev->dev, "ssc");
853 break; 844 break;
854 case AT91RM9200_ID_SSC1: 845 case AT91RM9200_ID_SSC1:
855 pdev = &at91rm9200_ssc1_device; 846 pdev = &at91rm9200_ssc1_device;
856 configure_ssc1_pins(pins); 847 configure_ssc1_pins(pins);
857 at91_clock_associate("ssc1_clk", &pdev->dev, "ssc");
858 break; 848 break;
859 case AT91RM9200_ID_SSC2: 849 case AT91RM9200_ID_SSC2:
860 pdev = &at91rm9200_ssc2_device; 850 pdev = &at91rm9200_ssc2_device;
861 configure_ssc2_pins(pins); 851 configure_ssc2_pins(pins);
862 at91_clock_associate("ssc2_clk", &pdev->dev, "ssc");
863 break; 852 break;
864 default: 853 default:
865 return; 854 return;
@@ -1109,37 +1098,34 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1109void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1098void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1110{ 1099{
1111 struct platform_device *pdev; 1100 struct platform_device *pdev;
1101 struct atmel_uart_data *pdata;
1112 1102
1113 switch (id) { 1103 switch (id) {
1114 case 0: /* DBGU */ 1104 case 0: /* DBGU */
1115 pdev = &at91rm9200_dbgu_device; 1105 pdev = &at91rm9200_dbgu_device;
1116 configure_dbgu_pins(); 1106 configure_dbgu_pins();
1117 at91_clock_associate("mck", &pdev->dev, "usart");
1118 break; 1107 break;
1119 case AT91RM9200_ID_US0: 1108 case AT91RM9200_ID_US0:
1120 pdev = &at91rm9200_uart0_device; 1109 pdev = &at91rm9200_uart0_device;
1121 configure_usart0_pins(pins); 1110 configure_usart0_pins(pins);
1122 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1123 break; 1111 break;
1124 case AT91RM9200_ID_US1: 1112 case AT91RM9200_ID_US1:
1125 pdev = &at91rm9200_uart1_device; 1113 pdev = &at91rm9200_uart1_device;
1126 configure_usart1_pins(pins); 1114 configure_usart1_pins(pins);
1127 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1128 break; 1115 break;
1129 case AT91RM9200_ID_US2: 1116 case AT91RM9200_ID_US2:
1130 pdev = &at91rm9200_uart2_device; 1117 pdev = &at91rm9200_uart2_device;
1131 configure_usart2_pins(pins); 1118 configure_usart2_pins(pins);
1132 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1133 break; 1119 break;
1134 case AT91RM9200_ID_US3: 1120 case AT91RM9200_ID_US3:
1135 pdev = &at91rm9200_uart3_device; 1121 pdev = &at91rm9200_uart3_device;
1136 configure_usart3_pins(pins); 1122 configure_usart3_pins(pins);
1137 at91_clock_associate("usart3_clk", &pdev->dev, "usart");
1138 break; 1123 break;
1139 default: 1124 default:
1140 return; 1125 return;
1141 } 1126 }
1142 pdev->id = portnr; /* update to mapped ID */ 1127 pdata = pdev->dev.platform_data;
1128 pdata->num = portnr; /* update to mapped ID */
1143 1129
1144 if (portnr < ATMEL_MAX_UART) 1130 if (portnr < ATMEL_MAX_UART)
1145 at91_uarts[portnr] = pdev; 1131 at91_uarts[portnr] = pdev;
@@ -1147,8 +1133,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1147 1133
1148void __init at91_set_serial_console(unsigned portnr) 1134void __init at91_set_serial_console(unsigned portnr)
1149{ 1135{
1150 if (portnr < ATMEL_MAX_UART) 1136 if (portnr < ATMEL_MAX_UART) {
1151 atmel_default_console_device = at91_uarts[portnr]; 1137 atmel_default_console_device = at91_uarts[portnr];
1138 at91rm9200_set_console_clock(portnr);
1139 }
1152} 1140}
1153 1141
1154void __init at91_add_device_serial(void) 1142void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 195208b30024..7d606b04d313 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -231,6 +231,28 @@ static struct clk *periph_clocks[] __initdata = {
231 // irq0 .. irq2 231 // irq0 .. irq2
232}; 232};
233 233
234static struct clk_lookup periph_clocks_lookups[] = {
235 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
236 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
237 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
238 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
239 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
240 CLKDEV_CON_DEV_ID("t3_clk", "atmel_tcb.1", &tc3_clk),
241 CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
242 CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
243 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
244};
245
246static struct clk_lookup usart_clocks_lookups[] = {
247 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
248 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
249 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
250 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
251 CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
252 CLKDEV_CON_DEV_ID("usart", "atmel_usart.5", &usart4_clk),
253 CLKDEV_CON_DEV_ID("usart", "atmel_usart.6", &usart5_clk),
254};
255
234/* 256/*
235 * The two programmable clocks. 257 * The two programmable clocks.
236 * You must configure pin multiplexing to bring these signals out. 258 * You must configure pin multiplexing to bring these signals out.
@@ -255,10 +277,27 @@ static void __init at91sam9260_register_clocks(void)
255 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 277 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
256 clk_register(periph_clocks[i]); 278 clk_register(periph_clocks[i]);
257 279
280 clkdev_add_table(periph_clocks_lookups,
281 ARRAY_SIZE(periph_clocks_lookups));
282 clkdev_add_table(usart_clocks_lookups,
283 ARRAY_SIZE(usart_clocks_lookups));
284
258 clk_register(&pck0); 285 clk_register(&pck0);
259 clk_register(&pck1); 286 clk_register(&pck1);
260} 287}
261 288
289static struct clk_lookup console_clock_lookup;
290
291void __init at91sam9260_set_console_clock(int id)
292{
293 if (id >= ARRAY_SIZE(usart_clocks_lookups))
294 return;
295
296 console_clock_lookup.con_id = "usart";
297 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
298 clkdev_add(&console_clock_lookup);
299}
300
262/* -------------------------------------------------------------------- 301/* --------------------------------------------------------------------
263 * GPIO 302 * GPIO
264 * -------------------------------------------------------------------- */ 303 * -------------------------------------------------------------------- */
@@ -289,7 +328,7 @@ static void at91sam9260_poweroff(void)
289 * AT91SAM9260 processor initialization 328 * AT91SAM9260 processor initialization
290 * -------------------------------------------------------------------- */ 329 * -------------------------------------------------------------------- */
291 330
292static void __init at91sam9xe_initialize(void) 331static void __init at91sam9xe_map_io(void)
293{ 332{
294 unsigned long cidr, sram_size; 333 unsigned long cidr, sram_size;
295 334
@@ -310,18 +349,21 @@ static void __init at91sam9xe_initialize(void)
310 iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc)); 349 iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc));
311} 350}
312 351
313void __init at91sam9260_initialize(unsigned long main_clock) 352void __init at91sam9260_map_io(void)
314{ 353{
315 /* Map peripherals */ 354 /* Map peripherals */
316 iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc)); 355 iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc));
317 356
318 if (cpu_is_at91sam9xe()) 357 if (cpu_is_at91sam9xe())
319 at91sam9xe_initialize(); 358 at91sam9xe_map_io();
320 else if (cpu_is_at91sam9g20()) 359 else if (cpu_is_at91sam9g20())
321 iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc)); 360 iotable_init(at91sam9g20_sram_desc, ARRAY_SIZE(at91sam9g20_sram_desc));
322 else 361 else
323 iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); 362 iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc));
363}
324 364
365void __init at91sam9260_initialize(unsigned long main_clock)
366{
325 at91_arch_reset = at91sam9_alt_reset; 367 at91_arch_reset = at91sam9_alt_reset;
326 pm_power_off = at91sam9260_poweroff; 368 pm_power_off = at91sam9260_poweroff;
327 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) 369 at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 07eb7b07e442..1fdeb9058a76 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -609,7 +609,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
609 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ 609 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
610 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI1_SPCK */ 610 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI1_SPCK */
611 611
612 at91_clock_associate("spi0_clk", &at91sam9260_spi0_device.dev, "spi_clk");
613 platform_device_register(&at91sam9260_spi0_device); 612 platform_device_register(&at91sam9260_spi0_device);
614 } 613 }
615 if (enable_spi1) { 614 if (enable_spi1) {
@@ -617,7 +616,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
617 at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI1_MOSI */ 616 at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI1_MOSI */
618 at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI1_SPCK */ 617 at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI1_SPCK */
619 618
620 at91_clock_associate("spi1_clk", &at91sam9260_spi1_device.dev, "spi_clk");
621 platform_device_register(&at91sam9260_spi1_device); 619 platform_device_register(&at91sam9260_spi1_device);
622 } 620 }
623} 621}
@@ -694,15 +692,7 @@ static struct platform_device at91sam9260_tcb1_device = {
694 692
695static void __init at91_add_device_tc(void) 693static void __init at91_add_device_tc(void)
696{ 694{
697 /* this chip has a separate clock and irq for each TC channel */
698 at91_clock_associate("tc0_clk", &at91sam9260_tcb0_device.dev, "t0_clk");
699 at91_clock_associate("tc1_clk", &at91sam9260_tcb0_device.dev, "t1_clk");
700 at91_clock_associate("tc2_clk", &at91sam9260_tcb0_device.dev, "t2_clk");
701 platform_device_register(&at91sam9260_tcb0_device); 695 platform_device_register(&at91sam9260_tcb0_device);
702
703 at91_clock_associate("tc3_clk", &at91sam9260_tcb1_device.dev, "t0_clk");
704 at91_clock_associate("tc4_clk", &at91sam9260_tcb1_device.dev, "t1_clk");
705 at91_clock_associate("tc5_clk", &at91sam9260_tcb1_device.dev, "t2_clk");
706 platform_device_register(&at91sam9260_tcb1_device); 696 platform_device_register(&at91sam9260_tcb1_device);
707} 697}
708#else 698#else
@@ -820,7 +810,6 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
820 case AT91SAM9260_ID_SSC: 810 case AT91SAM9260_ID_SSC:
821 pdev = &at91sam9260_ssc_device; 811 pdev = &at91sam9260_ssc_device;
822 configure_ssc_pins(pins); 812 configure_ssc_pins(pins);
823 at91_clock_associate("ssc_clk", &pdev->dev, "pclk");
824 break; 813 break;
825 default: 814 default:
826 return; 815 return;
@@ -1139,47 +1128,42 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1139void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1128void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1140{ 1129{
1141 struct platform_device *pdev; 1130 struct platform_device *pdev;
1131 struct atmel_uart_data *pdata;
1142 1132
1143 switch (id) { 1133 switch (id) {
1144 case 0: /* DBGU */ 1134 case 0: /* DBGU */
1145 pdev = &at91sam9260_dbgu_device; 1135 pdev = &at91sam9260_dbgu_device;
1146 configure_dbgu_pins(); 1136 configure_dbgu_pins();
1147 at91_clock_associate("mck", &pdev->dev, "usart");
1148 break; 1137 break;
1149 case AT91SAM9260_ID_US0: 1138 case AT91SAM9260_ID_US0:
1150 pdev = &at91sam9260_uart0_device; 1139 pdev = &at91sam9260_uart0_device;
1151 configure_usart0_pins(pins); 1140 configure_usart0_pins(pins);
1152 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1153 break; 1141 break;
1154 case AT91SAM9260_ID_US1: 1142 case AT91SAM9260_ID_US1:
1155 pdev = &at91sam9260_uart1_device; 1143 pdev = &at91sam9260_uart1_device;
1156 configure_usart1_pins(pins); 1144 configure_usart1_pins(pins);
1157 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1158 break; 1145 break;
1159 case AT91SAM9260_ID_US2: 1146 case AT91SAM9260_ID_US2:
1160 pdev = &at91sam9260_uart2_device; 1147 pdev = &at91sam9260_uart2_device;
1161 configure_usart2_pins(pins); 1148 configure_usart2_pins(pins);
1162 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1163 break; 1149 break;
1164 case AT91SAM9260_ID_US3: 1150 case AT91SAM9260_ID_US3:
1165 pdev = &at91sam9260_uart3_device; 1151 pdev = &at91sam9260_uart3_device;
1166 configure_usart3_pins(pins); 1152 configure_usart3_pins(pins);
1167 at91_clock_associate("usart3_clk", &pdev->dev, "usart");
1168 break; 1153 break;
1169 case AT91SAM9260_ID_US4: 1154 case AT91SAM9260_ID_US4:
1170 pdev = &at91sam9260_uart4_device; 1155 pdev = &at91sam9260_uart4_device;
1171 configure_usart4_pins(); 1156 configure_usart4_pins();
1172 at91_clock_associate("usart4_clk", &pdev->dev, "usart");
1173 break; 1157 break;
1174 case AT91SAM9260_ID_US5: 1158 case AT91SAM9260_ID_US5:
1175 pdev = &at91sam9260_uart5_device; 1159 pdev = &at91sam9260_uart5_device;
1176 configure_usart5_pins(); 1160 configure_usart5_pins();
1177 at91_clock_associate("usart5_clk", &pdev->dev, "usart");
1178 break; 1161 break;
1179 default: 1162 default:
1180 return; 1163 return;
1181 } 1164 }
1182 pdev->id = portnr; /* update to mapped ID */ 1165 pdata = pdev->dev.platform_data;
1166 pdata->num = portnr; /* update to mapped ID */
1183 1167
1184 if (portnr < ATMEL_MAX_UART) 1168 if (portnr < ATMEL_MAX_UART)
1185 at91_uarts[portnr] = pdev; 1169 at91_uarts[portnr] = pdev;
@@ -1187,8 +1171,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1187 1171
1188void __init at91_set_serial_console(unsigned portnr) 1172void __init at91_set_serial_console(unsigned portnr)
1189{ 1173{
1190 if (portnr < ATMEL_MAX_UART) 1174 if (portnr < ATMEL_MAX_UART) {
1191 atmel_default_console_device = at91_uarts[portnr]; 1175 atmel_default_console_device = at91_uarts[portnr];
1176 at91sam9260_set_console_clock(portnr);
1177 }
1192} 1178}
1193 1179
1194void __init at91_add_device_serial(void) 1180void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index fcad88668504..c1483168c97a 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -178,6 +178,24 @@ static struct clk *periph_clocks[] __initdata = {
178 // irq0 .. irq2 178 // irq0 .. irq2
179}; 179};
180 180
181static struct clk_lookup periph_clocks_lookups[] = {
182 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
183 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
184 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
185 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
186 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc1_clk),
187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
190};
191
192static struct clk_lookup usart_clocks_lookups[] = {
193 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
194 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
195 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
196 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
197};
198
181/* 199/*
182 * The four programmable clocks. 200 * The four programmable clocks.
183 * You must configure pin multiplexing to bring these signals out. 201 * You must configure pin multiplexing to bring these signals out.
@@ -228,6 +246,11 @@ static void __init at91sam9261_register_clocks(void)
228 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 246 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
229 clk_register(periph_clocks[i]); 247 clk_register(periph_clocks[i]);
230 248
249 clkdev_add_table(periph_clocks_lookups,
250 ARRAY_SIZE(periph_clocks_lookups));
251 clkdev_add_table(usart_clocks_lookups,
252 ARRAY_SIZE(usart_clocks_lookups));
253
231 clk_register(&pck0); 254 clk_register(&pck0);
232 clk_register(&pck1); 255 clk_register(&pck1);
233 clk_register(&pck2); 256 clk_register(&pck2);
@@ -237,6 +260,18 @@ static void __init at91sam9261_register_clocks(void)
237 clk_register(&hck1); 260 clk_register(&hck1);
238} 261}
239 262
263static struct clk_lookup console_clock_lookup;
264
265void __init at91sam9261_set_console_clock(int id)
266{
267 if (id >= ARRAY_SIZE(usart_clocks_lookups))
268 return;
269
270 console_clock_lookup.con_id = "usart";
271 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
272 clkdev_add(&console_clock_lookup);
273}
274
240/* -------------------------------------------------------------------- 275/* --------------------------------------------------------------------
241 * GPIO 276 * GPIO
242 * -------------------------------------------------------------------- */ 277 * -------------------------------------------------------------------- */
@@ -267,7 +302,7 @@ static void at91sam9261_poweroff(void)
267 * AT91SAM9261 processor initialization 302 * AT91SAM9261 processor initialization
268 * -------------------------------------------------------------------- */ 303 * -------------------------------------------------------------------- */
269 304
270void __init at91sam9261_initialize(unsigned long main_clock) 305void __init at91sam9261_map_io(void)
271{ 306{
272 /* Map peripherals */ 307 /* Map peripherals */
273 iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc)); 308 iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
@@ -276,8 +311,10 @@ void __init at91sam9261_initialize(unsigned long main_clock)
276 iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc)); 311 iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc));
277 else 312 else
278 iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc)); 313 iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc));
314}
279 315
280 316void __init at91sam9261_initialize(unsigned long main_clock)
317{
281 at91_arch_reset = at91sam9_alt_reset; 318 at91_arch_reset = at91sam9_alt_reset;
282 pm_power_off = at91sam9261_poweroff; 319 pm_power_off = at91sam9261_poweroff;
283 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 320 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 59fc48311fb0..3eb4538fceeb 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -426,7 +426,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
426 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ 426 at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
427 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */ 427 at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
428 428
429 at91_clock_associate("spi0_clk", &at91sam9261_spi0_device.dev, "spi_clk");
430 platform_device_register(&at91sam9261_spi0_device); 429 platform_device_register(&at91sam9261_spi0_device);
431 } 430 }
432 if (enable_spi1) { 431 if (enable_spi1) {
@@ -434,7 +433,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
434 at91_set_A_periph(AT91_PIN_PB31, 0); /* SPI1_MOSI */ 433 at91_set_A_periph(AT91_PIN_PB31, 0); /* SPI1_MOSI */
435 at91_set_A_periph(AT91_PIN_PB29, 0); /* SPI1_SPCK */ 434 at91_set_A_periph(AT91_PIN_PB29, 0); /* SPI1_SPCK */
436 435
437 at91_clock_associate("spi1_clk", &at91sam9261_spi1_device.dev, "spi_clk");
438 platform_device_register(&at91sam9261_spi1_device); 436 platform_device_register(&at91sam9261_spi1_device);
439 } 437 }
440} 438}
@@ -581,10 +579,6 @@ static struct platform_device at91sam9261_tcb_device = {
581 579
582static void __init at91_add_device_tc(void) 580static void __init at91_add_device_tc(void)
583{ 581{
584 /* this chip has a separate clock and irq for each TC channel */
585 at91_clock_associate("tc0_clk", &at91sam9261_tcb_device.dev, "t0_clk");
586 at91_clock_associate("tc1_clk", &at91sam9261_tcb_device.dev, "t1_clk");
587 at91_clock_associate("tc2_clk", &at91sam9261_tcb_device.dev, "t2_clk");
588 platform_device_register(&at91sam9261_tcb_device); 582 platform_device_register(&at91sam9261_tcb_device);
589} 583}
590#else 584#else
@@ -786,17 +780,14 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
786 case AT91SAM9261_ID_SSC0: 780 case AT91SAM9261_ID_SSC0:
787 pdev = &at91sam9261_ssc0_device; 781 pdev = &at91sam9261_ssc0_device;
788 configure_ssc0_pins(pins); 782 configure_ssc0_pins(pins);
789 at91_clock_associate("ssc0_clk", &pdev->dev, "pclk");
790 break; 783 break;
791 case AT91SAM9261_ID_SSC1: 784 case AT91SAM9261_ID_SSC1:
792 pdev = &at91sam9261_ssc1_device; 785 pdev = &at91sam9261_ssc1_device;
793 configure_ssc1_pins(pins); 786 configure_ssc1_pins(pins);
794 at91_clock_associate("ssc1_clk", &pdev->dev, "pclk");
795 break; 787 break;
796 case AT91SAM9261_ID_SSC2: 788 case AT91SAM9261_ID_SSC2:
797 pdev = &at91sam9261_ssc2_device; 789 pdev = &at91sam9261_ssc2_device;
798 configure_ssc2_pins(pins); 790 configure_ssc2_pins(pins);
799 at91_clock_associate("ssc2_clk", &pdev->dev, "pclk");
800 break; 791 break;
801 default: 792 default:
802 return; 793 return;
@@ -989,32 +980,30 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
989void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 980void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
990{ 981{
991 struct platform_device *pdev; 982 struct platform_device *pdev;
983 struct atmel_uart_data *pdata;
992 984
993 switch (id) { 985 switch (id) {
994 case 0: /* DBGU */ 986 case 0: /* DBGU */
995 pdev = &at91sam9261_dbgu_device; 987 pdev = &at91sam9261_dbgu_device;
996 configure_dbgu_pins(); 988 configure_dbgu_pins();
997 at91_clock_associate("mck", &pdev->dev, "usart");
998 break; 989 break;
999 case AT91SAM9261_ID_US0: 990 case AT91SAM9261_ID_US0:
1000 pdev = &at91sam9261_uart0_device; 991 pdev = &at91sam9261_uart0_device;
1001 configure_usart0_pins(pins); 992 configure_usart0_pins(pins);
1002 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1003 break; 993 break;
1004 case AT91SAM9261_ID_US1: 994 case AT91SAM9261_ID_US1:
1005 pdev = &at91sam9261_uart1_device; 995 pdev = &at91sam9261_uart1_device;
1006 configure_usart1_pins(pins); 996 configure_usart1_pins(pins);
1007 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1008 break; 997 break;
1009 case AT91SAM9261_ID_US2: 998 case AT91SAM9261_ID_US2:
1010 pdev = &at91sam9261_uart2_device; 999 pdev = &at91sam9261_uart2_device;
1011 configure_usart2_pins(pins); 1000 configure_usart2_pins(pins);
1012 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1013 break; 1001 break;
1014 default: 1002 default:
1015 return; 1003 return;
1016 } 1004 }
1017 pdev->id = portnr; /* update to mapped ID */ 1005 pdata = pdev->dev.platform_data;
1006 pdata->num = portnr; /* update to mapped ID */
1018 1007
1019 if (portnr < ATMEL_MAX_UART) 1008 if (portnr < ATMEL_MAX_UART)
1020 at91_uarts[portnr] = pdev; 1009 at91_uarts[portnr] = pdev;
@@ -1022,8 +1011,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1022 1011
1023void __init at91_set_serial_console(unsigned portnr) 1012void __init at91_set_serial_console(unsigned portnr)
1024{ 1013{
1025 if (portnr < ATMEL_MAX_UART) 1014 if (portnr < ATMEL_MAX_UART) {
1026 atmel_default_console_device = at91_uarts[portnr]; 1015 atmel_default_console_device = at91_uarts[portnr];
1016 at91sam9261_set_console_clock(portnr);
1017 }
1027} 1018}
1028 1019
1029void __init at91_add_device_serial(void) 1020void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 249f900954d8..dc28477d14ff 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -199,6 +199,23 @@ static struct clk *periph_clocks[] __initdata = {
199 // irq0 .. irq1 199 // irq0 .. irq1
200}; 200};
201 201
202static struct clk_lookup periph_clocks_lookups[] = {
203 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
204 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
205 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
206 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
207 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
208 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
209 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
210};
211
212static struct clk_lookup usart_clocks_lookups[] = {
213 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
214 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
215 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
216 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
217};
218
202/* 219/*
203 * The four programmable clocks. 220 * The four programmable clocks.
204 * You must configure pin multiplexing to bring these signals out. 221 * You must configure pin multiplexing to bring these signals out.
@@ -235,12 +252,29 @@ static void __init at91sam9263_register_clocks(void)
235 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 252 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
236 clk_register(periph_clocks[i]); 253 clk_register(periph_clocks[i]);
237 254
255 clkdev_add_table(periph_clocks_lookups,
256 ARRAY_SIZE(periph_clocks_lookups));
257 clkdev_add_table(usart_clocks_lookups,
258 ARRAY_SIZE(usart_clocks_lookups));
259
238 clk_register(&pck0); 260 clk_register(&pck0);
239 clk_register(&pck1); 261 clk_register(&pck1);
240 clk_register(&pck2); 262 clk_register(&pck2);
241 clk_register(&pck3); 263 clk_register(&pck3);
242} 264}
243 265
266static struct clk_lookup console_clock_lookup;
267
268void __init at91sam9263_set_console_clock(int id)
269{
270 if (id >= ARRAY_SIZE(usart_clocks_lookups))
271 return;
272
273 console_clock_lookup.con_id = "usart";
274 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
275 clkdev_add(&console_clock_lookup);
276}
277
244/* -------------------------------------------------------------------- 278/* --------------------------------------------------------------------
245 * GPIO 279 * GPIO
246 * -------------------------------------------------------------------- */ 280 * -------------------------------------------------------------------- */
@@ -279,11 +313,14 @@ static void at91sam9263_poweroff(void)
279 * AT91SAM9263 processor initialization 313 * AT91SAM9263 processor initialization
280 * -------------------------------------------------------------------- */ 314 * -------------------------------------------------------------------- */
281 315
282void __init at91sam9263_initialize(unsigned long main_clock) 316void __init at91sam9263_map_io(void)
283{ 317{
284 /* Map peripherals */ 318 /* Map peripherals */
285 iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc)); 319 iotable_init(at91sam9263_io_desc, ARRAY_SIZE(at91sam9263_io_desc));
320}
286 321
322void __init at91sam9263_initialize(unsigned long main_clock)
323{
287 at91_arch_reset = at91sam9_alt_reset; 324 at91_arch_reset = at91sam9_alt_reset;
288 pm_power_off = at91sam9263_poweroff; 325 pm_power_off = at91sam9263_poweroff;
289 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); 326 at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index fb5c23af1017..ffe081b77ed0 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -308,7 +308,6 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
308 } 308 }
309 309
310 mmc0_data = *data; 310 mmc0_data = *data;
311 at91_clock_associate("mci0_clk", &at91sam9263_mmc0_device.dev, "mci_clk");
312 platform_device_register(&at91sam9263_mmc0_device); 311 platform_device_register(&at91sam9263_mmc0_device);
313 } else { /* MCI1 */ 312 } else { /* MCI1 */
314 /* CLK */ 313 /* CLK */
@@ -339,7 +338,6 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
339 } 338 }
340 339
341 mmc1_data = *data; 340 mmc1_data = *data;
342 at91_clock_associate("mci1_clk", &at91sam9263_mmc1_device.dev, "mci_clk");
343 platform_device_register(&at91sam9263_mmc1_device); 341 platform_device_register(&at91sam9263_mmc1_device);
344 } 342 }
345} 343}
@@ -686,7 +684,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
686 at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */ 684 at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
687 at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */ 685 at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
688 686
689 at91_clock_associate("spi0_clk", &at91sam9263_spi0_device.dev, "spi_clk");
690 platform_device_register(&at91sam9263_spi0_device); 687 platform_device_register(&at91sam9263_spi0_device);
691 } 688 }
692 if (enable_spi1) { 689 if (enable_spi1) {
@@ -694,7 +691,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
694 at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */ 691 at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */
695 at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */ 692 at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */
696 693
697 at91_clock_associate("spi1_clk", &at91sam9263_spi1_device.dev, "spi_clk");
698 platform_device_register(&at91sam9263_spi1_device); 694 platform_device_register(&at91sam9263_spi1_device);
699 } 695 }
700} 696}
@@ -941,8 +937,6 @@ static struct platform_device at91sam9263_tcb_device = {
941 937
942static void __init at91_add_device_tc(void) 938static void __init at91_add_device_tc(void)
943{ 939{
944 /* this chip has one clock and irq for all three TC channels */
945 at91_clock_associate("tcb_clk", &at91sam9263_tcb_device.dev, "t0_clk");
946 platform_device_register(&at91sam9263_tcb_device); 940 platform_device_register(&at91sam9263_tcb_device);
947} 941}
948#else 942#else
@@ -1171,12 +1165,10 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
1171 case AT91SAM9263_ID_SSC0: 1165 case AT91SAM9263_ID_SSC0:
1172 pdev = &at91sam9263_ssc0_device; 1166 pdev = &at91sam9263_ssc0_device;
1173 configure_ssc0_pins(pins); 1167 configure_ssc0_pins(pins);
1174 at91_clock_associate("ssc0_clk", &pdev->dev, "pclk");
1175 break; 1168 break;
1176 case AT91SAM9263_ID_SSC1: 1169 case AT91SAM9263_ID_SSC1:
1177 pdev = &at91sam9263_ssc1_device; 1170 pdev = &at91sam9263_ssc1_device;
1178 configure_ssc1_pins(pins); 1171 configure_ssc1_pins(pins);
1179 at91_clock_associate("ssc1_clk", &pdev->dev, "pclk");
1180 break; 1172 break;
1181 default: 1173 default:
1182 return; 1174 return;
@@ -1370,32 +1362,30 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1370void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1362void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1371{ 1363{
1372 struct platform_device *pdev; 1364 struct platform_device *pdev;
1365 struct atmel_uart_data *pdata;
1373 1366
1374 switch (id) { 1367 switch (id) {
1375 case 0: /* DBGU */ 1368 case 0: /* DBGU */
1376 pdev = &at91sam9263_dbgu_device; 1369 pdev = &at91sam9263_dbgu_device;
1377 configure_dbgu_pins(); 1370 configure_dbgu_pins();
1378 at91_clock_associate("mck", &pdev->dev, "usart");
1379 break; 1371 break;
1380 case AT91SAM9263_ID_US0: 1372 case AT91SAM9263_ID_US0:
1381 pdev = &at91sam9263_uart0_device; 1373 pdev = &at91sam9263_uart0_device;
1382 configure_usart0_pins(pins); 1374 configure_usart0_pins(pins);
1383 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1384 break; 1375 break;
1385 case AT91SAM9263_ID_US1: 1376 case AT91SAM9263_ID_US1:
1386 pdev = &at91sam9263_uart1_device; 1377 pdev = &at91sam9263_uart1_device;
1387 configure_usart1_pins(pins); 1378 configure_usart1_pins(pins);
1388 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1389 break; 1379 break;
1390 case AT91SAM9263_ID_US2: 1380 case AT91SAM9263_ID_US2:
1391 pdev = &at91sam9263_uart2_device; 1381 pdev = &at91sam9263_uart2_device;
1392 configure_usart2_pins(pins); 1382 configure_usart2_pins(pins);
1393 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1394 break; 1383 break;
1395 default: 1384 default:
1396 return; 1385 return;
1397 } 1386 }
1398 pdev->id = portnr; /* update to mapped ID */ 1387 pdata = pdev->dev.platform_data;
1388 pdata->num = portnr; /* update to mapped ID */
1399 1389
1400 if (portnr < ATMEL_MAX_UART) 1390 if (portnr < ATMEL_MAX_UART)
1401 at91_uarts[portnr] = pdev; 1391 at91_uarts[portnr] = pdev;
@@ -1403,8 +1393,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1403 1393
1404void __init at91_set_serial_console(unsigned portnr) 1394void __init at91_set_serial_console(unsigned portnr)
1405{ 1395{
1406 if (portnr < ATMEL_MAX_UART) 1396 if (portnr < ATMEL_MAX_UART) {
1407 atmel_default_console_device = at91_uarts[portnr]; 1397 atmel_default_console_device = at91_uarts[portnr];
1398 at91sam9263_set_console_clock(portnr);
1399 }
1408} 1400}
1409 1401
1410void __init at91_add_device_serial(void) 1402void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index c67b47f1c0fd..2bb6ff9af1c7 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -184,22 +184,6 @@ static struct clk vdec_clk = {
184 .type = CLK_TYPE_PERIPHERAL, 184 .type = CLK_TYPE_PERIPHERAL,
185}; 185};
186 186
187/* One additional fake clock for ohci */
188static struct clk ohci_clk = {
189 .name = "ohci_clk",
190 .pmc_mask = 0,
191 .type = CLK_TYPE_PERIPHERAL,
192 .parent = &uhphs_clk,
193};
194
195/* One additional fake clock for second TC block */
196static struct clk tcb1_clk = {
197 .name = "tcb1_clk",
198 .pmc_mask = 0,
199 .type = CLK_TYPE_PERIPHERAL,
200 .parent = &tcb0_clk,
201};
202
203static struct clk *periph_clocks[] __initdata = { 187static struct clk *periph_clocks[] __initdata = {
204 &pioA_clk, 188 &pioA_clk,
205 &pioB_clk, 189 &pioB_clk,
@@ -228,8 +212,30 @@ static struct clk *periph_clocks[] __initdata = {
228 &udphs_clk, 212 &udphs_clk,
229 &mmc1_clk, 213 &mmc1_clk,
230 // irq0 214 // irq0
231 &ohci_clk, 215};
232 &tcb1_clk, 216
217static struct clk_lookup periph_clocks_lookups[] = {
218 /* One additional fake clock for ohci */
219 CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
220 CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci.0", &uhphs_clk),
221 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk),
222 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk),
223 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
224 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
225 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
226 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
227 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk),
228 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
229 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
230 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
231};
232
233static struct clk_lookup usart_clocks_lookups[] = {
234 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
235 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
236 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
237 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
238 CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
233}; 239};
234 240
235/* 241/*
@@ -256,6 +262,11 @@ static void __init at91sam9g45_register_clocks(void)
256 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 262 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
257 clk_register(periph_clocks[i]); 263 clk_register(periph_clocks[i]);
258 264
265 clkdev_add_table(periph_clocks_lookups,
266 ARRAY_SIZE(periph_clocks_lookups));
267 clkdev_add_table(usart_clocks_lookups,
268 ARRAY_SIZE(usart_clocks_lookups));
269
259 if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11()) 270 if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11())
260 clk_register(&vdec_clk); 271 clk_register(&vdec_clk);
261 272
@@ -263,6 +274,18 @@ static void __init at91sam9g45_register_clocks(void)
263 clk_register(&pck1); 274 clk_register(&pck1);
264} 275}
265 276
277static struct clk_lookup console_clock_lookup;
278
279void __init at91sam9g45_set_console_clock(int id)
280{
281 if (id >= ARRAY_SIZE(usart_clocks_lookups))
282 return;
283
284 console_clock_lookup.con_id = "usart";
285 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
286 clkdev_add(&console_clock_lookup);
287}
288
266/* -------------------------------------------------------------------- 289/* --------------------------------------------------------------------
267 * GPIO 290 * GPIO
268 * -------------------------------------------------------------------- */ 291 * -------------------------------------------------------------------- */
@@ -306,11 +329,14 @@ static void at91sam9g45_poweroff(void)
306 * AT91SAM9G45 processor initialization 329 * AT91SAM9G45 processor initialization
307 * -------------------------------------------------------------------- */ 330 * -------------------------------------------------------------------- */
308 331
309void __init at91sam9g45_initialize(unsigned long main_clock) 332void __init at91sam9g45_map_io(void)
310{ 333{
311 /* Map peripherals */ 334 /* Map peripherals */
312 iotable_init(at91sam9g45_io_desc, ARRAY_SIZE(at91sam9g45_io_desc)); 335 iotable_init(at91sam9g45_io_desc, ARRAY_SIZE(at91sam9g45_io_desc));
336}
313 337
338void __init at91sam9g45_initialize(unsigned long main_clock)
339{
314 at91_arch_reset = at91sam9g45_reset; 340 at91_arch_reset = at91sam9g45_reset;
315 pm_power_off = at91sam9g45_poweroff; 341 pm_power_off = at91sam9g45_poweroff;
316 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); 342 at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 5e9f8a4c38df..05674865bc21 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -180,7 +180,6 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
180 } 180 }
181 181
182 usbh_ehci_data = *data; 182 usbh_ehci_data = *data;
183 at91_clock_associate("uhphs_clk", &at91_usbh_ehci_device.dev, "ehci_clk");
184 platform_device_register(&at91_usbh_ehci_device); 183 platform_device_register(&at91_usbh_ehci_device);
185} 184}
186#else 185#else
@@ -266,10 +265,6 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
266 265
267 /* Pullup pin is handled internally by USB device peripheral */ 266 /* Pullup pin is handled internally by USB device peripheral */
268 267
269 /* Clocks */
270 at91_clock_associate("utmi_clk", &at91_usba_udc_device.dev, "hclk");
271 at91_clock_associate("udphs_clk", &at91_usba_udc_device.dev, "pclk");
272
273 platform_device_register(&at91_usba_udc_device); 268 platform_device_register(&at91_usba_udc_device);
274} 269}
275#else 270#else
@@ -478,7 +473,6 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
478 } 473 }
479 474
480 mmc0_data = *data; 475 mmc0_data = *data;
481 at91_clock_associate("mci0_clk", &at91sam9g45_mmc0_device.dev, "mci_clk");
482 platform_device_register(&at91sam9g45_mmc0_device); 476 platform_device_register(&at91sam9g45_mmc0_device);
483 477
484 } else { /* MCI1 */ 478 } else { /* MCI1 */
@@ -504,7 +498,6 @@ void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *data)
504 } 498 }
505 499
506 mmc1_data = *data; 500 mmc1_data = *data;
507 at91_clock_associate("mci1_clk", &at91sam9g45_mmc1_device.dev, "mci_clk");
508 platform_device_register(&at91sam9g45_mmc1_device); 501 platform_device_register(&at91sam9g45_mmc1_device);
509 502
510 } 503 }
@@ -801,7 +794,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
801 at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI0_MOSI */ 794 at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI0_MOSI */
802 at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI0_SPCK */ 795 at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI0_SPCK */
803 796
804 at91_clock_associate("spi0_clk", &at91sam9g45_spi0_device.dev, "spi_clk");
805 platform_device_register(&at91sam9g45_spi0_device); 797 platform_device_register(&at91sam9g45_spi0_device);
806 } 798 }
807 if (enable_spi1) { 799 if (enable_spi1) {
@@ -809,7 +801,6 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
809 at91_set_A_periph(AT91_PIN_PB15, 0); /* SPI1_MOSI */ 801 at91_set_A_periph(AT91_PIN_PB15, 0); /* SPI1_MOSI */
810 at91_set_A_periph(AT91_PIN_PB16, 0); /* SPI1_SPCK */ 802 at91_set_A_periph(AT91_PIN_PB16, 0); /* SPI1_SPCK */
811 803
812 at91_clock_associate("spi1_clk", &at91sam9g45_spi1_device.dev, "spi_clk");
813 platform_device_register(&at91sam9g45_spi1_device); 804 platform_device_register(&at91sam9g45_spi1_device);
814 } 805 }
815} 806}
@@ -999,10 +990,7 @@ static struct platform_device at91sam9g45_tcb1_device = {
999 990
1000static void __init at91_add_device_tc(void) 991static void __init at91_add_device_tc(void)
1001{ 992{
1002 /* this chip has one clock and irq for all six TC channels */
1003 at91_clock_associate("tcb0_clk", &at91sam9g45_tcb0_device.dev, "t0_clk");
1004 platform_device_register(&at91sam9g45_tcb0_device); 993 platform_device_register(&at91sam9g45_tcb0_device);
1005 at91_clock_associate("tcb1_clk", &at91sam9g45_tcb1_device.dev, "t0_clk");
1006 platform_device_register(&at91sam9g45_tcb1_device); 994 platform_device_register(&at91sam9g45_tcb1_device);
1007} 995}
1008#else 996#else
@@ -1286,12 +1274,10 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
1286 case AT91SAM9G45_ID_SSC0: 1274 case AT91SAM9G45_ID_SSC0:
1287 pdev = &at91sam9g45_ssc0_device; 1275 pdev = &at91sam9g45_ssc0_device;
1288 configure_ssc0_pins(pins); 1276 configure_ssc0_pins(pins);
1289 at91_clock_associate("ssc0_clk", &pdev->dev, "pclk");
1290 break; 1277 break;
1291 case AT91SAM9G45_ID_SSC1: 1278 case AT91SAM9G45_ID_SSC1:
1292 pdev = &at91sam9g45_ssc1_device; 1279 pdev = &at91sam9g45_ssc1_device;
1293 configure_ssc1_pins(pins); 1280 configure_ssc1_pins(pins);
1294 at91_clock_associate("ssc1_clk", &pdev->dev, "pclk");
1295 break; 1281 break;
1296 default: 1282 default:
1297 return; 1283 return;
@@ -1527,37 +1513,34 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1527void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1513void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1528{ 1514{
1529 struct platform_device *pdev; 1515 struct platform_device *pdev;
1516 struct atmel_uart_data *pdata;
1530 1517
1531 switch (id) { 1518 switch (id) {
1532 case 0: /* DBGU */ 1519 case 0: /* DBGU */
1533 pdev = &at91sam9g45_dbgu_device; 1520 pdev = &at91sam9g45_dbgu_device;
1534 configure_dbgu_pins(); 1521 configure_dbgu_pins();
1535 at91_clock_associate("mck", &pdev->dev, "usart");
1536 break; 1522 break;
1537 case AT91SAM9G45_ID_US0: 1523 case AT91SAM9G45_ID_US0:
1538 pdev = &at91sam9g45_uart0_device; 1524 pdev = &at91sam9g45_uart0_device;
1539 configure_usart0_pins(pins); 1525 configure_usart0_pins(pins);
1540 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1541 break; 1526 break;
1542 case AT91SAM9G45_ID_US1: 1527 case AT91SAM9G45_ID_US1:
1543 pdev = &at91sam9g45_uart1_device; 1528 pdev = &at91sam9g45_uart1_device;
1544 configure_usart1_pins(pins); 1529 configure_usart1_pins(pins);
1545 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1546 break; 1530 break;
1547 case AT91SAM9G45_ID_US2: 1531 case AT91SAM9G45_ID_US2:
1548 pdev = &at91sam9g45_uart2_device; 1532 pdev = &at91sam9g45_uart2_device;
1549 configure_usart2_pins(pins); 1533 configure_usart2_pins(pins);
1550 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1551 break; 1534 break;
1552 case AT91SAM9G45_ID_US3: 1535 case AT91SAM9G45_ID_US3:
1553 pdev = &at91sam9g45_uart3_device; 1536 pdev = &at91sam9g45_uart3_device;
1554 configure_usart3_pins(pins); 1537 configure_usart3_pins(pins);
1555 at91_clock_associate("usart3_clk", &pdev->dev, "usart");
1556 break; 1538 break;
1557 default: 1539 default:
1558 return; 1540 return;
1559 } 1541 }
1560 pdev->id = portnr; /* update to mapped ID */ 1542 pdata = pdev->dev.platform_data;
1543 pdata->num = portnr; /* update to mapped ID */
1561 1544
1562 if (portnr < ATMEL_MAX_UART) 1545 if (portnr < ATMEL_MAX_UART)
1563 at91_uarts[portnr] = pdev; 1546 at91_uarts[portnr] = pdev;
@@ -1565,8 +1548,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1565 1548
1566void __init at91_set_serial_console(unsigned portnr) 1549void __init at91_set_serial_console(unsigned portnr)
1567{ 1550{
1568 if (portnr < ATMEL_MAX_UART) 1551 if (portnr < ATMEL_MAX_UART) {
1569 atmel_default_console_device = at91_uarts[portnr]; 1552 atmel_default_console_device = at91_uarts[portnr];
1553 at91sam9g45_set_console_clock(portnr);
1554 }
1570} 1555}
1571 1556
1572void __init at91_add_device_serial(void) 1557void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 6a9d24e5ed8e..1a40f16b66c8 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -190,6 +190,24 @@ static struct clk *periph_clocks[] __initdata = {
190 // irq0 190 // irq0
191}; 191};
192 192
193static struct clk_lookup periph_clocks_lookups[] = {
194 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk),
195 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk),
196 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
197 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
198 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
199 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
200 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
201};
202
203static struct clk_lookup usart_clocks_lookups[] = {
204 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
205 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
206 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
207 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
208 CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
209};
210
193/* 211/*
194 * The two programmable clocks. 212 * The two programmable clocks.
195 * You must configure pin multiplexing to bring these signals out. 213 * You must configure pin multiplexing to bring these signals out.
@@ -214,10 +232,27 @@ static void __init at91sam9rl_register_clocks(void)
214 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 232 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
215 clk_register(periph_clocks[i]); 233 clk_register(periph_clocks[i]);
216 234
235 clkdev_add_table(periph_clocks_lookups,
236 ARRAY_SIZE(periph_clocks_lookups));
237 clkdev_add_table(usart_clocks_lookups,
238 ARRAY_SIZE(usart_clocks_lookups));
239
217 clk_register(&pck0); 240 clk_register(&pck0);
218 clk_register(&pck1); 241 clk_register(&pck1);
219} 242}
220 243
244static struct clk_lookup console_clock_lookup;
245
246void __init at91sam9rl_set_console_clock(int id)
247{
248 if (id >= ARRAY_SIZE(usart_clocks_lookups))
249 return;
250
251 console_clock_lookup.con_id = "usart";
252 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
253 clkdev_add(&console_clock_lookup);
254}
255
221/* -------------------------------------------------------------------- 256/* --------------------------------------------------------------------
222 * GPIO 257 * GPIO
223 * -------------------------------------------------------------------- */ 258 * -------------------------------------------------------------------- */
@@ -252,7 +287,7 @@ static void at91sam9rl_poweroff(void)
252 * AT91SAM9RL processor initialization 287 * AT91SAM9RL processor initialization
253 * -------------------------------------------------------------------- */ 288 * -------------------------------------------------------------------- */
254 289
255void __init at91sam9rl_initialize(unsigned long main_clock) 290void __init at91sam9rl_map_io(void)
256{ 291{
257 unsigned long cidr, sram_size; 292 unsigned long cidr, sram_size;
258 293
@@ -275,7 +310,10 @@ void __init at91sam9rl_initialize(unsigned long main_clock)
275 310
276 /* Map SRAM */ 311 /* Map SRAM */
277 iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); 312 iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
313}
278 314
315void __init at91sam9rl_initialize(unsigned long main_clock)
316{
279 at91_arch_reset = at91sam9_alt_reset; 317 at91_arch_reset = at91sam9_alt_reset;
280 pm_power_off = at91sam9rl_poweroff; 318 pm_power_off = at91sam9rl_poweroff;
281 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 319 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index c49262bddd85..c296045f2b6a 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -155,10 +155,6 @@ void __init at91_add_device_usba(struct usba_platform_data *data)
155 155
156 /* Pullup pin is handled internally by USB device peripheral */ 156 /* Pullup pin is handled internally by USB device peripheral */
157 157
158 /* Clocks */
159 at91_clock_associate("utmi_clk", &at91_usba_udc_device.dev, "hclk");
160 at91_clock_associate("udphs_clk", &at91_usba_udc_device.dev, "pclk");
161
162 platform_device_register(&at91_usba_udc_device); 158 platform_device_register(&at91_usba_udc_device);
163} 159}
164#else 160#else
@@ -605,10 +601,6 @@ static struct platform_device at91sam9rl_tcb_device = {
605 601
606static void __init at91_add_device_tc(void) 602static void __init at91_add_device_tc(void)
607{ 603{
608 /* this chip has a separate clock and irq for each TC channel */
609 at91_clock_associate("tc0_clk", &at91sam9rl_tcb_device.dev, "t0_clk");
610 at91_clock_associate("tc1_clk", &at91sam9rl_tcb_device.dev, "t1_clk");
611 at91_clock_associate("tc2_clk", &at91sam9rl_tcb_device.dev, "t2_clk");
612 platform_device_register(&at91sam9rl_tcb_device); 604 platform_device_register(&at91sam9rl_tcb_device);
613} 605}
614#else 606#else
@@ -892,12 +884,10 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
892 case AT91SAM9RL_ID_SSC0: 884 case AT91SAM9RL_ID_SSC0:
893 pdev = &at91sam9rl_ssc0_device; 885 pdev = &at91sam9rl_ssc0_device;
894 configure_ssc0_pins(pins); 886 configure_ssc0_pins(pins);
895 at91_clock_associate("ssc0_clk", &pdev->dev, "pclk");
896 break; 887 break;
897 case AT91SAM9RL_ID_SSC1: 888 case AT91SAM9RL_ID_SSC1:
898 pdev = &at91sam9rl_ssc1_device; 889 pdev = &at91sam9rl_ssc1_device;
899 configure_ssc1_pins(pins); 890 configure_ssc1_pins(pins);
900 at91_clock_associate("ssc1_clk", &pdev->dev, "pclk");
901 break; 891 break;
902 default: 892 default:
903 return; 893 return;
@@ -1141,37 +1131,34 @@ struct platform_device *atmel_default_console_device; /* the serial console devi
1141void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1131void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1142{ 1132{
1143 struct platform_device *pdev; 1133 struct platform_device *pdev;
1134 struct atmel_uart_data *pdata;
1144 1135
1145 switch (id) { 1136 switch (id) {
1146 case 0: /* DBGU */ 1137 case 0: /* DBGU */
1147 pdev = &at91sam9rl_dbgu_device; 1138 pdev = &at91sam9rl_dbgu_device;
1148 configure_dbgu_pins(); 1139 configure_dbgu_pins();
1149 at91_clock_associate("mck", &pdev->dev, "usart");
1150 break; 1140 break;
1151 case AT91SAM9RL_ID_US0: 1141 case AT91SAM9RL_ID_US0:
1152 pdev = &at91sam9rl_uart0_device; 1142 pdev = &at91sam9rl_uart0_device;
1153 configure_usart0_pins(pins); 1143 configure_usart0_pins(pins);
1154 at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1155 break; 1144 break;
1156 case AT91SAM9RL_ID_US1: 1145 case AT91SAM9RL_ID_US1:
1157 pdev = &at91sam9rl_uart1_device; 1146 pdev = &at91sam9rl_uart1_device;
1158 configure_usart1_pins(pins); 1147 configure_usart1_pins(pins);
1159 at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1160 break; 1148 break;
1161 case AT91SAM9RL_ID_US2: 1149 case AT91SAM9RL_ID_US2:
1162 pdev = &at91sam9rl_uart2_device; 1150 pdev = &at91sam9rl_uart2_device;
1163 configure_usart2_pins(pins); 1151 configure_usart2_pins(pins);
1164 at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1165 break; 1152 break;
1166 case AT91SAM9RL_ID_US3: 1153 case AT91SAM9RL_ID_US3:
1167 pdev = &at91sam9rl_uart3_device; 1154 pdev = &at91sam9rl_uart3_device;
1168 configure_usart3_pins(pins); 1155 configure_usart3_pins(pins);
1169 at91_clock_associate("usart3_clk", &pdev->dev, "usart");
1170 break; 1156 break;
1171 default: 1157 default:
1172 return; 1158 return;
1173 } 1159 }
1174 pdev->id = portnr; /* update to mapped ID */ 1160 pdata = pdev->dev.platform_data;
1161 pdata->num = portnr; /* update to mapped ID */
1175 1162
1176 if (portnr < ATMEL_MAX_UART) 1163 if (portnr < ATMEL_MAX_UART)
1177 at91_uarts[portnr] = pdev; 1164 at91_uarts[portnr] = pdev;
@@ -1179,8 +1166,10 @@ void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1179 1166
1180void __init at91_set_serial_console(unsigned portnr) 1167void __init at91_set_serial_console(unsigned portnr)
1181{ 1168{
1182 if (portnr < ATMEL_MAX_UART) 1169 if (portnr < ATMEL_MAX_UART) {
1183 atmel_default_console_device = at91_uarts[portnr]; 1170 atmel_default_console_device = at91_uarts[portnr];
1171 at91sam9rl_set_console_clock(portnr);
1172 }
1184} 1173}
1185 1174
1186void __init at91_add_device_serial(void) 1175void __init at91_add_device_serial(void)
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index ad3ec85b2790..56ba3bd035ae 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -37,11 +37,6 @@ unsigned long clk_get_rate(struct clk *clk)
37 return AT91X40_MASTER_CLOCK; 37 return AT91X40_MASTER_CLOCK;
38} 38}
39 39
40struct clk *clk_get(struct device *dev, const char *id)
41{
42 return NULL;
43}
44
45void __init at91x40_initialize(unsigned long main_clock) 40void __init at91x40_initialize(unsigned long main_clock)
46{ 41{
47 at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1) 42 at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c
index 8a3fc84847c1..ab1d463aa47d 100644
--- a/arch/arm/mach-at91/board-1arm.c
+++ b/arch/arm/mach-at91/board-1arm.c
@@ -35,14 +35,18 @@
35 35
36#include <mach/board.h> 36#include <mach/board.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cpu.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
41 42
42static void __init onearm_map_io(void) 43static void __init onearm_init_early(void)
43{ 44{
45 /* Set cpu type: PQFP */
46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
47
44 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
45 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 49 at91rm9200_initialize(18432000);
46 50
47 /* DBGU on ttyS0. (Rx & Tx only) */ 51 /* DBGU on ttyS0. (Rx & Tx only) */
48 at91_register_uart(0, 0, 0); 52 at91_register_uart(0, 0, 0);
@@ -92,9 +96,9 @@ static void __init onearm_board_init(void)
92 96
93MACHINE_START(ONEARM, "Ajeco 1ARM single board computer") 97MACHINE_START(ONEARM, "Ajeco 1ARM single board computer")
94 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ 98 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
95 .boot_params = AT91_SDRAM_BASE + 0x100,
96 .timer = &at91rm9200_timer, 99 .timer = &at91rm9200_timer,
97 .map_io = onearm_map_io, 100 .map_io = at91rm9200_map_io,
101 .init_early = onearm_init_early,
98 .init_irq = onearm_init_irq, 102 .init_irq = onearm_init_irq,
99 .init_machine = onearm_board_init, 103 .init_machine = onearm_board_init,
100MACHINE_END 104MACHINE_END
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
index cba7f7771fee..a4924de48c36 100644
--- a/arch/arm/mach-at91/board-afeb-9260v1.c
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -48,7 +48,7 @@
48#include "generic.h" 48#include "generic.h"
49 49
50 50
51static void __init afeb9260_map_io(void) 51static void __init afeb9260_init_early(void)
52{ 52{
53 /* Initialize processor: 18.432 MHz crystal */ 53 /* Initialize processor: 18.432 MHz crystal */
54 at91sam9260_initialize(18432000); 54 at91sam9260_initialize(18432000);
@@ -218,9 +218,9 @@ static void __init afeb9260_board_init(void)
218 218
219MACHINE_START(AFEB9260, "Custom afeb9260 board") 219MACHINE_START(AFEB9260, "Custom afeb9260 board")
220 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */ 220 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
221 .boot_params = AT91_SDRAM_BASE + 0x100,
222 .timer = &at91sam926x_timer, 221 .timer = &at91sam926x_timer,
223 .map_io = afeb9260_map_io, 222 .map_io = at91sam9260_map_io,
223 .init_early = afeb9260_init_early,
224 .init_irq = afeb9260_init_irq, 224 .init_irq = afeb9260_init_irq,
225 .init_machine = afeb9260_board_init, 225 .init_machine = afeb9260_board_init,
226MACHINE_END 226MACHINE_END
diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c
deleted file mode 100644
index 3929f1c9e4e5..000000000000
--- a/arch/arm/mach-at91/board-at572d940hf_ek.c
+++ /dev/null
@@ -1,326 +0,0 @@
1/*
2 * linux/arch/arm/mach-at91/board-at572d940hf_ek.c
3 *
4 * Copyright (C) 2008 Atmel Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2005 SAN People
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/types.h>
23#include <linux/init.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/platform_device.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/ds1305.h>
29#include <linux/irq.h>
30#include <linux/mtd/physmap.h>
31
32#include <mach/hardware.h>
33#include <asm/setup.h>
34#include <asm/mach-types.h>
35#include <asm/irq.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/irq.h>
40
41#include <mach/board.h>
42#include <mach/gpio.h>
43#include <mach/at91sam9_smc.h>
44
45#include "sam9_smc.h"
46#include "generic.h"
47
48
49static void __init eb_map_io(void)
50{
51 /* Initialize processor: 12.500 MHz crystal */
52 at572d940hf_initialize(12000000);
53
54 /* DBGU on ttyS0. (Rx & Tx only) */
55 at91_register_uart(0, 0, 0);
56
57 /* USART0 on ttyS1. (Rx & Tx only) */
58 at91_register_uart(AT572D940HF_ID_US0, 1, 0);
59
60 /* USART1 on ttyS2. (Rx & Tx only) */
61 at91_register_uart(AT572D940HF_ID_US1, 2, 0);
62
63 /* USART2 on ttyS3. (Tx & Rx only */
64 at91_register_uart(AT572D940HF_ID_US2, 3, 0);
65
66 /* set serial console to ttyS0 (ie, DBGU) */
67 at91_set_serial_console(0);
68}
69
70static void __init eb_init_irq(void)
71{
72 at572d940hf_init_interrupts(NULL);
73}
74
75
76/*
77 * USB Host Port
78 */
79static struct at91_usbh_data __initdata eb_usbh_data = {
80 .ports = 2,
81};
82
83
84/*
85 * USB Device Port
86 */
87static struct at91_udc_data __initdata eb_udc_data = {
88 .vbus_pin = 0, /* no VBUS detection,UDC always on */
89 .pullup_pin = 0, /* pull-up driven by UDC */
90};
91
92
93/*
94 * MCI (SD/MMC)
95 */
96static struct at91_mmc_data __initdata eb_mmc_data = {
97 .wire4 = 1,
98/* .det_pin = ... not connected */
99/* .wp_pin = ... not connected */
100/* .vcc_pin = ... not connected */
101};
102
103
104/*
105 * MACB Ethernet device
106 */
107static struct at91_eth_data __initdata eb_eth_data = {
108 .phy_irq_pin = AT91_PIN_PB25,
109 .is_rmii = 1,
110};
111
112/*
113 * NOR flash
114 */
115
116static struct mtd_partition eb_nor_partitions[] = {
117 {
118 .name = "Raw Environment",
119 .offset = 0,
120 .size = SZ_4M,
121 .mask_flags = 0,
122 },
123 {
124 .name = "OS FS",
125 .offset = MTDPART_OFS_APPEND,
126 .size = 3 * SZ_1M,
127 .mask_flags = 0,
128 },
129 {
130 .name = "APP FS",
131 .offset = MTDPART_OFS_APPEND,
132 .size = MTDPART_SIZ_FULL,
133 .mask_flags = 0,
134 },
135};
136
137static void nor_flash_set_vpp(struct map_info* mi, int i) {
138};
139
140static struct physmap_flash_data nor_flash_data = {
141 .width = 4,
142 .parts = eb_nor_partitions,
143 .nr_parts = ARRAY_SIZE(eb_nor_partitions),
144 .set_vpp = nor_flash_set_vpp,
145};
146
147static struct resource nor_flash_resources[] = {
148 {
149 .start = AT91_CHIPSELECT_0,
150 .end = AT91_CHIPSELECT_0 + SZ_16M - 1,
151 .flags = IORESOURCE_MEM,
152 },
153};
154
155static struct platform_device nor_flash = {
156 .name = "physmap-flash",
157 .id = 0,
158 .dev = {
159 .platform_data = &nor_flash_data,
160 },
161 .resource = nor_flash_resources,
162 .num_resources = ARRAY_SIZE(nor_flash_resources),
163};
164
165static struct sam9_smc_config __initdata eb_nor_smc_config = {
166 .ncs_read_setup = 1,
167 .nrd_setup = 1,
168 .ncs_write_setup = 1,
169 .nwe_setup = 1,
170
171 .ncs_read_pulse = 7,
172 .nrd_pulse = 7,
173 .ncs_write_pulse = 7,
174 .nwe_pulse = 7,
175
176 .read_cycle = 9,
177 .write_cycle = 9,
178
179 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_32,
180 .tdf_cycles = 1,
181};
182
183static void __init eb_add_device_nor(void)
184{
185 /* configure chip-select 0 (NOR) */
186 sam9_smc_configure(0, &eb_nor_smc_config);
187 platform_device_register(&nor_flash);
188}
189
190/*
191 * NAND flash
192 */
193static struct mtd_partition __initdata eb_nand_partition[] = {
194 {
195 .name = "Partition 1",
196 .offset = 0,
197 .size = SZ_16M,
198 },
199 {
200 .name = "Partition 2",
201 .offset = MTDPART_OFS_NXTBLK,
202 .size = MTDPART_SIZ_FULL,
203 }
204};
205
206static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
207{
208 *num_partitions = ARRAY_SIZE(eb_nand_partition);
209 return eb_nand_partition;
210}
211
212static struct atmel_nand_data __initdata eb_nand_data = {
213 .ale = 22,
214 .cle = 21,
215/* .det_pin = ... not connected */
216/* .rdy_pin = AT91_PIN_PC16, */
217 .enable_pin = AT91_PIN_PA15,
218 .partition_info = nand_partitions,
219#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
220 .bus_width_16 = 1,
221#else
222 .bus_width_16 = 0,
223#endif
224};
225
226static struct sam9_smc_config __initdata eb_nand_smc_config = {
227 .ncs_read_setup = 0,
228 .nrd_setup = 0,
229 .ncs_write_setup = 1,
230 .nwe_setup = 1,
231
232 .ncs_read_pulse = 3,
233 .nrd_pulse = 3,
234 .ncs_write_pulse = 3,
235 .nwe_pulse = 3,
236
237 .read_cycle = 5,
238 .write_cycle = 5,
239
240 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
241 .tdf_cycles = 12,
242};
243
244static void __init eb_add_device_nand(void)
245{
246 /* setup bus-width (8 or 16) */
247 if (eb_nand_data.bus_width_16)
248 eb_nand_smc_config.mode |= AT91_SMC_DBW_16;
249 else
250 eb_nand_smc_config.mode |= AT91_SMC_DBW_8;
251
252 /* configure chip-select 3 (NAND) */
253 sam9_smc_configure(3, &eb_nand_smc_config);
254
255 at91_add_device_nand(&eb_nand_data);
256}
257
258
259/*
260 * SPI devices
261 */
262static struct resource rtc_resources[] = {
263 [0] = {
264 .start = AT572D940HF_ID_IRQ1,
265 .end = AT572D940HF_ID_IRQ1,
266 .flags = IORESOURCE_IRQ,
267 },
268};
269
270static struct ds1305_platform_data ds1306_data = {
271 .is_ds1306 = true,
272 .en_1hz = false,
273};
274
275static struct spi_board_info eb_spi_devices[] = {
276 { /* RTC Dallas DS1306 */
277 .modalias = "rtc-ds1305",
278 .chip_select = 3,
279 .mode = SPI_CS_HIGH | SPI_CPOL | SPI_CPHA,
280 .max_speed_hz = 500000,
281 .bus_num = 0,
282 .irq = AT572D940HF_ID_IRQ1,
283 .platform_data = (void *) &ds1306_data,
284 },
285#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
286 { /* Dataflash card */
287 .modalias = "mtd_dataflash",
288 .chip_select = 0,
289 .max_speed_hz = 15 * 1000 * 1000,
290 .bus_num = 0,
291 },
292#endif
293};
294
295static void __init eb_board_init(void)
296{
297 /* Serial */
298 at91_add_device_serial();
299 /* USB Host */
300 at91_add_device_usbh(&eb_usbh_data);
301 /* USB Device */
302 at91_add_device_udc(&eb_udc_data);
303 /* I2C */
304 at91_add_device_i2c(NULL, 0);
305 /* NOR */
306 eb_add_device_nor();
307 /* NAND */
308 eb_add_device_nand();
309 /* SPI */
310 at91_add_device_spi(eb_spi_devices, ARRAY_SIZE(eb_spi_devices));
311 /* MMC */
312 at91_add_device_mmc(0, &eb_mmc_data);
313 /* Ethernet */
314 at91_add_device_eth(&eb_eth_data);
315 /* mAgic */
316 at91_add_device_mAgic();
317}
318
319MACHINE_START(AT572D940HFEB, "Atmel AT91D940HF-EB")
320 /* Maintainer: Atmel <costa.antonior@gmail.com> */
321 .boot_params = AT91_SDRAM_BASE + 0x100,
322 .timer = &at91sam926x_timer,
323 .map_io = eb_map_io,
324 .init_irq = eb_init_irq,
325 .init_machine = eb_board_init,
326MACHINE_END
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index b54e3e6fceb6..148fccb9a25a 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -45,7 +45,7 @@
45#include "generic.h" 45#include "generic.h"
46 46
47 47
48static void __init cam60_map_io(void) 48static void __init cam60_init_early(void)
49{ 49{
50 /* Initialize processor: 10 MHz crystal */ 50 /* Initialize processor: 10 MHz crystal */
51 at91sam9260_initialize(10000000); 51 at91sam9260_initialize(10000000);
@@ -198,9 +198,9 @@ static void __init cam60_board_init(void)
198 198
199MACHINE_START(CAM60, "KwikByte CAM60") 199MACHINE_START(CAM60, "KwikByte CAM60")
200 /* Maintainer: KwikByte */ 200 /* Maintainer: KwikByte */
201 .boot_params = AT91_SDRAM_BASE + 0x100,
202 .timer = &at91sam926x_timer, 201 .timer = &at91sam926x_timer,
203 .map_io = cam60_map_io, 202 .map_io = at91sam9260_map_io,
203 .init_early = cam60_init_early,
204 .init_irq = cam60_init_irq, 204 .init_irq = cam60_init_irq,
205 .init_machine = cam60_board_init, 205 .init_machine = cam60_board_init,
206MACHINE_END 206MACHINE_END
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index e7274440ead9..1904fdf87613 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -44,12 +44,13 @@
44#include <mach/gpio.h> 44#include <mach/gpio.h>
45#include <mach/at91cap9_matrix.h> 45#include <mach/at91cap9_matrix.h>
46#include <mach/at91sam9_smc.h> 46#include <mach/at91sam9_smc.h>
47#include <mach/system_rev.h>
47 48
48#include "sam9_smc.h" 49#include "sam9_smc.h"
49#include "generic.h" 50#include "generic.h"
50 51
51 52
52static void __init cap9adk_map_io(void) 53static void __init cap9adk_init_early(void)
53{ 54{
54 /* Initialize processor: 12 MHz crystal */ 55 /* Initialize processor: 12 MHz crystal */
55 at91cap9_initialize(12000000); 56 at91cap9_initialize(12000000);
@@ -187,11 +188,6 @@ static struct atmel_nand_data __initdata cap9adk_nand_data = {
187// .rdy_pin = ... not connected 188// .rdy_pin = ... not connected
188 .enable_pin = AT91_PIN_PD15, 189 .enable_pin = AT91_PIN_PD15,
189 .partition_info = nand_partitions, 190 .partition_info = nand_partitions,
190#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
191 .bus_width_16 = 1,
192#else
193 .bus_width_16 = 0,
194#endif
195}; 191};
196 192
197static struct sam9_smc_config __initdata cap9adk_nand_smc_config = { 193static struct sam9_smc_config __initdata cap9adk_nand_smc_config = {
@@ -219,6 +215,7 @@ static void __init cap9adk_add_device_nand(void)
219 csa = at91_sys_read(AT91_MATRIX_EBICSA); 215 csa = at91_sys_read(AT91_MATRIX_EBICSA);
220 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); 216 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
221 217
218 cap9adk_nand_data.bus_width_16 = !board_have_nand_8bit();
222 /* setup bus-width (8 or 16) */ 219 /* setup bus-width (8 or 16) */
223 if (cap9adk_nand_data.bus_width_16) 220 if (cap9adk_nand_data.bus_width_16)
224 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16; 221 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -399,9 +396,9 @@ static void __init cap9adk_board_init(void)
399 396
400MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK") 397MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK")
401 /* Maintainer: Stelian Pop <stelian.pop@leadtechdesign.com> */ 398 /* Maintainer: Stelian Pop <stelian.pop@leadtechdesign.com> */
402 .boot_params = AT91_SDRAM_BASE + 0x100,
403 .timer = &at91sam926x_timer, 399 .timer = &at91sam926x_timer,
404 .map_io = cap9adk_map_io, 400 .map_io = at91cap9_map_io,
401 .init_early = cap9adk_init_early,
405 .init_irq = cap9adk_init_irq, 402 .init_irq = cap9adk_init_irq,
406 .init_machine = cap9adk_board_init, 403 .init_machine = cap9adk_board_init,
407MACHINE_END 404MACHINE_END
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index 295e1e77fa60..f36b18687494 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -40,10 +40,10 @@
40#include "generic.h" 40#include "generic.h"
41 41
42 42
43static void __init carmeva_map_io(void) 43static void __init carmeva_init_early(void)
44{ 44{
45 /* Initialize processor: 20.000 MHz crystal */ 45 /* Initialize processor: 20.000 MHz crystal */
46 at91rm9200_initialize(20000000, AT91RM9200_BGA); 46 at91rm9200_initialize(20000000);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 at91_register_uart(0, 0, 0);
@@ -162,9 +162,9 @@ static void __init carmeva_board_init(void)
162 162
163MACHINE_START(CARMEVA, "Carmeva") 163MACHINE_START(CARMEVA, "Carmeva")
164 /* Maintainer: Conitec Datasystems */ 164 /* Maintainer: Conitec Datasystems */
165 .boot_params = AT91_SDRAM_BASE + 0x100,
166 .timer = &at91rm9200_timer, 165 .timer = &at91rm9200_timer,
167 .map_io = carmeva_map_io, 166 .map_io = at91rm9200_map_io,
167 .init_early = carmeva_init_early,
168 .init_irq = carmeva_init_irq, 168 .init_irq = carmeva_init_irq,
169 .init_machine = carmeva_board_init, 169 .init_machine = carmeva_board_init,
170MACHINE_END 170MACHINE_END
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index 3838594578f3..980511084fe4 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -47,7 +47,7 @@
47#include "sam9_smc.h" 47#include "sam9_smc.h"
48#include "generic.h" 48#include "generic.h"
49 49
50static void __init cpu9krea_map_io(void) 50static void __init cpu9krea_init_early(void)
51{ 51{
52 /* Initialize processor: 18.432 MHz crystal */ 52 /* Initialize processor: 18.432 MHz crystal */
53 at91sam9260_initialize(18432000); 53 at91sam9260_initialize(18432000);
@@ -375,9 +375,9 @@ MACHINE_START(CPUAT9260, "Eukrea CPU9260")
375MACHINE_START(CPUAT9G20, "Eukrea CPU9G20") 375MACHINE_START(CPUAT9G20, "Eukrea CPU9G20")
376#endif 376#endif
377 /* Maintainer: Eric Benard - EUKREA Electromatique */ 377 /* Maintainer: Eric Benard - EUKREA Electromatique */
378 .boot_params = AT91_SDRAM_BASE + 0x100,
379 .timer = &at91sam926x_timer, 378 .timer = &at91sam926x_timer,
380 .map_io = cpu9krea_map_io, 379 .map_io = at91sam9260_map_io,
380 .init_early = cpu9krea_init_early,
381 .init_irq = cpu9krea_init_irq, 381 .init_irq = cpu9krea_init_irq,
382 .init_machine = cpu9krea_board_init, 382 .init_machine = cpu9krea_board_init,
383MACHINE_END 383MACHINE_END
diff --git a/arch/arm/mach-at91/board-cpuat91.c b/arch/arm/mach-at91/board-cpuat91.c
index 2f4dd8cdd484..6daabe3907a1 100644
--- a/arch/arm/mach-at91/board-cpuat91.c
+++ b/arch/arm/mach-at91/board-cpuat91.c
@@ -38,6 +38,7 @@
38#include <mach/board.h> 38#include <mach/board.h>
39#include <mach/gpio.h> 39#include <mach/gpio.h>
40#include <mach/at91rm9200_mc.h> 40#include <mach/at91rm9200_mc.h>
41#include <mach/cpu.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
@@ -50,10 +51,13 @@ static struct gpio_led cpuat91_leds[] = {
50 }, 51 },
51}; 52};
52 53
53static void __init cpuat91_map_io(void) 54static void __init cpuat91_init_early(void)
54{ 55{
56 /* Set cpu type: PQFP */
57 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
58
55 /* Initialize processor: 18.432 MHz crystal */ 59 /* Initialize processor: 18.432 MHz crystal */
56 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 60 at91rm9200_initialize(18432000);
57 61
58 /* DBGU on ttyS0. (Rx & Tx only) */ 62 /* DBGU on ttyS0. (Rx & Tx only) */
59 at91_register_uart(0, 0, 0); 63 at91_register_uart(0, 0, 0);
@@ -175,9 +179,9 @@ static void __init cpuat91_board_init(void)
175 179
176MACHINE_START(CPUAT91, "Eukrea") 180MACHINE_START(CPUAT91, "Eukrea")
177 /* Maintainer: Eric Benard - EUKREA Electromatique */ 181 /* Maintainer: Eric Benard - EUKREA Electromatique */
178 .boot_params = AT91_SDRAM_BASE + 0x100,
179 .timer = &at91rm9200_timer, 182 .timer = &at91rm9200_timer,
180 .map_io = cpuat91_map_io, 183 .map_io = at91rm9200_map_io,
184 .init_early = cpuat91_init_early,
181 .init_irq = cpuat91_init_irq, 185 .init_irq = cpuat91_init_irq,
182 .init_machine = cpuat91_board_init, 186 .init_machine = cpuat91_board_init,
183MACHINE_END 187MACHINE_END
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index 464839dc39bd..d98bcec1dfe0 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -43,10 +43,10 @@
43#include "generic.h" 43#include "generic.h"
44 44
45 45
46static void __init csb337_map_io(void) 46static void __init csb337_init_early(void)
47{ 47{
48 /* Initialize processor: 3.6864 MHz crystal */ 48 /* Initialize processor: 3.6864 MHz crystal */
49 at91rm9200_initialize(3686400, AT91RM9200_BGA); 49 at91rm9200_initialize(3686400);
50 50
51 /* Setup the LEDs */ 51 /* Setup the LEDs */
52 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); 52 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
@@ -257,9 +257,9 @@ static void __init csb337_board_init(void)
257 257
258MACHINE_START(CSB337, "Cogent CSB337") 258MACHINE_START(CSB337, "Cogent CSB337")
259 /* Maintainer: Bill Gatliff */ 259 /* Maintainer: Bill Gatliff */
260 .boot_params = AT91_SDRAM_BASE + 0x100,
261 .timer = &at91rm9200_timer, 260 .timer = &at91rm9200_timer,
262 .map_io = csb337_map_io, 261 .map_io = at91rm9200_map_io,
262 .init_early = csb337_init_early,
263 .init_irq = csb337_init_irq, 263 .init_irq = csb337_init_irq,
264 .init_machine = csb337_board_init, 264 .init_machine = csb337_board_init,
265MACHINE_END 265MACHINE_END
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 431688c61412..019aab4e20b0 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -40,10 +40,10 @@
40#include "generic.h" 40#include "generic.h"
41 41
42 42
43static void __init csb637_map_io(void) 43static void __init csb637_init_early(void)
44{ 44{
45 /* Initialize processor: 3.6864 MHz crystal */ 45 /* Initialize processor: 3.6864 MHz crystal */
46 at91rm9200_initialize(3686400, AT91RM9200_BGA); 46 at91rm9200_initialize(3686400);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 at91_register_uart(0, 0, 0);
@@ -138,9 +138,9 @@ static void __init csb637_board_init(void)
138 138
139MACHINE_START(CSB637, "Cogent CSB637") 139MACHINE_START(CSB637, "Cogent CSB637")
140 /* Maintainer: Bill Gatliff */ 140 /* Maintainer: Bill Gatliff */
141 .boot_params = AT91_SDRAM_BASE + 0x100,
142 .timer = &at91rm9200_timer, 141 .timer = &at91rm9200_timer,
143 .map_io = csb637_map_io, 142 .map_io = at91rm9200_map_io,
143 .init_early = csb637_init_early,
144 .init_irq = csb637_init_irq, 144 .init_irq = csb637_init_irq,
145 .init_machine = csb637_board_init, 145 .init_machine = csb637_board_init,
146MACHINE_END 146MACHINE_END
diff --git a/arch/arm/mach-at91/board-eb01.c b/arch/arm/mach-at91/board-eb01.c
index d8df59a3426d..d2023f27c652 100644
--- a/arch/arm/mach-at91/board-eb01.c
+++ b/arch/arm/mach-at91/board-eb01.c
@@ -35,7 +35,7 @@ static void __init at91eb01_init_irq(void)
35 at91x40_init_interrupts(NULL); 35 at91x40_init_interrupts(NULL);
36} 36}
37 37
38static void __init at91eb01_map_io(void) 38static void __init at91eb01_init_early(void)
39{ 39{
40 at91x40_initialize(40000000); 40 at91x40_initialize(40000000);
41} 41}
@@ -43,7 +43,7 @@ static void __init at91eb01_map_io(void)
43MACHINE_START(AT91EB01, "Atmel AT91 EB01") 43MACHINE_START(AT91EB01, "Atmel AT91 EB01")
44 /* Maintainer: Greg Ungerer <gerg@snapgear.com> */ 44 /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
45 .timer = &at91x40_timer, 45 .timer = &at91x40_timer,
46 .init_early = at91eb01_init_early,
46 .init_irq = at91eb01_init_irq, 47 .init_irq = at91eb01_init_irq,
47 .map_io = at91eb01_map_io,
48MACHINE_END 48MACHINE_END
49 49
diff --git a/arch/arm/mach-at91/board-eb9200.c b/arch/arm/mach-at91/board-eb9200.c
index 6cf6566ae346..e9484535cbc8 100644
--- a/arch/arm/mach-at91/board-eb9200.c
+++ b/arch/arm/mach-at91/board-eb9200.c
@@ -40,10 +40,10 @@
40#include "generic.h" 40#include "generic.h"
41 41
42 42
43static void __init eb9200_map_io(void) 43static void __init eb9200_init_early(void)
44{ 44{
45 /* Initialize processor: 18.432 MHz crystal */ 45 /* Initialize processor: 18.432 MHz crystal */
46 at91rm9200_initialize(18432000, AT91RM9200_BGA); 46 at91rm9200_initialize(18432000);
47 47
48 /* DBGU on ttyS0. (Rx & Tx only) */ 48 /* DBGU on ttyS0. (Rx & Tx only) */
49 at91_register_uart(0, 0, 0); 49 at91_register_uart(0, 0, 0);
@@ -120,9 +120,9 @@ static void __init eb9200_board_init(void)
120} 120}
121 121
122MACHINE_START(ATEB9200, "Embest ATEB9200") 122MACHINE_START(ATEB9200, "Embest ATEB9200")
123 .boot_params = AT91_SDRAM_BASE + 0x100,
124 .timer = &at91rm9200_timer, 123 .timer = &at91rm9200_timer,
125 .map_io = eb9200_map_io, 124 .map_io = at91rm9200_map_io,
125 .init_early = eb9200_init_early,
126 .init_irq = eb9200_init_irq, 126 .init_irq = eb9200_init_irq,
127 .init_machine = eb9200_board_init, 127 .init_machine = eb9200_board_init,
128MACHINE_END 128MACHINE_END
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index de2fd04e7c8a..a6f57faa10a7 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -38,14 +38,18 @@
38 38
39#include <mach/board.h> 39#include <mach/board.h>
40#include <mach/gpio.h> 40#include <mach/gpio.h>
41#include <mach/cpu.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
44 45
45static void __init ecb_at91map_io(void) 46static void __init ecb_at91init_early(void)
46{ 47{
48 /* Set cpu type: PQFP */
49 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
50
47 /* Initialize processor: 18.432 MHz crystal */ 51 /* Initialize processor: 18.432 MHz crystal */
48 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 52 at91rm9200_initialize(18432000);
49 53
50 /* Setup the LEDs */ 54 /* Setup the LEDs */
51 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7); 55 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
@@ -168,9 +172,9 @@ static void __init ecb_at91board_init(void)
168 172
169MACHINE_START(ECBAT91, "emQbit's ECB_AT91") 173MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
170 /* Maintainer: emQbit.com */ 174 /* Maintainer: emQbit.com */
171 .boot_params = AT91_SDRAM_BASE + 0x100,
172 .timer = &at91rm9200_timer, 175 .timer = &at91rm9200_timer,
173 .map_io = ecb_at91map_io, 176 .map_io = at91rm9200_map_io,
177 .init_early = ecb_at91init_early,
174 .init_irq = ecb_at91init_irq, 178 .init_irq = ecb_at91init_irq,
175 .init_machine = ecb_at91board_init, 179 .init_machine = ecb_at91board_init,
176MACHINE_END 180MACHINE_END
diff --git a/arch/arm/mach-at91/board-eco920.c b/arch/arm/mach-at91/board-eco920.c
index a158a0ce458f..bfc0062d1483 100644
--- a/arch/arm/mach-at91/board-eco920.c
+++ b/arch/arm/mach-at91/board-eco920.c
@@ -26,11 +26,16 @@
26 26
27#include <mach/board.h> 27#include <mach/board.h>
28#include <mach/at91rm9200_mc.h> 28#include <mach/at91rm9200_mc.h>
29#include <mach/cpu.h>
30
29#include "generic.h" 31#include "generic.h"
30 32
31static void __init eco920_map_io(void) 33static void __init eco920_init_early(void)
32{ 34{
33 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 35 /* Set cpu type: PQFP */
36 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
37
38 at91rm9200_initialize(18432000);
34 39
35 /* Setup the LEDs */ 40 /* Setup the LEDs */
36 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1); 41 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
@@ -86,21 +91,6 @@ static struct platform_device eco920_flash = {
86 .num_resources = 1, 91 .num_resources = 1,
87}; 92};
88 93
89static struct resource at91_beeper_resources[] = {
90 [0] = {
91 .start = AT91RM9200_BASE_TC3,
92 .end = AT91RM9200_BASE_TC3 + 0x39,
93 .flags = IORESOURCE_MEM,
94 },
95};
96
97static struct platform_device at91_beeper = {
98 .name = "at91_beeper",
99 .id = 0,
100 .resource = at91_beeper_resources,
101 .num_resources = ARRAY_SIZE(at91_beeper_resources),
102};
103
104static struct spi_board_info eco920_spi_devices[] = { 94static struct spi_board_info eco920_spi_devices[] = {
105 { /* CAN controller */ 95 { /* CAN controller */
106 .modalias = "tlv5638", 96 .modalias = "tlv5638",
@@ -139,18 +129,14 @@ static void __init eco920_board_init(void)
139 AT91_SMC_TDF_(1) /* float time */ 129 AT91_SMC_TDF_(1) /* float time */
140 ); 130 );
141 131
142 at91_clock_associate("tc3_clk", &at91_beeper.dev, "at91_beeper");
143 at91_set_B_periph(AT91_PIN_PB6, 0);
144 platform_device_register(&at91_beeper);
145
146 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices)); 132 at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
147} 133}
148 134
149MACHINE_START(ECO920, "eco920") 135MACHINE_START(ECO920, "eco920")
150 /* Maintainer: Sascha Hauer */ 136 /* Maintainer: Sascha Hauer */
151 .boot_params = AT91_SDRAM_BASE + 0x100,
152 .timer = &at91rm9200_timer, 137 .timer = &at91rm9200_timer,
153 .map_io = eco920_map_io, 138 .map_io = at91rm9200_map_io,
139 .init_early = eco920_init_early,
154 .init_irq = eco920_init_irq, 140 .init_irq = eco920_init_irq,
155 .init_machine = eco920_board_init, 141 .init_machine = eco920_board_init,
156MACHINE_END 142MACHINE_END
diff --git a/arch/arm/mach-at91/board-flexibity.c b/arch/arm/mach-at91/board-flexibity.c
index c8a62dc8fa65..466c063b8d21 100644
--- a/arch/arm/mach-at91/board-flexibity.c
+++ b/arch/arm/mach-at91/board-flexibity.c
@@ -37,7 +37,7 @@
37 37
38#include "generic.h" 38#include "generic.h"
39 39
40static void __init flexibity_map_io(void) 40static void __init flexibity_init_early(void)
41{ 41{
42 /* Initialize processor: 18.432 MHz crystal */ 42 /* Initialize processor: 18.432 MHz crystal */
43 at91sam9260_initialize(18432000); 43 at91sam9260_initialize(18432000);
@@ -154,9 +154,9 @@ static void __init flexibity_board_init(void)
154 154
155MACHINE_START(FLEXIBITY, "Flexibity Connect") 155MACHINE_START(FLEXIBITY, "Flexibity Connect")
156 /* Maintainer: Maxim Osipov */ 156 /* Maintainer: Maxim Osipov */
157 .boot_params = AT91_SDRAM_BASE + 0x100,
158 .timer = &at91sam926x_timer, 157 .timer = &at91sam926x_timer,
159 .map_io = flexibity_map_io, 158 .map_io = at91sam9260_map_io,
159 .init_early = flexibity_init_early,
160 .init_irq = flexibity_init_irq, 160 .init_irq = flexibity_init_irq,
161 .init_machine = flexibity_board_init, 161 .init_machine = flexibity_board_init,
162MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c
index dfc7dfe738e4..e2d1dc9eff45 100644
--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59 59
60static void __init foxg20_map_io(void) 60static void __init foxg20_init_early(void)
61{ 61{
62 /* Initialize processor: 18.432 MHz crystal */ 62 /* Initialize processor: 18.432 MHz crystal */
63 at91sam9260_initialize(18432000); 63 at91sam9260_initialize(18432000);
@@ -266,9 +266,9 @@ static void __init foxg20_board_init(void)
266 266
267MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") 267MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20")
268 /* Maintainer: Sergio Tanzilli */ 268 /* Maintainer: Sergio Tanzilli */
269 .boot_params = AT91_SDRAM_BASE + 0x100,
270 .timer = &at91sam926x_timer, 269 .timer = &at91sam926x_timer,
271 .map_io = foxg20_map_io, 270 .map_io = at91sam9260_map_io,
271 .init_early = foxg20_init_early,
272 .init_irq = foxg20_init_irq, 272 .init_irq = foxg20_init_irq,
273 .init_machine = foxg20_board_init, 273 .init_machine = foxg20_board_init,
274MACHINE_END 274MACHINE_END
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index bc28136ee249..1d4f36b3cb27 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -38,9 +38,9 @@
38#include "sam9_smc.h" 38#include "sam9_smc.h"
39#include "generic.h" 39#include "generic.h"
40 40
41static void __init gsia18s_map_io(void) 41static void __init gsia18s_init_early(void)
42{ 42{
43 stamp9g20_map_io(); 43 stamp9g20_init_early();
44 44
45 /* 45 /*
46 * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI). 46 * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI).
@@ -576,9 +576,9 @@ static void __init gsia18s_board_init(void)
576} 576}
577 577
578MACHINE_START(GSIA18S, "GS_IA18_S") 578MACHINE_START(GSIA18S, "GS_IA18_S")
579 .boot_params = AT91_SDRAM_BASE + 0x100,
580 .timer = &at91sam926x_timer, 579 .timer = &at91sam926x_timer,
581 .map_io = gsia18s_map_io, 580 .map_io = at91sam9260_map_io,
581 .init_early = gsia18s_init_early,
582 .init_irq = init_irq, 582 .init_irq = init_irq,
583 .init_machine = gsia18s_board_init, 583 .init_machine = gsia18s_board_init,
584MACHINE_END 584MACHINE_END
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c
index d2e1f4ec1fcc..9b003ff744ba 100644
--- a/arch/arm/mach-at91/board-kafa.c
+++ b/arch/arm/mach-at91/board-kafa.c
@@ -35,14 +35,18 @@
35 35
36#include <mach/board.h> 36#include <mach/board.h>
37#include <mach/gpio.h> 37#include <mach/gpio.h>
38#include <mach/cpu.h>
38 39
39#include "generic.h" 40#include "generic.h"
40 41
41 42
42static void __init kafa_map_io(void) 43static void __init kafa_init_early(void)
43{ 44{
45 /* Set cpu type: PQFP */
46 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
47
44 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
45 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 49 at91rm9200_initialize(18432000);
46 50
47 /* Set up the LEDs */ 51 /* Set up the LEDs */
48 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); 52 at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4);
@@ -94,9 +98,9 @@ static void __init kafa_board_init(void)
94 98
95MACHINE_START(KAFA, "Sperry-Sun KAFA") 99MACHINE_START(KAFA, "Sperry-Sun KAFA")
96 /* Maintainer: Sergei Sharonov */ 100 /* Maintainer: Sergei Sharonov */
97 .boot_params = AT91_SDRAM_BASE + 0x100,
98 .timer = &at91rm9200_timer, 101 .timer = &at91rm9200_timer,
99 .map_io = kafa_map_io, 102 .map_io = at91rm9200_map_io,
103 .init_early = kafa_init_early,
100 .init_irq = kafa_init_irq, 104 .init_irq = kafa_init_irq,
101 .init_machine = kafa_board_init, 105 .init_machine = kafa_board_init,
102MACHINE_END 106MACHINE_END
diff --git a/arch/arm/mach-at91/board-kb9202.c b/arch/arm/mach-at91/board-kb9202.c
index a13d2063faff..a813a74b65f9 100644
--- a/arch/arm/mach-at91/board-kb9202.c
+++ b/arch/arm/mach-at91/board-kb9202.c
@@ -36,16 +36,19 @@
36 36
37#include <mach/board.h> 37#include <mach/board.h>
38#include <mach/gpio.h> 38#include <mach/gpio.h>
39 39#include <mach/cpu.h>
40#include <mach/at91rm9200_mc.h> 40#include <mach/at91rm9200_mc.h>
41 41
42#include "generic.h" 42#include "generic.h"
43 43
44 44
45static void __init kb9202_map_io(void) 45static void __init kb9202_init_early(void)
46{ 46{
47 /* Set cpu type: PQFP */
48 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
49
47 /* Initialize processor: 10 MHz crystal */ 50 /* Initialize processor: 10 MHz crystal */
48 at91rm9200_initialize(10000000, AT91RM9200_PQFP); 51 at91rm9200_initialize(10000000);
49 52
50 /* Set up the LEDs */ 53 /* Set up the LEDs */
51 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18); 54 at91_init_leds(AT91_PIN_PC19, AT91_PIN_PC18);
@@ -136,9 +139,9 @@ static void __init kb9202_board_init(void)
136 139
137MACHINE_START(KB9200, "KB920x") 140MACHINE_START(KB9200, "KB920x")
138 /* Maintainer: KwikByte, Inc. */ 141 /* Maintainer: KwikByte, Inc. */
139 .boot_params = AT91_SDRAM_BASE + 0x100,
140 .timer = &at91rm9200_timer, 142 .timer = &at91rm9200_timer,
141 .map_io = kb9202_map_io, 143 .map_io = at91rm9200_map_io,
144 .init_early = kb9202_init_early,
142 .init_irq = kb9202_init_irq, 145 .init_irq = kb9202_init_irq,
143 .init_machine = kb9202_board_init, 146 .init_machine = kb9202_board_init,
144MACHINE_END 147MACHINE_END
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index fe5f1d47e6e2..961e805db68c 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -51,7 +51,7 @@
51#include "generic.h" 51#include "generic.h"
52 52
53 53
54static void __init neocore926_map_io(void) 54static void __init neocore926_init_early(void)
55{ 55{
56 /* Initialize processor: 20 MHz crystal */ 56 /* Initialize processor: 20 MHz crystal */
57 at91sam9263_initialize(20000000); 57 at91sam9263_initialize(20000000);
@@ -387,9 +387,9 @@ static void __init neocore926_board_init(void)
387 387
388MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926") 388MACHINE_START(NEOCORE926, "ADENEO NEOCORE 926")
389 /* Maintainer: ADENEO */ 389 /* Maintainer: ADENEO */
390 .boot_params = AT91_SDRAM_BASE + 0x100,
391 .timer = &at91sam926x_timer, 390 .timer = &at91sam926x_timer,
392 .map_io = neocore926_map_io, 391 .map_io = at91sam9263_map_io,
392 .init_early = neocore926_init_early,
393 .init_irq = neocore926_init_irq, 393 .init_irq = neocore926_init_irq,
394 .init_machine = neocore926_board_init, 394 .init_machine = neocore926_board_init,
395MACHINE_END 395MACHINE_END
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index feb65787c30b..21a21af25878 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -37,9 +37,9 @@
37#include "generic.h" 37#include "generic.h"
38 38
39 39
40static void __init pcontrol_g20_map_io(void) 40static void __init pcontrol_g20_init_early(void)
41{ 41{
42 stamp9g20_map_io(); 42 stamp9g20_init_early();
43 43
44 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS) piggyback A2 */ 44 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS) piggyback A2 */
45 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS 45 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS
@@ -222,9 +222,9 @@ static void __init pcontrol_g20_board_init(void)
222 222
223MACHINE_START(PCONTROL_G20, "PControl G20") 223MACHINE_START(PCONTROL_G20, "PControl G20")
224 /* Maintainer: pgsellmann@portner-elektronik.at */ 224 /* Maintainer: pgsellmann@portner-elektronik.at */
225 .boot_params = AT91_SDRAM_BASE + 0x100,
226 .timer = &at91sam926x_timer, 225 .timer = &at91sam926x_timer,
227 .map_io = pcontrol_g20_map_io, 226 .map_io = at91sam9260_map_io,
227 .init_early = pcontrol_g20_init_early,
228 .init_irq = init_irq, 228 .init_irq = init_irq,
229 .init_machine = pcontrol_g20_board_init, 229 .init_machine = pcontrol_g20_board_init,
230MACHINE_END 230MACHINE_END
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index 55dad3a46547..756cc2a745dd 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -43,10 +43,10 @@
43#include "generic.h" 43#include "generic.h"
44 44
45 45
46static void __init picotux200_map_io(void) 46static void __init picotux200_init_early(void)
47{ 47{
48 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
49 at91rm9200_initialize(18432000, AT91RM9200_BGA); 49 at91rm9200_initialize(18432000);
50 50
51 /* DBGU on ttyS0. (Rx & Tx only) */ 51 /* DBGU on ttyS0. (Rx & Tx only) */
52 at91_register_uart(0, 0, 0); 52 at91_register_uart(0, 0, 0);
@@ -123,9 +123,9 @@ static void __init picotux200_board_init(void)
123 123
124MACHINE_START(PICOTUX2XX, "picotux 200") 124MACHINE_START(PICOTUX2XX, "picotux 200")
125 /* Maintainer: Kleinhenz Elektronik GmbH */ 125 /* Maintainer: Kleinhenz Elektronik GmbH */
126 .boot_params = AT91_SDRAM_BASE + 0x100,
127 .timer = &at91rm9200_timer, 126 .timer = &at91rm9200_timer,
128 .map_io = picotux200_map_io, 127 .map_io = at91rm9200_map_io,
128 .init_early = picotux200_init_early,
129 .init_irq = picotux200_init_irq, 129 .init_irq = picotux200_init_irq,
130 .init_machine = picotux200_board_init, 130 .init_machine = picotux200_board_init,
131MACHINE_END 131MACHINE_END
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 69d15a875b66..d1a6001b0bd8 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -48,7 +48,7 @@
48#include "generic.h" 48#include "generic.h"
49 49
50 50
51static void __init ek_map_io(void) 51static void __init ek_init_early(void)
52{ 52{
53 /* Initialize processor: 12.000 MHz crystal */ 53 /* Initialize processor: 12.000 MHz crystal */
54 at91sam9260_initialize(12000000); 54 at91sam9260_initialize(12000000);
@@ -268,9 +268,9 @@ static void __init ek_board_init(void)
268 268
269MACHINE_START(QIL_A9260, "CALAO QIL_A9260") 269MACHINE_START(QIL_A9260, "CALAO QIL_A9260")
270 /* Maintainer: calao-systems */ 270 /* Maintainer: calao-systems */
271 .boot_params = AT91_SDRAM_BASE + 0x100,
272 .timer = &at91sam926x_timer, 271 .timer = &at91sam926x_timer,
273 .map_io = ek_map_io, 272 .map_io = at91sam9260_map_io,
273 .init_early = ek_init_early,
274 .init_irq = ek_init_irq, 274 .init_irq = ek_init_irq,
275 .init_machine = ek_board_init, 275 .init_machine = ek_board_init,
276MACHINE_END 276MACHINE_END
diff --git a/arch/arm/mach-at91/board-rm9200dk.c b/arch/arm/mach-at91/board-rm9200dk.c
index 4c1047c8200d..aef9627710b0 100644
--- a/arch/arm/mach-at91/board-rm9200dk.c
+++ b/arch/arm/mach-at91/board-rm9200dk.c
@@ -45,10 +45,10 @@
45#include "generic.h" 45#include "generic.h"
46 46
47 47
48static void __init dk_map_io(void) 48static void __init dk_init_early(void)
49{ 49{
50 /* Initialize processor: 18.432 MHz crystal */ 50 /* Initialize processor: 18.432 MHz crystal */
51 at91rm9200_initialize(18432000, AT91RM9200_BGA); 51 at91rm9200_initialize(18432000);
52 52
53 /* Setup the LEDs */ 53 /* Setup the LEDs */
54 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 54 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
@@ -227,9 +227,9 @@ static void __init dk_board_init(void)
227 227
228MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK") 228MACHINE_START(AT91RM9200DK, "Atmel AT91RM9200-DK")
229 /* Maintainer: SAN People/Atmel */ 229 /* Maintainer: SAN People/Atmel */
230 .boot_params = AT91_SDRAM_BASE + 0x100,
231 .timer = &at91rm9200_timer, 230 .timer = &at91rm9200_timer,
232 .map_io = dk_map_io, 231 .map_io = at91rm9200_map_io,
232 .init_early = dk_init_early,
233 .init_irq = dk_init_irq, 233 .init_irq = dk_init_irq,
234 .init_machine = dk_board_init, 234 .init_machine = dk_board_init,
235MACHINE_END 235MACHINE_END
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 9df1be8818c0..015a02183080 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -45,10 +45,10 @@
45#include "generic.h" 45#include "generic.h"
46 46
47 47
48static void __init ek_map_io(void) 48static void __init ek_init_early(void)
49{ 49{
50 /* Initialize processor: 18.432 MHz crystal */ 50 /* Initialize processor: 18.432 MHz crystal */
51 at91rm9200_initialize(18432000, AT91RM9200_BGA); 51 at91rm9200_initialize(18432000);
52 52
53 /* Setup the LEDs */ 53 /* Setup the LEDs */
54 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); 54 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
@@ -193,9 +193,9 @@ static void __init ek_board_init(void)
193 193
194MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") 194MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK")
195 /* Maintainer: SAN People/Atmel */ 195 /* Maintainer: SAN People/Atmel */
196 .boot_params = AT91_SDRAM_BASE + 0x100,
197 .timer = &at91rm9200_timer, 196 .timer = &at91rm9200_timer,
198 .map_io = ek_map_io, 197 .map_io = at91rm9200_map_io,
198 .init_early = ek_init_early,
199 .init_irq = ek_init_irq, 199 .init_irq = ek_init_irq,
200 .init_machine = ek_board_init, 200 .init_machine = ek_board_init,
201MACHINE_END 201MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 25a26beaa728..aaf1bf0989b3 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -44,7 +44,7 @@
44#include "generic.h" 44#include "generic.h"
45 45
46 46
47static void __init ek_map_io(void) 47static void __init ek_init_early(void)
48{ 48{
49 /* Initialize processor: 18.432 MHz crystal */ 49 /* Initialize processor: 18.432 MHz crystal */
50 at91sam9260_initialize(18432000); 50 at91sam9260_initialize(18432000);
@@ -212,9 +212,9 @@ static void __init ek_board_init(void)
212 212
213MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260") 213MACHINE_START(SAM9_L9260, "Olimex SAM9-L9260")
214 /* Maintainer: Olimex */ 214 /* Maintainer: Olimex */
215 .boot_params = AT91_SDRAM_BASE + 0x100,
216 .timer = &at91sam926x_timer, 215 .timer = &at91sam926x_timer,
217 .map_io = ek_map_io, 216 .map_io = at91sam9260_map_io,
217 .init_early = ek_init_early,
218 .init_irq = ek_init_irq, 218 .init_irq = ek_init_irq,
219 .init_machine = ek_board_init, 219 .init_machine = ek_board_init,
220MACHINE_END 220MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index de1816e0e1d9..d600dc123227 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -44,12 +44,13 @@
44#include <mach/gpio.h> 44#include <mach/gpio.h>
45#include <mach/at91sam9_smc.h> 45#include <mach/at91sam9_smc.h>
46#include <mach/at91_shdwc.h> 46#include <mach/at91_shdwc.h>
47#include <mach/system_rev.h>
47 48
48#include "sam9_smc.h" 49#include "sam9_smc.h"
49#include "generic.h" 50#include "generic.h"
50 51
51 52
52static void __init ek_map_io(void) 53static void __init ek_init_early(void)
53{ 54{
54 /* Initialize processor: 18.432 MHz crystal */ 55 /* Initialize processor: 18.432 MHz crystal */
55 at91sam9260_initialize(18432000); 56 at91sam9260_initialize(18432000);
@@ -191,11 +192,6 @@ static struct atmel_nand_data __initdata ek_nand_data = {
191 .rdy_pin = AT91_PIN_PC13, 192 .rdy_pin = AT91_PIN_PC13,
192 .enable_pin = AT91_PIN_PC14, 193 .enable_pin = AT91_PIN_PC14,
193 .partition_info = nand_partitions, 194 .partition_info = nand_partitions,
194#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
195 .bus_width_16 = 1,
196#else
197 .bus_width_16 = 0,
198#endif
199}; 195};
200 196
201static struct sam9_smc_config __initdata ek_nand_smc_config = { 197static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -218,6 +214,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
218 214
219static void __init ek_add_device_nand(void) 215static void __init ek_add_device_nand(void)
220{ 216{
217 ek_nand_data.bus_width_16 = !board_have_nand_8bit();
221 /* setup bus-width (8 or 16) */ 218 /* setup bus-width (8 or 16) */
222 if (ek_nand_data.bus_width_16) 219 if (ek_nand_data.bus_width_16)
223 ek_nand_smc_config.mode |= AT91_SMC_DBW_16; 220 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -356,9 +353,9 @@ static void __init ek_board_init(void)
356 353
357MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 354MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
358 /* Maintainer: Atmel */ 355 /* Maintainer: Atmel */
359 .boot_params = AT91_SDRAM_BASE + 0x100,
360 .timer = &at91sam926x_timer, 356 .timer = &at91sam926x_timer,
361 .map_io = ek_map_io, 357 .map_io = at91sam9260_map_io,
358 .init_early = ek_init_early,
362 .init_irq = ek_init_irq, 359 .init_irq = ek_init_irq,
363 .init_machine = ek_board_init, 360 .init_machine = ek_board_init,
364MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 14acc901e24c..f897f84d43dc 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -48,12 +48,13 @@
48#include <mach/gpio.h> 48#include <mach/gpio.h>
49#include <mach/at91sam9_smc.h> 49#include <mach/at91sam9_smc.h>
50#include <mach/at91_shdwc.h> 50#include <mach/at91_shdwc.h>
51#include <mach/system_rev.h>
51 52
52#include "sam9_smc.h" 53#include "sam9_smc.h"
53#include "generic.h" 54#include "generic.h"
54 55
55 56
56static void __init ek_map_io(void) 57static void __init ek_init_early(void)
57{ 58{
58 /* Initialize processor: 18.432 MHz crystal */ 59 /* Initialize processor: 18.432 MHz crystal */
59 at91sam9261_initialize(18432000); 60 at91sam9261_initialize(18432000);
@@ -197,11 +198,6 @@ static struct atmel_nand_data __initdata ek_nand_data = {
197 .rdy_pin = AT91_PIN_PC15, 198 .rdy_pin = AT91_PIN_PC15,
198 .enable_pin = AT91_PIN_PC14, 199 .enable_pin = AT91_PIN_PC14,
199 .partition_info = nand_partitions, 200 .partition_info = nand_partitions,
200#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
201 .bus_width_16 = 1,
202#else
203 .bus_width_16 = 0,
204#endif
205}; 201};
206 202
207static struct sam9_smc_config __initdata ek_nand_smc_config = { 203static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -224,6 +220,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
224 220
225static void __init ek_add_device_nand(void) 221static void __init ek_add_device_nand(void)
226{ 222{
223 ek_nand_data.bus_width_16 = !board_have_nand_8bit();
227 /* setup bus-width (8 or 16) */ 224 /* setup bus-width (8 or 16) */
228 if (ek_nand_data.bus_width_16) 225 if (ek_nand_data.bus_width_16)
229 ek_nand_smc_config.mode |= AT91_SMC_DBW_16; 226 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -623,9 +620,9 @@ MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")
623MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK") 620MACHINE_START(AT91SAM9G10EK, "Atmel AT91SAM9G10-EK")
624#endif 621#endif
625 /* Maintainer: Atmel */ 622 /* Maintainer: Atmel */
626 .boot_params = AT91_SDRAM_BASE + 0x100,
627 .timer = &at91sam926x_timer, 623 .timer = &at91sam926x_timer,
628 .map_io = ek_map_io, 624 .map_io = at91sam9261_map_io,
625 .init_early = ek_init_early,
629 .init_irq = ek_init_irq, 626 .init_irq = ek_init_irq,
630 .init_machine = ek_board_init, 627 .init_machine = ek_board_init,
631MACHINE_END 628MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index bfe490df58be..605b26f40a4c 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -47,12 +47,13 @@
47#include <mach/gpio.h> 47#include <mach/gpio.h>
48#include <mach/at91sam9_smc.h> 48#include <mach/at91sam9_smc.h>
49#include <mach/at91_shdwc.h> 49#include <mach/at91_shdwc.h>
50#include <mach/system_rev.h>
50 51
51#include "sam9_smc.h" 52#include "sam9_smc.h"
52#include "generic.h" 53#include "generic.h"
53 54
54 55
55static void __init ek_map_io(void) 56static void __init ek_init_early(void)
56{ 57{
57 /* Initialize processor: 16.367 MHz crystal */ 58 /* Initialize processor: 16.367 MHz crystal */
58 at91sam9263_initialize(16367660); 59 at91sam9263_initialize(16367660);
@@ -198,11 +199,6 @@ static struct atmel_nand_data __initdata ek_nand_data = {
198 .rdy_pin = AT91_PIN_PA22, 199 .rdy_pin = AT91_PIN_PA22,
199 .enable_pin = AT91_PIN_PD15, 200 .enable_pin = AT91_PIN_PD15,
200 .partition_info = nand_partitions, 201 .partition_info = nand_partitions,
201#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
202 .bus_width_16 = 1,
203#else
204 .bus_width_16 = 0,
205#endif
206}; 202};
207 203
208static struct sam9_smc_config __initdata ek_nand_smc_config = { 204static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -225,6 +221,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
225 221
226static void __init ek_add_device_nand(void) 222static void __init ek_add_device_nand(void)
227{ 223{
224 ek_nand_data.bus_width_16 = !board_have_nand_8bit();
228 /* setup bus-width (8 or 16) */ 225 /* setup bus-width (8 or 16) */
229 if (ek_nand_data.bus_width_16) 226 if (ek_nand_data.bus_width_16)
230 ek_nand_smc_config.mode |= AT91_SMC_DBW_16; 227 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -454,9 +451,9 @@ static void __init ek_board_init(void)
454 451
455MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") 452MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
456 /* Maintainer: Atmel */ 453 /* Maintainer: Atmel */
457 .boot_params = AT91_SDRAM_BASE + 0x100,
458 .timer = &at91sam926x_timer, 454 .timer = &at91sam926x_timer,
459 .map_io = ek_map_io, 455 .map_io = at91sam9263_map_io,
456 .init_early = ek_init_early,
460 .init_irq = ek_init_irq, 457 .init_irq = ek_init_irq,
461 .init_machine = ek_board_init, 458 .init_machine = ek_board_init,
462MACHINE_END 459MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index ca8198b3c168..7624cf0d006b 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -43,6 +43,7 @@
43#include <mach/board.h> 43#include <mach/board.h>
44#include <mach/gpio.h> 44#include <mach/gpio.h>
45#include <mach/at91sam9_smc.h> 45#include <mach/at91sam9_smc.h>
46#include <mach/system_rev.h>
46 47
47#include "sam9_smc.h" 48#include "sam9_smc.h"
48#include "generic.h" 49#include "generic.h"
@@ -60,7 +61,7 @@ static int inline ek_have_2mmc(void)
60} 61}
61 62
62 63
63static void __init ek_map_io(void) 64static void __init ek_init_early(void)
64{ 65{
65 /* Initialize processor: 18.432 MHz crystal */ 66 /* Initialize processor: 18.432 MHz crystal */
66 at91sam9260_initialize(18432000); 67 at91sam9260_initialize(18432000);
@@ -175,11 +176,6 @@ static struct atmel_nand_data __initdata ek_nand_data = {
175 .rdy_pin = AT91_PIN_PC13, 176 .rdy_pin = AT91_PIN_PC13,
176 .enable_pin = AT91_PIN_PC14, 177 .enable_pin = AT91_PIN_PC14,
177 .partition_info = nand_partitions, 178 .partition_info = nand_partitions,
178#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
179 .bus_width_16 = 1,
180#else
181 .bus_width_16 = 0,
182#endif
183}; 179};
184 180
185static struct sam9_smc_config __initdata ek_nand_smc_config = { 181static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -202,6 +198,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
202 198
203static void __init ek_add_device_nand(void) 199static void __init ek_add_device_nand(void)
204{ 200{
201 ek_nand_data.bus_width_16 = !board_have_nand_8bit();
205 /* setup bus-width (8 or 16) */ 202 /* setup bus-width (8 or 16) */
206 if (ek_nand_data.bus_width_16) 203 if (ek_nand_data.bus_width_16)
207 ek_nand_smc_config.mode |= AT91_SMC_DBW_16; 204 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -406,18 +403,18 @@ static void __init ek_board_init(void)
406 403
407MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") 404MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
408 /* Maintainer: Atmel */ 405 /* Maintainer: Atmel */
409 .boot_params = AT91_SDRAM_BASE + 0x100,
410 .timer = &at91sam926x_timer, 406 .timer = &at91sam926x_timer,
411 .map_io = ek_map_io, 407 .map_io = at91sam9260_map_io,
408 .init_early = ek_init_early,
412 .init_irq = ek_init_irq, 409 .init_irq = ek_init_irq,
413 .init_machine = ek_board_init, 410 .init_machine = ek_board_init,
414MACHINE_END 411MACHINE_END
415 412
416MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod") 413MACHINE_START(AT91SAM9G20EK_2MMC, "Atmel AT91SAM9G20-EK 2 MMC Slot Mod")
417 /* Maintainer: Atmel */ 414 /* Maintainer: Atmel */
418 .boot_params = AT91_SDRAM_BASE + 0x100,
419 .timer = &at91sam926x_timer, 415 .timer = &at91sam926x_timer,
420 .map_io = ek_map_io, 416 .map_io = at91sam9260_map_io,
417 .init_early = ek_init_early,
421 .init_irq = ek_init_irq, 418 .init_irq = ek_init_irq,
422 .init_machine = ek_board_init, 419 .init_machine = ek_board_init,
423MACHINE_END 420MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 6c999dbd2bcf..063c95d0e8f0 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -41,12 +41,13 @@
41#include <mach/gpio.h> 41#include <mach/gpio.h>
42#include <mach/at91sam9_smc.h> 42#include <mach/at91sam9_smc.h>
43#include <mach/at91_shdwc.h> 43#include <mach/at91_shdwc.h>
44#include <mach/system_rev.h>
44 45
45#include "sam9_smc.h" 46#include "sam9_smc.h"
46#include "generic.h" 47#include "generic.h"
47 48
48 49
49static void __init ek_map_io(void) 50static void __init ek_init_early(void)
50{ 51{
51 /* Initialize processor: 12.000 MHz crystal */ 52 /* Initialize processor: 12.000 MHz crystal */
52 at91sam9g45_initialize(12000000); 53 at91sam9g45_initialize(12000000);
@@ -155,11 +156,6 @@ static struct atmel_nand_data __initdata ek_nand_data = {
155 .rdy_pin = AT91_PIN_PC8, 156 .rdy_pin = AT91_PIN_PC8,
156 .enable_pin = AT91_PIN_PC14, 157 .enable_pin = AT91_PIN_PC14,
157 .partition_info = nand_partitions, 158 .partition_info = nand_partitions,
158#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
159 .bus_width_16 = 1,
160#else
161 .bus_width_16 = 0,
162#endif
163}; 159};
164 160
165static struct sam9_smc_config __initdata ek_nand_smc_config = { 161static struct sam9_smc_config __initdata ek_nand_smc_config = {
@@ -182,6 +178,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
182 178
183static void __init ek_add_device_nand(void) 179static void __init ek_add_device_nand(void)
184{ 180{
181 ek_nand_data.bus_width_16 = !board_have_nand_8bit();
185 /* setup bus-width (8 or 16) */ 182 /* setup bus-width (8 or 16) */
186 if (ek_nand_data.bus_width_16) 183 if (ek_nand_data.bus_width_16)
187 ek_nand_smc_config.mode |= AT91_SMC_DBW_16; 184 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
@@ -424,9 +421,9 @@ static void __init ek_board_init(void)
424 421
425MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK") 422MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
426 /* Maintainer: Atmel */ 423 /* Maintainer: Atmel */
427 .boot_params = AT91_SDRAM_BASE + 0x100,
428 .timer = &at91sam926x_timer, 424 .timer = &at91sam926x_timer,
429 .map_io = ek_map_io, 425 .map_io = at91sam9g45_map_io,
426 .init_early = ek_init_early,
430 .init_irq = ek_init_irq, 427 .init_irq = ek_init_irq,
431 .init_machine = ek_board_init, 428 .init_machine = ek_board_init,
432MACHINE_END 429MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 3bf3408e94c1..effb399a80a6 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -38,7 +38,7 @@
38#include "generic.h" 38#include "generic.h"
39 39
40 40
41static void __init ek_map_io(void) 41static void __init ek_init_early(void)
42{ 42{
43 /* Initialize processor: 12.000 MHz crystal */ 43 /* Initialize processor: 12.000 MHz crystal */
44 at91sam9rl_initialize(12000000); 44 at91sam9rl_initialize(12000000);
@@ -329,9 +329,9 @@ static void __init ek_board_init(void)
329 329
330MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 330MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
331 /* Maintainer: Atmel */ 331 /* Maintainer: Atmel */
332 .boot_params = AT91_SDRAM_BASE + 0x100,
333 .timer = &at91sam926x_timer, 332 .timer = &at91sam926x_timer,
334 .map_io = ek_map_io, 333 .map_io = at91sam9rl_map_io,
334 .init_early = ek_init_early,
335 .init_irq = ek_init_irq, 335 .init_irq = ek_init_irq,
336 .init_machine = ek_board_init, 336 .init_machine = ek_board_init,
337MACHINE_END 337MACHINE_END
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 17f7d9b32142..3eb0a1153cc8 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -40,7 +40,7 @@
40 40
41#define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x)) 41#define SNAPPER9260_IO_EXP_GPIO(x) (NR_BUILTIN_GPIO + (x))
42 42
43static void __init snapper9260_map_io(void) 43static void __init snapper9260_init_early(void)
44{ 44{
45 at91sam9260_initialize(18432000); 45 at91sam9260_initialize(18432000);
46 46
@@ -178,9 +178,9 @@ static void __init snapper9260_board_init(void)
178} 178}
179 179
180MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module") 180MACHINE_START(SNAPPER_9260, "Bluewater Systems Snapper 9260/9G20 module")
181 .boot_params = AT91_SDRAM_BASE + 0x100,
182 .timer = &at91sam926x_timer, 181 .timer = &at91sam926x_timer,
183 .map_io = snapper9260_map_io, 182 .map_io = at91sam9260_map_io,
183 .init_early = snapper9260_init_early,
184 .init_irq = snapper9260_init_irq, 184 .init_irq = snapper9260_init_irq,
185 .init_machine = snapper9260_board_init, 185 .init_machine = snapper9260_board_init,
186MACHINE_END 186MACHINE_END
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index f8902b118960..5e5c85688f5f 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -32,7 +32,7 @@
32#include "generic.h" 32#include "generic.h"
33 33
34 34
35void __init stamp9g20_map_io(void) 35void __init stamp9g20_init_early(void)
36{ 36{
37 /* Initialize processor: 18.432 MHz crystal */ 37 /* Initialize processor: 18.432 MHz crystal */
38 at91sam9260_initialize(18432000); 38 at91sam9260_initialize(18432000);
@@ -44,9 +44,9 @@ void __init stamp9g20_map_io(void)
44 at91_set_serial_console(0); 44 at91_set_serial_console(0);
45} 45}
46 46
47static void __init stamp9g20evb_map_io(void) 47static void __init stamp9g20evb_init_early(void)
48{ 48{
49 stamp9g20_map_io(); 49 stamp9g20_init_early();
50 50
51 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ 51 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
52 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS 52 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
@@ -54,9 +54,9 @@ static void __init stamp9g20evb_map_io(void)
54 | ATMEL_UART_DCD | ATMEL_UART_RI); 54 | ATMEL_UART_DCD | ATMEL_UART_RI);
55} 55}
56 56
57static void __init portuxg20_map_io(void) 57static void __init portuxg20_init_early(void)
58{ 58{
59 stamp9g20_map_io(); 59 stamp9g20_init_early();
60 60
61 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ 61 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
62 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS 62 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
@@ -298,18 +298,18 @@ static void __init stamp9g20evb_board_init(void)
298 298
299MACHINE_START(PORTUXG20, "taskit PortuxG20") 299MACHINE_START(PORTUXG20, "taskit PortuxG20")
300 /* Maintainer: taskit GmbH */ 300 /* Maintainer: taskit GmbH */
301 .boot_params = AT91_SDRAM_BASE + 0x100,
302 .timer = &at91sam926x_timer, 301 .timer = &at91sam926x_timer,
303 .map_io = portuxg20_map_io, 302 .map_io = at91sam9260_map_io,
303 .init_early = portuxg20_init_early,
304 .init_irq = init_irq, 304 .init_irq = init_irq,
305 .init_machine = portuxg20_board_init, 305 .init_machine = portuxg20_board_init,
306MACHINE_END 306MACHINE_END
307 307
308MACHINE_START(STAMP9G20, "taskit Stamp9G20") 308MACHINE_START(STAMP9G20, "taskit Stamp9G20")
309 /* Maintainer: taskit GmbH */ 309 /* Maintainer: taskit GmbH */
310 .boot_params = AT91_SDRAM_BASE + 0x100,
311 .timer = &at91sam926x_timer, 310 .timer = &at91sam926x_timer,
312 .map_io = stamp9g20evb_map_io, 311 .map_io = at91sam9260_map_io,
312 .init_early = stamp9g20evb_init_early,
313 .init_irq = init_irq, 313 .init_irq = init_irq,
314 .init_machine = stamp9g20evb_board_init, 314 .init_machine = stamp9g20evb_board_init,
315MACHINE_END 315MACHINE_END
diff --git a/arch/arm/mach-at91/board-usb-a9260.c b/arch/arm/mach-at91/board-usb-a9260.c
index 07784baeae84..0e784e6fedec 100644
--- a/arch/arm/mach-at91/board-usb-a9260.c
+++ b/arch/arm/mach-at91/board-usb-a9260.c
@@ -48,7 +48,7 @@
48#include "generic.h" 48#include "generic.h"
49 49
50 50
51static void __init ek_map_io(void) 51static void __init ek_init_early(void)
52{ 52{
53 /* Initialize processor: 12.000 MHz crystal */ 53 /* Initialize processor: 12.000 MHz crystal */
54 at91sam9260_initialize(12000000); 54 at91sam9260_initialize(12000000);
@@ -228,9 +228,9 @@ static void __init ek_board_init(void)
228 228
229MACHINE_START(USB_A9260, "CALAO USB_A9260") 229MACHINE_START(USB_A9260, "CALAO USB_A9260")
230 /* Maintainer: calao-systems */ 230 /* Maintainer: calao-systems */
231 .boot_params = AT91_SDRAM_BASE + 0x100,
232 .timer = &at91sam926x_timer, 231 .timer = &at91sam926x_timer,
233 .map_io = ek_map_io, 232 .map_io = at91sam9260_map_io,
233 .init_early = ek_init_early,
234 .init_irq = ek_init_irq, 234 .init_irq = ek_init_irq,
235 .init_machine = ek_board_init, 235 .init_machine = ek_board_init,
236MACHINE_END 236MACHINE_END
diff --git a/arch/arm/mach-at91/board-usb-a9263.c b/arch/arm/mach-at91/board-usb-a9263.c
index b614508931fd..cf626dd14b2c 100644
--- a/arch/arm/mach-at91/board-usb-a9263.c
+++ b/arch/arm/mach-at91/board-usb-a9263.c
@@ -47,7 +47,7 @@
47#include "generic.h" 47#include "generic.h"
48 48
49 49
50static void __init ek_map_io(void) 50static void __init ek_init_early(void)
51{ 51{
52 /* Initialize processor: 12.00 MHz crystal */ 52 /* Initialize processor: 12.00 MHz crystal */
53 at91sam9263_initialize(12000000); 53 at91sam9263_initialize(12000000);
@@ -244,9 +244,9 @@ static void __init ek_board_init(void)
244 244
245MACHINE_START(USB_A9263, "CALAO USB_A9263") 245MACHINE_START(USB_A9263, "CALAO USB_A9263")
246 /* Maintainer: calao-systems */ 246 /* Maintainer: calao-systems */
247 .boot_params = AT91_SDRAM_BASE + 0x100,
248 .timer = &at91sam926x_timer, 247 .timer = &at91sam926x_timer,
249 .map_io = ek_map_io, 248 .map_io = at91sam9263_map_io,
249 .init_early = ek_init_early,
250 .init_irq = ek_init_irq, 250 .init_irq = ek_init_irq,
251 .init_machine = ek_board_init, 251 .init_machine = ek_board_init,
252MACHINE_END 252MACHINE_END
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index e0f0080eb639..c208cc334d7d 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -45,14 +45,18 @@
45#include <mach/board.h> 45#include <mach/board.h>
46#include <mach/gpio.h> 46#include <mach/gpio.h>
47#include <mach/at91rm9200_mc.h> 47#include <mach/at91rm9200_mc.h>
48#include <mach/cpu.h>
48 49
49#include "generic.h" 50#include "generic.h"
50 51
51 52
52static void __init yl9200_map_io(void) 53static void __init yl9200_init_early(void)
53{ 54{
55 /* Set cpu type: PQFP */
56 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
57
54 /* Initialize processor: 18.432 MHz crystal */ 58 /* Initialize processor: 18.432 MHz crystal */
55 at91rm9200_initialize(18432000, AT91RM9200_PQFP); 59 at91rm9200_initialize(18432000);
56 60
57 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */ 61 /* Setup the LEDs D2=PB17 (timer), D3=PB16 (cpu) */
58 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17); 62 at91_init_leds(AT91_PIN_PB16, AT91_PIN_PB17);
@@ -594,9 +598,9 @@ static void __init yl9200_board_init(void)
594 598
595MACHINE_START(YL9200, "uCdragon YL-9200") 599MACHINE_START(YL9200, "uCdragon YL-9200")
596 /* Maintainer: S.Birtles */ 600 /* Maintainer: S.Birtles */
597 .boot_params = AT91_SDRAM_BASE + 0x100,
598 .timer = &at91rm9200_timer, 601 .timer = &at91rm9200_timer,
599 .map_io = yl9200_map_io, 602 .map_io = at91rm9200_map_io,
603 .init_early = yl9200_init_early,
600 .init_irq = yl9200_init_irq, 604 .init_irq = yl9200_init_irq,
601 .init_machine = yl9200_board_init, 605 .init_machine = yl9200_board_init,
602MACHINE_END 606MACHINE_END
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 9113da6845f1..61873f3aa92d 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -163,7 +163,7 @@ static struct clk udpck = {
163 .parent = &pllb, 163 .parent = &pllb,
164 .mode = pmc_sys_mode, 164 .mode = pmc_sys_mode,
165}; 165};
166static struct clk utmi_clk = { 166struct clk utmi_clk = {
167 .name = "utmi_clk", 167 .name = "utmi_clk",
168 .parent = &main_clk, 168 .parent = &main_clk,
169 .pmc_mask = AT91_PMC_UPLLEN, /* in CKGR_UCKR */ 169 .pmc_mask = AT91_PMC_UPLLEN, /* in CKGR_UCKR */
@@ -182,7 +182,7 @@ static struct clk uhpck = {
182 * memory, interfaces to on-chip peripherals, the AIC, and sometimes more 182 * memory, interfaces to on-chip peripherals, the AIC, and sometimes more
183 * (e.g baud rate generation). It's sourced from one of the primary clocks. 183 * (e.g baud rate generation). It's sourced from one of the primary clocks.
184 */ 184 */
185static struct clk mck = { 185struct clk mck = {
186 .name = "mck", 186 .name = "mck",
187 .pmc_mask = AT91_PMC_MCKRDY, /* in PMC_SR */ 187 .pmc_mask = AT91_PMC_MCKRDY, /* in PMC_SR */
188}; 188};
@@ -215,43 +215,6 @@ static struct clk __init *at91_css_to_clk(unsigned long css)
215 return NULL; 215 return NULL;
216} 216}
217 217
218/*
219 * Associate a particular clock with a function (eg, "uart") and device.
220 * The drivers can then request the same 'function' with several different
221 * devices and not care about which clock name to use.
222 */
223void __init at91_clock_associate(const char *id, struct device *dev, const char *func)
224{
225 struct clk *clk = clk_get(NULL, id);
226
227 if (!dev || !clk || !IS_ERR(clk_get(dev, func)))
228 return;
229
230 clk->function = func;
231 clk->dev = dev;
232}
233
234/* clocks cannot be de-registered no refcounting necessary */
235struct clk *clk_get(struct device *dev, const char *id)
236{
237 struct clk *clk;
238
239 list_for_each_entry(clk, &clocks, node) {
240 if (strcmp(id, clk->name) == 0)
241 return clk;
242 if (clk->function && (dev == clk->dev) && strcmp(id, clk->function) == 0)
243 return clk;
244 }
245
246 return ERR_PTR(-ENOENT);
247}
248EXPORT_SYMBOL(clk_get);
249
250void clk_put(struct clk *clk)
251{
252}
253EXPORT_SYMBOL(clk_put);
254
255static void __clk_enable(struct clk *clk) 218static void __clk_enable(struct clk *clk)
256{ 219{
257 if (clk->parent) 220 if (clk->parent)
@@ -498,32 +461,38 @@ postcore_initcall(at91_clk_debugfs_init);
498/*------------------------------------------------------------------------*/ 461/*------------------------------------------------------------------------*/
499 462
500/* Register a new clock */ 463/* Register a new clock */
464static void __init at91_clk_add(struct clk *clk)
465{
466 list_add_tail(&clk->node, &clocks);
467
468 clk->cl.con_id = clk->name;
469 clk->cl.clk = clk;
470 clkdev_add(&clk->cl);
471}
472
501int __init clk_register(struct clk *clk) 473int __init clk_register(struct clk *clk)
502{ 474{
503 if (clk_is_peripheral(clk)) { 475 if (clk_is_peripheral(clk)) {
504 if (!clk->parent) 476 if (!clk->parent)
505 clk->parent = &mck; 477 clk->parent = &mck;
506 clk->mode = pmc_periph_mode; 478 clk->mode = pmc_periph_mode;
507 list_add_tail(&clk->node, &clocks);
508 } 479 }
509 else if (clk_is_sys(clk)) { 480 else if (clk_is_sys(clk)) {
510 clk->parent = &mck; 481 clk->parent = &mck;
511 clk->mode = pmc_sys_mode; 482 clk->mode = pmc_sys_mode;
512
513 list_add_tail(&clk->node, &clocks);
514 } 483 }
515#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS 484#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
516 else if (clk_is_programmable(clk)) { 485 else if (clk_is_programmable(clk)) {
517 clk->mode = pmc_sys_mode; 486 clk->mode = pmc_sys_mode;
518 init_programmable_clock(clk); 487 init_programmable_clock(clk);
519 list_add_tail(&clk->node, &clocks);
520 } 488 }
521#endif 489#endif
522 490
491 at91_clk_add(clk);
492
523 return 0; 493 return 0;
524} 494}
525 495
526
527/*------------------------------------------------------------------------*/ 496/*------------------------------------------------------------------------*/
528 497
529static u32 __init at91_pll_rate(struct clk *pll, u32 freq, u32 reg) 498static u32 __init at91_pll_rate(struct clk *pll, u32 freq, u32 reg)
@@ -630,7 +599,7 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
630 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); 599 at91_sys_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP);
631 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || 600 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() ||
632 cpu_is_at91sam9263() || cpu_is_at91sam9g20() || 601 cpu_is_at91sam9263() || cpu_is_at91sam9g20() ||
633 cpu_is_at91sam9g10() || cpu_is_at572d940hf()) { 602 cpu_is_at91sam9g10()) {
634 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 603 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
635 udpck.pmc_mask = AT91SAM926x_PMC_UDP; 604 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
636 } else if (cpu_is_at91cap9()) { 605 } else if (cpu_is_at91cap9()) {
@@ -754,19 +723,19 @@ int __init at91_clock_init(unsigned long main_clock)
754 723
755 /* Register the PMC's standard clocks */ 724 /* Register the PMC's standard clocks */
756 for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++) 725 for (i = 0; i < ARRAY_SIZE(standard_pmc_clocks); i++)
757 list_add_tail(&standard_pmc_clocks[i]->node, &clocks); 726 at91_clk_add(standard_pmc_clocks[i]);
758 727
759 if (cpu_has_pllb()) 728 if (cpu_has_pllb())
760 list_add_tail(&pllb.node, &clocks); 729 at91_clk_add(&pllb);
761 730
762 if (cpu_has_uhp()) 731 if (cpu_has_uhp())
763 list_add_tail(&uhpck.node, &clocks); 732 at91_clk_add(&uhpck);
764 733
765 if (cpu_has_udpfs()) 734 if (cpu_has_udpfs())
766 list_add_tail(&udpck.node, &clocks); 735 at91_clk_add(&udpck);
767 736
768 if (cpu_has_utmi()) 737 if (cpu_has_utmi())
769 list_add_tail(&utmi_clk.node, &clocks); 738 at91_clk_add(&utmi_clk);
770 739
771 /* MCK and CPU clock are "always on" */ 740 /* MCK and CPU clock are "always on" */
772 clk_enable(&mck); 741 clk_enable(&mck);
diff --git a/arch/arm/mach-at91/clock.h b/arch/arm/mach-at91/clock.h
index 6cf4b78e175d..c2e63e47dcbe 100644
--- a/arch/arm/mach-at91/clock.h
+++ b/arch/arm/mach-at91/clock.h
@@ -6,6 +6,8 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/clkdev.h>
10
9#define CLK_TYPE_PRIMARY 0x1 11#define CLK_TYPE_PRIMARY 0x1
10#define CLK_TYPE_PLL 0x2 12#define CLK_TYPE_PLL 0x2
11#define CLK_TYPE_PROGRAMMABLE 0x4 13#define CLK_TYPE_PROGRAMMABLE 0x4
@@ -16,8 +18,7 @@
16struct clk { 18struct clk {
17 struct list_head node; 19 struct list_head node;
18 const char *name; /* unique clock name */ 20 const char *name; /* unique clock name */
19 const char *function; /* function of the clock */ 21 struct clk_lookup cl;
20 struct device *dev; /* device associated with function */
21 unsigned long rate_hz; 22 unsigned long rate_hz;
22 struct clk *parent; 23 struct clk *parent;
23 u32 pmc_mask; 24 u32 pmc_mask;
@@ -29,3 +30,18 @@ struct clk {
29 30
30 31
31extern int __init clk_register(struct clk *clk); 32extern int __init clk_register(struct clk *clk);
33extern struct clk mck;
34extern struct clk utmi_clk;
35
36#define CLKDEV_CON_ID(_id, _clk) \
37 { \
38 .con_id = _id, \
39 .clk = _clk, \
40 }
41
42#define CLKDEV_CON_DEV_ID(_con_id, _dev_id, _clk) \
43 { \
44 .con_id = _con_id, \
45 .dev_id = _dev_id, \
46 .clk = _clk, \
47 }
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 0c66deb2db39..8ff3418f3430 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -8,8 +8,21 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/clkdev.h>
12
13 /* Map io */
14extern void __init at91rm9200_map_io(void);
15extern void __init at91sam9260_map_io(void);
16extern void __init at91sam9261_map_io(void);
17extern void __init at91sam9263_map_io(void);
18extern void __init at91sam9rl_map_io(void);
19extern void __init at91sam9g45_map_io(void);
20extern void __init at91x40_map_io(void);
21extern void __init at91cap9_map_io(void);
22
11 /* Processors */ 23 /* Processors */
12extern void __init at91rm9200_initialize(unsigned long main_clock, unsigned short banks); 24extern void __init at91rm9200_set_type(int type);
25extern void __init at91rm9200_initialize(unsigned long main_clock);
13extern void __init at91sam9260_initialize(unsigned long main_clock); 26extern void __init at91sam9260_initialize(unsigned long main_clock);
14extern void __init at91sam9261_initialize(unsigned long main_clock); 27extern void __init at91sam9261_initialize(unsigned long main_clock);
15extern void __init at91sam9263_initialize(unsigned long main_clock); 28extern void __init at91sam9263_initialize(unsigned long main_clock);
@@ -17,7 +30,6 @@ extern void __init at91sam9rl_initialize(unsigned long main_clock);
17extern void __init at91sam9g45_initialize(unsigned long main_clock); 30extern void __init at91sam9g45_initialize(unsigned long main_clock);
18extern void __init at91x40_initialize(unsigned long main_clock); 31extern void __init at91x40_initialize(unsigned long main_clock);
19extern void __init at91cap9_initialize(unsigned long main_clock); 32extern void __init at91cap9_initialize(unsigned long main_clock);
20extern void __init at572d940hf_initialize(unsigned long main_clock);
21 33
22 /* Interrupts */ 34 /* Interrupts */
23extern void __init at91rm9200_init_interrupts(unsigned int priority[]); 35extern void __init at91rm9200_init_interrupts(unsigned int priority[]);
@@ -28,7 +40,6 @@ extern void __init at91sam9rl_init_interrupts(unsigned int priority[]);
28extern void __init at91sam9g45_init_interrupts(unsigned int priority[]); 40extern void __init at91sam9g45_init_interrupts(unsigned int priority[]);
29extern void __init at91x40_init_interrupts(unsigned int priority[]); 41extern void __init at91x40_init_interrupts(unsigned int priority[]);
30extern void __init at91cap9_init_interrupts(unsigned int priority[]); 42extern void __init at91cap9_init_interrupts(unsigned int priority[]);
31extern void __init at572d940hf_init_interrupts(unsigned int priority[]);
32extern void __init at91_aic_init(unsigned int priority[]); 43extern void __init at91_aic_init(unsigned int priority[]);
33 44
34 /* Timer */ 45 /* Timer */
@@ -39,8 +50,19 @@ extern struct sys_timer at91x40_timer;
39 50
40 /* Clocks */ 51 /* Clocks */
41extern int __init at91_clock_init(unsigned long main_clock); 52extern int __init at91_clock_init(unsigned long main_clock);
53/*
54 * function to specify the clock of the default console. As we do not
55 * use the device/driver bus, the dev_name is not intialize. So we need
56 * to link the clock to a specific con_id only "usart"
57 */
58extern void __init at91rm9200_set_console_clock(int id);
59extern void __init at91sam9260_set_console_clock(int id);
60extern void __init at91sam9261_set_console_clock(int id);
61extern void __init at91sam9263_set_console_clock(int id);
62extern void __init at91sam9rl_set_console_clock(int id);
63extern void __init at91sam9g45_set_console_clock(int id);
64extern void __init at91cap9_set_console_clock(int id);
42struct device; 65struct device;
43extern void __init at91_clock_associate(const char *id, struct device *dev, const char *func);
44 66
45 /* Power Management */ 67 /* Power Management */
46extern void at91_irq_suspend(void); 68extern void at91_irq_suspend(void);
diff --git a/arch/arm/mach-at91/include/mach/at572d940hf.h b/arch/arm/mach-at91/include/mach/at572d940hf.h
deleted file mode 100644
index be510cfc56be..000000000000
--- a/arch/arm/mach-at91/include/mach/at572d940hf.h
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * include/mach/at572d940hf.h
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#ifndef AT572D940HF_H
24#define AT572D940HF_H
25
26/*
27 * Peripheral identifiers/interrupts.
28 */
29#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
30#define AT91_ID_SYS 1 /* System Peripherals */
31#define AT572D940HF_ID_PIOA 2 /* Parallel IO Controller A */
32#define AT572D940HF_ID_PIOB 3 /* Parallel IO Controller B */
33#define AT572D940HF_ID_PIOC 4 /* Parallel IO Controller C */
34#define AT572D940HF_ID_EMAC 5 /* MACB ethernet controller */
35#define AT572D940HF_ID_US0 6 /* USART 0 */
36#define AT572D940HF_ID_US1 7 /* USART 1 */
37#define AT572D940HF_ID_US2 8 /* USART 2 */
38#define AT572D940HF_ID_MCI 9 /* Multimedia Card Interface */
39#define AT572D940HF_ID_UDP 10 /* USB Device Port */
40#define AT572D940HF_ID_TWI0 11 /* Two-Wire Interface 0 */
41#define AT572D940HF_ID_SPI0 12 /* Serial Peripheral Interface 0 */
42#define AT572D940HF_ID_SPI1 13 /* Serial Peripheral Interface 1 */
43#define AT572D940HF_ID_SSC0 14 /* Serial Synchronous Controller 0 */
44#define AT572D940HF_ID_SSC1 15 /* Serial Synchronous Controller 1 */
45#define AT572D940HF_ID_SSC2 16 /* Serial Synchronous Controller 2 */
46#define AT572D940HF_ID_TC0 17 /* Timer Counter 0 */
47#define AT572D940HF_ID_TC1 18 /* Timer Counter 1 */
48#define AT572D940HF_ID_TC2 19 /* Timer Counter 2 */
49#define AT572D940HF_ID_UHP 20 /* USB Host port */
50#define AT572D940HF_ID_SSC3 21 /* Serial Synchronous Controller 3 */
51#define AT572D940HF_ID_TWI1 22 /* Two-Wire Interface 1 */
52#define AT572D940HF_ID_CAN0 23 /* CAN Controller 0 */
53#define AT572D940HF_ID_CAN1 24 /* CAN Controller 1 */
54#define AT572D940HF_ID_MHALT 25 /* mAgicV HALT line */
55#define AT572D940HF_ID_MSIRQ0 26 /* mAgicV SIRQ0 line */
56#define AT572D940HF_ID_MEXC 27 /* mAgicV exception line */
57#define AT572D940HF_ID_MEDMA 28 /* mAgicV end of DMA line */
58#define AT572D940HF_ID_IRQ0 29 /* External Interrupt Source (IRQ0) */
59#define AT572D940HF_ID_IRQ1 30 /* External Interrupt Source (IRQ1) */
60#define AT572D940HF_ID_IRQ2 31 /* External Interrupt Source (IRQ2) */
61
62
63/*
64 * User Peripheral physical base addresses.
65 */
66#define AT572D940HF_BASE_TCB 0xfffa0000
67#define AT572D940HF_BASE_TC0 0xfffa0000
68#define AT572D940HF_BASE_TC1 0xfffa0040
69#define AT572D940HF_BASE_TC2 0xfffa0080
70#define AT572D940HF_BASE_UDP 0xfffa4000
71#define AT572D940HF_BASE_MCI 0xfffa8000
72#define AT572D940HF_BASE_TWI0 0xfffac000
73#define AT572D940HF_BASE_US0 0xfffb0000
74#define AT572D940HF_BASE_US1 0xfffb4000
75#define AT572D940HF_BASE_US2 0xfffb8000
76#define AT572D940HF_BASE_SSC0 0xfffbc000
77#define AT572D940HF_BASE_SSC1 0xfffc0000
78#define AT572D940HF_BASE_SSC2 0xfffc4000
79#define AT572D940HF_BASE_SPI0 0xfffc8000
80#define AT572D940HF_BASE_SPI1 0xfffcc000
81#define AT572D940HF_BASE_SSC3 0xfffd0000
82#define AT572D940HF_BASE_TWI1 0xfffd4000
83#define AT572D940HF_BASE_EMAC 0xfffd8000
84#define AT572D940HF_BASE_CAN0 0xfffdc000
85#define AT572D940HF_BASE_CAN1 0xfffe0000
86#define AT91_BASE_SYS 0xffffea00
87
88
89/*
90 * System Peripherals (offset from AT91_BASE_SYS)
91 */
92#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
93#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
94#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
95#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
96#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)
97#define AT91_PIOA (0xfffff400 - AT91_BASE_SYS)
98#define AT91_PIOB (0xfffff600 - AT91_BASE_SYS)
99#define AT91_PIOC (0xfffff800 - AT91_BASE_SYS)
100#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)
101#define AT91_RSTC (0xfffffd00 - AT91_BASE_SYS)
102#define AT91_RTT (0xfffffd20 - AT91_BASE_SYS)
103#define AT91_PIT (0xfffffd30 - AT91_BASE_SYS)
104#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
105
106#define AT91_USART0 AT572D940HF_ID_US0
107#define AT91_USART1 AT572D940HF_ID_US1
108#define AT91_USART2 AT572D940HF_ID_US2
109
110
111/*
112 * Internal Memory.
113 */
114#define AT572D940HF_SRAM_BASE 0x00300000 /* Internal SRAM base address */
115#define AT572D940HF_SRAM_SIZE (48 * SZ_1K) /* Internal SRAM size (48Kb) */
116
117#define AT572D940HF_ROM_BASE 0x00400000 /* Internal ROM base address */
118#define AT572D940HF_ROM_SIZE SZ_32K /* Internal ROM size (32Kb) */
119
120#define AT572D940HF_UHP_BASE 0x00500000 /* USB Host controller */
121
122
123#endif
diff --git a/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h b/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h
deleted file mode 100644
index b6751df09488..000000000000
--- a/arch/arm/mach-at91/include/mach/at572d940hf_matrix.h
+++ /dev/null
@@ -1,123 +0,0 @@
1/*
2 * include/mach//at572d940hf_matrix.h
3 *
4 * Antonio R. Costa <costa.antonior@gmail.com>
5 * Copyright (C) 2008 Atmel
6 *
7 * Copyright (C) 2005 SAN People
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#ifndef AT572D940HF_MATRIX_H
25#define AT572D940HF_MATRIX_H
26
27#define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */
28#define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */
29#define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */
30#define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */
31#define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */
32#define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */
33
34#define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */
35#define AT91_MATRIX_ULBT_INFINITE (0 << 0)
36#define AT91_MATRIX_ULBT_SINGLE (1 << 0)
37#define AT91_MATRIX_ULBT_FOUR (2 << 0)
38#define AT91_MATRIX_ULBT_EIGHT (3 << 0)
39#define AT91_MATRIX_ULBT_SIXTEEN (4 << 0)
40
41#define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */
42#define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */
43#define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */
44#define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */
45#define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */
46#define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */
47#define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */
48#define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16)
49#define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16)
50#define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16)
51#define AT91_MATRIX_FIXED_DEFMSTR (0x7 << 18) /* Fixed Index of Default Master */
52#define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */
53#define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24)
54#define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
55
56#define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */
57#define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */
58#define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */
59#define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */
60#define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */
61
62#define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */
63#define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */
64#define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */
65#define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */
66#define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */
67#define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */
68#define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */
69
70#define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */
71#define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
72#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
73
74#define AT91_MATRIX_SFR0 (AT91_MATRIX + 0x110) /* Special Function Register 0 */
75#define AT91_MATRIX_SFR1 (AT91_MATRIX + 0x114) /* Special Function Register 1 */
76#define AT91_MATRIX_SFR2 (AT91_MATRIX + 0x118) /* Special Function Register 2 */
77#define AT91_MATRIX_SFR3 (AT91_MATRIX + 0x11C) /* Special Function Register 3 */
78#define AT91_MATRIX_SFR4 (AT91_MATRIX + 0x120) /* Special Function Register 4 */
79#define AT91_MATRIX_SFR5 (AT91_MATRIX + 0x124) /* Special Function Register 5 */
80#define AT91_MATRIX_SFR6 (AT91_MATRIX + 0x128) /* Special Function Register 6 */
81#define AT91_MATRIX_SFR7 (AT91_MATRIX + 0x12C) /* Special Function Register 7 */
82#define AT91_MATRIX_SFR8 (AT91_MATRIX + 0x130) /* Special Function Register 8 */
83#define AT91_MATRIX_SFR9 (AT91_MATRIX + 0x134) /* Special Function Register 9 */
84#define AT91_MATRIX_SFR10 (AT91_MATRIX + 0x138) /* Special Function Register 10 */
85#define AT91_MATRIX_SFR11 (AT91_MATRIX + 0x13C) /* Special Function Register 11 */
86#define AT91_MATRIX_SFR12 (AT91_MATRIX + 0x140) /* Special Function Register 12 */
87#define AT91_MATRIX_SFR13 (AT91_MATRIX + 0x144) /* Special Function Register 13 */
88#define AT91_MATRIX_SFR14 (AT91_MATRIX + 0x148) /* Special Function Register 14 */
89#define AT91_MATRIX_SFR15 (AT91_MATRIX + 0x14C) /* Special Function Register 15 */
90
91
92/*
93 * The following registers / bits are not defined in the Datasheet (Revision A)
94 */
95
96#define AT91_MATRIX_TCR (AT91_MATRIX + 0x100) /* TCM Configuration Register */
97#define AT91_MATRIX_ITCM_SIZE (0xf << 0) /* Size of ITCM enabled memory block */
98#define AT91_MATRIX_ITCM_0 (0 << 0)
99#define AT91_MATRIX_ITCM_16 (5 << 0)
100#define AT91_MATRIX_ITCM_32 (6 << 0)
101#define AT91_MATRIX_ITCM_64 (7 << 0)
102#define AT91_MATRIX_DTCM_SIZE (0xf << 4) /* Size of DTCM enabled memory block */
103#define AT91_MATRIX_DTCM_0 (0 << 4)
104#define AT91_MATRIX_DTCM_16 (5 << 4)
105#define AT91_MATRIX_DTCM_32 (6 << 4)
106#define AT91_MATRIX_DTCM_64 (7 << 4)
107
108#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */
109#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */
110#define AT91_MATRIX_CS1A_SMC (0 << 1)
111#define AT91_MATRIX_CS1A_SDRAMC (1 << 1)
112#define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */
113#define AT91_MATRIX_CS3A_SMC (0 << 3)
114#define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
115#define AT91_MATRIX_CS4A (1 << 4) /* Chip Select 4 Assignment */
116#define AT91_MATRIX_CS4A_SMC (0 << 4)
117#define AT91_MATRIX_CS4A_SMC_CF1 (1 << 4)
118#define AT91_MATRIX_CS5A (1 << 5) /* Chip Select 5 Assignment */
119#define AT91_MATRIX_CS5A_SMC (0 << 5)
120#define AT91_MATRIX_CS5A_SMC_CF2 (1 << 5)
121#define AT91_MATRIX_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */
122
123#endif
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h
index 9c6af9737485..665993849a7b 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9.h
@@ -20,8 +20,6 @@
20/* 20/*
21 * Peripheral identifiers/interrupts. 21 * Peripheral identifiers/interrupts.
22 */ 22 */
23#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
24#define AT91_ID_SYS 1 /* System Peripherals */
25#define AT91CAP9_ID_PIOABCD 2 /* Parallel IO Controller A, B, C and D */ 23#define AT91CAP9_ID_PIOABCD 2 /* Parallel IO Controller A, B, C and D */
26#define AT91CAP9_ID_MPB0 3 /* MP Block Peripheral 0 */ 24#define AT91CAP9_ID_MPB0 3 /* MP Block Peripheral 0 */
27#define AT91CAP9_ID_MPB1 4 /* MP Block Peripheral 1 */ 25#define AT91CAP9_ID_MPB1 4 /* MP Block Peripheral 1 */
@@ -123,6 +121,4 @@
123#define AT91CAP9_UDPHS_FIFO 0x00600000 /* USB High Speed Device Port */ 121#define AT91CAP9_UDPHS_FIFO 0x00600000 /* USB High Speed Device Port */
124#define AT91CAP9_UHP_BASE 0x00700000 /* USB Host controller */ 122#define AT91CAP9_UHP_BASE 0x00700000 /* USB Host controller */
125 123
126#define CONFIG_DRAM_BASE AT91_CHIPSELECT_6
127
128#endif 124#endif
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h b/arch/arm/mach-at91/include/mach/at91rm9200.h
index 78983155a074..99e0f8d02d7b 100644
--- a/arch/arm/mach-at91/include/mach/at91rm9200.h
+++ b/arch/arm/mach-at91/include/mach/at91rm9200.h
@@ -19,8 +19,6 @@
19/* 19/*
20 * Peripheral identifiers/interrupts. 20 * Peripheral identifiers/interrupts.
21 */ 21 */
22#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
23#define AT91_ID_SYS 1 /* System Peripheral */
24#define AT91RM9200_ID_PIOA 2 /* Parallel IO Controller A */ 22#define AT91RM9200_ID_PIOA 2 /* Parallel IO Controller A */
25#define AT91RM9200_ID_PIOB 3 /* Parallel IO Controller B */ 23#define AT91RM9200_ID_PIOB 3 /* Parallel IO Controller B */
26#define AT91RM9200_ID_PIOC 4 /* Parallel IO Controller C */ 24#define AT91RM9200_ID_PIOC 4 /* Parallel IO Controller C */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 4e79036d3b80..8b6bf835cd73 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -20,8 +20,6 @@
20/* 20/*
21 * Peripheral identifiers/interrupts. 21 * Peripheral identifiers/interrupts.
22 */ 22 */
23#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
24#define AT91_ID_SYS 1 /* System Peripherals */
25#define AT91SAM9260_ID_PIOA 2 /* Parallel IO Controller A */ 23#define AT91SAM9260_ID_PIOA 2 /* Parallel IO Controller A */
26#define AT91SAM9260_ID_PIOB 3 /* Parallel IO Controller B */ 24#define AT91SAM9260_ID_PIOB 3 /* Parallel IO Controller B */
27#define AT91SAM9260_ID_PIOC 4 /* Parallel IO Controller C */ 25#define AT91SAM9260_ID_PIOC 4 /* Parallel IO Controller C */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index 2b5618518129..eafbddaf523c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -18,8 +18,6 @@
18/* 18/*
19 * Peripheral identifiers/interrupts. 19 * Peripheral identifiers/interrupts.
20 */ 20 */
21#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
22#define AT91_ID_SYS 1 /* System Peripherals */
23#define AT91SAM9261_ID_PIOA 2 /* Parallel IO Controller A */ 21#define AT91SAM9261_ID_PIOA 2 /* Parallel IO Controller A */
24#define AT91SAM9261_ID_PIOB 3 /* Parallel IO Controller B */ 22#define AT91SAM9261_ID_PIOB 3 /* Parallel IO Controller B */
25#define AT91SAM9261_ID_PIOC 4 /* Parallel IO Controller C */ 23#define AT91SAM9261_ID_PIOC 4 /* Parallel IO Controller C */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h
index 2091f1e42d43..e2d348213a7b 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -18,8 +18,6 @@
18/* 18/*
19 * Peripheral identifiers/interrupts. 19 * Peripheral identifiers/interrupts.
20 */ 20 */
21#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
22#define AT91_ID_SYS 1 /* System Peripherals */
23#define AT91SAM9263_ID_PIOA 2 /* Parallel IO Controller A */ 21#define AT91SAM9263_ID_PIOA 2 /* Parallel IO Controller A */
24#define AT91SAM9263_ID_PIOB 3 /* Parallel IO Controller B */ 22#define AT91SAM9263_ID_PIOB 3 /* Parallel IO Controller B */
25#define AT91SAM9263_ID_PIOCDE 4 /* Parallel IO Controller C, D and E */ 23#define AT91SAM9263_ID_PIOCDE 4 /* Parallel IO Controller C, D and E */
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index a526869aee37..659304aa73d9 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -18,8 +18,6 @@
18/* 18/*
19 * Peripheral identifiers/interrupts. 19 * Peripheral identifiers/interrupts.
20 */ 20 */
21#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
22#define AT91_ID_SYS 1 /* System Controller Interrupt */
23#define AT91SAM9G45_ID_PIOA 2 /* Parallel I/O Controller A */ 21#define AT91SAM9G45_ID_PIOA 2 /* Parallel I/O Controller A */
24#define AT91SAM9G45_ID_PIOB 3 /* Parallel I/O Controller B */ 22#define AT91SAM9G45_ID_PIOB 3 /* Parallel I/O Controller B */
25#define AT91SAM9G45_ID_PIOC 4 /* Parallel I/O Controller C */ 23#define AT91SAM9G45_ID_PIOC 4 /* Parallel I/O Controller C */
@@ -131,8 +129,6 @@
131#define AT91SAM9G45_EHCI_BASE 0x00800000 /* USB Host controller (EHCI) */ 129#define AT91SAM9G45_EHCI_BASE 0x00800000 /* USB Host controller (EHCI) */
132#define AT91SAM9G45_VDEC_BASE 0x00900000 /* Video Decoder Controller */ 130#define AT91SAM9G45_VDEC_BASE 0x00900000 /* Video Decoder Controller */
133 131
134#define CONFIG_DRAM_BASE AT91_CHIPSELECT_6
135
136#define CONSISTENT_DMA_SIZE SZ_4M 132#define CONSISTENT_DMA_SIZE SZ_4M
137 133
138/* 134/*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index 87ba8517ad98..41dbbe61055c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -17,8 +17,6 @@
17/* 17/*
18 * Peripheral identifiers/interrupts. 18 * Peripheral identifiers/interrupts.
19 */ 19 */
20#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
21#define AT91_ID_SYS 1 /* System Controller */
22#define AT91SAM9RL_ID_PIOA 2 /* Parallel IO Controller A */ 20#define AT91SAM9RL_ID_PIOA 2 /* Parallel IO Controller A */
23#define AT91SAM9RL_ID_PIOB 3 /* Parallel IO Controller B */ 21#define AT91SAM9RL_ID_PIOB 3 /* Parallel IO Controller B */
24#define AT91SAM9RL_ID_PIOC 4 /* Parallel IO Controller C */ 22#define AT91SAM9RL_ID_PIOC 4 /* Parallel IO Controller C */
diff --git a/arch/arm/mach-at91/include/mach/at91x40.h b/arch/arm/mach-at91/include/mach/at91x40.h
index 063ac44a0204..a152ff87e688 100644
--- a/arch/arm/mach-at91/include/mach/at91x40.h
+++ b/arch/arm/mach-at91/include/mach/at91x40.h
@@ -15,8 +15,6 @@
15/* 15/*
16 * IRQ list. 16 * IRQ list.
17 */ 17 */
18#define AT91_ID_FIQ 0 /* FIQ */
19#define AT91_ID_SYS 1 /* System Peripheral */
20#define AT91X40_ID_USART0 2 /* USART port 0 */ 18#define AT91X40_ID_USART0 2 /* USART port 0 */
21#define AT91X40_ID_USART1 3 /* USART port 1 */ 19#define AT91X40_ID_USART1 3 /* USART port 1 */
22#define AT91X40_ID_TC0 4 /* Timer/Counter 0 */ 20#define AT91X40_ID_TC0 4 /* Timer/Counter 0 */
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 2b499eb343a1..ed544a0d5a1d 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -90,7 +90,7 @@ struct at91_eth_data {
90extern void __init at91_add_device_eth(struct at91_eth_data *data); 90extern void __init at91_add_device_eth(struct at91_eth_data *data);
91 91
92#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \ 92#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91SAM9G20) || defined(CONFIG_ARCH_AT91CAP9) \
93 || defined(CONFIG_ARCH_AT91SAM9G45) || defined(CONFIG_ARCH_AT572D940HF) 93 || defined(CONFIG_ARCH_AT91SAM9G45)
94#define eth_platform_data at91_eth_data 94#define eth_platform_data at91_eth_data
95#endif 95#endif
96 96
@@ -140,6 +140,7 @@ extern void __init at91_set_serial_console(unsigned portnr);
140extern struct platform_device *atmel_default_console_device; 140extern struct platform_device *atmel_default_console_device;
141 141
142struct atmel_uart_data { 142struct atmel_uart_data {
143 int num; /* port num */
143 short use_dma_tx; /* use transmit DMA? */ 144 short use_dma_tx; /* use transmit DMA? */
144 short use_dma_rx; /* use receive DMA? */ 145 short use_dma_rx; /* use receive DMA? */
145 void __iomem *regs; /* virt. base address, if any */ 146 void __iomem *regs; /* virt. base address, if any */
@@ -203,9 +204,6 @@ extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
203extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 204extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
204extern void __init at91_pwm_leds(struct gpio_led *leds, int nr); 205extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
205 206
206 /* AT572D940HF DSP */
207extern void __init at91_add_device_mAgic(void);
208
209/* FIXME: this needs a better location, but gets stuff building again */ 207/* FIXME: this needs a better location, but gets stuff building again */
210extern int at91_suspend_entering_slow_clock(void); 208extern int at91_suspend_entering_slow_clock(void);
211 209
diff --git a/arch/arm/mach-at91/include/mach/clkdev.h b/arch/arm/mach-at91/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0)
6
7#endif
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 0700f2125305..df966c2bc2d4 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -34,8 +34,6 @@
34#define ARCH_ID_AT91SAM9XE256 0x329a93a0 34#define ARCH_ID_AT91SAM9XE256 0x329a93a0
35#define ARCH_ID_AT91SAM9XE512 0x329aa3a0 35#define ARCH_ID_AT91SAM9XE512 0x329aa3a0
36 36
37#define ARCH_ID_AT572D940HF 0x0e0303e0
38
39#define ARCH_ID_AT91M40800 0x14080044 37#define ARCH_ID_AT91M40800 0x14080044
40#define ARCH_ID_AT91R40807 0x44080746 38#define ARCH_ID_AT91R40807 0x44080746
41#define ARCH_ID_AT91M40807 0x14080745 39#define ARCH_ID_AT91M40807 0x14080745
@@ -90,9 +88,16 @@ static inline unsigned long at91cap9_rev_identify(void)
90#endif 88#endif
91 89
92#ifdef CONFIG_ARCH_AT91RM9200 90#ifdef CONFIG_ARCH_AT91RM9200
91extern int rm9200_type;
92#define ARCH_REVISON_9200_BGA (0 << 0)
93#define ARCH_REVISON_9200_PQFP (1 << 0)
93#define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) 94#define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200)
95#define cpu_is_at91rm9200_bga() (!cpu_is_at91rm9200_pqfp())
96#define cpu_is_at91rm9200_pqfp() (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP)
94#else 97#else
95#define cpu_is_at91rm9200() (0) 98#define cpu_is_at91rm9200() (0)
99#define cpu_is_at91rm9200_bga() (0)
100#define cpu_is_at91rm9200_pqfp() (0)
96#endif 101#endif
97 102
98#ifdef CONFIG_ARCH_AT91SAM9260 103#ifdef CONFIG_ARCH_AT91SAM9260
@@ -181,12 +186,6 @@ static inline unsigned long at91cap9_rev_identify(void)
181#define cpu_is_at91cap9_revC() (0) 186#define cpu_is_at91cap9_revC() (0)
182#endif 187#endif
183 188
184#ifdef CONFIG_ARCH_AT572D940HF
185#define cpu_is_at572d940hf() (at91_cpu_identify() == ARCH_ID_AT572D940HF)
186#else
187#define cpu_is_at572d940hf() (0)
188#endif
189
190/* 189/*
191 * Since this is ARM, we will never run on any AVR32 CPU. But these 190 * Since this is ARM, we will never run on any AVR32 CPU. But these
192 * definitions may reduce clutter in common drivers. 191 * 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 3d64a75e3ed5..1008b9fb5074 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -32,13 +32,17 @@
32#include <mach/at91cap9.h> 32#include <mach/at91cap9.h>
33#elif defined(CONFIG_ARCH_AT91X40) 33#elif defined(CONFIG_ARCH_AT91X40)
34#include <mach/at91x40.h> 34#include <mach/at91x40.h>
35#elif defined(CONFIG_ARCH_AT572D940HF)
36#include <mach/at572d940hf.h>
37#else 35#else
38#error "Unsupported AT91 processor" 36#error "Unsupported AT91 processor"
39#endif 37#endif
40 38
41 39
40/*
41 * Peripheral identifiers/interrupts.
42 */
43#define AT91_ID_FIQ 0 /* Advanced Interrupt Controller (FIQ) */
44#define AT91_ID_SYS 1 /* System Peripherals */
45
42#ifdef CONFIG_MMU 46#ifdef CONFIG_MMU
43/* 47/*
44 * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF 48 * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF
@@ -82,13 +86,6 @@
82#define AT91_CHIPSELECT_6 0x70000000 86#define AT91_CHIPSELECT_6 0x70000000
83#define AT91_CHIPSELECT_7 0x80000000 87#define AT91_CHIPSELECT_7 0x80000000
84 88
85/* SDRAM */
86#ifdef CONFIG_DRAM_BASE
87#define AT91_SDRAM_BASE CONFIG_DRAM_BASE
88#else
89#define AT91_SDRAM_BASE AT91_CHIPSELECT_1
90#endif
91
92/* Clocks */ 89/* Clocks */
93#define AT91_SLOW_CLOCK 32768 /* slow clock */ 90#define AT91_SLOW_CLOCK 32768 /* slow clock */
94 91
diff --git a/arch/arm/mach-at91/include/mach/memory.h b/arch/arm/mach-at91/include/mach/memory.h
index c2cfe5040642..401c207f2f39 100644
--- a/arch/arm/mach-at91/include/mach/memory.h
+++ b/arch/arm/mach-at91/include/mach/memory.h
@@ -23,6 +23,4 @@
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25 25
26#define PLAT_PHYS_OFFSET (AT91_SDRAM_BASE)
27
28#endif 26#endif
diff --git a/arch/arm/mach-at91/include/mach/stamp9g20.h b/arch/arm/mach-at91/include/mach/stamp9g20.h
index 6120f9c46d59..f62c0abca4b4 100644
--- a/arch/arm/mach-at91/include/mach/stamp9g20.h
+++ b/arch/arm/mach-at91/include/mach/stamp9g20.h
@@ -1,7 +1,7 @@
1#ifndef __MACH_STAMP9G20_H 1#ifndef __MACH_STAMP9G20_H
2#define __MACH_STAMP9G20_H 2#define __MACH_STAMP9G20_H
3 3
4void stamp9g20_map_io(void); 4void stamp9g20_init_early(void);
5void stamp9g20_board_init(void); 5void stamp9g20_board_init(void);
6 6
7#endif 7#endif
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
new file mode 100644
index 000000000000..b855ee75f72c
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/system_rev.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
3 *
4 * Under GPLv2 only
5 */
6
7#ifndef __ARCH_SYSTEM_REV_H__
8#define __ARCH_SYSTEM_REV_H__
9
10/*
11 * board revision encoding
12 * mach specific
13 * the 16-31 bit are reserved for at91 generic information
14 *
15 * bit 31:
16 * 0 => nand 16 bit
17 * 1 => nand 8 bit
18 */
19#define BOARD_HAVE_NAND_8BIT (1 << 31)
20static int inline board_have_nand_8bit(void)
21{
22 return system_rev & BOARD_HAVE_NAND_8BIT;
23}
24
25#endif /* __ARCH_SYSTEM_REV_H__ */
diff --git a/arch/arm/mach-at91/include/mach/timex.h b/arch/arm/mach-at91/include/mach/timex.h
index 05a6e8af80c4..31ac2d97f14c 100644
--- a/arch/arm/mach-at91/include/mach/timex.h
+++ b/arch/arm/mach-at91/include/mach/timex.h
@@ -82,11 +82,6 @@
82#define AT91X40_MASTER_CLOCK 40000000 82#define AT91X40_MASTER_CLOCK 40000000
83#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK) 83#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK)
84 84
85#elif defined(CONFIG_ARCH_AT572D940HF)
86
87#define AT572D940HF_MASTER_CLOCK 80000000
88#define CLOCK_TICK_RATE (AT572D940HF_MASTER_CLOCK/16)
89
90#endif 85#endif
91 86
92#endif 87#endif
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
index 04c779832c78..4f3572a1c684 100644
--- a/arch/arm/mach-tegra/include/mach/kbc.h
+++ b/arch/arm/mach-tegra/include/mach/kbc.h
@@ -50,13 +50,11 @@ struct tegra_kbc_platform_data {
50 unsigned int debounce_cnt; 50 unsigned int debounce_cnt;
51 unsigned int repeat_cnt; 51 unsigned int repeat_cnt;
52 52
53 unsigned int wake_cnt; /* 0:wake on any key >1:wake on wake_cfg */
54 const struct tegra_kbc_wake_key *wake_cfg;
55
56 struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO]; 53 struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
57 const struct matrix_keymap_data *keymap_data; 54 const struct matrix_keymap_data *keymap_data;
58 55
59 bool wakeup; 56 bool wakeup;
60 bool use_fn_map; 57 bool use_fn_map;
58 bool use_ghost_filter;
61}; 59};
62#endif 60#endif
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 6e1907fa94f0..bb26f40493e6 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -204,7 +204,7 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
204 }, 204 },
205}; 205};
206 206
207#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ 207#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, t_out, _sm) \
208static struct nmk_i2c_controller u8500_i2c##id##_data = { \ 208static struct nmk_i2c_controller u8500_i2c##id##_data = { \
209 /* \ 209 /* \
210 * slave data setup time, which is \ 210 * slave data setup time, which is \
@@ -219,19 +219,21 @@ static struct nmk_i2c_controller u8500_i2c##id##_data = { \
219 .rft = _rft, \ 219 .rft = _rft, \
220 /* std. mode operation */ \ 220 /* std. mode operation */ \
221 .clk_freq = clk, \ 221 .clk_freq = clk, \
222 /* Slave response timeout(ms) */\
223 .timeout = t_out, \
222 .sm = _sm, \ 224 .sm = _sm, \
223} 225}
224 226
225/* 227/*
226 * The board uses 4 i2c controllers, initialize all of 228 * The board uses 4 i2c controllers, initialize all of
227 * them with slave data setup time of 250 ns, 229 * them with slave data setup time of 250 ns,
228 * Tx & Rx FIFO threshold values as 1 and standard 230 * Tx & Rx FIFO threshold values as 8 and standard
229 * mode of operation 231 * mode of operation
230 */ 232 */
231U8500_I2C_CONTROLLER(0, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 233U8500_I2C_CONTROLLER(0, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
232U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 234U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
233U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 235U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
234U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 236U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
235 237
236static void __init mop500_i2c_init(void) 238static void __init mop500_i2c_init(void)
237{ 239{
diff --git a/arch/arm/plat-nomadik/include/plat/i2c.h b/arch/arm/plat-nomadik/include/plat/i2c.h
index 1621db67a53d..8ba70ffc31ec 100644
--- a/arch/arm/plat-nomadik/include/plat/i2c.h
+++ b/arch/arm/plat-nomadik/include/plat/i2c.h
@@ -11,8 +11,8 @@
11enum i2c_freq_mode { 11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */ 12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */ 13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
14 I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */
14 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */ 15 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
15 I2C_FREQ_MODE_HIGH_SPEED /* up to 3.4 Mb/s */
16}; 16};
17 17
18/** 18/**
@@ -24,13 +24,15 @@ enum i2c_freq_mode {
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk 24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes 25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes 26 * @rft: Rx FIFO Threshold in bytes
27 * @timeout Slave response timeout(ms)
27 * @sm: speed mode 28 * @sm: speed mode
28 */ 29 */
29struct nmk_i2c_controller { 30struct nmk_i2c_controller {
30 unsigned long clk_freq; 31 unsigned long clk_freq;
31 unsigned short slsu; 32 unsigned short slsu;
32 unsigned char tft; 33 unsigned char tft;
33 unsigned char rft; 34 unsigned char rft;
35 int timeout;
34 enum i2c_freq_mode sm; 36 enum i2c_freq_mode sm;
35}; 37};
36 38