aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/afeb9260_defconfig1259
-rw-r--r--arch/arm/configs/at91sam9rlek_defconfig1
-rw-r--r--arch/arm/include/asm/byteorder.h25
-rw-r--r--arch/arm/mach-at91/Kconfig22
-rw-r--r--arch/arm/mach-at91/Makefile2
-rw-r--r--arch/arm/mach-at91/at91cap9.c6
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c54
-rw-r--r--arch/arm/mach-at91/at91sam9263.c6
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c53
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c6
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c98
-rw-r--r--arch/arm/mach-at91/board-afeb-9260v1.c210
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c2
-rw-r--r--arch/arm/mach-at91/board-carmeva.c28
-rw-r--r--arch/arm/mach-at91/board-csb337.c12
-rw-r--r--arch/arm/mach-at91/board-csb637.c4
-rw-r--r--arch/arm/mach-at91/board-dk.c4
-rw-r--r--arch/arm/mach-at91/board-ecbat91.c2
-rw-r--r--arch/arm/mach-at91/board-ek.c4
-rw-r--r--arch/arm/mach-at91/board-picotux200.c2
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c14
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c4
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c80
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c18
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c64
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c8
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c8
-rw-r--r--arch/arm/mach-at91/board-usb-a9260.c14
-rw-r--r--arch/arm/mach-at91/board-usb-a9263.c14
-rw-r--r--arch/arm/mach-at91/board-yl-9200.c50
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pit.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91_rstc.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91_rtt.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91_shdwc.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91_wdt.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9260_matrix.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9261_matrix.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_sdramc.h3
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_smc.h3
-rw-r--r--arch/arm/mach-at91/include/mach/board.h14
-rw-r--r--arch/arm/mach-at91/leds.c45
-rw-r--r--arch/arm/mach-at91/pm_slowclock.S283
-rw-r--r--arch/avr32/kernel/asm-offsets.c6
-rw-r--r--arch/avr32/kernel/entry-avr32b.S59
-rw-r--r--arch/avr32/mach-at32ap/pm-at32ap700x.S2
-rw-r--r--arch/ia64/include/asm/sections.h3
-rw-r--r--arch/ia64/kernel/module.c12
-rw-r--r--arch/mips/Kconfig9
-rw-r--r--arch/mips/kernel/setup.c33
-rw-r--r--arch/mips/kernel/traps.c18
-rw-r--r--arch/mips/mm/c-r3k.c1
-rw-r--r--arch/mips/mm/c-r4k.c18
-rw-r--r--arch/mips/mm/c-tx39.c2
-rw-r--r--arch/mips/mm/cache.c1
-rw-r--r--arch/mips/mm/tlbex.c6
-rw-r--r--arch/mips/sgi-ip22/ip22-platform.c2
-rw-r--r--arch/mips/txx9/generic/setup.c1
-rw-r--r--arch/parisc/kernel/module.c14
-rw-r--r--arch/powerpc/Makefile5
-rw-r--r--arch/powerpc/boot/Makefile2
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h6
-rw-r--r--arch/powerpc/include/asm/sections.h3
-rw-r--r--arch/powerpc/kernel/Makefile7
-rw-r--r--arch/powerpc/kernel/align.c2
-rw-r--r--arch/powerpc/kernel/idle_6xx.S2
-rw-r--r--arch/powerpc/kernel/idle_e500.S3
-rw-r--r--arch/powerpc/kernel/module_64.c13
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S7
-rw-r--r--arch/powerpc/mm/hash_utils_64.c18
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c29
-rw-r--r--arch/powerpc/platforms/powermac/Makefile2
-rw-r--r--arch/s390/kernel/compat_ptrace.h1
-rw-r--r--arch/s390/kernel/ptrace.c28
-rw-r--r--arch/sh/configs/ap325rxa_defconfig22
-rw-r--r--arch/sh/configs/migor_defconfig21
-rw-r--r--arch/sh/include/asm/uaccess_64.h2
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S14
-rw-r--r--arch/sh/kernel/entry-common.S27
-rw-r--r--arch/sh/kernel/machine_kexec.c2
-rw-r--r--arch/sh/kernel/ptrace_64.c2
-rw-r--r--arch/sh/kernel/setup.c6
-rw-r--r--arch/sh/kernel/sys_sh.c2
-rw-r--r--arch/sh/mm/consistent.c6
-rw-r--r--arch/sparc64/kernel/irq.c2
-rw-r--r--arch/sparc64/kernel/smp.c14
-rw-r--r--arch/x86/Kconfig.cpu13
-rw-r--r--arch/x86/boot/cpucheck.c8
-rw-r--r--arch/x86/kernel/alternative.c36
-rw-r--r--arch/x86/kernel/cpu/amd.c9
-rw-r--r--arch/x86/kernel/cpu/centaur.c11
-rw-r--r--arch/x86/kernel/cpu/common.c34
-rw-r--r--arch/x86/kernel/cpu/common_64.c74
-rw-r--r--arch/x86/kernel/cpu/cyrix.c32
-rw-r--r--arch/x86/kernel/cpu/feature_names.c3
-rw-r--r--arch/x86/kernel/e820.c2
-rw-r--r--arch/x86/kernel/hpet.c19
-rw-r--r--arch/x86/kernel/io_delay.c8
-rw-r--r--arch/x86/kernel/tsc.c135
-rw-r--r--arch/x86/xen/enlighten.c2
100 files changed, 2876 insertions, 388 deletions
diff --git a/arch/arm/configs/afeb9260_defconfig b/arch/arm/configs/afeb9260_defconfig
new file mode 100644
index 00000000000..ce909586a34
--- /dev/null
+++ b/arch/arm/configs/afeb9260_defconfig
@@ -0,0 +1,1259 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-rc2
4# Tue Aug 12 22:30:16 2008
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30
31#
32# General setup
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y
36CONFIG_LOCK_KERNEL=y
37CONFIG_INIT_ENV_ARG_LIMIT=32
38CONFIG_LOCALVERSION=""
39# CONFIG_LOCALVERSION_AUTO is not set
40CONFIG_SWAP=y
41CONFIG_SYSVIPC=y
42CONFIG_SYSVIPC_SYSCTL=y
43# CONFIG_POSIX_MQUEUE is not set
44# CONFIG_BSD_PROCESS_ACCT is not set
45# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set
47# CONFIG_IKCONFIG is not set
48CONFIG_LOG_BUF_SHIFT=14
49# CONFIG_CGROUPS is not set
50# CONFIG_GROUP_SCHED is not set
51CONFIG_SYSFS_DEPRECATED=y
52CONFIG_SYSFS_DEPRECATED_V2=y
53# CONFIG_RELAY is not set
54CONFIG_NAMESPACES=y
55# CONFIG_UTS_NS is not set
56# CONFIG_IPC_NS is not set
57# CONFIG_USER_NS is not set
58# CONFIG_PID_NS is not set
59CONFIG_BLK_DEV_INITRD=y
60CONFIG_INITRAMFS_SOURCE=""
61CONFIG_CC_OPTIMIZE_FOR_SIZE=y
62CONFIG_SYSCTL=y
63# CONFIG_EMBEDDED is not set
64CONFIG_UID16=y
65CONFIG_SYSCTL_SYSCALL=y
66CONFIG_SYSCTL_SYSCALL_CHECK=y
67CONFIG_KALLSYMS=y
68# CONFIG_KALLSYMS_ALL is not set
69# CONFIG_KALLSYMS_EXTRA_PASS is not set
70CONFIG_HOTPLUG=y
71CONFIG_PRINTK=y
72CONFIG_BUG=y
73CONFIG_ELF_CORE=y
74CONFIG_COMPAT_BRK=y
75CONFIG_BASE_FULL=y
76CONFIG_FUTEX=y
77CONFIG_ANON_INODES=y
78CONFIG_EPOLL=y
79CONFIG_SIGNALFD=y
80CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y
82CONFIG_SHMEM=y
83CONFIG_VM_EVENT_COUNTERS=y
84CONFIG_SLAB=y
85# CONFIG_SLUB is not set
86# CONFIG_SLOB is not set
87# CONFIG_PROFILING is not set
88# CONFIG_MARKERS is not set
89CONFIG_HAVE_OPROFILE=y
90# CONFIG_KPROBES is not set
91# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
92# CONFIG_HAVE_IOREMAP_PROT is not set
93CONFIG_HAVE_KPROBES=y
94CONFIG_HAVE_KRETPROBES=y
95# CONFIG_HAVE_ARCH_TRACEHOOK is not set
96# CONFIG_HAVE_DMA_ATTRS is not set
97# CONFIG_USE_GENERIC_SMP_HELPERS is not set
98CONFIG_HAVE_CLK=y
99CONFIG_PROC_PAGE_MONITOR=y
100CONFIG_HAVE_GENERIC_DMA_COHERENT=y
101CONFIG_SLABINFO=y
102CONFIG_RT_MUTEXES=y
103# CONFIG_TINY_SHMEM is not set
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set
107CONFIG_MODULE_UNLOAD=y
108# CONFIG_MODULE_FORCE_UNLOAD is not set
109# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_KMOD=y
112CONFIG_BLOCK=y
113# CONFIG_LBD is not set
114# CONFIG_BLK_DEV_IO_TRACE is not set
115# CONFIG_LSF is not set
116# CONFIG_BLK_DEV_BSG is not set
117# CONFIG_BLK_DEV_INTEGRITY is not set
118
119#
120# IO Schedulers
121#
122CONFIG_IOSCHED_NOOP=y
123CONFIG_IOSCHED_AS=y
124# CONFIG_IOSCHED_DEADLINE is not set
125# CONFIG_IOSCHED_CFQ is not set
126CONFIG_DEFAULT_AS=y
127# CONFIG_DEFAULT_DEADLINE is not set
128# CONFIG_DEFAULT_CFQ is not set
129# CONFIG_DEFAULT_NOOP is not set
130CONFIG_DEFAULT_IOSCHED="anticipatory"
131CONFIG_CLASSIC_RCU=y
132
133#
134# System Type
135#
136# CONFIG_ARCH_AAEC2000 is not set
137# CONFIG_ARCH_INTEGRATOR is not set
138# CONFIG_ARCH_REALVIEW is not set
139# CONFIG_ARCH_VERSATILE is not set
140CONFIG_ARCH_AT91=y
141# CONFIG_ARCH_CLPS7500 is not set
142# CONFIG_ARCH_CLPS711X is not set
143# CONFIG_ARCH_EBSA110 is not set
144# CONFIG_ARCH_EP93XX is not set
145# CONFIG_ARCH_FOOTBRIDGE is not set
146# CONFIG_ARCH_NETX is not set
147# CONFIG_ARCH_H720X is not set
148# CONFIG_ARCH_IMX is not set
149# CONFIG_ARCH_IOP13XX is not set
150# CONFIG_ARCH_IOP32X is not set
151# CONFIG_ARCH_IOP33X is not set
152# CONFIG_ARCH_IXP23XX is not set
153# CONFIG_ARCH_IXP2000 is not set
154# CONFIG_ARCH_IXP4XX is not set
155# CONFIG_ARCH_L7200 is not set
156# CONFIG_ARCH_KIRKWOOD is not set
157# CONFIG_ARCH_KS8695 is not set
158# CONFIG_ARCH_NS9XXX is not set
159# CONFIG_ARCH_LOKI is not set
160# CONFIG_ARCH_MV78XX0 is not set
161# CONFIG_ARCH_MXC is not set
162# CONFIG_ARCH_ORION5X is not set
163# CONFIG_ARCH_PNX4008 is not set
164# CONFIG_ARCH_PXA is not set
165# CONFIG_ARCH_RPC is not set
166# CONFIG_ARCH_SA1100 is not set
167# CONFIG_ARCH_S3C2410 is not set
168# CONFIG_ARCH_SHARK is not set
169# CONFIG_ARCH_LH7A40X is not set
170# CONFIG_ARCH_DAVINCI is not set
171# CONFIG_ARCH_OMAP is not set
172# CONFIG_ARCH_MSM7X00A is not set
173
174#
175# Boot options
176#
177
178#
179# Power management
180#
181
182#
183# Atmel AT91 System-on-Chip
184#
185# CONFIG_ARCH_AT91RM9200 is not set
186CONFIG_ARCH_AT91SAM9260=y
187# CONFIG_ARCH_AT91SAM9261 is not set
188# CONFIG_ARCH_AT91SAM9263 is not set
189# CONFIG_ARCH_AT91SAM9RL is not set
190# CONFIG_ARCH_AT91SAM9G20 is not set
191# CONFIG_ARCH_AT91CAP9 is not set
192# CONFIG_ARCH_AT91X40 is not set
193CONFIG_AT91_PMC_UNIT=y
194
195#
196# AT91SAM9260 Variants
197#
198# CONFIG_ARCH_AT91SAM9260_SAM9XE is not set
199
200#
201# AT91SAM9260 / AT91SAM9XE Board Type
202#
203# CONFIG_MACH_AT91SAM9260EK is not set
204# CONFIG_MACH_CAM60 is not set
205# CONFIG_MACH_SAM9_L9260 is not set
206CONFIG_MACH_AFEB9260=y
207# CONFIG_MACH_USB_A9260 is not set
208# CONFIG_MACH_QIL_A9260 is not set
209
210#
211# AT91 Board Options
212#
213
214#
215# AT91 Feature Selections
216#
217CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
218CONFIG_AT91_TIMER_HZ=100
219CONFIG_AT91_EARLY_DBGU=y
220# CONFIG_AT91_EARLY_USART0 is not set
221# CONFIG_AT91_EARLY_USART1 is not set
222# CONFIG_AT91_EARLY_USART2 is not set
223# CONFIG_AT91_EARLY_USART3 is not set
224# CONFIG_AT91_EARLY_USART4 is not set
225# CONFIG_AT91_EARLY_USART5 is not set
226
227#
228# Processor Type
229#
230CONFIG_CPU_32=y
231CONFIG_CPU_ARM926T=y
232CONFIG_CPU_32v5=y
233CONFIG_CPU_ABRT_EV5TJ=y
234CONFIG_CPU_PABRT_NOIFAR=y
235CONFIG_CPU_CACHE_VIVT=y
236CONFIG_CPU_COPY_V4WB=y
237CONFIG_CPU_TLB_V4WBI=y
238CONFIG_CPU_CP15=y
239CONFIG_CPU_CP15_MMU=y
240
241#
242# Processor Features
243#
244CONFIG_ARM_THUMB=y
245# CONFIG_CPU_ICACHE_DISABLE is not set
246# CONFIG_CPU_DCACHE_DISABLE is not set
247# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
248# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
249# CONFIG_OUTER_CACHE is not set
250
251#
252# Bus support
253#
254# CONFIG_PCI_SYSCALL is not set
255# CONFIG_ARCH_SUPPORTS_MSI is not set
256# CONFIG_PCCARD is not set
257
258#
259# Kernel Features
260#
261# CONFIG_TICK_ONESHOT is not set
262# CONFIG_NO_HZ is not set
263# CONFIG_HIGH_RES_TIMERS is not set
264CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
265CONFIG_PREEMPT=y
266CONFIG_HZ=100
267CONFIG_AEABI=y
268CONFIG_OABI_COMPAT=y
269# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
270CONFIG_SELECT_MEMORY_MODEL=y
271CONFIG_FLATMEM_MANUAL=y
272# CONFIG_DISCONTIGMEM_MANUAL is not set
273# CONFIG_SPARSEMEM_MANUAL is not set
274CONFIG_FLATMEM=y
275CONFIG_FLAT_NODE_MEM_MAP=y
276# CONFIG_SPARSEMEM_STATIC is not set
277# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
278CONFIG_PAGEFLAGS_EXTENDED=y
279CONFIG_SPLIT_PTLOCK_CPUS=4096
280# CONFIG_RESOURCES_64BIT is not set
281CONFIG_ZONE_DMA_FLAG=1
282CONFIG_BOUNCE=y
283CONFIG_VIRT_TO_BUS=y
284# CONFIG_LEDS is not set
285CONFIG_ALIGNMENT_TRAP=y
286
287#
288# Boot options
289#
290CONFIG_ZBOOT_ROM_TEXT=0x0
291CONFIG_ZBOOT_ROM_BSS=0x0
292CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
293# CONFIG_XIP_KERNEL is not set
294# CONFIG_KEXEC is not set
295
296#
297# Floating point emulation
298#
299
300#
301# At least one emulation must be selected
302#
303CONFIG_FPE_NWFPE=y
304# CONFIG_FPE_NWFPE_XP is not set
305# CONFIG_FPE_FASTFPE is not set
306# CONFIG_VFP is not set
307
308#
309# Userspace binary formats
310#
311CONFIG_BINFMT_ELF=y
312# CONFIG_BINFMT_AOUT is not set
313# CONFIG_BINFMT_MISC is not set
314
315#
316# Power management options
317#
318# CONFIG_PM is not set
319CONFIG_ARCH_SUSPEND_POSSIBLE=y
320CONFIG_NET=y
321
322#
323# Networking options
324#
325CONFIG_PACKET=y
326# CONFIG_PACKET_MMAP is not set
327CONFIG_UNIX=y
328# CONFIG_NET_KEY is not set
329CONFIG_INET=y
330# CONFIG_IP_MULTICAST is not set
331# CONFIG_IP_ADVANCED_ROUTER is not set
332CONFIG_IP_FIB_HASH=y
333CONFIG_IP_PNP=y
334# CONFIG_IP_PNP_DHCP is not set
335CONFIG_IP_PNP_BOOTP=y
336# CONFIG_IP_PNP_RARP is not set
337# CONFIG_NET_IPIP is not set
338# CONFIG_NET_IPGRE is not set
339# CONFIG_ARPD is not set
340# CONFIG_SYN_COOKIES is not set
341# CONFIG_INET_AH is not set
342# CONFIG_INET_ESP is not set
343# CONFIG_INET_IPCOMP is not set
344# CONFIG_INET_XFRM_TUNNEL is not set
345# CONFIG_INET_TUNNEL is not set
346# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
347# CONFIG_INET_XFRM_MODE_TUNNEL is not set
348# CONFIG_INET_XFRM_MODE_BEET is not set
349# CONFIG_INET_LRO is not set
350CONFIG_INET_DIAG=y
351CONFIG_INET_TCP_DIAG=y
352# CONFIG_TCP_CONG_ADVANCED is not set
353CONFIG_TCP_CONG_CUBIC=y
354CONFIG_DEFAULT_TCP_CONG="cubic"
355# CONFIG_TCP_MD5SIG is not set
356# CONFIG_IPV6 is not set
357# CONFIG_NETWORK_SECMARK is not set
358# CONFIG_NETFILTER is not set
359# CONFIG_IP_DCCP is not set
360# CONFIG_IP_SCTP is not set
361# CONFIG_TIPC is not set
362# CONFIG_ATM is not set
363# CONFIG_BRIDGE is not set
364# CONFIG_VLAN_8021Q is not set
365# CONFIG_DECNET is not set
366# CONFIG_LLC2 is not set
367# CONFIG_IPX is not set
368# CONFIG_ATALK is not set
369# CONFIG_X25 is not set
370# CONFIG_LAPB is not set
371# CONFIG_ECONET is not set
372# CONFIG_WAN_ROUTER is not set
373# CONFIG_NET_SCHED is not set
374
375#
376# Network testing
377#
378# CONFIG_NET_PKTGEN is not set
379# CONFIG_HAMRADIO is not set
380# CONFIG_CAN is not set
381# CONFIG_IRDA is not set
382# CONFIG_BT is not set
383# CONFIG_AF_RXRPC is not set
384
385#
386# Wireless
387#
388# CONFIG_CFG80211 is not set
389# CONFIG_WIRELESS_EXT is not set
390# CONFIG_MAC80211 is not set
391# CONFIG_IEEE80211 is not set
392# CONFIG_RFKILL is not set
393# CONFIG_NET_9P is not set
394
395#
396# Device Drivers
397#
398
399#
400# Generic Driver Options
401#
402CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
403CONFIG_STANDALONE=y
404CONFIG_PREVENT_FIRMWARE_BUILD=y
405CONFIG_FW_LOADER=y
406CONFIG_FIRMWARE_IN_KERNEL=y
407CONFIG_EXTRA_FIRMWARE=""
408# CONFIG_DEBUG_DRIVER is not set
409# CONFIG_DEBUG_DEVRES is not set
410# CONFIG_SYS_HYPERVISOR is not set
411# CONFIG_CONNECTOR is not set
412CONFIG_MTD=y
413# CONFIG_MTD_DEBUG is not set
414# CONFIG_MTD_CONCAT is not set
415CONFIG_MTD_PARTITIONS=y
416# CONFIG_MTD_REDBOOT_PARTS is not set
417# CONFIG_MTD_CMDLINE_PARTS is not set
418# CONFIG_MTD_AFS_PARTS is not set
419# CONFIG_MTD_AR7_PARTS is not set
420
421#
422# User Modules And Translation Layers
423#
424CONFIG_MTD_CHAR=y
425CONFIG_MTD_BLKDEVS=y
426CONFIG_MTD_BLOCK=y
427# CONFIG_FTL is not set
428# CONFIG_NFTL is not set
429# CONFIG_INFTL is not set
430# CONFIG_RFD_FTL is not set
431# CONFIG_SSFDC is not set
432# CONFIG_MTD_OOPS is not set
433
434#
435# RAM/ROM/Flash chip drivers
436#
437# CONFIG_MTD_CFI is not set
438# CONFIG_MTD_JEDECPROBE is not set
439CONFIG_MTD_MAP_BANK_WIDTH_1=y
440CONFIG_MTD_MAP_BANK_WIDTH_2=y
441CONFIG_MTD_MAP_BANK_WIDTH_4=y
442# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
443# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
444# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
445CONFIG_MTD_CFI_I1=y
446CONFIG_MTD_CFI_I2=y
447# CONFIG_MTD_CFI_I4 is not set
448# CONFIG_MTD_CFI_I8 is not set
449# CONFIG_MTD_RAM is not set
450# CONFIG_MTD_ROM is not set
451# CONFIG_MTD_ABSENT is not set
452
453#
454# Mapping drivers for chip access
455#
456# CONFIG_MTD_COMPLEX_MAPPINGS is not set
457# CONFIG_MTD_PLATRAM is not set
458
459#
460# Self-contained MTD device drivers
461#
462CONFIG_MTD_DATAFLASH=y
463# CONFIG_MTD_M25P80 is not set
464# CONFIG_MTD_SLRAM is not set
465# CONFIG_MTD_PHRAM is not set
466# CONFIG_MTD_MTDRAM is not set
467# CONFIG_MTD_BLOCK2MTD is not set
468
469#
470# Disk-On-Chip Device Drivers
471#
472# CONFIG_MTD_DOC2000 is not set
473# CONFIG_MTD_DOC2001 is not set
474# CONFIG_MTD_DOC2001PLUS is not set
475CONFIG_MTD_NAND=y
476# CONFIG_MTD_NAND_VERIFY_WRITE is not set
477# CONFIG_MTD_NAND_ECC_SMC is not set
478# CONFIG_MTD_NAND_MUSEUM_IDS is not set
479CONFIG_MTD_NAND_IDS=y
480# CONFIG_MTD_NAND_DISKONCHIP is not set
481CONFIG_MTD_NAND_ATMEL=y
482# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
483CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
484# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
485# CONFIG_MTD_NAND_NANDSIM is not set
486# CONFIG_MTD_NAND_PLATFORM is not set
487# CONFIG_MTD_ALAUDA is not set
488# CONFIG_MTD_ONENAND is not set
489
490#
491# UBI - Unsorted block images
492#
493# CONFIG_MTD_UBI is not set
494# CONFIG_PARPORT is not set
495CONFIG_BLK_DEV=y
496# CONFIG_BLK_DEV_COW_COMMON is not set
497# CONFIG_BLK_DEV_LOOP is not set
498# CONFIG_BLK_DEV_NBD is not set
499# CONFIG_BLK_DEV_UB is not set
500CONFIG_BLK_DEV_RAM=y
501CONFIG_BLK_DEV_RAM_COUNT=16
502CONFIG_BLK_DEV_RAM_SIZE=8192
503# CONFIG_BLK_DEV_XIP is not set
504# CONFIG_CDROM_PKTCDVD is not set
505# CONFIG_ATA_OVER_ETH is not set
506CONFIG_MISC_DEVICES=y
507# CONFIG_ATMEL_PWM is not set
508# CONFIG_ATMEL_TCLIB is not set
509# CONFIG_EEPROM_93CX6 is not set
510CONFIG_ATMEL_SSC=y
511# CONFIG_ENCLOSURE_SERVICES is not set
512CONFIG_HAVE_IDE=y
513# CONFIG_IDE is not set
514
515#
516# SCSI device support
517#
518# CONFIG_RAID_ATTRS is not set
519CONFIG_SCSI=y
520CONFIG_SCSI_DMA=y
521# CONFIG_SCSI_TGT is not set
522# CONFIG_SCSI_NETLINK is not set
523CONFIG_SCSI_PROC_FS=y
524
525#
526# SCSI support type (disk, tape, CD-ROM)
527#
528CONFIG_BLK_DEV_SD=y
529# CONFIG_CHR_DEV_ST is not set
530# CONFIG_CHR_DEV_OSST is not set
531# CONFIG_BLK_DEV_SR is not set
532# CONFIG_CHR_DEV_SG is not set
533# CONFIG_CHR_DEV_SCH is not set
534
535#
536# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
537#
538CONFIG_SCSI_MULTI_LUN=y
539# CONFIG_SCSI_CONSTANTS is not set
540# CONFIG_SCSI_LOGGING is not set
541# CONFIG_SCSI_SCAN_ASYNC is not set
542CONFIG_SCSI_WAIT_SCAN=m
543
544#
545# SCSI Transports
546#
547# CONFIG_SCSI_SPI_ATTRS is not set
548# CONFIG_SCSI_FC_ATTRS is not set
549# CONFIG_SCSI_ISCSI_ATTRS is not set
550# CONFIG_SCSI_SAS_LIBSAS is not set
551# CONFIG_SCSI_SRP_ATTRS is not set
552CONFIG_SCSI_LOWLEVEL=y
553# CONFIG_ISCSI_TCP is not set
554# CONFIG_SCSI_DEBUG is not set
555# CONFIG_SCSI_DH is not set
556# CONFIG_ATA is not set
557# CONFIG_MD is not set
558CONFIG_NETDEVICES=y
559# CONFIG_DUMMY is not set
560# CONFIG_BONDING is not set
561# CONFIG_MACVLAN is not set
562# CONFIG_EQUALIZER is not set
563# CONFIG_TUN is not set
564# CONFIG_VETH is not set
565CONFIG_PHYLIB=y
566
567#
568# MII PHY device drivers
569#
570# CONFIG_MARVELL_PHY is not set
571# CONFIG_DAVICOM_PHY is not set
572# CONFIG_QSEMI_PHY is not set
573# CONFIG_LXT_PHY is not set
574# CONFIG_CICADA_PHY is not set
575# CONFIG_VITESSE_PHY is not set
576# CONFIG_SMSC_PHY is not set
577# CONFIG_BROADCOM_PHY is not set
578# CONFIG_ICPLUS_PHY is not set
579# CONFIG_REALTEK_PHY is not set
580# CONFIG_FIXED_PHY is not set
581# CONFIG_MDIO_BITBANG is not set
582CONFIG_NET_ETHERNET=y
583CONFIG_MII=y
584CONFIG_MACB=y
585# CONFIG_AX88796 is not set
586# CONFIG_SMC91X is not set
587# CONFIG_DM9000 is not set
588# CONFIG_ENC28J60 is not set
589# CONFIG_IBM_NEW_EMAC_ZMII is not set
590# CONFIG_IBM_NEW_EMAC_RGMII is not set
591# CONFIG_IBM_NEW_EMAC_TAH is not set
592# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
593# CONFIG_B44 is not set
594# CONFIG_NETDEV_1000 is not set
595# CONFIG_NETDEV_10000 is not set
596
597#
598# Wireless LAN
599#
600# CONFIG_WLAN_PRE80211 is not set
601# CONFIG_WLAN_80211 is not set
602# CONFIG_IWLWIFI_LEDS is not set
603
604#
605# USB Network Adapters
606#
607# CONFIG_USB_CATC is not set
608# CONFIG_USB_KAWETH is not set
609# CONFIG_USB_PEGASUS is not set
610# CONFIG_USB_RTL8150 is not set
611# CONFIG_USB_USBNET is not set
612# CONFIG_WAN is not set
613# CONFIG_PPP is not set
614# CONFIG_SLIP is not set
615# CONFIG_NETCONSOLE is not set
616# CONFIG_NETPOLL is not set
617# CONFIG_NET_POLL_CONTROLLER is not set
618# CONFIG_ISDN is not set
619
620#
621# Input device support
622#
623CONFIG_INPUT=y
624# CONFIG_INPUT_FF_MEMLESS is not set
625# CONFIG_INPUT_POLLDEV is not set
626
627#
628# Userland interfaces
629#
630CONFIG_INPUT_MOUSEDEV=y
631# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
632CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
633CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
634# CONFIG_INPUT_JOYDEV is not set
635# CONFIG_INPUT_EVDEV is not set
636# CONFIG_INPUT_EVBUG is not set
637
638#
639# Input Device Drivers
640#
641# CONFIG_INPUT_KEYBOARD is not set
642# CONFIG_INPUT_MOUSE is not set
643# CONFIG_INPUT_JOYSTICK is not set
644# CONFIG_INPUT_TABLET is not set
645# CONFIG_INPUT_TOUCHSCREEN is not set
646# CONFIG_INPUT_MISC is not set
647
648#
649# Hardware I/O ports
650#
651# CONFIG_SERIO is not set
652# CONFIG_GAMEPORT is not set
653
654#
655# Character devices
656#
657CONFIG_VT=y
658CONFIG_CONSOLE_TRANSLATIONS=y
659CONFIG_VT_CONSOLE=y
660CONFIG_HW_CONSOLE=y
661# CONFIG_VT_HW_CONSOLE_BINDING is not set
662CONFIG_DEVKMEM=y
663# CONFIG_SERIAL_NONSTANDARD is not set
664
665#
666# Serial drivers
667#
668# CONFIG_SERIAL_8250 is not set
669
670#
671# Non-8250 serial port support
672#
673CONFIG_SERIAL_ATMEL=y
674CONFIG_SERIAL_ATMEL_CONSOLE=y
675CONFIG_SERIAL_ATMEL_PDC=y
676# CONFIG_SERIAL_ATMEL_TTYAT is not set
677CONFIG_SERIAL_CORE=y
678CONFIG_SERIAL_CORE_CONSOLE=y
679CONFIG_UNIX98_PTYS=y
680CONFIG_LEGACY_PTYS=y
681CONFIG_LEGACY_PTY_COUNT=256
682# CONFIG_IPMI_HANDLER is not set
683# CONFIG_HW_RANDOM is not set
684# CONFIG_NVRAM is not set
685# CONFIG_R3964 is not set
686# CONFIG_RAW_DRIVER is not set
687# CONFIG_TCG_TPM is not set
688CONFIG_I2C=y
689CONFIG_I2C_BOARDINFO=y
690CONFIG_I2C_CHARDEV=y
691CONFIG_I2C_HELPER_AUTO=y
692CONFIG_I2C_ALGOBIT=y
693
694#
695# I2C Hardware Bus support
696#
697
698#
699# I2C system bus drivers (mostly embedded / system-on-chip)
700#
701CONFIG_I2C_GPIO=y
702# CONFIG_I2C_OCORES is not set
703# CONFIG_I2C_SIMTEC is not set
704
705#
706# External I2C/SMBus adapter drivers
707#
708# CONFIG_I2C_PARPORT_LIGHT is not set
709# CONFIG_I2C_TAOS_EVM is not set
710# CONFIG_I2C_TINY_USB is not set
711
712#
713# Other I2C/SMBus bus drivers
714#
715# CONFIG_I2C_PCA_PLATFORM is not set
716# CONFIG_I2C_STUB is not set
717
718#
719# Miscellaneous I2C Chip support
720#
721# CONFIG_DS1682 is not set
722CONFIG_AT24=y
723# CONFIG_SENSORS_EEPROM is not set
724# CONFIG_SENSORS_PCF8574 is not set
725# CONFIG_PCF8575 is not set
726# CONFIG_SENSORS_PCA9539 is not set
727# CONFIG_SENSORS_PCF8591 is not set
728# CONFIG_SENSORS_MAX6875 is not set
729# CONFIG_SENSORS_TSL2550 is not set
730# CONFIG_I2C_DEBUG_CORE is not set
731# CONFIG_I2C_DEBUG_ALGO is not set
732# CONFIG_I2C_DEBUG_BUS is not set
733# CONFIG_I2C_DEBUG_CHIP is not set
734CONFIG_SPI=y
735CONFIG_SPI_DEBUG=y
736CONFIG_SPI_MASTER=y
737
738#
739# SPI Master Controller Drivers
740#
741CONFIG_SPI_ATMEL=y
742# CONFIG_SPI_BITBANG is not set
743
744#
745# SPI Protocol Masters
746#
747# CONFIG_SPI_AT25 is not set
748CONFIG_SPI_SPIDEV=y
749# CONFIG_SPI_TLE62X0 is not set
750# CONFIG_W1 is not set
751# CONFIG_POWER_SUPPLY is not set
752# CONFIG_HWMON is not set
753CONFIG_WATCHDOG=y
754CONFIG_WATCHDOG_NOWAYOUT=y
755
756#
757# Watchdog Device Drivers
758#
759# CONFIG_SOFT_WATCHDOG is not set
760
761#
762# USB-based Watchdog Cards
763#
764# CONFIG_USBPCWATCHDOG is not set
765
766#
767# Sonics Silicon Backplane
768#
769CONFIG_SSB_POSSIBLE=y
770# CONFIG_SSB is not set
771
772#
773# Multifunction device drivers
774#
775# CONFIG_MFD_CORE is not set
776# CONFIG_MFD_SM501 is not set
777# CONFIG_HTC_PASIC3 is not set
778# CONFIG_MFD_TMIO is not set
779# CONFIG_MFD_T7L66XB is not set
780# CONFIG_MFD_TC6387XB is not set
781
782#
783# Multimedia devices
784#
785
786#
787# Multimedia core support
788#
789# CONFIG_VIDEO_DEV is not set
790# CONFIG_DVB_CORE is not set
791# CONFIG_VIDEO_MEDIA is not set
792
793#
794# Multimedia drivers
795#
796# CONFIG_DAB is not set
797
798#
799# Graphics support
800#
801# CONFIG_VGASTATE is not set
802# CONFIG_VIDEO_OUTPUT_CONTROL is not set
803# CONFIG_FB is not set
804# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
805
806#
807# Display device support
808#
809# CONFIG_DISPLAY_SUPPORT is not set
810
811#
812# Console display driver support
813#
814# CONFIG_VGA_CONSOLE is not set
815CONFIG_DUMMY_CONSOLE=y
816# CONFIG_SOUND is not set
817CONFIG_HID_SUPPORT=y
818CONFIG_HID=y
819# CONFIG_HID_DEBUG is not set
820# CONFIG_HIDRAW is not set
821
822#
823# USB Input Devices
824#
825# CONFIG_USB_HID is not set
826
827#
828# USB HID Boot Protocol drivers
829#
830# CONFIG_USB_KBD is not set
831# CONFIG_USB_MOUSE is not set
832CONFIG_USB_SUPPORT=y
833CONFIG_USB_ARCH_HAS_HCD=y
834CONFIG_USB_ARCH_HAS_OHCI=y
835# CONFIG_USB_ARCH_HAS_EHCI is not set
836CONFIG_USB=y
837# CONFIG_USB_DEBUG is not set
838# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
839
840#
841# Miscellaneous USB options
842#
843CONFIG_USB_DEVICEFS=y
844CONFIG_USB_DEVICE_CLASS=y
845# CONFIG_USB_DYNAMIC_MINORS is not set
846# CONFIG_USB_OTG is not set
847
848#
849# USB Host Controller Drivers
850#
851# CONFIG_USB_C67X00_HCD is not set
852# CONFIG_USB_ISP116X_HCD is not set
853# CONFIG_USB_ISP1760_HCD is not set
854CONFIG_USB_OHCI_HCD=y
855# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
856# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
857CONFIG_USB_OHCI_LITTLE_ENDIAN=y
858# CONFIG_USB_SL811_HCD is not set
859# CONFIG_USB_R8A66597_HCD is not set
860
861#
862# USB Device Class drivers
863#
864# CONFIG_USB_ACM is not set
865# CONFIG_USB_PRINTER is not set
866# CONFIG_USB_WDM is not set
867
868#
869# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
870#
871
872#
873# may also be needed; see USB_STORAGE Help for more information
874#
875CONFIG_USB_STORAGE=y
876# CONFIG_USB_STORAGE_DEBUG is not set
877# CONFIG_USB_STORAGE_DATAFAB is not set
878# CONFIG_USB_STORAGE_FREECOM is not set
879# CONFIG_USB_STORAGE_ISD200 is not set
880# CONFIG_USB_STORAGE_DPCM is not set
881# CONFIG_USB_STORAGE_USBAT is not set
882# CONFIG_USB_STORAGE_SDDR09 is not set
883# CONFIG_USB_STORAGE_SDDR55 is not set
884# CONFIG_USB_STORAGE_JUMPSHOT is not set
885# CONFIG_USB_STORAGE_ALAUDA is not set
886# CONFIG_USB_STORAGE_ONETOUCH is not set
887# CONFIG_USB_STORAGE_KARMA is not set
888# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
889# CONFIG_USB_LIBUSUAL is not set
890
891#
892# USB Imaging devices
893#
894# CONFIG_USB_MDC800 is not set
895# CONFIG_USB_MICROTEK is not set
896CONFIG_USB_MON=y
897
898#
899# USB port drivers
900#
901# CONFIG_USB_SERIAL is not set
902
903#
904# USB Miscellaneous drivers
905#
906# CONFIG_USB_EMI62 is not set
907# CONFIG_USB_EMI26 is not set
908# CONFIG_USB_ADUTUX is not set
909# CONFIG_USB_AUERSWALD is not set
910# CONFIG_USB_RIO500 is not set
911# CONFIG_USB_LEGOTOWER is not set
912# CONFIG_USB_LCD is not set
913# CONFIG_USB_BERRY_CHARGE is not set
914# CONFIG_USB_LED is not set
915# CONFIG_USB_CYPRESS_CY7C63 is not set
916# CONFIG_USB_CYTHERM is not set
917# CONFIG_USB_PHIDGET is not set
918# CONFIG_USB_IDMOUSE is not set
919# CONFIG_USB_FTDI_ELAN is not set
920# CONFIG_USB_APPLEDISPLAY is not set
921# CONFIG_USB_LD is not set
922# CONFIG_USB_TRANCEVIBRATOR is not set
923# CONFIG_USB_IOWARRIOR is not set
924# CONFIG_USB_TEST is not set
925# CONFIG_USB_ISIGHTFW is not set
926CONFIG_USB_GADGET=y
927# CONFIG_USB_GADGET_DEBUG is not set
928# CONFIG_USB_GADGET_DEBUG_FILES is not set
929CONFIG_USB_GADGET_SELECTED=y
930# CONFIG_USB_GADGET_AMD5536UDC is not set
931# CONFIG_USB_GADGET_ATMEL_USBA is not set
932# CONFIG_USB_GADGET_FSL_USB2 is not set
933# CONFIG_USB_GADGET_NET2280 is not set
934# CONFIG_USB_GADGET_PXA25X is not set
935# CONFIG_USB_GADGET_M66592 is not set
936# CONFIG_USB_GADGET_PXA27X is not set
937# CONFIG_USB_GADGET_GOKU is not set
938# CONFIG_USB_GADGET_LH7A40X is not set
939# CONFIG_USB_GADGET_OMAP is not set
940# CONFIG_USB_GADGET_S3C2410 is not set
941CONFIG_USB_GADGET_AT91=y
942CONFIG_USB_AT91=y
943# CONFIG_USB_GADGET_DUMMY_HCD is not set
944# CONFIG_USB_GADGET_DUALSPEED is not set
945CONFIG_USB_ZERO=m
946# CONFIG_USB_ETH is not set
947CONFIG_USB_GADGETFS=m
948CONFIG_USB_FILE_STORAGE=m
949# CONFIG_USB_FILE_STORAGE_TEST is not set
950CONFIG_USB_G_SERIAL=m
951# CONFIG_USB_MIDI_GADGET is not set
952# CONFIG_USB_G_PRINTER is not set
953# CONFIG_USB_CDC_COMPOSITE is not set
954# CONFIG_MMC is not set
955# CONFIG_NEW_LEDS is not set
956CONFIG_RTC_LIB=y
957CONFIG_RTC_CLASS=y
958CONFIG_RTC_HCTOSYS=y
959CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
960CONFIG_RTC_DEBUG=y
961
962#
963# RTC interfaces
964#
965CONFIG_RTC_INTF_SYSFS=y
966CONFIG_RTC_INTF_PROC=y
967CONFIG_RTC_INTF_DEV=y
968# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
969# CONFIG_RTC_DRV_TEST is not set
970
971#
972# I2C RTC drivers
973#
974# CONFIG_RTC_DRV_DS1307 is not set
975# CONFIG_RTC_DRV_DS1374 is not set
976# CONFIG_RTC_DRV_DS1672 is not set
977# CONFIG_RTC_DRV_MAX6900 is not set
978# CONFIG_RTC_DRV_RS5C372 is not set
979# CONFIG_RTC_DRV_ISL1208 is not set
980# CONFIG_RTC_DRV_X1205 is not set
981# CONFIG_RTC_DRV_PCF8563 is not set
982# CONFIG_RTC_DRV_PCF8583 is not set
983# CONFIG_RTC_DRV_M41T80 is not set
984# CONFIG_RTC_DRV_S35390A is not set
985CONFIG_RTC_DRV_FM3130=y
986
987#
988# SPI RTC drivers
989#
990# CONFIG_RTC_DRV_M41T94 is not set
991# CONFIG_RTC_DRV_DS1305 is not set
992# CONFIG_RTC_DRV_MAX6902 is not set
993# CONFIG_RTC_DRV_R9701 is not set
994# CONFIG_RTC_DRV_RS5C348 is not set
995
996#
997# Platform RTC drivers
998#
999# CONFIG_RTC_DRV_CMOS is not set
1000# CONFIG_RTC_DRV_DS1511 is not set
1001# CONFIG_RTC_DRV_DS1553 is not set
1002# CONFIG_RTC_DRV_DS1742 is not set
1003# CONFIG_RTC_DRV_STK17TA8 is not set
1004# CONFIG_RTC_DRV_M48T86 is not set
1005# CONFIG_RTC_DRV_M48T59 is not set
1006# CONFIG_RTC_DRV_V3020 is not set
1007
1008#
1009# on-CPU RTC drivers
1010#
1011# CONFIG_RTC_DRV_AT91SAM9 is not set
1012# CONFIG_DMADEVICES is not set
1013
1014#
1015# Voltage and Current regulators
1016#
1017# CONFIG_REGULATOR is not set
1018# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1019# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1020# CONFIG_REGULATOR_BQ24022 is not set
1021# CONFIG_UIO is not set
1022
1023#
1024# File systems
1025#
1026CONFIG_EXT2_FS=y
1027# CONFIG_EXT2_FS_XATTR is not set
1028# CONFIG_EXT2_FS_XIP is not set
1029CONFIG_EXT3_FS=y
1030CONFIG_EXT3_FS_XATTR=y
1031# CONFIG_EXT3_FS_POSIX_ACL is not set
1032# CONFIG_EXT3_FS_SECURITY is not set
1033# CONFIG_EXT4DEV_FS is not set
1034CONFIG_JBD=y
1035CONFIG_FS_MBCACHE=y
1036# CONFIG_REISERFS_FS is not set
1037# CONFIG_JFS_FS is not set
1038# CONFIG_FS_POSIX_ACL is not set
1039# CONFIG_XFS_FS is not set
1040# CONFIG_OCFS2_FS is not set
1041CONFIG_DNOTIFY=y
1042CONFIG_INOTIFY=y
1043CONFIG_INOTIFY_USER=y
1044# CONFIG_QUOTA is not set
1045# CONFIG_AUTOFS_FS is not set
1046# CONFIG_AUTOFS4_FS is not set
1047# CONFIG_FUSE_FS is not set
1048
1049#
1050# CD-ROM/DVD Filesystems
1051#
1052# CONFIG_ISO9660_FS is not set
1053# CONFIG_UDF_FS is not set
1054
1055#
1056# DOS/FAT/NT Filesystems
1057#
1058CONFIG_FAT_FS=y
1059# CONFIG_MSDOS_FS is not set
1060CONFIG_VFAT_FS=y
1061CONFIG_FAT_DEFAULT_CODEPAGE=437
1062CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1063# CONFIG_NTFS_FS is not set
1064
1065#
1066# Pseudo filesystems
1067#
1068CONFIG_PROC_FS=y
1069CONFIG_PROC_SYSCTL=y
1070CONFIG_SYSFS=y
1071CONFIG_TMPFS=y
1072# CONFIG_TMPFS_POSIX_ACL is not set
1073# CONFIG_HUGETLB_PAGE is not set
1074# CONFIG_CONFIGFS_FS is not set
1075
1076#
1077# Miscellaneous filesystems
1078#
1079# CONFIG_ADFS_FS is not set
1080# CONFIG_AFFS_FS is not set
1081# CONFIG_HFS_FS is not set
1082# CONFIG_HFSPLUS_FS is not set
1083# CONFIG_BEFS_FS is not set
1084# CONFIG_BFS_FS is not set
1085# CONFIG_EFS_FS is not set
1086CONFIG_JFFS2_FS=y
1087CONFIG_JFFS2_FS_DEBUG=0
1088CONFIG_JFFS2_FS_WRITEBUFFER=y
1089# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1090# CONFIG_JFFS2_SUMMARY is not set
1091# CONFIG_JFFS2_FS_XATTR is not set
1092# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1093CONFIG_JFFS2_ZLIB=y
1094# CONFIG_JFFS2_LZO is not set
1095CONFIG_JFFS2_RTIME=y
1096# CONFIG_JFFS2_RUBIN is not set
1097CONFIG_CRAMFS=y
1098# CONFIG_VXFS_FS is not set
1099# CONFIG_MINIX_FS is not set
1100# CONFIG_OMFS_FS is not set
1101# CONFIG_HPFS_FS is not set
1102# CONFIG_QNX4FS_FS is not set
1103# CONFIG_ROMFS_FS is not set
1104# CONFIG_SYSV_FS is not set
1105# CONFIG_UFS_FS is not set
1106CONFIG_NETWORK_FILESYSTEMS=y
1107CONFIG_NFS_FS=y
1108CONFIG_NFS_V3=y
1109# CONFIG_NFS_V3_ACL is not set
1110# CONFIG_NFS_V4 is not set
1111CONFIG_ROOT_NFS=y
1112# CONFIG_NFSD is not set
1113CONFIG_LOCKD=y
1114CONFIG_LOCKD_V4=y
1115CONFIG_NFS_COMMON=y
1116CONFIG_SUNRPC=y
1117# CONFIG_RPCSEC_GSS_KRB5 is not set
1118# CONFIG_RPCSEC_GSS_SPKM3 is not set
1119# CONFIG_SMB_FS is not set
1120# CONFIG_CIFS is not set
1121# CONFIG_NCP_FS is not set
1122# CONFIG_CODA_FS is not set
1123# CONFIG_AFS_FS is not set
1124
1125#
1126# Partition Types
1127#
1128# CONFIG_PARTITION_ADVANCED is not set
1129CONFIG_MSDOS_PARTITION=y
1130CONFIG_NLS=y
1131CONFIG_NLS_DEFAULT="iso8859-1"
1132CONFIG_NLS_CODEPAGE_437=y
1133# CONFIG_NLS_CODEPAGE_737 is not set
1134# CONFIG_NLS_CODEPAGE_775 is not set
1135CONFIG_NLS_CODEPAGE_850=y
1136# CONFIG_NLS_CODEPAGE_852 is not set
1137# CONFIG_NLS_CODEPAGE_855 is not set
1138# CONFIG_NLS_CODEPAGE_857 is not set
1139# CONFIG_NLS_CODEPAGE_860 is not set
1140# CONFIG_NLS_CODEPAGE_861 is not set
1141# CONFIG_NLS_CODEPAGE_862 is not set
1142# CONFIG_NLS_CODEPAGE_863 is not set
1143# CONFIG_NLS_CODEPAGE_864 is not set
1144# CONFIG_NLS_CODEPAGE_865 is not set
1145# CONFIG_NLS_CODEPAGE_866 is not set
1146# CONFIG_NLS_CODEPAGE_869 is not set
1147# CONFIG_NLS_CODEPAGE_936 is not set
1148# CONFIG_NLS_CODEPAGE_950 is not set
1149# CONFIG_NLS_CODEPAGE_932 is not set
1150# CONFIG_NLS_CODEPAGE_949 is not set
1151# CONFIG_NLS_CODEPAGE_874 is not set
1152# CONFIG_NLS_ISO8859_8 is not set
1153# CONFIG_NLS_CODEPAGE_1250 is not set
1154# CONFIG_NLS_CODEPAGE_1251 is not set
1155# CONFIG_NLS_ASCII is not set
1156CONFIG_NLS_ISO8859_1=y
1157# CONFIG_NLS_ISO8859_2 is not set
1158# CONFIG_NLS_ISO8859_3 is not set
1159# CONFIG_NLS_ISO8859_4 is not set
1160# CONFIG_NLS_ISO8859_5 is not set
1161# CONFIG_NLS_ISO8859_6 is not set
1162# CONFIG_NLS_ISO8859_7 is not set
1163# CONFIG_NLS_ISO8859_9 is not set
1164# CONFIG_NLS_ISO8859_13 is not set
1165# CONFIG_NLS_ISO8859_14 is not set
1166# CONFIG_NLS_ISO8859_15 is not set
1167# CONFIG_NLS_KOI8_R is not set
1168# CONFIG_NLS_KOI8_U is not set
1169# CONFIG_NLS_UTF8 is not set
1170# CONFIG_DLM is not set
1171
1172#
1173# Kernel hacking
1174#
1175# CONFIG_PRINTK_TIME is not set
1176CONFIG_ENABLE_WARN_DEPRECATED=y
1177CONFIG_ENABLE_MUST_CHECK=y
1178CONFIG_FRAME_WARN=1024
1179# CONFIG_MAGIC_SYSRQ is not set
1180# CONFIG_UNUSED_SYMBOLS is not set
1181# CONFIG_DEBUG_FS is not set
1182# CONFIG_HEADERS_CHECK is not set
1183CONFIG_DEBUG_KERNEL=y
1184# CONFIG_DEBUG_SHIRQ is not set
1185CONFIG_DETECT_SOFTLOCKUP=y
1186# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1187CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1188CONFIG_SCHED_DEBUG=y
1189# CONFIG_SCHEDSTATS is not set
1190# CONFIG_TIMER_STATS is not set
1191# CONFIG_DEBUG_OBJECTS is not set
1192# CONFIG_DEBUG_SLAB is not set
1193CONFIG_DEBUG_PREEMPT=y
1194# CONFIG_DEBUG_RT_MUTEXES is not set
1195# CONFIG_RT_MUTEX_TESTER is not set
1196# CONFIG_DEBUG_SPINLOCK is not set
1197# CONFIG_DEBUG_MUTEXES is not set
1198# CONFIG_DEBUG_LOCK_ALLOC is not set
1199# CONFIG_PROVE_LOCKING is not set
1200# CONFIG_LOCK_STAT is not set
1201# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1202# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1203# CONFIG_DEBUG_KOBJECT is not set
1204CONFIG_DEBUG_BUGVERBOSE=y
1205CONFIG_DEBUG_INFO=y
1206# CONFIG_DEBUG_VM is not set
1207# CONFIG_DEBUG_WRITECOUNT is not set
1208CONFIG_DEBUG_MEMORY_INIT=y
1209# CONFIG_DEBUG_LIST is not set
1210# CONFIG_DEBUG_SG is not set
1211CONFIG_FRAME_POINTER=y
1212# CONFIG_BOOT_PRINTK_DELAY is not set
1213# CONFIG_RCU_TORTURE_TEST is not set
1214# CONFIG_BACKTRACE_SELF_TEST is not set
1215# CONFIG_FAULT_INJECTION is not set
1216# CONFIG_LATENCYTOP is not set
1217CONFIG_HAVE_FTRACE=y
1218CONFIG_HAVE_DYNAMIC_FTRACE=y
1219# CONFIG_FTRACE is not set
1220# CONFIG_IRQSOFF_TRACER is not set
1221# CONFIG_PREEMPT_TRACER is not set
1222# CONFIG_SCHED_TRACER is not set
1223# CONFIG_CONTEXT_SWITCH_TRACER is not set
1224# CONFIG_SAMPLES is not set
1225CONFIG_HAVE_ARCH_KGDB=y
1226# CONFIG_KGDB is not set
1227CONFIG_DEBUG_USER=y
1228# CONFIG_DEBUG_ERRORS is not set
1229# CONFIG_DEBUG_STACK_USAGE is not set
1230CONFIG_DEBUG_LL=y
1231# CONFIG_DEBUG_ICEDCC is not set
1232
1233#
1234# Security options
1235#
1236# CONFIG_KEYS is not set
1237# CONFIG_SECURITY is not set
1238# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1239# CONFIG_CRYPTO is not set
1240
1241#
1242# Library routines
1243#
1244CONFIG_BITREVERSE=y
1245# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1246# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1247# CONFIG_CRC_CCITT is not set
1248# CONFIG_CRC16 is not set
1249CONFIG_CRC_T10DIF=y
1250# CONFIG_CRC_ITU_T is not set
1251CONFIG_CRC32=y
1252# CONFIG_CRC7 is not set
1253# CONFIG_LIBCRC32C is not set
1254CONFIG_ZLIB_INFLATE=y
1255CONFIG_ZLIB_DEFLATE=y
1256CONFIG_PLIST=y
1257CONFIG_HAS_IOMEM=y
1258CONFIG_HAS_IOPORT=y
1259CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/at91sam9rlek_defconfig b/arch/arm/configs/at91sam9rlek_defconfig
index 1c76642272a..811bebbdc78 100644
--- a/arch/arm/configs/at91sam9rlek_defconfig
+++ b/arch/arm/configs/at91sam9rlek_defconfig
@@ -496,6 +496,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
496# CONFIG_TOUCHSCREEN_PENMOUNT is not set 496# CONFIG_TOUCHSCREEN_PENMOUNT is not set
497# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 497# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
498# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 498# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
499CONFIG_TOUCHSCREEN_ATMEL_TSADCC=y
499# CONFIG_TOUCHSCREEN_UCB1400 is not set 500# CONFIG_TOUCHSCREEN_UCB1400 is not set
500# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 501# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
501# CONFIG_INPUT_MISC is not set 502# CONFIG_INPUT_MISC is not set
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h
index d04a7a2bc2e..4fbfb22f65a 100644
--- a/arch/arm/include/asm/byteorder.h
+++ b/arch/arm/include/asm/byteorder.h
@@ -18,15 +18,7 @@
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <asm/types.h> 19#include <asm/types.h>
20 20
21#ifdef __ARMEB__ 21static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
22# define __BIG_ENDIAN
23#else
24# define __LITTLE_ENDIAN
25#endif
26
27#define __SWAB_64_THRU_32__
28
29static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
30{ 22{
31 __u32 t; 23 __u32 t;
32 24
@@ -48,8 +40,19 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
48 40
49 return x; 41 return x;
50} 42}
51#define __arch_swab32 __arch_swab32
52 43
53#include <linux/byteorder.h> 44#define __arch__swab32(x) ___arch__swab32(x)
45
46#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
47# define __BYTEORDER_HAS_U64__
48# define __SWAB_64_THRU_32__
49#endif
50
51#ifdef __ARMEB__
52#include <linux/byteorder/big_endian.h>
53#else
54#include <linux/byteorder/little_endian.h>
55#endif
54 56
55#endif 57#endif
58
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index a048b92cb40..5aafb2e2ca7 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -175,6 +175,15 @@ config MACH_SAM9_L9260
175 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260. 175 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
176 <http://www.olimex.com/dev/sam9-L9260.html> 176 <http://www.olimex.com/dev/sam9-L9260.html>
177 177
178config MACH_AFEB9260
179 bool "Custom afeb9260 board v1"
180 depends on ARCH_AT91SAM9260
181 help
182 Select this if you are using custom afeb9260 board based on
183 open hardware design. Select this for revision 1 of the board.
184 <svn://194.85.238.22/home/users/george/svn/arm9eb>
185 <http://groups.google.com/group/arm9fpga-evolution-board>
186
178config MACH_USB_A9260 187config MACH_USB_A9260
179 bool "CALAO USB-A9260" 188 bool "CALAO USB-A9260"
180 depends on ARCH_AT91SAM9260 189 depends on ARCH_AT91SAM9260
@@ -314,6 +323,19 @@ config AT91_PROGRAMMABLE_CLOCKS
314 Select this if you need to program one or more of the PCK0..PCK3 323 Select this if you need to program one or more of the PCK0..PCK3
315 programmable clock outputs. 324 programmable clock outputs.
316 325
326config AT91_SLOW_CLOCK
327 bool "Suspend-to-RAM disables main oscillator"
328 depends on SUSPEND
329 help
330 Select this if you want Suspend-to-RAM to save the most power
331 possible (without powering off the CPU) by disabling the PLLs
332 and main oscillator so that only the 32 KiHz clock is available.
333
334 When only that slow-clock is available, some peripherals lose
335 functionality. Many can't issue wakeup events unless faster
336 clocks are available. Some lose their operating state and
337 need to be completely re-initialized.
338
317config AT91_TIMER_HZ 339config AT91_TIMER_HZ
318 int "Kernel HZ (jiffies per second)" 340 int "Kernel HZ (jiffies per second)"
319 range 32 1024 341 range 32 1024
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 7d641f97516..cca612d97ca 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_MACH_CAM60) += board-cam60.o
39obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o 39obj-$(CONFIG_MACH_SAM9_L9260) += board-sam9-l9260.o
40obj-$(CONFIG_MACH_USB_A9260) += board-usb-a9260.o 40obj-$(CONFIG_MACH_USB_A9260) += board-usb-a9260.o
41obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o 41obj-$(CONFIG_MACH_QIL_A9260) += board-qil-a9260.o
42obj-$(CONFIG_MACH_AFEB9260) += board-afeb-9260v1.o
42 43
43# AT91SAM9261 board-specific support 44# AT91SAM9261 board-specific support
44obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o 45obj-$(CONFIG_MACH_AT91SAM9261EK) += board-sam9261ek.o
@@ -64,6 +65,7 @@ obj-y += leds.o
64 65
65# Power Management 66# Power Management
66obj-$(CONFIG_PM) += pm.o 67obj-$(CONFIG_PM) += pm.o
68obj-$(CONFIG_AT91_SLOW_CLOCK) += pm_slowclock.o
67 69
68ifeq ($(CONFIG_PM_DEBUG),y) 70ifeq ($(CONFIG_PM_DEBUG),y)
69CFLAGS_pm.o += -DDEBUG 71CFLAGS_pm.o += -DDEBUG
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 638948c1677..0fc0adaebd5 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -141,8 +141,8 @@ static struct clk tcb_clk = {
141 .pmc_mask = 1 << AT91CAP9_ID_TCB, 141 .pmc_mask = 1 << AT91CAP9_ID_TCB,
142 .type = CLK_TYPE_PERIPHERAL, 142 .type = CLK_TYPE_PERIPHERAL,
143}; 143};
144static struct clk pwmc_clk = { 144static struct clk pwm_clk = {
145 .name = "pwmc_clk", 145 .name = "pwm_clk",
146 .pmc_mask = 1 << AT91CAP9_ID_PWMC, 146 .pmc_mask = 1 << AT91CAP9_ID_PWMC,
147 .type = CLK_TYPE_PERIPHERAL, 147 .type = CLK_TYPE_PERIPHERAL,
148}; 148};
@@ -207,7 +207,7 @@ static struct clk *periph_clocks[] __initdata = {
207 &ssc1_clk, 207 &ssc1_clk,
208 &ac97_clk, 208 &ac97_clk,
209 &tcb_clk, 209 &tcb_clk,
210 &pwmc_clk, 210 &pwm_clk,
211 &macb_clk, 211 &macb_clk,
212 &aestdes_clk, 212 &aestdes_clk,
213 &adc_clk, 213 &adc_clk,
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index abb4aac8fa9..5ebd4273d35 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -719,6 +719,60 @@ static void __init at91_add_device_watchdog(void) {}
719 719
720 720
721/* -------------------------------------------------------------------- 721/* --------------------------------------------------------------------
722 * PWM
723 * --------------------------------------------------------------------*/
724
725#if defined(CONFIG_ATMEL_PWM)
726static u32 pwm_mask;
727
728static struct resource pwm_resources[] = {
729 [0] = {
730 .start = AT91CAP9_BASE_PWMC,
731 .end = AT91CAP9_BASE_PWMC + SZ_16K - 1,
732 .flags = IORESOURCE_MEM,
733 },
734 [1] = {
735 .start = AT91CAP9_ID_PWMC,
736 .end = AT91CAP9_ID_PWMC,
737 .flags = IORESOURCE_IRQ,
738 },
739};
740
741static struct platform_device at91cap9_pwm0_device = {
742 .name = "atmel_pwm",
743 .id = -1,
744 .dev = {
745 .platform_data = &pwm_mask,
746 },
747 .resource = pwm_resources,
748 .num_resources = ARRAY_SIZE(pwm_resources),
749};
750
751void __init at91_add_device_pwm(u32 mask)
752{
753 if (mask & (1 << AT91_PWM0))
754 at91_set_A_periph(AT91_PIN_PB19, 1); /* enable PWM0 */
755
756 if (mask & (1 << AT91_PWM1))
757 at91_set_B_periph(AT91_PIN_PB8, 1); /* enable PWM1 */
758
759 if (mask & (1 << AT91_PWM2))
760 at91_set_B_periph(AT91_PIN_PC29, 1); /* enable PWM2 */
761
762 if (mask & (1 << AT91_PWM3))
763 at91_set_B_periph(AT91_PIN_PA11, 1); /* enable PWM3 */
764
765 pwm_mask = mask;
766
767 platform_device_register(&at91cap9_pwm0_device);
768}
769#else
770void __init at91_add_device_pwm(u32 mask) {}
771#endif
772
773
774
775/* --------------------------------------------------------------------
722 * AC97 776 * AC97
723 * -------------------------------------------------------------------- */ 777 * -------------------------------------------------------------------- */
724 778
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 80bfab5680e..ada4b676910 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -129,8 +129,8 @@ static struct clk tcb_clk = {
129 .pmc_mask = 1 << AT91SAM9263_ID_TCB, 129 .pmc_mask = 1 << AT91SAM9263_ID_TCB,
130 .type = CLK_TYPE_PERIPHERAL, 130 .type = CLK_TYPE_PERIPHERAL,
131}; 131};
132static struct clk pwmc_clk = { 132static struct clk pwm_clk = {
133 .name = "pwmc_clk", 133 .name = "pwm_clk",
134 .pmc_mask = 1 << AT91SAM9263_ID_PWMC, 134 .pmc_mask = 1 << AT91SAM9263_ID_PWMC,
135 .type = CLK_TYPE_PERIPHERAL, 135 .type = CLK_TYPE_PERIPHERAL,
136}; 136};
@@ -187,7 +187,7 @@ static struct clk *periph_clocks[] __initdata = {
187 &ssc1_clk, 187 &ssc1_clk,
188 &ac97_clk, 188 &ac97_clk,
189 &tcb_clk, 189 &tcb_clk,
190 &pwmc_clk, 190 &pwm_clk,
191 &macb_clk, 191 &macb_clk,
192 &twodge_clk, 192 &twodge_clk,
193 &udc_clk, 193 &udc_clk,
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index c93992f55dc..8b884083f76 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -886,6 +886,59 @@ static void __init at91_add_device_watchdog(void) {}
886 886
887 887
888/* -------------------------------------------------------------------- 888/* --------------------------------------------------------------------
889 * PWM
890 * --------------------------------------------------------------------*/
891
892#if defined(CONFIG_ATMEL_PWM)
893static u32 pwm_mask;
894
895static struct resource pwm_resources[] = {
896 [0] = {
897 .start = AT91SAM9263_BASE_PWMC,
898 .end = AT91SAM9263_BASE_PWMC + SZ_16K - 1,
899 .flags = IORESOURCE_MEM,
900 },
901 [1] = {
902 .start = AT91SAM9263_ID_PWMC,
903 .end = AT91SAM9263_ID_PWMC,
904 .flags = IORESOURCE_IRQ,
905 },
906};
907
908static struct platform_device at91sam9263_pwm0_device = {
909 .name = "atmel_pwm",
910 .id = -1,
911 .dev = {
912 .platform_data = &pwm_mask,
913 },
914 .resource = pwm_resources,
915 .num_resources = ARRAY_SIZE(pwm_resources),
916};
917
918void __init at91_add_device_pwm(u32 mask)
919{
920 if (mask & (1 << AT91_PWM0))
921 at91_set_B_periph(AT91_PIN_PB7, 1); /* enable PWM0 */
922
923 if (mask & (1 << AT91_PWM1))
924 at91_set_B_periph(AT91_PIN_PB8, 1); /* enable PWM1 */
925
926 if (mask & (1 << AT91_PWM2))
927 at91_set_B_periph(AT91_PIN_PC29, 1); /* enable PWM2 */
928
929 if (mask & (1 << AT91_PWM3))
930 at91_set_B_periph(AT91_PIN_PB29, 1); /* enable PWM3 */
931
932 pwm_mask = mask;
933
934 platform_device_register(&at91sam9263_pwm0_device);
935}
936#else
937void __init at91_add_device_pwm(u32 mask) {}
938#endif
939
940
941/* --------------------------------------------------------------------
889 * SSC -- Synchronous Serial Controller 942 * SSC -- Synchronous Serial Controller
890 * -------------------------------------------------------------------- */ 943 * -------------------------------------------------------------------- */
891 944
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 556bddf35b4..252e954b49f 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -131,8 +131,8 @@ static struct clk tc2_clk = {
131 .pmc_mask = 1 << AT91SAM9RL_ID_TC2, 131 .pmc_mask = 1 << AT91SAM9RL_ID_TC2,
132 .type = CLK_TYPE_PERIPHERAL, 132 .type = CLK_TYPE_PERIPHERAL,
133}; 133};
134static struct clk pwmc_clk = { 134static struct clk pwm_clk = {
135 .name = "pwmc_clk", 135 .name = "pwm_clk",
136 .pmc_mask = 1 << AT91SAM9RL_ID_PWMC, 136 .pmc_mask = 1 << AT91SAM9RL_ID_PWMC,
137 .type = CLK_TYPE_PERIPHERAL, 137 .type = CLK_TYPE_PERIPHERAL,
138}; 138};
@@ -180,7 +180,7 @@ static struct clk *periph_clocks[] __initdata = {
180 &tc0_clk, 180 &tc0_clk,
181 &tc1_clk, 181 &tc1_clk,
182 &tc2_clk, 182 &tc2_clk,
183 &pwmc_clk, 183 &pwm_clk,
184 &tsc_clk, 184 &tsc_clk,
185 &dma_clk, 185 &dma_clk,
186 &udphs_clk, 186 &udphs_clk,
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index 620886341fb..87deb1e1b52 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -527,6 +527,51 @@ static void __init at91_add_device_tc(void) { }
527 527
528 528
529/* -------------------------------------------------------------------- 529/* --------------------------------------------------------------------
530 * Touchscreen
531 * -------------------------------------------------------------------- */
532
533#if defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) || defined(CONFIG_TOUCHSCREEN_ATMEL_TSADCC_MODULE)
534static u64 tsadcc_dmamask = DMA_BIT_MASK(32);
535
536static struct resource tsadcc_resources[] = {
537 [0] = {
538 .start = AT91SAM9RL_BASE_TSC,
539 .end = AT91SAM9RL_BASE_TSC + SZ_16K - 1,
540 .flags = IORESOURCE_MEM,
541 },
542 [1] = {
543 .start = AT91SAM9RL_ID_TSC,
544 .end = AT91SAM9RL_ID_TSC,
545 .flags = IORESOURCE_IRQ,
546 }
547};
548
549static struct platform_device at91sam9rl_tsadcc_device = {
550 .name = "atmel_tsadcc",
551 .id = -1,
552 .dev = {
553 .dma_mask = &tsadcc_dmamask,
554 .coherent_dma_mask = DMA_BIT_MASK(32),
555 },
556 .resource = tsadcc_resources,
557 .num_resources = ARRAY_SIZE(tsadcc_resources),
558};
559
560void __init at91_add_device_tsadcc(void)
561{
562 at91_set_A_periph(AT91_PIN_PA17, 0); /* AD0_XR */
563 at91_set_A_periph(AT91_PIN_PA18, 0); /* AD1_XL */
564 at91_set_A_periph(AT91_PIN_PA19, 0); /* AD2_YT */
565 at91_set_A_periph(AT91_PIN_PA20, 0); /* AD3_TB */
566
567 platform_device_register(&at91sam9rl_tsadcc_device);
568}
569#else
570void __init at91_add_device_tsadcc(void) {}
571#endif
572
573
574/* --------------------------------------------------------------------
530 * RTC 575 * RTC
531 * -------------------------------------------------------------------- */ 576 * -------------------------------------------------------------------- */
532 577
@@ -592,6 +637,59 @@ static void __init at91_add_device_watchdog(void) {}
592 637
593 638
594/* -------------------------------------------------------------------- 639/* --------------------------------------------------------------------
640 * PWM
641 * --------------------------------------------------------------------*/
642
643#if defined(CONFIG_ATMEL_PWM)
644static u32 pwm_mask;
645
646static struct resource pwm_resources[] = {
647 [0] = {
648 .start = AT91SAM9RL_BASE_PWMC,
649 .end = AT91SAM9RL_BASE_PWMC + SZ_16K - 1,
650 .flags = IORESOURCE_MEM,
651 },
652 [1] = {
653 .start = AT91SAM9RL_ID_PWMC,
654 .end = AT91SAM9RL_ID_PWMC,
655 .flags = IORESOURCE_IRQ,
656 },
657};
658
659static struct platform_device at91sam9rl_pwm0_device = {
660 .name = "atmel_pwm",
661 .id = -1,
662 .dev = {
663 .platform_data = &pwm_mask,
664 },
665 .resource = pwm_resources,
666 .num_resources = ARRAY_SIZE(pwm_resources),
667};
668
669void __init at91_add_device_pwm(u32 mask)
670{
671 if (mask & (1 << AT91_PWM0))
672 at91_set_B_periph(AT91_PIN_PB8, 1); /* enable PWM0 */
673
674 if (mask & (1 << AT91_PWM1))
675 at91_set_B_periph(AT91_PIN_PB9, 1); /* enable PWM1 */
676
677 if (mask & (1 << AT91_PWM2))
678 at91_set_B_periph(AT91_PIN_PD5, 1); /* enable PWM2 */
679
680 if (mask & (1 << AT91_PWM3))
681 at91_set_B_periph(AT91_PIN_PD8, 1); /* enable PWM3 */
682
683 pwm_mask = mask;
684
685 platform_device_register(&at91sam9rl_pwm0_device);
686}
687#else
688void __init at91_add_device_pwm(u32 mask) {}
689#endif
690
691
692/* --------------------------------------------------------------------
595 * SSC -- Synchronous Serial Controller 693 * SSC -- Synchronous Serial Controller
596 * -------------------------------------------------------------------- */ 694 * -------------------------------------------------------------------- */
597 695
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c
new file mode 100644
index 00000000000..9c040c78889
--- /dev/null
+++ b/arch/arm/mach-at91/board-afeb-9260v1.c
@@ -0,0 +1,210 @@
1/*
2 * linux/arch/arm/mach-at91/board-afeb-9260v1.c
3 *
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2006 Atmel
6 * Copyright (C) 2008 Sergey Lapin
7 *
8 * A custom board designed as open hardware; PCBs and various information
9 * is available at http://groups.google.com/group/arm9fpga-evolution-board/
10 * Subversion repository: svn://194.85.238.22/home/users/george/svn/arm9eb
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/types.h>
28#include <linux/init.h>
29#include <linux/mm.h>
30#include <linux/module.h>
31#include <linux/platform_device.h>
32#include <linux/spi/spi.h>
33#include <linux/clk.h>
34#include <linux/dma-mapping.h>
35
36#include <mach/hardware.h>
37#include <asm/setup.h>
38#include <asm/mach-types.h>
39#include <asm/irq.h>
40
41#include <asm/mach/arch.h>
42#include <asm/mach/map.h>
43#include <asm/mach/irq.h>
44
45#include <mach/board.h>
46#include <mach/gpio.h>
47
48#include "generic.h"
49
50
51static void __init afeb9260_map_io(void)
52{
53 /* Initialize processor: 18.432 MHz crystal */
54 at91sam9260_initialize(18432000);
55
56 /* DGBU on ttyS0. (Rx & Tx only) */
57 at91_register_uart(0, 0, 0);
58
59 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
60 at91_register_uart(AT91SAM9260_ID_US0, 1,
61 ATMEL_UART_CTS | ATMEL_UART_RTS
62 | ATMEL_UART_DTR | ATMEL_UART_DSR
63 | ATMEL_UART_DCD | ATMEL_UART_RI);
64
65 /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
66 at91_register_uart(AT91SAM9260_ID_US1, 2,
67 ATMEL_UART_CTS | ATMEL_UART_RTS);
68
69 /* set serial console to ttyS0 (ie, DBGU) */
70 at91_set_serial_console(0);
71}
72
73static void __init afeb9260_init_irq(void)
74{
75 at91sam9260_init_interrupts(NULL);
76}
77
78
79/*
80 * USB Host port
81 */
82static struct at91_usbh_data __initdata afeb9260_usbh_data = {
83 .ports = 1,
84};
85
86/*
87 * USB Device port
88 */
89static struct at91_udc_data __initdata afeb9260_udc_data = {
90 .vbus_pin = AT91_PIN_PC5,
91 .pullup_pin = 0, /* pull-up driven by UDC */
92};
93
94
95
96/*
97 * SPI devices.
98 */
99static struct spi_board_info afeb9260_spi_devices[] = {
100 { /* DataFlash chip */
101 .modalias = "mtd_dataflash",
102 .chip_select = 1,
103 .max_speed_hz = 15 * 1000 * 1000,
104 .bus_num = 0,
105 },
106};
107
108
109/*
110 * MACB Ethernet device
111 */
112static struct at91_eth_data __initdata afeb9260_macb_data = {
113 .phy_irq_pin = AT91_PIN_PA9,
114 .is_rmii = 0,
115};
116
117
118/*
119 * NAND flash
120 */
121static struct mtd_partition __initdata afeb9260_nand_partition[] = {
122 {
123 .name = "bootloader",
124 .offset = 0,
125 .size = (640 * SZ_1K),
126 },
127 {
128 .name = "kernel",
129 .offset = MTDPART_OFS_NXTBLK,
130 .size = SZ_2M,
131 },
132 {
133 .name = "rootfs",
134 .offset = MTDPART_OFS_NXTBLK,
135 .size = MTDPART_SIZ_FULL,
136 },
137};
138
139static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
140{
141 *num_partitions = ARRAY_SIZE(afeb9260_nand_partition);
142 return afeb9260_nand_partition;
143}
144
145static struct atmel_nand_data __initdata afeb9260_nand_data = {
146 .ale = 21,
147 .cle = 22,
148 .rdy_pin = AT91_PIN_PC13,
149 .enable_pin = AT91_PIN_PC14,
150 .partition_info = nand_partitions,
151 .bus_width_16 = 0,
152};
153
154
155/*
156 * MCI (SD/MMC)
157 */
158static struct at91_mmc_data __initdata afeb9260_mmc_data = {
159 .slot_b = 1,
160 .wire4 = 1,
161};
162
163
164
165static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {
166 {
167 I2C_BOARD_INFO("fm3130", 0x68),
168 I2C_BOARD_INFO("24c64", 0x50),
169 },
170};
171
172static void __init afeb9260_board_init(void)
173{
174 /* Serial */
175 at91_add_device_serial();
176 /* USB Host */
177 at91_add_device_usbh(&afeb9260_usbh_data);
178 /* USB Device */
179 at91_add_device_udc(&afeb9260_udc_data);
180 /* SPI */
181 at91_add_device_spi(afeb9260_spi_devices,
182 ARRAY_SIZE(afeb9260_spi_devices));
183 /* NAND */
184 at91_add_device_nand(&afeb9260_nand_data);
185 /* Ethernet */
186 at91_add_device_eth(&afeb9260_macb_data);
187
188 /* Standard function's pin assignments are not
189 * appropriate for us and generic code provide
190 * no API to configure these pins any other way */
191 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
192 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
193 /* MMC */
194 at91_add_device_mmc(0, &afeb9260_mmc_data);
195 /* I2C */
196 at91_add_device_i2c(afeb9260_i2c_devices,
197 ARRAY_SIZE(afeb9260_i2c_devices));
198}
199
200MACHINE_START(AFEB9260, "Custom afeb9260 board")
201 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
202 .phys_io = AT91_BASE_SYS,
203 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
204 .boot_params = AT91_SDRAM_BASE + 0x100,
205 .timer = &at91sam926x_timer,
206 .map_io = afeb9260_map_io,
207 .init_irq = afeb9260_init_irq,
208 .init_machine = afeb9260_board_init,
209MACHINE_END
210
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 196199552eb..201b89392dc 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -214,7 +214,7 @@ static struct physmap_flash_data cap9adk_nor_data = {
214}; 214};
215 215
216#define NOR_BASE AT91_CHIPSELECT_0 216#define NOR_BASE AT91_CHIPSELECT_0
217#define NOR_SIZE 0x800000 217#define NOR_SIZE SZ_8M
218 218
219static struct resource nor_flash_resources[] = { 219static struct resource nor_flash_resources[] = {
220 { 220 {
diff --git a/arch/arm/mach-at91/board-carmeva.c b/arch/arm/mach-at91/board-carmeva.c
index afa1ff0e957..db1f9544d2e 100644
--- a/arch/arm/mach-at91/board-carmeva.c
+++ b/arch/arm/mach-at91/board-carmeva.c
@@ -25,7 +25,6 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28#include <mach/hardware.h>
29#include <asm/setup.h> 28#include <asm/setup.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31#include <asm/irq.h> 30#include <asm/irq.h>
@@ -34,6 +33,7 @@
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
36 35
36#include <mach/hardware.h>
37#include <mach/board.h> 37#include <mach/board.h>
38#include <mach/gpio.h> 38#include <mach/gpio.h>
39 39
@@ -114,6 +114,30 @@ static struct spi_board_info carmeva_spi_devices[] = {
114 }, 114 },
115}; 115};
116 116
117static struct gpio_led carmeva_leds[] = {
118 { /* "user led 1", LED9 */
119 .name = "led9",
120 .gpio = AT91_PIN_PA21,
121 .active_low = 1,
122 .default_trigger = "heartbeat",
123 },
124 { /* "user led 2", LED10 */
125 .name = "led10",
126 .gpio = AT91_PIN_PA25,
127 .active_low = 1,
128 },
129 { /* "user led 3", LED11 */
130 .name = "led11",
131 .gpio = AT91_PIN_PA26,
132 .active_low = 1,
133 },
134 { /* "user led 4", LED12 */
135 .name = "led12",
136 .gpio = AT91_PIN_PA18,
137 .active_low = 1,
138 }
139};
140
117static void __init carmeva_board_init(void) 141static void __init carmeva_board_init(void)
118{ 142{
119 /* Serial */ 143 /* Serial */
@@ -132,6 +156,8 @@ static void __init carmeva_board_init(void)
132// at91_add_device_cf(&carmeva_cf_data); 156// at91_add_device_cf(&carmeva_cf_data);
133 /* MMC */ 157 /* MMC */
134 at91_add_device_mmc(0, &carmeva_mmc_data); 158 at91_add_device_mmc(0, &carmeva_mmc_data);
159 /* LEDs */
160 at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
135} 161}
136 162
137MACHINE_START(CARMEVA, "Carmeva") 163MACHINE_START(CARMEVA, "Carmeva")
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c
index cb7c9a8fa48..fea2529ebcf 100644
--- a/arch/arm/mach-at91/board-csb337.c
+++ b/arch/arm/mach-at91/board-csb337.c
@@ -28,7 +28,6 @@
28#include <linux/input.h> 28#include <linux/input.h>
29#include <linux/gpio_keys.h> 29#include <linux/gpio_keys.h>
30 30
31#include <mach/hardware.h>
32#include <asm/setup.h> 31#include <asm/setup.h>
33#include <asm/mach-types.h> 32#include <asm/mach-types.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
@@ -37,6 +36,7 @@
37#include <asm/mach/map.h> 36#include <asm/mach/map.h>
38#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
39 38
39#include <mach/hardware.h>
40#include <mach/board.h> 40#include <mach/board.h>
41#include <mach/gpio.h> 41#include <mach/gpio.h>
42 42
@@ -114,7 +114,7 @@ static struct spi_board_info csb337_spi_devices[] = {
114}; 114};
115 115
116#define CSB_FLASH_BASE AT91_CHIPSELECT_0 116#define CSB_FLASH_BASE AT91_CHIPSELECT_0
117#define CSB_FLASH_SIZE 0x800000 117#define CSB_FLASH_SIZE SZ_8M
118 118
119static struct mtd_partition csb_flash_partitions[] = { 119static struct mtd_partition csb_flash_partitions[] = {
120 { 120 {
@@ -193,11 +193,11 @@ static struct platform_device csb300_button_device = {
193 193
194static void __init csb300_add_device_buttons(void) 194static void __init csb300_add_device_buttons(void)
195{ 195{
196 at91_set_gpio_input(AT91_PIN_PB29, 0); /* sw0 */ 196 at91_set_gpio_input(AT91_PIN_PB29, 1); /* sw0 */
197 at91_set_deglitch(AT91_PIN_PB29, 1); 197 at91_set_deglitch(AT91_PIN_PB29, 1);
198 at91_set_gpio_input(AT91_PIN_PB28, 0); /* sw1 */ 198 at91_set_gpio_input(AT91_PIN_PB28, 1); /* sw1 */
199 at91_set_deglitch(AT91_PIN_PB28, 1); 199 at91_set_deglitch(AT91_PIN_PB28, 1);
200 at91_set_gpio_input(AT91_PIN_PA21, 0); /* sw2 */ 200 at91_set_gpio_input(AT91_PIN_PA21, 1); /* sw2 */
201 at91_set_deglitch(AT91_PIN_PA21, 1); 201 at91_set_deglitch(AT91_PIN_PA21, 1);
202 202
203 platform_device_register(&csb300_button_device); 203 platform_device_register(&csb300_button_device);
@@ -224,7 +224,7 @@ static struct gpio_led csb_leds[] = {
224 .gpio = AT91_PIN_PB0, 224 .gpio = AT91_PIN_PB0,
225 .active_low = 1, 225 .active_low = 1,
226 .default_trigger = "ide-disk", 226 .default_trigger = "ide-disk",
227 }, 227 }
228}; 228};
229 229
230 230
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c
index 8db8bd8babd..cfa3f04b220 100644
--- a/arch/arm/mach-at91/board-csb637.c
+++ b/arch/arm/mach-at91/board-csb637.c
@@ -25,7 +25,6 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27 27
28#include <mach/hardware.h>
29#include <asm/setup.h> 28#include <asm/setup.h>
30#include <asm/mach-types.h> 29#include <asm/mach-types.h>
31#include <asm/irq.h> 30#include <asm/irq.h>
@@ -34,6 +33,7 @@
34#include <asm/mach/map.h> 33#include <asm/mach/map.h>
35#include <asm/mach/irq.h> 34#include <asm/mach/irq.h>
36 35
36#include <mach/hardware.h>
37#include <mach/board.h> 37#include <mach/board.h>
38#include <mach/gpio.h> 38#include <mach/gpio.h>
39 39
@@ -72,7 +72,7 @@ static struct at91_udc_data __initdata csb637_udc_data = {
72}; 72};
73 73
74#define CSB_FLASH_BASE AT91_CHIPSELECT_0 74#define CSB_FLASH_BASE AT91_CHIPSELECT_0
75#define CSB_FLASH_SIZE 0x1000000 75#define CSB_FLASH_SIZE SZ_16M
76 76
77static struct mtd_partition csb_flash_partitions[] = { 77static struct mtd_partition csb_flash_partitions[] = {
78 { 78 {
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c
index 43e1aa7ecef..0fd0f5bc77e 100644
--- a/arch/arm/mach-at91/board-dk.c
+++ b/arch/arm/mach-at91/board-dk.c
@@ -29,7 +29,6 @@
29#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
30#include <linux/mtd/physmap.h> 30#include <linux/mtd/physmap.h>
31 31
32#include <mach/hardware.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -38,6 +37,7 @@
38#include <asm/mach/map.h> 37#include <asm/mach/map.h>
39#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
40 39
40#include <mach/hardware.h>
41#include <mach/board.h> 41#include <mach/board.h>
42#include <mach/gpio.h> 42#include <mach/gpio.h>
43#include <mach/at91rm9200_mc.h> 43#include <mach/at91rm9200_mc.h>
@@ -157,7 +157,7 @@ static struct atmel_nand_data __initdata dk_nand_data = {
157}; 157};
158 158
159#define DK_FLASH_BASE AT91_CHIPSELECT_0 159#define DK_FLASH_BASE AT91_CHIPSELECT_0
160#define DK_FLASH_SIZE 0x200000 160#define DK_FLASH_SIZE SZ_2M
161 161
162static struct physmap_flash_data dk_flash_data = { 162static struct physmap_flash_data dk_flash_data = {
163 .width = 2, 163 .width = 2,
diff --git a/arch/arm/mach-at91/board-ecbat91.c b/arch/arm/mach-at91/board-ecbat91.c
index bfeee8a2af2..1d69908617f 100644
--- a/arch/arm/mach-at91/board-ecbat91.c
+++ b/arch/arm/mach-at91/board-ecbat91.c
@@ -86,7 +86,7 @@ static struct mtd_partition __initdata my_flash0_partitions[] =
86 { /* 0x8400 */ 86 { /* 0x8400 */
87 .name = "Darrell-loader", 87 .name = "Darrell-loader",
88 .offset = 0, 88 .offset = 0,
89 .size = 12* 1056, 89 .size = 12 * 1056,
90 }, 90 },
91 { 91 {
92 .name = "U-boot", 92 .name = "U-boot",
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-ek.c
index 60626e7a349..4cdfaac8e59 100644
--- a/arch/arm/mach-at91/board-ek.c
+++ b/arch/arm/mach-at91/board-ek.c
@@ -29,7 +29,6 @@
29#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
30#include <linux/mtd/physmap.h> 30#include <linux/mtd/physmap.h>
31 31
32#include <mach/hardware.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -38,6 +37,7 @@
38#include <asm/mach/map.h> 37#include <asm/mach/map.h>
39#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
40 39
40#include <mach/hardware.h>
41#include <mach/board.h> 41#include <mach/board.h>
42#include <mach/gpio.h> 42#include <mach/gpio.h>
43#include <mach/at91rm9200_mc.h> 43#include <mach/at91rm9200_mc.h>
@@ -116,7 +116,7 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
116}; 116};
117 117
118#define EK_FLASH_BASE AT91_CHIPSELECT_0 118#define EK_FLASH_BASE AT91_CHIPSELECT_0
119#define EK_FLASH_SIZE 0x200000 119#define EK_FLASH_SIZE SZ_2M
120 120
121static struct physmap_flash_data ek_flash_data = { 121static struct physmap_flash_data ek_flash_data = {
122 .width = 2, 122 .width = 2,
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
index dbc912d633c..859727e7ea3 100644
--- a/arch/arm/mach-at91/board-picotux200.c
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -105,7 +105,7 @@ static struct at91_mmc_data __initdata picotux200_mmc_data = {
105// }; 105// };
106 106
107#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 107#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
108#define PICOTUX200_FLASH_SIZE 0x400000 108#define PICOTUX200_FLASH_SIZE SZ_4M
109 109
110static struct physmap_flash_data picotux200_flash_data = { 110static struct physmap_flash_data picotux200_flash_data = {
111 .width = 2, 111 .width = 2,
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 4c28413426c..cfb4571a2e2 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -30,7 +30,6 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
32 32
33#include <mach/hardware.h>
34#include <asm/setup.h> 33#include <asm/setup.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
@@ -39,6 +38,7 @@
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
41 40
41#include <mach/hardware.h>
42#include <mach/board.h> 42#include <mach/board.h>
43#include <mach/gpio.h> 43#include <mach/gpio.h>
44#include <mach/at91_shdwc.h> 44#include <mach/at91_shdwc.h>
@@ -119,18 +119,18 @@ static struct at91_eth_data __initdata ek_macb_data = {
119static struct mtd_partition __initdata ek_nand_partition[] = { 119static struct mtd_partition __initdata ek_nand_partition[] = {
120 { 120 {
121 .name = "Uboot & Kernel", 121 .name = "Uboot & Kernel",
122 .offset = 0x00000000, 122 .offset = 0,
123 .size = 16 * 1024 * 1024, 123 .size = SZ_16M,
124 }, 124 },
125 { 125 {
126 .name = "Root FS", 126 .name = "Root FS",
127 .offset = 0x01000000, 127 .offset = MTDPART_OFS_NXTBLK,
128 .size = 120 * 1024 * 1024, 128 .size = 120 * SZ_1M,
129 }, 129 },
130 { 130 {
131 .name = "FS", 131 .name = "FS",
132 .offset = 0x08800000, 132 .offset = MTDPART_OFS_NXTBLK,
133 .size = 120 * 1024 * 1024, 133 .size = 120 * SZ_1M,
134 }, 134 },
135}; 135};
136 136
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index e4910cb26c1..99bb4cc23a0 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -126,11 +126,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
126 { 126 {
127 .name = "Bootloader Area", 127 .name = "Bootloader Area",
128 .offset = 0, 128 .offset = 0,
129 .size = 10 * 1024 * 1024, 129 .size = 10 * SZ_1M,
130 }, 130 },
131 { 131 {
132 .name = "User Area", 132 .name = "User Area",
133 .offset = 10 * 1024 * 1024, 133 .offset = MTDPART_OFS_NXTBLK,
134 .size = MTDPART_SIZ_FULL, 134 .size = MTDPART_SIZ_FULL,
135 }, 135 },
136}; 136};
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index cb20e70b3b0..b49eb6e4918 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -27,8 +27,10 @@
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/at73c213.h> 28#include <linux/spi/at73c213.h>
29#include <linux/clk.h> 29#include <linux/clk.h>
30#include <linux/i2c/at24.h>
31#include <linux/gpio_keys.h>
32#include <linux/input.h>
30 33
31#include <mach/hardware.h>
32#include <asm/setup.h> 34#include <asm/setup.h>
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/irq.h> 36#include <asm/irq.h>
@@ -37,6 +39,7 @@
37#include <asm/mach/map.h> 39#include <asm/mach/map.h>
38#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
39 41
42#include <mach/hardware.h>
40#include <mach/board.h> 43#include <mach/board.h>
41#include <mach/gpio.h> 44#include <mach/gpio.h>
42 45
@@ -163,11 +166,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
163 { 166 {
164 .name = "Partition 1", 167 .name = "Partition 1",
165 .offset = 0, 168 .offset = 0,
166 .size = 256 * 1024, 169 .size = SZ_256K,
167 }, 170 },
168 { 171 {
169 .name = "Partition 2", 172 .name = "Partition 2",
170 .offset = 256 * 1024, 173 .offset = MTDPART_OFS_NXTBLK,
171 .size = MTDPART_SIZ_FULL, 174 .size = MTDPART_SIZ_FULL,
172 }, 175 },
173}; 176};
@@ -222,6 +225,73 @@ static struct gpio_led ek_leds[] = {
222 } 225 }
223}; 226};
224 227
228/*
229 * I2C devices
230 */
231static struct at24_platform_data at24c512 = {
232 .byte_len = SZ_512K / 8,
233 .page_size = 128,
234 .flags = AT24_FLAG_ADDR16,
235};
236
237static struct i2c_board_info __initdata ek_i2c_devices[] = {
238 {
239 I2C_BOARD_INFO("24c512", 0x50),
240 .platform_data = &at24c512,
241 },
242 /* more devices can be added using expansion connectors */
243};
244
245
246/*
247 * GPIO Buttons
248 */
249#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
250static struct gpio_keys_button ek_buttons[] = {
251 {
252 .gpio = AT91_PIN_PA30,
253 .code = BTN_3,
254 .desc = "Button 3",
255 .active_low = 1,
256 .wakeup = 1,
257 },
258 {
259 .gpio = AT91_PIN_PA31,
260 .code = BTN_4,
261 .desc = "Button 4",
262 .active_low = 1,
263 .wakeup = 1,
264 }
265};
266
267static struct gpio_keys_platform_data ek_button_data = {
268 .buttons = ek_buttons,
269 .nbuttons = ARRAY_SIZE(ek_buttons),
270};
271
272static struct platform_device ek_button_device = {
273 .name = "gpio-keys",
274 .id = -1,
275 .num_resources = 0,
276 .dev = {
277 .platform_data = &ek_button_data,
278 }
279};
280
281static void __init ek_add_device_buttons(void)
282{
283 at91_set_gpio_input(AT91_PIN_PA30, 1); /* btn3 */
284 at91_set_deglitch(AT91_PIN_PA30, 1);
285 at91_set_gpio_input(AT91_PIN_PA31, 1); /* btn4 */
286 at91_set_deglitch(AT91_PIN_PA31, 1);
287
288 platform_device_register(&ek_button_device);
289}
290#else
291static void __init ek_add_device_buttons(void) {}
292#endif
293
294
225static void __init ek_board_init(void) 295static void __init ek_board_init(void)
226{ 296{
227 /* Serial */ 297 /* Serial */
@@ -239,12 +309,14 @@ static void __init ek_board_init(void)
239 /* MMC */ 309 /* MMC */
240 at91_add_device_mmc(0, &ek_mmc_data); 310 at91_add_device_mmc(0, &ek_mmc_data);
241 /* I2C */ 311 /* I2C */
242 at91_add_device_i2c(NULL, 0); 312 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
243 /* SSC (to AT73C213) */ 313 /* SSC (to AT73C213) */
244 at73c213_set_clk(&at73c213_data); 314 at73c213_set_clk(&at73c213_data);
245 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX); 315 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
246 /* LEDs */ 316 /* LEDs */
247 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 317 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
318 /* Push Buttons */
319 ek_add_device_buttons();
248} 320}
249 321
250MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 322MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 1a9963b811c..4977409d4fc 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -35,7 +35,6 @@
35 35
36#include <video/atmel_lcdc.h> 36#include <video/atmel_lcdc.h>
37 37
38#include <mach/hardware.h>
39#include <asm/setup.h> 38#include <asm/setup.h>
40#include <asm/mach-types.h> 39#include <asm/mach-types.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
@@ -44,6 +43,7 @@
44#include <asm/mach/map.h> 43#include <asm/mach/map.h>
45#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
46 45
46#include <mach/hardware.h>
47#include <mach/board.h> 47#include <mach/board.h>
48#include <mach/gpio.h> 48#include <mach/gpio.h>
49#include <mach/at91sam9_smc.h> 49#include <mach/at91sam9_smc.h>
@@ -168,11 +168,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
168 { 168 {
169 .name = "Partition 1", 169 .name = "Partition 1",
170 .offset = 0, 170 .offset = 0,
171 .size = 256 * 1024, 171 .size = SZ_256K,
172 }, 172 },
173 { 173 {
174 .name = "Partition 2", 174 .name = "Partition 2",
175 .offset = 256 * 1024 , 175 .offset = MTDPART_OFS_NXTBLK,
176 .size = MTDPART_SIZ_FULL, 176 .size = MTDPART_SIZ_FULL,
177 }, 177 },
178}; 178};
@@ -435,24 +435,28 @@ static struct gpio_keys_button ek_buttons[] = {
435 .code = BTN_0, 435 .code = BTN_0,
436 .desc = "Button 0", 436 .desc = "Button 0",
437 .active_low = 1, 437 .active_low = 1,
438 .wakeup = 1,
438 }, 439 },
439 { 440 {
440 .gpio = AT91_PIN_PA26, 441 .gpio = AT91_PIN_PA26,
441 .code = BTN_1, 442 .code = BTN_1,
442 .desc = "Button 1", 443 .desc = "Button 1",
443 .active_low = 1, 444 .active_low = 1,
445 .wakeup = 1,
444 }, 446 },
445 { 447 {
446 .gpio = AT91_PIN_PA25, 448 .gpio = AT91_PIN_PA25,
447 .code = BTN_2, 449 .code = BTN_2,
448 .desc = "Button 2", 450 .desc = "Button 2",
449 .active_low = 1, 451 .active_low = 1,
452 .wakeup = 1,
450 }, 453 },
451 { 454 {
452 .gpio = AT91_PIN_PA24, 455 .gpio = AT91_PIN_PA24,
453 .code = BTN_3, 456 .code = BTN_3,
454 .desc = "Button 3", 457 .desc = "Button 3",
455 .active_low = 1, 458 .active_low = 1,
459 .wakeup = 1,
456 } 460 }
457}; 461};
458 462
@@ -472,13 +476,13 @@ static struct platform_device ek_button_device = {
472 476
473static void __init ek_add_device_buttons(void) 477static void __init ek_add_device_buttons(void)
474{ 478{
475 at91_set_gpio_input(AT91_PIN_PA27, 0); /* btn0 */ 479 at91_set_gpio_input(AT91_PIN_PA27, 1); /* btn0 */
476 at91_set_deglitch(AT91_PIN_PA27, 1); 480 at91_set_deglitch(AT91_PIN_PA27, 1);
477 at91_set_gpio_input(AT91_PIN_PA26, 0); /* btn1 */ 481 at91_set_gpio_input(AT91_PIN_PA26, 1); /* btn1 */
478 at91_set_deglitch(AT91_PIN_PA26, 1); 482 at91_set_deglitch(AT91_PIN_PA26, 1);
479 at91_set_gpio_input(AT91_PIN_PA25, 0); /* btn2 */ 483 at91_set_gpio_input(AT91_PIN_PA25, 1); /* btn2 */
480 at91_set_deglitch(AT91_PIN_PA25, 1); 484 at91_set_deglitch(AT91_PIN_PA25, 1);
481 at91_set_gpio_input(AT91_PIN_PA24, 0); /* btn3 */ 485 at91_set_gpio_input(AT91_PIN_PA24, 1); /* btn3 */
482 at91_set_deglitch(AT91_PIN_PA24, 1); 486 at91_set_deglitch(AT91_PIN_PA24, 1);
483 487
484 platform_device_register(&ek_button_device); 488 platform_device_register(&ek_button_device);
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index b1d11960a73..8354015c6a2 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -26,13 +26,14 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h> 28#include <linux/spi/ads7846.h>
29#include <linux/i2c/at24.h>
29#include <linux/fb.h> 30#include <linux/fb.h>
30#include <linux/gpio_keys.h> 31#include <linux/gpio_keys.h>
31#include <linux/input.h> 32#include <linux/input.h>
33#include <linux/leds.h>
32 34
33#include <video/atmel_lcdc.h> 35#include <video/atmel_lcdc.h>
34 36
35#include <mach/hardware.h>
36#include <asm/setup.h> 37#include <asm/setup.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38#include <asm/irq.h> 39#include <asm/irq.h>
@@ -41,6 +42,7 @@
41#include <asm/mach/map.h> 42#include <asm/mach/map.h>
42#include <asm/mach/irq.h> 43#include <asm/mach/irq.h>
43 44
45#include <mach/hardware.h>
44#include <mach/board.h> 46#include <mach/board.h>
45#include <mach/gpio.h> 47#include <mach/gpio.h>
46#include <mach/at91sam9_smc.h> 48#include <mach/at91sam9_smc.h>
@@ -172,11 +174,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
172 { 174 {
173 .name = "Partition 1", 175 .name = "Partition 1",
174 .offset = 0, 176 .offset = 0,
175 .size = 64 * 1024 * 1024, 177 .size = SZ_64M,
176 }, 178 },
177 { 179 {
178 .name = "Partition 2", 180 .name = "Partition 2",
179 .offset = 64 * 1024 * 1024, 181 .offset = MTDPART_OFS_NXTBLK,
180 .size = MTDPART_SIZ_FULL, 182 .size = MTDPART_SIZ_FULL,
181 }, 183 },
182}; 184};
@@ -203,12 +205,30 @@ static struct atmel_nand_data __initdata ek_nand_data = {
203 205
204 206
205/* 207/*
208 * I2C devices
209 */
210static struct at24_platform_data at24c512 = {
211 .byte_len = SZ_512K / 8,
212 .page_size = 128,
213 .flags = AT24_FLAG_ADDR16,
214};
215
216
217static struct i2c_board_info __initdata ek_i2c_devices[] = {
218 {
219 I2C_BOARD_INFO("24c512", 0x50),
220 .platform_data = &at24c512,
221 },
222 /* more devices can be added using expansion connectors */
223};
224
225/*
206 * LCD Controller 226 * LCD Controller
207 */ 227 */
208#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) 228#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
209static struct fb_videomode at91_tft_vga_modes[] = { 229static struct fb_videomode at91_tft_vga_modes[] = {
210 { 230 {
211 .name = "TX09D50VM1CCA @ 60", 231 .name = "TX09D50VM1CCA @ 60",
212 .refresh = 60, 232 .refresh = 60,
213 .xres = 240, .yres = 320, 233 .xres = 240, .yres = 320,
214 .pixclock = KHZ2PICOS(4965), 234 .pixclock = KHZ2PICOS(4965),
@@ -224,7 +244,7 @@ static struct fb_videomode at91_tft_vga_modes[] = {
224 244
225static struct fb_monspecs at91fb_default_monspecs = { 245static struct fb_monspecs at91fb_default_monspecs = {
226 .manufacturer = "HIT", 246 .manufacturer = "HIT",
227 .monitor = "TX09D70VM1CCA", 247 .monitor = "TX09D70VM1CCA",
228 248
229 .modedb = at91_tft_vga_modes, 249 .modedb = at91_tft_vga_modes,
230 .modedb_len = ARRAY_SIZE(at91_tft_vga_modes), 250 .modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
@@ -235,7 +255,7 @@ static struct fb_monspecs at91fb_default_monspecs = {
235}; 255};
236 256
237#define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \ 257#define AT91SAM9263_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
238 | ATMEL_LCDC_DISTYPE_TFT \ 258 | ATMEL_LCDC_DISTYPE_TFT \
239 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE) 259 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
240 260
241static void at91_lcdc_power_control(int on) 261static void at91_lcdc_power_control(int on)
@@ -277,7 +297,7 @@ static struct gpio_keys_button ek_buttons[] = {
277 .active_low = 1, 297 .active_low = 1,
278 .desc = "right_click", 298 .desc = "right_click",
279 .wakeup = 1, 299 .wakeup = 1,
280 }, 300 }
281}; 301};
282 302
283static struct gpio_keys_platform_data ek_button_data = { 303static struct gpio_keys_platform_data ek_button_data = {
@@ -296,9 +316,9 @@ static struct platform_device ek_button_device = {
296 316
297static void __init ek_add_device_buttons(void) 317static void __init ek_add_device_buttons(void)
298{ 318{
299 at91_set_GPIO_periph(AT91_PIN_PC5, 0); /* left button */ 319 at91_set_GPIO_periph(AT91_PIN_PC5, 1); /* left button */
300 at91_set_deglitch(AT91_PIN_PC5, 1); 320 at91_set_deglitch(AT91_PIN_PC5, 1);
301 at91_set_GPIO_periph(AT91_PIN_PC4, 0); /* right button */ 321 at91_set_GPIO_periph(AT91_PIN_PC4, 1); /* right button */
302 at91_set_deglitch(AT91_PIN_PC4, 1); 322 at91_set_deglitch(AT91_PIN_PC4, 1);
303 323
304 platform_device_register(&ek_button_device); 324 platform_device_register(&ek_button_device);
@@ -320,25 +340,32 @@ static struct atmel_ac97_data ek_ac97_data = {
320 * LEDs ... these could all be PWM-driven, for variable brightness 340 * LEDs ... these could all be PWM-driven, for variable brightness
321 */ 341 */
322static struct gpio_led ek_leds[] = { 342static struct gpio_led ek_leds[] = {
323 { /* "left" led, green, userled1, pwm1 */ 343 { /* "right" led, green, userled2 (could be driven by pwm2) */
324 .name = "ds1",
325 .gpio = AT91_PIN_PB8,
326 .active_low = 1,
327 .default_trigger = "mmc0",
328 },
329 { /* "right" led, green, userled2, pwm2 */
330 .name = "ds2", 344 .name = "ds2",
331 .gpio = AT91_PIN_PC29, 345 .gpio = AT91_PIN_PC29,
332 .active_low = 1, 346 .active_low = 1,
333 .default_trigger = "nand-disk", 347 .default_trigger = "nand-disk",
334 }, 348 },
335 { /* "power" led, yellow, pwm0 */ 349 { /* "power" led, yellow (could be driven by pwm0) */
336 .name = "ds3", 350 .name = "ds3",
337 .gpio = AT91_PIN_PB7, 351 .gpio = AT91_PIN_PB7,
338 .default_trigger = "heartbeat", 352 .default_trigger = "heartbeat",
339 } 353 }
340}; 354};
341 355
356/*
357 * PWM Leds
358 */
359static struct gpio_led ek_pwm_led[] = {
360 /* For now only DS1 is PWM-driven (by pwm1) */
361 {
362 .name = "ds1",
363 .gpio = 1, /* is PWM channel number */
364 .active_low = 1,
365 .default_trigger = "none",
366 }
367};
368
342 369
343static void __init ek_board_init(void) 370static void __init ek_board_init(void)
344{ 371{
@@ -360,7 +387,7 @@ static void __init ek_board_init(void)
360 /* NAND */ 387 /* NAND */
361 at91_add_device_nand(&ek_nand_data); 388 at91_add_device_nand(&ek_nand_data);
362 /* I2C */ 389 /* I2C */
363 at91_add_device_i2c(NULL, 0); 390 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
364 /* LCD Controller */ 391 /* LCD Controller */
365 at91_add_device_lcdc(&ek_lcdc_data); 392 at91_add_device_lcdc(&ek_lcdc_data);
366 /* Push Buttons */ 393 /* Push Buttons */
@@ -369,6 +396,7 @@ static void __init ek_board_init(void)
369 at91_add_device_ac97(&ek_ac97_data); 396 at91_add_device_ac97(&ek_ac97_data);
370 /* LEDs */ 397 /* LEDs */
371 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 398 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
399 at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led));
372} 400}
373 401
374MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") 402MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index d4eba5c0ce0..b588ead14d6 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -122,16 +122,16 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
122 { 122 {
123 .name = "Bootstrap", 123 .name = "Bootstrap",
124 .offset = 0, 124 .offset = 0,
125 .size = 4 * 1024 * 1024, 125 .size = 4 * SZ_1M,
126 }, 126 },
127 { 127 {
128 .name = "Partition 1", 128 .name = "Partition 1",
129 .offset = 4 * 1024 * 1024, 129 .offset = MTDPART_OFS_NXTBLK,
130 .size = 60 * 1024 * 1024, 130 .size = 60 * SZ_1M,
131 }, 131 },
132 { 132 {
133 .name = "Partition 2", 133 .name = "Partition 2",
134 .offset = 64 * 1024 * 1024, 134 .offset = MTDPART_OFS_NXTBLK,
135 .size = MTDPART_SIZ_FULL, 135 .size = MTDPART_SIZ_FULL,
136 }, 136 },
137}; 137};
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index c6dce49c388..27085186430 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -18,7 +18,6 @@
18 18
19#include <video/atmel_lcdc.h> 19#include <video/atmel_lcdc.h>
20 20
21#include <mach/hardware.h>
22#include <asm/setup.h> 21#include <asm/setup.h>
23#include <asm/mach-types.h> 22#include <asm/mach-types.h>
24#include <asm/irq.h> 23#include <asm/irq.h>
@@ -27,6 +26,7 @@
27#include <asm/mach/map.h> 26#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
29 28
29#include <mach/hardware.h>
30#include <mach/board.h> 30#include <mach/board.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
@@ -81,11 +81,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
81 { 81 {
82 .name = "Partition 1", 82 .name = "Partition 1",
83 .offset = 0, 83 .offset = 0,
84 .size = 256 * 1024, 84 .size = SZ_256K,
85 }, 85 },
86 { 86 {
87 .name = "Partition 2", 87 .name = "Partition 2",
88 .offset = 256 * 1024 , 88 .offset = MTDPART_OFS_NXTBLK,
89 .size = MTDPART_SIZ_FULL, 89 .size = MTDPART_SIZ_FULL,
90 }, 90 },
91}; 91};
@@ -195,6 +195,8 @@ static void __init ek_board_init(void)
195 at91_add_device_mmc(0, &ek_mmc_data); 195 at91_add_device_mmc(0, &ek_mmc_data);
196 /* LCD Controller */ 196 /* LCD Controller */
197 at91_add_device_lcdc(&ek_lcdc_data); 197 at91_add_device_lcdc(&ek_lcdc_data);
198 /* Touch Screen Controller */
199 at91_add_device_tsadcc();
198} 200}
199 201
200MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK") 202MACHINE_START(AT91SAM9RLEK, "Atmel AT91SAM9RL-EK")
diff --git a/arch/arm/mach-at91/board-usb-a9260.c b/arch/arm/mach-at91/board-usb-a9260.c
index f9d0b65da40..7c350357333 100644
--- a/arch/arm/mach-at91/board-usb-a9260.c
+++ b/arch/arm/mach-at91/board-usb-a9260.c
@@ -30,7 +30,6 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
32 32
33#include <mach/hardware.h>
34#include <asm/setup.h> 33#include <asm/setup.h>
35#include <asm/mach-types.h> 34#include <asm/mach-types.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
@@ -39,6 +38,7 @@
39#include <asm/mach/map.h> 38#include <asm/mach/map.h>
40#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
41 40
41#include <mach/hardware.h>
42#include <mach/board.h> 42#include <mach/board.h>
43#include <mach/gpio.h> 43#include <mach/gpio.h>
44#include <mach/at91_shdwc.h> 44#include <mach/at91_shdwc.h>
@@ -93,18 +93,18 @@ static struct at91_eth_data __initdata ek_macb_data = {
93static struct mtd_partition __initdata ek_nand_partition[] = { 93static struct mtd_partition __initdata ek_nand_partition[] = {
94 { 94 {
95 .name = "Uboot & Kernel", 95 .name = "Uboot & Kernel",
96 .offset = 0x00000000, 96 .offset = 0,
97 .size = 16 * 1024 * 1024, 97 .size = SZ_16M,
98 }, 98 },
99 { 99 {
100 .name = "Root FS", 100 .name = "Root FS",
101 .offset = 0x01000000, 101 .offset = MTDPART_OFS_NXTBLK,
102 .size = 120 * 1024 * 1024, 102 .size = 120 * SZ_1M,
103 }, 103 },
104 { 104 {
105 .name = "FS", 105 .name = "FS",
106 .offset = 0x08800000, 106 .offset = MTDPART_OFS_NXTBLK,
107 .size = 120 * 1024 * 1024, 107 .size = 120 * SZ_1M,
108 } 108 }
109}; 109};
110 110
diff --git a/arch/arm/mach-at91/board-usb-a9263.c b/arch/arm/mach-at91/board-usb-a9263.c
index 673e5c27214..391b566c457 100644
--- a/arch/arm/mach-at91/board-usb-a9263.c
+++ b/arch/arm/mach-at91/board-usb-a9263.c
@@ -29,7 +29,6 @@
29#include <linux/gpio_keys.h> 29#include <linux/gpio_keys.h>
30#include <linux/input.h> 30#include <linux/input.h>
31 31
32#include <mach/hardware.h>
33#include <asm/setup.h> 32#include <asm/setup.h>
34#include <asm/mach-types.h> 33#include <asm/mach-types.h>
35#include <asm/irq.h> 34#include <asm/irq.h>
@@ -38,6 +37,7 @@
38#include <asm/mach/map.h> 37#include <asm/mach/map.h>
39#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
40 39
40#include <mach/hardware.h>
41#include <mach/board.h> 41#include <mach/board.h>
42#include <mach/gpio.h> 42#include <mach/gpio.h>
43#include <mach/at91_shdwc.h> 43#include <mach/at91_shdwc.h>
@@ -106,18 +106,18 @@ static struct at91_eth_data __initdata ek_macb_data = {
106static struct mtd_partition __initdata ek_nand_partition[] = { 106static struct mtd_partition __initdata ek_nand_partition[] = {
107 { 107 {
108 .name = "Linux Kernel", 108 .name = "Linux Kernel",
109 .offset = 0x00000000, 109 .offset = 0,
110 .size = 16 * 1024 * 1024, 110 .size = SZ_16M,
111 }, 111 },
112 { 112 {
113 .name = "Root FS", 113 .name = "Root FS",
114 .offset = 0x01000000, 114 .offset = MTDPART_OFS_NXTBLK,
115 .size = 120 * 1024 * 1024, 115 .size = 120 * SZ_1M,
116 }, 116 },
117 { 117 {
118 .name = "FS", 118 .name = "FS",
119 .offset = 0x08800000, 119 .offset = MTDPART_OFS_NXTBLK,
120 .size = 120 * 1024 * 1024, 120 .size = 120 * SZ_1M,
121 } 121 }
122}; 122};
123 123
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c
index 36b380aad00..e22bf051f83 100644
--- a/arch/arm/mach-at91/board-yl-9200.c
+++ b/arch/arm/mach-at91/board-yl-9200.c
@@ -33,7 +33,6 @@
33#include <linux/gpio_keys.h> 33#include <linux/gpio_keys.h>
34#include <linux/input.h> 34#include <linux/input.h>
35 35
36#include <mach/hardware.h>
37#include <asm/setup.h> 36#include <asm/setup.h>
38#include <asm/mach-types.h> 37#include <asm/mach-types.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
@@ -42,6 +41,7 @@
42#include <asm/mach/map.h> 41#include <asm/mach/map.h>
43#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
44 43
44#include <mach/hardware.h>
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>
@@ -150,27 +150,27 @@ static struct mtd_partition __initdata yl9200_nand_partition[] = {
150 { 150 {
151 .name = "AT91 NAND partition 1, boot", 151 .name = "AT91 NAND partition 1, boot",
152 .offset = 0, 152 .offset = 0,
153 .size = 1 * SZ_256K 153 .size = SZ_256K
154 }, 154 },
155 { 155 {
156 .name = "AT91 NAND partition 2, kernel", 156 .name = "AT91 NAND partition 2, kernel",
157 .offset = 1 * SZ_256K, 157 .offset = MTDPART_OFS_NXTBLK,
158 .size = 2 * SZ_1M - 1 * SZ_256K 158 .size = (2 * SZ_1M) - SZ_256K
159 }, 159 },
160 { 160 {
161 .name = "AT91 NAND partition 3, filesystem", 161 .name = "AT91 NAND partition 3, filesystem",
162 .offset = 2 * SZ_1M, 162 .offset = MTDPART_OFS_NXTBLK,
163 .size = 14 * SZ_1M 163 .size = 14 * SZ_1M
164 }, 164 },
165 { 165 {
166 .name = "AT91 NAND partition 4, storage", 166 .name = "AT91 NAND partition 4, storage",
167 .offset = 16 * SZ_1M, 167 .offset = MTDPART_OFS_NXTBLK,
168 .size = 16 * SZ_1M 168 .size = SZ_16M
169 }, 169 },
170 { 170 {
171 .name = "AT91 NAND partition 5, ext-fs", 171 .name = "AT91 NAND partition 5, ext-fs",
172 .offset = 32 * SZ_1M, 172 .offset = MTDPART_OFS_NXTBLK,
173 .size = 32 * SZ_1M 173 .size = SZ_32M
174 } 174 }
175}; 175};
176 176
@@ -193,24 +193,24 @@ static struct atmel_nand_data __initdata yl9200_nand_data = {
193 * NOR Flash 193 * NOR Flash
194 */ 194 */
195#define YL9200_FLASH_BASE AT91_CHIPSELECT_0 195#define YL9200_FLASH_BASE AT91_CHIPSELECT_0
196#define YL9200_FLASH_SIZE 0x1000000 196#define YL9200_FLASH_SIZE SZ_16M
197 197
198static struct mtd_partition yl9200_flash_partitions[] = { 198static struct mtd_partition yl9200_flash_partitions[] = {
199 { 199 {
200 .name = "Bootloader", 200 .name = "Bootloader",
201 .size = 0x00040000,
202 .offset = 0, 201 .offset = 0,
202 .size = SZ_256K,
203 .mask_flags = MTD_WRITEABLE, /* force read-only */ 203 .mask_flags = MTD_WRITEABLE, /* force read-only */
204 }, 204 },
205 { 205 {
206 .name = "Kernel", 206 .name = "Kernel",
207 .size = 0x001C0000, 207 .offset = MTDPART_OFS_NXTBLK,
208 .offset = 0x00040000, 208 .size = (2 * SZ_1M) - SZ_256K
209 }, 209 },
210 { 210 {
211 .name = "Filesystem", 211 .name = "Filesystem",
212 .size = MTDPART_SIZ_FULL, 212 .offset = MTDPART_OFS_NXTBLK,
213 .offset = 0x00200000 213 .size = MTDPART_SIZ_FULL
214 } 214 }
215}; 215};
216 216
@@ -390,10 +390,6 @@ static struct spi_board_info yl9200_spi_devices[] = {
390#if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE) 390#if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE)
391#include <video/s1d13xxxfb.h> 391#include <video/s1d13xxxfb.h>
392 392
393#define AT91_FB_REG_BASE 0x80000000L
394#define AT91_FB_REG_SIZE 0x200
395#define AT91_FB_VMEM_BASE 0x80200000L
396#define AT91_FB_VMEM_SIZE 0x200000L
397 393
398static void __init yl9200_init_video(void) 394static void __init yl9200_init_video(void)
399{ 395{
@@ -516,29 +512,33 @@ static struct s1d13xxxfb_regval yl9200_s1dfb_initregs[] =
516 {S1DREG_COM_DISP_MODE, 0x01}, /* Display Mode Register, LCD only*/ 512 {S1DREG_COM_DISP_MODE, 0x01}, /* Display Mode Register, LCD only*/
517}; 513};
518 514
519static u64 s1dfb_dmamask = DMA_BIT_MASK(32);
520
521static struct s1d13xxxfb_pdata yl9200_s1dfb_pdata = { 515static struct s1d13xxxfb_pdata yl9200_s1dfb_pdata = {
522 .initregs = yl9200_s1dfb_initregs, 516 .initregs = yl9200_s1dfb_initregs,
523 .initregssize = ARRAY_SIZE(yl9200_s1dfb_initregs), 517 .initregssize = ARRAY_SIZE(yl9200_s1dfb_initregs),
524 .platform_init_video = yl9200_init_video, 518 .platform_init_video = yl9200_init_video,
525}; 519};
526 520
521#define YL9200_FB_REG_BASE AT91_CHIPSELECT_7
522#define YL9200_FB_VMEM_BASE YL9200_FB_REG_BASE + SZ_2M
523#define YL9200_FB_VMEM_SIZE SZ_2M
524
527static struct resource yl9200_s1dfb_resource[] = { 525static struct resource yl9200_s1dfb_resource[] = {
528 [0] = { /* video mem */ 526 [0] = { /* video mem */
529 .name = "s1d13xxxfb memory", 527 .name = "s1d13xxxfb memory",
530 .start = AT91_FB_VMEM_BASE, 528 .start = YL9200_FB_VMEM_BASE,
531 .end = AT91_FB_VMEM_BASE + AT91_FB_VMEM_SIZE -1, 529 .end = YL9200_FB_VMEM_BASE + YL9200_FB_VMEM_SIZE -1,
532 .flags = IORESOURCE_MEM, 530 .flags = IORESOURCE_MEM,
533 }, 531 },
534 [1] = { /* video registers */ 532 [1] = { /* video registers */
535 .name = "s1d13xxxfb registers", 533 .name = "s1d13xxxfb registers",
536 .start = AT91_FB_REG_BASE, 534 .start = YL9200_FB_REG_BASE,
537 .end = AT91_FB_REG_BASE + AT91_FB_REG_SIZE -1, 535 .end = YL9200_FB_REG_BASE + SZ_512 -1,
538 .flags = IORESOURCE_MEM, 536 .flags = IORESOURCE_MEM,
539 }, 537 },
540}; 538};
541 539
540static u64 s1dfb_dmamask = DMA_BIT_MASK(32);
541
542static struct platform_device yl9200_s1dfb_device = { 542static struct platform_device yl9200_s1dfb_device = {
543 .name = "s1d13806fb", 543 .name = "s1d13806fb",
544 .id = -1, 544 .id = -1,
diff --git a/arch/arm/mach-at91/include/mach/at91_pit.h b/arch/arm/mach-at91/include/mach/at91_pit.h
index 0448ac36ead..974d0bd05b5 100644
--- a/arch/arm/mach-at91/include/mach/at91_pit.h
+++ b/arch/arm/mach-at91/include/mach/at91_pit.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91_pit.h 2 * arch/arm/mach-at91/include/mach/at91_pit.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Periodic Interval Timer (PIT) - System peripherals regsters. 7 * Periodic Interval Timer (PIT) - System peripherals regsters.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91_rstc.h b/arch/arm/mach-at91/include/mach/at91_rstc.h
index 7cd1b39aaa4..cbd2bf052c1 100644
--- a/arch/arm/mach-at91/include/mach/at91_rstc.h
+++ b/arch/arm/mach-at91/include/mach/at91_rstc.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91_rstc.h 2 * arch/arm/mach-at91/include/mach/at91_rstc.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Reset Controller (RSTC) - System peripherals regsters. 7 * Reset Controller (RSTC) - System peripherals regsters.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91_rtt.h b/arch/arm/mach-at91/include/mach/at91_rtt.h
index 71782e5d215..7ec75de8bbb 100644
--- a/arch/arm/mach-at91/include/mach/at91_rtt.h
+++ b/arch/arm/mach-at91/include/mach/at91_rtt.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91_rtt.h 2 * arch/arm/mach-at91/include/mach/at91_rtt.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Real-time Timer (RTT) - System peripherals regsters. 7 * Real-time Timer (RTT) - System peripherals regsters.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91_shdwc.h b/arch/arm/mach-at91/include/mach/at91_shdwc.h
index 60be5ae624f..c4ce07e8a8f 100644
--- a/arch/arm/mach-at91/include/mach/at91_shdwc.h
+++ b/arch/arm/mach-at91/include/mach/at91_shdwc.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91_shdwc.h 2 * arch/arm/mach-at91/include/mach/at91_shdwc.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Shutdown Controller (SHDWC) - System peripherals regsters. 7 * Shutdown Controller (SHDWC) - System peripherals regsters.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h
index 973b4526a98..fecc2e9f0ca 100644
--- a/arch/arm/mach-at91/include/mach/at91_wdt.h
+++ b/arch/arm/mach-at91/include/mach/at91_wdt.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91_wdt.h 2 * arch/arm/mach-at91/include/mach/at91_wdt.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Watchdog Timer (WDT) - System peripherals regsters. 7 * Watchdog Timer (WDT) - System peripherals regsters.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
index bca878f3bd8..1499b1cbffd 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h 2 * arch/arm/mach-at91/include/mach/at91cap9_ddrsdr.h
3 * 3 *
4 * (C) 2008 Andrew Victor
5 *
4 * DDR/SDR Controller (DDRSDRC) - System peripherals registers. 6 * DDR/SDR Controller (DDRSDRC) - System peripherals registers.
5 * Based on AT91CAP9 datasheet revision B. 7 * Based on AT91CAP9 datasheet revision B.
6 * 8 *
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
index f027de5df95..020f02ed921 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91sam9260_matrix.h 2 * arch/arm/mach-at91/include/mach/at91sam9260_matrix.h
3 * 3 *
4 * Copyright (C) 2007 Atmel Corporation.
5 *
4 * Memory Controllers (MATRIX, EBI) - System peripherals registers. 6 * Memory Controllers (MATRIX, EBI) - System peripherals registers.
5 * Based on AT91SAM9260 datasheet revision B. 7 * Based on AT91SAM9260 datasheet revision B.
6 * 8 *
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
index db62b1f1830..69c6501915d 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
@@ -1,6 +1,8 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91sam9261_matrix.h 2 * arch/arm/mach-at91/include/mach/at91sam9261_matrix.h
3 * 3 *
4 * Copyright (C) 2007 Atmel Corporation.
5 *
4 * Memory Controllers (MATRIX, EBI) - System peripherals registers. 6 * Memory Controllers (MATRIX, EBI) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D. 7 * Based on AT91SAM9261 datasheet revision D.
6 * 8 *
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
index 1921181c63c..b7260389f7c 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91sam9_sdramc.h 2 * arch/arm/mach-at91/include/mach/at91sam9_sdramc.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * SDRAM Controllers (SDRAMC) - System peripherals registers. 7 * SDRAM Controllers (SDRAMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
index ec6ad1338b5..57de6207e57 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
@@ -1,6 +1,9 @@
1/* 1/*
2 * arch/arm/mach-at91/include/mach/at91sam9_smc.h 2 * arch/arm/mach-at91/include/mach/at91sam9_smc.h
3 * 3 *
4 * Copyright (C) 2007 Andrew Victor
5 * Copyright (C) 2007 Atmel Corporation.
6 *
4 * Static Memory Controllers (SMC) - System peripherals registers. 7 * Static Memory Controllers (SMC) - System peripherals registers.
5 * Based on AT91SAM9261 datasheet revision D. 8 * Based on AT91SAM9261 datasheet revision D.
6 * 9 *
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index acd60f2a072..fb51f0e0a83 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -133,6 +133,16 @@ struct atmel_uart_data {
133extern void __init at91_add_device_serial(void); 133extern void __init at91_add_device_serial(void);
134 134
135/* 135/*
136 * PWM
137 */
138#define AT91_PWM0 0
139#define AT91_PWM1 1
140#define AT91_PWM2 2
141#define AT91_PWM3 3
142
143extern void __init at91_add_device_pwm(u32 mask);
144
145/*
136 * SSC -- accessed through ssc_request(id). Drivers don't bind to SSC 146 * SSC -- accessed through ssc_request(id). Drivers don't bind to SSC
137 * platform devices. Their SSC ID is part of their configuration data, 147 * platform devices. Their SSC ID is part of their configuration data,
138 * along with information about which SSC signals they should use. 148 * along with information about which SSC signals they should use.
@@ -162,9 +172,13 @@ extern void __init at91_add_device_ac97(struct atmel_ac97_data *data);
162 /* ISI */ 172 /* ISI */
163extern void __init at91_add_device_isi(void); 173extern void __init at91_add_device_isi(void);
164 174
175 /* Touchscreen Controller */
176extern void __init at91_add_device_tsadcc(void);
177
165 /* LEDs */ 178 /* LEDs */
166extern void __init at91_init_leds(u8 cpu_led, u8 timer_led); 179extern void __init at91_init_leds(u8 cpu_led, u8 timer_led);
167extern void __init at91_gpio_leds(struct gpio_led *leds, int nr); 180extern void __init at91_gpio_leds(struct gpio_led *leds, int nr);
181extern void __init at91_pwm_leds(struct gpio_led *leds, int nr);
168 182
169/* FIXME: this needs a better location, but gets stuff building again */ 183/* FIXME: this needs a better location, but gets stuff building again */
170extern int at91_suspend_entering_slow_clock(void); 184extern int at91_suspend_entering_slow_clock(void);
diff --git a/arch/arm/mach-at91/leds.c b/arch/arm/mach-at91/leds.c
index fec03c59ff9..0415a839e1a 100644
--- a/arch/arm/mach-at91/leds.c
+++ b/arch/arm/mach-at91/leds.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h>
15 16
16#include <mach/board.h> 17#include <mach/board.h>
17#include <mach/gpio.h> 18#include <mach/gpio.h>
@@ -21,15 +22,13 @@
21 22
22#if defined(CONFIG_NEW_LEDS) 23#if defined(CONFIG_NEW_LEDS)
23 24
24#include <linux/platform_device.h>
25
26/* 25/*
27 * New cross-platform LED support. 26 * New cross-platform LED support.
28 */ 27 */
29 28
30static struct gpio_led_platform_data led_data; 29static struct gpio_led_platform_data led_data;
31 30
32static struct platform_device at91_leds = { 31static struct platform_device at91_gpio_leds_device = {
33 .name = "leds-gpio", 32 .name = "leds-gpio",
34 .id = -1, 33 .id = -1,
35 .dev.platform_data = &led_data, 34 .dev.platform_data = &led_data,
@@ -47,7 +46,7 @@ void __init at91_gpio_leds(struct gpio_led *leds, int nr)
47 46
48 led_data.leds = leds; 47 led_data.leds = leds;
49 led_data.num_leds = nr; 48 led_data.num_leds = nr;
50 platform_device_register(&at91_leds); 49 platform_device_register(&at91_gpio_leds_device);
51} 50}
52 51
53#else 52#else
@@ -57,6 +56,44 @@ void __init at91_gpio_leds(struct gpio_led *leds, int nr) {}
57 56
58/* ------------------------------------------------------------------------- */ 57/* ------------------------------------------------------------------------- */
59 58
59#if defined (CONFIG_LEDS_ATMEL_PWM)
60
61/*
62 * PWM Leds
63 */
64
65static struct gpio_led_platform_data pwm_led_data;
66
67static struct platform_device at91_pwm_leds_device = {
68 .name = "leds-atmel-pwm",
69 .id = -1,
70 .dev.platform_data = &pwm_led_data,
71};
72
73void __init at91_pwm_leds(struct gpio_led *leds, int nr)
74{
75 int i;
76 u32 pwm_mask = 0;
77
78 if (!nr)
79 return;
80
81 for (i = 0; i < nr; i++)
82 pwm_mask |= (1 << leds[i].gpio);
83
84 pwm_led_data.leds = leds;
85 pwm_led_data.num_leds = nr;
86
87 at91_add_device_pwm(pwm_mask);
88 platform_device_register(&at91_pwm_leds_device);
89}
90#else
91void __init at91_pwm_leds(struct gpio_led *leds, int nr){}
92#endif
93
94
95/* ------------------------------------------------------------------------- */
96
60#if defined(CONFIG_LEDS) 97#if defined(CONFIG_LEDS)
61 98
62#include <asm/leds.h> 99#include <asm/leds.h>
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
new file mode 100644
index 00000000000..987fab3d846
--- /dev/null
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -0,0 +1,283 @@
1/*
2 * arch/arm/mach-at91/pm_slow_clock.S
3 *
4 * Copyright (C) 2006 Savin Zlobec
5 *
6 * AT91SAM9 support:
7 * Copyright (C) 2007 Anti Sullin <anti.sullin@artecdesign.ee
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 version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#include <linux/linkage.h>
16#include <mach/hardware.h>
17#include <mach/at91_pmc.h>
18
19#ifdef CONFIG_ARCH_AT91RM9200
20#include <mach/at91rm9200_mc.h>
21#elif defined(CONFIG_ARCH_AT91CAP9)
22#include <mach/at91cap9_ddrsdr.h>
23#else
24#include <mach/at91sam9_sdramc.h>
25#endif
26
27
28#ifdef CONFIG_ARCH_AT91SAM9263
29/*
30 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
31 * handle those cases both here and in the Suspend-To-RAM support.
32 */
33#define AT91_SDRAMC AT91_SDRAMC0
34#warning Assuming EB1 SDRAM controller is *NOT* used
35#endif
36
37/*
38 * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master
39 * clock during suspend by adjusting its prescalar and divisor.
40 * NOTE: This hasn't been shown to be stable on SAM9s; and on the RM9200 there
41 * are errata regarding adjusting the prescalar and divisor.
42 */
43#undef SLOWDOWN_MASTER_CLOCK
44
45#define MCKRDY_TIMEOUT 1000
46#define MOSCRDY_TIMEOUT 1000
47#define PLLALOCK_TIMEOUT 1000
48#define PLLBLOCK_TIMEOUT 1000
49
50
51/*
52 * Wait until master clock is ready (after switching master clock source)
53 */
54 .macro wait_mckrdy
55 mov r4, #MCKRDY_TIMEOUT
561: sub r4, r4, #1
57 cmp r4, #0
58 beq 2f
59 ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)]
60 tst r3, #AT91_PMC_MCKRDY
61 beq 1b
622:
63 .endm
64
65/*
66 * Wait until master oscillator has stabilized.
67 */
68 .macro wait_moscrdy
69 mov r4, #MOSCRDY_TIMEOUT
701: sub r4, r4, #1
71 cmp r4, #0
72 beq 2f
73 ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)]
74 tst r3, #AT91_PMC_MOSCS
75 beq 1b
762:
77 .endm
78
79/*
80 * Wait until PLLA has locked.
81 */
82 .macro wait_pllalock
83 mov r4, #PLLALOCK_TIMEOUT
841: sub r4, r4, #1
85 cmp r4, #0
86 beq 2f
87 ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)]
88 tst r3, #AT91_PMC_LOCKA
89 beq 1b
902:
91 .endm
92
93/*
94 * Wait until PLLB has locked.
95 */
96 .macro wait_pllblock
97 mov r4, #PLLBLOCK_TIMEOUT
981: sub r4, r4, #1
99 cmp r4, #0
100 beq 2f
101 ldr r3, [r1, #(AT91_PMC_SR - AT91_PMC)]
102 tst r3, #AT91_PMC_LOCKB
103 beq 1b
1042:
105 .endm
106
107 .text
108
109ENTRY(at91_slow_clock)
110 /* Save registers on stack */
111 stmfd sp!, {r0 - r12, lr}
112
113 /*
114 * Register usage:
115 * R1 = Base address of AT91_PMC
116 * R2 = Base address of AT91_SDRAMC (or AT91_SYS on AT91RM9200)
117 * R3 = temporary register
118 * R4 = temporary register
119 */
120 ldr r1, .at91_va_base_pmc
121 ldr r2, .at91_va_base_sdramc
122
123 /* Drain write buffer */
124 mcr p15, 0, r0, c7, c10, 4
125
126#ifdef CONFIG_ARCH_AT91RM9200
127 /* Put SDRAM in self-refresh mode */
128 mov r3, #1
129 str r3, [r2, #AT91_SDRAMC_SRR]
130#elif defined(CONFIG_ARCH_AT91CAP9)
131 /* Enable SDRAM self-refresh mode */
132 ldr r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
133 str r3, .saved_sam9_lpr
134
135 mov r3, #AT91_DDRSDRC_LPCB_SELF_REFRESH
136 str r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
137#else
138 /* Enable SDRAM self-refresh mode */
139 ldr r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
140 str r3, .saved_sam9_lpr
141
142 mov r3, #AT91_SDRAMC_LPCB_SELF_REFRESH
143 str r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
144#endif
145
146 /* Save Master clock setting */
147 ldr r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)]
148 str r3, .saved_mckr
149
150 /*
151 * Set the Master clock source to slow clock
152 */
153 bic r3, r3, #AT91_PMC_CSS
154 str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)]
155
156 wait_mckrdy
157
158#ifdef SLOWDOWN_MASTER_CLOCK
159 /*
160 * Set the Master Clock PRES and MDIV fields.
161 *
162 * See AT91RM9200 errata #27 and #28 for details.
163 */
164 mov r3, #0
165 str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)]
166
167 wait_mckrdy
168#endif
169
170 /* Save PLLA setting and disable it */
171 ldr r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)]
172 str r3, .saved_pllar
173
174 mov r3, #AT91_PMC_PLLCOUNT
175 orr r3, r3, #(1 << 29) /* bit 29 always set */
176 str r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)]
177
178 wait_pllalock
179
180 /* Save PLLB setting and disable it */
181 ldr r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)]
182 str r3, .saved_pllbr
183
184 mov r3, #AT91_PMC_PLLCOUNT
185 str r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)]
186
187 wait_pllblock
188
189 /* Turn off the main oscillator */
190 ldr r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)]
191 bic r3, r3, #AT91_PMC_MOSCEN
192 str r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)]
193
194 /* Wait for interrupt */
195 mcr p15, 0, r0, c7, c0, 4
196
197 /* Turn on the main oscillator */
198 ldr r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)]
199 orr r3, r3, #AT91_PMC_MOSCEN
200 str r3, [r1, #(AT91_CKGR_MOR - AT91_PMC)]
201
202 wait_moscrdy
203
204 /* Restore PLLB setting */
205 ldr r3, .saved_pllbr
206 str r3, [r1, #(AT91_CKGR_PLLBR - AT91_PMC)]
207
208 wait_pllblock
209
210 /* Restore PLLA setting */
211 ldr r3, .saved_pllar
212 str r3, [r1, #(AT91_CKGR_PLLAR - AT91_PMC)]
213
214 wait_pllalock
215
216#ifdef SLOWDOWN_MASTER_CLOCK
217 /*
218 * First set PRES if it was not 0,
219 * than set CSS and MDIV fields.
220 *
221 * See AT91RM9200 errata #27 and #28 for details.
222 */
223 ldr r3, .saved_mckr
224 tst r3, #AT91_PMC_PRES
225 beq 2f
226 and r3, r3, #AT91_PMC_PRES
227 str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)]
228
229 wait_mckrdy
230#endif
231
232 /*
233 * Restore master clock setting
234 */
2352: ldr r3, .saved_mckr
236 str r3, [r1, #(AT91_PMC_MCKR - AT91_PMC)]
237
238 wait_mckrdy
239
240#ifdef CONFIG_ARCH_AT91RM9200
241 /* Do nothing - self-refresh is automatically disabled. */
242#elif defined(CONFIG_ARCH_AT91CAP9)
243 /* Restore LPR on AT91CAP9 */
244 ldr r3, .saved_sam9_lpr
245 str r3, [r2, #AT91_DDRSDRC_LPR - AT91_DDRSDRC]
246#else
247 /* Restore LPR on AT91SAM9 */
248 ldr r3, .saved_sam9_lpr
249 str r3, [r2, #AT91_SDRAMC_LPR - AT91_SDRAMC]
250#endif
251
252 /* Restore registers, and return */
253 ldmfd sp!, {r0 - r12, pc}
254
255
256.saved_mckr:
257 .word 0
258
259.saved_pllar:
260 .word 0
261
262.saved_pllbr:
263 .word 0
264
265.saved_sam9_lpr:
266 .word 0
267
268.at91_va_base_pmc:
269 .word AT91_VA_BASE_SYS + AT91_PMC
270
271#ifdef CONFIG_ARCH_AT91RM9200
272.at91_va_base_sdramc:
273 .word AT91_VA_BASE_SYS
274#elif defined(CONFIG_ARCH_AT91CAP9)
275.at91_va_base_sdramc:
276 .word AT91_VA_BASE_SYS + AT91_DDRSDRC
277#else
278.at91_va_base_sdramc:
279 .word AT91_VA_BASE_SYS + AT91_SDRAMC
280#endif
281
282ENTRY(at91_slow_clock_sz)
283 .word .-at91_slow_clock
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c
index e4796c67a83..d6a8193a1d2 100644
--- a/arch/avr32/kernel/asm-offsets.c
+++ b/arch/avr32/kernel/asm-offsets.c
@@ -4,6 +4,8 @@
4 * to extract and format the required data. 4 * to extract and format the required data.
5 */ 5 */
6 6
7#include <linux/mm.h>
8#include <linux/sched.h>
7#include <linux/thread_info.h> 9#include <linux/thread_info.h>
8#include <linux/kbuild.h> 10#include <linux/kbuild.h>
9 11
@@ -17,4 +19,8 @@ void foo(void)
17 OFFSET(TI_rar_saved, thread_info, rar_saved); 19 OFFSET(TI_rar_saved, thread_info, rar_saved);
18 OFFSET(TI_rsr_saved, thread_info, rsr_saved); 20 OFFSET(TI_rsr_saved, thread_info, rsr_saved);
19 OFFSET(TI_restart_block, thread_info, restart_block); 21 OFFSET(TI_restart_block, thread_info, restart_block);
22 BLANK();
23 OFFSET(TSK_active_mm, task_struct, active_mm);
24 BLANK();
25 OFFSET(MM_pgd, mm_struct, pgd);
20} 26}
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 2b398cae110..33d49377b8b 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -334,9 +334,64 @@ save_full_context_ex:
334 334
335 /* Low-level exception handlers */ 335 /* Low-level exception handlers */
336handle_critical: 336handle_critical:
337 /*
338 * AT32AP700x errata:
339 *
340 * After a Java stack overflow or underflow trap, any CPU
341 * memory access may cause erratic behavior. This will happen
342 * when the four least significant bits of the JOSP system
343 * register contains any value between 9 and 15 (inclusive).
344 *
345 * Possible workarounds:
346 * - Don't use the Java Extension Module
347 * - Ensure that the stack overflow and underflow trap
348 * handlers do not do any memory access or trigger any
349 * exceptions before the overflow/underflow condition is
350 * cleared (by incrementing or decrementing the JOSP)
351 * - Make sure that JOSP does not contain any problematic
352 * value before doing any exception or interrupt
353 * processing.
354 * - Set up a critical exception handler which writes a
355 * known-to-be-safe value, e.g. 4, to JOSP before doing
356 * any further processing.
357 *
358 * We'll use the last workaround for now since we cannot
359 * guarantee that user space processes don't use Java mode.
360 * Non-well-behaving userland will be terminated with extreme
361 * prejudice.
362 */
363#ifdef CONFIG_CPU_AT32AP700X
364 /*
365 * There's a chance we can't touch memory, so temporarily
366 * borrow PTBR to save the stack pointer while we fix things
367 * up...
368 */
369 mtsr SYSREG_PTBR, sp
370 mov sp, 4
371 mtsr SYSREG_JOSP, sp
372 mfsr sp, SYSREG_PTBR
373 sub pc, -2
374
375 /* Push most of pt_regs on stack. We'll do the rest later */
337 sub sp, 4 376 sub sp, 4
338 stmts --sp, r0-lr 377 pushm r0-r12
339 rcall save_full_context_ex 378
379 /* PTBR mirrors current_thread_info()->task->active_mm->pgd */
380 get_thread_info r0
381 ld.w r1, r0[TI_task]
382 ld.w r2, r1[TSK_active_mm]
383 ld.w r3, r2[MM_pgd]
384 mtsr SYSREG_PTBR, r3
385#else
386 sub sp, 4
387 pushm r0-r12
388#endif
389 sub r0, sp, -(14 * 4)
390 mov r1, lr
391 mfsr r2, SYSREG_RAR_EX
392 mfsr r3, SYSREG_RSR_EX
393 pushm r0-r3
394
340 mfsr r12, SYSREG_ECR 395 mfsr r12, SYSREG_ECR
341 mov r11, sp 396 mov r11, sp
342 rcall do_critical_exception 397 rcall do_critical_exception
diff --git a/arch/avr32/mach-at32ap/pm-at32ap700x.S b/arch/avr32/mach-at32ap/pm-at32ap700x.S
index 5be4de65b20..17503b0ed6c 100644
--- a/arch/avr32/mach-at32ap/pm-at32ap700x.S
+++ b/arch/avr32/mach-at32ap/pm-at32ap700x.S
@@ -134,7 +134,7 @@ pm_standby:
134 mov r11, SDRAMC_LPR_LPCB_SELF_RFR 134 mov r11, SDRAMC_LPR_LPCB_SELF_RFR
135 bfins r10, r11, 0, 2 /* LPCB <- self Refresh */ 135 bfins r10, r11, 0, 2 /* LPCB <- self Refresh */
136 sync 0 /* flush write buffer */ 136 sync 0 /* flush write buffer */
137 st.w r12[SDRAMC_LPR], r11 /* put SDRAM in self-refresh mode */ 137 st.w r12[SDRAMC_LPR], r10 /* put SDRAM in self-refresh mode */
138 ld.w r11, r12[SDRAMC_LPR] 138 ld.w r11, r12[SDRAMC_LPR]
139 unmask_interrupts 139 unmask_interrupts
140 sleep CPU_SLEEP_FROZEN 140 sleep CPU_SLEEP_FROZEN
diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h
index 7286e4a9fe8..a7acad2bc2f 100644
--- a/arch/ia64/include/asm/sections.h
+++ b/arch/ia64/include/asm/sections.h
@@ -21,5 +21,8 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b
21extern char __start_unwind[], __end_unwind[]; 21extern char __start_unwind[], __end_unwind[];
22extern char __start_ivt_text[], __end_ivt_text[]; 22extern char __start_ivt_text[], __end_ivt_text[];
23 23
24#undef dereference_function_descriptor
25void *dereference_function_descriptor(void *);
26
24#endif /* _ASM_IA64_SECTIONS_H */ 27#endif /* _ASM_IA64_SECTIONS_H */
25 28
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index 29aad349e0c..545626f66a4 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -31,9 +31,11 @@
31#include <linux/elf.h> 31#include <linux/elf.h>
32#include <linux/moduleloader.h> 32#include <linux/moduleloader.h>
33#include <linux/string.h> 33#include <linux/string.h>
34#include <linux/uaccess.h>
34#include <linux/vmalloc.h> 35#include <linux/vmalloc.h>
35 36
36#include <asm/patch.h> 37#include <asm/patch.h>
38#include <asm/sections.h>
37#include <asm/unaligned.h> 39#include <asm/unaligned.h>
38 40
39#define ARCH_MODULE_DEBUG 0 41#define ARCH_MODULE_DEBUG 0
@@ -941,3 +943,13 @@ module_arch_cleanup (struct module *mod)
941 if (mod->arch.core_unw_table) 943 if (mod->arch.core_unw_table)
942 unw_remove_unwind_table(mod->arch.core_unw_table); 944 unw_remove_unwind_table(mod->arch.core_unw_table);
943} 945}
946
947void *dereference_function_descriptor(void *ptr)
948{
949 struct fdesc *desc = ptr;
950 void *p;
951
952 if (!probe_kernel_address(&desc->ip, p))
953 ptr = p;
954 return ptr;
955}
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4da736e2533..49896a2a1d7 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1886,6 +1886,15 @@ config STACKTRACE_SUPPORT
1886 1886
1887source "init/Kconfig" 1887source "init/Kconfig"
1888 1888
1889config PROBE_INITRD_HEADER
1890 bool "Probe initrd header created by addinitrd"
1891 depends on BLK_DEV_INITRD
1892 help
1893 Probe initrd header at the last page of kernel image.
1894 Say Y here if you are using arch/mips/boot/addinitrd.c to
1895 add initrd or initramfs image to the kernel image.
1896 Otherwise, say N.
1897
1889menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)" 1898menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)"
1890 1899
1891config HW_HAS_EISA 1900config HW_HAS_EISA
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 2aae76bce29..16f8edfe5cd 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -160,30 +160,33 @@ early_param("rd_size", rd_size_early);
160static unsigned long __init init_initrd(void) 160static unsigned long __init init_initrd(void)
161{ 161{
162 unsigned long end; 162 unsigned long end;
163 u32 *initrd_header;
164 163
165 /* 164 /*
166 * Board specific code or command line parser should have 165 * Board specific code or command line parser should have
167 * already set up initrd_start and initrd_end. In these cases 166 * already set up initrd_start and initrd_end. In these cases
168 * perfom sanity checks and use them if all looks good. 167 * perfom sanity checks and use them if all looks good.
169 */ 168 */
170 if (initrd_start && initrd_end > initrd_start) 169 if (!initrd_start || initrd_end <= initrd_start) {
171 goto sanitize; 170#ifdef CONFIG_PROBE_INITRD_HEADER
171 u32 *initrd_header;
172 172
173 /* 173 /*
174 * See if initrd has been added to the kernel image by 174 * See if initrd has been added to the kernel image by
175 * arch/mips/boot/addinitrd.c. In that case a header is 175 * arch/mips/boot/addinitrd.c. In that case a header is
176 * prepended to initrd and is made up by 8 bytes. The fisrt 176 * prepended to initrd and is made up by 8 bytes. The first
177 * word is a magic number and the second one is the size of 177 * word is a magic number and the second one is the size of
178 * initrd. Initrd start must be page aligned in any cases. 178 * initrd. Initrd start must be page aligned in any cases.
179 */ 179 */
180 initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; 180 initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8;
181 if (initrd_header[0] != 0x494E5244) 181 if (initrd_header[0] != 0x494E5244)
182 goto disable;
183 initrd_start = (unsigned long)(initrd_header + 2);
184 initrd_end = initrd_start + initrd_header[1];
185#else
182 goto disable; 186 goto disable;
183 initrd_start = (unsigned long)(initrd_header + 2); 187#endif
184 initrd_end = initrd_start + initrd_header[1]; 188 }
185 189
186sanitize:
187 if (initrd_start & ~PAGE_MASK) { 190 if (initrd_start & ~PAGE_MASK) {
188 pr_err("initrd start must be page aligned\n"); 191 pr_err("initrd start must be page aligned\n");
189 goto disable; 192 goto disable;
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 426cced1e9d..6bee29097a5 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -373,8 +373,8 @@ void __noreturn die(const char * str, const struct pt_regs * regs)
373 do_exit(SIGSEGV); 373 do_exit(SIGSEGV);
374} 374}
375 375
376extern const struct exception_table_entry __start___dbe_table[]; 376extern struct exception_table_entry __start___dbe_table[];
377extern const struct exception_table_entry __stop___dbe_table[]; 377extern struct exception_table_entry __stop___dbe_table[];
378 378
379__asm__( 379__asm__(
380" .section __dbe_table, \"a\"\n" 380" .section __dbe_table, \"a\"\n"
@@ -1200,7 +1200,7 @@ void *set_except_vector(int n, void *addr)
1200 if (n == 0 && cpu_has_divec) { 1200 if (n == 0 && cpu_has_divec) {
1201 *(u32 *)(ebase + 0x200) = 0x08000000 | 1201 *(u32 *)(ebase + 0x200) = 0x08000000 |
1202 (0x03ffffff & (handler >> 2)); 1202 (0x03ffffff & (handler >> 2));
1203 flush_icache_range(ebase + 0x200, ebase + 0x204); 1203 local_flush_icache_range(ebase + 0x200, ebase + 0x204);
1204 } 1204 }
1205 return (void *)old_handler; 1205 return (void *)old_handler;
1206} 1206}
@@ -1283,7 +1283,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
1283 *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); 1283 *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff);
1284 w = (u32 *)(b + ori_offset); 1284 w = (u32 *)(b + ori_offset);
1285 *w = (*w & 0xffff0000) | ((u32)handler & 0xffff); 1285 *w = (*w & 0xffff0000) | ((u32)handler & 0xffff);
1286 flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len)); 1286 local_flush_icache_range((unsigned long)b,
1287 (unsigned long)(b+handler_len));
1287 } 1288 }
1288 else { 1289 else {
1289 /* 1290 /*
@@ -1295,7 +1296,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
1295 w = (u32 *)b; 1296 w = (u32 *)b;
1296 *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */ 1297 *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */
1297 *w = 0; 1298 *w = 0;
1298 flush_icache_range((unsigned long)b, (unsigned long)(b+8)); 1299 local_flush_icache_range((unsigned long)b,
1300 (unsigned long)(b+8));
1299 } 1301 }
1300 1302
1301 return (void *)old_handler; 1303 return (void *)old_handler;
@@ -1515,7 +1517,7 @@ void __cpuinit per_cpu_trap_init(void)
1515void __init set_handler(unsigned long offset, void *addr, unsigned long size) 1517void __init set_handler(unsigned long offset, void *addr, unsigned long size)
1516{ 1518{
1517 memcpy((void *)(ebase + offset), addr, size); 1519 memcpy((void *)(ebase + offset), addr, size);
1518 flush_icache_range(ebase + offset, ebase + offset + size); 1520 local_flush_icache_range(ebase + offset, ebase + offset + size);
1519} 1521}
1520 1522
1521static char panic_null_cerr[] __cpuinitdata = 1523static char panic_null_cerr[] __cpuinitdata =
@@ -1680,6 +1682,8 @@ void __init trap_init(void)
1680 signal32_init(); 1682 signal32_init();
1681#endif 1683#endif
1682 1684
1683 flush_icache_range(ebase, ebase + 0x400); 1685 local_flush_icache_range(ebase, ebase + 0x400);
1684 flush_tlb_handlers(); 1686 flush_tlb_handlers();
1687
1688 sort_extable(__start___dbe_table, __stop___dbe_table);
1685} 1689}
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 27a5b466c85..5500c20c79a 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -320,6 +320,7 @@ void __cpuinit r3k_cache_init(void)
320 flush_cache_range = r3k_flush_cache_range; 320 flush_cache_range = r3k_flush_cache_range;
321 flush_cache_page = r3k_flush_cache_page; 321 flush_cache_page = r3k_flush_cache_page;
322 flush_icache_range = r3k_flush_icache_range; 322 flush_icache_range = r3k_flush_icache_range;
323 local_flush_icache_range = r3k_flush_icache_range;
323 324
324 flush_cache_sigtramp = r3k_flush_cache_sigtramp; 325 flush_cache_sigtramp = r3k_flush_cache_sigtramp;
325 local_flush_data_cache_page = local_r3k_flush_data_cache_page; 326 local_flush_data_cache_page = local_r3k_flush_data_cache_page;
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 71df3390c07..6e99665ae86 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -543,12 +543,8 @@ struct flush_icache_range_args {
543 unsigned long end; 543 unsigned long end;
544}; 544};
545 545
546static inline void local_r4k_flush_icache_range(void *args) 546static inline void local_r4k_flush_icache_range(unsigned long start, unsigned long end)
547{ 547{
548 struct flush_icache_range_args *fir_args = args;
549 unsigned long start = fir_args->start;
550 unsigned long end = fir_args->end;
551
552 if (!cpu_has_ic_fills_f_dc) { 548 if (!cpu_has_ic_fills_f_dc) {
553 if (end - start >= dcache_size) { 549 if (end - start >= dcache_size) {
554 r4k_blast_dcache(); 550 r4k_blast_dcache();
@@ -564,6 +560,15 @@ static inline void local_r4k_flush_icache_range(void *args)
564 protected_blast_icache_range(start, end); 560 protected_blast_icache_range(start, end);
565} 561}
566 562
563static inline void local_r4k_flush_icache_range_ipi(void *args)
564{
565 struct flush_icache_range_args *fir_args = args;
566 unsigned long start = fir_args->start;
567 unsigned long end = fir_args->end;
568
569 local_r4k_flush_icache_range(start, end);
570}
571
567static void r4k_flush_icache_range(unsigned long start, unsigned long end) 572static void r4k_flush_icache_range(unsigned long start, unsigned long end)
568{ 573{
569 struct flush_icache_range_args args; 574 struct flush_icache_range_args args;
@@ -571,7 +576,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
571 args.start = start; 576 args.start = start;
572 args.end = end; 577 args.end = end;
573 578
574 r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1); 579 r4k_on_each_cpu(local_r4k_flush_icache_range_ipi, &args, 1);
575 instruction_hazard(); 580 instruction_hazard();
576} 581}
577 582
@@ -1375,6 +1380,7 @@ void __cpuinit r4k_cache_init(void)
1375 local_flush_data_cache_page = local_r4k_flush_data_cache_page; 1380 local_flush_data_cache_page = local_r4k_flush_data_cache_page;
1376 flush_data_cache_page = r4k_flush_data_cache_page; 1381 flush_data_cache_page = r4k_flush_data_cache_page;
1377 flush_icache_range = r4k_flush_icache_range; 1382 flush_icache_range = r4k_flush_icache_range;
1383 local_flush_icache_range = local_r4k_flush_icache_range;
1378 1384
1379#if defined(CONFIG_DMA_NONCOHERENT) 1385#if defined(CONFIG_DMA_NONCOHERENT)
1380 if (coherentio) { 1386 if (coherentio) {
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index a9f7f1f5e9b..f7c8f9ce39c 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -362,6 +362,7 @@ void __cpuinit tx39_cache_init(void)
362 flush_cache_range = (void *) tx39h_flush_icache_all; 362 flush_cache_range = (void *) tx39h_flush_icache_all;
363 flush_cache_page = (void *) tx39h_flush_icache_all; 363 flush_cache_page = (void *) tx39h_flush_icache_all;
364 flush_icache_range = (void *) tx39h_flush_icache_all; 364 flush_icache_range = (void *) tx39h_flush_icache_all;
365 local_flush_icache_range = (void *) tx39h_flush_icache_all;
365 366
366 flush_cache_sigtramp = (void *) tx39h_flush_icache_all; 367 flush_cache_sigtramp = (void *) tx39h_flush_icache_all;
367 local_flush_data_cache_page = (void *) tx39h_flush_icache_all; 368 local_flush_data_cache_page = (void *) tx39h_flush_icache_all;
@@ -390,6 +391,7 @@ void __cpuinit tx39_cache_init(void)
390 flush_cache_range = tx39_flush_cache_range; 391 flush_cache_range = tx39_flush_cache_range;
391 flush_cache_page = tx39_flush_cache_page; 392 flush_cache_page = tx39_flush_cache_page;
392 flush_icache_range = tx39_flush_icache_range; 393 flush_icache_range = tx39_flush_icache_range;
394 local_flush_icache_range = tx39_flush_icache_range;
393 395
394 flush_cache_sigtramp = tx39_flush_cache_sigtramp; 396 flush_cache_sigtramp = tx39_flush_cache_sigtramp;
395 local_flush_data_cache_page = local_tx39_flush_data_cache_page; 397 local_flush_data_cache_page = local_tx39_flush_data_cache_page;
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 034e8506f6e..1eb7c71e3d6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -29,6 +29,7 @@ void (*flush_cache_range)(struct vm_area_struct *vma, unsigned long start,
29void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, 29void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page,
30 unsigned long pfn); 30 unsigned long pfn);
31void (*flush_icache_range)(unsigned long start, unsigned long end); 31void (*flush_icache_range)(unsigned long start, unsigned long end);
32void (*local_flush_icache_range)(unsigned long start, unsigned long end);
32 33
33void (*__flush_cache_vmap)(void); 34void (*__flush_cache_vmap)(void);
34void (*__flush_cache_vunmap)(void); 35void (*__flush_cache_vunmap)(void);
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 76da73a5ab3..979cf919728 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -1273,10 +1273,10 @@ void __cpuinit build_tlb_refill_handler(void)
1273 1273
1274void __cpuinit flush_tlb_handlers(void) 1274void __cpuinit flush_tlb_handlers(void)
1275{ 1275{
1276 flush_icache_range((unsigned long)handle_tlbl, 1276 local_flush_icache_range((unsigned long)handle_tlbl,
1277 (unsigned long)handle_tlbl + sizeof(handle_tlbl)); 1277 (unsigned long)handle_tlbl + sizeof(handle_tlbl));
1278 flush_icache_range((unsigned long)handle_tlbs, 1278 local_flush_icache_range((unsigned long)handle_tlbs,
1279 (unsigned long)handle_tlbs + sizeof(handle_tlbs)); 1279 (unsigned long)handle_tlbs + sizeof(handle_tlbs));
1280 flush_icache_range((unsigned long)handle_tlbm, 1280 local_flush_icache_range((unsigned long)handle_tlbm,
1281 (unsigned long)handle_tlbm + sizeof(handle_tlbm)); 1281 (unsigned long)handle_tlbm + sizeof(handle_tlbm));
1282} 1282}
diff --git a/arch/mips/sgi-ip22/ip22-platform.c b/arch/mips/sgi-ip22/ip22-platform.c
index 60141235ec4..52486c4d2b0 100644
--- a/arch/mips/sgi-ip22/ip22-platform.c
+++ b/arch/mips/sgi-ip22/ip22-platform.c
@@ -150,7 +150,7 @@ static int __init sgiseeq_devinit(void)
150 return res; 150 return res;
151 151
152 /* Second HPC is missing? */ 152 /* Second HPC is missing? */
153 if (!ip22_is_fullhouse() || 153 if (ip22_is_fullhouse() ||
154 get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1])) 154 get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]))
155 return 0; 155 return 0;
156 156
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 0afe94c48fb..fe6bee09cec 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -53,6 +53,7 @@ txx9_reg_res_init(unsigned int pcode, unsigned long base, unsigned long size)
53 txx9_ce_res[i].name = txx9_ce_res_name[i]; 53 txx9_ce_res[i].name = txx9_ce_res_name[i];
54 } 54 }
55 55
56 txx9_pcode = pcode;
56 sprintf(txx9_pcode_str, "TX%x", pcode); 57 sprintf(txx9_pcode_str, "TX%x", pcode);
57 if (base) { 58 if (base) {
58 txx9_reg_res.start = base & 0xfffffffffULL; 59 txx9_reg_res.start = base & 0xfffffffffULL;
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index fdacdd4341c..44138c3e6ea 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -47,7 +47,9 @@
47#include <linux/string.h> 47#include <linux/string.h>
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/bug.h> 49#include <linux/bug.h>
50#include <linux/uaccess.h>
50 51
52#include <asm/sections.h>
51#include <asm/unwind.h> 53#include <asm/unwind.h>
52 54
53#if 0 55#if 0
@@ -860,3 +862,15 @@ void module_arch_cleanup(struct module *mod)
860 deregister_unwind_table(mod); 862 deregister_unwind_table(mod);
861 module_bug_cleanup(mod); 863 module_bug_cleanup(mod);
862} 864}
865
866#ifdef CONFIG_64BIT
867void *dereference_function_descriptor(void *ptr)
868{
869 Elf64_Fdesc *desc = ptr;
870 void *p;
871
872 if (!probe_kernel_address(&desc->addr, p))
873 ptr = p;
874 return ptr;
875}
876#endif
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 9155c9312c1..c6be19e9cea 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -116,6 +116,11 @@ ifeq ($(CONFIG_6xx),y)
116KBUILD_CFLAGS += -mcpu=powerpc 116KBUILD_CFLAGS += -mcpu=powerpc
117endif 117endif
118 118
119# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
120ifeq ($(CONFIG_FTRACE),y)
121KBUILD_CFLAGS += -mno-sched-epilog
122endif
123
119cpu-as-$(CONFIG_4xx) += -Wa,-m405 124cpu-as-$(CONFIG_4xx) += -Wa,-m405
120cpu-as-$(CONFIG_6xx) += -Wa,-maltivec 125cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
121cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec 126cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 14174aa2407..717a3bc1352 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -49,7 +49,7 @@ zlib := inffast.c inflate.c inftrees.c
49zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 49zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
50zliblinuxheader := zlib.h zconf.h zutil.h 50zliblinuxheader := zlib.h zconf.h zutil.h
51 51
52$(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ 52$(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \
53 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) 53 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
54 54
55src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c 55src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index db0b8f3b880..4597c491e9b 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -153,12 +153,10 @@
153#define __S110 PAGE_SHARED_X 153#define __S110 PAGE_SHARED_X
154#define __S111 PAGE_SHARED_X 154#define __S111 PAGE_SHARED_X
155 155
156#ifdef CONFIG_HUGETLB_PAGE 156#ifdef CONFIG_PPC_MM_SLICES
157
158#define HAVE_ARCH_UNMAPPED_AREA 157#define HAVE_ARCH_UNMAPPED_AREA
159#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN 158#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
160 159#endif /* CONFIG_PPC_MM_SLICES */
161#endif
162 160
163#ifndef __ASSEMBLY__ 161#ifndef __ASSEMBLY__
164 162
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
index 916018e425c..7710e9e6660 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -16,6 +16,9 @@ static inline int in_kernel_text(unsigned long addr)
16 return 0; 16 return 0;
17} 17}
18 18
19#undef dereference_function_descriptor
20void *dereference_function_descriptor(void *);
21
19#endif 22#endif
20 23
21#endif /* __KERNEL__ */ 24#endif /* __KERNEL__ */
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 64f5948ebc9..946daea780f 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -14,12 +14,13 @@ endif
14 14
15ifdef CONFIG_FTRACE 15ifdef CONFIG_FTRACE
16# Do not trace early boot code 16# Do not trace early boot code
17CFLAGS_REMOVE_cputable.o = -pg 17CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
18CFLAGS_REMOVE_prom_init.o = -pg 18CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
19CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
19 20
20ifdef CONFIG_DYNAMIC_FTRACE 21ifdef CONFIG_DYNAMIC_FTRACE
21# dynamic ftrace setup. 22# dynamic ftrace setup.
22CFLAGS_REMOVE_ftrace.o = -pg 23CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog
23endif 24endif
24 25
25endif 26endif
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 367129789cc..5af4e9b2dbe 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -647,7 +647,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg,
647 unsigned int flags, unsigned int length) 647 unsigned int flags, unsigned int length)
648{ 648{
649 char *ptr = (char *) &current->thread.TS_FPR(reg); 649 char *ptr = (char *) &current->thread.TS_FPR(reg);
650 int ret; 650 int ret = 0;
651 651
652 flush_vsx_to_thread(current); 652 flush_vsx_to_thread(current);
653 653
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S
index 019b02d8844..15c611de1ee 100644
--- a/arch/powerpc/kernel/idle_6xx.S
+++ b/arch/powerpc/kernel/idle_6xx.S
@@ -158,7 +158,7 @@ _GLOBAL(power_save_ppc32_restore)
158 stw r9,_NIP(r11) /* make it do a blr */ 158 stw r9,_NIP(r11) /* make it do a blr */
159 159
160#ifdef CONFIG_SMP 160#ifdef CONFIG_SMP
161 mfspr r12,SPRN_SPRG3 161 rlwinm r12,r11,0,0,31-THREAD_SHIFT
162 lwz r11,TI_CPU(r12) /* get cpu number * 4 */ 162 lwz r11,TI_CPU(r12) /* get cpu number * 4 */
163 slwi r11,r11,2 163 slwi r11,r11,2
164#else 164#else
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
index 06304034b39..47a1a983ff8 100644
--- a/arch/powerpc/kernel/idle_e500.S
+++ b/arch/powerpc/kernel/idle_e500.S
@@ -84,10 +84,11 @@ _GLOBAL(power_save_ppc32_restore)
84 stw r9,_NIP(r11) /* make it do a blr */ 84 stw r9,_NIP(r11) /* make it do a blr */
85 85
86#ifdef CONFIG_SMP 86#ifdef CONFIG_SMP
87 mfspr r12,SPRN_SPRG3 87 rlwinm r12,r1,0,0,31-THREAD_SHIFT
88 lwz r11,TI_CPU(r12) /* get cpu number * 4 */ 88 lwz r11,TI_CPU(r12) /* get cpu number * 4 */
89 slwi r11,r11,2 89 slwi r11,r11,2
90#else 90#else
91 li r11,0 91 li r11,0
92#endif 92#endif
93
93 b transfer_to_handler_cont 94 b transfer_to_handler_cont
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c
index ee6a2982d56..ad79de272ff 100644
--- a/arch/powerpc/kernel/module_64.c
+++ b/arch/powerpc/kernel/module_64.c
@@ -21,8 +21,9 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/vmalloc.h> 22#include <linux/vmalloc.h>
23#include <linux/bug.h> 23#include <linux/bug.h>
24#include <linux/uaccess.h>
24#include <asm/module.h> 25#include <asm/module.h>
25#include <asm/uaccess.h> 26#include <asm/sections.h>
26#include <asm/firmware.h> 27#include <asm/firmware.h>
27#include <asm/code-patching.h> 28#include <asm/code-patching.h>
28#include <linux/sort.h> 29#include <linux/sort.h>
@@ -451,3 +452,13 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
451 452
452 return 0; 453 return 0;
453} 454}
455
456void *dereference_function_descriptor(void *ptr)
457{
458 struct ppc64_opd_entry *desc = ptr;
459 void *p;
460
461 if (!probe_kernel_address(&desc->funcaddr, p))
462 ptr = p;
463 return ptr;
464}
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 4a8ce62fe11..9f6c1ca1739 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -66,11 +66,12 @@ SECTIONS
66 __got2_end = .; 66 __got2_end = .;
67#endif /* CONFIG_PPC32 */ 67#endif /* CONFIG_PPC32 */
68 68
69 . = ALIGN(PAGE_SIZE);
70 _etext = .;
71 PROVIDE32 (etext = .);
72 } :kernel 69 } :kernel
73 70
71 . = ALIGN(PAGE_SIZE);
72 _etext = .;
73 PROVIDE32 (etext = .);
74
74 /* Read-only data */ 75 /* Read-only data */
75 RODATA 76 RODATA
76 77
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 14be408dfc9..8920eea3452 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -191,12 +191,17 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
191 unsigned long hash, hpteg; 191 unsigned long hash, hpteg;
192 unsigned long vsid = get_kernel_vsid(vaddr, ssize); 192 unsigned long vsid = get_kernel_vsid(vaddr, ssize);
193 unsigned long va = hpt_va(vaddr, vsid, ssize); 193 unsigned long va = hpt_va(vaddr, vsid, ssize);
194 unsigned long tprot = prot;
195
196 /* Make kernel text executable */
197 if (in_kernel_text(vaddr))
198 tprot &= ~HPTE_R_N;
194 199
195 hash = hpt_hash(va, shift, ssize); 200 hash = hpt_hash(va, shift, ssize);
196 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 201 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
197 202
198 BUG_ON(!ppc_md.hpte_insert); 203 BUG_ON(!ppc_md.hpte_insert);
199 ret = ppc_md.hpte_insert(hpteg, va, paddr, prot, 204 ret = ppc_md.hpte_insert(hpteg, va, paddr, tprot,
200 HPTE_V_BOLTED, psize, ssize); 205 HPTE_V_BOLTED, psize, ssize);
201 206
202 if (ret < 0) 207 if (ret < 0)
@@ -584,7 +589,7 @@ void __init htab_initialize(void)
584{ 589{
585 unsigned long table; 590 unsigned long table;
586 unsigned long pteg_count; 591 unsigned long pteg_count;
587 unsigned long prot, tprot; 592 unsigned long prot;
588 unsigned long base = 0, size = 0, limit; 593 unsigned long base = 0, size = 0, limit;
589 int i; 594 int i;
590 595
@@ -660,10 +665,9 @@ void __init htab_initialize(void)
660 for (i=0; i < lmb.memory.cnt; i++) { 665 for (i=0; i < lmb.memory.cnt; i++) {
661 base = (unsigned long)__va(lmb.memory.region[i].base); 666 base = (unsigned long)__va(lmb.memory.region[i].base);
662 size = lmb.memory.region[i].size; 667 size = lmb.memory.region[i].size;
663 tprot = prot | (in_kernel_text(base) ? _PAGE_EXEC : 0);
664 668
665 DBG("creating mapping for region: %lx..%lx (prot: %x)\n", 669 DBG("creating mapping for region: %lx..%lx (prot: %x)\n",
666 base, size, tprot); 670 base, size, prot);
667 671
668#ifdef CONFIG_U3_DART 672#ifdef CONFIG_U3_DART
669 /* Do not map the DART space. Fortunately, it will be aligned 673 /* Do not map the DART space. Fortunately, it will be aligned
@@ -680,21 +684,21 @@ void __init htab_initialize(void)
680 unsigned long dart_table_end = dart_tablebase + 16 * MB; 684 unsigned long dart_table_end = dart_tablebase + 16 * MB;
681 if (base != dart_tablebase) 685 if (base != dart_tablebase)
682 BUG_ON(htab_bolt_mapping(base, dart_tablebase, 686 BUG_ON(htab_bolt_mapping(base, dart_tablebase,
683 __pa(base), tprot, 687 __pa(base), prot,
684 mmu_linear_psize, 688 mmu_linear_psize,
685 mmu_kernel_ssize)); 689 mmu_kernel_ssize));
686 if ((base + size) > dart_table_end) 690 if ((base + size) > dart_table_end)
687 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, 691 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB,
688 base + size, 692 base + size,
689 __pa(dart_table_end), 693 __pa(dart_table_end),
690 tprot, 694 prot,
691 mmu_linear_psize, 695 mmu_linear_psize,
692 mmu_kernel_ssize)); 696 mmu_kernel_ssize));
693 continue; 697 continue;
694 } 698 }
695#endif /* CONFIG_U3_DART */ 699#endif /* CONFIG_U3_DART */
696 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), 700 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base),
697 tprot, mmu_linear_psize, mmu_kernel_ssize)); 701 prot, mmu_linear_psize, mmu_kernel_ssize));
698 } 702 }
699 703
700 /* 704 /*
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 1c1b627ee84..67595bc380d 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -643,9 +643,10 @@ static struct spu *find_victim(struct spu_context *ctx)
643 !(tmp->flags & SPU_CREATE_NOSCHED) && 643 !(tmp->flags & SPU_CREATE_NOSCHED) &&
644 (!victim || tmp->prio > victim->prio)) { 644 (!victim || tmp->prio > victim->prio)) {
645 victim = spu->ctx; 645 victim = spu->ctx;
646 get_spu_context(victim);
647 } 646 }
648 } 647 }
648 if (victim)
649 get_spu_context(victim);
649 mutex_unlock(&cbe_spu_info[node].list_mutex); 650 mutex_unlock(&cbe_spu_info[node].list_mutex);
650 651
651 if (victim) { 652 if (victim) {
@@ -727,17 +728,33 @@ static void spu_schedule(struct spu *spu, struct spu_context *ctx)
727 /* not a candidate for interruptible because it's called either 728 /* not a candidate for interruptible because it's called either
728 from the scheduler thread or from spu_deactivate */ 729 from the scheduler thread or from spu_deactivate */
729 mutex_lock(&ctx->state_mutex); 730 mutex_lock(&ctx->state_mutex);
730 __spu_schedule(spu, ctx); 731 if (ctx->state == SPU_STATE_SAVED)
732 __spu_schedule(spu, ctx);
731 spu_release(ctx); 733 spu_release(ctx);
732} 734}
733 735
734static void spu_unschedule(struct spu *spu, struct spu_context *ctx) 736/**
737 * spu_unschedule - remove a context from a spu, and possibly release it.
738 * @spu: The SPU to unschedule from
739 * @ctx: The context currently scheduled on the SPU
740 * @free_spu Whether to free the SPU for other contexts
741 *
742 * Unbinds the context @ctx from the SPU @spu. If @free_spu is non-zero, the
743 * SPU is made available for other contexts (ie, may be returned by
744 * spu_get_idle). If this is zero, the caller is expected to schedule another
745 * context to this spu.
746 *
747 * Should be called with ctx->state_mutex held.
748 */
749static void spu_unschedule(struct spu *spu, struct spu_context *ctx,
750 int free_spu)
735{ 751{
736 int node = spu->node; 752 int node = spu->node;
737 753
738 mutex_lock(&cbe_spu_info[node].list_mutex); 754 mutex_lock(&cbe_spu_info[node].list_mutex);
739 cbe_spu_info[node].nr_active--; 755 cbe_spu_info[node].nr_active--;
740 spu->alloc_state = SPU_FREE; 756 if (free_spu)
757 spu->alloc_state = SPU_FREE;
741 spu_unbind_context(spu, ctx); 758 spu_unbind_context(spu, ctx);
742 ctx->stats.invol_ctx_switch++; 759 ctx->stats.invol_ctx_switch++;
743 spu->stats.invol_ctx_switch++; 760 spu->stats.invol_ctx_switch++;
@@ -837,7 +854,7 @@ static int __spu_deactivate(struct spu_context *ctx, int force, int max_prio)
837 if (spu) { 854 if (spu) {
838 new = grab_runnable_context(max_prio, spu->node); 855 new = grab_runnable_context(max_prio, spu->node);
839 if (new || force) { 856 if (new || force) {
840 spu_unschedule(spu, ctx); 857 spu_unschedule(spu, ctx, new == NULL);
841 if (new) { 858 if (new) {
842 if (new->flags & SPU_CREATE_NOSCHED) 859 if (new->flags & SPU_CREATE_NOSCHED)
843 wake_up(&new->stop_wq); 860 wake_up(&new->stop_wq);
@@ -910,7 +927,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
910 927
911 new = grab_runnable_context(ctx->prio + 1, spu->node); 928 new = grab_runnable_context(ctx->prio + 1, spu->node);
912 if (new) { 929 if (new) {
913 spu_unschedule(spu, ctx); 930 spu_unschedule(spu, ctx, 0);
914 if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) 931 if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
915 spu_add_to_rq(ctx); 932 spu_add_to_rq(ctx);
916 } else { 933 } else {
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile
index 58ecdd72630..be60d64be7a 100644
--- a/arch/powerpc/platforms/powermac/Makefile
+++ b/arch/powerpc/platforms/powermac/Makefile
@@ -2,7 +2,7 @@ CFLAGS_bootx_init.o += -fPIC
2 2
3ifdef CONFIG_FTRACE 3ifdef CONFIG_FTRACE
4# Do not trace early boot code 4# Do not trace early boot code
5CFLAGS_REMOVE_bootx_init.o = -pg 5CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog
6endif 6endif
7 7
8obj-y += pic.o setup.o time.o feature.o pci.o \ 8obj-y += pic.o setup.o time.o feature.o pci.o \
diff --git a/arch/s390/kernel/compat_ptrace.h b/arch/s390/kernel/compat_ptrace.h
index cde81fa64f8..a2be3a978d5 100644
--- a/arch/s390/kernel/compat_ptrace.h
+++ b/arch/s390/kernel/compat_ptrace.h
@@ -42,6 +42,7 @@ struct user_regs_struct32
42 u32 gprs[NUM_GPRS]; 42 u32 gprs[NUM_GPRS];
43 u32 acrs[NUM_ACRS]; 43 u32 acrs[NUM_ACRS];
44 u32 orig_gpr2; 44 u32 orig_gpr2;
45 /* nb: there's a 4-byte hole here */
45 s390_fp_regs fp_regs; 46 s390_fp_regs fp_regs;
46 /* 47 /*
47 * These per registers are in here so that gdb can modify them 48 * These per registers are in here so that gdb can modify them
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 2815bfe348a..c8b08289eb8 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -170,6 +170,13 @@ static unsigned long __peek_user(struct task_struct *child, addr_t addr)
170 */ 170 */
171 tmp = (addr_t) task_pt_regs(child)->orig_gpr2; 171 tmp = (addr_t) task_pt_regs(child)->orig_gpr2;
172 172
173 } else if (addr < (addr_t) &dummy->regs.fp_regs) {
174 /*
175 * prevent reads of padding hole between
176 * orig_gpr2 and fp_regs on s390.
177 */
178 tmp = 0;
179
173 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { 180 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) {
174 /* 181 /*
175 * floating point regs. are stored in the thread structure 182 * floating point regs. are stored in the thread structure
@@ -270,6 +277,13 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
270 */ 277 */
271 task_pt_regs(child)->orig_gpr2 = data; 278 task_pt_regs(child)->orig_gpr2 = data;
272 279
280 } else if (addr < (addr_t) &dummy->regs.fp_regs) {
281 /*
282 * prevent writes of padding hole between
283 * orig_gpr2 and fp_regs on s390.
284 */
285 return 0;
286
273 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { 287 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) {
274 /* 288 /*
275 * floating point regs. are stored in the thread structure 289 * floating point regs. are stored in the thread structure
@@ -428,6 +442,13 @@ static u32 __peek_user_compat(struct task_struct *child, addr_t addr)
428 */ 442 */
429 tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4); 443 tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4);
430 444
445 } else if (addr < (addr_t) &dummy32->regs.fp_regs) {
446 /*
447 * prevent reads of padding hole between
448 * orig_gpr2 and fp_regs on s390.
449 */
450 tmp = 0;
451
431 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { 452 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) {
432 /* 453 /*
433 * floating point regs. are stored in the thread structure 454 * floating point regs. are stored in the thread structure
@@ -514,6 +535,13 @@ static int __poke_user_compat(struct task_struct *child,
514 */ 535 */
515 *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp; 536 *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp;
516 537
538 } else if (addr < (addr_t) &dummy32->regs.fp_regs) {
539 /*
540 * prevent writess of padding hole between
541 * orig_gpr2 and fp_regs on s390.
542 */
543 return 0;
544
517 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { 545 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) {
518 /* 546 /*
519 * floating point regs. are stored in the thread structure 547 * floating point regs. are stored in the thread structure
diff --git a/arch/sh/configs/ap325rxa_defconfig b/arch/sh/configs/ap325rxa_defconfig
index 29926a9b9ce..851c870adf3 100644
--- a/arch/sh/configs/ap325rxa_defconfig
+++ b/arch/sh/configs/ap325rxa_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.26 3# Linux kernel version: 2.6.27-rc4
4# Wed Jul 30 01:18:59 2008 4# Tue Aug 26 14:21:17 2008
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
14CONFIG_GENERIC_IRQ_PROBE=y 15CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_CALIBRATE_DELAY=y 16CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_GENERIC_TIME=y 17CONFIG_GENERIC_TIME=y
@@ -20,7 +21,6 @@ CONFIG_LOCKDEP_SUPPORT=y
20# CONFIG_ARCH_HAS_ILOG2_U32 is not set 21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_ARCH_NO_VIRT_TO_BUS=y 23CONFIG_ARCH_NO_VIRT_TO_BUS=y
23CONFIG_ARCH_SUPPORTS_AOUT=y
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25 25
26# 26#
@@ -58,7 +58,6 @@ CONFIG_SYSCTL=y
58CONFIG_EMBEDDED=y 58CONFIG_EMBEDDED=y
59CONFIG_UID16=y 59CONFIG_UID16=y
60CONFIG_SYSCTL_SYSCALL=y 60CONFIG_SYSCTL_SYSCALL=y
61CONFIG_SYSCTL_SYSCALL_CHECK=y
62# CONFIG_KALLSYMS is not set 61# CONFIG_KALLSYMS is not set
63CONFIG_HOTPLUG=y 62CONFIG_HOTPLUG=y
64CONFIG_PRINTK=y 63CONFIG_PRINTK=y
@@ -89,6 +88,7 @@ CONFIG_HAVE_OPROFILE=y
89# CONFIG_USE_GENERIC_SMP_HELPERS is not set 88# CONFIG_USE_GENERIC_SMP_HELPERS is not set
90CONFIG_HAVE_CLK=y 89CONFIG_HAVE_CLK=y
91CONFIG_PROC_PAGE_MONITOR=y 90CONFIG_PROC_PAGE_MONITOR=y
91CONFIG_HAVE_GENERIC_DMA_COHERENT=y
92CONFIG_SLABINFO=y 92CONFIG_SLABINFO=y
93CONFIG_RT_MUTEXES=y 93CONFIG_RT_MUTEXES=y
94# CONFIG_TINY_SHMEM is not set 94# CONFIG_TINY_SHMEM is not set
@@ -261,9 +261,10 @@ CONFIG_HZ_250=y
261# CONFIG_HZ_300 is not set 261# CONFIG_HZ_300 is not set
262# CONFIG_HZ_1000 is not set 262# CONFIG_HZ_1000 is not set
263CONFIG_HZ=250 263CONFIG_HZ=250
264# CONFIG_SCHED_HRTICK is not set 264CONFIG_SCHED_HRTICK=y
265# CONFIG_KEXEC is not set 265# CONFIG_KEXEC is not set
266# CONFIG_CRASH_DUMP is not set 266# CONFIG_CRASH_DUMP is not set
267CONFIG_SECCOMP=y
267# CONFIG_PREEMPT_NONE is not set 268# CONFIG_PREEMPT_NONE is not set
268# CONFIG_PREEMPT_VOLUNTARY is not set 269# CONFIG_PREEMPT_VOLUNTARY is not set
269CONFIG_PREEMPT=y 270CONFIG_PREEMPT=y
@@ -289,10 +290,6 @@ CONFIG_CMDLINE="console=tty1 console=ttySC5,38400 root=/dev/nfs ip=dhcp"
289# 290#
290CONFIG_BINFMT_ELF=y 291CONFIG_BINFMT_ELF=y
291# CONFIG_BINFMT_MISC is not set 292# CONFIG_BINFMT_MISC is not set
292
293#
294# Networking
295#
296CONFIG_NET=y 293CONFIG_NET=y
297 294
298# 295#
@@ -647,6 +644,7 @@ CONFIG_SSB_POSSIBLE=y
647# CONFIG_MFD_CORE is not set 644# CONFIG_MFD_CORE is not set
648# CONFIG_MFD_SM501 is not set 645# CONFIG_MFD_SM501 is not set
649# CONFIG_HTC_PASIC3 is not set 646# CONFIG_HTC_PASIC3 is not set
647# CONFIG_MFD_TMIO is not set
650 648
651# 649#
652# Multimedia devices 650# Multimedia devices
@@ -690,7 +688,10 @@ CONFIG_DUMMY_CONSOLE=y
690# CONFIG_ACCESSIBILITY is not set 688# CONFIG_ACCESSIBILITY is not set
691# CONFIG_RTC_CLASS is not set 689# CONFIG_RTC_CLASS is not set
692# CONFIG_DMADEVICES is not set 690# CONFIG_DMADEVICES is not set
693# CONFIG_UIO is not set 691CONFIG_UIO=y
692# CONFIG_UIO_PDRV is not set
693CONFIG_UIO_PDRV_GENIRQ=y
694# CONFIG_UIO_SMX is not set
694 695
695# 696#
696# File systems 697# File systems
@@ -854,6 +855,7 @@ CONFIG_FRAME_WARN=1024
854# CONFIG_DEBUG_KERNEL is not set 855# CONFIG_DEBUG_KERNEL is not set
855# CONFIG_DEBUG_BUGVERBOSE is not set 856# CONFIG_DEBUG_BUGVERBOSE is not set
856# CONFIG_DEBUG_MEMORY_INIT is not set 857# CONFIG_DEBUG_MEMORY_INIT is not set
858CONFIG_SYSCTL_SYSCALL_CHECK=y
857# CONFIG_SAMPLES is not set 859# CONFIG_SAMPLES is not set
858# CONFIG_SH_STANDARD_BIOS is not set 860# CONFIG_SH_STANDARD_BIOS is not set
859# CONFIG_EARLY_SCIF_CONSOLE is not set 861# CONFIG_EARLY_SCIF_CONSOLE is not set
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig
index c4b3e1d8950..4f8b1974f2c 100644
--- a/arch/sh/configs/migor_defconfig
+++ b/arch/sh/configs/migor_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.26 3# Linux kernel version: 2.6.27-rc4
4# Wed Jul 30 01:44:41 2008 4# Tue Aug 26 14:18:17 2008
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y 7CONFIG_SUPERH32=y
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
14CONFIG_GENERIC_IRQ_PROBE=y 15CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_CALIBRATE_DELAY=y 16CONFIG_GENERIC_CALIBRATE_DELAY=y
16CONFIG_GENERIC_TIME=y 17CONFIG_GENERIC_TIME=y
@@ -21,7 +22,6 @@ CONFIG_LOCKDEP_SUPPORT=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 22# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set 23# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_ARCH_NO_VIRT_TO_BUS=y 24CONFIG_ARCH_NO_VIRT_TO_BUS=y
24CONFIG_ARCH_SUPPORTS_AOUT=y
25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26 26
27# 27#
@@ -87,6 +87,7 @@ CONFIG_HAVE_OPROFILE=y
87# CONFIG_USE_GENERIC_SMP_HELPERS is not set 87# CONFIG_USE_GENERIC_SMP_HELPERS is not set
88CONFIG_HAVE_CLK=y 88CONFIG_HAVE_CLK=y
89CONFIG_PROC_PAGE_MONITOR=y 89CONFIG_PROC_PAGE_MONITOR=y
90CONFIG_HAVE_GENERIC_DMA_COHERENT=y
90CONFIG_SLABINFO=y 91CONFIG_SLABINFO=y
91CONFIG_RT_MUTEXES=y 92CONFIG_RT_MUTEXES=y
92# CONFIG_TINY_SHMEM is not set 93# CONFIG_TINY_SHMEM is not set
@@ -270,6 +271,7 @@ CONFIG_HZ=250
270# CONFIG_SCHED_HRTICK is not set 271# CONFIG_SCHED_HRTICK is not set
271# CONFIG_KEXEC is not set 272# CONFIG_KEXEC is not set
272# CONFIG_CRASH_DUMP is not set 273# CONFIG_CRASH_DUMP is not set
274CONFIG_SECCOMP=y
273CONFIG_PREEMPT_NONE=y 275CONFIG_PREEMPT_NONE=y
274# CONFIG_PREEMPT_VOLUNTARY is not set 276# CONFIG_PREEMPT_VOLUNTARY is not set
275# CONFIG_PREEMPT is not set 277# CONFIG_PREEMPT is not set
@@ -294,10 +296,6 @@ CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ip=on"
294# 296#
295CONFIG_BINFMT_ELF=y 297CONFIG_BINFMT_ELF=y
296# CONFIG_BINFMT_MISC is not set 298# CONFIG_BINFMT_MISC is not set
297
298#
299# Networking
300#
301CONFIG_NET=y 299CONFIG_NET=y
302 300
303# 301#
@@ -649,6 +647,7 @@ CONFIG_HW_RANDOM=y
649CONFIG_I2C=y 647CONFIG_I2C=y
650CONFIG_I2C_BOARDINFO=y 648CONFIG_I2C_BOARDINFO=y
651# CONFIG_I2C_CHARDEV is not set 649# CONFIG_I2C_CHARDEV is not set
650CONFIG_I2C_HELPER_AUTO=y
652 651
653# 652#
654# I2C Hardware Bus support 653# I2C Hardware Bus support
@@ -709,6 +708,7 @@ CONFIG_SSB_POSSIBLE=y
709# CONFIG_MFD_CORE is not set 708# CONFIG_MFD_CORE is not set
710# CONFIG_MFD_SM501 is not set 709# CONFIG_MFD_SM501 is not set
711# CONFIG_HTC_PASIC3 is not set 710# CONFIG_HTC_PASIC3 is not set
711# CONFIG_MFD_TMIO is not set
712 712
713# 713#
714# Multimedia devices 714# Multimedia devices
@@ -755,6 +755,8 @@ CONFIG_USB_ARCH_HAS_HCD=y
755# CONFIG_USB is not set 755# CONFIG_USB is not set
756# CONFIG_USB_OTG_WHITELIST is not set 756# CONFIG_USB_OTG_WHITELIST is not set
757# CONFIG_USB_OTG_BLACKLIST_HUB is not set 757# CONFIG_USB_OTG_BLACKLIST_HUB is not set
758# CONFIG_USB_MUSB_HDRC is not set
759# CONFIG_USB_GADGET_MUSB_HDRC is not set
758 760
759# 761#
760# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 762# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -842,7 +844,10 @@ CONFIG_RTC_DRV_RS5C372=y
842# 844#
843CONFIG_RTC_DRV_SH=y 845CONFIG_RTC_DRV_SH=y
844# CONFIG_DMADEVICES is not set 846# CONFIG_DMADEVICES is not set
845# CONFIG_UIO is not set 847CONFIG_UIO=y
848# CONFIG_UIO_PDRV is not set
849CONFIG_UIO_PDRV_GENIRQ=y
850# CONFIG_UIO_SMX is not set
846 851
847# 852#
848# File systems 853# File systems
diff --git a/arch/sh/include/asm/uaccess_64.h b/arch/sh/include/asm/uaccess_64.h
index 81b3d515fcb..5580fd47100 100644
--- a/arch/sh/include/asm/uaccess_64.h
+++ b/arch/sh/include/asm/uaccess_64.h
@@ -76,4 +76,6 @@ extern long __put_user_asm_l(void *, long);
76extern long __put_user_asm_q(void *, long); 76extern long __put_user_asm_q(void *, long);
77extern void __put_user_unknown(void); 77extern void __put_user_unknown(void);
78 78
79extern long __strnlen_user(const char *__s, long __n);
80
79#endif /* __ASM_SH_UACCESS_64_H */ 81#endif /* __ASM_SH_UACCESS_64_H */
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index 04c7da96814..e640c63d581 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -2,7 +2,7 @@
2 * arch/sh/kernel/cpu/sh5/entry.S 2 * arch/sh/kernel/cpu/sh5/entry.S
3 * 3 *
4 * Copyright (C) 2000, 2001 Paolo Alberelli 4 * Copyright (C) 2000, 2001 Paolo Alberelli
5 * Copyright (C) 2004 - 2007 Paul Mundt 5 * Copyright (C) 2004 - 2008 Paul Mundt
6 * Copyright (C) 2003, 2004 Richard Curnow 6 * Copyright (C) 2003, 2004 Richard Curnow
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
@@ -923,6 +923,8 @@ ret_from_exception:
923 blink tr0, ZERO 923 blink tr0, ZERO
924 924
925resume_kernel: 925resume_kernel:
926 CLI()
927
926 pta restore_all, tr0 928 pta restore_all, tr0
927 929
928 getcon KCR0, r6 930 getcon KCR0, r6
@@ -939,19 +941,11 @@ need_resched:
939 andi r7, 0xf0, r7 941 andi r7, 0xf0, r7
940 bne r7, ZERO, tr0 942 bne r7, ZERO, tr0
941 943
942 movi ((PREEMPT_ACTIVE >> 16) & 65535), r8 944 movi preempt_schedule_irq, r7
943 shori (PREEMPT_ACTIVE & 65535), r8
944 st.l r6, TI_PRE_COUNT, r8
945
946 STI()
947 movi schedule, r7
948 ori r7, 1, r7 945 ori r7, 1, r7
949 ptabs r7, tr1 946 ptabs r7, tr1
950 blink tr1, LINK 947 blink tr1, LINK
951 948
952 st.l r6, TI_PRE_COUNT, ZERO
953 CLI()
954
955 pta need_resched, tr1 949 pta need_resched, tr1
956 blink tr1, ZERO 950 blink tr1, ZERO
957#endif 951#endif
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 0bc17def55a..efbb4268875 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -92,6 +92,7 @@ ENTRY(ret_from_irq)
92 bra resume_userspace 92 bra resume_userspace
93 nop 93 nop
94ENTRY(resume_kernel) 94ENTRY(resume_kernel)
95 cli
95 mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count 96 mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count
96 tst r0, r0 97 tst r0, r0
97 bf noresched 98 bf noresched
@@ -105,28 +106,9 @@ need_resched:
105 and #0xf0, r0 ! interrupts off (exception path)? 106 and #0xf0, r0 ! interrupts off (exception path)?
106 cmp/eq #0xf0, r0 107 cmp/eq #0xf0, r0
107 bt noresched 108 bt noresched
108
109 mov.l 1f, r0
110 mov.l r0, @(TI_PRE_COUNT,r8)
111
112#ifdef CONFIG_TRACE_IRQFLAGS
113 mov.l 3f, r0 109 mov.l 3f, r0
114 jsr @r0 110 jsr @r0 ! call preempt_schedule_irq
115 nop
116#endif
117 sti
118 mov.l 2f, r0
119 jsr @r0
120 nop
121 mov #0, r0
122 mov.l r0, @(TI_PRE_COUNT,r8)
123 cli
124#ifdef CONFIG_TRACE_IRQFLAGS
125 mov.l 4f, r0
126 jsr @r0
127 nop 111 nop
128#endif
129
130 bra need_resched 112 bra need_resched
131 nop 113 nop
132 114
@@ -137,10 +119,7 @@ noresched:
137 .align 2 119 .align 2
1381: .long PREEMPT_ACTIVE 1201: .long PREEMPT_ACTIVE
1392: .long schedule 1212: .long schedule
140#ifdef CONFIG_TRACE_IRQFLAGS 1223: .long preempt_schedule_irq
1413: .long trace_hardirqs_on
1424: .long trace_hardirqs_off
143#endif
144#endif 123#endif
145 124
146ENTRY(resume_userspace) 125ENTRY(resume_userspace)
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 4703dff174d..94df56b0d1f 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -102,7 +102,7 @@ void machine_kexec(struct kimage *image)
102 102
103 /* now call it */ 103 /* now call it */
104 rnk = (relocate_new_kernel_t) reboot_code_buffer; 104 rnk = (relocate_new_kernel_t) reboot_code_buffer;
105 (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); 105 (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start), vbr_reg);
106} 106}
107 107
108void arch_crash_save_vmcoreinfo(void) 108void arch_crash_save_vmcoreinfo(void)
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c
index 5922edd416d..9c6424892bd 100644
--- a/arch/sh/kernel/ptrace_64.c
+++ b/arch/sh/kernel/ptrace_64.c
@@ -131,6 +131,8 @@ void user_enable_single_step(struct task_struct *child)
131 131
132void user_disable_single_step(struct task_struct *child) 132void user_disable_single_step(struct task_struct *child)
133{ 133{
134 struct pt_regs *regs = child->thread.uregs;
135
134 regs->sr &= ~SR_SSTEP; 136 regs->sr &= ~SR_SSTEP;
135} 137}
136 138
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index a35207655e7..de832056bf1 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -171,6 +171,7 @@ static void __init reserve_crashkernel(void)
171 (unsigned long)(free_mem >> 20)); 171 (unsigned long)(free_mem >> 20));
172 crashk_res.start = crash_base; 172 crashk_res.start = crash_base;
173 crashk_res.end = crash_base + crash_size - 1; 173 crashk_res.end = crash_base + crash_size - 1;
174 insert_resource(&iomem_resource, &crashk_res);
174 } 175 }
175} 176}
176#else 177#else
@@ -204,11 +205,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
204 request_resource(res, &data_resource); 205 request_resource(res, &data_resource);
205 request_resource(res, &bss_resource); 206 request_resource(res, &bss_resource);
206 207
207#ifdef CONFIG_KEXEC
208 if (crashk_res.start != crashk_res.end)
209 request_resource(res, &crashk_res);
210#endif
211
212 add_active_range(nid, start_pfn, end_pfn); 208 add_active_range(nid, start_pfn, end_pfn);
213} 209}
214 210
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index 59cd2859ce9..9061b86d73f 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second,
170 version = call >> 16; /* hack for backward compatibility */ 170 version = call >> 16; /* hack for backward compatibility */
171 call &= 0xffff; 171 call &= 0xffff;
172 172
173 if (call <= SEMCTL) 173 if (call <= SEMTIMEDOP)
174 switch (call) { 174 switch (call) {
175 case SEMOP: 175 case SEMOP:
176 return sys_semtimedop(first, 176 return sys_semtimedop(first,
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 895bb3f335c..64b8f7f96f9 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -101,7 +101,7 @@ static int __init memchunk_setup(char *str)
101} 101}
102__setup("memchunk.", memchunk_setup); 102__setup("memchunk.", memchunk_setup);
103 103
104static void memchunk_cmdline_override(char *name, unsigned long *sizep) 104static void __init memchunk_cmdline_override(char *name, unsigned long *sizep)
105{ 105{
106 char *p = boot_command_line; 106 char *p = boot_command_line;
107 int k = strlen(name); 107 int k = strlen(name);
@@ -118,8 +118,8 @@ static void memchunk_cmdline_override(char *name, unsigned long *sizep)
118 } 118 }
119} 119}
120 120
121int platform_resource_setup_memory(struct platform_device *pdev, 121int __init platform_resource_setup_memory(struct platform_device *pdev,
122 char *name, unsigned long memsize) 122 char *name, unsigned long memsize)
123{ 123{
124 struct resource *r; 124 struct resource *r;
125 dma_addr_t dma_handle; 125 dma_addr_t dma_handle;
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 9b6689d9d57..23963882bc1 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -792,6 +792,8 @@ void fixup_irqs(void)
792 } 792 }
793 spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 793 spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
794 } 794 }
795
796 tick_ops->disable_irq();
795} 797}
796#endif 798#endif
797 799
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 743ccad61c6..2be166c544c 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -80,8 +80,6 @@ void smp_bogo(struct seq_file *m)
80 i, cpu_data(i).clock_tick); 80 i, cpu_data(i).clock_tick);
81} 81}
82 82
83static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock);
84
85extern void setup_sparc64_timer(void); 83extern void setup_sparc64_timer(void);
86 84
87static volatile unsigned long callin_flag = 0; 85static volatile unsigned long callin_flag = 0;
@@ -120,9 +118,9 @@ void __cpuinit smp_callin(void)
120 while (!cpu_isset(cpuid, smp_commenced_mask)) 118 while (!cpu_isset(cpuid, smp_commenced_mask))
121 rmb(); 119 rmb();
122 120
123 spin_lock(&call_lock); 121 ipi_call_lock();
124 cpu_set(cpuid, cpu_online_map); 122 cpu_set(cpuid, cpu_online_map);
125 spin_unlock(&call_lock); 123 ipi_call_unlock();
126 124
127 /* idle thread is expected to have preempt disabled */ 125 /* idle thread is expected to have preempt disabled */
128 preempt_disable(); 126 preempt_disable();
@@ -1305,10 +1303,6 @@ int __cpu_disable(void)
1305 c->core_id = 0; 1303 c->core_id = 0;
1306 c->proc_id = -1; 1304 c->proc_id = -1;
1307 1305
1308 spin_lock(&call_lock);
1309 cpu_clear(cpu, cpu_online_map);
1310 spin_unlock(&call_lock);
1311
1312 smp_wmb(); 1306 smp_wmb();
1313 1307
1314 /* Make sure no interrupts point to this cpu. */ 1308 /* Make sure no interrupts point to this cpu. */
@@ -1318,6 +1312,10 @@ int __cpu_disable(void)
1318 mdelay(1); 1312 mdelay(1);
1319 local_irq_disable(); 1313 local_irq_disable();
1320 1314
1315 ipi_call_lock();
1316 cpu_clear(cpu, cpu_online_map);
1317 ipi_call_unlock();
1318
1321 return 0; 1319 return 0;
1322} 1320}
1323 1321
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 2c518fbc52e..b225219c448 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -382,14 +382,17 @@ config X86_OOSTORE
382# P6_NOPs are a relatively minor optimization that require a family >= 382# P6_NOPs are a relatively minor optimization that require a family >=
383# 6 processor, except that it is broken on certain VIA chips. 383# 6 processor, except that it is broken on certain VIA chips.
384# Furthermore, AMD chips prefer a totally different sequence of NOPs 384# Furthermore, AMD chips prefer a totally different sequence of NOPs
385# (which work on all CPUs). As a result, disallow these if we're 385# (which work on all CPUs). In addition, it looks like Virtual PC
386# compiling X86_GENERIC but not X86_64 (these NOPs do work on all 386# does not understand them.
387# x86-64 capable chips); the list of processors in the right-hand clause 387#
388# are the cores that benefit from this optimization. 388# As a result, disallow these if we're not compiling for X86_64 (these
389# NOPs do work on all x86-64 capable chips); the list of processors in
390# the right-hand clause are the cores that benefit from this optimization.
389# 391#
390config X86_P6_NOP 392config X86_P6_NOP
391 def_bool y 393 def_bool y
392 depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || MPENTIUM4 || MPSC) 394 depends on X86_64
395 depends on (MCORE2 || MPENTIUM4 || MPSC)
393 396
394config X86_TSC 397config X86_TSC
395 def_bool y 398 def_bool y
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
index 4b9ae7c5674..4d3ff037201 100644
--- a/arch/x86/boot/cpucheck.c
+++ b/arch/x86/boot/cpucheck.c
@@ -38,12 +38,12 @@ static const u32 req_flags[NCAPINTS] =
38{ 38{
39 REQUIRED_MASK0, 39 REQUIRED_MASK0,
40 REQUIRED_MASK1, 40 REQUIRED_MASK1,
41 REQUIRED_MASK2, 41 0, /* REQUIRED_MASK2 not implemented in this file */
42 REQUIRED_MASK3, 42 0, /* REQUIRED_MASK3 not implemented in this file */
43 REQUIRED_MASK4, 43 REQUIRED_MASK4,
44 REQUIRED_MASK5, 44 0, /* REQUIRED_MASK5 not implemented in this file */
45 REQUIRED_MASK6, 45 REQUIRED_MASK6,
46 REQUIRED_MASK7, 46 0, /* REQUIRED_MASK7 not implemented in this file */
47}; 47};
48 48
49#define A32(a, b, c, d) (((d) << 24)+((c) << 16)+((b) << 8)+(a)) 49#define A32(a, b, c, d) (((d) << 24)+((c) << 16)+((b) << 8)+(a))
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 2763cb37b55..65a0c1b4869 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -145,35 +145,25 @@ static const unsigned char *const p6_nops[ASM_NOP_MAX+1] = {
145extern char __vsyscall_0; 145extern char __vsyscall_0;
146const unsigned char *const *find_nop_table(void) 146const unsigned char *const *find_nop_table(void)
147{ 147{
148 return boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || 148 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
149 boot_cpu_data.x86 < 6 ? k8_nops : p6_nops; 149 boot_cpu_has(X86_FEATURE_NOPL))
150 return p6_nops;
151 else
152 return k8_nops;
150} 153}
151 154
152#else /* CONFIG_X86_64 */ 155#else /* CONFIG_X86_64 */
153 156
154static const struct nop {
155 int cpuid;
156 const unsigned char *const *noptable;
157} noptypes[] = {
158 { X86_FEATURE_K8, k8_nops },
159 { X86_FEATURE_K7, k7_nops },
160 { X86_FEATURE_P4, p6_nops },
161 { X86_FEATURE_P3, p6_nops },
162 { -1, NULL }
163};
164
165const unsigned char *const *find_nop_table(void) 157const unsigned char *const *find_nop_table(void)
166{ 158{
167 const unsigned char *const *noptable = intel_nops; 159 if (boot_cpu_has(X86_FEATURE_K8))
168 int i; 160 return k8_nops;
169 161 else if (boot_cpu_has(X86_FEATURE_K7))
170 for (i = 0; noptypes[i].cpuid >= 0; i++) { 162 return k7_nops;
171 if (boot_cpu_has(noptypes[i].cpuid)) { 163 else if (boot_cpu_has(X86_FEATURE_NOPL))
172 noptable = noptypes[i].noptable; 164 return p6_nops;
173 break; 165 else
174 } 166 return intel_nops;
175 }
176 return noptable;
177} 167}
178 168
179#endif /* CONFIG_X86_64 */ 169#endif /* CONFIG_X86_64 */
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index cae9cabc303..18514ed2610 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -31,6 +31,11 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
31 if (c->x86_power & (1<<8)) 31 if (c->x86_power & (1<<8))
32 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 32 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
33 } 33 }
34
35 /* Set MTRR capability flag if appropriate */
36 if (c->x86_model == 13 || c->x86_model == 9 ||
37 (c->x86_model == 8 && c->x86_mask >= 8))
38 set_cpu_cap(c, X86_FEATURE_K6_MTRR);
34} 39}
35 40
36static void __cpuinit init_amd(struct cpuinfo_x86 *c) 41static void __cpuinit init_amd(struct cpuinfo_x86 *c)
@@ -166,10 +171,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
166 mbytes); 171 mbytes);
167 } 172 }
168 173
169 /* Set MTRR capability flag if appropriate */
170 if (c->x86_model == 13 || c->x86_model == 9 ||
171 (c->x86_model == 8 && c->x86_mask >= 8))
172 set_cpu_cap(c, X86_FEATURE_K6_MTRR);
173 break; 174 break;
174 } 175 }
175 176
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index e0f45edd6a5..a0534c04d38 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -314,6 +314,16 @@ enum {
314 EAMD3D = 1<<20, 314 EAMD3D = 1<<20,
315}; 315};
316 316
317static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c)
318{
319 switch (c->x86) {
320 case 5:
321 /* Emulate MTRRs using Centaur's MCR. */
322 set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR);
323 break;
324 }
325}
326
317static void __cpuinit init_centaur(struct cpuinfo_x86 *c) 327static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
318{ 328{
319 329
@@ -462,6 +472,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size)
462static struct cpu_dev centaur_cpu_dev __cpuinitdata = { 472static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
463 .c_vendor = "Centaur", 473 .c_vendor = "Centaur",
464 .c_ident = { "CentaurHauls" }, 474 .c_ident = { "CentaurHauls" },
475 .c_early_init = early_init_centaur,
465 .c_init = init_centaur, 476 .c_init = init_centaur,
466 .c_size_cache = centaur_size_cache, 477 .c_size_cache = centaur_size_cache,
467}; 478};
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 80ab20d4fa3..8aab8517642 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -13,6 +13,7 @@
13#include <asm/mtrr.h> 13#include <asm/mtrr.h>
14#include <asm/mce.h> 14#include <asm/mce.h>
15#include <asm/pat.h> 15#include <asm/pat.h>
16#include <asm/asm.h>
16#ifdef CONFIG_X86_LOCAL_APIC 17#ifdef CONFIG_X86_LOCAL_APIC
17#include <asm/mpspec.h> 18#include <asm/mpspec.h>
18#include <asm/apic.h> 19#include <asm/apic.h>
@@ -334,11 +335,40 @@ static void __init early_cpu_detect(void)
334 335
335 get_cpu_vendor(c, 1); 336 get_cpu_vendor(c, 1);
336 337
338 early_get_cap(c);
339
337 if (c->x86_vendor != X86_VENDOR_UNKNOWN && 340 if (c->x86_vendor != X86_VENDOR_UNKNOWN &&
338 cpu_devs[c->x86_vendor]->c_early_init) 341 cpu_devs[c->x86_vendor]->c_early_init)
339 cpu_devs[c->x86_vendor]->c_early_init(c); 342 cpu_devs[c->x86_vendor]->c_early_init(c);
343}
340 344
341 early_get_cap(c); 345/*
346 * The NOPL instruction is supposed to exist on all CPUs with
347 * family >= 6, unfortunately, that's not true in practice because
348 * of early VIA chips and (more importantly) broken virtualizers that
349 * are not easy to detect. Hence, probe for it based on first
350 * principles.
351 */
352static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
353{
354 const u32 nopl_signature = 0x888c53b1; /* Random number */
355 u32 has_nopl = nopl_signature;
356
357 clear_cpu_cap(c, X86_FEATURE_NOPL);
358 if (c->x86 >= 6) {
359 asm volatile("\n"
360 "1: .byte 0x0f,0x1f,0xc0\n" /* nopl %eax */
361 "2:\n"
362 " .section .fixup,\"ax\"\n"
363 "3: xor %0,%0\n"
364 " jmp 2b\n"
365 " .previous\n"
366 _ASM_EXTABLE(1b,3b)
367 : "+a" (has_nopl));
368
369 if (has_nopl == nopl_signature)
370 set_cpu_cap(c, X86_FEATURE_NOPL);
371 }
342} 372}
343 373
344static void __cpuinit generic_identify(struct cpuinfo_x86 *c) 374static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
@@ -395,8 +425,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
395 } 425 }
396 426
397 init_scattered_cpuid_features(c); 427 init_scattered_cpuid_features(c);
428 detect_nopl(c);
398 } 429 }
399
400} 430}
401 431
402static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) 432static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c
index dd6e3f15017..a11f5d4477c 100644
--- a/arch/x86/kernel/cpu/common_64.c
+++ b/arch/x86/kernel/cpu/common_64.c
@@ -18,6 +18,7 @@
18#include <asm/mtrr.h> 18#include <asm/mtrr.h>
19#include <asm/mce.h> 19#include <asm/mce.h>
20#include <asm/pat.h> 20#include <asm/pat.h>
21#include <asm/asm.h>
21#include <asm/numa.h> 22#include <asm/numa.h>
22#ifdef CONFIG_X86_LOCAL_APIC 23#ifdef CONFIG_X86_LOCAL_APIC
23#include <asm/mpspec.h> 24#include <asm/mpspec.h>
@@ -215,6 +216,39 @@ static void __init early_cpu_support_print(void)
215 } 216 }
216} 217}
217 218
219/*
220 * The NOPL instruction is supposed to exist on all CPUs with
221 * family >= 6, unfortunately, that's not true in practice because
222 * of early VIA chips and (more importantly) broken virtualizers that
223 * are not easy to detect. Hence, probe for it based on first
224 * principles.
225 *
226 * Note: no 64-bit chip is known to lack these, but put the code here
227 * for consistency with 32 bits, and to make it utterly trivial to
228 * diagnose the problem should it ever surface.
229 */
230static void __cpuinit detect_nopl(struct cpuinfo_x86 *c)
231{
232 const u32 nopl_signature = 0x888c53b1; /* Random number */
233 u32 has_nopl = nopl_signature;
234
235 clear_cpu_cap(c, X86_FEATURE_NOPL);
236 if (c->x86 >= 6) {
237 asm volatile("\n"
238 "1: .byte 0x0f,0x1f,0xc0\n" /* nopl %eax */
239 "2:\n"
240 " .section .fixup,\"ax\"\n"
241 "3: xor %0,%0\n"
242 " jmp 2b\n"
243 " .previous\n"
244 _ASM_EXTABLE(1b,3b)
245 : "+a" (has_nopl));
246
247 if (has_nopl == nopl_signature)
248 set_cpu_cap(c, X86_FEATURE_NOPL);
249 }
250}
251
218static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c); 252static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c);
219 253
220void __init early_cpu_init(void) 254void __init early_cpu_init(void)
@@ -313,6 +347,8 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
313 c->x86_phys_bits = eax & 0xff; 347 c->x86_phys_bits = eax & 0xff;
314 } 348 }
315 349
350 detect_nopl(c);
351
316 if (c->x86_vendor != X86_VENDOR_UNKNOWN && 352 if (c->x86_vendor != X86_VENDOR_UNKNOWN &&
317 cpu_devs[c->x86_vendor]->c_early_init) 353 cpu_devs[c->x86_vendor]->c_early_init)
318 cpu_devs[c->x86_vendor]->c_early_init(c); 354 cpu_devs[c->x86_vendor]->c_early_init(c);
@@ -493,17 +529,20 @@ void pda_init(int cpu)
493 /* others are initialized in smpboot.c */ 529 /* others are initialized in smpboot.c */
494 pda->pcurrent = &init_task; 530 pda->pcurrent = &init_task;
495 pda->irqstackptr = boot_cpu_stack; 531 pda->irqstackptr = boot_cpu_stack;
532 pda->irqstackptr += IRQSTACKSIZE - 64;
496 } else { 533 } else {
497 pda->irqstackptr = (char *) 534 if (!pda->irqstackptr) {
498 __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); 535 pda->irqstackptr = (char *)
499 if (!pda->irqstackptr) 536 __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER);
500 panic("cannot allocate irqstack for cpu %d", cpu); 537 if (!pda->irqstackptr)
538 panic("cannot allocate irqstack for cpu %d",
539 cpu);
540 pda->irqstackptr += IRQSTACKSIZE - 64;
541 }
501 542
502 if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE) 543 if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE)
503 pda->nodenumber = cpu_to_node(cpu); 544 pda->nodenumber = cpu_to_node(cpu);
504 } 545 }
505
506 pda->irqstackptr += IRQSTACKSIZE-64;
507} 546}
508 547
509char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + 548char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ +
@@ -601,19 +640,22 @@ void __cpuinit cpu_init(void)
601 /* 640 /*
602 * set up and load the per-CPU TSS 641 * set up and load the per-CPU TSS
603 */ 642 */
604 for (v = 0; v < N_EXCEPTION_STACKS; v++) { 643 if (!orig_ist->ist[0]) {
605 static const unsigned int order[N_EXCEPTION_STACKS] = { 644 static const unsigned int order[N_EXCEPTION_STACKS] = {
606 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, 645 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER,
607 [DEBUG_STACK - 1] = DEBUG_STACK_ORDER 646 [DEBUG_STACK - 1] = DEBUG_STACK_ORDER
608 }; 647 };
609 if (cpu) { 648 for (v = 0; v < N_EXCEPTION_STACKS; v++) {
610 estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); 649 if (cpu) {
611 if (!estacks) 650 estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]);
612 panic("Cannot allocate exception stack %ld %d\n", 651 if (!estacks)
613 v, cpu); 652 panic("Cannot allocate exception "
653 "stack %ld %d\n", v, cpu);
654 }
655 estacks += PAGE_SIZE << order[v];
656 orig_ist->ist[v] = t->x86_tss.ist[v] =
657 (unsigned long)estacks;
614 } 658 }
615 estacks += PAGE_SIZE << order[v];
616 orig_ist->ist[v] = t->x86_tss.ist[v] = (unsigned long)estacks;
617 } 659 }
618 660
619 t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); 661 t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap);
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index e710a21bb6e..898a5a2002e 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -15,13 +15,11 @@
15/* 15/*
16 * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU 16 * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
17 */ 17 */
18static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) 18static void __cpuinit __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
19{ 19{
20 unsigned char ccr2, ccr3; 20 unsigned char ccr2, ccr3;
21 unsigned long flags;
22 21
23 /* we test for DEVID by checking whether CCR3 is writable */ 22 /* we test for DEVID by checking whether CCR3 is writable */
24 local_irq_save(flags);
25 ccr3 = getCx86(CX86_CCR3); 23 ccr3 = getCx86(CX86_CCR3);
26 setCx86(CX86_CCR3, ccr3 ^ 0x80); 24 setCx86(CX86_CCR3, ccr3 ^ 0x80);
27 getCx86(0xc0); /* dummy to change bus */ 25 getCx86(0xc0); /* dummy to change bus */
@@ -44,9 +42,16 @@ static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
44 *dir0 = getCx86(CX86_DIR0); 42 *dir0 = getCx86(CX86_DIR0);
45 *dir1 = getCx86(CX86_DIR1); 43 *dir1 = getCx86(CX86_DIR1);
46 } 44 }
47 local_irq_restore(flags);
48} 45}
49 46
47static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
48{
49 unsigned long flags;
50
51 local_irq_save(flags);
52 __do_cyrix_devid(dir0, dir1);
53 local_irq_restore(flags);
54}
50/* 55/*
51 * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in 56 * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in
52 * order to identify the Cyrix CPU model after we're out of setup.c 57 * order to identify the Cyrix CPU model after we're out of setup.c
@@ -161,6 +166,24 @@ static void __cpuinit geode_configure(void)
161 local_irq_restore(flags); 166 local_irq_restore(flags);
162} 167}
163 168
169static void __cpuinit early_init_cyrix(struct cpuinfo_x86 *c)
170{
171 unsigned char dir0, dir0_msn, dir1 = 0;
172
173 __do_cyrix_devid(&dir0, &dir1);
174 dir0_msn = dir0 >> 4; /* identifies CPU "family" */
175
176 switch (dir0_msn) {
177 case 3: /* 6x86/6x86L */
178 /* Emulate MTRRs using Cyrix's ARRs. */
179 set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
180 break;
181 case 5: /* 6x86MX/M II */
182 /* Emulate MTRRs using Cyrix's ARRs. */
183 set_cpu_cap(c, X86_FEATURE_CYRIX_ARR);
184 break;
185 }
186}
164 187
165static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) 188static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
166{ 189{
@@ -416,6 +439,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c)
416static struct cpu_dev cyrix_cpu_dev __cpuinitdata = { 439static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
417 .c_vendor = "Cyrix", 440 .c_vendor = "Cyrix",
418 .c_ident = { "CyrixInstead" }, 441 .c_ident = { "CyrixInstead" },
442 .c_early_init = early_init_cyrix,
419 .c_init = init_cyrix, 443 .c_init = init_cyrix,
420 .c_identify = cyrix_identify, 444 .c_identify = cyrix_identify,
421}; 445};
diff --git a/arch/x86/kernel/cpu/feature_names.c b/arch/x86/kernel/cpu/feature_names.c
index e43ad4ad4cb..c9017799497 100644
--- a/arch/x86/kernel/cpu/feature_names.c
+++ b/arch/x86/kernel/cpu/feature_names.c
@@ -39,7 +39,8 @@ const char * const x86_cap_flags[NCAPINTS*32] = {
39 NULL, NULL, NULL, NULL, 39 NULL, NULL, NULL, NULL,
40 "constant_tsc", "up", NULL, "arch_perfmon", 40 "constant_tsc", "up", NULL, "arch_perfmon",
41 "pebs", "bts", NULL, NULL, 41 "pebs", "bts", NULL, NULL,
42 "rep_good", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 42 "rep_good", NULL, NULL, NULL,
43 "nopl", NULL, NULL, NULL,
43 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 44 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
44 45
45 /* Intel-defined (#2) */ 46 /* Intel-defined (#2) */
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 9af89078f7b..66e48aa2dd1 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1203,7 +1203,7 @@ static int __init parse_memmap_opt(char *p)
1203 if (!p) 1203 if (!p)
1204 return -EINVAL; 1204 return -EINVAL;
1205 1205
1206 if (!strcmp(p, "exactmap")) { 1206 if (!strncmp(p, "exactmap", 8)) {
1207#ifdef CONFIG_CRASH_DUMP 1207#ifdef CONFIG_CRASH_DUMP
1208 /* 1208 /*
1209 * If we are doing a crash dump, we still need to know 1209 * If we are doing a crash dump, we still need to know
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 59fd3b6b130..73deaffadd0 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -210,8 +210,8 @@ static void hpet_legacy_clockevent_register(void)
210 /* Calculate the min / max delta */ 210 /* Calculate the min / max delta */
211 hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF, 211 hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
212 &hpet_clockevent); 212 &hpet_clockevent);
213 hpet_clockevent.min_delta_ns = clockevent_delta2ns(0x30, 213 /* 5 usec minimum reprogramming delta. */
214 &hpet_clockevent); 214 hpet_clockevent.min_delta_ns = 5000;
215 215
216 /* 216 /*
217 * Start hpet with the boot cpu mask and make it 217 * Start hpet with the boot cpu mask and make it
@@ -270,15 +270,22 @@ static void hpet_legacy_set_mode(enum clock_event_mode mode,
270} 270}
271 271
272static int hpet_legacy_next_event(unsigned long delta, 272static int hpet_legacy_next_event(unsigned long delta,
273 struct clock_event_device *evt) 273 struct clock_event_device *evt)
274{ 274{
275 unsigned long cnt; 275 u32 cnt;
276 276
277 cnt = hpet_readl(HPET_COUNTER); 277 cnt = hpet_readl(HPET_COUNTER);
278 cnt += delta; 278 cnt += (u32) delta;
279 hpet_writel(cnt, HPET_T0_CMP); 279 hpet_writel(cnt, HPET_T0_CMP);
280 280
281 return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0) ? -ETIME : 0; 281 /*
282 * We need to read back the CMP register to make sure that
283 * what we wrote hit the chip before we compare it to the
284 * counter.
285 */
286 WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt);
287
288 return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
282} 289}
283 290
284/* 291/*
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index 1c3a66a67f8..720d2607aac 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -92,6 +92,14 @@ static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = {
92 DMI_MATCH(DMI_BOARD_NAME, "30BF") 92 DMI_MATCH(DMI_BOARD_NAME, "30BF")
93 } 93 }
94 }, 94 },
95 {
96 .callback = dmi_io_delay_0xed_port,
97 .ident = "Presario F700",
98 .matches = {
99 DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
100 DMI_MATCH(DMI_BOARD_NAME, "30D3")
101 }
102 },
95 { } 103 { }
96}; 104};
97 105
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index ac79bd143da..8f98e9de1b8 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -122,15 +122,75 @@ static u64 tsc_read_refs(u64 *pm, u64 *hpet)
122 return ULLONG_MAX; 122 return ULLONG_MAX;
123} 123}
124 124
125/*
126 * Try to calibrate the TSC against the Programmable
127 * Interrupt Timer and return the frequency of the TSC
128 * in kHz.
129 *
130 * Return ULONG_MAX on failure to calibrate.
131 */
132static unsigned long pit_calibrate_tsc(void)
133{
134 u64 tsc, t1, t2, delta;
135 unsigned long tscmin, tscmax;
136 int pitcnt;
137
138 /* Set the Gate high, disable speaker */
139 outb((inb(0x61) & ~0x02) | 0x01, 0x61);
140
141 /*
142 * Setup CTC channel 2* for mode 0, (interrupt on terminal
143 * count mode), binary count. Set the latch register to 50ms
144 * (LSB then MSB) to begin countdown.
145 */
146 outb(0xb0, 0x43);
147 outb((CLOCK_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
148 outb((CLOCK_TICK_RATE / (1000 / 50)) >> 8, 0x42);
149
150 tsc = t1 = t2 = get_cycles();
151
152 pitcnt = 0;
153 tscmax = 0;
154 tscmin = ULONG_MAX;
155 while ((inb(0x61) & 0x20) == 0) {
156 t2 = get_cycles();
157 delta = t2 - tsc;
158 tsc = t2;
159 if ((unsigned long) delta < tscmin)
160 tscmin = (unsigned int) delta;
161 if ((unsigned long) delta > tscmax)
162 tscmax = (unsigned int) delta;
163 pitcnt++;
164 }
165
166 /*
167 * Sanity checks:
168 *
169 * If we were not able to read the PIT more than 5000
170 * times, then we have been hit by a massive SMI
171 *
172 * If the maximum is 10 times larger than the minimum,
173 * then we got hit by an SMI as well.
174 */
175 if (pitcnt < 5000 || tscmax > 10 * tscmin)
176 return ULONG_MAX;
177
178 /* Calculate the PIT value */
179 delta = t2 - t1;
180 do_div(delta, 50);
181 return delta;
182}
183
184
125/** 185/**
126 * native_calibrate_tsc - calibrate the tsc on boot 186 * native_calibrate_tsc - calibrate the tsc on boot
127 */ 187 */
128unsigned long native_calibrate_tsc(void) 188unsigned long native_calibrate_tsc(void)
129{ 189{
130 u64 tsc1, tsc2, tr1, tr2, tsc, delta, pm1, pm2, hpet1, hpet2; 190 u64 tsc1, tsc2, delta, pm1, pm2, hpet1, hpet2;
131 unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX; 191 unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX;
132 unsigned long flags, tscmin, tscmax; 192 unsigned long flags;
133 int hpet = is_hpet_enabled(), pitcnt, i; 193 int hpet = is_hpet_enabled(), i;
134 194
135 /* 195 /*
136 * Run 5 calibration loops to get the lowest frequency value 196 * Run 5 calibration loops to get the lowest frequency value
@@ -157,72 +217,22 @@ unsigned long native_calibrate_tsc(void)
157 * amount of time anyway. 217 * amount of time anyway.
158 */ 218 */
159 for (i = 0; i < 5; i++) { 219 for (i = 0; i < 5; i++) {
160 220 unsigned long tsc_pit_khz;
161 tscmin = ULONG_MAX;
162 tscmax = 0;
163 pitcnt = 0;
164
165 local_irq_save(flags);
166 221
167 /* 222 /*
168 * Read the start value and the reference count of 223 * Read the start value and the reference count of
169 * hpet/pmtimer when available: 224 * hpet/pmtimer when available. Then do the PIT
225 * calibration, which will take at least 50ms, and
226 * read the end value.
170 */ 227 */
228 local_irq_save(flags);
171 tsc1 = tsc_read_refs(&pm1, hpet ? &hpet1 : NULL); 229 tsc1 = tsc_read_refs(&pm1, hpet ? &hpet1 : NULL);
172 230 tsc_pit_khz = pit_calibrate_tsc();
173 /* Set the Gate high, disable speaker */
174 outb((inb(0x61) & ~0x02) | 0x01, 0x61);
175
176 /*
177 * Setup CTC channel 2* for mode 0, (interrupt on terminal
178 * count mode), binary count. Set the latch register to 50ms
179 * (LSB then MSB) to begin countdown.
180 *
181 * Some devices need a delay here.
182 */
183 outb(0xb0, 0x43);
184 outb((CLOCK_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
185 outb((CLOCK_TICK_RATE / (1000 / 50)) >> 8, 0x42);
186
187 tsc = tr1 = tr2 = get_cycles();
188
189 while ((inb(0x61) & 0x20) == 0) {
190 tr2 = get_cycles();
191 delta = tr2 - tsc;
192 tsc = tr2;
193 if ((unsigned int) delta < tscmin)
194 tscmin = (unsigned int) delta;
195 if ((unsigned int) delta > tscmax)
196 tscmax = (unsigned int) delta;
197 pitcnt++;
198 }
199
200 /*
201 * We waited at least 50ms above. Now read
202 * pmtimer/hpet reference again
203 */
204 tsc2 = tsc_read_refs(&pm2, hpet ? &hpet2 : NULL); 231 tsc2 = tsc_read_refs(&pm2, hpet ? &hpet2 : NULL);
205
206 local_irq_restore(flags); 232 local_irq_restore(flags);
207 233
208 /* 234 /* Pick the lowest PIT TSC calibration so far */
209 * Sanity checks: 235 tsc_pit_min = min(tsc_pit_min, tsc_pit_khz);
210 *
211 * If we were not able to read the PIT more than 5000
212 * times, then we have been hit by a massive SMI
213 *
214 * If the maximum is 10 times larger than the minimum,
215 * then we got hit by an SMI as well.
216 */
217 if (pitcnt > 5000 && tscmax < 10 * tscmin) {
218
219 /* Calculate the PIT value */
220 delta = tr2 - tr1;
221 do_div(delta, 50);
222
223 /* We take the smallest value into account */
224 tsc_pit_min = min(tsc_pit_min, (unsigned long) delta);
225 }
226 236
227 /* hpet or pmtimer available ? */ 237 /* hpet or pmtimer available ? */
228 if (!hpet && !pm1 && !pm2) 238 if (!hpet && !pm1 && !pm2)
@@ -257,8 +267,7 @@ unsigned long native_calibrate_tsc(void)
257 */ 267 */
258 if (tsc_pit_min == ULONG_MAX) { 268 if (tsc_pit_min == ULONG_MAX) {
259 /* PIT gave no useful value */ 269 /* PIT gave no useful value */
260 printk(KERN_WARNING "TSC: PIT calibration failed due to " 270 printk(KERN_WARNING "TSC: Unable to calibrate against PIT\n");
261 "SMI disturbance.\n");
262 271
263 /* We don't have an alternative source, disable TSC */ 272 /* We don't have an alternative source, disable TSC */
264 if (!hpet && !pm1 && !pm2) { 273 if (!hpet && !pm1 && !pm2) {
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 9ff6e3cbf08..a4e201b47f6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1324,7 +1324,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1324 .ptep_modify_prot_commit = __ptep_modify_prot_commit, 1324 .ptep_modify_prot_commit = __ptep_modify_prot_commit,
1325 1325
1326 .pte_val = xen_pte_val, 1326 .pte_val = xen_pte_val,
1327 .pte_flags = native_pte_val, 1327 .pte_flags = native_pte_flags,
1328 .pgd_val = xen_pgd_val, 1328 .pgd_val = xen_pgd_val,
1329 1329
1330 .make_pte = xen_make_pte, 1330 .make_pte = xen_make_pte,