aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/arm/00-INDEX2
-rw-r--r--Documentation/arm/SPEAr/overview.txt60
-rw-r--r--MAINTAINERS40
-rw-r--r--arch/arm/Kconfig54
-rw-r--r--arch/arm/Makefile7
-rw-r--r--arch/arm/common/Kconfig5
-rw-r--r--arch/arm/common/Makefile3
-rw-r--r--arch/arm/common/icst.c100
-rw-r--r--arch/arm/common/icst307.c161
-rw-r--r--arch/arm/common/icst525.c160
-rw-r--r--arch/arm/common/vic.c107
-rw-r--r--arch/arm/configs/spear300_defconfig773
-rw-r--r--arch/arm/configs/spear310_defconfig775
-rw-r--r--arch/arm/configs/spear320_defconfig775
-rw-r--r--arch/arm/configs/spear600_defconfig760
-rw-r--r--arch/arm/configs/stamp9g20_defconfig1456
-rw-r--r--arch/arm/include/asm/hardware/arm_timer.h39
-rw-r--r--arch/arm/include/asm/hardware/icst.h59
-rw-r--r--arch/arm/include/asm/hardware/icst307.h38
-rw-r--r--arch/arm/include/asm/hardware/icst525.h36
-rw-r--r--arch/arm/include/asm/hardware/sp810.h59
-rw-r--r--arch/arm/include/asm/ioctls.h3
-rw-r--r--arch/arm/include/asm/pmu.h5
-rw-r--r--arch/arm/mach-at91/Kconfig13
-rw-r--r--arch/arm/mach-at91/Makefile2
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c315
-rw-r--r--arch/arm/mach-at91/include/mach/board.h8
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h4
-rw-r--r--arch/arm/mach-at91/include/mach/system.h7
-rw-r--r--arch/arm/mach-bcmring/arch.c16
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c2
-rw-r--r--arch/arm/mach-ep93xx/clock.c13
-rw-r--r--arch/arm/mach-ep93xx/core.c123
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c4
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h1
-rw-r--r--arch/arm/mach-ep93xx/include/mach/platform.h12
-rw-r--r--arch/arm/mach-ep93xx/micro9.c2
-rw-r--r--arch/arm/mach-ep93xx/simone.c6
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c6
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c2
-rw-r--r--arch/arm/mach-integrator/Kconfig1
-rw-r--r--arch/arm/mach-integrator/Makefile2
-rw-r--r--arch/arm/mach-integrator/common.h2
-rw-r--r--arch/arm/mach-integrator/core.c127
-rw-r--r--arch/arm/mach-integrator/cpu.c53
-rw-r--r--arch/arm/mach-integrator/impd1.c43
-rw-r--r--arch/arm/mach-integrator/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-integrator/include/mach/entry-macro.S1
-rw-r--r--arch/arm/mach-integrator/include/mach/hardware.h17
-rw-r--r--arch/arm/mach-integrator/include/mach/platform.h54
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c166
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c88
-rw-r--r--arch/arm/mach-integrator/leds.c1
-rw-r--r--arch/arm/mach-integrator/pci_v3.c7
-rw-r--r--arch/arm/mach-iop32x/n2100.c2
-rw-r--r--arch/arm/mach-nomadik/Kconfig1
-rw-r--r--arch/arm/mach-nomadik/Makefile2
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c10
-rw-r--r--arch/arm/mach-nomadik/clock.c38
-rw-r--r--arch/arm/mach-nomadik/clock.h1
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c83
-rw-r--r--arch/arm/mach-nomadik/include/mach/gpio.h67
-rw-r--r--arch/arm/mach-omap2/devices.c34
-rw-r--r--arch/arm/mach-realview/Makefile2
-rw-r--r--arch/arm/mach-realview/clock.c64
-rw-r--r--arch/arm/mach-realview/clock.h19
-rw-r--r--arch/arm/mach-realview/core.c194
-rw-r--r--arch/arm/mach-realview/include/mach/clkdev.h9
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pb1176.h1
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pba8.h8
-rw-r--r--arch/arm/mach-realview/include/mach/irqs-pbx.h14
-rw-r--r--arch/arm/mach-realview/include/mach/platform.h20
-rw-r--r--arch/arm/mach-realview/realview_eb.c34
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c17
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c34
-rw-r--r--arch/arm/mach-realview/realview_pba8.c17
-rw-r--r--arch/arm/mach-realview/realview_pbx.c32
-rw-r--r--arch/arm/mach-spear3xx/Kconfig33
-rw-r--r--arch/arm/mach-spear3xx/Kconfig30017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig31017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig32017
-rw-r--r--arch/arm/mach-spear3xx/Makefile26
-rw-r--r--arch/arm/mach-spear3xx/Makefile.boot3
-rw-r--r--arch/arm/mach-spear3xx/clock.c389
-rw-r--r--arch/arm/mach-spear3xx/include/mach/clkdev.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/debug-macro.S14
-rw-r--r--arch/arm/mach-spear3xx/include/mach/entry-macro.S46
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h205
-rw-r--r--arch/arm/mach-spear3xx/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/hardware.h20
-rw-r--r--arch/arm/mach-spear3xx/include/mach/io.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/irqs.h152
-rw-r--r--arch/arm/mach-spear3xx/include/mach/memory.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/misc_regs.h163
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear.h144
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear300.h83
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear310.h70
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear320.h96
-rw-r--r--arch/arm/mach-spear3xx/include/mach/system.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/timex.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/uncompress.h19
-rw-r--r--arch/arm/mach-spear3xx/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-spear3xx/spear300.c468
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c77
-rw-r--r--arch/arm/mach-spear3xx/spear310.c302
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c84
-rw-r--r--arch/arm/mach-spear3xx/spear320.c549
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c81
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c548
-rw-r--r--arch/arm/mach-spear6xx/Kconfig20
-rw-r--r--arch/arm/mach-spear6xx/Kconfig60017
-rw-r--r--arch/arm/mach-spear6xx/Makefile12
-rw-r--r--arch/arm/mach-spear6xx/Makefile.boot3
-rw-r--r--arch/arm/mach-spear6xx/clock.c483
-rw-r--r--arch/arm/mach-spear6xx/include/mach/clkdev.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/debug-macro.S14
-rw-r--r--arch/arm/mach-spear6xx/include/mach/entry-macro.S55
-rw-r--r--arch/arm/mach-spear6xx/include/mach/generic.h45
-rw-r--r--arch/arm/mach-spear6xx/include/mach/gpio.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/hardware.h21
-rw-r--r--arch/arm/mach-spear6xx/include/mach/io.h20
-rw-r--r--arch/arm/mach-spear6xx/include/mach/irqs.h97
-rw-r--r--arch/arm/mach-spear6xx/include/mach/memory.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/misc_regs.h173
-rw-r--r--arch/arm/mach-spear6xx/include/mach/spear.h173
-rw-r--r--arch/arm/mach-spear6xx/include/mach/spear600.h21
-rw-r--r--arch/arm/mach-spear6xx/include/mach/system.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/timex.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/uncompress.h19
-rw-r--r--arch/arm/mach-spear6xx/include/mach/vmalloc.h19
-rw-r--r--arch/arm/mach-spear6xx/spear600.c25
-rw-r--r--arch/arm/mach-spear6xx/spear600_evb.c51
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c158
-rw-r--r--arch/arm/mach-u300/mmc.c3
-rw-r--r--arch/arm/mach-ux500/Kconfig41
-rw-r--r--arch/arm/mach-ux500/Makefile6
-rw-r--r--arch/arm/mach-ux500/board-mop500.c134
-rw-r--r--arch/arm/mach-ux500/board-u5500.c41
-rw-r--r--arch/arm/mach-ux500/clock.c501
-rw-r--r--arch/arm/mach-ux500/clock.h125
-rw-r--r--arch/arm/mach-ux500/cpu-db5500.c50
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c (renamed from arch/arm/mach-ux500/cpu-u8500.c)55
-rw-r--r--arch/arm/mach-ux500/cpu.c99
-rw-r--r--arch/arm/mach-ux500/devices-db5500.c46
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c107
-rw-r--r--arch/arm/mach-ux500/devices.c88
-rw-r--r--arch/arm/mach-ux500/include/mach/db5500-regs.h103
-rw-r--r--arch/arm/mach-ux500/include/mach/db8500-regs.h135
-rw-r--r--arch/arm/mach-ux500/include/mach/debug-macro.S12
-rw-r--r--arch/arm/mach-ux500/include/mach/devices.h29
-rw-r--r--arch/arm/mach-ux500/include/mach/entry-macro.S2
-rw-r--r--arch/arm/mach-ux500/include/mach/gpio.h50
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h197
-rw-r--r--arch/arm/mach-ux500/include/mach/irqs.h9
-rw-r--r--arch/arm/mach-ux500/include/mach/setup.h24
-rw-r--r--arch/arm/mach-ux500/platsmp.c13
-rw-r--r--arch/arm/mach-versatile/Makefile2
-rw-r--r--arch/arm/mach-versatile/clock.c65
-rw-r--r--arch/arm/mach-versatile/clock.h20
-rw-r--r--arch/arm/mach-versatile/core.c194
-rw-r--r--arch/arm/mach-versatile/include/mach/clkdev.h9
-rw-r--r--arch/arm/mach-versatile/include/mach/entry-macro.S1
-rw-r--r--arch/arm/mach-versatile/include/mach/hardware.h3
-rw-r--r--arch/arm/mach-versatile/include/mach/platform.h26
-rw-r--r--arch/arm/mach-vexpress/Kconfig9
-rw-r--r--arch/arm/mach-vexpress/Makefile8
-rw-r--r--arch/arm/mach-vexpress/Makefile.boot3
-rw-r--r--arch/arm/mach-vexpress/core.h26
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c249
-rw-r--r--arch/arm/mach-vexpress/headsmp.S39
-rw-r--r--arch/arm/mach-vexpress/include/mach/clkdev.h15
-rw-r--r--arch/arm/mach-vexpress/include/mach/ct-ca9x4.h47
-rw-r--r--arch/arm/mach-vexpress/include/mach/debug-macro.S23
-rw-r--r--arch/arm/mach-vexpress/include/mach/entry-macro.S67
-rw-r--r--arch/arm/mach-vexpress/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-vexpress/include/mach/io.h28
-rw-r--r--arch/arm/mach-vexpress/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-vexpress/include/mach/memory.h25
-rw-r--r--arch/arm/mach-vexpress/include/mach/motherboard.h121
-rw-r--r--arch/arm/mach-vexpress/include/mach/smp.h21
-rw-r--r--arch/arm/mach-vexpress/include/mach/system.h37
-rw-r--r--arch/arm/mach-vexpress/include/mach/timex.h23
-rw-r--r--arch/arm/mach-vexpress/include/mach/uncompress.h52
-rw-r--r--arch/arm/mach-vexpress/include/mach/vmalloc.h21
-rw-r--r--arch/arm/mach-vexpress/localtimer.c26
-rw-r--r--arch/arm/mach-vexpress/platsmp.c190
-rw-r--r--arch/arm/mach-vexpress/v2m.c361
-rw-r--r--arch/arm/mm/Kconfig3
-rw-r--r--arch/arm/plat-iop/Makefile2
-rw-r--r--arch/arm/plat-iop/pmu.c40
-rw-r--r--arch/arm/plat-nomadik/Kconfig5
-rw-r--r--arch/arm/plat-nomadik/Makefile1
-rw-r--r--arch/arm/plat-nomadik/gpio.c (renamed from arch/arm/mach-nomadik/gpio.c)188
-rw-r--r--arch/arm/plat-nomadik/include/plat/gpio.h70
-rw-r--r--arch/arm/plat-nomadik/timer.c145
-rw-r--r--arch/arm/plat-pxa/Makefile2
-rw-r--r--arch/arm/plat-pxa/pmu.c33
-rw-r--r--arch/arm/plat-spear/Kconfig31
-rw-r--r--arch/arm/plat-spear/Makefile8
-rw-r--r--arch/arm/plat-spear/clock.c435
-rw-r--r--arch/arm/plat-spear/include/plat/clkdev.h20
-rw-r--r--arch/arm/plat-spear/include/plat/clock.h126
-rw-r--r--arch/arm/plat-spear/include/plat/debug-macro.S38
-rw-r--r--arch/arm/plat-spear/include/plat/gpio.h24
-rw-r--r--arch/arm/plat-spear/include/plat/io.h22
-rw-r--r--arch/arm/plat-spear/include/plat/memory.h20
-rw-r--r--arch/arm/plat-spear/include/plat/padmux.h92
-rw-r--r--arch/arm/plat-spear/include/plat/shirq.h73
-rw-r--r--arch/arm/plat-spear/include/plat/system.h41
-rw-r--r--arch/arm/plat-spear/include/plat/timex.h19
-rw-r--r--arch/arm/plat-spear/include/plat/uncompress.h43
-rw-r--r--arch/arm/plat-spear/include/plat/vmalloc.h19
-rw-r--r--arch/arm/plat-spear/padmux.c164
-rw-r--r--arch/arm/plat-spear/shirq.c118
-rw-r--r--arch/arm/plat-spear/time.c292
-rw-r--r--arch/arm/plat-versatile/Makefile4
-rw-r--r--arch/arm/plat-versatile/clock.c (renamed from arch/arm/mach-integrator/clock.c)43
-rw-r--r--arch/arm/plat-versatile/include/plat/clock.h15
-rw-r--r--arch/arm/plat-versatile/include/plat/timer-sp.h2
-rw-r--r--arch/arm/plat-versatile/sched-clock.c53
-rw-r--r--arch/arm/plat-versatile/timer-sp.c156
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/mmc/host/mmci.c19
-rw-r--r--drivers/mmc/host/mmci.h6
-rw-r--r--drivers/serial/atmel_serial.c207
-rw-r--r--drivers/usb/gadget/at91_udc.c7
-rw-r--r--include/linux/amba/mmci.h23
228 files changed, 16801 insertions, 1960 deletions
diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX
index 82e418d648d0..7f5fc3ba9c91 100644
--- a/Documentation/arm/00-INDEX
+++ b/Documentation/arm/00-INDEX
@@ -20,6 +20,8 @@ Samsung-S3C24XX
20 - S3C24XX ARM Linux Overview 20 - S3C24XX ARM Linux Overview
21Sharp-LH 21Sharp-LH
22 - Linux on Sharp LH79524 and LH7A40X System On a Chip (SOC) 22 - Linux on Sharp LH79524 and LH7A40X System On a Chip (SOC)
23SPEAr
24 - ST SPEAr platform Linux Overview
23VFP/ 25VFP/
24 - Release notes for Linux Kernel Vector Floating Point support code 26 - Release notes for Linux Kernel Vector Floating Point support code
25empeg/ 27empeg/
diff --git a/Documentation/arm/SPEAr/overview.txt b/Documentation/arm/SPEAr/overview.txt
new file mode 100644
index 000000000000..253a35c6f782
--- /dev/null
+++ b/Documentation/arm/SPEAr/overview.txt
@@ -0,0 +1,60 @@
1 SPEAr ARM Linux Overview
2 ==========================
3
4Introduction
5------------
6
7 SPEAr (Structured Processor Enhanced Architecture).
8 weblink : http://www.st.com/spear
9
10 The ST Microelectronics SPEAr range of ARM9/CortexA9 System-on-Chip CPUs are
11 supported by the 'spear' platform of ARM Linux. Currently SPEAr300,
12 SPEAr310, SPEAr320 and SPEAr600 SOCs are supported. Support for the SPEAr13XX
13 series is in progress.
14
15 Hierarchy in SPEAr is as follows:
16
17 SPEAr (Platform)
18 - SPEAr3XX (3XX SOC series, based on ARM9)
19 - SPEAr300 (SOC)
20 - SPEAr300_EVB (Evaluation Board)
21 - SPEAr310 (SOC)
22 - SPEAr310_EVB (Evaluation Board)
23 - SPEAr320 (SOC)
24 - SPEAr320_EVB (Evaluation Board)
25 - SPEAr6XX (6XX SOC series, based on ARM9)
26 - SPEAr600 (SOC)
27 - SPEAr600_EVB (Evaluation Board)
28 - SPEAr13XX (13XX SOC series, based on ARM CORTEXA9)
29 - SPEAr1300 (SOC)
30
31 Configuration
32 -------------
33
34 A generic configuration is provided for each machine, and can be used as the
35 default by
36 make spear600_defconfig
37 make spear300_defconfig
38 make spear310_defconfig
39 make spear320_defconfig
40
41 Layout
42 ------
43
44 The common files for multiple machine families (SPEAr3XX, SPEAr6XX and
45 SPEAr13XX) are located in the platform code contained in arch/arm/plat-spear
46 with headers in plat/.
47
48 Each machine series have a directory with name arch/arm/mach-spear followed by
49 series name. Like mach-spear3xx, mach-spear6xx and mach-spear13xx.
50
51 Common file for machines of spear3xx family is mach-spear3xx/spear3xx.c and for
52 spear6xx is mach-spear6xx/spear6xx.c. mach-spear* also contain soc/machine
53 specific files, like spear300.c, spear310.c, spear320.c and spear600.c.
54 mach-spear* also contains board specific files for each machine type.
55
56
57 Document Author
58 ---------------
59
60 Viresh Kumar, (c) 2010 ST Microelectronics
diff --git a/MAINTAINERS b/MAINTAINERS
index 382eaa4d0068..aa18ca333f80 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5229,6 +5229,46 @@ F: drivers/serial/sunsu.c
5229F: drivers/serial/sunzilog.c 5229F: drivers/serial/sunzilog.c
5230F: drivers/serial/sunzilog.h 5230F: drivers/serial/sunzilog.h
5231 5231
5232SPEAR PLATFORM SUPPORT
5233M: Viresh Kumar <viresh.kumar@st.com>
5234W: http://www.st.com/spear
5235S: Maintained
5236F: arch/arm/plat-spear/
5237
5238SPEAR3XX MACHINE SUPPORT
5239M: Viresh Kumar <viresh.kumar@st.com>
5240W: http://www.st.com/spear
5241S: Maintained
5242F: arch/arm/mach-spear3xx/
5243
5244SPEAR6XX MACHINE SUPPORT
5245M: Rajeev Kumar <rajeev-dlh.kumar@st.com>
5246W: http://www.st.com/spear
5247S: Maintained
5248F: arch/arm/mach-spear6xx/
5249
5250SPEAR CLOCK FRAMEWORK SUPPORT
5251M: Viresh Kumar <viresh.kumar@st.com>
5252W: http://www.st.com/spear
5253S: Maintained
5254F: arch/arm/mach-spear*/clock.c
5255F: arch/arm/mach-spear*/include/mach/clkdev.h
5256F: arch/arm/plat-spear/clock.c
5257F: arch/arm/plat-spear/include/plat/clock.h and clkdev.h
5258
5259SPEAR PAD MULTIPLEXING SUPPORT
5260M: Viresh Kumar <viresh.kumar@st.com>
5261W: http://www.st.com/spear
5262S: Maintained
5263F: arch/arm/plat-spear/include/plat/padmux.h
5264F: arch/arm/plat-spear/padmux.c
5265F: arch/arm/mach-spear*/spear*xx.c
5266F: arch/arm/mach-spear*/include/mach/generic.h
5267F: arch/arm/mach-spear3xx/spear3*0.c
5268F: arch/arm/mach-spear3xx/spear3*0_evb.c
5269F: arch/arm/mach-spear6xx/spear600.c
5270F: arch/arm/mach-spear6xx/spear600_evb.c
5271
5232SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER 5272SPECIALIX IO8+ MULTIPORT SERIAL CARD DRIVER
5233M: Roger Wolff <R.E.Wolff@BitWizard.nl> 5273M: Roger Wolff <R.E.Wolff@BitWizard.nl>
5234S: Supported 5274S: Supported
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 88f9334110cf..daaa4b2b46e1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -246,7 +246,10 @@ config ARCH_INTEGRATOR
246 select ARM_AMBA 246 select ARM_AMBA
247 select ARCH_HAS_CPUFREQ 247 select ARCH_HAS_CPUFREQ
248 select COMMON_CLKDEV 248 select COMMON_CLKDEV
249 select ICST525 249 select ICST
250 select GENERIC_TIME
251 select GENERIC_CLOCKEVENTS
252 select PLAT_VERSATILE
250 help 253 help
251 Support for ARM's Integrator platform. 254 Support for ARM's Integrator platform.
252 255
@@ -254,10 +257,12 @@ config ARCH_REALVIEW
254 bool "ARM Ltd. RealView family" 257 bool "ARM Ltd. RealView family"
255 select ARM_AMBA 258 select ARM_AMBA
256 select COMMON_CLKDEV 259 select COMMON_CLKDEV
257 select ICST307 260 select ICST
258 select GENERIC_TIME 261 select GENERIC_TIME
259 select GENERIC_CLOCKEVENTS 262 select GENERIC_CLOCKEVENTS
260 select ARCH_WANT_OPTIONAL_GPIOLIB 263 select ARCH_WANT_OPTIONAL_GPIOLIB
264 select PLAT_VERSATILE
265 select ARM_TIMER_SP804
261 help 266 help
262 This enables support for ARM Ltd RealView boards. 267 This enables support for ARM Ltd RealView boards.
263 268
@@ -266,13 +271,29 @@ config ARCH_VERSATILE
266 select ARM_AMBA 271 select ARM_AMBA
267 select ARM_VIC 272 select ARM_VIC
268 select COMMON_CLKDEV 273 select COMMON_CLKDEV
269 select ICST307 274 select ICST
270 select GENERIC_TIME 275 select GENERIC_TIME
271 select GENERIC_CLOCKEVENTS 276 select GENERIC_CLOCKEVENTS
272 select ARCH_WANT_OPTIONAL_GPIOLIB 277 select ARCH_WANT_OPTIONAL_GPIOLIB
278 select PLAT_VERSATILE
279 select ARM_TIMER_SP804
273 help 280 help
274 This enables support for ARM Ltd Versatile board. 281 This enables support for ARM Ltd Versatile board.
275 282
283config ARCH_VEXPRESS
284 bool "ARM Ltd. Versatile Express family"
285 select ARCH_WANT_OPTIONAL_GPIOLIB
286 select ARM_AMBA
287 select ARM_TIMER_SP804
288 select COMMON_CLKDEV
289 select GENERIC_CLOCKEVENTS
290 select GENERIC_TIME
291 select HAVE_CLK
292 select ICST
293 select PLAT_VERSATILE
294 help
295 This enables support for the ARM Ltd Versatile Express boards.
296
276config ARCH_AT91 297config ARCH_AT91
277 bool "Atmel AT91" 298 bool "Atmel AT91"
278 select GENERIC_GPIO 299 select GENERIC_GPIO
@@ -768,6 +789,7 @@ config ARCH_U8500
768 select GENERIC_TIME 789 select GENERIC_TIME
769 select GENERIC_CLOCKEVENTS 790 select GENERIC_CLOCKEVENTS
770 select COMMON_CLKDEV 791 select COMMON_CLKDEV
792 select ARCH_REQUIRE_GPIOLIB
771 help 793 help
772 Support for ST-Ericsson's Ux500 architecture 794 Support for ST-Ericsson's Ux500 architecture
773 795
@@ -811,6 +833,18 @@ config ARCH_OMAP
811 help 833 help
812 Support for TI's OMAP platform (OMAP1 and OMAP2). 834 Support for TI's OMAP platform (OMAP1 and OMAP2).
813 835
836config PLAT_SPEAR
837 bool "ST SPEAr"
838 select ARM_AMBA
839 select ARCH_REQUIRE_GPIOLIB
840 select COMMON_CLKDEV
841 select GENERIC_CLOCKEVENTS
842 select GENERIC_GPIO
843 select GENERIC_TIME
844 select HAVE_CLK
845 help
846 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
847
814endchoice 848endchoice
815 849
816# 850#
@@ -896,6 +930,7 @@ source "arch/arm/plat-samsung/Kconfig"
896source "arch/arm/plat-s3c24xx/Kconfig" 930source "arch/arm/plat-s3c24xx/Kconfig"
897source "arch/arm/plat-s5p/Kconfig" 931source "arch/arm/plat-s5p/Kconfig"
898source "arch/arm/plat-s5pc1xx/Kconfig" 932source "arch/arm/plat-s5pc1xx/Kconfig"
933source "arch/arm/plat-spear/Kconfig"
899 934
900if ARCH_S3C2410 935if ARCH_S3C2410
901source "arch/arm/mach-s3c2400/Kconfig" 936source "arch/arm/mach-s3c2400/Kconfig"
@@ -929,6 +964,8 @@ source "arch/arm/mach-ux500/Kconfig"
929 964
930source "arch/arm/mach-versatile/Kconfig" 965source "arch/arm/mach-versatile/Kconfig"
931 966
967source "arch/arm/mach-vexpress/Kconfig"
968
932source "arch/arm/mach-w90x900/Kconfig" 969source "arch/arm/mach-w90x900/Kconfig"
933 970
934# Definitions to make life easier 971# Definitions to make life easier
@@ -946,6 +983,12 @@ config PLAT_ORION
946config PLAT_PXA 983config PLAT_PXA
947 bool 984 bool
948 985
986config PLAT_VERSATILE
987 bool
988
989config ARM_TIMER_SP804
990 bool
991
949source arch/arm/mm/Kconfig 992source arch/arm/mm/Kconfig
950 993
951config IWMMXT 994config IWMMXT
@@ -1106,10 +1149,11 @@ source "kernel/time/Kconfig"
1106config SMP 1149config SMP
1107 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 1150 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
1108 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\ 1151 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\
1109 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500) 1152 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\
1153 ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
1110 depends on GENERIC_CLOCKEVENTS 1154 depends on GENERIC_CLOCKEVENTS
1111 select USE_GENERIC_SMP_HELPERS 1155 select USE_GENERIC_SMP_HELPERS
1112 select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500) 1156 select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
1113 help 1157 help
1114 This enables support for systems with more than one CPU. If you have 1158 This enables support for systems with more than one CPU. If you have
1115 a system with only one CPU, like most personal computers, say N. If 1159 a system with only one CPU, like most personal computers, say N. If
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ed820e737a8a..219cb4ee7e32 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -175,9 +175,14 @@ machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
175machine-$(CONFIG_ARCH_U300) := u300 175machine-$(CONFIG_ARCH_U300) := u300
176machine-$(CONFIG_ARCH_U8500) := ux500 176machine-$(CONFIG_ARCH_U8500) := ux500
177machine-$(CONFIG_ARCH_VERSATILE) := versatile 177machine-$(CONFIG_ARCH_VERSATILE) := versatile
178machine-$(CONFIG_ARCH_VEXPRESS) := vexpress
178machine-$(CONFIG_ARCH_W90X900) := w90x900 179machine-$(CONFIG_ARCH_W90X900) := w90x900
179machine-$(CONFIG_ARCH_NUC93X) := nuc93x 180machine-$(CONFIG_ARCH_NUC93X) := nuc93x
180machine-$(CONFIG_FOOTBRIDGE) := footbridge 181machine-$(CONFIG_FOOTBRIDGE) := footbridge
182machine-$(CONFIG_MACH_SPEAR300) := spear3xx
183machine-$(CONFIG_MACH_SPEAR310) := spear3xx
184machine-$(CONFIG_MACH_SPEAR320) := spear3xx
185machine-$(CONFIG_MACH_SPEAR600) := spear6xx
181 186
182# Platform directory name. This list is sorted alphanumerically 187# Platform directory name. This list is sorted alphanumerically
183# by CONFIG_* macro name. 188# by CONFIG_* macro name.
@@ -192,6 +197,8 @@ plat-$(CONFIG_PLAT_PXA) := pxa
192plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung 197plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung
193plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung 198plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung
194plat-$(CONFIG_PLAT_S5P) := s5p samsung 199plat-$(CONFIG_PLAT_S5P) := s5p samsung
200plat-$(CONFIG_PLAT_SPEAR) := spear
201plat-$(CONFIG_PLAT_VERSATILE) := versatile
195 202
196ifeq ($(CONFIG_ARCH_EBSA110),y) 203ifeq ($(CONFIG_ARCH_EBSA110),y)
197# This is what happens if you forget the IOCS16 line. 204# This is what happens if you forget the IOCS16 line.
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index cf9059091884..0a34c8186924 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -12,10 +12,7 @@ config ARM_VIC_NR
12 The maximum number of VICs available in the system, for 12 The maximum number of VICs available in the system, for
13 power management. 13 power management.
14 14
15config ICST525 15config ICST
16 bool
17
18config ICST307
19 bool 16 bool
20 17
21config PL330 18config PL330
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index df20c2650206..e6e8664a9413 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -4,8 +4,7 @@
4 4
5obj-$(CONFIG_ARM_GIC) += gic.o 5obj-$(CONFIG_ARM_GIC) += gic.o
6obj-$(CONFIG_ARM_VIC) += vic.o 6obj-$(CONFIG_ARM_VIC) += vic.o
7obj-$(CONFIG_ICST525) += icst525.o 7obj-$(CONFIG_ICST) += icst.o
8obj-$(CONFIG_ICST307) += icst307.o
9obj-$(CONFIG_PL330) += pl330.o 8obj-$(CONFIG_PL330) += pl330.o
10obj-$(CONFIG_SA1111) += sa1111.o 9obj-$(CONFIG_SA1111) += sa1111.o
11obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o 10obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
diff --git a/arch/arm/common/icst.c b/arch/arm/common/icst.c
new file mode 100644
index 000000000000..9a7f09cff300
--- /dev/null
+++ b/arch/arm/common/icst.c
@@ -0,0 +1,100 @@
1/*
2 * linux/arch/arm/common/icst307.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST307
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 *
14 * This is an almost identical implementation to the ICST525 clock generator.
15 * The s2div and idx2s files are different
16 */
17#include <linux/module.h>
18#include <linux/kernel.h>
19
20#include <asm/hardware/icst.h>
21
22/*
23 * Divisors for each OD setting.
24 */
25const unsigned char icst307_s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
26const unsigned char icst525_s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
27EXPORT_SYMBOL(icst307_s2div);
28EXPORT_SYMBOL(icst525_s2div);
29
30unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco)
31{
32 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]);
33}
34
35EXPORT_SYMBOL(icst_hz);
36
37/*
38 * Ascending divisor S values.
39 */
40const unsigned char icst307_idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
41const unsigned char icst525_idx2s[8] = { 1, 3, 4, 7, 5, 2, 6, 0 };
42EXPORT_SYMBOL(icst307_idx2s);
43EXPORT_SYMBOL(icst525_idx2s);
44
45struct icst_vco
46icst_hz_to_vco(const struct icst_params *p, unsigned long freq)
47{
48 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
49 unsigned long f;
50 unsigned int i = 0, rd, best = (unsigned int)-1;
51
52 /*
53 * First, find the PLL output divisor such
54 * that the PLL output is within spec.
55 */
56 do {
57 f = freq * p->s2div[p->idx2s[i]];
58
59 if (f > p->vco_min && f <= p->vco_max)
60 break;
61 } while (i < 8);
62
63 if (i >= 8)
64 return vco;
65
66 vco.s = p->idx2s[i];
67
68 /*
69 * Now find the closest divisor combination
70 * which gives a PLL output of 'f'.
71 */
72 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
73 unsigned long fref_div, f_pll;
74 unsigned int vd;
75 int f_diff;
76
77 fref_div = (2 * p->ref) / rd;
78
79 vd = (f + fref_div / 2) / fref_div;
80 if (vd < p->vd_min || vd > p->vd_max)
81 continue;
82
83 f_pll = fref_div * vd;
84 f_diff = f_pll - f;
85 if (f_diff < 0)
86 f_diff = -f_diff;
87
88 if ((unsigned)f_diff < best) {
89 vco.v = vd - 8;
90 vco.r = rd - 2;
91 if (f_diff == 0)
92 break;
93 best = f_diff;
94 }
95 }
96
97 return vco;
98}
99
100EXPORT_SYMBOL(icst_hz_to_vco);
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c
deleted file mode 100644
index 6d094c157540..000000000000
--- a/arch/arm/common/icst307.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * linux/arch/arm/common/icst307.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST307
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 *
14 * This is an almost identical implementation to the ICST525 clock generator.
15 * The s2div and idx2s files are different
16 */
17#include <linux/module.h>
18#include <linux/kernel.h>
19
20#include <asm/hardware/icst307.h>
21
22/*
23 * Divisors for each OD setting.
24 */
25static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
26
27unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco)
28{
29 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
30}
31
32EXPORT_SYMBOL(icst307_khz);
33
34/*
35 * Ascending divisor S values.
36 */
37static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
38
39struct icst307_vco
40icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq)
41{
42 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
43 unsigned long f;
44 unsigned int i = 0, rd, best = (unsigned int)-1;
45
46 /*
47 * First, find the PLL output divisor such
48 * that the PLL output is within spec.
49 */
50 do {
51 f = freq * s2div[idx2s[i]];
52
53 /*
54 * f must be between 6MHz and 200MHz (3.3 or 5V)
55 */
56 if (f > 6000 && f <= p->vco_max)
57 break;
58 } while (i < ARRAY_SIZE(idx2s));
59
60 if (i >= ARRAY_SIZE(idx2s))
61 return vco;
62
63 vco.s = idx2s[i];
64
65 /*
66 * Now find the closest divisor combination
67 * which gives a PLL output of 'f'.
68 */
69 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
70 unsigned long fref_div, f_pll;
71 unsigned int vd;
72 int f_diff;
73
74 fref_div = (2 * p->ref) / rd;
75
76 vd = (f + fref_div / 2) / fref_div;
77 if (vd < p->vd_min || vd > p->vd_max)
78 continue;
79
80 f_pll = fref_div * vd;
81 f_diff = f_pll - f;
82 if (f_diff < 0)
83 f_diff = -f_diff;
84
85 if ((unsigned)f_diff < best) {
86 vco.v = vd - 8;
87 vco.r = rd - 2;
88 if (f_diff == 0)
89 break;
90 best = f_diff;
91 }
92 }
93
94 return vco;
95}
96
97EXPORT_SYMBOL(icst307_khz_to_vco);
98
99struct icst307_vco
100icst307_ps_to_vco(const struct icst307_params *p, unsigned long period)
101{
102 struct icst307_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
103 unsigned long f, ps;
104 unsigned int i = 0, rd, best = (unsigned int)-1;
105
106 ps = 1000000000UL / p->vco_max;
107
108 /*
109 * First, find the PLL output divisor such
110 * that the PLL output is within spec.
111 */
112 do {
113 f = period / s2div[idx2s[i]];
114
115 /*
116 * f must be between 6MHz and 200MHz (3.3 or 5V)
117 */
118 if (f >= ps && f < 1000000000UL / 6000 + 1)
119 break;
120 } while (i < ARRAY_SIZE(idx2s));
121
122 if (i >= ARRAY_SIZE(idx2s))
123 return vco;
124
125 vco.s = idx2s[i];
126
127 ps = 500000000UL / p->ref;
128
129 /*
130 * Now find the closest divisor combination
131 * which gives a PLL output of 'f'.
132 */
133 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
134 unsigned long f_in_div, f_pll;
135 unsigned int vd;
136 int f_diff;
137
138 f_in_div = ps * rd;
139
140 vd = (f_in_div + f / 2) / f;
141 if (vd < p->vd_min || vd > p->vd_max)
142 continue;
143
144 f_pll = (f_in_div + vd / 2) / vd;
145 f_diff = f_pll - f;
146 if (f_diff < 0)
147 f_diff = -f_diff;
148
149 if ((unsigned)f_diff < best) {
150 vco.v = vd - 8;
151 vco.r = rd - 2;
152 if (f_diff == 0)
153 break;
154 best = f_diff;
155 }
156 }
157
158 return vco;
159}
160
161EXPORT_SYMBOL(icst307_ps_to_vco);
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c
deleted file mode 100644
index 3d377c5bdef6..000000000000
--- a/arch/arm/common/icst525.c
+++ /dev/null
@@ -1,160 +0,0 @@
1/*
2 * linux/arch/arm/common/icst525.c
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST525
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 */
14#include <linux/module.h>
15#include <linux/kernel.h>
16
17#include <asm/hardware/icst525.h>
18
19/*
20 * Divisors for each OD setting.
21 */
22static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
23
24unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco)
25{
26 return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
27}
28
29EXPORT_SYMBOL(icst525_khz);
30
31/*
32 * Ascending divisor S values.
33 */
34static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 };
35
36struct icst525_vco
37icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq)
38{
39 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
40 unsigned long f;
41 unsigned int i = 0, rd, best = (unsigned int)-1;
42
43 /*
44 * First, find the PLL output divisor such
45 * that the PLL output is within spec.
46 */
47 do {
48 f = freq * s2div[idx2s[i]];
49
50 /*
51 * f must be between 10MHz and
52 * 320MHz (5V) or 200MHz (3V)
53 */
54 if (f > 10000 && f <= p->vco_max)
55 break;
56 } while (i < ARRAY_SIZE(idx2s));
57
58 if (i >= ARRAY_SIZE(idx2s))
59 return vco;
60
61 vco.s = idx2s[i];
62
63 /*
64 * Now find the closest divisor combination
65 * which gives a PLL output of 'f'.
66 */
67 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
68 unsigned long fref_div, f_pll;
69 unsigned int vd;
70 int f_diff;
71
72 fref_div = (2 * p->ref) / rd;
73
74 vd = (f + fref_div / 2) / fref_div;
75 if (vd < p->vd_min || vd > p->vd_max)
76 continue;
77
78 f_pll = fref_div * vd;
79 f_diff = f_pll - f;
80 if (f_diff < 0)
81 f_diff = -f_diff;
82
83 if ((unsigned)f_diff < best) {
84 vco.v = vd - 8;
85 vco.r = rd - 2;
86 if (f_diff == 0)
87 break;
88 best = f_diff;
89 }
90 }
91
92 return vco;
93}
94
95EXPORT_SYMBOL(icst525_khz_to_vco);
96
97struct icst525_vco
98icst525_ps_to_vco(const struct icst525_params *p, unsigned long period)
99{
100 struct icst525_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
101 unsigned long f, ps;
102 unsigned int i = 0, rd, best = (unsigned int)-1;
103
104 ps = 1000000000UL / p->vco_max;
105
106 /*
107 * First, find the PLL output divisor such
108 * that the PLL output is within spec.
109 */
110 do {
111 f = period / s2div[idx2s[i]];
112
113 /*
114 * f must be between 10MHz and
115 * 320MHz (5V) or 200MHz (3V)
116 */
117 if (f >= ps && f < 100000)
118 break;
119 } while (i < ARRAY_SIZE(idx2s));
120
121 if (i >= ARRAY_SIZE(idx2s))
122 return vco;
123
124 vco.s = idx2s[i];
125
126 ps = 500000000UL / p->ref;
127
128 /*
129 * Now find the closest divisor combination
130 * which gives a PLL output of 'f'.
131 */
132 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
133 unsigned long f_in_div, f_pll;
134 unsigned int vd;
135 int f_diff;
136
137 f_in_div = ps * rd;
138
139 vd = (f_in_div + f / 2) / f;
140 if (vd < p->vd_min || vd > p->vd_max)
141 continue;
142
143 f_pll = (f_in_div + vd / 2) / vd;
144 f_diff = f_pll - f;
145 if (f_diff < 0)
146 f_diff = -f_diff;
147
148 if ((unsigned)f_diff < best) {
149 vco.v = vd - 8;
150 vco.r = rd - 2;
151 if (f_diff == 0)
152 break;
153 best = f_diff;
154 }
155 }
156
157 return vco;
158}
159
160EXPORT_SYMBOL(icst525_ps_to_vco);
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 1cf999ade4bc..ba65f6eedca6 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -266,13 +266,53 @@ static int vic_set_wake(unsigned int irq, unsigned int on)
266#endif /* CONFIG_PM */ 266#endif /* CONFIG_PM */
267 267
268static struct irq_chip vic_chip = { 268static struct irq_chip vic_chip = {
269 .name = "VIC", 269 .name = "VIC",
270 .ack = vic_ack_irq, 270 .ack = vic_ack_irq,
271 .mask = vic_mask_irq, 271 .mask = vic_mask_irq,
272 .unmask = vic_unmask_irq, 272 .unmask = vic_unmask_irq,
273 .set_wake = vic_set_wake, 273 .set_wake = vic_set_wake,
274}; 274};
275 275
276static void __init vic_disable(void __iomem *base)
277{
278 writel(0, base + VIC_INT_SELECT);
279 writel(0, base + VIC_INT_ENABLE);
280 writel(~0, base + VIC_INT_ENABLE_CLEAR);
281 writel(0, base + VIC_IRQ_STATUS);
282 writel(0, base + VIC_ITCR);
283 writel(~0, base + VIC_INT_SOFT_CLEAR);
284}
285
286static void __init vic_clear_interrupts(void __iomem *base)
287{
288 unsigned int i;
289
290 writel(0, base + VIC_PL190_VECT_ADDR);
291 for (i = 0; i < 19; i++) {
292 unsigned int value;
293
294 value = readl(base + VIC_PL190_VECT_ADDR);
295 writel(value, base + VIC_PL190_VECT_ADDR);
296 }
297}
298
299static void __init vic_set_irq_sources(void __iomem *base,
300 unsigned int irq_start, u32 vic_sources)
301{
302 unsigned int i;
303
304 for (i = 0; i < 32; i++) {
305 if (vic_sources & (1 << i)) {
306 unsigned int irq = irq_start + i;
307
308 set_irq_chip(irq, &vic_chip);
309 set_irq_chip_data(irq, base);
310 set_irq_handler(irq, handle_level_irq);
311 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
312 }
313 }
314}
315
276/* 316/*
277 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts. 317 * The PL190 cell from ARM has been modified by ST to handle 64 interrupts.
278 * The original cell has 32 interrupts, while the modified one has 64, 318 * The original cell has 32 interrupts, while the modified one has 64,
@@ -287,13 +327,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
287 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0; 327 int vic_2nd_block = ((unsigned long)base & ~PAGE_MASK) != 0;
288 328
289 /* Disable all interrupts initially. */ 329 /* Disable all interrupts initially. */
290 330 vic_disable(base);
291 writel(0, base + VIC_INT_SELECT);
292 writel(0, base + VIC_INT_ENABLE);
293 writel(~0, base + VIC_INT_ENABLE_CLEAR);
294 writel(0, base + VIC_IRQ_STATUS);
295 writel(0, base + VIC_ITCR);
296 writel(~0, base + VIC_INT_SOFT_CLEAR);
297 331
298 /* 332 /*
299 * Make sure we clear all existing interrupts. The vector registers 333 * Make sure we clear all existing interrupts. The vector registers
@@ -302,13 +336,8 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
302 * the second base address, which is 0x20 in the page 336 * the second base address, which is 0x20 in the page
303 */ 337 */
304 if (vic_2nd_block) { 338 if (vic_2nd_block) {
305 writel(0, base + VIC_PL190_VECT_ADDR); 339 vic_clear_interrupts(base);
306 for (i = 0; i < 19; i++) {
307 unsigned int value;
308 340
309 value = readl(base + VIC_PL190_VECT_ADDR);
310 writel(value, base + VIC_PL190_VECT_ADDR);
311 }
312 /* ST has 16 vectors as well, but we don't enable them by now */ 341 /* ST has 16 vectors as well, but we don't enable them by now */
313 for (i = 0; i < 16; i++) { 342 for (i = 0; i < 16; i++) {
314 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); 343 void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4);
@@ -318,16 +347,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start,
318 writel(32, base + VIC_PL190_DEF_VECT_ADDR); 347 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
319 } 348 }
320 349
321 for (i = 0; i < 32; i++) { 350 vic_set_irq_sources(base, irq_start, vic_sources);
322 if (vic_sources & (1 << i)) {
323 unsigned int irq = irq_start + i;
324
325 set_irq_chip(irq, &vic_chip);
326 set_irq_chip_data(irq, base);
327 set_irq_handler(irq, handle_level_irq);
328 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
329 }
330 }
331} 351}
332 352
333/** 353/**
@@ -365,37 +385,14 @@ void __init vic_init(void __iomem *base, unsigned int irq_start,
365 } 385 }
366 386
367 /* Disable all interrupts initially. */ 387 /* Disable all interrupts initially. */
388 vic_disable(base);
368 389
369 writel(0, base + VIC_INT_SELECT); 390 /* Make sure we clear all existing interrupts */
370 writel(0, base + VIC_INT_ENABLE); 391 vic_clear_interrupts(base);
371 writel(~0, base + VIC_INT_ENABLE_CLEAR);
372 writel(0, base + VIC_IRQ_STATUS);
373 writel(0, base + VIC_ITCR);
374 writel(~0, base + VIC_INT_SOFT_CLEAR);
375
376 /*
377 * Make sure we clear all existing interrupts
378 */
379 writel(0, base + VIC_PL190_VECT_ADDR);
380 for (i = 0; i < 19; i++) {
381 unsigned int value;
382
383 value = readl(base + VIC_PL190_VECT_ADDR);
384 writel(value, base + VIC_PL190_VECT_ADDR);
385 }
386 392
387 vic_init2(base); 393 vic_init2(base);
388 394
389 for (i = 0; i < 32; i++) { 395 vic_set_irq_sources(base, irq_start, vic_sources);
390 if (vic_sources & (1 << i)) {
391 unsigned int irq = irq_start + i;
392
393 set_irq_chip(irq, &vic_chip);
394 set_irq_chip_data(irq, base);
395 set_irq_handler(irq, handle_level_irq);
396 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
397 }
398 }
399 396
400 vic_pm_register(base, irq_start, resume_sources); 397 vic_pm_register(base, irq_start, resume_sources);
401} 398}
diff --git a/arch/arm/configs/spear300_defconfig b/arch/arm/configs/spear300_defconfig
new file mode 100644
index 000000000000..35e64d1cb750
--- /dev/null
+++ b/arch/arm/configs/spear300_defconfig
@@ -0,0 +1,773 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32
4# Tue Mar 23 14:36:23 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36CONFIG_SYSVIPC_SYSCTL=y
37CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39
40#
41# RCU Subsystem
42#
43CONFIG_TREE_RCU=y
44# CONFIG_TREE_PREEMPT_RCU is not set
45# CONFIG_RCU_TRACE is not set
46CONFIG_RCU_FANOUT=32
47# CONFIG_RCU_FANOUT_EXACT is not set
48# CONFIG_TREE_RCU_TRACE is not set
49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=17
51# CONFIG_GROUP_SCHED is not set
52# CONFIG_CGROUPS is not set
53# CONFIG_SYSFS_DEPRECATED_V2 is not set
54# CONFIG_RELAY is not set
55CONFIG_NAMESPACES=y
56# CONFIG_UTS_NS is not set
57# CONFIG_IPC_NS is not set
58# CONFIG_USER_NS is not set
59# CONFIG_PID_NS is not set
60CONFIG_BLK_DEV_INITRD=y
61CONFIG_INITRAMFS_SOURCE=""
62CONFIG_RD_GZIP=y
63CONFIG_RD_BZIP2=y
64CONFIG_RD_LZMA=y
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73CONFIG_KALLSYMS_EXTRA_PASS=y
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLUB_DEBUG=y
92CONFIG_COMPAT_BRK=y
93# CONFIG_SLAB is not set
94CONFIG_SLUB=y
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_CLK=y
102
103#
104# GCOV-based kernel profiling
105#
106# CONFIG_GCOV_KERNEL is not set
107# CONFIG_SLOW_WORK is not set
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115# CONFIG_MODULE_FORCE_UNLOAD is not set
116CONFIG_MODVERSIONS=y
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119CONFIG_LBDAF=y
120CONFIG_BLK_DEV_BSG=y
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_AS=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130# CONFIG_DEFAULT_AS is not set
131# CONFIG_DEFAULT_DEADLINE is not set
132CONFIG_DEFAULT_CFQ=y
133# CONFIG_DEFAULT_NOOP is not set
134CONFIG_DEFAULT_IOSCHED="cfq"
135# CONFIG_FREEZER is not set
136
137#
138# System Type
139#
140CONFIG_MMU=y
141# CONFIG_ARCH_AAEC2000 is not set
142# CONFIG_ARCH_INTEGRATOR is not set
143# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_MXC is not set
152# CONFIG_ARCH_STMP3XXX is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_NOMADIK is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_LOKI is not set
165# CONFIG_ARCH_MV78XX0 is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
171# CONFIG_ARCH_PNX4008 is not set
172# CONFIG_ARCH_PXA is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_RPC is not set
175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_S5PC1XX is not set
179# CONFIG_ARCH_SHARK is not set
180# CONFIG_ARCH_LH7A40X is not set
181# CONFIG_ARCH_U300 is not set
182# CONFIG_ARCH_DAVINCI is not set
183# CONFIG_ARCH_OMAP is not set
184# CONFIG_ARCH_BCMRING is not set
185CONFIG_PLAT_SPEAR=y
186CONFIG_ARCH_SPEAR3XX=y
187# CONFIG_ARCH_SPEAR6XX is not set
188CONFIG_MACH_SPEAR300=y
189# CONFIG_MACH_SPEAR310 is not set
190# CONFIG_MACH_SPEAR320 is not set
191CONFIG_BOARD_SPEAR300_EVB=y
192
193#
194# Processor Type
195#
196CONFIG_CPU_32=y
197CONFIG_CPU_ARM926T=y
198CONFIG_CPU_32v5=y
199CONFIG_CPU_ABRT_EV5TJ=y
200CONFIG_CPU_PABRT_LEGACY=y
201CONFIG_CPU_CACHE_VIVT=y
202CONFIG_CPU_COPY_V4WB=y
203CONFIG_CPU_TLB_V4WBI=y
204CONFIG_CPU_CP15=y
205CONFIG_CPU_CP15_MMU=y
206
207#
208# Processor Features
209#
210CONFIG_ARM_THUMB=y
211# CONFIG_CPU_ICACHE_DISABLE is not set
212# CONFIG_CPU_DCACHE_DISABLE is not set
213# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
214# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
215CONFIG_ARM_L1_CACHE_SHIFT=5
216CONFIG_ARM_VIC=y
217CONFIG_ARM_VIC_NR=2
218CONFIG_COMMON_CLKDEV=y
219
220#
221# Bus support
222#
223CONFIG_ARM_AMBA=y
224# CONFIG_PCI_SYSCALL is not set
225# CONFIG_ARCH_SUPPORTS_MSI is not set
226# CONFIG_PCCARD is not set
227
228#
229# Kernel Features
230#
231# CONFIG_NO_HZ is not set
232# CONFIG_HIGH_RES_TIMERS is not set
233CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
234CONFIG_VMSPLIT_3G=y
235# CONFIG_VMSPLIT_2G is not set
236# CONFIG_VMSPLIT_1G is not set
237CONFIG_PAGE_OFFSET=0xC0000000
238CONFIG_PREEMPT_NONE=y
239# CONFIG_PREEMPT_VOLUNTARY is not set
240# CONFIG_PREEMPT is not set
241CONFIG_HZ=100
242# CONFIG_AEABI is not set
243# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
244# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
245# CONFIG_HIGHMEM is not set
246CONFIG_SELECT_MEMORY_MODEL=y
247CONFIG_FLATMEM_MANUAL=y
248# CONFIG_DISCONTIGMEM_MANUAL is not set
249# CONFIG_SPARSEMEM_MANUAL is not set
250CONFIG_FLATMEM=y
251CONFIG_FLAT_NODE_MEM_MAP=y
252CONFIG_PAGEFLAGS_EXTENDED=y
253CONFIG_SPLIT_PTLOCK_CPUS=4096
254# CONFIG_PHYS_ADDR_T_64BIT is not set
255CONFIG_ZONE_DMA_FLAG=0
256CONFIG_VIRT_TO_BUS=y
257CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y
259# CONFIG_KSM is not set
260CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
261CONFIG_ALIGNMENT_TRAP=y
262# CONFIG_UACCESS_WITH_MEMCPY is not set
263
264#
265# Boot options
266#
267CONFIG_ZBOOT_ROM_TEXT=0
268CONFIG_ZBOOT_ROM_BSS=0
269CONFIG_CMDLINE=""
270# CONFIG_XIP_KERNEL is not set
271# CONFIG_KEXEC is not set
272
273#
274# CPU Power Management
275#
276# CONFIG_CPU_IDLE is not set
277
278#
279# Floating point emulation
280#
281
282#
283# At least one emulation must be selected
284#
285# CONFIG_FPE_NWFPE is not set
286# CONFIG_FPE_FASTFPE is not set
287# CONFIG_VFP is not set
288
289#
290# Userspace binary formats
291#
292CONFIG_BINFMT_ELF=y
293# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
294CONFIG_HAVE_AOUT=y
295# CONFIG_BINFMT_AOUT is not set
296CONFIG_BINFMT_MISC=y
297
298#
299# Power management options
300#
301# CONFIG_PM is not set
302CONFIG_ARCH_SUSPEND_POSSIBLE=y
303# CONFIG_NET is not set
304
305#
306# Device Drivers
307#
308
309#
310# Generic Driver Options
311#
312CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
313# CONFIG_DEVTMPFS is not set
314CONFIG_STANDALONE=y
315CONFIG_PREVENT_FIRMWARE_BUILD=y
316CONFIG_FW_LOADER=y
317CONFIG_FIRMWARE_IN_KERNEL=y
318CONFIG_EXTRA_FIRMWARE=""
319# CONFIG_DEBUG_DRIVER is not set
320# CONFIG_DEBUG_DEVRES is not set
321# CONFIG_SYS_HYPERVISOR is not set
322# CONFIG_MTD is not set
323# CONFIG_PARPORT is not set
324CONFIG_BLK_DEV=y
325# CONFIG_BLK_DEV_COW_COMMON is not set
326# CONFIG_BLK_DEV_LOOP is not set
327CONFIG_BLK_DEV_RAM=y
328CONFIG_BLK_DEV_RAM_COUNT=16
329CONFIG_BLK_DEV_RAM_SIZE=16384
330# CONFIG_BLK_DEV_XIP is not set
331# CONFIG_CDROM_PKTCDVD is not set
332CONFIG_MISC_DEVICES=y
333# CONFIG_ENCLOSURE_SERVICES is not set
334# CONFIG_C2PORT is not set
335
336#
337# EEPROM support
338#
339# CONFIG_EEPROM_93CX6 is not set
340CONFIG_HAVE_IDE=y
341# CONFIG_IDE is not set
342
343#
344# SCSI device support
345#
346# CONFIG_RAID_ATTRS is not set
347# CONFIG_SCSI is not set
348# CONFIG_SCSI_DMA is not set
349# CONFIG_SCSI_NETLINK is not set
350# CONFIG_ATA is not set
351# CONFIG_MD is not set
352# CONFIG_PHONE is not set
353
354#
355# Input device support
356#
357CONFIG_INPUT=y
358CONFIG_INPUT_FF_MEMLESS=y
359# CONFIG_INPUT_POLLDEV is not set
360
361#
362# Userland interfaces
363#
364CONFIG_INPUT_MOUSEDEV=y
365# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
366CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
367CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
368# CONFIG_INPUT_JOYDEV is not set
369# CONFIG_INPUT_EVDEV is not set
370# CONFIG_INPUT_EVBUG is not set
371
372#
373# Input Device Drivers
374#
375# CONFIG_INPUT_KEYBOARD is not set
376# CONFIG_INPUT_MOUSE is not set
377# CONFIG_INPUT_JOYSTICK is not set
378# CONFIG_INPUT_TABLET is not set
379# CONFIG_INPUT_TOUCHSCREEN is not set
380# CONFIG_INPUT_MISC is not set
381
382#
383# Hardware I/O ports
384#
385CONFIG_SERIO=y
386CONFIG_SERIO_SERPORT=y
387# CONFIG_SERIO_AMBAKMI is not set
388# CONFIG_SERIO_RAW is not set
389# CONFIG_GAMEPORT is not set
390
391#
392# Character devices
393#
394CONFIG_VT=y
395CONFIG_CONSOLE_TRANSLATIONS=y
396CONFIG_VT_CONSOLE=y
397CONFIG_HW_CONSOLE=y
398# CONFIG_VT_HW_CONSOLE_BINDING is not set
399CONFIG_DEVKMEM=y
400# CONFIG_SERIAL_NONSTANDARD is not set
401
402#
403# Serial drivers
404#
405# CONFIG_SERIAL_8250 is not set
406
407#
408# Non-8250 serial port support
409#
410# CONFIG_SERIAL_AMBA_PL010 is not set
411CONFIG_SERIAL_AMBA_PL011=y
412CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
413CONFIG_SERIAL_CORE=y
414CONFIG_SERIAL_CORE_CONSOLE=y
415CONFIG_UNIX98_PTYS=y
416# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
417# CONFIG_LEGACY_PTYS is not set
418# CONFIG_IPMI_HANDLER is not set
419# CONFIG_HW_RANDOM is not set
420# CONFIG_R3964 is not set
421CONFIG_RAW_DRIVER=y
422CONFIG_MAX_RAW_DEVS=8192
423# CONFIG_TCG_TPM is not set
424# CONFIG_I2C is not set
425# CONFIG_SPI is not set
426
427#
428# PPS support
429#
430# CONFIG_PPS is not set
431CONFIG_ARCH_REQUIRE_GPIOLIB=y
432CONFIG_GPIOLIB=y
433# CONFIG_DEBUG_GPIO is not set
434CONFIG_GPIO_SYSFS=y
435
436#
437# Memory mapped GPIO expanders:
438#
439CONFIG_GPIO_PL061=y
440
441#
442# I2C GPIO expanders:
443#
444
445#
446# PCI GPIO expanders:
447#
448
449#
450# SPI GPIO expanders:
451#
452
453#
454# AC97 GPIO expanders:
455#
456# CONFIG_W1 is not set
457# CONFIG_POWER_SUPPLY is not set
458# CONFIG_HWMON is not set
459# CONFIG_THERMAL is not set
460# CONFIG_WATCHDOG is not set
461CONFIG_SSB_POSSIBLE=y
462
463#
464# Sonics Silicon Backplane
465#
466# CONFIG_SSB is not set
467
468#
469# Multifunction device drivers
470#
471# CONFIG_MFD_CORE is not set
472# CONFIG_MFD_SM501 is not set
473# CONFIG_MFD_ASIC3 is not set
474# CONFIG_HTC_EGPIO is not set
475# CONFIG_HTC_PASIC3 is not set
476# CONFIG_MFD_TMIO is not set
477# CONFIG_MFD_T7L66XB is not set
478# CONFIG_MFD_TC6387XB is not set
479# CONFIG_MFD_TC6393XB is not set
480# CONFIG_REGULATOR is not set
481# CONFIG_MEDIA_SUPPORT is not set
482
483#
484# Graphics support
485#
486# CONFIG_VGASTATE is not set
487# CONFIG_VIDEO_OUTPUT_CONTROL is not set
488# CONFIG_FB is not set
489# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
490
491#
492# Display device support
493#
494# CONFIG_DISPLAY_SUPPORT is not set
495
496#
497# Console display driver support
498#
499# CONFIG_VGA_CONSOLE is not set
500CONFIG_DUMMY_CONSOLE=y
501# CONFIG_SOUND is not set
502# CONFIG_HID_SUPPORT is not set
503# CONFIG_USB_SUPPORT is not set
504# CONFIG_MMC is not set
505# CONFIG_MEMSTICK is not set
506# CONFIG_NEW_LEDS is not set
507# CONFIG_ACCESSIBILITY is not set
508CONFIG_RTC_LIB=y
509# CONFIG_RTC_CLASS is not set
510# CONFIG_DMADEVICES is not set
511# CONFIG_AUXDISPLAY is not set
512# CONFIG_UIO is not set
513
514#
515# TI VLYNQ
516#
517# CONFIG_STAGING is not set
518
519#
520# File systems
521#
522CONFIG_EXT2_FS=y
523CONFIG_EXT2_FS_XATTR=y
524# CONFIG_EXT2_FS_POSIX_ACL is not set
525CONFIG_EXT2_FS_SECURITY=y
526# CONFIG_EXT2_FS_XIP is not set
527CONFIG_EXT3_FS=y
528# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
529CONFIG_EXT3_FS_XATTR=y
530# CONFIG_EXT3_FS_POSIX_ACL is not set
531CONFIG_EXT3_FS_SECURITY=y
532# CONFIG_EXT4_FS is not set
533CONFIG_JBD=y
534# CONFIG_JBD_DEBUG is not set
535CONFIG_FS_MBCACHE=y
536# CONFIG_REISERFS_FS is not set
537# CONFIG_JFS_FS is not set
538# CONFIG_FS_POSIX_ACL is not set
539# CONFIG_XFS_FS is not set
540# CONFIG_GFS2_FS is not set
541# CONFIG_BTRFS_FS is not set
542# CONFIG_NILFS2_FS is not set
543CONFIG_FILE_LOCKING=y
544CONFIG_FSNOTIFY=y
545CONFIG_DNOTIFY=y
546# CONFIG_INOTIFY is not set
547CONFIG_INOTIFY_USER=y
548# CONFIG_QUOTA is not set
549# CONFIG_AUTOFS_FS is not set
550CONFIG_AUTOFS4_FS=m
551# CONFIG_FUSE_FS is not set
552
553#
554# Caches
555#
556# CONFIG_FSCACHE is not set
557
558#
559# CD-ROM/DVD Filesystems
560#
561# CONFIG_ISO9660_FS is not set
562# CONFIG_UDF_FS is not set
563
564#
565# DOS/FAT/NT Filesystems
566#
567CONFIG_FAT_FS=m
568CONFIG_MSDOS_FS=m
569CONFIG_VFAT_FS=m
570CONFIG_FAT_DEFAULT_CODEPAGE=437
571CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
572# CONFIG_NTFS_FS is not set
573
574#
575# Pseudo filesystems
576#
577CONFIG_PROC_FS=y
578CONFIG_PROC_SYSCTL=y
579CONFIG_PROC_PAGE_MONITOR=y
580CONFIG_SYSFS=y
581CONFIG_TMPFS=y
582# CONFIG_TMPFS_POSIX_ACL is not set
583# CONFIG_HUGETLB_PAGE is not set
584# CONFIG_CONFIGFS_FS is not set
585CONFIG_MISC_FILESYSTEMS=y
586# CONFIG_ADFS_FS is not set
587# CONFIG_AFFS_FS is not set
588# CONFIG_HFS_FS is not set
589# CONFIG_HFSPLUS_FS is not set
590# CONFIG_BEFS_FS is not set
591# CONFIG_BFS_FS is not set
592# CONFIG_EFS_FS is not set
593# CONFIG_SQUASHFS is not set
594# CONFIG_VXFS_FS is not set
595# CONFIG_MINIX_FS is not set
596# CONFIG_OMFS_FS is not set
597# CONFIG_HPFS_FS is not set
598# CONFIG_QNX4FS_FS is not set
599# CONFIG_ROMFS_FS is not set
600# CONFIG_SYSV_FS is not set
601# CONFIG_UFS_FS is not set
602
603#
604# Partition Types
605#
606CONFIG_PARTITION_ADVANCED=y
607# CONFIG_ACORN_PARTITION is not set
608# CONFIG_OSF_PARTITION is not set
609# CONFIG_AMIGA_PARTITION is not set
610# CONFIG_ATARI_PARTITION is not set
611# CONFIG_MAC_PARTITION is not set
612CONFIG_MSDOS_PARTITION=y
613# CONFIG_BSD_DISKLABEL is not set
614# CONFIG_MINIX_SUBPARTITION is not set
615# CONFIG_SOLARIS_X86_PARTITION is not set
616# CONFIG_UNIXWARE_DISKLABEL is not set
617# CONFIG_LDM_PARTITION is not set
618# CONFIG_SGI_PARTITION is not set
619# CONFIG_ULTRIX_PARTITION is not set
620# CONFIG_SUN_PARTITION is not set
621# CONFIG_KARMA_PARTITION is not set
622# CONFIG_EFI_PARTITION is not set
623# CONFIG_SYSV68_PARTITION is not set
624CONFIG_NLS=y
625CONFIG_NLS_DEFAULT="utf8"
626CONFIG_NLS_CODEPAGE_437=y
627# CONFIG_NLS_CODEPAGE_737 is not set
628# CONFIG_NLS_CODEPAGE_775 is not set
629# CONFIG_NLS_CODEPAGE_850 is not set
630# CONFIG_NLS_CODEPAGE_852 is not set
631# CONFIG_NLS_CODEPAGE_855 is not set
632# CONFIG_NLS_CODEPAGE_857 is not set
633# CONFIG_NLS_CODEPAGE_860 is not set
634# CONFIG_NLS_CODEPAGE_861 is not set
635# CONFIG_NLS_CODEPAGE_862 is not set
636# CONFIG_NLS_CODEPAGE_863 is not set
637# CONFIG_NLS_CODEPAGE_864 is not set
638# CONFIG_NLS_CODEPAGE_865 is not set
639# CONFIG_NLS_CODEPAGE_866 is not set
640# CONFIG_NLS_CODEPAGE_869 is not set
641# CONFIG_NLS_CODEPAGE_936 is not set
642# CONFIG_NLS_CODEPAGE_950 is not set
643# CONFIG_NLS_CODEPAGE_932 is not set
644# CONFIG_NLS_CODEPAGE_949 is not set
645# CONFIG_NLS_CODEPAGE_874 is not set
646# CONFIG_NLS_ISO8859_8 is not set
647# CONFIG_NLS_CODEPAGE_1250 is not set
648# CONFIG_NLS_CODEPAGE_1251 is not set
649CONFIG_NLS_ASCII=m
650# CONFIG_NLS_ISO8859_1 is not set
651# CONFIG_NLS_ISO8859_2 is not set
652# CONFIG_NLS_ISO8859_3 is not set
653# CONFIG_NLS_ISO8859_4 is not set
654# CONFIG_NLS_ISO8859_5 is not set
655# CONFIG_NLS_ISO8859_6 is not set
656# CONFIG_NLS_ISO8859_7 is not set
657# CONFIG_NLS_ISO8859_9 is not set
658# CONFIG_NLS_ISO8859_13 is not set
659# CONFIG_NLS_ISO8859_14 is not set
660# CONFIG_NLS_ISO8859_15 is not set
661# CONFIG_NLS_KOI8_R is not set
662# CONFIG_NLS_KOI8_U is not set
663# CONFIG_NLS_UTF8 is not set
664
665#
666# Kernel hacking
667#
668# CONFIG_PRINTK_TIME is not set
669CONFIG_ENABLE_WARN_DEPRECATED=y
670CONFIG_ENABLE_MUST_CHECK=y
671CONFIG_FRAME_WARN=1024
672CONFIG_MAGIC_SYSRQ=y
673# CONFIG_STRIP_ASM_SYMS is not set
674# CONFIG_UNUSED_SYMBOLS is not set
675CONFIG_DEBUG_FS=y
676# CONFIG_HEADERS_CHECK is not set
677CONFIG_DEBUG_KERNEL=y
678# CONFIG_DEBUG_SHIRQ is not set
679CONFIG_DETECT_SOFTLOCKUP=y
680# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
681CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
682CONFIG_DETECT_HUNG_TASK=y
683# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
684CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
685CONFIG_SCHED_DEBUG=y
686# CONFIG_SCHEDSTATS is not set
687# CONFIG_TIMER_STATS is not set
688# CONFIG_DEBUG_OBJECTS is not set
689# CONFIG_SLUB_DEBUG_ON is not set
690# CONFIG_SLUB_STATS is not set
691# CONFIG_DEBUG_KMEMLEAK is not set
692# CONFIG_DEBUG_RT_MUTEXES is not set
693# CONFIG_RT_MUTEX_TESTER is not set
694CONFIG_DEBUG_SPINLOCK=y
695# CONFIG_DEBUG_MUTEXES is not set
696# CONFIG_DEBUG_LOCK_ALLOC is not set
697# CONFIG_PROVE_LOCKING is not set
698# CONFIG_LOCK_STAT is not set
699CONFIG_DEBUG_SPINLOCK_SLEEP=y
700# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
701# CONFIG_DEBUG_KOBJECT is not set
702CONFIG_DEBUG_BUGVERBOSE=y
703CONFIG_DEBUG_INFO=y
704# CONFIG_DEBUG_VM is not set
705# CONFIG_DEBUG_WRITECOUNT is not set
706CONFIG_DEBUG_MEMORY_INIT=y
707# CONFIG_DEBUG_LIST is not set
708# CONFIG_DEBUG_SG is not set
709# CONFIG_DEBUG_NOTIFIERS is not set
710# CONFIG_DEBUG_CREDENTIALS is not set
711CONFIG_FRAME_POINTER=y
712# CONFIG_BOOT_PRINTK_DELAY is not set
713# CONFIG_RCU_TORTURE_TEST is not set
714CONFIG_RCU_CPU_STALL_DETECTOR=y
715# CONFIG_BACKTRACE_SELF_TEST is not set
716# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
717# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
718# CONFIG_FAULT_INJECTION is not set
719# CONFIG_LATENCYTOP is not set
720# CONFIG_SYSCTL_SYSCALL_CHECK is not set
721# CONFIG_PAGE_POISONING is not set
722CONFIG_HAVE_FUNCTION_TRACER=y
723CONFIG_TRACING_SUPPORT=y
724CONFIG_FTRACE=y
725# CONFIG_FUNCTION_TRACER is not set
726# CONFIG_IRQSOFF_TRACER is not set
727# CONFIG_SCHED_TRACER is not set
728# CONFIG_ENABLE_DEFAULT_TRACERS is not set
729# CONFIG_BOOT_TRACER is not set
730CONFIG_BRANCH_PROFILE_NONE=y
731# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
732# CONFIG_PROFILE_ALL_BRANCHES is not set
733# CONFIG_STACK_TRACER is not set
734# CONFIG_KMEMTRACE is not set
735# CONFIG_WORKQUEUE_TRACER is not set
736# CONFIG_BLK_DEV_IO_TRACE is not set
737# CONFIG_DYNAMIC_DEBUG is not set
738# CONFIG_SAMPLES is not set
739CONFIG_HAVE_ARCH_KGDB=y
740# CONFIG_KGDB is not set
741# CONFIG_DEBUG_USER is not set
742# CONFIG_DEBUG_ERRORS is not set
743# CONFIG_DEBUG_STACK_USAGE is not set
744# CONFIG_DEBUG_LL is not set
745
746#
747# Security options
748#
749# CONFIG_KEYS is not set
750# CONFIG_SECURITY is not set
751# CONFIG_SECURITYFS is not set
752# CONFIG_SECURITY_FILE_CAPABILITIES is not set
753# CONFIG_CRYPTO is not set
754# CONFIG_BINARY_PRINTF is not set
755
756#
757# Library routines
758#
759CONFIG_GENERIC_FIND_LAST_BIT=y
760# CONFIG_CRC_CCITT is not set
761# CONFIG_CRC16 is not set
762# CONFIG_CRC_T10DIF is not set
763# CONFIG_CRC_ITU_T is not set
764# CONFIG_CRC32 is not set
765# CONFIG_CRC7 is not set
766# CONFIG_LIBCRC32C is not set
767CONFIG_ZLIB_INFLATE=y
768CONFIG_DECOMPRESS_GZIP=y
769CONFIG_DECOMPRESS_BZIP2=y
770CONFIG_DECOMPRESS_LZMA=y
771CONFIG_HAS_IOMEM=y
772CONFIG_HAS_IOPORT=y
773CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/spear310_defconfig b/arch/arm/configs/spear310_defconfig
new file mode 100644
index 000000000000..cbbfd290bba8
--- /dev/null
+++ b/arch/arm/configs/spear310_defconfig
@@ -0,0 +1,775 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32
4# Tue Mar 23 14:37:01 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36CONFIG_SYSVIPC_SYSCTL=y
37CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39
40#
41# RCU Subsystem
42#
43CONFIG_TREE_RCU=y
44# CONFIG_TREE_PREEMPT_RCU is not set
45# CONFIG_RCU_TRACE is not set
46CONFIG_RCU_FANOUT=32
47# CONFIG_RCU_FANOUT_EXACT is not set
48# CONFIG_TREE_RCU_TRACE is not set
49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=17
51# CONFIG_GROUP_SCHED is not set
52# CONFIG_CGROUPS is not set
53# CONFIG_SYSFS_DEPRECATED_V2 is not set
54# CONFIG_RELAY is not set
55CONFIG_NAMESPACES=y
56# CONFIG_UTS_NS is not set
57# CONFIG_IPC_NS is not set
58# CONFIG_USER_NS is not set
59# CONFIG_PID_NS is not set
60CONFIG_BLK_DEV_INITRD=y
61CONFIG_INITRAMFS_SOURCE=""
62CONFIG_RD_GZIP=y
63CONFIG_RD_BZIP2=y
64CONFIG_RD_LZMA=y
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73CONFIG_KALLSYMS_EXTRA_PASS=y
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLUB_DEBUG=y
92CONFIG_COMPAT_BRK=y
93# CONFIG_SLAB is not set
94CONFIG_SLUB=y
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_CLK=y
102
103#
104# GCOV-based kernel profiling
105#
106# CONFIG_GCOV_KERNEL is not set
107# CONFIG_SLOW_WORK is not set
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115# CONFIG_MODULE_FORCE_UNLOAD is not set
116CONFIG_MODVERSIONS=y
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119CONFIG_LBDAF=y
120CONFIG_BLK_DEV_BSG=y
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_AS=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130# CONFIG_DEFAULT_AS is not set
131# CONFIG_DEFAULT_DEADLINE is not set
132CONFIG_DEFAULT_CFQ=y
133# CONFIG_DEFAULT_NOOP is not set
134CONFIG_DEFAULT_IOSCHED="cfq"
135# CONFIG_FREEZER is not set
136
137#
138# System Type
139#
140CONFIG_MMU=y
141# CONFIG_ARCH_AAEC2000 is not set
142# CONFIG_ARCH_INTEGRATOR is not set
143# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_MXC is not set
152# CONFIG_ARCH_STMP3XXX is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_NOMADIK is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_LOKI is not set
165# CONFIG_ARCH_MV78XX0 is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
171# CONFIG_ARCH_PNX4008 is not set
172# CONFIG_ARCH_PXA is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_RPC is not set
175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_S5PC1XX is not set
179# CONFIG_ARCH_SHARK is not set
180# CONFIG_ARCH_LH7A40X is not set
181# CONFIG_ARCH_U300 is not set
182# CONFIG_ARCH_DAVINCI is not set
183# CONFIG_ARCH_OMAP is not set
184# CONFIG_ARCH_BCMRING is not set
185CONFIG_PLAT_SPEAR=y
186CONFIG_ARCH_SPEAR3XX=y
187# CONFIG_ARCH_SPEAR6XX is not set
188# CONFIG_MACH_SPEAR300 is not set
189CONFIG_MACH_SPEAR310=y
190# CONFIG_MACH_SPEAR320 is not set
191# CONFIG_BOARD_SPEAR300_EVB is not set
192CONFIG_BOARD_SPEAR310_EVB=y
193
194#
195# Processor Type
196#
197CONFIG_CPU_32=y
198CONFIG_CPU_ARM926T=y
199CONFIG_CPU_32v5=y
200CONFIG_CPU_ABRT_EV5TJ=y
201CONFIG_CPU_PABRT_LEGACY=y
202CONFIG_CPU_CACHE_VIVT=y
203CONFIG_CPU_COPY_V4WB=y
204CONFIG_CPU_TLB_V4WBI=y
205CONFIG_CPU_CP15=y
206CONFIG_CPU_CP15_MMU=y
207
208#
209# Processor Features
210#
211CONFIG_ARM_THUMB=y
212# CONFIG_CPU_ICACHE_DISABLE is not set
213# CONFIG_CPU_DCACHE_DISABLE is not set
214# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
215# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
216CONFIG_ARM_L1_CACHE_SHIFT=5
217CONFIG_ARM_VIC=y
218CONFIG_ARM_VIC_NR=2
219CONFIG_COMMON_CLKDEV=y
220
221#
222# Bus support
223#
224CONFIG_ARM_AMBA=y
225# CONFIG_PCI_SYSCALL is not set
226# CONFIG_ARCH_SUPPORTS_MSI is not set
227# CONFIG_PCCARD is not set
228
229#
230# Kernel Features
231#
232# CONFIG_NO_HZ is not set
233# CONFIG_HIGH_RES_TIMERS is not set
234CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
235CONFIG_VMSPLIT_3G=y
236# CONFIG_VMSPLIT_2G is not set
237# CONFIG_VMSPLIT_1G is not set
238CONFIG_PAGE_OFFSET=0xC0000000
239CONFIG_PREEMPT_NONE=y
240# CONFIG_PREEMPT_VOLUNTARY is not set
241# CONFIG_PREEMPT is not set
242CONFIG_HZ=100
243# CONFIG_AEABI is not set
244# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
245# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
246# CONFIG_HIGHMEM is not set
247CONFIG_SELECT_MEMORY_MODEL=y
248CONFIG_FLATMEM_MANUAL=y
249# CONFIG_DISCONTIGMEM_MANUAL is not set
250# CONFIG_SPARSEMEM_MANUAL is not set
251CONFIG_FLATMEM=y
252CONFIG_FLAT_NODE_MEM_MAP=y
253CONFIG_PAGEFLAGS_EXTENDED=y
254CONFIG_SPLIT_PTLOCK_CPUS=4096
255# CONFIG_PHYS_ADDR_T_64BIT is not set
256CONFIG_ZONE_DMA_FLAG=0
257CONFIG_VIRT_TO_BUS=y
258CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y
260# CONFIG_KSM is not set
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_ALIGNMENT_TRAP=y
263# CONFIG_UACCESS_WITH_MEMCPY is not set
264
265#
266# Boot options
267#
268CONFIG_ZBOOT_ROM_TEXT=0
269CONFIG_ZBOOT_ROM_BSS=0
270CONFIG_CMDLINE=""
271# CONFIG_XIP_KERNEL is not set
272# CONFIG_KEXEC is not set
273
274#
275# CPU Power Management
276#
277# CONFIG_CPU_IDLE is not set
278
279#
280# Floating point emulation
281#
282
283#
284# At least one emulation must be selected
285#
286# CONFIG_FPE_NWFPE is not set
287# CONFIG_FPE_FASTFPE is not set
288# CONFIG_VFP is not set
289
290#
291# Userspace binary formats
292#
293CONFIG_BINFMT_ELF=y
294# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
295CONFIG_HAVE_AOUT=y
296# CONFIG_BINFMT_AOUT is not set
297CONFIG_BINFMT_MISC=y
298
299#
300# Power management options
301#
302# CONFIG_PM is not set
303CONFIG_ARCH_SUSPEND_POSSIBLE=y
304# CONFIG_NET is not set
305
306#
307# Device Drivers
308#
309
310#
311# Generic Driver Options
312#
313CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
314# CONFIG_DEVTMPFS is not set
315CONFIG_STANDALONE=y
316CONFIG_PREVENT_FIRMWARE_BUILD=y
317CONFIG_FW_LOADER=y
318CONFIG_FIRMWARE_IN_KERNEL=y
319CONFIG_EXTRA_FIRMWARE=""
320# CONFIG_DEBUG_DRIVER is not set
321# CONFIG_DEBUG_DEVRES is not set
322# CONFIG_SYS_HYPERVISOR is not set
323# CONFIG_MTD is not set
324# CONFIG_PARPORT is not set
325CONFIG_BLK_DEV=y
326# CONFIG_BLK_DEV_COW_COMMON is not set
327# CONFIG_BLK_DEV_LOOP is not set
328CONFIG_BLK_DEV_RAM=y
329CONFIG_BLK_DEV_RAM_COUNT=16
330CONFIG_BLK_DEV_RAM_SIZE=16384
331# CONFIG_BLK_DEV_XIP is not set
332# CONFIG_CDROM_PKTCDVD is not set
333# CONFIG_MG_DISK is not set
334CONFIG_MISC_DEVICES=y
335# CONFIG_ENCLOSURE_SERVICES is not set
336# CONFIG_C2PORT is not set
337
338#
339# EEPROM support
340#
341# CONFIG_EEPROM_93CX6 is not set
342CONFIG_HAVE_IDE=y
343# CONFIG_IDE is not set
344
345#
346# SCSI device support
347#
348# CONFIG_RAID_ATTRS is not set
349# CONFIG_SCSI is not set
350# CONFIG_SCSI_DMA is not set
351# CONFIG_SCSI_NETLINK is not set
352# CONFIG_ATA is not set
353# CONFIG_MD is not set
354# CONFIG_PHONE is not set
355
356#
357# Input device support
358#
359CONFIG_INPUT=y
360CONFIG_INPUT_FF_MEMLESS=y
361# CONFIG_INPUT_POLLDEV is not set
362
363#
364# Userland interfaces
365#
366CONFIG_INPUT_MOUSEDEV=y
367# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
368CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
369CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
370# CONFIG_INPUT_JOYDEV is not set
371# CONFIG_INPUT_EVDEV is not set
372# CONFIG_INPUT_EVBUG is not set
373
374#
375# Input Device Drivers
376#
377# CONFIG_INPUT_KEYBOARD is not set
378# CONFIG_INPUT_MOUSE is not set
379# CONFIG_INPUT_JOYSTICK is not set
380# CONFIG_INPUT_TABLET is not set
381# CONFIG_INPUT_TOUCHSCREEN is not set
382# CONFIG_INPUT_MISC is not set
383
384#
385# Hardware I/O ports
386#
387CONFIG_SERIO=y
388CONFIG_SERIO_SERPORT=y
389# CONFIG_SERIO_AMBAKMI is not set
390# CONFIG_SERIO_RAW is not set
391# CONFIG_GAMEPORT is not set
392
393#
394# Character devices
395#
396CONFIG_VT=y
397CONFIG_CONSOLE_TRANSLATIONS=y
398CONFIG_VT_CONSOLE=y
399CONFIG_HW_CONSOLE=y
400# CONFIG_VT_HW_CONSOLE_BINDING is not set
401CONFIG_DEVKMEM=y
402# CONFIG_SERIAL_NONSTANDARD is not set
403
404#
405# Serial drivers
406#
407# CONFIG_SERIAL_8250 is not set
408
409#
410# Non-8250 serial port support
411#
412# CONFIG_SERIAL_AMBA_PL010 is not set
413CONFIG_SERIAL_AMBA_PL011=y
414CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
415CONFIG_SERIAL_CORE=y
416CONFIG_SERIAL_CORE_CONSOLE=y
417CONFIG_UNIX98_PTYS=y
418# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
419# CONFIG_LEGACY_PTYS is not set
420# CONFIG_IPMI_HANDLER is not set
421# CONFIG_HW_RANDOM is not set
422# CONFIG_R3964 is not set
423CONFIG_RAW_DRIVER=y
424CONFIG_MAX_RAW_DEVS=8192
425# CONFIG_TCG_TPM is not set
426# CONFIG_I2C is not set
427# CONFIG_SPI is not set
428
429#
430# PPS support
431#
432# CONFIG_PPS is not set
433CONFIG_ARCH_REQUIRE_GPIOLIB=y
434CONFIG_GPIOLIB=y
435# CONFIG_DEBUG_GPIO is not set
436CONFIG_GPIO_SYSFS=y
437
438#
439# Memory mapped GPIO expanders:
440#
441CONFIG_GPIO_PL061=y
442
443#
444# I2C GPIO expanders:
445#
446
447#
448# PCI GPIO expanders:
449#
450
451#
452# SPI GPIO expanders:
453#
454
455#
456# AC97 GPIO expanders:
457#
458# CONFIG_W1 is not set
459# CONFIG_POWER_SUPPLY is not set
460# CONFIG_HWMON is not set
461# CONFIG_THERMAL is not set
462# CONFIG_WATCHDOG is not set
463CONFIG_SSB_POSSIBLE=y
464
465#
466# Sonics Silicon Backplane
467#
468# CONFIG_SSB is not set
469
470#
471# Multifunction device drivers
472#
473# CONFIG_MFD_CORE is not set
474# CONFIG_MFD_SM501 is not set
475# CONFIG_MFD_ASIC3 is not set
476# CONFIG_HTC_EGPIO is not set
477# CONFIG_HTC_PASIC3 is not set
478# CONFIG_MFD_TMIO is not set
479# CONFIG_MFD_T7L66XB is not set
480# CONFIG_MFD_TC6387XB is not set
481# CONFIG_MFD_TC6393XB is not set
482# CONFIG_REGULATOR is not set
483# CONFIG_MEDIA_SUPPORT is not set
484
485#
486# Graphics support
487#
488# CONFIG_VGASTATE is not set
489# CONFIG_VIDEO_OUTPUT_CONTROL is not set
490# CONFIG_FB is not set
491# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
492
493#
494# Display device support
495#
496# CONFIG_DISPLAY_SUPPORT is not set
497
498#
499# Console display driver support
500#
501# CONFIG_VGA_CONSOLE is not set
502CONFIG_DUMMY_CONSOLE=y
503# CONFIG_SOUND is not set
504# CONFIG_HID_SUPPORT is not set
505# CONFIG_USB_SUPPORT is not set
506# CONFIG_MMC is not set
507# CONFIG_MEMSTICK is not set
508# CONFIG_NEW_LEDS is not set
509# CONFIG_ACCESSIBILITY is not set
510CONFIG_RTC_LIB=y
511# CONFIG_RTC_CLASS is not set
512# CONFIG_DMADEVICES is not set
513# CONFIG_AUXDISPLAY is not set
514# CONFIG_UIO is not set
515
516#
517# TI VLYNQ
518#
519# CONFIG_STAGING is not set
520
521#
522# File systems
523#
524CONFIG_EXT2_FS=y
525CONFIG_EXT2_FS_XATTR=y
526# CONFIG_EXT2_FS_POSIX_ACL is not set
527CONFIG_EXT2_FS_SECURITY=y
528# CONFIG_EXT2_FS_XIP is not set
529CONFIG_EXT3_FS=y
530# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
531CONFIG_EXT3_FS_XATTR=y
532# CONFIG_EXT3_FS_POSIX_ACL is not set
533CONFIG_EXT3_FS_SECURITY=y
534# CONFIG_EXT4_FS is not set
535CONFIG_JBD=y
536# CONFIG_JBD_DEBUG is not set
537CONFIG_FS_MBCACHE=y
538# CONFIG_REISERFS_FS is not set
539# CONFIG_JFS_FS is not set
540# CONFIG_FS_POSIX_ACL is not set
541# CONFIG_XFS_FS is not set
542# CONFIG_GFS2_FS is not set
543# CONFIG_BTRFS_FS is not set
544# CONFIG_NILFS2_FS is not set
545CONFIG_FILE_LOCKING=y
546CONFIG_FSNOTIFY=y
547CONFIG_DNOTIFY=y
548# CONFIG_INOTIFY is not set
549CONFIG_INOTIFY_USER=y
550# CONFIG_QUOTA is not set
551# CONFIG_AUTOFS_FS is not set
552CONFIG_AUTOFS4_FS=m
553# CONFIG_FUSE_FS is not set
554
555#
556# Caches
557#
558# CONFIG_FSCACHE is not set
559
560#
561# CD-ROM/DVD Filesystems
562#
563# CONFIG_ISO9660_FS is not set
564# CONFIG_UDF_FS is not set
565
566#
567# DOS/FAT/NT Filesystems
568#
569CONFIG_FAT_FS=m
570CONFIG_MSDOS_FS=m
571CONFIG_VFAT_FS=m
572CONFIG_FAT_DEFAULT_CODEPAGE=437
573CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
574# CONFIG_NTFS_FS is not set
575
576#
577# Pseudo filesystems
578#
579CONFIG_PROC_FS=y
580CONFIG_PROC_SYSCTL=y
581CONFIG_PROC_PAGE_MONITOR=y
582CONFIG_SYSFS=y
583CONFIG_TMPFS=y
584# CONFIG_TMPFS_POSIX_ACL is not set
585# CONFIG_HUGETLB_PAGE is not set
586# CONFIG_CONFIGFS_FS is not set
587CONFIG_MISC_FILESYSTEMS=y
588# CONFIG_ADFS_FS is not set
589# CONFIG_AFFS_FS is not set
590# CONFIG_HFS_FS is not set
591# CONFIG_HFSPLUS_FS is not set
592# CONFIG_BEFS_FS is not set
593# CONFIG_BFS_FS is not set
594# CONFIG_EFS_FS is not set
595# CONFIG_SQUASHFS is not set
596# CONFIG_VXFS_FS is not set
597# CONFIG_MINIX_FS is not set
598# CONFIG_OMFS_FS is not set
599# CONFIG_HPFS_FS is not set
600# CONFIG_QNX4FS_FS is not set
601# CONFIG_ROMFS_FS is not set
602# CONFIG_SYSV_FS is not set
603# CONFIG_UFS_FS is not set
604
605#
606# Partition Types
607#
608CONFIG_PARTITION_ADVANCED=y
609# CONFIG_ACORN_PARTITION is not set
610# CONFIG_OSF_PARTITION is not set
611# CONFIG_AMIGA_PARTITION is not set
612# CONFIG_ATARI_PARTITION is not set
613# CONFIG_MAC_PARTITION is not set
614CONFIG_MSDOS_PARTITION=y
615# CONFIG_BSD_DISKLABEL is not set
616# CONFIG_MINIX_SUBPARTITION is not set
617# CONFIG_SOLARIS_X86_PARTITION is not set
618# CONFIG_UNIXWARE_DISKLABEL is not set
619# CONFIG_LDM_PARTITION is not set
620# CONFIG_SGI_PARTITION is not set
621# CONFIG_ULTRIX_PARTITION is not set
622# CONFIG_SUN_PARTITION is not set
623# CONFIG_KARMA_PARTITION is not set
624# CONFIG_EFI_PARTITION is not set
625# CONFIG_SYSV68_PARTITION is not set
626CONFIG_NLS=y
627CONFIG_NLS_DEFAULT="utf8"
628CONFIG_NLS_CODEPAGE_437=y
629# CONFIG_NLS_CODEPAGE_737 is not set
630# CONFIG_NLS_CODEPAGE_775 is not set
631# CONFIG_NLS_CODEPAGE_850 is not set
632# CONFIG_NLS_CODEPAGE_852 is not set
633# CONFIG_NLS_CODEPAGE_855 is not set
634# CONFIG_NLS_CODEPAGE_857 is not set
635# CONFIG_NLS_CODEPAGE_860 is not set
636# CONFIG_NLS_CODEPAGE_861 is not set
637# CONFIG_NLS_CODEPAGE_862 is not set
638# CONFIG_NLS_CODEPAGE_863 is not set
639# CONFIG_NLS_CODEPAGE_864 is not set
640# CONFIG_NLS_CODEPAGE_865 is not set
641# CONFIG_NLS_CODEPAGE_866 is not set
642# CONFIG_NLS_CODEPAGE_869 is not set
643# CONFIG_NLS_CODEPAGE_936 is not set
644# CONFIG_NLS_CODEPAGE_950 is not set
645# CONFIG_NLS_CODEPAGE_932 is not set
646# CONFIG_NLS_CODEPAGE_949 is not set
647# CONFIG_NLS_CODEPAGE_874 is not set
648# CONFIG_NLS_ISO8859_8 is not set
649# CONFIG_NLS_CODEPAGE_1250 is not set
650# CONFIG_NLS_CODEPAGE_1251 is not set
651CONFIG_NLS_ASCII=m
652# CONFIG_NLS_ISO8859_1 is not set
653# CONFIG_NLS_ISO8859_2 is not set
654# CONFIG_NLS_ISO8859_3 is not set
655# CONFIG_NLS_ISO8859_4 is not set
656# CONFIG_NLS_ISO8859_5 is not set
657# CONFIG_NLS_ISO8859_6 is not set
658# CONFIG_NLS_ISO8859_7 is not set
659# CONFIG_NLS_ISO8859_9 is not set
660# CONFIG_NLS_ISO8859_13 is not set
661# CONFIG_NLS_ISO8859_14 is not set
662# CONFIG_NLS_ISO8859_15 is not set
663# CONFIG_NLS_KOI8_R is not set
664# CONFIG_NLS_KOI8_U is not set
665# CONFIG_NLS_UTF8 is not set
666
667#
668# Kernel hacking
669#
670# CONFIG_PRINTK_TIME is not set
671CONFIG_ENABLE_WARN_DEPRECATED=y
672CONFIG_ENABLE_MUST_CHECK=y
673CONFIG_FRAME_WARN=1024
674CONFIG_MAGIC_SYSRQ=y
675# CONFIG_STRIP_ASM_SYMS is not set
676# CONFIG_UNUSED_SYMBOLS is not set
677CONFIG_DEBUG_FS=y
678# CONFIG_HEADERS_CHECK is not set
679CONFIG_DEBUG_KERNEL=y
680# CONFIG_DEBUG_SHIRQ is not set
681CONFIG_DETECT_SOFTLOCKUP=y
682# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
683CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
684CONFIG_DETECT_HUNG_TASK=y
685# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
686CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
687CONFIG_SCHED_DEBUG=y
688# CONFIG_SCHEDSTATS is not set
689# CONFIG_TIMER_STATS is not set
690# CONFIG_DEBUG_OBJECTS is not set
691# CONFIG_SLUB_DEBUG_ON is not set
692# CONFIG_SLUB_STATS is not set
693# CONFIG_DEBUG_KMEMLEAK is not set
694# CONFIG_DEBUG_RT_MUTEXES is not set
695# CONFIG_RT_MUTEX_TESTER is not set
696CONFIG_DEBUG_SPINLOCK=y
697# CONFIG_DEBUG_MUTEXES is not set
698# CONFIG_DEBUG_LOCK_ALLOC is not set
699# CONFIG_PROVE_LOCKING is not set
700# CONFIG_LOCK_STAT is not set
701CONFIG_DEBUG_SPINLOCK_SLEEP=y
702# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
703# CONFIG_DEBUG_KOBJECT is not set
704CONFIG_DEBUG_BUGVERBOSE=y
705CONFIG_DEBUG_INFO=y
706# CONFIG_DEBUG_VM is not set
707# CONFIG_DEBUG_WRITECOUNT is not set
708CONFIG_DEBUG_MEMORY_INIT=y
709# CONFIG_DEBUG_LIST is not set
710# CONFIG_DEBUG_SG is not set
711# CONFIG_DEBUG_NOTIFIERS is not set
712# CONFIG_DEBUG_CREDENTIALS is not set
713CONFIG_FRAME_POINTER=y
714# CONFIG_BOOT_PRINTK_DELAY is not set
715# CONFIG_RCU_TORTURE_TEST is not set
716CONFIG_RCU_CPU_STALL_DETECTOR=y
717# CONFIG_BACKTRACE_SELF_TEST is not set
718# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
719# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
720# CONFIG_FAULT_INJECTION is not set
721# CONFIG_LATENCYTOP is not set
722# CONFIG_SYSCTL_SYSCALL_CHECK is not set
723# CONFIG_PAGE_POISONING is not set
724CONFIG_HAVE_FUNCTION_TRACER=y
725CONFIG_TRACING_SUPPORT=y
726CONFIG_FTRACE=y
727# CONFIG_FUNCTION_TRACER is not set
728# CONFIG_IRQSOFF_TRACER is not set
729# CONFIG_SCHED_TRACER is not set
730# CONFIG_ENABLE_DEFAULT_TRACERS is not set
731# CONFIG_BOOT_TRACER is not set
732CONFIG_BRANCH_PROFILE_NONE=y
733# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
734# CONFIG_PROFILE_ALL_BRANCHES is not set
735# CONFIG_STACK_TRACER is not set
736# CONFIG_KMEMTRACE is not set
737# CONFIG_WORKQUEUE_TRACER is not set
738# CONFIG_BLK_DEV_IO_TRACE is not set
739# CONFIG_DYNAMIC_DEBUG is not set
740# CONFIG_SAMPLES is not set
741CONFIG_HAVE_ARCH_KGDB=y
742# CONFIG_KGDB is not set
743# CONFIG_DEBUG_USER is not set
744# CONFIG_DEBUG_ERRORS is not set
745# CONFIG_DEBUG_STACK_USAGE is not set
746# CONFIG_DEBUG_LL is not set
747
748#
749# Security options
750#
751# CONFIG_KEYS is not set
752# CONFIG_SECURITY is not set
753# CONFIG_SECURITYFS is not set
754# CONFIG_SECURITY_FILE_CAPABILITIES is not set
755# CONFIG_CRYPTO is not set
756# CONFIG_BINARY_PRINTF is not set
757
758#
759# Library routines
760#
761CONFIG_GENERIC_FIND_LAST_BIT=y
762# CONFIG_CRC_CCITT is not set
763# CONFIG_CRC16 is not set
764# CONFIG_CRC_T10DIF is not set
765# CONFIG_CRC_ITU_T is not set
766# CONFIG_CRC32 is not set
767# CONFIG_CRC7 is not set
768# CONFIG_LIBCRC32C is not set
769CONFIG_ZLIB_INFLATE=y
770CONFIG_DECOMPRESS_GZIP=y
771CONFIG_DECOMPRESS_BZIP2=y
772CONFIG_DECOMPRESS_LZMA=y
773CONFIG_HAS_IOMEM=y
774CONFIG_HAS_IOPORT=y
775CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/spear320_defconfig b/arch/arm/configs/spear320_defconfig
new file mode 100644
index 000000000000..2ae3c110a21a
--- /dev/null
+++ b/arch/arm/configs/spear320_defconfig
@@ -0,0 +1,775 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32
4# Tue Mar 23 14:37:12 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36CONFIG_SYSVIPC_SYSCTL=y
37CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39
40#
41# RCU Subsystem
42#
43CONFIG_TREE_RCU=y
44# CONFIG_TREE_PREEMPT_RCU is not set
45# CONFIG_RCU_TRACE is not set
46CONFIG_RCU_FANOUT=32
47# CONFIG_RCU_FANOUT_EXACT is not set
48# CONFIG_TREE_RCU_TRACE is not set
49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=17
51# CONFIG_GROUP_SCHED is not set
52# CONFIG_CGROUPS is not set
53# CONFIG_SYSFS_DEPRECATED_V2 is not set
54# CONFIG_RELAY is not set
55CONFIG_NAMESPACES=y
56# CONFIG_UTS_NS is not set
57# CONFIG_IPC_NS is not set
58# CONFIG_USER_NS is not set
59# CONFIG_PID_NS is not set
60CONFIG_BLK_DEV_INITRD=y
61CONFIG_INITRAMFS_SOURCE=""
62CONFIG_RD_GZIP=y
63CONFIG_RD_BZIP2=y
64CONFIG_RD_LZMA=y
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73CONFIG_KALLSYMS_EXTRA_PASS=y
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLUB_DEBUG=y
92CONFIG_COMPAT_BRK=y
93# CONFIG_SLAB is not set
94CONFIG_SLUB=y
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_CLK=y
102
103#
104# GCOV-based kernel profiling
105#
106# CONFIG_GCOV_KERNEL is not set
107# CONFIG_SLOW_WORK is not set
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115# CONFIG_MODULE_FORCE_UNLOAD is not set
116CONFIG_MODVERSIONS=y
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119CONFIG_LBDAF=y
120CONFIG_BLK_DEV_BSG=y
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_AS=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130# CONFIG_DEFAULT_AS is not set
131# CONFIG_DEFAULT_DEADLINE is not set
132CONFIG_DEFAULT_CFQ=y
133# CONFIG_DEFAULT_NOOP is not set
134CONFIG_DEFAULT_IOSCHED="cfq"
135# CONFIG_FREEZER is not set
136
137#
138# System Type
139#
140CONFIG_MMU=y
141# CONFIG_ARCH_AAEC2000 is not set
142# CONFIG_ARCH_INTEGRATOR is not set
143# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_MXC is not set
152# CONFIG_ARCH_STMP3XXX is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_NOMADIK is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_LOKI is not set
165# CONFIG_ARCH_MV78XX0 is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
171# CONFIG_ARCH_PNX4008 is not set
172# CONFIG_ARCH_PXA is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_RPC is not set
175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_S5PC1XX is not set
179# CONFIG_ARCH_SHARK is not set
180# CONFIG_ARCH_LH7A40X is not set
181# CONFIG_ARCH_U300 is not set
182# CONFIG_ARCH_DAVINCI is not set
183# CONFIG_ARCH_OMAP is not set
184# CONFIG_ARCH_BCMRING is not set
185CONFIG_PLAT_SPEAR=y
186CONFIG_ARCH_SPEAR3XX=y
187# CONFIG_ARCH_SPEAR6XX is not set
188# CONFIG_MACH_SPEAR300 is not set
189# CONFIG_MACH_SPEAR310 is not set
190CONFIG_MACH_SPEAR320=y
191# CONFIG_BOARD_SPEAR300_EVB is not set
192CONFIG_BOARD_SPEAR320_EVB=y
193
194#
195# Processor Type
196#
197CONFIG_CPU_32=y
198CONFIG_CPU_ARM926T=y
199CONFIG_CPU_32v5=y
200CONFIG_CPU_ABRT_EV5TJ=y
201CONFIG_CPU_PABRT_LEGACY=y
202CONFIG_CPU_CACHE_VIVT=y
203CONFIG_CPU_COPY_V4WB=y
204CONFIG_CPU_TLB_V4WBI=y
205CONFIG_CPU_CP15=y
206CONFIG_CPU_CP15_MMU=y
207
208#
209# Processor Features
210#
211CONFIG_ARM_THUMB=y
212# CONFIG_CPU_ICACHE_DISABLE is not set
213# CONFIG_CPU_DCACHE_DISABLE is not set
214# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
215# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
216CONFIG_ARM_L1_CACHE_SHIFT=5
217CONFIG_ARM_VIC=y
218CONFIG_ARM_VIC_NR=2
219CONFIG_COMMON_CLKDEV=y
220
221#
222# Bus support
223#
224CONFIG_ARM_AMBA=y
225# CONFIG_PCI_SYSCALL is not set
226# CONFIG_ARCH_SUPPORTS_MSI is not set
227# CONFIG_PCCARD is not set
228
229#
230# Kernel Features
231#
232# CONFIG_NO_HZ is not set
233# CONFIG_HIGH_RES_TIMERS is not set
234CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
235CONFIG_VMSPLIT_3G=y
236# CONFIG_VMSPLIT_2G is not set
237# CONFIG_VMSPLIT_1G is not set
238CONFIG_PAGE_OFFSET=0xC0000000
239CONFIG_PREEMPT_NONE=y
240# CONFIG_PREEMPT_VOLUNTARY is not set
241# CONFIG_PREEMPT is not set
242CONFIG_HZ=100
243# CONFIG_AEABI is not set
244# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
245# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
246# CONFIG_HIGHMEM is not set
247CONFIG_SELECT_MEMORY_MODEL=y
248CONFIG_FLATMEM_MANUAL=y
249# CONFIG_DISCONTIGMEM_MANUAL is not set
250# CONFIG_SPARSEMEM_MANUAL is not set
251CONFIG_FLATMEM=y
252CONFIG_FLAT_NODE_MEM_MAP=y
253CONFIG_PAGEFLAGS_EXTENDED=y
254CONFIG_SPLIT_PTLOCK_CPUS=4096
255# CONFIG_PHYS_ADDR_T_64BIT is not set
256CONFIG_ZONE_DMA_FLAG=0
257CONFIG_VIRT_TO_BUS=y
258CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y
260# CONFIG_KSM is not set
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_ALIGNMENT_TRAP=y
263# CONFIG_UACCESS_WITH_MEMCPY is not set
264
265#
266# Boot options
267#
268CONFIG_ZBOOT_ROM_TEXT=0
269CONFIG_ZBOOT_ROM_BSS=0
270CONFIG_CMDLINE=""
271# CONFIG_XIP_KERNEL is not set
272# CONFIG_KEXEC is not set
273
274#
275# CPU Power Management
276#
277# CONFIG_CPU_IDLE is not set
278
279#
280# Floating point emulation
281#
282
283#
284# At least one emulation must be selected
285#
286# CONFIG_FPE_NWFPE is not set
287# CONFIG_FPE_FASTFPE is not set
288# CONFIG_VFP is not set
289
290#
291# Userspace binary formats
292#
293CONFIG_BINFMT_ELF=y
294# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
295CONFIG_HAVE_AOUT=y
296# CONFIG_BINFMT_AOUT is not set
297CONFIG_BINFMT_MISC=y
298
299#
300# Power management options
301#
302# CONFIG_PM is not set
303CONFIG_ARCH_SUSPEND_POSSIBLE=y
304# CONFIG_NET is not set
305
306#
307# Device Drivers
308#
309
310#
311# Generic Driver Options
312#
313CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
314# CONFIG_DEVTMPFS is not set
315CONFIG_STANDALONE=y
316CONFIG_PREVENT_FIRMWARE_BUILD=y
317CONFIG_FW_LOADER=y
318CONFIG_FIRMWARE_IN_KERNEL=y
319CONFIG_EXTRA_FIRMWARE=""
320# CONFIG_DEBUG_DRIVER is not set
321# CONFIG_DEBUG_DEVRES is not set
322# CONFIG_SYS_HYPERVISOR is not set
323# CONFIG_MTD is not set
324# CONFIG_PARPORT is not set
325CONFIG_BLK_DEV=y
326# CONFIG_BLK_DEV_COW_COMMON is not set
327# CONFIG_BLK_DEV_LOOP is not set
328CONFIG_BLK_DEV_RAM=y
329CONFIG_BLK_DEV_RAM_COUNT=16
330CONFIG_BLK_DEV_RAM_SIZE=16384
331# CONFIG_BLK_DEV_XIP is not set
332# CONFIG_CDROM_PKTCDVD is not set
333# CONFIG_MG_DISK is not set
334CONFIG_MISC_DEVICES=y
335# CONFIG_ENCLOSURE_SERVICES is not set
336# CONFIG_C2PORT is not set
337
338#
339# EEPROM support
340#
341# CONFIG_EEPROM_93CX6 is not set
342CONFIG_HAVE_IDE=y
343# CONFIG_IDE is not set
344
345#
346# SCSI device support
347#
348# CONFIG_RAID_ATTRS is not set
349# CONFIG_SCSI is not set
350# CONFIG_SCSI_DMA is not set
351# CONFIG_SCSI_NETLINK is not set
352# CONFIG_ATA is not set
353# CONFIG_MD is not set
354# CONFIG_PHONE is not set
355
356#
357# Input device support
358#
359CONFIG_INPUT=y
360CONFIG_INPUT_FF_MEMLESS=y
361# CONFIG_INPUT_POLLDEV is not set
362
363#
364# Userland interfaces
365#
366CONFIG_INPUT_MOUSEDEV=y
367# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
368CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
369CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
370# CONFIG_INPUT_JOYDEV is not set
371# CONFIG_INPUT_EVDEV is not set
372# CONFIG_INPUT_EVBUG is not set
373
374#
375# Input Device Drivers
376#
377# CONFIG_INPUT_KEYBOARD is not set
378# CONFIG_INPUT_MOUSE is not set
379# CONFIG_INPUT_JOYSTICK is not set
380# CONFIG_INPUT_TABLET is not set
381# CONFIG_INPUT_TOUCHSCREEN is not set
382# CONFIG_INPUT_MISC is not set
383
384#
385# Hardware I/O ports
386#
387CONFIG_SERIO=y
388CONFIG_SERIO_SERPORT=y
389# CONFIG_SERIO_AMBAKMI is not set
390# CONFIG_SERIO_RAW is not set
391# CONFIG_GAMEPORT is not set
392
393#
394# Character devices
395#
396CONFIG_VT=y
397CONFIG_CONSOLE_TRANSLATIONS=y
398CONFIG_VT_CONSOLE=y
399CONFIG_HW_CONSOLE=y
400# CONFIG_VT_HW_CONSOLE_BINDING is not set
401CONFIG_DEVKMEM=y
402# CONFIG_SERIAL_NONSTANDARD is not set
403
404#
405# Serial drivers
406#
407# CONFIG_SERIAL_8250 is not set
408
409#
410# Non-8250 serial port support
411#
412# CONFIG_SERIAL_AMBA_PL010 is not set
413CONFIG_SERIAL_AMBA_PL011=y
414CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
415CONFIG_SERIAL_CORE=y
416CONFIG_SERIAL_CORE_CONSOLE=y
417CONFIG_UNIX98_PTYS=y
418# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
419# CONFIG_LEGACY_PTYS is not set
420# CONFIG_IPMI_HANDLER is not set
421# CONFIG_HW_RANDOM is not set
422# CONFIG_R3964 is not set
423CONFIG_RAW_DRIVER=y
424CONFIG_MAX_RAW_DEVS=8192
425# CONFIG_TCG_TPM is not set
426# CONFIG_I2C is not set
427# CONFIG_SPI is not set
428
429#
430# PPS support
431#
432# CONFIG_PPS is not set
433CONFIG_ARCH_REQUIRE_GPIOLIB=y
434CONFIG_GPIOLIB=y
435# CONFIG_DEBUG_GPIO is not set
436CONFIG_GPIO_SYSFS=y
437
438#
439# Memory mapped GPIO expanders:
440#
441CONFIG_GPIO_PL061=y
442
443#
444# I2C GPIO expanders:
445#
446
447#
448# PCI GPIO expanders:
449#
450
451#
452# SPI GPIO expanders:
453#
454
455#
456# AC97 GPIO expanders:
457#
458# CONFIG_W1 is not set
459# CONFIG_POWER_SUPPLY is not set
460# CONFIG_HWMON is not set
461# CONFIG_THERMAL is not set
462# CONFIG_WATCHDOG is not set
463CONFIG_SSB_POSSIBLE=y
464
465#
466# Sonics Silicon Backplane
467#
468# CONFIG_SSB is not set
469
470#
471# Multifunction device drivers
472#
473# CONFIG_MFD_CORE is not set
474# CONFIG_MFD_SM501 is not set
475# CONFIG_MFD_ASIC3 is not set
476# CONFIG_HTC_EGPIO is not set
477# CONFIG_HTC_PASIC3 is not set
478# CONFIG_MFD_TMIO is not set
479# CONFIG_MFD_T7L66XB is not set
480# CONFIG_MFD_TC6387XB is not set
481# CONFIG_MFD_TC6393XB is not set
482# CONFIG_REGULATOR is not set
483# CONFIG_MEDIA_SUPPORT is not set
484
485#
486# Graphics support
487#
488# CONFIG_VGASTATE is not set
489# CONFIG_VIDEO_OUTPUT_CONTROL is not set
490# CONFIG_FB is not set
491# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
492
493#
494# Display device support
495#
496# CONFIG_DISPLAY_SUPPORT is not set
497
498#
499# Console display driver support
500#
501# CONFIG_VGA_CONSOLE is not set
502CONFIG_DUMMY_CONSOLE=y
503# CONFIG_SOUND is not set
504# CONFIG_HID_SUPPORT is not set
505# CONFIG_USB_SUPPORT is not set
506# CONFIG_MMC is not set
507# CONFIG_MEMSTICK is not set
508# CONFIG_NEW_LEDS is not set
509# CONFIG_ACCESSIBILITY is not set
510CONFIG_RTC_LIB=y
511# CONFIG_RTC_CLASS is not set
512# CONFIG_DMADEVICES is not set
513# CONFIG_AUXDISPLAY is not set
514# CONFIG_UIO is not set
515
516#
517# TI VLYNQ
518#
519# CONFIG_STAGING is not set
520
521#
522# File systems
523#
524CONFIG_EXT2_FS=y
525CONFIG_EXT2_FS_XATTR=y
526# CONFIG_EXT2_FS_POSIX_ACL is not set
527CONFIG_EXT2_FS_SECURITY=y
528# CONFIG_EXT2_FS_XIP is not set
529CONFIG_EXT3_FS=y
530# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
531CONFIG_EXT3_FS_XATTR=y
532# CONFIG_EXT3_FS_POSIX_ACL is not set
533CONFIG_EXT3_FS_SECURITY=y
534# CONFIG_EXT4_FS is not set
535CONFIG_JBD=y
536# CONFIG_JBD_DEBUG is not set
537CONFIG_FS_MBCACHE=y
538# CONFIG_REISERFS_FS is not set
539# CONFIG_JFS_FS is not set
540# CONFIG_FS_POSIX_ACL is not set
541# CONFIG_XFS_FS is not set
542# CONFIG_GFS2_FS is not set
543# CONFIG_BTRFS_FS is not set
544# CONFIG_NILFS2_FS is not set
545CONFIG_FILE_LOCKING=y
546CONFIG_FSNOTIFY=y
547CONFIG_DNOTIFY=y
548# CONFIG_INOTIFY is not set
549CONFIG_INOTIFY_USER=y
550# CONFIG_QUOTA is not set
551# CONFIG_AUTOFS_FS is not set
552CONFIG_AUTOFS4_FS=m
553# CONFIG_FUSE_FS is not set
554
555#
556# Caches
557#
558# CONFIG_FSCACHE is not set
559
560#
561# CD-ROM/DVD Filesystems
562#
563# CONFIG_ISO9660_FS is not set
564# CONFIG_UDF_FS is not set
565
566#
567# DOS/FAT/NT Filesystems
568#
569CONFIG_FAT_FS=m
570CONFIG_MSDOS_FS=m
571CONFIG_VFAT_FS=m
572CONFIG_FAT_DEFAULT_CODEPAGE=437
573CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
574# CONFIG_NTFS_FS is not set
575
576#
577# Pseudo filesystems
578#
579CONFIG_PROC_FS=y
580CONFIG_PROC_SYSCTL=y
581CONFIG_PROC_PAGE_MONITOR=y
582CONFIG_SYSFS=y
583CONFIG_TMPFS=y
584# CONFIG_TMPFS_POSIX_ACL is not set
585# CONFIG_HUGETLB_PAGE is not set
586# CONFIG_CONFIGFS_FS is not set
587CONFIG_MISC_FILESYSTEMS=y
588# CONFIG_ADFS_FS is not set
589# CONFIG_AFFS_FS is not set
590# CONFIG_HFS_FS is not set
591# CONFIG_HFSPLUS_FS is not set
592# CONFIG_BEFS_FS is not set
593# CONFIG_BFS_FS is not set
594# CONFIG_EFS_FS is not set
595# CONFIG_SQUASHFS is not set
596# CONFIG_VXFS_FS is not set
597# CONFIG_MINIX_FS is not set
598# CONFIG_OMFS_FS is not set
599# CONFIG_HPFS_FS is not set
600# CONFIG_QNX4FS_FS is not set
601# CONFIG_ROMFS_FS is not set
602# CONFIG_SYSV_FS is not set
603# CONFIG_UFS_FS is not set
604
605#
606# Partition Types
607#
608CONFIG_PARTITION_ADVANCED=y
609# CONFIG_ACORN_PARTITION is not set
610# CONFIG_OSF_PARTITION is not set
611# CONFIG_AMIGA_PARTITION is not set
612# CONFIG_ATARI_PARTITION is not set
613# CONFIG_MAC_PARTITION is not set
614CONFIG_MSDOS_PARTITION=y
615# CONFIG_BSD_DISKLABEL is not set
616# CONFIG_MINIX_SUBPARTITION is not set
617# CONFIG_SOLARIS_X86_PARTITION is not set
618# CONFIG_UNIXWARE_DISKLABEL is not set
619# CONFIG_LDM_PARTITION is not set
620# CONFIG_SGI_PARTITION is not set
621# CONFIG_ULTRIX_PARTITION is not set
622# CONFIG_SUN_PARTITION is not set
623# CONFIG_KARMA_PARTITION is not set
624# CONFIG_EFI_PARTITION is not set
625# CONFIG_SYSV68_PARTITION is not set
626CONFIG_NLS=y
627CONFIG_NLS_DEFAULT="utf8"
628CONFIG_NLS_CODEPAGE_437=y
629# CONFIG_NLS_CODEPAGE_737 is not set
630# CONFIG_NLS_CODEPAGE_775 is not set
631# CONFIG_NLS_CODEPAGE_850 is not set
632# CONFIG_NLS_CODEPAGE_852 is not set
633# CONFIG_NLS_CODEPAGE_855 is not set
634# CONFIG_NLS_CODEPAGE_857 is not set
635# CONFIG_NLS_CODEPAGE_860 is not set
636# CONFIG_NLS_CODEPAGE_861 is not set
637# CONFIG_NLS_CODEPAGE_862 is not set
638# CONFIG_NLS_CODEPAGE_863 is not set
639# CONFIG_NLS_CODEPAGE_864 is not set
640# CONFIG_NLS_CODEPAGE_865 is not set
641# CONFIG_NLS_CODEPAGE_866 is not set
642# CONFIG_NLS_CODEPAGE_869 is not set
643# CONFIG_NLS_CODEPAGE_936 is not set
644# CONFIG_NLS_CODEPAGE_950 is not set
645# CONFIG_NLS_CODEPAGE_932 is not set
646# CONFIG_NLS_CODEPAGE_949 is not set
647# CONFIG_NLS_CODEPAGE_874 is not set
648# CONFIG_NLS_ISO8859_8 is not set
649# CONFIG_NLS_CODEPAGE_1250 is not set
650# CONFIG_NLS_CODEPAGE_1251 is not set
651CONFIG_NLS_ASCII=m
652# CONFIG_NLS_ISO8859_1 is not set
653# CONFIG_NLS_ISO8859_2 is not set
654# CONFIG_NLS_ISO8859_3 is not set
655# CONFIG_NLS_ISO8859_4 is not set
656# CONFIG_NLS_ISO8859_5 is not set
657# CONFIG_NLS_ISO8859_6 is not set
658# CONFIG_NLS_ISO8859_7 is not set
659# CONFIG_NLS_ISO8859_9 is not set
660# CONFIG_NLS_ISO8859_13 is not set
661# CONFIG_NLS_ISO8859_14 is not set
662# CONFIG_NLS_ISO8859_15 is not set
663# CONFIG_NLS_KOI8_R is not set
664# CONFIG_NLS_KOI8_U is not set
665# CONFIG_NLS_UTF8 is not set
666
667#
668# Kernel hacking
669#
670# CONFIG_PRINTK_TIME is not set
671CONFIG_ENABLE_WARN_DEPRECATED=y
672CONFIG_ENABLE_MUST_CHECK=y
673CONFIG_FRAME_WARN=1024
674CONFIG_MAGIC_SYSRQ=y
675# CONFIG_STRIP_ASM_SYMS is not set
676# CONFIG_UNUSED_SYMBOLS is not set
677CONFIG_DEBUG_FS=y
678# CONFIG_HEADERS_CHECK is not set
679CONFIG_DEBUG_KERNEL=y
680# CONFIG_DEBUG_SHIRQ is not set
681CONFIG_DETECT_SOFTLOCKUP=y
682# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
683CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
684CONFIG_DETECT_HUNG_TASK=y
685# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
686CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
687CONFIG_SCHED_DEBUG=y
688# CONFIG_SCHEDSTATS is not set
689# CONFIG_TIMER_STATS is not set
690# CONFIG_DEBUG_OBJECTS is not set
691# CONFIG_SLUB_DEBUG_ON is not set
692# CONFIG_SLUB_STATS is not set
693# CONFIG_DEBUG_KMEMLEAK is not set
694# CONFIG_DEBUG_RT_MUTEXES is not set
695# CONFIG_RT_MUTEX_TESTER is not set
696CONFIG_DEBUG_SPINLOCK=y
697# CONFIG_DEBUG_MUTEXES is not set
698# CONFIG_DEBUG_LOCK_ALLOC is not set
699# CONFIG_PROVE_LOCKING is not set
700# CONFIG_LOCK_STAT is not set
701CONFIG_DEBUG_SPINLOCK_SLEEP=y
702# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
703# CONFIG_DEBUG_KOBJECT is not set
704CONFIG_DEBUG_BUGVERBOSE=y
705CONFIG_DEBUG_INFO=y
706# CONFIG_DEBUG_VM is not set
707# CONFIG_DEBUG_WRITECOUNT is not set
708CONFIG_DEBUG_MEMORY_INIT=y
709# CONFIG_DEBUG_LIST is not set
710# CONFIG_DEBUG_SG is not set
711# CONFIG_DEBUG_NOTIFIERS is not set
712# CONFIG_DEBUG_CREDENTIALS is not set
713CONFIG_FRAME_POINTER=y
714# CONFIG_BOOT_PRINTK_DELAY is not set
715# CONFIG_RCU_TORTURE_TEST is not set
716CONFIG_RCU_CPU_STALL_DETECTOR=y
717# CONFIG_BACKTRACE_SELF_TEST is not set
718# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
719# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
720# CONFIG_FAULT_INJECTION is not set
721# CONFIG_LATENCYTOP is not set
722# CONFIG_SYSCTL_SYSCALL_CHECK is not set
723# CONFIG_PAGE_POISONING is not set
724CONFIG_HAVE_FUNCTION_TRACER=y
725CONFIG_TRACING_SUPPORT=y
726CONFIG_FTRACE=y
727# CONFIG_FUNCTION_TRACER is not set
728# CONFIG_IRQSOFF_TRACER is not set
729# CONFIG_SCHED_TRACER is not set
730# CONFIG_ENABLE_DEFAULT_TRACERS is not set
731# CONFIG_BOOT_TRACER is not set
732CONFIG_BRANCH_PROFILE_NONE=y
733# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
734# CONFIG_PROFILE_ALL_BRANCHES is not set
735# CONFIG_STACK_TRACER is not set
736# CONFIG_KMEMTRACE is not set
737# CONFIG_WORKQUEUE_TRACER is not set
738# CONFIG_BLK_DEV_IO_TRACE is not set
739# CONFIG_DYNAMIC_DEBUG is not set
740# CONFIG_SAMPLES is not set
741CONFIG_HAVE_ARCH_KGDB=y
742# CONFIG_KGDB is not set
743# CONFIG_DEBUG_USER is not set
744# CONFIG_DEBUG_ERRORS is not set
745# CONFIG_DEBUG_STACK_USAGE is not set
746# CONFIG_DEBUG_LL is not set
747
748#
749# Security options
750#
751# CONFIG_KEYS is not set
752# CONFIG_SECURITY is not set
753# CONFIG_SECURITYFS is not set
754# CONFIG_SECURITY_FILE_CAPABILITIES is not set
755# CONFIG_CRYPTO is not set
756# CONFIG_BINARY_PRINTF is not set
757
758#
759# Library routines
760#
761CONFIG_GENERIC_FIND_LAST_BIT=y
762# CONFIG_CRC_CCITT is not set
763# CONFIG_CRC16 is not set
764# CONFIG_CRC_T10DIF is not set
765# CONFIG_CRC_ITU_T is not set
766# CONFIG_CRC32 is not set
767# CONFIG_CRC7 is not set
768# CONFIG_LIBCRC32C is not set
769CONFIG_ZLIB_INFLATE=y
770CONFIG_DECOMPRESS_GZIP=y
771CONFIG_DECOMPRESS_BZIP2=y
772CONFIG_DECOMPRESS_LZMA=y
773CONFIG_HAS_IOMEM=y
774CONFIG_HAS_IOPORT=y
775CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/spear600_defconfig b/arch/arm/configs/spear600_defconfig
new file mode 100644
index 000000000000..c85a02924ec5
--- /dev/null
+++ b/arch/arm/configs/spear600_defconfig
@@ -0,0 +1,760 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32
4# Tue Mar 23 14:37:26 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_INIT_ENV_ARG_LIMIT=32
32CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SWAP=y
35CONFIG_SYSVIPC=y
36CONFIG_SYSVIPC_SYSCTL=y
37CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39
40#
41# RCU Subsystem
42#
43CONFIG_TREE_RCU=y
44# CONFIG_TREE_PREEMPT_RCU is not set
45# CONFIG_RCU_TRACE is not set
46CONFIG_RCU_FANOUT=32
47# CONFIG_RCU_FANOUT_EXACT is not set
48# CONFIG_TREE_RCU_TRACE is not set
49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=17
51# CONFIG_GROUP_SCHED is not set
52# CONFIG_CGROUPS is not set
53# CONFIG_SYSFS_DEPRECATED_V2 is not set
54# CONFIG_RELAY is not set
55CONFIG_NAMESPACES=y
56# CONFIG_UTS_NS is not set
57# CONFIG_IPC_NS is not set
58# CONFIG_USER_NS is not set
59# CONFIG_PID_NS is not set
60CONFIG_BLK_DEV_INITRD=y
61CONFIG_INITRAMFS_SOURCE=""
62CONFIG_RD_GZIP=y
63CONFIG_RD_BZIP2=y
64CONFIG_RD_LZMA=y
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73CONFIG_KALLSYMS_EXTRA_PASS=y
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLUB_DEBUG=y
92CONFIG_COMPAT_BRK=y
93# CONFIG_SLAB is not set
94CONFIG_SLUB=y
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_CLK=y
102
103#
104# GCOV-based kernel profiling
105#
106# CONFIG_GCOV_KERNEL is not set
107# CONFIG_SLOW_WORK is not set
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115# CONFIG_MODULE_FORCE_UNLOAD is not set
116CONFIG_MODVERSIONS=y
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119CONFIG_LBDAF=y
120CONFIG_BLK_DEV_BSG=y
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_AS=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130# CONFIG_DEFAULT_AS is not set
131# CONFIG_DEFAULT_DEADLINE is not set
132CONFIG_DEFAULT_CFQ=y
133# CONFIG_DEFAULT_NOOP is not set
134CONFIG_DEFAULT_IOSCHED="cfq"
135# CONFIG_FREEZER is not set
136
137#
138# System Type
139#
140CONFIG_MMU=y
141# CONFIG_ARCH_AAEC2000 is not set
142# CONFIG_ARCH_INTEGRATOR is not set
143# CONFIG_ARCH_REALVIEW is not set
144# CONFIG_ARCH_VERSATILE is not set
145# CONFIG_ARCH_AT91 is not set
146# CONFIG_ARCH_CLPS711X is not set
147# CONFIG_ARCH_GEMINI is not set
148# CONFIG_ARCH_EBSA110 is not set
149# CONFIG_ARCH_EP93XX is not set
150# CONFIG_ARCH_FOOTBRIDGE is not set
151# CONFIG_ARCH_MXC is not set
152# CONFIG_ARCH_STMP3XXX is not set
153# CONFIG_ARCH_NETX is not set
154# CONFIG_ARCH_H720X is not set
155# CONFIG_ARCH_NOMADIK is not set
156# CONFIG_ARCH_IOP13XX is not set
157# CONFIG_ARCH_IOP32X is not set
158# CONFIG_ARCH_IOP33X is not set
159# CONFIG_ARCH_IXP23XX is not set
160# CONFIG_ARCH_IXP2000 is not set
161# CONFIG_ARCH_IXP4XX is not set
162# CONFIG_ARCH_L7200 is not set
163# CONFIG_ARCH_KIRKWOOD is not set
164# CONFIG_ARCH_LOKI is not set
165# CONFIG_ARCH_MV78XX0 is not set
166# CONFIG_ARCH_ORION5X is not set
167# CONFIG_ARCH_MMP is not set
168# CONFIG_ARCH_KS8695 is not set
169# CONFIG_ARCH_NS9XXX is not set
170# CONFIG_ARCH_W90X900 is not set
171# CONFIG_ARCH_PNX4008 is not set
172# CONFIG_ARCH_PXA is not set
173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_RPC is not set
175# CONFIG_ARCH_SA1100 is not set
176# CONFIG_ARCH_S3C2410 is not set
177# CONFIG_ARCH_S3C64XX is not set
178# CONFIG_ARCH_S5PC1XX is not set
179# CONFIG_ARCH_SHARK is not set
180# CONFIG_ARCH_LH7A40X is not set
181# CONFIG_ARCH_U300 is not set
182# CONFIG_ARCH_DAVINCI is not set
183# CONFIG_ARCH_OMAP is not set
184# CONFIG_ARCH_BCMRING is not set
185CONFIG_PLAT_SPEAR=y
186# CONFIG_ARCH_SPEAR3XX is not set
187CONFIG_ARCH_SPEAR6XX=y
188# CONFIG_MACH_SPEAR300 is not set
189# CONFIG_MACH_SPEAR310 is not set
190# CONFIG_MACH_SPEAR320 is not set
191# CONFIG_BOARD_SPEAR300_EVB is not set
192CONFIG_MACH_SPEAR600=y
193CONFIG_BOARD_SPEAR600_EVB=y
194
195#
196# Processor Type
197#
198CONFIG_CPU_32=y
199CONFIG_CPU_ARM926T=y
200CONFIG_CPU_32v5=y
201CONFIG_CPU_ABRT_EV5TJ=y
202CONFIG_CPU_PABRT_LEGACY=y
203CONFIG_CPU_CACHE_VIVT=y
204CONFIG_CPU_COPY_V4WB=y
205CONFIG_CPU_TLB_V4WBI=y
206CONFIG_CPU_CP15=y
207CONFIG_CPU_CP15_MMU=y
208
209#
210# Processor Features
211#
212CONFIG_ARM_THUMB=y
213# CONFIG_CPU_ICACHE_DISABLE is not set
214# CONFIG_CPU_DCACHE_DISABLE is not set
215# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
216# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
217CONFIG_ARM_L1_CACHE_SHIFT=5
218CONFIG_ARM_VIC=y
219CONFIG_ARM_VIC_NR=2
220CONFIG_COMMON_CLKDEV=y
221
222#
223# Bus support
224#
225CONFIG_ARM_AMBA=y
226# CONFIG_PCI_SYSCALL is not set
227# CONFIG_ARCH_SUPPORTS_MSI is not set
228# CONFIG_PCCARD is not set
229
230#
231# Kernel Features
232#
233# CONFIG_NO_HZ is not set
234# CONFIG_HIGH_RES_TIMERS is not set
235CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
236CONFIG_VMSPLIT_3G=y
237# CONFIG_VMSPLIT_2G is not set
238# CONFIG_VMSPLIT_1G is not set
239CONFIG_PAGE_OFFSET=0xC0000000
240CONFIG_PREEMPT_NONE=y
241# CONFIG_PREEMPT_VOLUNTARY is not set
242# CONFIG_PREEMPT is not set
243CONFIG_HZ=100
244# CONFIG_AEABI is not set
245# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
246# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
247# CONFIG_HIGHMEM is not set
248CONFIG_SELECT_MEMORY_MODEL=y
249CONFIG_FLATMEM_MANUAL=y
250# CONFIG_DISCONTIGMEM_MANUAL is not set
251# CONFIG_SPARSEMEM_MANUAL is not set
252CONFIG_FLATMEM=y
253CONFIG_FLAT_NODE_MEM_MAP=y
254CONFIG_PAGEFLAGS_EXTENDED=y
255CONFIG_SPLIT_PTLOCK_CPUS=4096
256# CONFIG_PHYS_ADDR_T_64BIT is not set
257CONFIG_ZONE_DMA_FLAG=0
258CONFIG_VIRT_TO_BUS=y
259CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261# CONFIG_KSM is not set
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_ALIGNMENT_TRAP=y
264# CONFIG_UACCESS_WITH_MEMCPY is not set
265
266#
267# Boot options
268#
269CONFIG_ZBOOT_ROM_TEXT=0
270CONFIG_ZBOOT_ROM_BSS=0
271CONFIG_CMDLINE=""
272# CONFIG_XIP_KERNEL is not set
273# CONFIG_KEXEC is not set
274
275#
276# CPU Power Management
277#
278# CONFIG_CPU_IDLE is not set
279
280#
281# Floating point emulation
282#
283
284#
285# At least one emulation must be selected
286#
287# CONFIG_FPE_NWFPE is not set
288# CONFIG_FPE_FASTFPE is not set
289# CONFIG_VFP is not set
290
291#
292# Userspace binary formats
293#
294CONFIG_BINFMT_ELF=y
295# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
296CONFIG_HAVE_AOUT=y
297# CONFIG_BINFMT_AOUT is not set
298CONFIG_BINFMT_MISC=y
299# CONFIG_ARTHUR is not set
300
301#
302# Power management options
303#
304# CONFIG_PM is not set
305CONFIG_ARCH_SUSPEND_POSSIBLE=y
306# CONFIG_NET is not set
307
308#
309# Device Drivers
310#
311
312#
313# Generic Driver Options
314#
315CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
316# CONFIG_DEVTMPFS is not set
317CONFIG_STANDALONE=y
318CONFIG_PREVENT_FIRMWARE_BUILD=y
319CONFIG_FW_LOADER=y
320CONFIG_FIRMWARE_IN_KERNEL=y
321CONFIG_EXTRA_FIRMWARE=""
322# CONFIG_DEBUG_DRIVER is not set
323# CONFIG_DEBUG_DEVRES is not set
324# CONFIG_SYS_HYPERVISOR is not set
325# CONFIG_MTD is not set
326# CONFIG_PARPORT is not set
327CONFIG_BLK_DEV=y
328# CONFIG_BLK_DEV_COW_COMMON is not set
329# CONFIG_BLK_DEV_LOOP is not set
330CONFIG_BLK_DEV_RAM=y
331CONFIG_BLK_DEV_RAM_COUNT=16
332CONFIG_BLK_DEV_RAM_SIZE=16384
333# CONFIG_BLK_DEV_XIP is not set
334# CONFIG_CDROM_PKTCDVD is not set
335CONFIG_MISC_DEVICES=y
336# CONFIG_ENCLOSURE_SERVICES is not set
337# CONFIG_C2PORT is not set
338
339#
340# EEPROM support
341#
342# CONFIG_EEPROM_93CX6 is not set
343CONFIG_HAVE_IDE=y
344# CONFIG_IDE is not set
345
346#
347# SCSI device support
348#
349# CONFIG_RAID_ATTRS is not set
350# CONFIG_SCSI is not set
351# CONFIG_SCSI_DMA is not set
352# CONFIG_SCSI_NETLINK is not set
353# CONFIG_ATA is not set
354# CONFIG_MD is not set
355# CONFIG_PHONE is not set
356
357#
358# Input device support
359#
360CONFIG_INPUT=y
361CONFIG_INPUT_FF_MEMLESS=y
362# CONFIG_INPUT_POLLDEV is not set
363
364#
365# Userland interfaces
366#
367CONFIG_INPUT_MOUSEDEV=y
368# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
369CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
370CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
371# CONFIG_INPUT_JOYDEV is not set
372# CONFIG_INPUT_EVDEV is not set
373# CONFIG_INPUT_EVBUG is not set
374
375#
376# Hardware I/O ports
377#
378CONFIG_SERIO=y
379CONFIG_SERIO_SERPORT=y
380# CONFIG_SERIO_AMBAKMI is not set
381# CONFIG_SERIO_RAW is not set
382# CONFIG_GAMEPORT is not set
383
384#
385# Character devices
386#
387CONFIG_VT=y
388CONFIG_CONSOLE_TRANSLATIONS=y
389CONFIG_VT_CONSOLE=y
390CONFIG_HW_CONSOLE=y
391# CONFIG_VT_HW_CONSOLE_BINDING is not set
392CONFIG_DEVKMEM=y
393# CONFIG_SERIAL_NONSTANDARD is not set
394
395#
396# Serial drivers
397#
398# CONFIG_SERIAL_8250 is not set
399
400#
401# Non-8250 serial port support
402#
403# CONFIG_SERIAL_AMBA_PL010 is not set
404CONFIG_SERIAL_AMBA_PL011=y
405CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
406CONFIG_SERIAL_CORE=y
407CONFIG_SERIAL_CORE_CONSOLE=y
408CONFIG_UNIX98_PTYS=y
409# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
410# CONFIG_LEGACY_PTYS is not set
411# CONFIG_R3964 is not set
412CONFIG_RAW_DRIVER=y
413CONFIG_MAX_RAW_DEVS=8192
414# CONFIG_TCG_TPM is not set
415# CONFIG_I2C is not set
416# CONFIG_SPI is not set
417
418#
419# PPS support
420#
421# CONFIG_PPS is not set
422CONFIG_ARCH_REQUIRE_GPIOLIB=y
423CONFIG_GPIOLIB=y
424# CONFIG_DEBUG_GPIO is not set
425CONFIG_GPIO_SYSFS=y
426
427#
428# Memory mapped GPIO expanders:
429#
430CONFIG_GPIO_PL061=y
431
432#
433# I2C GPIO expanders:
434#
435
436#
437# PCI GPIO expanders:
438#
439
440#
441# SPI GPIO expanders:
442#
443
444#
445# AC97 GPIO expanders:
446#
447# CONFIG_W1 is not set
448# CONFIG_POWER_SUPPLY is not set
449# CONFIG_HWMON is not set
450# CONFIG_THERMAL is not set
451# CONFIG_WATCHDOG is not set
452CONFIG_SSB_POSSIBLE=y
453
454#
455# Sonics Silicon Backplane
456#
457# CONFIG_SSB is not set
458
459#
460# Multifunction device drivers
461#
462# CONFIG_MFD_CORE is not set
463# CONFIG_MFD_SM501 is not set
464# CONFIG_HTC_PASIC3 is not set
465# CONFIG_MFD_TMIO is not set
466# CONFIG_MFD_T7L66XB is not set
467# CONFIG_MFD_TC6387XB is not set
468# CONFIG_REGULATOR is not set
469# CONFIG_MEDIA_SUPPORT is not set
470
471#
472# Graphics support
473#
474# CONFIG_VGASTATE is not set
475# CONFIG_VIDEO_OUTPUT_CONTROL is not set
476# CONFIG_FB is not set
477# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
478
479#
480# Display device support
481#
482# CONFIG_DISPLAY_SUPPORT is not set
483
484#
485# Console display driver support
486#
487# CONFIG_VGA_CONSOLE is not set
488CONFIG_DUMMY_CONSOLE=y
489# CONFIG_HID_SUPPORT is not set
490# CONFIG_USB_SUPPORT is not set
491# CONFIG_MMC is not set
492# CONFIG_MEMSTICK is not set
493# CONFIG_NEW_LEDS is not set
494# CONFIG_ACCESSIBILITY is not set
495CONFIG_RTC_LIB=y
496# CONFIG_RTC_CLASS is not set
497# CONFIG_DMADEVICES is not set
498# CONFIG_AUXDISPLAY is not set
499# CONFIG_UIO is not set
500
501#
502# TI VLYNQ
503#
504# CONFIG_STAGING is not set
505
506#
507# File systems
508#
509CONFIG_EXT2_FS=y
510CONFIG_EXT2_FS_XATTR=y
511# CONFIG_EXT2_FS_POSIX_ACL is not set
512CONFIG_EXT2_FS_SECURITY=y
513# CONFIG_EXT2_FS_XIP is not set
514CONFIG_EXT3_FS=y
515# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
516CONFIG_EXT3_FS_XATTR=y
517# CONFIG_EXT3_FS_POSIX_ACL is not set
518CONFIG_EXT3_FS_SECURITY=y
519# CONFIG_EXT4_FS is not set
520CONFIG_JBD=y
521# CONFIG_JBD_DEBUG is not set
522CONFIG_FS_MBCACHE=y
523# CONFIG_REISERFS_FS is not set
524# CONFIG_JFS_FS is not set
525# CONFIG_FS_POSIX_ACL is not set
526# CONFIG_XFS_FS is not set
527# CONFIG_GFS2_FS is not set
528# CONFIG_BTRFS_FS is not set
529# CONFIG_NILFS2_FS is not set
530CONFIG_FILE_LOCKING=y
531CONFIG_FSNOTIFY=y
532CONFIG_DNOTIFY=y
533# CONFIG_INOTIFY is not set
534CONFIG_INOTIFY_USER=y
535# CONFIG_QUOTA is not set
536# CONFIG_AUTOFS_FS is not set
537CONFIG_AUTOFS4_FS=m
538# CONFIG_FUSE_FS is not set
539
540#
541# Caches
542#
543# CONFIG_FSCACHE is not set
544
545#
546# CD-ROM/DVD Filesystems
547#
548# CONFIG_ISO9660_FS is not set
549# CONFIG_UDF_FS is not set
550
551#
552# DOS/FAT/NT Filesystems
553#
554CONFIG_FAT_FS=m
555CONFIG_MSDOS_FS=m
556CONFIG_VFAT_FS=m
557CONFIG_FAT_DEFAULT_CODEPAGE=437
558CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
559# CONFIG_NTFS_FS is not set
560
561#
562# Pseudo filesystems
563#
564CONFIG_PROC_FS=y
565CONFIG_PROC_SYSCTL=y
566CONFIG_PROC_PAGE_MONITOR=y
567CONFIG_SYSFS=y
568CONFIG_TMPFS=y
569# CONFIG_TMPFS_POSIX_ACL is not set
570# CONFIG_HUGETLB_PAGE is not set
571# CONFIG_CONFIGFS_FS is not set
572CONFIG_MISC_FILESYSTEMS=y
573# CONFIG_ADFS_FS is not set
574# CONFIG_AFFS_FS is not set
575# CONFIG_HFS_FS is not set
576# CONFIG_HFSPLUS_FS is not set
577# CONFIG_BEFS_FS is not set
578# CONFIG_BFS_FS is not set
579# CONFIG_EFS_FS is not set
580# CONFIG_SQUASHFS is not set
581# CONFIG_VXFS_FS is not set
582# CONFIG_MINIX_FS is not set
583# CONFIG_OMFS_FS is not set
584# CONFIG_HPFS_FS is not set
585# CONFIG_QNX4FS_FS is not set
586# CONFIG_ROMFS_FS is not set
587# CONFIG_SYSV_FS is not set
588# CONFIG_UFS_FS is not set
589
590#
591# Partition Types
592#
593CONFIG_PARTITION_ADVANCED=y
594# CONFIG_ACORN_PARTITION is not set
595# CONFIG_OSF_PARTITION is not set
596# CONFIG_AMIGA_PARTITION is not set
597# CONFIG_ATARI_PARTITION is not set
598# CONFIG_MAC_PARTITION is not set
599CONFIG_MSDOS_PARTITION=y
600# CONFIG_BSD_DISKLABEL is not set
601# CONFIG_MINIX_SUBPARTITION is not set
602# CONFIG_SOLARIS_X86_PARTITION is not set
603# CONFIG_UNIXWARE_DISKLABEL is not set
604# CONFIG_LDM_PARTITION is not set
605# CONFIG_SGI_PARTITION is not set
606# CONFIG_ULTRIX_PARTITION is not set
607# CONFIG_SUN_PARTITION is not set
608# CONFIG_KARMA_PARTITION is not set
609# CONFIG_EFI_PARTITION is not set
610# CONFIG_SYSV68_PARTITION is not set
611CONFIG_NLS=y
612CONFIG_NLS_DEFAULT="utf8"
613CONFIG_NLS_CODEPAGE_437=y
614# CONFIG_NLS_CODEPAGE_737 is not set
615# CONFIG_NLS_CODEPAGE_775 is not set
616# CONFIG_NLS_CODEPAGE_850 is not set
617# CONFIG_NLS_CODEPAGE_852 is not set
618# CONFIG_NLS_CODEPAGE_855 is not set
619# CONFIG_NLS_CODEPAGE_857 is not set
620# CONFIG_NLS_CODEPAGE_860 is not set
621# CONFIG_NLS_CODEPAGE_861 is not set
622# CONFIG_NLS_CODEPAGE_862 is not set
623# CONFIG_NLS_CODEPAGE_863 is not set
624# CONFIG_NLS_CODEPAGE_864 is not set
625# CONFIG_NLS_CODEPAGE_865 is not set
626# CONFIG_NLS_CODEPAGE_866 is not set
627# CONFIG_NLS_CODEPAGE_869 is not set
628# CONFIG_NLS_CODEPAGE_936 is not set
629# CONFIG_NLS_CODEPAGE_950 is not set
630# CONFIG_NLS_CODEPAGE_932 is not set
631# CONFIG_NLS_CODEPAGE_949 is not set
632# CONFIG_NLS_CODEPAGE_874 is not set
633# CONFIG_NLS_ISO8859_8 is not set
634# CONFIG_NLS_CODEPAGE_1250 is not set
635# CONFIG_NLS_CODEPAGE_1251 is not set
636CONFIG_NLS_ASCII=m
637# CONFIG_NLS_ISO8859_1 is not set
638# CONFIG_NLS_ISO8859_2 is not set
639# CONFIG_NLS_ISO8859_3 is not set
640# CONFIG_NLS_ISO8859_4 is not set
641# CONFIG_NLS_ISO8859_5 is not set
642# CONFIG_NLS_ISO8859_6 is not set
643# CONFIG_NLS_ISO8859_7 is not set
644# CONFIG_NLS_ISO8859_9 is not set
645# CONFIG_NLS_ISO8859_13 is not set
646# CONFIG_NLS_ISO8859_14 is not set
647# CONFIG_NLS_ISO8859_15 is not set
648# CONFIG_NLS_KOI8_R is not set
649# CONFIG_NLS_KOI8_U is not set
650# CONFIG_NLS_UTF8 is not set
651
652#
653# Kernel hacking
654#
655# CONFIG_PRINTK_TIME is not set
656CONFIG_ENABLE_WARN_DEPRECATED=y
657CONFIG_ENABLE_MUST_CHECK=y
658CONFIG_FRAME_WARN=1024
659CONFIG_MAGIC_SYSRQ=y
660# CONFIG_STRIP_ASM_SYMS is not set
661# CONFIG_UNUSED_SYMBOLS is not set
662CONFIG_DEBUG_FS=y
663# CONFIG_HEADERS_CHECK is not set
664CONFIG_DEBUG_KERNEL=y
665# CONFIG_DEBUG_SHIRQ is not set
666CONFIG_DETECT_SOFTLOCKUP=y
667# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
668CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
669CONFIG_DETECT_HUNG_TASK=y
670# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
671CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
672CONFIG_SCHED_DEBUG=y
673# CONFIG_SCHEDSTATS is not set
674# CONFIG_TIMER_STATS is not set
675# CONFIG_DEBUG_OBJECTS is not set
676# CONFIG_SLUB_DEBUG_ON is not set
677# CONFIG_SLUB_STATS is not set
678# CONFIG_DEBUG_KMEMLEAK is not set
679# CONFIG_DEBUG_RT_MUTEXES is not set
680# CONFIG_RT_MUTEX_TESTER is not set
681CONFIG_DEBUG_SPINLOCK=y
682# CONFIG_DEBUG_MUTEXES is not set
683# CONFIG_DEBUG_LOCK_ALLOC is not set
684# CONFIG_PROVE_LOCKING is not set
685# CONFIG_LOCK_STAT is not set
686CONFIG_DEBUG_SPINLOCK_SLEEP=y
687# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
688# CONFIG_DEBUG_KOBJECT is not set
689CONFIG_DEBUG_BUGVERBOSE=y
690CONFIG_DEBUG_INFO=y
691# CONFIG_DEBUG_VM is not set
692# CONFIG_DEBUG_WRITECOUNT is not set
693CONFIG_DEBUG_MEMORY_INIT=y
694# CONFIG_DEBUG_LIST is not set
695# CONFIG_DEBUG_SG is not set
696# CONFIG_DEBUG_NOTIFIERS is not set
697# CONFIG_DEBUG_CREDENTIALS is not set
698CONFIG_FRAME_POINTER=y
699# CONFIG_BOOT_PRINTK_DELAY is not set
700# CONFIG_RCU_TORTURE_TEST is not set
701CONFIG_RCU_CPU_STALL_DETECTOR=y
702# CONFIG_BACKTRACE_SELF_TEST is not set
703# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
704# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
705# CONFIG_FAULT_INJECTION is not set
706# CONFIG_LATENCYTOP is not set
707# CONFIG_SYSCTL_SYSCALL_CHECK is not set
708# CONFIG_PAGE_POISONING is not set
709CONFIG_HAVE_FUNCTION_TRACER=y
710CONFIG_TRACING_SUPPORT=y
711CONFIG_FTRACE=y
712# CONFIG_FUNCTION_TRACER is not set
713# CONFIG_IRQSOFF_TRACER is not set
714# CONFIG_SCHED_TRACER is not set
715# CONFIG_ENABLE_DEFAULT_TRACERS is not set
716# CONFIG_BOOT_TRACER is not set
717CONFIG_BRANCH_PROFILE_NONE=y
718# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
719# CONFIG_PROFILE_ALL_BRANCHES is not set
720# CONFIG_STACK_TRACER is not set
721# CONFIG_KMEMTRACE is not set
722# CONFIG_WORKQUEUE_TRACER is not set
723# CONFIG_BLK_DEV_IO_TRACE is not set
724# CONFIG_DYNAMIC_DEBUG is not set
725# CONFIG_SAMPLES is not set
726CONFIG_HAVE_ARCH_KGDB=y
727# CONFIG_KGDB is not set
728# CONFIG_DEBUG_USER is not set
729# CONFIG_DEBUG_ERRORS is not set
730# CONFIG_DEBUG_STACK_USAGE is not set
731# CONFIG_DEBUG_LL is not set
732
733#
734# Security options
735#
736# CONFIG_KEYS is not set
737# CONFIG_SECURITY is not set
738# CONFIG_SECURITYFS is not set
739# CONFIG_SECURITY_FILE_CAPABILITIES is not set
740# CONFIG_CRYPTO is not set
741# CONFIG_BINARY_PRINTF is not set
742
743#
744# Library routines
745#
746CONFIG_GENERIC_FIND_LAST_BIT=y
747# CONFIG_CRC_CCITT is not set
748# CONFIG_CRC16 is not set
749# CONFIG_CRC_T10DIF is not set
750# CONFIG_CRC_ITU_T is not set
751# CONFIG_CRC32 is not set
752# CONFIG_CRC7 is not set
753# CONFIG_LIBCRC32C is not set
754CONFIG_ZLIB_INFLATE=y
755CONFIG_DECOMPRESS_GZIP=y
756CONFIG_DECOMPRESS_BZIP2=y
757CONFIG_DECOMPRESS_LZMA=y
758CONFIG_HAS_IOMEM=y
759CONFIG_HAS_IOPORT=y
760CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/stamp9g20_defconfig b/arch/arm/configs/stamp9g20_defconfig
new file mode 100644
index 000000000000..06a8293c61ca
--- /dev/null
+++ b/arch/arm/configs/stamp9g20_defconfig
@@ -0,0 +1,1456 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.34-rc1
4# Wed Mar 17 16:38:03 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_HAVE_PROC_CPU=y
12CONFIG_GENERIC_HARDIRQS=y
13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_LOCK_KERNEL=y
33CONFIG_INIT_ENV_ARG_LIMIT=32
34CONFIG_LOCALVERSION=""
35# CONFIG_LOCALVERSION_AUTO is not set
36CONFIG_HAVE_KERNEL_GZIP=y
37CONFIG_HAVE_KERNEL_LZO=y
38CONFIG_KERNEL_GZIP=y
39# CONFIG_KERNEL_BZIP2 is not set
40# CONFIG_KERNEL_LZMA is not set
41# CONFIG_KERNEL_LZO is not set
42# CONFIG_SWAP is not set
43CONFIG_SYSVIPC=y
44CONFIG_SYSVIPC_SYSCTL=y
45# CONFIG_POSIX_MQUEUE is not set
46# CONFIG_BSD_PROCESS_ACCT is not set
47# CONFIG_TASKSTATS is not set
48# CONFIG_AUDIT is not set
49
50#
51# RCU Subsystem
52#
53# CONFIG_TREE_RCU is not set
54CONFIG_TREE_PREEMPT_RCU=y
55# CONFIG_TINY_RCU is not set
56# CONFIG_RCU_TRACE is not set
57CONFIG_RCU_FANOUT=32
58# CONFIG_RCU_FANOUT_EXACT is not set
59# CONFIG_TREE_RCU_TRACE is not set
60# CONFIG_IKCONFIG is not set
61CONFIG_LOG_BUF_SHIFT=14
62# CONFIG_CGROUPS is not set
63# CONFIG_SYSFS_DEPRECATED_V2 is not set
64# CONFIG_RELAY is not set
65CONFIG_NAMESPACES=y
66# CONFIG_UTS_NS is not set
67# CONFIG_IPC_NS is not set
68# CONFIG_USER_NS is not set
69# CONFIG_PID_NS is not set
70# CONFIG_NET_NS is not set
71CONFIG_BLK_DEV_INITRD=y
72CONFIG_INITRAMFS_SOURCE=""
73CONFIG_RD_GZIP=y
74CONFIG_RD_BZIP2=y
75CONFIG_RD_LZMA=y
76CONFIG_RD_LZO=y
77CONFIG_CC_OPTIMIZE_FOR_SIZE=y
78CONFIG_SYSCTL=y
79CONFIG_ANON_INODES=y
80# CONFIG_EMBEDDED is not set
81CONFIG_UID16=y
82CONFIG_SYSCTL_SYSCALL=y
83CONFIG_KALLSYMS=y
84# CONFIG_KALLSYMS_EXTRA_PASS is not set
85CONFIG_HOTPLUG=y
86CONFIG_PRINTK=y
87CONFIG_BUG=y
88CONFIG_ELF_CORE=y
89CONFIG_BASE_FULL=y
90CONFIG_FUTEX=y
91CONFIG_EPOLL=y
92CONFIG_SIGNALFD=y
93CONFIG_TIMERFD=y
94CONFIG_EVENTFD=y
95CONFIG_SHMEM=y
96CONFIG_AIO=y
97CONFIG_HAVE_PERF_EVENTS=y
98CONFIG_PERF_USE_VMALLOC=y
99
100#
101# Kernel Performance Events And Counters
102#
103# CONFIG_PERF_EVENTS is not set
104# CONFIG_PERF_COUNTERS is not set
105CONFIG_VM_EVENT_COUNTERS=y
106CONFIG_COMPAT_BRK=y
107CONFIG_SLAB=y
108# CONFIG_SLUB is not set
109# CONFIG_SLOB is not set
110# CONFIG_PROFILING is not set
111CONFIG_HAVE_OPROFILE=y
112# CONFIG_KPROBES is not set
113CONFIG_HAVE_KPROBES=y
114CONFIG_HAVE_KRETPROBES=y
115CONFIG_HAVE_CLK=y
116
117#
118# GCOV-based kernel profiling
119#
120# CONFIG_SLOW_WORK is not set
121CONFIG_HAVE_GENERIC_DMA_COHERENT=y
122CONFIG_SLABINFO=y
123CONFIG_RT_MUTEXES=y
124CONFIG_BASE_SMALL=0
125CONFIG_MODULES=y
126# CONFIG_MODULE_FORCE_LOAD is not set
127CONFIG_MODULE_UNLOAD=y
128# CONFIG_MODULE_FORCE_UNLOAD is not set
129# CONFIG_MODVERSIONS is not set
130# CONFIG_MODULE_SRCVERSION_ALL is not set
131CONFIG_BLOCK=y
132# CONFIG_LBDAF is not set
133# CONFIG_BLK_DEV_BSG is not set
134# CONFIG_BLK_DEV_INTEGRITY is not set
135
136#
137# IO Schedulers
138#
139CONFIG_IOSCHED_NOOP=y
140# CONFIG_IOSCHED_DEADLINE is not set
141CONFIG_IOSCHED_CFQ=y
142# CONFIG_DEFAULT_DEADLINE is not set
143CONFIG_DEFAULT_CFQ=y
144# CONFIG_DEFAULT_NOOP is not set
145CONFIG_DEFAULT_IOSCHED="cfq"
146# CONFIG_INLINE_SPIN_TRYLOCK is not set
147# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
148# CONFIG_INLINE_SPIN_LOCK is not set
149# CONFIG_INLINE_SPIN_LOCK_BH is not set
150# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
151# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
152# CONFIG_INLINE_SPIN_UNLOCK is not set
153# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
154# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
155# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
156# CONFIG_INLINE_READ_TRYLOCK is not set
157# CONFIG_INLINE_READ_LOCK is not set
158# CONFIG_INLINE_READ_LOCK_BH is not set
159# CONFIG_INLINE_READ_LOCK_IRQ is not set
160# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
161# CONFIG_INLINE_READ_UNLOCK is not set
162# CONFIG_INLINE_READ_UNLOCK_BH is not set
163# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
164# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
165# CONFIG_INLINE_WRITE_TRYLOCK is not set
166# CONFIG_INLINE_WRITE_LOCK is not set
167# CONFIG_INLINE_WRITE_LOCK_BH is not set
168# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
169# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
170# CONFIG_INLINE_WRITE_UNLOCK is not set
171# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
172# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
173# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
174# CONFIG_MUTEX_SPIN_ON_OWNER is not set
175CONFIG_FREEZER=y
176
177#
178# System Type
179#
180CONFIG_MMU=y
181# CONFIG_ARCH_AAEC2000 is not set
182# CONFIG_ARCH_INTEGRATOR is not set
183# CONFIG_ARCH_REALVIEW is not set
184# CONFIG_ARCH_VERSATILE is not set
185CONFIG_ARCH_AT91=y
186# CONFIG_ARCH_CLPS711X is not set
187# CONFIG_ARCH_GEMINI is not set
188# CONFIG_ARCH_EBSA110 is not set
189# CONFIG_ARCH_EP93XX is not set
190# CONFIG_ARCH_FOOTBRIDGE is not set
191# CONFIG_ARCH_MXC is not set
192# CONFIG_ARCH_STMP3XXX is not set
193# CONFIG_ARCH_NETX is not set
194# CONFIG_ARCH_H720X is not set
195# CONFIG_ARCH_NOMADIK is not set
196# CONFIG_ARCH_IOP13XX is not set
197# CONFIG_ARCH_IOP32X is not set
198# CONFIG_ARCH_IOP33X is not set
199# CONFIG_ARCH_IXP23XX is not set
200# CONFIG_ARCH_IXP2000 is not set
201# CONFIG_ARCH_IXP4XX is not set
202# CONFIG_ARCH_L7200 is not set
203# CONFIG_ARCH_DOVE is not set
204# CONFIG_ARCH_KIRKWOOD is not set
205# CONFIG_ARCH_LOKI is not set
206# CONFIG_ARCH_MV78XX0 is not set
207# CONFIG_ARCH_ORION5X is not set
208# CONFIG_ARCH_MMP is not set
209# CONFIG_ARCH_KS8695 is not set
210# CONFIG_ARCH_NS9XXX is not set
211# CONFIG_ARCH_W90X900 is not set
212# CONFIG_ARCH_NUC93X is not set
213# CONFIG_ARCH_PNX4008 is not set
214# CONFIG_ARCH_PXA is not set
215# CONFIG_ARCH_MSM is not set
216# CONFIG_ARCH_RPC is not set
217# CONFIG_ARCH_SA1100 is not set
218# CONFIG_ARCH_S3C2410 is not set
219# CONFIG_ARCH_S3C64XX is not set
220# CONFIG_ARCH_S5PC1XX is not set
221# CONFIG_ARCH_SHARK is not set
222# CONFIG_ARCH_LH7A40X is not set
223# CONFIG_ARCH_U300 is not set
224# CONFIG_ARCH_DAVINCI is not set
225# CONFIG_ARCH_OMAP is not set
226# CONFIG_ARCH_BCMRING is not set
227# CONFIG_ARCH_U8500 is not set
228CONFIG_HAVE_AT91_USART3=y
229CONFIG_HAVE_AT91_USART4=y
230CONFIG_HAVE_AT91_USART5=y
231
232#
233# Atmel AT91 System-on-Chip
234#
235# CONFIG_ARCH_AT91RM9200 is not set
236# CONFIG_ARCH_AT91SAM9260 is not set
237# CONFIG_ARCH_AT91SAM9261 is not set
238# CONFIG_ARCH_AT91SAM9G10 is not set
239# CONFIG_ARCH_AT91SAM9263 is not set
240# CONFIG_ARCH_AT91SAM9RL is not set
241CONFIG_ARCH_AT91SAM9G20=y
242# CONFIG_ARCH_AT91SAM9G45 is not set
243# CONFIG_ARCH_AT91CAP9 is not set
244# CONFIG_ARCH_AT572D940HF is not set
245# CONFIG_ARCH_AT91X40 is not set
246CONFIG_AT91_PMC_UNIT=y
247
248#
249# AT91SAM9G20 Board Type
250#
251# CONFIG_MACH_AT91SAM9G20EK is not set
252# CONFIG_MACH_AT91SAM9G20EK_2MMC is not set
253# CONFIG_MACH_CPU9G20 is not set
254CONFIG_MACH_PORTUXG20=y
255CONFIG_MACH_STAMP9G20=y
256
257#
258# AT91 Board Options
259#
260
261#
262# AT91 Feature Selections
263#
264CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
265CONFIG_AT91_SLOW_CLOCK=y
266CONFIG_AT91_TIMER_HZ=100
267CONFIG_AT91_EARLY_DBGU=y
268# CONFIG_AT91_EARLY_USART0 is not set
269# CONFIG_AT91_EARLY_USART1 is not set
270# CONFIG_AT91_EARLY_USART2 is not set
271# CONFIG_AT91_EARLY_USART3 is not set
272# CONFIG_AT91_EARLY_USART4 is not set
273# CONFIG_AT91_EARLY_USART5 is not set
274
275#
276# Processor Type
277#
278CONFIG_CPU_ARM926T=y
279CONFIG_CPU_32v5=y
280CONFIG_CPU_ABRT_EV5TJ=y
281CONFIG_CPU_PABRT_LEGACY=y
282CONFIG_CPU_CACHE_VIVT=y
283CONFIG_CPU_COPY_V4WB=y
284CONFIG_CPU_TLB_V4WBI=y
285CONFIG_CPU_CP15=y
286CONFIG_CPU_CP15_MMU=y
287
288#
289# Processor Features
290#
291CONFIG_ARM_THUMB=y
292# CONFIG_CPU_ICACHE_DISABLE is not set
293# CONFIG_CPU_DCACHE_DISABLE is not set
294# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
295# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
296CONFIG_ARM_L1_CACHE_SHIFT=5
297
298#
299# Bus support
300#
301# CONFIG_PCI_SYSCALL is not set
302# CONFIG_ARCH_SUPPORTS_MSI is not set
303# CONFIG_PCCARD is not set
304
305#
306# Kernel Features
307#
308CONFIG_TICK_ONESHOT=y
309CONFIG_NO_HZ=y
310CONFIG_HIGH_RES_TIMERS=y
311CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
312CONFIG_VMSPLIT_3G=y
313# CONFIG_VMSPLIT_2G is not set
314# CONFIG_VMSPLIT_1G is not set
315CONFIG_PAGE_OFFSET=0xC0000000
316# CONFIG_PREEMPT_NONE is not set
317# CONFIG_PREEMPT_VOLUNTARY is not set
318CONFIG_PREEMPT=y
319CONFIG_HZ=100
320CONFIG_AEABI=y
321# CONFIG_OABI_COMPAT is not set
322# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
323# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
324# CONFIG_HIGHMEM is not set
325CONFIG_SELECT_MEMORY_MODEL=y
326CONFIG_FLATMEM_MANUAL=y
327# CONFIG_DISCONTIGMEM_MANUAL is not set
328# CONFIG_SPARSEMEM_MANUAL is not set
329CONFIG_FLATMEM=y
330CONFIG_FLAT_NODE_MEM_MAP=y
331CONFIG_PAGEFLAGS_EXTENDED=y
332CONFIG_SPLIT_PTLOCK_CPUS=999999
333# CONFIG_PHYS_ADDR_T_64BIT is not set
334CONFIG_ZONE_DMA_FLAG=0
335CONFIG_VIRT_TO_BUS=y
336# CONFIG_KSM is not set
337CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
338# CONFIG_LEDS is not set
339CONFIG_ALIGNMENT_TRAP=y
340# CONFIG_UACCESS_WITH_MEMCPY is not set
341
342#
343# Boot options
344#
345CONFIG_ZBOOT_ROM_TEXT=0x0
346CONFIG_ZBOOT_ROM_BSS=0x0
347CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
348# CONFIG_XIP_KERNEL is not set
349CONFIG_KEXEC=y
350CONFIG_ATAGS_PROC=y
351
352#
353# CPU Power Management
354#
355CONFIG_CPU_IDLE=y
356CONFIG_CPU_IDLE_GOV_LADDER=y
357CONFIG_CPU_IDLE_GOV_MENU=y
358
359#
360# Floating point emulation
361#
362
363#
364# At least one emulation must be selected
365#
366# CONFIG_VFP is not set
367
368#
369# Userspace binary formats
370#
371CONFIG_BINFMT_ELF=y
372# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
373CONFIG_HAVE_AOUT=y
374# CONFIG_BINFMT_AOUT is not set
375# CONFIG_BINFMT_MISC is not set
376
377#
378# Power management options
379#
380CONFIG_PM=y
381# CONFIG_PM_DEBUG is not set
382CONFIG_PM_SLEEP=y
383CONFIG_SUSPEND=y
384CONFIG_SUSPEND_FREEZER=y
385# CONFIG_APM_EMULATION is not set
386# CONFIG_PM_RUNTIME is not set
387CONFIG_PM_OPS=y
388CONFIG_ARCH_SUSPEND_POSSIBLE=y
389CONFIG_NET=y
390
391#
392# Networking options
393#
394CONFIG_PACKET=y
395CONFIG_UNIX=y
396# CONFIG_NET_KEY is not set
397CONFIG_INET=y
398# CONFIG_IP_MULTICAST is not set
399# CONFIG_IP_ADVANCED_ROUTER is not set
400CONFIG_IP_FIB_HASH=y
401# CONFIG_IP_PNP is not set
402# CONFIG_NET_IPIP is not set
403# CONFIG_NET_IPGRE is not set
404# CONFIG_ARPD is not set
405# CONFIG_SYN_COOKIES is not set
406# CONFIG_INET_AH is not set
407# CONFIG_INET_ESP is not set
408# CONFIG_INET_IPCOMP is not set
409# CONFIG_INET_XFRM_TUNNEL is not set
410# CONFIG_INET_TUNNEL is not set
411# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
412# CONFIG_INET_XFRM_MODE_TUNNEL is not set
413# CONFIG_INET_XFRM_MODE_BEET is not set
414# CONFIG_INET_LRO is not set
415CONFIG_INET_DIAG=y
416CONFIG_INET_TCP_DIAG=y
417# CONFIG_TCP_CONG_ADVANCED is not set
418CONFIG_TCP_CONG_CUBIC=y
419CONFIG_DEFAULT_TCP_CONG="cubic"
420# CONFIG_TCP_MD5SIG is not set
421# CONFIG_IPV6 is not set
422# CONFIG_NETWORK_SECMARK is not set
423# CONFIG_NETFILTER is not set
424# CONFIG_IP_DCCP is not set
425# CONFIG_IP_SCTP is not set
426# CONFIG_RDS is not set
427# CONFIG_TIPC is not set
428# CONFIG_ATM is not set
429# CONFIG_BRIDGE is not set
430# CONFIG_NET_DSA is not set
431# CONFIG_VLAN_8021Q is not set
432# CONFIG_DECNET is not set
433# CONFIG_LLC2 is not set
434# CONFIG_IPX is not set
435# CONFIG_ATALK is not set
436# CONFIG_X25 is not set
437# CONFIG_LAPB is not set
438# CONFIG_ECONET is not set
439# CONFIG_WAN_ROUTER is not set
440# CONFIG_PHONET is not set
441# CONFIG_IEEE802154 is not set
442# CONFIG_NET_SCHED is not set
443# CONFIG_DCB is not set
444
445#
446# Network testing
447#
448# CONFIG_NET_PKTGEN is not set
449# CONFIG_HAMRADIO is not set
450# CONFIG_CAN is not set
451# CONFIG_IRDA is not set
452# CONFIG_BT is not set
453# CONFIG_AF_RXRPC is not set
454# CONFIG_WIRELESS is not set
455# CONFIG_WIMAX is not set
456# CONFIG_RFKILL is not set
457# CONFIG_NET_9P is not set
458
459#
460# Device Drivers
461#
462
463#
464# Generic Driver Options
465#
466CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
467# CONFIG_DEVTMPFS is not set
468CONFIG_STANDALONE=y
469CONFIG_PREVENT_FIRMWARE_BUILD=y
470CONFIG_FW_LOADER=y
471CONFIG_FIRMWARE_IN_KERNEL=y
472CONFIG_EXTRA_FIRMWARE=""
473# CONFIG_SYS_HYPERVISOR is not set
474# CONFIG_CONNECTOR is not set
475CONFIG_MTD=y
476# CONFIG_MTD_DEBUG is not set
477# CONFIG_MTD_TESTS is not set
478CONFIG_MTD_CONCAT=y
479CONFIG_MTD_PARTITIONS=y
480# CONFIG_MTD_REDBOOT_PARTS is not set
481CONFIG_MTD_CMDLINE_PARTS=y
482# CONFIG_MTD_AFS_PARTS is not set
483# CONFIG_MTD_AR7_PARTS is not set
484
485#
486# User Modules And Translation Layers
487#
488CONFIG_MTD_CHAR=y
489CONFIG_MTD_BLKDEVS=y
490CONFIG_MTD_BLOCK=y
491# CONFIG_FTL is not set
492# CONFIG_NFTL is not set
493# CONFIG_INFTL is not set
494# CONFIG_RFD_FTL is not set
495# CONFIG_SSFDC is not set
496# CONFIG_MTD_OOPS is not set
497
498#
499# RAM/ROM/Flash chip drivers
500#
501# CONFIG_MTD_CFI is not set
502# CONFIG_MTD_JEDECPROBE is not set
503CONFIG_MTD_MAP_BANK_WIDTH_1=y
504CONFIG_MTD_MAP_BANK_WIDTH_2=y
505CONFIG_MTD_MAP_BANK_WIDTH_4=y
506# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
507# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
508# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
509CONFIG_MTD_CFI_I1=y
510CONFIG_MTD_CFI_I2=y
511# CONFIG_MTD_CFI_I4 is not set
512# CONFIG_MTD_CFI_I8 is not set
513# CONFIG_MTD_RAM is not set
514# CONFIG_MTD_ROM is not set
515# CONFIG_MTD_ABSENT is not set
516
517#
518# Mapping drivers for chip access
519#
520# CONFIG_MTD_COMPLEX_MAPPINGS is not set
521# CONFIG_MTD_PLATRAM is not set
522
523#
524# Self-contained MTD device drivers
525#
526CONFIG_MTD_DATAFLASH=y
527# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
528# CONFIG_MTD_DATAFLASH_OTP is not set
529# CONFIG_MTD_M25P80 is not set
530# CONFIG_MTD_SST25L is not set
531# CONFIG_MTD_SLRAM is not set
532# CONFIG_MTD_PHRAM is not set
533# CONFIG_MTD_MTDRAM is not set
534# CONFIG_MTD_BLOCK2MTD is not set
535
536#
537# Disk-On-Chip Device Drivers
538#
539# CONFIG_MTD_DOC2000 is not set
540# CONFIG_MTD_DOC2001 is not set
541# CONFIG_MTD_DOC2001PLUS is not set
542CONFIG_MTD_NAND=y
543# CONFIG_MTD_NAND_VERIFY_WRITE is not set
544# CONFIG_MTD_NAND_ECC_SMC is not set
545# CONFIG_MTD_NAND_MUSEUM_IDS is not set
546# CONFIG_MTD_NAND_GPIO is not set
547CONFIG_MTD_NAND_IDS=y
548# CONFIG_MTD_NAND_DISKONCHIP is not set
549CONFIG_MTD_NAND_ATMEL=y
550# CONFIG_MTD_NAND_ATMEL_ECC_HW is not set
551CONFIG_MTD_NAND_ATMEL_ECC_SOFT=y
552# CONFIG_MTD_NAND_ATMEL_ECC_NONE is not set
553# CONFIG_MTD_NAND_NANDSIM is not set
554# CONFIG_MTD_NAND_PLATFORM is not set
555# CONFIG_MTD_ALAUDA is not set
556# CONFIG_MTD_ONENAND is not set
557
558#
559# LPDDR flash memory drivers
560#
561# CONFIG_MTD_LPDDR is not set
562
563#
564# UBI - Unsorted block images
565#
566# CONFIG_MTD_UBI is not set
567# CONFIG_PARPORT is not set
568CONFIG_BLK_DEV=y
569# CONFIG_BLK_DEV_COW_COMMON is not set
570CONFIG_BLK_DEV_LOOP=y
571# CONFIG_BLK_DEV_CRYPTOLOOP is not set
572
573#
574# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
575#
576# CONFIG_BLK_DEV_NBD is not set
577# CONFIG_BLK_DEV_UB is not set
578CONFIG_BLK_DEV_RAM=y
579CONFIG_BLK_DEV_RAM_COUNT=16
580CONFIG_BLK_DEV_RAM_SIZE=8192
581# CONFIG_BLK_DEV_XIP is not set
582# CONFIG_CDROM_PKTCDVD is not set
583# CONFIG_ATA_OVER_ETH is not set
584# CONFIG_MG_DISK is not set
585# CONFIG_MISC_DEVICES is not set
586CONFIG_HAVE_IDE=y
587# CONFIG_IDE is not set
588
589#
590# SCSI device support
591#
592# CONFIG_RAID_ATTRS is not set
593CONFIG_SCSI=y
594CONFIG_SCSI_DMA=y
595# CONFIG_SCSI_TGT is not set
596# CONFIG_SCSI_NETLINK is not set
597CONFIG_SCSI_PROC_FS=y
598
599#
600# SCSI support type (disk, tape, CD-ROM)
601#
602CONFIG_BLK_DEV_SD=y
603# CONFIG_CHR_DEV_ST is not set
604# CONFIG_CHR_DEV_OSST is not set
605# CONFIG_BLK_DEV_SR is not set
606# CONFIG_CHR_DEV_SG is not set
607# CONFIG_CHR_DEV_SCH is not set
608CONFIG_SCSI_MULTI_LUN=y
609# CONFIG_SCSI_CONSTANTS is not set
610# CONFIG_SCSI_LOGGING is not set
611# CONFIG_SCSI_SCAN_ASYNC is not set
612CONFIG_SCSI_WAIT_SCAN=m
613
614#
615# SCSI Transports
616#
617# CONFIG_SCSI_SPI_ATTRS is not set
618# CONFIG_SCSI_FC_ATTRS is not set
619# CONFIG_SCSI_ISCSI_ATTRS is not set
620# CONFIG_SCSI_SAS_LIBSAS is not set
621# CONFIG_SCSI_SRP_ATTRS is not set
622# CONFIG_SCSI_LOWLEVEL is not set
623# CONFIG_SCSI_DH is not set
624# CONFIG_SCSI_OSD_INITIATOR is not set
625# CONFIG_ATA is not set
626# CONFIG_MD is not set
627CONFIG_NETDEVICES=y
628# CONFIG_DUMMY is not set
629# CONFIG_BONDING is not set
630# CONFIG_MACVLAN is not set
631# CONFIG_EQUALIZER is not set
632# CONFIG_TUN is not set
633# CONFIG_VETH is not set
634CONFIG_PHYLIB=y
635
636#
637# MII PHY device drivers
638#
639# CONFIG_MARVELL_PHY is not set
640# CONFIG_DAVICOM_PHY is not set
641# CONFIG_QSEMI_PHY is not set
642# CONFIG_LXT_PHY is not set
643# CONFIG_CICADA_PHY is not set
644# CONFIG_VITESSE_PHY is not set
645# CONFIG_SMSC_PHY is not set
646# CONFIG_BROADCOM_PHY is not set
647# CONFIG_ICPLUS_PHY is not set
648# CONFIG_REALTEK_PHY is not set
649# CONFIG_NATIONAL_PHY is not set
650# CONFIG_STE10XP is not set
651# CONFIG_LSI_ET1011C_PHY is not set
652# CONFIG_FIXED_PHY is not set
653# CONFIG_MDIO_BITBANG is not set
654CONFIG_NET_ETHERNET=y
655# CONFIG_MII is not set
656CONFIG_MACB=y
657# CONFIG_AX88796 is not set
658# CONFIG_SMC91X is not set
659# CONFIG_DM9000 is not set
660# CONFIG_ENC28J60 is not set
661# CONFIG_ETHOC is not set
662# CONFIG_SMC911X is not set
663# CONFIG_SMSC911X is not set
664# CONFIG_DNET is not set
665# CONFIG_IBM_NEW_EMAC_ZMII is not set
666# CONFIG_IBM_NEW_EMAC_RGMII is not set
667# CONFIG_IBM_NEW_EMAC_TAH is not set
668# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
669# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
670# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
671# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
672# CONFIG_B44 is not set
673# CONFIG_KS8842 is not set
674# CONFIG_KS8851 is not set
675# CONFIG_KS8851_MLL is not set
676# CONFIG_NETDEV_1000 is not set
677# CONFIG_NETDEV_10000 is not set
678# CONFIG_WLAN is not set
679
680#
681# Enable WiMAX (Networking options) to see the WiMAX drivers
682#
683
684#
685# USB Network Adapters
686#
687# CONFIG_USB_CATC is not set
688# CONFIG_USB_KAWETH is not set
689# CONFIG_USB_PEGASUS is not set
690# CONFIG_USB_RTL8150 is not set
691# CONFIG_USB_USBNET is not set
692# CONFIG_WAN is not set
693# CONFIG_PPP is not set
694# CONFIG_SLIP is not set
695# CONFIG_NETCONSOLE is not set
696# CONFIG_NETPOLL is not set
697# CONFIG_NET_POLL_CONTROLLER is not set
698# CONFIG_ISDN is not set
699# CONFIG_PHONE is not set
700
701#
702# Input device support
703#
704CONFIG_INPUT=y
705# CONFIG_INPUT_FF_MEMLESS is not set
706# CONFIG_INPUT_POLLDEV is not set
707# CONFIG_INPUT_SPARSEKMAP is not set
708
709#
710# Userland interfaces
711#
712CONFIG_INPUT_MOUSEDEV=y
713# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
714CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
715CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
716# CONFIG_INPUT_JOYDEV is not set
717# CONFIG_INPUT_EVDEV is not set
718# CONFIG_INPUT_EVBUG is not set
719
720#
721# Input Device Drivers
722#
723# CONFIG_INPUT_KEYBOARD is not set
724# CONFIG_INPUT_MOUSE is not set
725# CONFIG_INPUT_JOYSTICK is not set
726# CONFIG_INPUT_TABLET is not set
727# CONFIG_INPUT_TOUCHSCREEN is not set
728# CONFIG_INPUT_MISC is not set
729
730#
731# Hardware I/O ports
732#
733# CONFIG_SERIO is not set
734# CONFIG_GAMEPORT is not set
735
736#
737# Character devices
738#
739CONFIG_VT=y
740CONFIG_CONSOLE_TRANSLATIONS=y
741CONFIG_VT_CONSOLE=y
742CONFIG_HW_CONSOLE=y
743# CONFIG_VT_HW_CONSOLE_BINDING is not set
744CONFIG_DEVKMEM=y
745# CONFIG_SERIAL_NONSTANDARD is not set
746
747#
748# Serial drivers
749#
750# CONFIG_SERIAL_8250 is not set
751
752#
753# Non-8250 serial port support
754#
755CONFIG_SERIAL_ATMEL=y
756CONFIG_SERIAL_ATMEL_CONSOLE=y
757CONFIG_SERIAL_ATMEL_PDC=y
758# CONFIG_SERIAL_ATMEL_TTYAT is not set
759# CONFIG_SERIAL_MAX3100 is not set
760CONFIG_SERIAL_CORE=y
761CONFIG_SERIAL_CORE_CONSOLE=y
762# CONFIG_SERIAL_TIMBERDALE is not set
763CONFIG_UNIX98_PTYS=y
764# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
765# CONFIG_LEGACY_PTYS is not set
766# CONFIG_IPMI_HANDLER is not set
767# CONFIG_HW_RANDOM is not set
768# CONFIG_R3964 is not set
769# CONFIG_RAW_DRIVER is not set
770# CONFIG_TCG_TPM is not set
771CONFIG_I2C=y
772CONFIG_I2C_BOARDINFO=y
773CONFIG_I2C_COMPAT=y
774CONFIG_I2C_CHARDEV=y
775CONFIG_I2C_HELPER_AUTO=y
776CONFIG_I2C_ALGOBIT=y
777
778#
779# I2C Hardware Bus support
780#
781
782#
783# I2C system bus drivers (mostly embedded / system-on-chip)
784#
785# CONFIG_I2C_DESIGNWARE is not set
786CONFIG_I2C_GPIO=y
787# CONFIG_I2C_OCORES is not set
788# CONFIG_I2C_SIMTEC is not set
789# CONFIG_I2C_XILINX is not set
790
791#
792# External I2C/SMBus adapter drivers
793#
794# CONFIG_I2C_PARPORT_LIGHT is not set
795# CONFIG_I2C_TAOS_EVM is not set
796# CONFIG_I2C_TINY_USB is not set
797
798#
799# Other I2C/SMBus bus drivers
800#
801# CONFIG_I2C_PCA_PLATFORM is not set
802# CONFIG_I2C_STUB is not set
803
804#
805# Miscellaneous I2C Chip support
806#
807# CONFIG_SENSORS_TSL2550 is not set
808# CONFIG_I2C_DEBUG_CORE is not set
809# CONFIG_I2C_DEBUG_ALGO is not set
810# CONFIG_I2C_DEBUG_BUS is not set
811# CONFIG_I2C_DEBUG_CHIP is not set
812CONFIG_SPI=y
813CONFIG_SPI_MASTER=y
814
815#
816# SPI Master Controller Drivers
817#
818CONFIG_SPI_ATMEL=y
819# CONFIG_SPI_BITBANG is not set
820# CONFIG_SPI_GPIO is not set
821# CONFIG_SPI_XILINX is not set
822# CONFIG_SPI_DESIGNWARE is not set
823
824#
825# SPI Protocol Masters
826#
827CONFIG_SPI_SPIDEV=y
828# CONFIG_SPI_TLE62X0 is not set
829
830#
831# PPS support
832#
833# CONFIG_PPS is not set
834CONFIG_ARCH_REQUIRE_GPIOLIB=y
835CONFIG_GPIOLIB=y
836CONFIG_GPIO_SYSFS=y
837
838#
839# Memory mapped GPIO expanders:
840#
841# CONFIG_GPIO_IT8761E is not set
842
843#
844# I2C GPIO expanders:
845#
846# CONFIG_GPIO_MAX7300 is not set
847# CONFIG_GPIO_MAX732X is not set
848# CONFIG_GPIO_PCA953X is not set
849# CONFIG_GPIO_PCF857X is not set
850# CONFIG_GPIO_ADP5588 is not set
851
852#
853# PCI GPIO expanders:
854#
855
856#
857# SPI GPIO expanders:
858#
859# CONFIG_GPIO_MAX7301 is not set
860# CONFIG_GPIO_MCP23S08 is not set
861# CONFIG_GPIO_MC33880 is not set
862
863#
864# AC97 GPIO expanders:
865#
866CONFIG_W1=y
867
868#
869# 1-wire Bus Masters
870#
871# CONFIG_W1_MASTER_DS2490 is not set
872# CONFIG_W1_MASTER_DS2482 is not set
873# CONFIG_W1_MASTER_DS1WM is not set
874CONFIG_W1_MASTER_GPIO=y
875
876#
877# 1-wire Slaves
878#
879CONFIG_W1_SLAVE_THERM=y
880# CONFIG_W1_SLAVE_SMEM is not set
881CONFIG_W1_SLAVE_DS2431=y
882# CONFIG_W1_SLAVE_DS2433 is not set
883# CONFIG_W1_SLAVE_DS2760 is not set
884# CONFIG_W1_SLAVE_BQ27000 is not set
885# CONFIG_POWER_SUPPLY is not set
886# CONFIG_HWMON is not set
887# CONFIG_THERMAL is not set
888CONFIG_WATCHDOG=y
889# CONFIG_WATCHDOG_NOWAYOUT is not set
890
891#
892# Watchdog Device Drivers
893#
894# CONFIG_SOFT_WATCHDOG is not set
895# CONFIG_MAX63XX_WATCHDOG is not set
896CONFIG_AT91SAM9X_WATCHDOG=y
897
898#
899# USB-based Watchdog Cards
900#
901# CONFIG_USBPCWATCHDOG is not set
902CONFIG_SSB_POSSIBLE=y
903
904#
905# Sonics Silicon Backplane
906#
907# CONFIG_SSB is not set
908
909#
910# Multifunction device drivers
911#
912# CONFIG_MFD_CORE is not set
913# CONFIG_MFD_88PM860X is not set
914# CONFIG_MFD_SM501 is not set
915# CONFIG_MFD_ASIC3 is not set
916# CONFIG_HTC_EGPIO is not set
917# CONFIG_HTC_PASIC3 is not set
918# CONFIG_HTC_I2CPLD is not set
919# CONFIG_TPS65010 is not set
920# CONFIG_TWL4030_CORE is not set
921# CONFIG_MFD_TMIO is not set
922# CONFIG_MFD_T7L66XB is not set
923# CONFIG_MFD_TC6387XB is not set
924# CONFIG_MFD_TC6393XB is not set
925# CONFIG_PMIC_DA903X is not set
926# CONFIG_PMIC_ADP5520 is not set
927# CONFIG_MFD_MAX8925 is not set
928# CONFIG_MFD_WM8400 is not set
929# CONFIG_MFD_WM831X is not set
930# CONFIG_MFD_WM8350_I2C is not set
931# CONFIG_MFD_WM8994 is not set
932# CONFIG_MFD_PCF50633 is not set
933# CONFIG_MFD_MC13783 is not set
934# CONFIG_AB3100_CORE is not set
935# CONFIG_EZX_PCAP is not set
936# CONFIG_AB4500_CORE is not set
937# CONFIG_REGULATOR is not set
938# CONFIG_MEDIA_SUPPORT is not set
939
940#
941# Graphics support
942#
943# CONFIG_VGASTATE is not set
944# CONFIG_VIDEO_OUTPUT_CONTROL is not set
945# CONFIG_FB is not set
946# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
947
948#
949# Display device support
950#
951# CONFIG_DISPLAY_SUPPORT is not set
952
953#
954# Console display driver support
955#
956# CONFIG_VGA_CONSOLE is not set
957CONFIG_DUMMY_CONSOLE=y
958# CONFIG_SOUND is not set
959# CONFIG_HID_SUPPORT is not set
960CONFIG_USB_SUPPORT=y
961CONFIG_USB_ARCH_HAS_HCD=y
962CONFIG_USB_ARCH_HAS_OHCI=y
963# CONFIG_USB_ARCH_HAS_EHCI is not set
964CONFIG_USB=y
965# CONFIG_USB_DEBUG is not set
966# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
967
968#
969# Miscellaneous USB options
970#
971CONFIG_USB_DEVICEFS=y
972# CONFIG_USB_DEVICE_CLASS is not set
973# CONFIG_USB_DYNAMIC_MINORS is not set
974# CONFIG_USB_OTG is not set
975CONFIG_USB_MON=y
976# CONFIG_USB_WUSB is not set
977# CONFIG_USB_WUSB_CBAF is not set
978
979#
980# USB Host Controller Drivers
981#
982# CONFIG_USB_C67X00_HCD is not set
983# CONFIG_USB_OXU210HP_HCD is not set
984# CONFIG_USB_ISP116X_HCD is not set
985# CONFIG_USB_ISP1760_HCD is not set
986# CONFIG_USB_ISP1362_HCD is not set
987CONFIG_USB_OHCI_HCD=y
988# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
989# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
990CONFIG_USB_OHCI_LITTLE_ENDIAN=y
991# CONFIG_USB_SL811_HCD is not set
992# CONFIG_USB_R8A66597_HCD is not set
993# CONFIG_USB_HWA_HCD is not set
994# CONFIG_USB_MUSB_HDRC is not set
995# CONFIG_USB_GADGET_MUSB_HDRC is not set
996
997#
998# USB Device Class drivers
999#
1000# CONFIG_USB_ACM is not set
1001# CONFIG_USB_PRINTER is not set
1002# CONFIG_USB_WDM is not set
1003# CONFIG_USB_TMC is not set
1004
1005#
1006# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1007#
1008
1009#
1010# also be needed; see USB_STORAGE Help for more info
1011#
1012CONFIG_USB_STORAGE=y
1013# CONFIG_USB_STORAGE_DEBUG is not set
1014# CONFIG_USB_STORAGE_DATAFAB is not set
1015# CONFIG_USB_STORAGE_FREECOM is not set
1016# CONFIG_USB_STORAGE_ISD200 is not set
1017# CONFIG_USB_STORAGE_USBAT is not set
1018# CONFIG_USB_STORAGE_SDDR09 is not set
1019# CONFIG_USB_STORAGE_SDDR55 is not set
1020# CONFIG_USB_STORAGE_JUMPSHOT is not set
1021# CONFIG_USB_STORAGE_ALAUDA is not set
1022# CONFIG_USB_STORAGE_ONETOUCH is not set
1023# CONFIG_USB_STORAGE_KARMA is not set
1024# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1025# CONFIG_USB_LIBUSUAL is not set
1026
1027#
1028# USB Imaging devices
1029#
1030# CONFIG_USB_MDC800 is not set
1031# CONFIG_USB_MICROTEK is not set
1032
1033#
1034# USB port drivers
1035#
1036# CONFIG_USB_SERIAL is not set
1037
1038#
1039# USB Miscellaneous drivers
1040#
1041# CONFIG_USB_EMI62 is not set
1042# CONFIG_USB_EMI26 is not set
1043# CONFIG_USB_ADUTUX is not set
1044# CONFIG_USB_SEVSEG is not set
1045# CONFIG_USB_RIO500 is not set
1046# CONFIG_USB_LEGOTOWER is not set
1047# CONFIG_USB_LCD is not set
1048# CONFIG_USB_LED is not set
1049# CONFIG_USB_CYPRESS_CY7C63 is not set
1050# CONFIG_USB_CYTHERM is not set
1051# CONFIG_USB_IDMOUSE is not set
1052# CONFIG_USB_FTDI_ELAN is not set
1053# CONFIG_USB_APPLEDISPLAY is not set
1054# CONFIG_USB_LD is not set
1055# CONFIG_USB_TRANCEVIBRATOR is not set
1056# CONFIG_USB_IOWARRIOR is not set
1057# CONFIG_USB_TEST is not set
1058# CONFIG_USB_ISIGHTFW is not set
1059CONFIG_USB_GADGET=m
1060# CONFIG_USB_GADGET_DEBUG_FILES is not set
1061CONFIG_USB_GADGET_VBUS_DRAW=2
1062CONFIG_USB_GADGET_SELECTED=y
1063CONFIG_USB_GADGET_AT91=y
1064CONFIG_USB_AT91=m
1065# CONFIG_USB_GADGET_ATMEL_USBA is not set
1066# CONFIG_USB_GADGET_FSL_USB2 is not set
1067# CONFIG_USB_GADGET_LH7A40X is not set
1068# CONFIG_USB_GADGET_OMAP is not set
1069# CONFIG_USB_GADGET_PXA25X is not set
1070# CONFIG_USB_GADGET_R8A66597 is not set
1071# CONFIG_USB_GADGET_PXA27X is not set
1072# CONFIG_USB_GADGET_S3C_HSOTG is not set
1073# CONFIG_USB_GADGET_IMX is not set
1074# CONFIG_USB_GADGET_S3C2410 is not set
1075# CONFIG_USB_GADGET_M66592 is not set
1076# CONFIG_USB_GADGET_AMD5536UDC is not set
1077# CONFIG_USB_GADGET_FSL_QE is not set
1078# CONFIG_USB_GADGET_CI13XXX is not set
1079# CONFIG_USB_GADGET_NET2280 is not set
1080# CONFIG_USB_GADGET_GOKU is not set
1081# CONFIG_USB_GADGET_LANGWELL is not set
1082# CONFIG_USB_GADGET_DUMMY_HCD is not set
1083# CONFIG_USB_GADGET_DUALSPEED is not set
1084CONFIG_USB_ZERO=m
1085# CONFIG_USB_AUDIO is not set
1086CONFIG_USB_ETH=m
1087CONFIG_USB_ETH_RNDIS=y
1088# CONFIG_USB_ETH_EEM is not set
1089# CONFIG_USB_GADGETFS is not set
1090CONFIG_USB_FILE_STORAGE=m
1091# CONFIG_USB_FILE_STORAGE_TEST is not set
1092# CONFIG_USB_MASS_STORAGE is not set
1093CONFIG_USB_G_SERIAL=m
1094# CONFIG_USB_MIDI_GADGET is not set
1095# CONFIG_USB_G_PRINTER is not set
1096# CONFIG_USB_CDC_COMPOSITE is not set
1097# CONFIG_USB_G_NOKIA is not set
1098# CONFIG_USB_G_MULTI is not set
1099
1100#
1101# OTG and related infrastructure
1102#
1103# CONFIG_USB_GPIO_VBUS is not set
1104# CONFIG_USB_ULPI is not set
1105# CONFIG_NOP_USB_XCEIV is not set
1106CONFIG_MMC=y
1107# CONFIG_MMC_DEBUG is not set
1108# CONFIG_MMC_UNSAFE_RESUME is not set
1109
1110#
1111# MMC/SD/SDIO Card Drivers
1112#
1113CONFIG_MMC_BLOCK=y
1114CONFIG_MMC_BLOCK_BOUNCE=y
1115# CONFIG_SDIO_UART is not set
1116# CONFIG_MMC_TEST is not set
1117
1118#
1119# MMC/SD/SDIO Host Controller Drivers
1120#
1121# CONFIG_MMC_SDHCI is not set
1122# CONFIG_MMC_AT91 is not set
1123CONFIG_MMC_ATMELMCI=y
1124# CONFIG_MMC_SPI is not set
1125# CONFIG_MEMSTICK is not set
1126CONFIG_NEW_LEDS=y
1127CONFIG_LEDS_CLASS=y
1128
1129#
1130# LED drivers
1131#
1132# CONFIG_LEDS_PCA9532 is not set
1133CONFIG_LEDS_GPIO=y
1134CONFIG_LEDS_GPIO_PLATFORM=y
1135# CONFIG_LEDS_LP3944 is not set
1136# CONFIG_LEDS_PCA955X is not set
1137# CONFIG_LEDS_DAC124S085 is not set
1138# CONFIG_LEDS_BD2802 is not set
1139# CONFIG_LEDS_LT3593 is not set
1140
1141#
1142# LED Triggers
1143#
1144CONFIG_LEDS_TRIGGERS=y
1145CONFIG_LEDS_TRIGGER_TIMER=y
1146CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1147# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1148# CONFIG_LEDS_TRIGGER_GPIO is not set
1149CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1150
1151#
1152# iptables trigger is under Netfilter config (LED target)
1153#
1154# CONFIG_ACCESSIBILITY is not set
1155CONFIG_RTC_LIB=y
1156CONFIG_RTC_CLASS=y
1157CONFIG_RTC_HCTOSYS=y
1158CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1159# CONFIG_RTC_DEBUG is not set
1160
1161#
1162# RTC interfaces
1163#
1164CONFIG_RTC_INTF_SYSFS=y
1165CONFIG_RTC_INTF_PROC=y
1166CONFIG_RTC_INTF_DEV=y
1167# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1168# CONFIG_RTC_DRV_TEST is not set
1169
1170#
1171# I2C RTC drivers
1172#
1173# CONFIG_RTC_DRV_DS1307 is not set
1174# CONFIG_RTC_DRV_DS1374 is not set
1175# CONFIG_RTC_DRV_DS1672 is not set
1176# CONFIG_RTC_DRV_MAX6900 is not set
1177# CONFIG_RTC_DRV_RS5C372 is not set
1178# CONFIG_RTC_DRV_ISL1208 is not set
1179# CONFIG_RTC_DRV_X1205 is not set
1180# CONFIG_RTC_DRV_PCF8563 is not set
1181# CONFIG_RTC_DRV_PCF8583 is not set
1182# CONFIG_RTC_DRV_M41T80 is not set
1183# CONFIG_RTC_DRV_BQ32K is not set
1184# CONFIG_RTC_DRV_S35390A is not set
1185# CONFIG_RTC_DRV_FM3130 is not set
1186# CONFIG_RTC_DRV_RX8581 is not set
1187# CONFIG_RTC_DRV_RX8025 is not set
1188
1189#
1190# SPI RTC drivers
1191#
1192# CONFIG_RTC_DRV_M41T94 is not set
1193# CONFIG_RTC_DRV_DS1305 is not set
1194# CONFIG_RTC_DRV_DS1390 is not set
1195# CONFIG_RTC_DRV_MAX6902 is not set
1196# CONFIG_RTC_DRV_R9701 is not set
1197# CONFIG_RTC_DRV_RS5C348 is not set
1198# CONFIG_RTC_DRV_DS3234 is not set
1199# CONFIG_RTC_DRV_PCF2123 is not set
1200
1201#
1202# Platform RTC drivers
1203#
1204# CONFIG_RTC_DRV_CMOS is not set
1205# CONFIG_RTC_DRV_DS1286 is not set
1206# CONFIG_RTC_DRV_DS1511 is not set
1207# CONFIG_RTC_DRV_DS1553 is not set
1208# CONFIG_RTC_DRV_DS1742 is not set
1209# CONFIG_RTC_DRV_STK17TA8 is not set
1210# CONFIG_RTC_DRV_M48T86 is not set
1211# CONFIG_RTC_DRV_M48T35 is not set
1212# CONFIG_RTC_DRV_M48T59 is not set
1213# CONFIG_RTC_DRV_MSM6242 is not set
1214# CONFIG_RTC_DRV_BQ4802 is not set
1215# CONFIG_RTC_DRV_RP5C01 is not set
1216# CONFIG_RTC_DRV_V3020 is not set
1217
1218#
1219# on-CPU RTC drivers
1220#
1221CONFIG_RTC_DRV_AT91SAM9=y
1222CONFIG_RTC_DRV_AT91SAM9_RTT=0
1223CONFIG_RTC_DRV_AT91SAM9_GPBR=0
1224# CONFIG_DMADEVICES is not set
1225# CONFIG_AUXDISPLAY is not set
1226# CONFIG_UIO is not set
1227
1228#
1229# TI VLYNQ
1230#
1231# CONFIG_STAGING is not set
1232
1233#
1234# File systems
1235#
1236CONFIG_EXT2_FS=y
1237# CONFIG_EXT2_FS_XATTR is not set
1238# CONFIG_EXT2_FS_XIP is not set
1239CONFIG_EXT3_FS=y
1240# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1241CONFIG_EXT3_FS_XATTR=y
1242# CONFIG_EXT3_FS_POSIX_ACL is not set
1243# CONFIG_EXT3_FS_SECURITY is not set
1244# CONFIG_EXT4_FS is not set
1245CONFIG_JBD=y
1246CONFIG_FS_MBCACHE=y
1247# CONFIG_REISERFS_FS is not set
1248# CONFIG_JFS_FS is not set
1249# CONFIG_FS_POSIX_ACL is not set
1250# CONFIG_XFS_FS is not set
1251# CONFIG_OCFS2_FS is not set
1252# CONFIG_BTRFS_FS is not set
1253# CONFIG_NILFS2_FS is not set
1254CONFIG_FILE_LOCKING=y
1255CONFIG_FSNOTIFY=y
1256CONFIG_DNOTIFY=y
1257CONFIG_INOTIFY=y
1258CONFIG_INOTIFY_USER=y
1259# CONFIG_QUOTA is not set
1260# CONFIG_AUTOFS_FS is not set
1261# CONFIG_AUTOFS4_FS is not set
1262# CONFIG_FUSE_FS is not set
1263
1264#
1265# Caches
1266#
1267# CONFIG_FSCACHE is not set
1268
1269#
1270# CD-ROM/DVD Filesystems
1271#
1272# CONFIG_ISO9660_FS is not set
1273# CONFIG_UDF_FS is not set
1274
1275#
1276# DOS/FAT/NT Filesystems
1277#
1278CONFIG_FAT_FS=y
1279# CONFIG_MSDOS_FS is not set
1280CONFIG_VFAT_FS=y
1281CONFIG_FAT_DEFAULT_CODEPAGE=437
1282CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1283# CONFIG_NTFS_FS is not set
1284
1285#
1286# Pseudo filesystems
1287#
1288CONFIG_PROC_FS=y
1289CONFIG_PROC_SYSCTL=y
1290CONFIG_PROC_PAGE_MONITOR=y
1291CONFIG_SYSFS=y
1292CONFIG_TMPFS=y
1293# CONFIG_TMPFS_POSIX_ACL is not set
1294# CONFIG_HUGETLB_PAGE is not set
1295# CONFIG_CONFIGFS_FS is not set
1296CONFIG_MISC_FILESYSTEMS=y
1297# CONFIG_ADFS_FS is not set
1298# CONFIG_AFFS_FS is not set
1299# CONFIG_HFS_FS is not set
1300# CONFIG_HFSPLUS_FS is not set
1301# CONFIG_BEFS_FS is not set
1302# CONFIG_BFS_FS is not set
1303# CONFIG_EFS_FS is not set
1304CONFIG_JFFS2_FS=y
1305CONFIG_JFFS2_FS_DEBUG=0
1306CONFIG_JFFS2_FS_WRITEBUFFER=y
1307# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1308CONFIG_JFFS2_SUMMARY=y
1309# CONFIG_JFFS2_FS_XATTR is not set
1310# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1311CONFIG_JFFS2_ZLIB=y
1312# CONFIG_JFFS2_LZO is not set
1313CONFIG_JFFS2_RTIME=y
1314# CONFIG_JFFS2_RUBIN is not set
1315# CONFIG_LOGFS is not set
1316# CONFIG_CRAMFS is not set
1317# CONFIG_SQUASHFS is not set
1318# CONFIG_VXFS_FS is not set
1319# CONFIG_MINIX_FS is not set
1320# CONFIG_OMFS_FS is not set
1321# CONFIG_HPFS_FS is not set
1322# CONFIG_QNX4FS_FS is not set
1323# CONFIG_ROMFS_FS is not set
1324# CONFIG_SYSV_FS is not set
1325# CONFIG_UFS_FS is not set
1326CONFIG_NETWORK_FILESYSTEMS=y
1327CONFIG_NFS_FS=y
1328CONFIG_NFS_V3=y
1329# CONFIG_NFS_V3_ACL is not set
1330# CONFIG_NFS_V4 is not set
1331# CONFIG_NFSD is not set
1332CONFIG_LOCKD=y
1333CONFIG_LOCKD_V4=y
1334CONFIG_NFS_COMMON=y
1335CONFIG_SUNRPC=y
1336# CONFIG_RPCSEC_GSS_KRB5 is not set
1337# CONFIG_RPCSEC_GSS_SPKM3 is not set
1338# CONFIG_SMB_FS is not set
1339# CONFIG_CIFS is not set
1340# CONFIG_NCP_FS is not set
1341# CONFIG_CODA_FS is not set
1342# CONFIG_AFS_FS is not set
1343
1344#
1345# Partition Types
1346#
1347# CONFIG_PARTITION_ADVANCED is not set
1348CONFIG_MSDOS_PARTITION=y
1349CONFIG_NLS=y
1350CONFIG_NLS_DEFAULT="iso8859-1"
1351CONFIG_NLS_CODEPAGE_437=y
1352# CONFIG_NLS_CODEPAGE_737 is not set
1353# CONFIG_NLS_CODEPAGE_775 is not set
1354CONFIG_NLS_CODEPAGE_850=y
1355# CONFIG_NLS_CODEPAGE_852 is not set
1356# CONFIG_NLS_CODEPAGE_855 is not set
1357# CONFIG_NLS_CODEPAGE_857 is not set
1358# CONFIG_NLS_CODEPAGE_860 is not set
1359# CONFIG_NLS_CODEPAGE_861 is not set
1360# CONFIG_NLS_CODEPAGE_862 is not set
1361# CONFIG_NLS_CODEPAGE_863 is not set
1362# CONFIG_NLS_CODEPAGE_864 is not set
1363# CONFIG_NLS_CODEPAGE_865 is not set
1364# CONFIG_NLS_CODEPAGE_866 is not set
1365# CONFIG_NLS_CODEPAGE_869 is not set
1366# CONFIG_NLS_CODEPAGE_936 is not set
1367# CONFIG_NLS_CODEPAGE_950 is not set
1368# CONFIG_NLS_CODEPAGE_932 is not set
1369# CONFIG_NLS_CODEPAGE_949 is not set
1370# CONFIG_NLS_CODEPAGE_874 is not set
1371# CONFIG_NLS_ISO8859_8 is not set
1372# CONFIG_NLS_CODEPAGE_1250 is not set
1373# CONFIG_NLS_CODEPAGE_1251 is not set
1374# CONFIG_NLS_ASCII is not set
1375CONFIG_NLS_ISO8859_1=y
1376# CONFIG_NLS_ISO8859_2 is not set
1377# CONFIG_NLS_ISO8859_3 is not set
1378# CONFIG_NLS_ISO8859_4 is not set
1379# CONFIG_NLS_ISO8859_5 is not set
1380# CONFIG_NLS_ISO8859_6 is not set
1381# CONFIG_NLS_ISO8859_7 is not set
1382# CONFIG_NLS_ISO8859_9 is not set
1383# CONFIG_NLS_ISO8859_13 is not set
1384# CONFIG_NLS_ISO8859_14 is not set
1385CONFIG_NLS_ISO8859_15=y
1386# CONFIG_NLS_KOI8_R is not set
1387# CONFIG_NLS_KOI8_U is not set
1388CONFIG_NLS_UTF8=y
1389# CONFIG_DLM is not set
1390
1391#
1392# Kernel hacking
1393#
1394# CONFIG_PRINTK_TIME is not set
1395CONFIG_ENABLE_WARN_DEPRECATED=y
1396CONFIG_ENABLE_MUST_CHECK=y
1397CONFIG_FRAME_WARN=1024
1398# CONFIG_MAGIC_SYSRQ is not set
1399# CONFIG_STRIP_ASM_SYMS is not set
1400# CONFIG_UNUSED_SYMBOLS is not set
1401# CONFIG_DEBUG_FS is not set
1402# CONFIG_HEADERS_CHECK is not set
1403# CONFIG_DEBUG_KERNEL is not set
1404CONFIG_DEBUG_BUGVERBOSE=y
1405CONFIG_DEBUG_MEMORY_INIT=y
1406CONFIG_FRAME_POINTER=y
1407# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1408# CONFIG_LATENCYTOP is not set
1409# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1410CONFIG_HAVE_FUNCTION_TRACER=y
1411CONFIG_TRACING_SUPPORT=y
1412# CONFIG_FTRACE is not set
1413# CONFIG_SAMPLES is not set
1414CONFIG_HAVE_ARCH_KGDB=y
1415# CONFIG_ARM_UNWIND is not set
1416# CONFIG_DEBUG_USER is not set
1417# CONFIG_OC_ETM is not set
1418
1419#
1420# Security options
1421#
1422# CONFIG_KEYS is not set
1423# CONFIG_SECURITY is not set
1424# CONFIG_SECURITYFS is not set
1425# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1426# CONFIG_DEFAULT_SECURITY_SMACK is not set
1427# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1428CONFIG_DEFAULT_SECURITY_DAC=y
1429CONFIG_DEFAULT_SECURITY=""
1430# CONFIG_CRYPTO is not set
1431# CONFIG_BINARY_PRINTF is not set
1432
1433#
1434# Library routines
1435#
1436CONFIG_BITREVERSE=y
1437CONFIG_GENERIC_FIND_LAST_BIT=y
1438# CONFIG_CRC_CCITT is not set
1439# CONFIG_CRC16 is not set
1440# CONFIG_CRC_T10DIF is not set
1441# CONFIG_CRC_ITU_T is not set
1442CONFIG_CRC32=y
1443# CONFIG_CRC7 is not set
1444# CONFIG_LIBCRC32C is not set
1445CONFIG_ZLIB_INFLATE=y
1446CONFIG_ZLIB_DEFLATE=y
1447CONFIG_LZO_DECOMPRESS=y
1448CONFIG_DECOMPRESS_GZIP=y
1449CONFIG_DECOMPRESS_BZIP2=y
1450CONFIG_DECOMPRESS_LZMA=y
1451CONFIG_DECOMPRESS_LZO=y
1452CONFIG_HAS_IOMEM=y
1453CONFIG_HAS_IOPORT=y
1454CONFIG_HAS_DMA=y
1455CONFIG_NLATTR=y
1456CONFIG_GENERIC_ATOMIC64=y
diff --git a/arch/arm/include/asm/hardware/arm_timer.h b/arch/arm/include/asm/hardware/arm_timer.h
index 04be3bdf46b8..c0f4e7bf22de 100644
--- a/arch/arm/include/asm/hardware/arm_timer.h
+++ b/arch/arm/include/asm/hardware/arm_timer.h
@@ -1,21 +1,30 @@
1#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H 1#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
2#define __ASM_ARM_HARDWARE_ARM_TIMER_H 2#define __ASM_ARM_HARDWARE_ARM_TIMER_H
3 3
4#define TIMER_LOAD 0x00 4/*
5#define TIMER_VALUE 0x04 5 * ARM timer implementation, found in Integrator, Versatile and Realview
6#define TIMER_CTRL 0x08 6 * platforms. Not all platforms support all registers and bits in these
7#define TIMER_CTRL_ONESHOT (1 << 0) 7 * registers, so we mark them with A for Integrator AP, C for Integrator
8#define TIMER_CTRL_32BIT (1 << 1) 8 * CP, V for Versatile and R for Realview.
9#define TIMER_CTRL_DIV1 (0 << 2) 9 *
10#define TIMER_CTRL_DIV16 (1 << 2) 10 * Integrator AP has 16-bit timers, Integrator CP, Versatile and Realview
11#define TIMER_CTRL_DIV256 (2 << 2) 11 * can have 16-bit or 32-bit selectable via a bit in the control register.
12#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */ 12 */
13#define TIMER_CTRL_PERIODIC (1 << 6) 13#define TIMER_LOAD 0x00 /* ACVR rw */
14#define TIMER_CTRL_ENABLE (1 << 7) 14#define TIMER_VALUE 0x04 /* ACVR ro */
15#define TIMER_CTRL 0x08 /* ACVR rw */
16#define TIMER_CTRL_ONESHOT (1 << 0) /* CVR */
17#define TIMER_CTRL_32BIT (1 << 1) /* CVR */
18#define TIMER_CTRL_DIV1 (0 << 2) /* ACVR */
19#define TIMER_CTRL_DIV16 (1 << 2) /* ACVR */
20#define TIMER_CTRL_DIV256 (2 << 2) /* ACVR */
21#define TIMER_CTRL_IE (1 << 5) /* VR */
22#define TIMER_CTRL_PERIODIC (1 << 6) /* ACVR */
23#define TIMER_CTRL_ENABLE (1 << 7) /* ACVR */
15 24
16#define TIMER_INTCLR 0x0c 25#define TIMER_INTCLR 0x0c /* ACVR wo */
17#define TIMER_RIS 0x10 26#define TIMER_RIS 0x10 /* CVR ro */
18#define TIMER_MIS 0x14 27#define TIMER_MIS 0x14 /* CVR ro */
19#define TIMER_BGLOAD 0x18 28#define TIMER_BGLOAD 0x18 /* CVR rw */
20 29
21#endif 30#endif
diff --git a/arch/arm/include/asm/hardware/icst.h b/arch/arm/include/asm/hardware/icst.h
new file mode 100644
index 000000000000..10382a3dcec9
--- /dev/null
+++ b/arch/arm/include/asm/hardware/icst.h
@@ -0,0 +1,59 @@
1/*
2 * arch/arm/include/asm/hardware/icst.h
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 */
14#ifndef ASMARM_HARDWARE_ICST_H
15#define ASMARM_HARDWARE_ICST_H
16
17struct icst_params {
18 unsigned long ref;
19 unsigned long vco_max; /* inclusive */
20 unsigned long vco_min; /* exclusive */
21 unsigned short vd_min; /* inclusive */
22 unsigned short vd_max; /* inclusive */
23 unsigned char rd_min; /* inclusive */
24 unsigned char rd_max; /* inclusive */
25 const unsigned char *s2div; /* chip specific s2div array */
26 const unsigned char *idx2s; /* chip specific idx2s array */
27};
28
29struct icst_vco {
30 unsigned short v;
31 unsigned char r;
32 unsigned char s;
33};
34
35unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco);
36struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq);
37
38/*
39 * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V).
40 * This frequency is pre-output divider.
41 */
42#define ICST307_VCO_MIN 6000000
43#define ICST307_VCO_MAX 200000000
44
45extern const unsigned char icst307_s2div[];
46extern const unsigned char icst307_idx2s[];
47
48/*
49 * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V).
50 * This frequency is pre-output divider.
51 */
52#define ICST525_VCO_MIN 10000000
53#define ICST525_VCO_MAX_3V 200000000
54#define ICST525_VCO_MAX_5V 320000000
55
56extern const unsigned char icst525_s2div[];
57extern const unsigned char icst525_idx2s[];
58
59#endif
diff --git a/arch/arm/include/asm/hardware/icst307.h b/arch/arm/include/asm/hardware/icst307.h
deleted file mode 100644
index 554f128a1046..000000000000
--- a/arch/arm/include/asm/hardware/icst307.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/icst307.h
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICS307
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 *
14 * This file is similar to the icst525.h file
15 */
16#ifndef ASMARM_HARDWARE_ICST307_H
17#define ASMARM_HARDWARE_ICST307_H
18
19struct icst307_params {
20 unsigned long ref;
21 unsigned long vco_max; /* inclusive */
22 unsigned short vd_min; /* inclusive */
23 unsigned short vd_max; /* inclusive */
24 unsigned char rd_min; /* inclusive */
25 unsigned char rd_max; /* inclusive */
26};
27
28struct icst307_vco {
29 unsigned short v;
30 unsigned char r;
31 unsigned char s;
32};
33
34unsigned long icst307_khz(const struct icst307_params *p, struct icst307_vco vco);
35struct icst307_vco icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq);
36struct icst307_vco icst307_ps_to_vco(const struct icst307_params *p, unsigned long period);
37
38#endif
diff --git a/arch/arm/include/asm/hardware/icst525.h b/arch/arm/include/asm/hardware/icst525.h
deleted file mode 100644
index 58f0dc43e2ed..000000000000
--- a/arch/arm/include/asm/hardware/icst525.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/icst525.h
3 *
4 * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Support functions for calculating clocks/divisors for the ICST525
11 * clock generators. See http://www.icst.com/ for more information
12 * on these devices.
13 */
14#ifndef ASMARM_HARDWARE_ICST525_H
15#define ASMARM_HARDWARE_ICST525_H
16
17struct icst525_params {
18 unsigned long ref;
19 unsigned long vco_max; /* inclusive */
20 unsigned short vd_min; /* inclusive */
21 unsigned short vd_max; /* inclusive */
22 unsigned char rd_min; /* inclusive */
23 unsigned char rd_max; /* inclusive */
24};
25
26struct icst525_vco {
27 unsigned short v;
28 unsigned char r;
29 unsigned char s;
30};
31
32unsigned long icst525_khz(const struct icst525_params *p, struct icst525_vco vco);
33struct icst525_vco icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq);
34struct icst525_vco icst525_ps_to_vco(const struct icst525_params *p, unsigned long period);
35
36#endif
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h
new file mode 100644
index 000000000000..a101f10bb5b1
--- /dev/null
+++ b/arch/arm/include/asm/hardware/sp810.h
@@ -0,0 +1,59 @@
1/*
2 * arch/arm/include/asm/hardware/sp810.h
3 *
4 * ARM PrimeXsys System Controller SP810 header file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __ASM_ARM_SP810_H
15#define __ASM_ARM_SP810_H
16
17#include <linux/io.h>
18
19/* sysctl registers offset */
20#define SCCTRL 0x000
21#define SCSYSSTAT 0x004
22#define SCIMCTRL 0x008
23#define SCIMSTAT 0x00C
24#define SCXTALCTRL 0x010
25#define SCPLLCTRL 0x014
26#define SCPLLFCTRL 0x018
27#define SCPERCTRL0 0x01C
28#define SCPERCTRL1 0x020
29#define SCPEREN 0x024
30#define SCPERDIS 0x028
31#define SCPERCLKEN 0x02C
32#define SCPERSTAT 0x030
33#define SCSYSID0 0xEE0
34#define SCSYSID1 0xEE4
35#define SCSYSID2 0xEE8
36#define SCSYSID3 0xEEC
37#define SCITCR 0xF00
38#define SCITIR0 0xF04
39#define SCITIR1 0xF08
40#define SCITOR 0xF0C
41#define SCCNTCTRL 0xF10
42#define SCCNTDATA 0xF14
43#define SCCNTSTEP 0xF18
44#define SCPERIPHID0 0xFE0
45#define SCPERIPHID1 0xFE4
46#define SCPERIPHID2 0xFE8
47#define SCPERIPHID3 0xFEC
48#define SCPCELLID0 0xFF0
49#define SCPCELLID1 0xFF4
50#define SCPCELLID2 0xFF8
51#define SCPCELLID3 0xFFC
52
53static inline void sysctl_soft_reset(void __iomem *base)
54{
55 /* writing any value to SCSYSSTAT reg will reset system */
56 writel(0, base + SCSYSSTAT);
57}
58
59#endif /* __ASM_ARM_SP810_H */
diff --git a/arch/arm/include/asm/ioctls.h b/arch/arm/include/asm/ioctls.h
index a91d8a1523cf..7f0b6d13296a 100644
--- a/arch/arm/include/asm/ioctls.h
+++ b/arch/arm/include/asm/ioctls.h
@@ -53,6 +53,9 @@
53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 53#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 54#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
55 55
56#define TIOCGRS485 0x542E
57#define TIOCSRS485 0x542F
58
56#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ 59#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
57#define FIOCLEX 0x5451 60#define FIOCLEX 0x5451
58#define FIOASYNC 0x5452 61#define FIOASYNC 0x5452
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 2829b9f981a1..44bec1f02cb0 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -12,6 +12,11 @@
12#ifndef __ARM_PMU_H__ 12#ifndef __ARM_PMU_H__
13#define __ARM_PMU_H__ 13#define __ARM_PMU_H__
14 14
15enum arm_pmu_type {
16 ARM_PMU_DEVICE_CPU = 0,
17 ARM_NUM_PMU_DEVICES,
18};
19
15#ifdef CONFIG_CPU_HAS_PMU 20#ifdef CONFIG_CPU_HAS_PMU
16 21
17struct pmu_irqs { 22struct pmu_irqs {
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 8a5e8e9fe448..103976411a67 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -361,6 +361,19 @@ config MACH_CPU9G20
361 Select this if you are using a Eukrea Electromatique's 361 Select this if you are using a Eukrea Electromatique's
362 CPU9G20 Board <http://www.eukrea.com/> 362 CPU9G20 Board <http://www.eukrea.com/>
363 363
364config MACH_PORTUXG20
365 bool "taskit PortuxG20"
366 help
367 Select this if you are using taskit's PortuxG20.
368 <http://www.taskit.de/en/>
369
370config MACH_STAMP9G20
371 bool "taskit Stamp9G20 CPU module"
372 help
373 Select this if you are using taskit's Stamp9G20 CPU module on its
374 evaluation board.
375 <http://www.taskit.de/en/>
376
364endif 377endif
365 378
366# ---------------------------------------------------------- 379# ----------------------------------------------------------
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 027dd570dcc3..1df9ee1ba040 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -63,6 +63,8 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o
63obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o 63obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o
64obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o 64obj-$(CONFIG_MACH_AT91SAM9G20EK_2MMC) += board-sam9g20ek-2slot-mmc.o
65obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o 65obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o
66obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o
67obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o
66 68
67# AT91SAM9G45 board-specific support 69# AT91SAM9G45 board-specific support
68obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o 70obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
new file mode 100644
index 000000000000..87958274290f
--- /dev/null
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -0,0 +1,315 @@
1/*
2 * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de>
3 * taskit GmbH
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <linux/mm.h>
21#include <linux/platform_device.h>
22#include <linux/gpio.h>
23#include <linux/w1-gpio.h>
24
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28#include <mach/board.h>
29#include <mach/at91sam9_smc.h>
30
31#include "sam9_smc.h"
32#include "generic.h"
33
34
35static void __init portuxg20_map_io(void)
36{
37 /* Initialize processor: 18.432 MHz crystal */
38 at91sam9260_initialize(18432000);
39
40 /* DGBU on ttyS0. (Rx & Tx only) */
41 at91_register_uart(0, 0, 0);
42
43 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
44 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
45 | ATMEL_UART_DTR | ATMEL_UART_DSR
46 | ATMEL_UART_DCD | ATMEL_UART_RI);
47
48 /* USART1 on ttyS2. (Rx, Tx, CTS, RTS) */
49 at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
50
51 /* USART2 on ttyS3. (Rx, Tx, CTS, RTS) */
52 at91_register_uart(AT91SAM9260_ID_US2, 3, ATMEL_UART_CTS | ATMEL_UART_RTS);
53
54 /* USART4 on ttyS5. (Rx, Tx only) */
55 at91_register_uart(AT91SAM9260_ID_US4, 5, 0);
56
57 /* USART5 on ttyS6. (Rx, Tx only) */
58 at91_register_uart(AT91SAM9260_ID_US5, 6, 0);
59
60 /* set serial console to ttyS0 (ie, DBGU) */
61 at91_set_serial_console(0);
62}
63
64static void __init stamp9g20_map_io(void)
65{
66 /* Initialize processor: 18.432 MHz crystal */
67 at91sam9260_initialize(18432000);
68
69 /* DGBU on ttyS0. (Rx & Tx only) */
70 at91_register_uart(0, 0, 0);
71
72 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
73 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
74 | ATMEL_UART_DTR | ATMEL_UART_DSR
75 | ATMEL_UART_DCD | ATMEL_UART_RI);
76
77 /* set serial console to ttyS0 (ie, DBGU) */
78 at91_set_serial_console(0);
79}
80
81static void __init init_irq(void)
82{
83 at91sam9260_init_interrupts(NULL);
84}
85
86
87/*
88 * NAND flash
89 */
90static struct atmel_nand_data __initdata nand_data = {
91 .ale = 21,
92 .cle = 22,
93 .rdy_pin = AT91_PIN_PC13,
94 .enable_pin = AT91_PIN_PC14,
95 .bus_width_16 = 0,
96};
97
98static struct sam9_smc_config __initdata nand_smc_config = {
99 .ncs_read_setup = 0,
100 .nrd_setup = 2,
101 .ncs_write_setup = 0,
102 .nwe_setup = 2,
103
104 .ncs_read_pulse = 4,
105 .nrd_pulse = 4,
106 .ncs_write_pulse = 4,
107 .nwe_pulse = 4,
108
109 .read_cycle = 7,
110 .write_cycle = 7,
111
112 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
113 .tdf_cycles = 3,
114};
115
116static void __init add_device_nand(void)
117{
118 /* configure chip-select 3 (NAND) */
119 sam9_smc_configure(3, &nand_smc_config);
120
121 at91_add_device_nand(&nand_data);
122}
123
124
125/*
126 * MCI (SD/MMC)
127 * det_pin, wp_pin and vcc_pin are not connected
128 */
129#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
130static struct mci_platform_data __initdata mmc_data = {
131 .slot[0] = {
132 .bus_width = 4,
133 },
134};
135#else
136static struct at91_mmc_data __initdata mmc_data = {
137 .slot_b = 0,
138 .wire4 = 1,
139};
140#endif
141
142
143/*
144 * USB Host port
145 */
146static struct at91_usbh_data __initdata usbh_data = {
147 .ports = 2,
148};
149
150
151/*
152 * USB Device port
153 */
154static struct at91_udc_data __initdata portuxg20_udc_data = {
155 .vbus_pin = AT91_PIN_PC7,
156 .pullup_pin = 0, /* pull-up driven by UDC */
157};
158
159static struct at91_udc_data __initdata stamp9g20_udc_data = {
160 .vbus_pin = AT91_PIN_PA22,
161 .pullup_pin = 0, /* pull-up driven by UDC */
162};
163
164
165/*
166 * MACB Ethernet device
167 */
168static struct at91_eth_data __initdata macb_data = {
169 .phy_irq_pin = AT91_PIN_PA28,
170 .is_rmii = 1,
171};
172
173
174/*
175 * LEDs
176 */
177static struct gpio_led portuxg20_leds[] = {
178 {
179 .name = "LED2",
180 .gpio = AT91_PIN_PC5,
181 .default_trigger = "none",
182 }, {
183 .name = "LED3",
184 .gpio = AT91_PIN_PC4,
185 .default_trigger = "none",
186 }, {
187 .name = "LED4",
188 .gpio = AT91_PIN_PC10,
189 .default_trigger = "heartbeat",
190 }
191};
192
193static struct gpio_led stamp9g20_leds[] = {
194 {
195 .name = "D8",
196 .gpio = AT91_PIN_PB18,
197 .active_low = 1,
198 .default_trigger = "none",
199 }, {
200 .name = "D9",
201 .gpio = AT91_PIN_PB19,
202 .active_low = 1,
203 .default_trigger = "none",
204 }, {
205 .name = "D10",
206 .gpio = AT91_PIN_PB20,
207 .active_low = 1,
208 .default_trigger = "heartbeat",
209 }
210};
211
212
213/*
214 * SPI devices
215 */
216static struct spi_board_info portuxg20_spi_devices[] = {
217 {
218 .modalias = "spidev",
219 .chip_select = 0,
220 .max_speed_hz = 1 * 1000 * 1000,
221 .bus_num = 0,
222 }, {
223 .modalias = "spidev",
224 .chip_select = 0,
225 .max_speed_hz = 1 * 1000 * 1000,
226 .bus_num = 1,
227 },
228};
229
230
231/*
232 * Dallas 1-Wire
233 */
234static struct w1_gpio_platform_data w1_gpio_pdata = {
235 .pin = AT91_PIN_PA29,
236 .is_open_drain = 1,
237};
238
239static struct platform_device w1_device = {
240 .name = "w1-gpio",
241 .id = -1,
242 .dev.platform_data = &w1_gpio_pdata,
243};
244
245void add_w1(void)
246{
247 at91_set_GPIO_periph(w1_gpio_pdata.pin, 1);
248 at91_set_multi_drive(w1_gpio_pdata.pin, 1);
249 platform_device_register(&w1_device);
250}
251
252
253static void __init generic_board_init(void)
254{
255 /* Serial */
256 at91_add_device_serial();
257 /* NAND */
258 add_device_nand();
259 /* MMC */
260#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
261 at91_add_device_mci(0, &mmc_data);
262#else
263 at91_add_device_mmc(0, &mmc_data);
264#endif
265 /* USB Host */
266 at91_add_device_usbh(&usbh_data);
267 /* Ethernet */
268 at91_add_device_eth(&macb_data);
269 /* I2C */
270 at91_add_device_i2c(NULL, 0);
271 /* W1 */
272 add_w1();
273}
274
275static void __init portuxg20_board_init(void)
276{
277 generic_board_init();
278 /* SPI */
279 at91_add_device_spi(portuxg20_spi_devices, ARRAY_SIZE(portuxg20_spi_devices));
280 /* USB Device */
281 at91_add_device_udc(&portuxg20_udc_data);
282 /* LEDs */
283 at91_gpio_leds(portuxg20_leds, ARRAY_SIZE(portuxg20_leds));
284}
285
286static void __init stamp9g20_board_init(void)
287{
288 generic_board_init();
289 /* USB Device */
290 at91_add_device_udc(&stamp9g20_udc_data);
291 /* LEDs */
292 at91_gpio_leds(stamp9g20_leds, ARRAY_SIZE(stamp9g20_leds));
293}
294
295MACHINE_START(PORTUXG20, "taskit PortuxG20")
296 /* Maintainer: taskit GmbH */
297 .phys_io = AT91_BASE_SYS,
298 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
299 .boot_params = AT91_SDRAM_BASE + 0x100,
300 .timer = &at91sam926x_timer,
301 .map_io = portuxg20_map_io,
302 .init_irq = init_irq,
303 .init_machine = portuxg20_board_init,
304MACHINE_END
305
306MACHINE_START(STAMP9G20, "taskit Stamp9G20")
307 /* Maintainer: taskit GmbH */
308 .phys_io = AT91_BASE_SYS,
309 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
310 .boot_params = AT91_SDRAM_BASE + 0x100,
311 .timer = &at91sam926x_timer,
312 .map_io = stamp9g20_map_io,
313 .init_irq = init_irq,
314 .init_machine = stamp9g20_board_init,
315MACHINE_END
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index ceaec6c16eb2..df2ed848c9f8 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -39,6 +39,7 @@
39#include <linux/usb/atmel_usba_udc.h> 39#include <linux/usb/atmel_usba_udc.h>
40#include <linux/atmel-mci.h> 40#include <linux/atmel-mci.h>
41#include <sound/atmel-ac97c.h> 41#include <sound/atmel-ac97c.h>
42#include <linux/serial.h>
42 43
43 /* USB Device */ 44 /* USB Device */
44struct at91_udc_data { 45struct at91_udc_data {
@@ -143,9 +144,10 @@ extern struct platform_device *atmel_default_console_device;
143extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); 144extern void __init __deprecated at91_init_serial(struct at91_uart_config *config);
144 145
145struct atmel_uart_data { 146struct atmel_uart_data {
146 short use_dma_tx; /* use transmit DMA? */ 147 short use_dma_tx; /* use transmit DMA? */
147 short use_dma_rx; /* use receive DMA? */ 148 short use_dma_rx; /* use receive DMA? */
148 void __iomem *regs; /* virtual base address, if any */ 149 void __iomem *regs; /* virt. base address, if any */
150 struct serial_rs485 rs485; /* rs485 settings */
149}; 151};
150extern void __init at91_add_device_serial(void); 152extern void __init at91_add_device_serial(void);
151 153
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 5a0650101d45..833659d1200a 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -21,7 +21,7 @@
21#define ARCH_ID_AT91SAM9260 0x019803a0 21#define ARCH_ID_AT91SAM9260 0x019803a0
22#define ARCH_ID_AT91SAM9261 0x019703a0 22#define ARCH_ID_AT91SAM9261 0x019703a0
23#define ARCH_ID_AT91SAM9263 0x019607a0 23#define ARCH_ID_AT91SAM9263 0x019607a0
24#define ARCH_ID_AT91SAM9G10 0x819903a0 24#define ARCH_ID_AT91SAM9G10 0x019903a0
25#define ARCH_ID_AT91SAM9G20 0x019905a0 25#define ARCH_ID_AT91SAM9G20 0x019905a0
26#define ARCH_ID_AT91SAM9RL64 0x019b03a0 26#define ARCH_ID_AT91SAM9RL64 0x019b03a0
27#define ARCH_ID_AT91SAM9G45 0x819b05a0 27#define ARCH_ID_AT91SAM9G45 0x819b05a0
@@ -108,7 +108,7 @@ static inline unsigned long at91cap9_rev_identify(void)
108#endif 108#endif
109 109
110#ifdef CONFIG_ARCH_AT91SAM9G10 110#ifdef CONFIG_ARCH_AT91SAM9G10
111#define cpu_is_at91sam9g10() (at91_cpu_identify() == ARCH_ID_AT91SAM9G10) 111#define cpu_is_at91sam9g10() ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10)
112#else 112#else
113#define cpu_is_at91sam9g10() (0) 113#define cpu_is_at91sam9g10() (0)
114#endif 114#endif
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h
index 5268af3933c2..c80e090b3670 100644
--- a/arch/arm/mach-at91/include/mach/system.h
+++ b/arch/arm/mach-at91/include/mach/system.h
@@ -24,21 +24,24 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/at91_st.h> 25#include <mach/at91_st.h>
26#include <mach/at91_dbgu.h> 26#include <mach/at91_dbgu.h>
27#include <mach/at91_pmc.h>
27 28
28static inline void arch_idle(void) 29static inline void arch_idle(void)
29{ 30{
31#ifndef CONFIG_DEBUG_KERNEL
30 /* 32 /*
31 * Disable the processor clock. The processor will be automatically 33 * Disable the processor clock. The processor will be automatically
32 * re-enabled by an interrupt or by a reset. 34 * re-enabled by an interrupt or by a reset.
33 */ 35 */
34// at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK); 36 at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
35 37#else
36 /* 38 /*
37 * Set the processor (CP15) into 'Wait for Interrupt' mode. 39 * Set the processor (CP15) into 'Wait for Interrupt' mode.
38 * Unlike disabling the processor clock via the PMC (above) 40 * Unlike disabling the processor clock via the PMC (above)
39 * this allows the processor to be woken via JTAG. 41 * this allows the processor to be woken via JTAG.
40 */ 42 */
41 cpu_do_idle(); 43 cpu_do_idle();
44#endif
42} 45}
43 46
44void (*at91_arch_reset)(void); 47void (*at91_arch_reset)(void);
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index 53dd2a9eecf9..2f139196d63d 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -29,6 +29,7 @@
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32#include <asm/pmu.h>
32 33
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <mach/dma.h> 35#include <mach/dma.h>
@@ -85,8 +86,23 @@ static struct platform_device nand_device = {
85 .num_resources = ARRAY_SIZE(nand_resource), 86 .num_resources = ARRAY_SIZE(nand_resource),
86}; 87};
87 88
89static struct resource pmu_resource = {
90 .start = IRQ_PMUIRQ,
91 .end = IRQ_PMUIRQ,
92 .flags = IORESOURCE_IRQ,
93};
94
95static struct platform_device pmu_device = {
96 .name = "arm-pmu",
97 .id = ARM_PMU_DEVICE_CPU,
98 .resource = &pmu_resource,
99 .num_resources = 1,
100};
101
102
88static struct platform_device *devices[] __initdata = { 103static struct platform_device *devices[] __initdata = {
89 &nand_device, 104 &nand_device,
105 &pmu_device,
90}; 106};
91 107
92/**************************************************************************** 108/****************************************************************************
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index caf6d5154aec..3a1a855bfdca 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -41,7 +41,7 @@ static struct platform_device adssphere_flash = {
41 .resource = &adssphere_flash_resource, 41 .resource = &adssphere_flash_resource,
42}; 42};
43 43
44static struct ep93xx_eth_data adssphere_eth_data = { 44static struct ep93xx_eth_data __initdata adssphere_eth_data = {
45 .phy_id = 1, 45 .phy_id = 1,
46}; 46};
47 47
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index 5f80092b6ace..e29bdef9b2e2 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -96,6 +96,10 @@ static struct clk clk_keypad = {
96 .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN, 96 .enable_mask = EP93XX_SYSCON_KEYTCHCLKDIV_KEN,
97 .set_rate = set_keytchclk_rate, 97 .set_rate = set_keytchclk_rate,
98}; 98};
99static struct clk clk_spi = {
100 .parent = &clk_xtali,
101 .rate = EP93XX_EXT_CLK_RATE,
102};
99static struct clk clk_pwm = { 103static struct clk clk_pwm = {
100 .parent = &clk_xtali, 104 .parent = &clk_xtali,
101 .rate = EP93XX_EXT_CLK_RATE, 105 .rate = EP93XX_EXT_CLK_RATE,
@@ -186,6 +190,7 @@ static struct clk_lookup clocks[] = {
186 INIT_CK("ep93xx-ohci", NULL, &clk_usb_host), 190 INIT_CK("ep93xx-ohci", NULL, &clk_usb_host),
187 INIT_CK("ep93xx-keypad", NULL, &clk_keypad), 191 INIT_CK("ep93xx-keypad", NULL, &clk_keypad),
188 INIT_CK("ep93xx-fb", NULL, &clk_video), 192 INIT_CK("ep93xx-fb", NULL, &clk_video),
193 INIT_CK("ep93xx-spi.0", NULL, &clk_spi),
189 INIT_CK(NULL, "pwm_clk", &clk_pwm), 194 INIT_CK(NULL, "pwm_clk", &clk_pwm),
190 INIT_CK(NULL, "m2p0", &clk_m2p0), 195 INIT_CK(NULL, "m2p0", &clk_m2p0),
191 INIT_CK(NULL, "m2p1", &clk_m2p1), 196 INIT_CK(NULL, "m2p1", &clk_m2p1),
@@ -473,6 +478,14 @@ static int __init ep93xx_clock_init(void)
473 /* Initialize the pll2 derived clocks */ 478 /* Initialize the pll2 derived clocks */
474 clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1); 479 clk_usb_host.rate = clk_pll2.rate / (((value >> 28) & 0xf) + 1);
475 480
481 /*
482 * EP93xx SSP clock rate was doubled in version E2. For more information
483 * see:
484 * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf
485 */
486 if (ep93xx_chip_revision() < EP93XX_CHIP_REV_E2)
487 clk_spi.rate /= 2;
488
476 pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n", 489 pr_info("PLL1 running at %ld MHz, PLL2 at %ld MHz\n",
477 clk_pll1.rate / 1000000, clk_pll2.rate / 1000000); 490 clk_pll1.rate / 1000000, clk_pll2.rate / 1000000);
478 pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n", 491 pr_info("FCLK %ld MHz, HCLK %ld MHz, PCLK %ld MHz\n",
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 90fb591cbffa..9092677f63eb 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -31,10 +31,12 @@
31#include <linux/amba/serial.h> 31#include <linux/amba/serial.h>
32#include <linux/i2c.h> 32#include <linux/i2c.h>
33#include <linux/i2c-gpio.h> 33#include <linux/i2c-gpio.h>
34#include <linux/spi/spi.h>
34 35
35#include <mach/hardware.h> 36#include <mach/hardware.h>
36#include <mach/fb.h> 37#include <mach/fb.h>
37#include <mach/ep93xx_keypad.h> 38#include <mach/ep93xx_keypad.h>
39#include <mach/ep93xx_spi.h>
38 40
39#include <asm/mach/map.h> 41#include <asm/mach/map.h>
40#include <asm/mach/time.h> 42#include <asm/mach/time.h>
@@ -222,6 +224,20 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
222} 224}
223EXPORT_SYMBOL(ep93xx_devcfg_set_clear); 225EXPORT_SYMBOL(ep93xx_devcfg_set_clear);
224 226
227/**
228 * ep93xx_chip_revision() - returns the EP93xx chip revision
229 *
230 * See <mach/platform.h> for more information.
231 */
232unsigned int ep93xx_chip_revision(void)
233{
234 unsigned int v;
235
236 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
237 v &= EP93XX_SYSCON_SYSCFG_REV_MASK;
238 v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT;
239 return v;
240}
225 241
226/************************************************************************* 242/*************************************************************************
227 * EP93xx peripheral handling 243 * EP93xx peripheral handling
@@ -330,6 +346,10 @@ static struct platform_device ep93xx_ohci_device = {
330 .resource = ep93xx_ohci_resources, 346 .resource = ep93xx_ohci_resources,
331}; 347};
332 348
349
350/*************************************************************************
351 * EP93xx ethernet peripheral handling
352 *************************************************************************/
333static struct ep93xx_eth_data ep93xx_eth_data; 353static struct ep93xx_eth_data ep93xx_eth_data;
334 354
335static struct resource ep93xx_eth_resource[] = { 355static struct resource ep93xx_eth_resource[] = {
@@ -354,6 +374,12 @@ static struct platform_device ep93xx_eth_device = {
354 .resource = ep93xx_eth_resource, 374 .resource = ep93xx_eth_resource,
355}; 375};
356 376
377/**
378 * ep93xx_register_eth - Register the built-in ethernet platform device.
379 * @data: platform specific ethernet configuration (__initdata)
380 * @copy_addr: flag indicating that the MAC address should be copied
381 * from the IndAd registers (as programmed by the bootloader)
382 */
357void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) 383void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
358{ 384{
359 if (copy_addr) 385 if (copy_addr)
@@ -370,11 +396,19 @@ void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
370static struct i2c_gpio_platform_data ep93xx_i2c_data; 396static struct i2c_gpio_platform_data ep93xx_i2c_data;
371 397
372static struct platform_device ep93xx_i2c_device = { 398static struct platform_device ep93xx_i2c_device = {
373 .name = "i2c-gpio", 399 .name = "i2c-gpio",
374 .id = 0, 400 .id = 0,
375 .dev.platform_data = &ep93xx_i2c_data, 401 .dev = {
402 .platform_data = &ep93xx_i2c_data,
403 },
376}; 404};
377 405
406/**
407 * ep93xx_register_i2c - Register the i2c platform device.
408 * @data: platform specific i2c-gpio configuration (__initdata)
409 * @devices: platform specific i2c bus device information (__initdata)
410 * @num: the number of devices on the i2c bus
411 */
378void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data, 412void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
379 struct i2c_board_info *devices, int num) 413 struct i2c_board_info *devices, int num)
380{ 414{
@@ -398,17 +432,67 @@ void __init ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
398 platform_device_register(&ep93xx_i2c_device); 432 platform_device_register(&ep93xx_i2c_device);
399} 433}
400 434
435/*************************************************************************
436 * EP93xx SPI peripheral handling
437 *************************************************************************/
438static struct ep93xx_spi_info ep93xx_spi_master_data;
439
440static struct resource ep93xx_spi_resources[] = {
441 {
442 .start = EP93XX_SPI_PHYS_BASE,
443 .end = EP93XX_SPI_PHYS_BASE + 0x18 - 1,
444 .flags = IORESOURCE_MEM,
445 },
446 {
447 .start = IRQ_EP93XX_SSP,
448 .end = IRQ_EP93XX_SSP,
449 .flags = IORESOURCE_IRQ,
450 },
451};
452
453static struct platform_device ep93xx_spi_device = {
454 .name = "ep93xx-spi",
455 .id = 0,
456 .dev = {
457 .platform_data = &ep93xx_spi_master_data,
458 },
459 .num_resources = ARRAY_SIZE(ep93xx_spi_resources),
460 .resource = ep93xx_spi_resources,
461};
462
463/**
464 * ep93xx_register_spi() - registers spi platform device
465 * @info: ep93xx board specific spi master info (__initdata)
466 * @devices: SPI devices to register (__initdata)
467 * @num: number of SPI devices to register
468 *
469 * This function registers platform device for the EP93xx SPI controller and
470 * also makes sure that SPI pins are muxed so that I2S is not using those pins.
471 */
472void __init ep93xx_register_spi(struct ep93xx_spi_info *info,
473 struct spi_board_info *devices, int num)
474{
475 /*
476 * When SPI is used, we need to make sure that I2S is muxed off from
477 * SPI pins.
478 */
479 ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2SONSSP);
480
481 ep93xx_spi_master_data = *info;
482 spi_register_board_info(devices, num);
483 platform_device_register(&ep93xx_spi_device);
484}
401 485
402/************************************************************************* 486/*************************************************************************
403 * EP93xx LEDs 487 * EP93xx LEDs
404 *************************************************************************/ 488 *************************************************************************/
405static struct gpio_led ep93xx_led_pins[] = { 489static struct gpio_led ep93xx_led_pins[] = {
406 { 490 {
407 .name = "platform:grled", 491 .name = "platform:grled",
408 .gpio = EP93XX_GPIO_LINE_GRLED, 492 .gpio = EP93XX_GPIO_LINE_GRLED,
409 }, { 493 }, {
410 .name = "platform:rdled", 494 .name = "platform:rdled",
411 .gpio = EP93XX_GPIO_LINE_RDLED, 495 .gpio = EP93XX_GPIO_LINE_RDLED,
412 }, 496 },
413}; 497};
414 498
@@ -528,7 +612,7 @@ static struct platform_device ep93xx_fb_device = {
528 .name = "ep93xx-fb", 612 .name = "ep93xx-fb",
529 .id = -1, 613 .id = -1,
530 .dev = { 614 .dev = {
531 .platform_data = &ep93xxfb_data, 615 .platform_data = &ep93xxfb_data,
532 .coherent_dma_mask = DMA_BIT_MASK(32), 616 .coherent_dma_mask = DMA_BIT_MASK(32),
533 .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask, 617 .dma_mask = &ep93xx_fb_device.dev.coherent_dma_mask,
534 }, 618 },
@@ -536,6 +620,10 @@ static struct platform_device ep93xx_fb_device = {
536 .resource = ep93xx_fb_resource, 620 .resource = ep93xx_fb_resource,
537}; 621};
538 622
623/**
624 * ep93xx_register_fb - Register the framebuffer platform device.
625 * @data: platform specific framebuffer configuration (__initdata)
626 */
539void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) 627void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
540{ 628{
541 ep93xxfb_data = *data; 629 ep93xxfb_data = *data;
@@ -546,6 +634,8 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
546/************************************************************************* 634/*************************************************************************
547 * EP93xx matrix keypad peripheral handling 635 * EP93xx matrix keypad peripheral handling
548 *************************************************************************/ 636 *************************************************************************/
637static struct ep93xx_keypad_platform_data ep93xx_keypad_data;
638
549static struct resource ep93xx_keypad_resource[] = { 639static struct resource ep93xx_keypad_resource[] = {
550 { 640 {
551 .start = EP93XX_KEY_MATRIX_PHYS_BASE, 641 .start = EP93XX_KEY_MATRIX_PHYS_BASE,
@@ -559,15 +649,22 @@ static struct resource ep93xx_keypad_resource[] = {
559}; 649};
560 650
561static struct platform_device ep93xx_keypad_device = { 651static struct platform_device ep93xx_keypad_device = {
562 .name = "ep93xx-keypad", 652 .name = "ep93xx-keypad",
563 .id = -1, 653 .id = -1,
564 .num_resources = ARRAY_SIZE(ep93xx_keypad_resource), 654 .dev = {
565 .resource = ep93xx_keypad_resource, 655 .platform_data = &ep93xx_keypad_data,
656 },
657 .num_resources = ARRAY_SIZE(ep93xx_keypad_resource),
658 .resource = ep93xx_keypad_resource,
566}; 659};
567 660
661/**
662 * ep93xx_register_keypad - Register the keypad platform device.
663 * @data: platform specific keypad configuration (__initdata)
664 */
568void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data) 665void __init ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data)
569{ 666{
570 ep93xx_keypad_device.dev.platform_data = data; 667 ep93xx_keypad_data = *data;
571 platform_device_register(&ep93xx_keypad_device); 668 platform_device_register(&ep93xx_keypad_device);
572} 669}
573 670
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index d22d67ac8b99..3884182cd362 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -74,7 +74,7 @@ static void __init edb93xx_register_flash(void)
74 } 74 }
75} 75}
76 76
77static struct ep93xx_eth_data edb93xx_eth_data = { 77static struct ep93xx_eth_data __initdata edb93xx_eth_data = {
78 .phy_id = 1, 78 .phy_id = 1,
79}; 79};
80 80
@@ -82,7 +82,7 @@ static struct ep93xx_eth_data edb93xx_eth_data = {
82/************************************************************************* 82/*************************************************************************
83 * EDB93xx i2c peripheral handling 83 * EDB93xx i2c peripheral handling
84 *************************************************************************/ 84 *************************************************************************/
85static struct i2c_gpio_platform_data edb93xx_i2c_gpio_data = { 85static struct i2c_gpio_platform_data __initdata edb93xx_i2c_gpio_data = {
86 .sda_pin = EP93XX_GPIO_LINE_EEDAT, 86 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
87 .sda_is_open_drain = 0, 87 .sda_is_open_drain = 0,
88 .scl_pin = EP93XX_GPIO_LINE_EECLK, 88 .scl_pin = EP93XX_GPIO_LINE_EECLK,
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index 3da7ca816d19..a809618e9f05 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -41,7 +41,7 @@ static struct platform_device gesbc9312_flash = {
41 .resource = &gesbc9312_flash_resource, 41 .resource = &gesbc9312_flash_resource,
42}; 42};
43 43
44static struct ep93xx_eth_data gesbc9312_eth_data = { 44static struct ep93xx_eth_data __initdata gesbc9312_eth_data = {
45 .phy_id = 1, 45 .phy_id = 1,
46}; 46};
47 47
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index 93e2ecc79ceb..b1e096f0c2d2 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -106,6 +106,7 @@
106 106
107#define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000) 107#define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000)
108 108
109#define EP93XX_SPI_PHYS_BASE EP93XX_APB_PHYS(0x000a0000)
109#define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000) 110#define EP93XX_SPI_BASE EP93XX_APB_IOMEM(0x000a0000)
110 111
111#define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000) 112#define EP93XX_IRDA_BASE EP93XX_APB_IOMEM(0x000b0000)
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h
index c6dc14dbca18..9a4413dd44bb 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/include/mach/platform.h
@@ -6,9 +6,11 @@
6 6
7struct i2c_gpio_platform_data; 7struct i2c_gpio_platform_data;
8struct i2c_board_info; 8struct i2c_board_info;
9struct spi_board_info;
9struct platform_device; 10struct platform_device;
10struct ep93xxfb_mach_info; 11struct ep93xxfb_mach_info;
11struct ep93xx_keypad_platform_data; 12struct ep93xx_keypad_platform_data;
13struct ep93xx_spi_info;
12 14
13struct ep93xx_eth_data 15struct ep93xx_eth_data
14{ 16{
@@ -33,9 +35,19 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits)
33 ep93xx_devcfg_set_clear(0x00, bits); 35 ep93xx_devcfg_set_clear(0x00, bits);
34} 36}
35 37
38#define EP93XX_CHIP_REV_D0 3
39#define EP93XX_CHIP_REV_D1 4
40#define EP93XX_CHIP_REV_E0 5
41#define EP93XX_CHIP_REV_E1 6
42#define EP93XX_CHIP_REV_E2 7
43
44unsigned int ep93xx_chip_revision(void);
45
36void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); 46void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr);
37void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, 47void ep93xx_register_i2c(struct i2c_gpio_platform_data *data,
38 struct i2c_board_info *devices, int num); 48 struct i2c_board_info *devices, int num);
49void ep93xx_register_spi(struct ep93xx_spi_info *info,
50 struct spi_board_info *devices, int num);
39void ep93xx_register_fb(struct ep93xxfb_mach_info *data); 51void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
40void ep93xx_register_pwm(int pwm0, int pwm1); 52void ep93xx_register_pwm(int pwm0, int pwm1);
41int ep93xx_pwm_acquire_gpio(struct platform_device *pdev); 53int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index c33360e82868..1cc911b4efa6 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -80,7 +80,7 @@ static void __init micro9_register_flash(void)
80/************************************************************************* 80/*************************************************************************
81 * Micro9 Ethernet 81 * Micro9 Ethernet
82 *************************************************************************/ 82 *************************************************************************/
83static struct ep93xx_eth_data micro9_eth_data = { 83static struct ep93xx_eth_data __initdata micro9_eth_data = {
84 .phy_id = 0x1f, 84 .phy_id = 0x1f,
85}; 85};
86 86
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index cd93990f1b99..388aec95f60e 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -49,17 +49,17 @@ static struct platform_device simone_flash = {
49 }, 49 },
50}; 50};
51 51
52static struct ep93xx_eth_data simone_eth_data = { 52static struct ep93xx_eth_data __initdata simone_eth_data = {
53 .phy_id = 1, 53 .phy_id = 1,
54}; 54};
55 55
56static struct ep93xxfb_mach_info simone_fb_info = { 56static struct ep93xxfb_mach_info __initdata simone_fb_info = {
57 .num_modes = EP93XXFB_USE_MODEDB, 57 .num_modes = EP93XXFB_USE_MODEDB,
58 .bpp = 16, 58 .bpp = 16,
59 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, 59 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
60}; 60};
61 61
62static struct i2c_gpio_platform_data simone_i2c_gpio_data = { 62static struct i2c_gpio_platform_data __initdata simone_i2c_gpio_data = {
63 .sda_pin = EP93XX_GPIO_LINE_EEDAT, 63 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
64 .sda_is_open_drain = 0, 64 .sda_is_open_drain = 0,
65 .scl_pin = EP93XX_GPIO_LINE_EECLK, 65 .scl_pin = EP93XX_GPIO_LINE_EECLK,
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index 51134b0382ca..38deaee40397 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -125,11 +125,11 @@ static struct platform_device snappercl15_nand_device = {
125 .num_resources = ARRAY_SIZE(snappercl15_nand_resource), 125 .num_resources = ARRAY_SIZE(snappercl15_nand_resource),
126}; 126};
127 127
128static struct ep93xx_eth_data snappercl15_eth_data = { 128static struct ep93xx_eth_data __initdata snappercl15_eth_data = {
129 .phy_id = 1, 129 .phy_id = 1,
130}; 130};
131 131
132static struct i2c_gpio_platform_data snappercl15_i2c_gpio_data = { 132static struct i2c_gpio_platform_data __initdata snappercl15_i2c_gpio_data = {
133 .sda_pin = EP93XX_GPIO_LINE_EEDAT, 133 .sda_pin = EP93XX_GPIO_LINE_EEDAT,
134 .sda_is_open_drain = 0, 134 .sda_is_open_drain = 0,
135 .scl_pin = EP93XX_GPIO_LINE_EECLK, 135 .scl_pin = EP93XX_GPIO_LINE_EECLK,
@@ -145,7 +145,7 @@ static struct i2c_board_info __initdata snappercl15_i2c_data[] = {
145 }, 145 },
146}; 146};
147 147
148static struct ep93xxfb_mach_info snappercl15_fb_info = { 148static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = {
149 .num_modes = EP93XXFB_USE_MODEDB, 149 .num_modes = EP93XXFB_USE_MODEDB,
150 .bpp = 16, 150 .bpp = 16,
151}; 151};
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index fac1ec7a60fb..9553031900b0 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -186,7 +186,7 @@ static struct platform_device ts72xx_wdt_device = {
186 .resource = ts72xx_wdt_resources, 186 .resource = ts72xx_wdt_resources,
187}; 187};
188 188
189static struct ep93xx_eth_data ts72xx_eth_data = { 189static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
190 .phy_id = 1, 190 .phy_id = 1,
191}; 191};
192 192
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index df97d16390e3..27db275b367c 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -11,6 +11,7 @@ config ARCH_INTEGRATOR_AP
11config ARCH_INTEGRATOR_CP 11config ARCH_INTEGRATOR_CP
12 bool "Support Integrator/CP platform" 12 bool "Support Integrator/CP platform"
13 select ARCH_CINTEGRATOR 13 select ARCH_CINTEGRATOR
14 select ARM_TIMER_SP804
14 help 15 help
15 Include support for the ARM(R) Integrator CP platform. 16 Include support for the ARM(R) Integrator CP platform.
16 17
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index 6a5ef8d30b10..ebeef966e1f5 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -4,7 +4,7 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := clock.o core.o lm.o 7obj-y := core.o lm.o
8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o 8obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o
9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o 9obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o
10 10
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
deleted file mode 100644
index 609c49de3d47..000000000000
--- a/arch/arm/mach-integrator/common.h
+++ /dev/null
@@ -1,2 +0,0 @@
1extern void integrator_time_init(unsigned long, unsigned int);
2extern unsigned long integrator_gettimeoffset(void);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 8b390e36ba69..b02cfc06e0ae 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -24,15 +24,13 @@
24#include <asm/clkdev.h> 24#include <asm/clkdev.h>
25#include <mach/clkdev.h> 25#include <mach/clkdev.h>
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/platform.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/hardware/arm_timer.h>
29#include <mach/cm.h> 29#include <mach/cm.h>
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/leds.h> 31#include <asm/leds.h>
32#include <asm/mach/time.h> 32#include <asm/mach/time.h>
33 33
34#include "common.h"
35
36static struct amba_pl010_data integrator_uart_data; 34static struct amba_pl010_data integrator_uart_data;
37 35
38static struct amba_device rtc_device = { 36static struct amba_device rtc_device = {
@@ -163,8 +161,8 @@ arch_initcall(integrator_init);
163 * UART0 7 6 161 * UART0 7 6
164 * UART1 5 4 162 * UART1 5 4
165 */ 163 */
166#define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) 164#define SC_CTRLC IO_ADDRESS(INTEGRATOR_SC_CTRLC)
167#define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) 165#define SC_CTRLS IO_ADDRESS(INTEGRATOR_SC_CTRLS)
168 166
169static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl) 167static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
170{ 168{
@@ -196,7 +194,7 @@ static struct amba_pl010_data integrator_uart_data = {
196 .set_mctrl = integrator_uart_set_mctrl, 194 .set_mctrl = integrator_uart_set_mctrl,
197}; 195};
198 196
199#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET 197#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_CTRL)
200 198
201static DEFINE_SPINLOCK(cm_lock); 199static DEFINE_SPINLOCK(cm_lock);
202 200
@@ -217,120 +215,3 @@ void cm_control(u32 mask, u32 set)
217} 215}
218 216
219EXPORT_SYMBOL(cm_control); 217EXPORT_SYMBOL(cm_control);
220
221/*
222 * Where is the timer (VA)?
223 */
224#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
225#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
226#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200)
227#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
228
229/*
230 * How long is the timer interval?
231 */
232#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
233#if TIMER_INTERVAL >= 0x100000
234#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
235#elif TIMER_INTERVAL >= 0x10000
236#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
237#else
238#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
239#endif
240
241static unsigned long timer_reload;
242
243/*
244 * Returns number of ms since last clock interrupt. Note that interrupts
245 * will have been disabled by do_gettimeoffset()
246 */
247unsigned long integrator_gettimeoffset(void)
248{
249 unsigned long ticks1, ticks2, status;
250
251 /*
252 * Get the current number of ticks. Note that there is a race
253 * condition between us reading the timer and checking for
254 * an interrupt. We get around this by ensuring that the
255 * counter has not reloaded between our two reads.
256 */
257 ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;
258 do {
259 ticks1 = ticks2;
260 status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS);
261 ticks2 = readl(TIMER1_VA_BASE + TIMER_VALUE) & 0xffff;
262 } while (ticks2 > ticks1);
263
264 /*
265 * Number of ticks since last interrupt.
266 */
267 ticks1 = timer_reload - ticks2;
268
269 /*
270 * Interrupt pending? If so, we've reloaded once already.
271 */
272 if (status & (1 << IRQ_TIMERINT1))
273 ticks1 += timer_reload;
274
275 /*
276 * Convert the ticks to usecs
277 */
278 return TICKS2USECS(ticks1);
279}
280
281/*
282 * IRQ handler for the timer
283 */
284static irqreturn_t
285integrator_timer_interrupt(int irq, void *dev_id)
286{
287 /*
288 * clear the interrupt
289 */
290 writel(1, TIMER1_VA_BASE + TIMER_INTCLR);
291
292 timer_tick();
293
294 return IRQ_HANDLED;
295}
296
297static struct irqaction integrator_timer_irq = {
298 .name = "Integrator Timer Tick",
299 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
300 .handler = integrator_timer_interrupt,
301};
302
303/*
304 * Set up timer interrupt, and return the current time in seconds.
305 */
306void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
307{
308 unsigned int timer_ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
309
310 timer_reload = reload;
311 timer_ctrl |= ctrl;
312
313 if (timer_reload > 0x100000) {
314 timer_reload >>= 8;
315 timer_ctrl |= TIMER_CTRL_DIV256;
316 } else if (timer_reload > 0x010000) {
317 timer_reload >>= 4;
318 timer_ctrl |= TIMER_CTRL_DIV16;
319 }
320
321 /*
322 * Initialise to a known state (all timers off)
323 */
324 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
325 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
326 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
327
328 writel(timer_reload, TIMER1_VA_BASE + TIMER_LOAD);
329 writel(timer_reload, TIMER1_VA_BASE + TIMER_VALUE);
330 writel(timer_ctrl, TIMER1_VA_BASE + TIMER_CTRL);
331
332 /*
333 * Make irqs happen for the system timer
334 */
335 setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
336}
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index 44d4c2e8207b..1cb222daa06d 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -20,32 +20,39 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/platform.h>
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24#include <asm/hardware/icst525.h> 25#include <asm/hardware/icst.h>
25 26
26static struct cpufreq_driver integrator_driver; 27static struct cpufreq_driver integrator_driver;
27 28
28#define CM_ID (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_ID_OFFSET) 29#define CM_ID IO_ADDRESS(INTEGRATOR_HDR_ID)
29#define CM_OSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_OSC_OFFSET) 30#define CM_OSC IO_ADDRESS(INTEGRATOR_HDR_OSC)
30#define CM_STAT (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_STAT_OFFSET) 31#define CM_STAT IO_ADDRESS(INTEGRATOR_HDR_STAT)
31#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) 32#define CM_LOCK IO_ADDRESS(INTEGRATOR_HDR_LOCK)
32 33
33static const struct icst525_params lclk_params = { 34static const struct icst_params lclk_params = {
34 .ref = 24000, 35 .ref = 24000000,
35 .vco_max = 320000, 36 .vco_max = ICST525_VCO_MAX_5V,
37 .vco_min = ICST525_VCO_MIN,
36 .vd_min = 8, 38 .vd_min = 8,
37 .vd_max = 132, 39 .vd_max = 132,
38 .rd_min = 24, 40 .rd_min = 24,
39 .rd_max = 24, 41 .rd_max = 24,
42 .s2div = icst525_s2div,
43 .idx2s = icst525_idx2s,
40}; 44};
41 45
42static const struct icst525_params cclk_params = { 46static const struct icst_params cclk_params = {
43 .ref = 24000, 47 .ref = 24000000,
44 .vco_max = 320000, 48 .vco_max = ICST525_VCO_MAX_5V,
49 .vco_min = ICST525_VCO_MIN,
45 .vd_min = 12, 50 .vd_min = 12,
46 .vd_max = 160, 51 .vd_max = 160,
47 .rd_min = 24, 52 .rd_min = 24,
48 .rd_max = 24, 53 .rd_max = 24,
54 .s2div = icst525_s2div,
55 .idx2s = icst525_idx2s,
49}; 56};
50 57
51/* 58/*
@@ -53,17 +60,17 @@ static const struct icst525_params cclk_params = {
53 */ 60 */
54static int integrator_verify_policy(struct cpufreq_policy *policy) 61static int integrator_verify_policy(struct cpufreq_policy *policy)
55{ 62{
56 struct icst525_vco vco; 63 struct icst_vco vco;
57 64
58 cpufreq_verify_within_limits(policy, 65 cpufreq_verify_within_limits(policy,
59 policy->cpuinfo.min_freq, 66 policy->cpuinfo.min_freq,
60 policy->cpuinfo.max_freq); 67 policy->cpuinfo.max_freq);
61 68
62 vco = icst525_khz_to_vco(&cclk_params, policy->max); 69 vco = icst_hz_to_vco(&cclk_params, policy->max * 1000);
63 policy->max = icst525_khz(&cclk_params, vco); 70 policy->max = icst_hz(&cclk_params, vco) / 1000;
64 71
65 vco = icst525_khz_to_vco(&cclk_params, policy->min); 72 vco = icst_hz_to_vco(&cclk_params, policy->min * 1000);
66 policy->min = icst525_khz(&cclk_params, vco); 73 policy->min = icst_hz(&cclk_params, vco) / 1000;
67 74
68 cpufreq_verify_within_limits(policy, 75 cpufreq_verify_within_limits(policy,
69 policy->cpuinfo.min_freq, 76 policy->cpuinfo.min_freq,
@@ -79,7 +86,7 @@ static int integrator_set_target(struct cpufreq_policy *policy,
79{ 86{
80 cpumask_t cpus_allowed; 87 cpumask_t cpus_allowed;
81 int cpu = policy->cpu; 88 int cpu = policy->cpu;
82 struct icst525_vco vco; 89 struct icst_vco vco;
83 struct cpufreq_freqs freqs; 90 struct cpufreq_freqs freqs;
84 u_int cm_osc; 91 u_int cm_osc;
85 92
@@ -105,17 +112,17 @@ static int integrator_set_target(struct cpufreq_policy *policy,
105 } 112 }
106 vco.v = cm_osc & 255; 113 vco.v = cm_osc & 255;
107 vco.r = 22; 114 vco.r = 22;
108 freqs.old = icst525_khz(&cclk_params, vco); 115 freqs.old = icst_hz(&cclk_params, vco) / 1000;
109 116
110 /* icst525_khz_to_vco rounds down -- so we need the next 117 /* icst_hz_to_vco rounds down -- so we need the next
111 * larger freq in case of CPUFREQ_RELATION_L. 118 * larger freq in case of CPUFREQ_RELATION_L.
112 */ 119 */
113 if (relation == CPUFREQ_RELATION_L) 120 if (relation == CPUFREQ_RELATION_L)
114 target_freq += 999; 121 target_freq += 999;
115 if (target_freq > policy->max) 122 if (target_freq > policy->max)
116 target_freq = policy->max; 123 target_freq = policy->max;
117 vco = icst525_khz_to_vco(&cclk_params, target_freq); 124 vco = icst_hz_to_vco(&cclk_params, target_freq * 1000);
118 freqs.new = icst525_khz(&cclk_params, vco); 125 freqs.new = icst_hz(&cclk_params, vco) / 1000;
119 126
120 freqs.cpu = policy->cpu; 127 freqs.cpu = policy->cpu;
121 128
@@ -155,7 +162,7 @@ static unsigned int integrator_get(unsigned int cpu)
155 cpumask_t cpus_allowed; 162 cpumask_t cpus_allowed;
156 unsigned int current_freq; 163 unsigned int current_freq;
157 u_int cm_osc; 164 u_int cm_osc;
158 struct icst525_vco vco; 165 struct icst_vco vco;
159 166
160 cpus_allowed = current->cpus_allowed; 167 cpus_allowed = current->cpus_allowed;
161 168
@@ -173,7 +180,7 @@ static unsigned int integrator_get(unsigned int cpu)
173 vco.v = cm_osc & 255; 180 vco.v = cm_osc & 255;
174 vco.r = 22; 181 vco.r = 22;
175 182
176 current_freq = icst525_khz(&cclk_params, vco); /* current freq */ 183 current_freq = icst_hz(&cclk_params, vco) / 1000; /* current freq */
177 184
178 set_cpus_allowed(current, cpus_allowed); 185 set_cpus_allowed(current, cpus_allowed);
179 186
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 0058c937719e..1a0ee93e4519 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -24,7 +24,7 @@
24 24
25#include <asm/clkdev.h> 25#include <asm/clkdev.h>
26#include <mach/clkdev.h> 26#include <mach/clkdev.h>
27#include <asm/hardware/icst525.h> 27#include <asm/hardware/icst.h>
28#include <mach/lm.h> 28#include <mach/lm.h>
29#include <mach/impd1.h> 29#include <mach/impd1.h>
30#include <asm/sizes.h> 30#include <asm/sizes.h>
@@ -40,32 +40,25 @@ struct impd1_module {
40 struct clk_lookup *clks[3]; 40 struct clk_lookup *clks[3];
41}; 41};
42 42
43static const struct icst525_params impd1_vco_params = { 43static const struct icst_params impd1_vco_params = {
44 .ref = 24000, /* 24 MHz */ 44 .ref = 24000000, /* 24 MHz */
45 .vco_max = 200000, /* 200 MHz */ 45 .vco_max = ICST525_VCO_MAX_3V,
46 .vco_min = ICST525_VCO_MIN,
46 .vd_min = 12, 47 .vd_min = 12,
47 .vd_max = 519, 48 .vd_max = 519,
48 .rd_min = 3, 49 .rd_min = 3,
49 .rd_max = 120, 50 .rd_max = 120,
51 .s2div = icst525_s2div,
52 .idx2s = icst525_idx2s,
50}; 53};
51 54
52static void impd1_setvco(struct clk *clk, struct icst525_vco vco) 55static void impd1_setvco(struct clk *clk, struct icst_vco vco)
53{ 56{
54 struct impd1_module *impd1 = clk->data; 57 struct impd1_module *impd1 = clk->data;
55 int vconr = clk - impd1->vcos; 58 u32 val = vco.v | (vco.r << 9) | (vco.s << 16);
56 u32 val;
57
58 val = vco.v | (vco.r << 9) | (vco.s << 16);
59 59
60 writel(0xa05f, impd1->base + IMPD1_LOCK); 60 writel(0xa05f, impd1->base + IMPD1_LOCK);
61 switch (vconr) { 61 writel(val, clk->vcoreg);
62 case 0:
63 writel(val, impd1->base + IMPD1_OSC1);
64 break;
65 case 1:
66 writel(val, impd1->base + IMPD1_OSC2);
67 break;
68 }
69 writel(0, impd1->base + IMPD1_LOCK); 62 writel(0, impd1->base + IMPD1_LOCK);
70 63
71#ifdef DEBUG 64#ifdef DEBUG
@@ -73,11 +66,17 @@ static void impd1_setvco(struct clk *clk, struct icst525_vco vco)
73 vco.r = (val >> 9) & 0x7f; 66 vco.r = (val >> 9) & 0x7f;
74 vco.s = (val >> 16) & 7; 67 vco.s = (val >> 16) & 7;
75 68
76 pr_debug("IM-PD1: VCO%d clock is %ld kHz\n", 69 pr_debug("IM-PD1: VCO%d clock is %ld Hz\n",
77 vconr, icst525_khz(&impd1_vco_params, vco)); 70 vconr, icst525_hz(&impd1_vco_params, vco));
78#endif 71#endif
79} 72}
80 73
74static const struct clk_ops impd1_clk_ops = {
75 .round = icst_clk_round,
76 .set = icst_clk_set,
77 .setvco = impd1_setvco,
78};
79
81void impd1_tweak_control(struct device *dev, u32 mask, u32 val) 80void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
82{ 81{
83 struct impd1_module *impd1 = dev_get_drvdata(dev); 82 struct impd1_module *impd1 = dev_get_drvdata(dev);
@@ -373,11 +372,13 @@ static int impd1_probe(struct lm_device *dev)
373 (unsigned long)dev->resource.start); 372 (unsigned long)dev->resource.start);
374 373
375 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) { 374 for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
375 impd1->vcos[i].ops = &impd1_clk_ops,
376 impd1->vcos[i].owner = THIS_MODULE, 376 impd1->vcos[i].owner = THIS_MODULE,
377 impd1->vcos[i].params = &impd1_vco_params, 377 impd1->vcos[i].params = &impd1_vco_params,
378 impd1->vcos[i].data = impd1, 378 impd1->vcos[i].data = impd1;
379 impd1->vcos[i].setvco = impd1_setvco;
380 } 379 }
380 impd1->vcos[0].vcoreg = impd1->base + IMPD1_OSC1;
381 impd1->vcos[1].vcoreg = impd1->base + IMPD1_OSC2;
381 382
382 impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000", 383 impd1->clks[0] = clkdev_alloc(&impd1->vcos[0], NULL, "lm%x:01000",
383 dev->id); 384 dev->id);
diff --git a/arch/arm/mach-integrator/include/mach/clkdev.h b/arch/arm/mach-integrator/include/mach/clkdev.h
index 9293e410832a..bfe07679faec 100644
--- a/arch/arm/mach-integrator/include/mach/clkdev.h
+++ b/arch/arm/mach-integrator/include/mach/clkdev.h
@@ -2,14 +2,15 @@
2#define __ASM_MACH_CLKDEV_H 2#define __ASM_MACH_CLKDEV_H
3 3
4#include <linux/module.h> 4#include <linux/module.h>
5#include <asm/hardware/icst525.h> 5#include <plat/clock.h>
6 6
7struct clk { 7struct clk {
8 unsigned long rate; 8 unsigned long rate;
9 const struct clk_ops *ops;
9 struct module *owner; 10 struct module *owner;
10 const struct icst525_params *params; 11 const struct icst_params *params;
12 void __iomem *vcoreg;
11 void *data; 13 void *data;
12 void (*setvco)(struct clk *, struct icst525_vco vco);
13}; 14};
14 15
15static inline int __clk_get(struct clk *clk) 16static inline int __clk_get(struct clk *clk)
diff --git a/arch/arm/mach-integrator/include/mach/entry-macro.S b/arch/arm/mach-integrator/include/mach/entry-macro.S
index 7649c57acb53..3d029c9f3ef6 100644
--- a/arch/arm/mach-integrator/include/mach/entry-macro.S
+++ b/arch/arm/mach-integrator/include/mach/entry-macro.S
@@ -8,6 +8,7 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/hardware.h> 10#include <mach/hardware.h>
11#include <mach/platform.h>
11#include <mach/irqs.h> 12#include <mach/irqs.h>
12 13
13 .macro disable_fiq 14 .macro disable_fiq
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h
index d795642fad22..8e26360ce9a3 100644
--- a/arch/arm/mach-integrator/include/mach/hardware.h
+++ b/arch/arm/mach-integrator/include/mach/hardware.h
@@ -23,7 +23,6 @@
23#define __ASM_ARCH_HARDWARE_H 23#define __ASM_ARCH_HARDWARE_H
24 24
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26#include <mach/platform.h>
27 26
28/* 27/*
29 * Where in virtual memory the IO devices (timers, system controllers 28 * Where in virtual memory the IO devices (timers, system controllers
@@ -36,17 +35,19 @@
36#define PCIO_BASE PCI_IO_VADDR 35#define PCIO_BASE PCI_IO_VADDR
37#define PCIMEM_BASE PCI_MEMORY_VADDR 36#define PCIMEM_BASE PCI_MEMORY_VADDR
38 37
39#ifdef CONFIG_MMU
40/* macro to get at IO space when running virtually */
41#define IO_ADDRESS(x) (((x) >> 4) + IO_BASE)
42#else
43#define IO_ADDRESS(x) (x)
44#endif
45
46#define pcibios_assign_all_busses() 1 38#define pcibios_assign_all_busses() 1
47 39
48#define PCIBIOS_MIN_IO 0x6000 40#define PCIBIOS_MIN_IO 0x6000
49#define PCIBIOS_MIN_MEM 0x00100000 41#define PCIBIOS_MIN_MEM 0x00100000
50 42
43/* macro to get at IO space when running virtually */
44#ifdef CONFIG_MMU
45#define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
46#else
47#define IO_ADDRESS(x) (x)
48#endif
49
50#define __io_address(n) ((void __iomem *)IO_ADDRESS(n))
51
51#endif 52#endif
52 53
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/include/mach/platform.h
index e00a2624f269..5e6ea5cfea6e 100644
--- a/arch/arm/mach-integrator/include/mach/platform.h
+++ b/arch/arm/mach-integrator/include/mach/platform.h
@@ -23,9 +23,6 @@
23 * 23 *
24 * Integrator address map 24 * Integrator address map
25 * 25 *
26 * NOTE: This is a multi-hosted header file for use with uHAL and
27 * supported debuggers.
28 *
29 * ***********************************************************************/ 26 * ***********************************************************************/
30 27
31#ifndef __address_h 28#ifndef __address_h
@@ -290,12 +287,14 @@
290#define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET) 287#define INTEGRATOR_DBG_LEDS (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_LEDS_OFFSET)
291#define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET) 288#define INTEGRATOR_DBG_SWITCH (INTEGRATOR_DBG_BASE + INTEGRATOR_DBG_SWITCH_OFFSET)
292 289
290#define INTEGRATOR_AP_GPIO_BASE 0x1B000000 /* GPIO */
293 291
294#if defined(CONFIG_ARCH_INTEGRATOR_AP) 292#define INTEGRATOR_CP_MMC_BASE 0x1C000000 /* MMC */
295#define INTEGRATOR_GPIO_BASE 0x1B000000 /* GPIO */ 293#define INTEGRATOR_CP_AACI_BASE 0x1D000000 /* AACI */
296#elif defined(CONFIG_ARCH_INTEGRATOR_CP) 294#define INTEGRATOR_CP_ETH_BASE 0xC8000000 /* Ethernet */
297#define INTEGRATOR_GPIO_BASE 0xC9000000 /* GPIO */ 295#define INTEGRATOR_CP_GPIO_BASE 0xC9000000 /* GPIO */
298#endif 296#define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */
297#define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */
299 298
300/* ------------------------------------------------------------------------ 299/* ------------------------------------------------------------------------
301 * KMI keyboard/mouse definitions 300 * KMI keyboard/mouse definitions
@@ -328,20 +327,6 @@
328 */ 327 */
329#define PHYS_PCI_V3_BASE 0x62000000 328#define PHYS_PCI_V3_BASE 0x62000000
330 329
331#define PCI_DRAMSIZE INTEGRATOR_SSRAM_SIZE
332
333/* 'export' these to UHAL */
334#define UHAL_PCI_IO PCI_IO_BASE
335#define UHAL_PCI_MEM PCI_MEM_BASE
336#define UHAL_PCI_ALLOC_IO_BASE 0x00004000
337#define UHAL_PCI_ALLOC_MEM_BASE PCI_MEM_BASE
338#define UHAL_PCI_MAX_SLOT 20
339
340/* ========================================================================
341 * Start of uHAL definitions
342 * ========================================================================
343 */
344
345/* ------------------------------------------------------------------------ 330/* ------------------------------------------------------------------------
346 * Integrator Interrupt Controllers 331 * Integrator Interrupt Controllers
347 * ------------------------------------------------------------------------ 332 * ------------------------------------------------------------------------
@@ -389,7 +374,7 @@
389 */ 374 */
390 375
391/* ------------------------------------------------------------------------ 376/* ------------------------------------------------------------------------
392 * LED's - The header LED is not accessible via the uHAL API 377 * LED's
393 * ------------------------------------------------------------------------ 378 * ------------------------------------------------------------------------
394 * 379 *
395 */ 380 */
@@ -402,34 +387,18 @@
402#define LED_BANK INTEGRATOR_DBG_LEDS 387#define LED_BANK INTEGRATOR_DBG_LEDS
403 388
404/* 389/*
405 * Memory definitions - run uHAL out of SSRAM.
406 *
407 */
408#define uHAL_MEMORY_SIZE INTEGRATOR_SSRAM_SIZE
409
410/*
411 * Clean base - dummy
412 *
413 */
414#define CLEAN_BASE INTEGRATOR_BOOT_ROM_HI
415
416/*
417 * Timer definitions 390 * Timer definitions
418 * 391 *
419 * Only use timer 1 & 2 392 * Only use timer 1 & 2
420 * (both run at 24MHz and will need the clock divider set to 16). 393 * (both run at 24MHz and will need the clock divider set to 16).
421 * 394 *
422 * Timer 0 runs at bus frequency and therefore could vary and currently 395 * Timer 0 runs at bus frequency
423 * uHAL can't handle that.
424 *
425 */ 396 */
426 397
427#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE 398#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE
428#define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) 399#define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100)
429#define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) 400#define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200)
430 401
431#define MAX_TIMER 2
432#define MAX_PERIOD 699050
433#define TICKS_PER_uSEC 24 402#define TICKS_PER_uSEC 24
434 403
435/* 404/*
@@ -437,14 +406,9 @@
437 * 406 *
438 */ 407 */
439#define mSEC_1 1000 408#define mSEC_1 1000
440#define mSEC_5 (mSEC_1 * 5)
441#define mSEC_10 (mSEC_1 * 10) 409#define mSEC_10 (mSEC_1 * 10)
442#define mSEC_25 (mSEC_1 * 25)
443#define SEC_1 (mSEC_1 * 1000)
444 410
445#define INTEGRATOR_CSR_BASE 0x10000000 411#define INTEGRATOR_CSR_BASE 0x10000000
446#define INTEGRATOR_CSR_SIZE 0x10000000 412#define INTEGRATOR_CSR_SIZE 0x10000000
447 413
448#endif 414#endif
449
450/* END */
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 8138a7e24562..227cf4d05088 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -27,9 +27,14 @@
27#include <linux/sysdev.h> 27#include <linux/sysdev.h>
28#include <linux/amba/bus.h> 28#include <linux/amba/bus.h>
29#include <linux/amba/kmi.h> 29#include <linux/amba/kmi.h>
30#include <linux/clocksource.h>
31#include <linux/clockchips.h>
32#include <linux/interrupt.h>
30#include <linux/io.h> 33#include <linux/io.h>
31 34
32#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/platform.h>
37#include <asm/hardware/arm_timer.h>
33#include <asm/irq.h> 38#include <asm/irq.h>
34#include <asm/setup.h> 39#include <asm/setup.h>
35#include <asm/param.h> /* HZ */ 40#include <asm/param.h> /* HZ */
@@ -43,8 +48,6 @@
43#include <asm/mach/map.h> 48#include <asm/mach/map.h>
44#include <asm/mach/time.h> 49#include <asm/mach/time.h>
45 50
46#include "common.h"
47
48/* 51/*
49 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx 52 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
50 * is the (PA >> 12). 53 * is the (PA >> 12).
@@ -55,7 +58,7 @@
55#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) 58#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
56#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) 59#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE)
57#define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) 60#define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE)
58#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_IC_OFFSET 61#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_IC)
59 62
60/* 63/*
61 * Logical Physical 64 * Logical Physical
@@ -117,8 +120,8 @@ static struct map_desc ap_io_desc[] __initdata = {
117 .length = SZ_4K, 120 .length = SZ_4K,
118 .type = MT_DEVICE 121 .type = MT_DEVICE
119 }, { 122 }, {
120 .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), 123 .virtual = IO_ADDRESS(INTEGRATOR_AP_GPIO_BASE),
121 .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), 124 .pfn = __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE),
122 .length = SZ_4K, 125 .length = SZ_4K,
123 .type = MT_DEVICE 126 .type = MT_DEVICE
124 }, { 127 }, {
@@ -334,14 +337,163 @@ static void __init ap_init(void)
334 } 337 }
335} 338}
336 339
340/*
341 * Where is the timer (VA)?
342 */
343#define TIMER0_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER0_BASE)
344#define TIMER1_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER1_BASE)
345#define TIMER2_VA_BASE IO_ADDRESS(INTEGRATOR_TIMER2_BASE)
346
347/*
348 * How long is the timer interval?
349 */
350#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
351#if TIMER_INTERVAL >= 0x100000
352#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
353#elif TIMER_INTERVAL >= 0x10000
354#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
355#else
356#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
357#endif
358
359static unsigned long timer_reload;
360
361static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE;
362
363static cycle_t timersp_read(struct clocksource *cs)
364{
365 return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff);
366}
367
368static struct clocksource clocksource_timersp = {
369 .name = "timer2",
370 .rating = 200,
371 .read = timersp_read,
372 .mask = CLOCKSOURCE_MASK(16),
373 .shift = 16,
374 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
375};
376
377static void integrator_clocksource_init(u32 khz)
378{
379 struct clocksource *cs = &clocksource_timersp;
380 void __iomem *base = clksrc_base;
381 u32 ctrl = TIMER_CTRL_ENABLE;
382
383 if (khz >= 1500) {
384 khz /= 16;
385 ctrl = TIMER_CTRL_DIV16;
386 }
387
388 writel(ctrl, base + TIMER_CTRL);
389 writel(0xffff, base + TIMER_LOAD);
390
391 cs->mult = clocksource_khz2mult(khz, cs->shift);
392 clocksource_register(cs);
393}
394
395static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
396
397/*
398 * IRQ handler for the timer
399 */
400static irqreturn_t integrator_timer_interrupt(int irq, void *dev_id)
401{
402 struct clock_event_device *evt = dev_id;
403
404 /* clear the interrupt */
405 writel(1, clkevt_base + TIMER_INTCLR);
406
407 evt->event_handler(evt);
408
409 return IRQ_HANDLED;
410}
411
412static void clkevt_set_mode(enum clock_event_mode mode, struct clock_event_device *evt)
413{
414 u32 ctrl = readl(clkevt_base + TIMER_CTRL) & ~TIMER_CTRL_ENABLE;
415
416 BUG_ON(mode == CLOCK_EVT_MODE_ONESHOT);
417
418 if (mode == CLOCK_EVT_MODE_PERIODIC) {
419 writel(ctrl, clkevt_base + TIMER_CTRL);
420 writel(timer_reload, clkevt_base + TIMER_LOAD);
421 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
422 }
423
424 writel(ctrl, clkevt_base + TIMER_CTRL);
425}
426
427static int clkevt_set_next_event(unsigned long next, struct clock_event_device *evt)
428{
429 unsigned long ctrl = readl(clkevt_base + TIMER_CTRL);
430
431 writel(ctrl & ~TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL);
432 writel(next, clkevt_base + TIMER_LOAD);
433 writel(ctrl | TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL);
434
435 return 0;
436}
437
438static struct clock_event_device integrator_clockevent = {
439 .name = "timer1",
440 .shift = 34,
441 .features = CLOCK_EVT_FEAT_PERIODIC,
442 .set_mode = clkevt_set_mode,
443 .set_next_event = clkevt_set_next_event,
444 .rating = 300,
445 .cpumask = cpu_all_mask,
446};
447
448static struct irqaction integrator_timer_irq = {
449 .name = "timer",
450 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
451 .handler = integrator_timer_interrupt,
452 .dev_id = &integrator_clockevent,
453};
454
455static void integrator_clockevent_init(u32 khz)
456{
457 struct clock_event_device *evt = &integrator_clockevent;
458 unsigned int ctrl = 0;
459
460 if (khz * 1000 > 0x100000 * HZ) {
461 khz /= 256;
462 ctrl |= TIMER_CTRL_DIV256;
463 } else if (khz * 1000 > 0x10000 * HZ) {
464 khz /= 16;
465 ctrl |= TIMER_CTRL_DIV16;
466 }
467
468 timer_reload = khz * 1000 / HZ;
469 writel(ctrl, clkevt_base + TIMER_CTRL);
470
471 evt->irq = IRQ_TIMERINT1;
472 evt->mult = div_sc(khz, NSEC_PER_MSEC, evt->shift);
473 evt->max_delta_ns = clockevent_delta2ns(0xffff, evt);
474 evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
475
476 setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
477 clockevents_register_device(evt);
478}
479
480/*
481 * Set up timer(s).
482 */
337static void __init ap_init_timer(void) 483static void __init ap_init_timer(void)
338{ 484{
339 integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0); 485 u32 khz = TICKS_PER_uSEC * 1000;
486
487 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
488 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
489 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
490
491 integrator_clocksource_init(khz);
492 integrator_clockevent_init(khz);
340} 493}
341 494
342static struct sys_timer ap_timer = { 495static struct sys_timer ap_timer = {
343 .init = ap_init_timer, 496 .init = ap_init_timer,
344 .offset = integrator_gettimeoffset,
345}; 497};
346 498
347MACHINE_START(INTEGRATOR, "ARM-Integrator") 499MACHINE_START(INTEGRATOR, "ARM-Integrator")
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 66ef86d6d9e3..54edb6b8504f 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -25,10 +25,12 @@
25#include <asm/clkdev.h> 25#include <asm/clkdev.h>
26#include <mach/clkdev.h> 26#include <mach/clkdev.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/platform.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
29#include <asm/setup.h> 30#include <asm/setup.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/hardware/icst525.h> 32#include <asm/hardware/arm_timer.h>
33#include <asm/hardware/icst.h>
32 34
33#include <mach/cm.h> 35#include <mach/cm.h>
34#include <mach/lm.h> 36#include <mach/lm.h>
@@ -39,24 +41,20 @@
39#include <asm/mach/map.h> 41#include <asm/mach/map.h>
40#include <asm/mach/time.h> 42#include <asm/mach/time.h>
41 43
42#include "common.h" 44#include <plat/timer-sp.h>
43
44#define INTCP_PA_MMC_BASE 0x1c000000
45#define INTCP_PA_AACI_BASE 0x1d000000
46 45
47#define INTCP_PA_FLASH_BASE 0x24000000 46#define INTCP_PA_FLASH_BASE 0x24000000
48#define INTCP_FLASH_SIZE SZ_32M 47#define INTCP_FLASH_SIZE SZ_32M
49 48
50#define INTCP_PA_CLCD_BASE 0xc0000000 49#define INTCP_PA_CLCD_BASE 0xc0000000
51 50
52#define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE) + 0x40 51#define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x40)
53#define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) 52#define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE)
54#define INTCP_VA_SIC_BASE IO_ADDRESS(0xca000000) 53#define INTCP_VA_SIC_BASE IO_ADDRESS(INTEGRATOR_CP_SIC_BASE)
55 54
56#define INTCP_PA_ETH_BASE 0xc8000000
57#define INTCP_ETH_SIZE 0x10 55#define INTCP_ETH_SIZE 0x10
58 56
59#define INTCP_VA_CTRL_BASE IO_ADDRESS(0xcb000000) 57#define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE)
60#define INTCP_FLASHPROG 0x04 58#define INTCP_FLASHPROG 0x04
61#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) 59#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
62#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) 60#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
@@ -71,7 +69,9 @@
71 * f1600000 16000000 UART 0 69 * f1600000 16000000 UART 0
72 * f1700000 17000000 UART 1 70 * f1700000 17000000 UART 1
73 * f1a00000 1a000000 Debug LEDs 71 * f1a00000 1a000000 Debug LEDs
74 * f1b00000 1b000000 GPIO 72 * fc900000 c9000000 GPIO
73 * fca00000 ca000000 SIC
74 * fcb00000 cb000000 CP system control
75 */ 75 */
76 76
77static struct map_desc intcp_io_desc[] __initdata = { 77static struct map_desc intcp_io_desc[] __initdata = {
@@ -116,18 +116,18 @@ static struct map_desc intcp_io_desc[] __initdata = {
116 .length = SZ_4K, 116 .length = SZ_4K,
117 .type = MT_DEVICE 117 .type = MT_DEVICE
118 }, { 118 }, {
119 .virtual = IO_ADDRESS(INTEGRATOR_GPIO_BASE), 119 .virtual = IO_ADDRESS(INTEGRATOR_CP_GPIO_BASE),
120 .pfn = __phys_to_pfn(INTEGRATOR_GPIO_BASE), 120 .pfn = __phys_to_pfn(INTEGRATOR_CP_GPIO_BASE),
121 .length = SZ_4K, 121 .length = SZ_4K,
122 .type = MT_DEVICE 122 .type = MT_DEVICE
123 }, { 123 }, {
124 .virtual = IO_ADDRESS(0xca000000), 124 .virtual = IO_ADDRESS(INTEGRATOR_CP_SIC_BASE),
125 .pfn = __phys_to_pfn(0xca000000), 125 .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE),
126 .length = SZ_4K, 126 .length = SZ_4K,
127 .type = MT_DEVICE 127 .type = MT_DEVICE
128 }, { 128 }, {
129 .virtual = IO_ADDRESS(0xcb000000), 129 .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE),
130 .pfn = __phys_to_pfn(0xcb000000), 130 .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE),
131 .length = SZ_4K, 131 .length = SZ_4K,
132 .type = MT_DEVICE 132 .type = MT_DEVICE
133 } 133 }
@@ -266,33 +266,43 @@ static void __init intcp_init_irq(void)
266/* 266/*
267 * Clock handling 267 * Clock handling
268 */ 268 */
269#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET) 269#define CM_LOCK (__io_address(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET)
270#define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c) 270#define CM_AUXOSC (__io_address(INTEGRATOR_HDR_BASE)+0x1c)
271 271
272static const struct icst525_params cp_auxvco_params = { 272static const struct icst_params cp_auxvco_params = {
273 .ref = 24000, 273 .ref = 24000000,
274 .vco_max = 320000, 274 .vco_max = ICST525_VCO_MAX_5V,
275 .vco_min = ICST525_VCO_MIN,
275 .vd_min = 8, 276 .vd_min = 8,
276 .vd_max = 263, 277 .vd_max = 263,
277 .rd_min = 3, 278 .rd_min = 3,
278 .rd_max = 65, 279 .rd_max = 65,
280 .s2div = icst525_s2div,
281 .idx2s = icst525_idx2s,
279}; 282};
280 283
281static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco) 284static void cp_auxvco_set(struct clk *clk, struct icst_vco vco)
282{ 285{
283 u32 val; 286 u32 val;
284 287
285 val = readl(CM_AUXOSC) & ~0x7ffff; 288 val = readl(clk->vcoreg) & ~0x7ffff;
286 val |= vco.v | (vco.r << 9) | (vco.s << 16); 289 val |= vco.v | (vco.r << 9) | (vco.s << 16);
287 290
288 writel(0xa05f, CM_LOCK); 291 writel(0xa05f, CM_LOCK);
289 writel(val, CM_AUXOSC); 292 writel(val, clk->vcoreg);
290 writel(0, CM_LOCK); 293 writel(0, CM_LOCK);
291} 294}
292 295
296static const struct clk_ops cp_auxclk_ops = {
297 .round = icst_clk_round,
298 .set = icst_clk_set,
299 .setvco = cp_auxvco_set,
300};
301
293static struct clk cp_auxclk = { 302static struct clk cp_auxclk = {
303 .ops = &cp_auxclk_ops,
294 .params = &cp_auxvco_params, 304 .params = &cp_auxvco_params,
295 .setvco = cp_auxvco_set, 305 .vcoreg = CM_AUXOSC,
296}; 306};
297 307
298static struct clk_lookup cp_lookups[] = { 308static struct clk_lookup cp_lookups[] = {
@@ -363,8 +373,8 @@ static struct platform_device intcp_flash_device = {
363 373
364static struct resource smc91x_resources[] = { 374static struct resource smc91x_resources[] = {
365 [0] = { 375 [0] = {
366 .start = INTCP_PA_ETH_BASE, 376 .start = INTEGRATOR_CP_ETH_BASE,
367 .end = INTCP_PA_ETH_BASE + INTCP_ETH_SIZE - 1, 377 .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
368 .flags = IORESOURCE_MEM, 378 .flags = IORESOURCE_MEM,
369 }, 379 },
370 [1] = { 380 [1] = {
@@ -394,8 +404,8 @@ static struct platform_device *intcp_devs[] __initdata = {
394 */ 404 */
395static unsigned int mmc_status(struct device *dev) 405static unsigned int mmc_status(struct device *dev)
396{ 406{
397 unsigned int status = readl(IO_ADDRESS(0xca000000) + 4); 407 unsigned int status = readl(IO_ADDRESS(0xca000000 + 4));
398 writel(8, IO_ADDRESS(0xcb000000) + 8); 408 writel(8, IO_ADDRESS(INTEGRATOR_CP_CTL_BASE + 8));
399 409
400 return status & 8; 410 return status & 8;
401} 411}
@@ -413,8 +423,8 @@ static struct amba_device mmc_device = {
413 .platform_data = &mmc_data, 423 .platform_data = &mmc_data,
414 }, 424 },
415 .res = { 425 .res = {
416 .start = INTCP_PA_MMC_BASE, 426 .start = INTEGRATOR_CP_MMC_BASE,
417 .end = INTCP_PA_MMC_BASE + SZ_4K - 1, 427 .end = INTEGRATOR_CP_MMC_BASE + SZ_4K - 1,
418 .flags = IORESOURCE_MEM, 428 .flags = IORESOURCE_MEM,
419 }, 429 },
420 .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, 430 .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 },
@@ -426,8 +436,8 @@ static struct amba_device aaci_device = {
426 .init_name = "mb:1d", 436 .init_name = "mb:1d",
427 }, 437 },
428 .res = { 438 .res = {
429 .start = INTCP_PA_AACI_BASE, 439 .start = INTEGRATOR_CP_AACI_BASE,
430 .end = INTCP_PA_AACI_BASE + SZ_4K - 1, 440 .end = INTEGRATOR_CP_AACI_BASE + SZ_4K - 1,
431 .flags = IORESOURCE_MEM, 441 .flags = IORESOURCE_MEM,
432 }, 442 },
433 .irq = { IRQ_CP_AACIINT, NO_IRQ }, 443 .irq = { IRQ_CP_AACIINT, NO_IRQ },
@@ -567,16 +577,22 @@ static void __init intcp_init(void)
567 } 577 }
568} 578}
569 579
570#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable */ 580#define TIMER0_VA_BASE __io_address(INTEGRATOR_TIMER0_BASE)
581#define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
582#define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
571 583
572static void __init intcp_timer_init(void) 584static void __init intcp_timer_init(void)
573{ 585{
574 integrator_time_init(1000000 / HZ, TIMER_CTRL_IE); 586 writel(0, TIMER0_VA_BASE + TIMER_CTRL);
587 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
588 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
589
590 sp804_clocksource_init(TIMER2_VA_BASE);
591 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1);
575} 592}
576 593
577static struct sys_timer cp_timer = { 594static struct sys_timer cp_timer = {
578 .init = intcp_timer_init, 595 .init = intcp_timer_init,
579 .offset = integrator_gettimeoffset,
580}; 596};
581 597
582MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 598MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index 8dcc823f4135..28be186adb89 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -27,6 +27,7 @@
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/platform.h>
30#include <asm/leds.h> 31#include <asm/leds.h>
31#include <asm/system.h> 32#include <asm/system.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index 148d25fc636f..e5491629c6da 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -30,6 +30,7 @@
30#include <linux/io.h> 30#include <linux/io.h>
31 31
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/platform.h>
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/signal.h> 35#include <asm/signal.h>
35#include <asm/system.h> 36#include <asm/system.h>
@@ -390,9 +391,9 @@ static int __init pci_v3_setup_resources(struct resource **resource)
390 * means I can't get additional information on the reason for the pm2fb 391 * means I can't get additional information on the reason for the pm2fb
391 * problems. I suppose I'll just have to mind-meld with the machine. ;) 392 * problems. I suppose I'll just have to mind-meld with the machine. ;)
392 */ 393 */
393#define SC_PCI (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_PCIENABLE_OFFSET) 394#define SC_PCI IO_ADDRESS(INTEGRATOR_SC_PCIENABLE)
394#define SC_LBFADDR (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x20) 395#define SC_LBFADDR IO_ADDRESS(INTEGRATOR_SC_BASE + 0x20)
395#define SC_LBFCODE (IO_ADDRESS(INTEGRATOR_SC_BASE) + 0x24) 396#define SC_LBFCODE IO_ADDRESS(INTEGRATOR_SC_BASE + 0x24)
396 397
397static int 398static int
398v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 399v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index 2a5c637639bb..266b1f58a784 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -177,7 +177,7 @@ static struct plat_serial8250_port n2100_serial_port[] = {
177 .mapbase = N2100_UART, 177 .mapbase = N2100_UART,
178 .membase = (char *)N2100_UART, 178 .membase = (char *)N2100_UART,
179 .irq = 0, 179 .irq = 0,
180 .flags = UPF_SKIP_TEST, 180 .flags = UPF_SKIP_TEST | UPF_AUTO_IRQ | UPF_SHARE_IRQ,
181 .iotype = UPIO_MEM, 181 .iotype = UPIO_MEM,
182 .regshift = 0, 182 .regshift = 0,
183 .uartclk = 1843200, 183 .uartclk = 1843200,
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 3c5e0f522e9c..71f3ea623974 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -6,6 +6,7 @@ config MACH_NOMADIK_8815NHK
6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)" 6 bool "ST 8815 Nomadik Hardware Kit (evaluation board)"
7 select NOMADIK_8815 7 select NOMADIK_8815
8 select HAS_MTU 8 select HAS_MTU
9 select NOMADIK_GPIO
9 10
10endmenu 11endmenu
11 12
diff --git a/arch/arm/mach-nomadik/Makefile b/arch/arm/mach-nomadik/Makefile
index 36f67fb207d2..a6bbd1a7b4e7 100644
--- a/arch/arm/mach-nomadik/Makefile
+++ b/arch/arm/mach-nomadik/Makefile
@@ -7,7 +7,7 @@
7 7
8# Object file lists. 8# Object file lists.
9 9
10obj-y += clock.o gpio.o 10obj-y += clock.o
11 11
12# Cpu revision 12# Cpu revision
13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o 13obj-$(CONFIG_NOMADIK_8815) += cpu-8815.o
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index ab3712c86d2b..841d459ad59d 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -32,7 +32,6 @@
32#include <mach/setup.h> 32#include <mach/setup.h>
33#include <mach/nand.h> 33#include <mach/nand.h>
34#include <mach/fsmc.h> 34#include <mach/fsmc.h>
35#include "clock.h"
36 35
37/* Initial value for SRC control register: all timers use MXTAL/8 source */ 36/* Initial value for SRC control register: all timers use MXTAL/8 source */
38#define SRC_CR_INIT_MASK 0x00007fff 37#define SRC_CR_INIT_MASK 0x00007fff
@@ -202,11 +201,6 @@ static struct amba_device *amba_devs[] __initdata = {
202 &uart1_device, 201 &uart1_device,
203}; 202};
204 203
205/* We have a fixed clock alone, by now */
206static struct clk nhk8815_clk_48 = {
207 .rate = 48*1000*1000,
208};
209
210static struct resource nhk8815_eth_resources[] = { 204static struct resource nhk8815_eth_resources[] = {
211 { 205 {
212 .name = "smc91x-regs", 206 .name = "smc91x-regs",
@@ -276,10 +270,8 @@ static void __init nhk8815_platform_init(void)
276 platform_add_devices(nhk8815_platform_devices, 270 platform_add_devices(nhk8815_platform_devices,
277 ARRAY_SIZE(nhk8815_platform_devices)); 271 ARRAY_SIZE(nhk8815_platform_devices));
278 272
279 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 273 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
280 nmdk_clk_create(&nhk8815_clk_48, amba_devs[i]->dev.init_name);
281 amba_device_register(amba_devs[i], &iomem_resource); 274 amba_device_register(amba_devs[i], &iomem_resource);
282 }
283} 275}
284 276
285MACHINE_START(NOMADIK, "NHK8815") 277MACHINE_START(NOMADIK, "NHK8815")
diff --git a/arch/arm/mach-nomadik/clock.c b/arch/arm/mach-nomadik/clock.c
index 9f92502a0083..60f5bee09f2e 100644
--- a/arch/arm/mach-nomadik/clock.c
+++ b/arch/arm/mach-nomadik/clock.c
@@ -32,14 +32,36 @@ void clk_disable(struct clk *clk)
32} 32}
33EXPORT_SYMBOL(clk_disable); 33EXPORT_SYMBOL(clk_disable);
34 34
35/* Create a clock structure with the given name */ 35/* We have a fixed clock alone, for now */
36int nmdk_clk_create(struct clk *clk, const char *dev_id) 36static struct clk clk_48 = {
37{ 37 .rate = 48 * 1000 * 1000,
38 struct clk_lookup *clkdev; 38};
39
40/*
41 * Catch-all default clock to satisfy drivers using the clk API. We don't
42 * model the actual hardware clocks yet.
43 */
44static struct clk clk_default;
39 45
40 clkdev = clkdev_alloc(clk, NULL, dev_id); 46#define CLK(_clk, dev) \
41 if (!clkdev) 47 { \
42 return -ENOMEM; 48 .clk = _clk, \
43 clkdev_add(clkdev); 49 .dev_id = dev, \
50 }
51
52static struct clk_lookup lookups[] = {
53 CLK(&clk_48, "uart0"),
54 CLK(&clk_48, "uart1"),
55 CLK(&clk_default, "gpio.0"),
56 CLK(&clk_default, "gpio.1"),
57 CLK(&clk_default, "gpio.2"),
58 CLK(&clk_default, "gpio.3"),
59};
60
61static int __init clk_init(void)
62{
63 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
44 return 0; 64 return 0;
45} 65}
66
67arch_initcall(clk_init);
diff --git a/arch/arm/mach-nomadik/clock.h b/arch/arm/mach-nomadik/clock.h
index 235faec7f627..5563985a2cc7 100644
--- a/arch/arm/mach-nomadik/clock.h
+++ b/arch/arm/mach-nomadik/clock.h
@@ -11,4 +11,3 @@
11struct clk { 11struct clk {
12 unsigned long rate; 12 unsigned long rate;
13}; 13};
14extern int nmdk_clk_create(struct clk *clk, const char *dev_id);
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 9bf33b30a025..91c3c901b469 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/amba/bus.h> 22#include <linux/amba/bus.h>
23#include <linux/platform_device.h>
23#include <linux/gpio.h> 24#include <linux/gpio.h>
24 25
25#include <mach/hardware.h> 26#include <mach/hardware.h>
@@ -30,60 +31,66 @@
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/hardware/cache-l2x0.h> 32#include <asm/hardware/cache-l2x0.h>
32 33
34#define __MEM_4K_RESOURCE(x) \
35 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
36
33/* The 8815 has 4 GPIO blocks, let's register them immediately */ 37/* The 8815 has 4 GPIO blocks, let's register them immediately */
38
39#define GPIO_RESOURCE(block) \
40 { \
41 .start = NOMADIK_GPIO##block##_BASE, \
42 .end = NOMADIK_GPIO##block##_BASE + SZ_4K - 1, \
43 .flags = IORESOURCE_MEM, \
44 }, \
45 { \
46 .start = IRQ_GPIO##block, \
47 .end = IRQ_GPIO##block, \
48 .flags = IORESOURCE_IRQ, \
49 }
50
51#define GPIO_DEVICE(block) \
52 { \
53 .name = "gpio", \
54 .id = block, \
55 .num_resources = 2, \
56 .resource = &cpu8815_gpio_resources[block * 2], \
57 .dev = { \
58 .platform_data = &cpu8815_gpio[block], \
59 }, \
60 }
61
34static struct nmk_gpio_platform_data cpu8815_gpio[] = { 62static struct nmk_gpio_platform_data cpu8815_gpio[] = {
35 { 63 {
36 .name = "GPIO-0-31", 64 .name = "GPIO-0-31",
37 .first_gpio = 0, 65 .first_gpio = 0,
38 .first_irq = NOMADIK_GPIO_TO_IRQ(0), 66 .first_irq = NOMADIK_GPIO_TO_IRQ(0),
39 .parent_irq = IRQ_GPIO0,
40 }, { 67 }, {
41 .name = "GPIO-32-63", 68 .name = "GPIO-32-63",
42 .first_gpio = 32, 69 .first_gpio = 32,
43 .first_irq = NOMADIK_GPIO_TO_IRQ(32), 70 .first_irq = NOMADIK_GPIO_TO_IRQ(32),
44 .parent_irq = IRQ_GPIO1,
45 }, { 71 }, {
46 .name = "GPIO-64-95", 72 .name = "GPIO-64-95",
47 .first_gpio = 64, 73 .first_gpio = 64,
48 .first_irq = NOMADIK_GPIO_TO_IRQ(64), 74 .first_irq = NOMADIK_GPIO_TO_IRQ(64),
49 .parent_irq = IRQ_GPIO2,
50 }, { 75 }, {
51 .name = "GPIO-96-127", /* 124..127 not routed to pin */ 76 .name = "GPIO-96-127", /* 124..127 not routed to pin */
52 .first_gpio = 96, 77 .first_gpio = 96,
53 .first_irq = NOMADIK_GPIO_TO_IRQ(96), 78 .first_irq = NOMADIK_GPIO_TO_IRQ(96),
54 .parent_irq = IRQ_GPIO3,
55 } 79 }
56}; 80};
57 81
58#define __MEM_4K_RESOURCE(x) \ 82static struct resource cpu8815_gpio_resources[] = {
59 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM} 83 GPIO_RESOURCE(0),
84 GPIO_RESOURCE(1),
85 GPIO_RESOURCE(2),
86 GPIO_RESOURCE(3),
87};
60 88
61static struct amba_device cpu8815_amba_gpio[] = { 89static struct platform_device cpu8815_platform_gpio[] = {
62 { 90 GPIO_DEVICE(0),
63 .dev = { 91 GPIO_DEVICE(1),
64 .init_name = "gpio0", 92 GPIO_DEVICE(2),
65 .platform_data = cpu8815_gpio + 0, 93 GPIO_DEVICE(3),
66 },
67 __MEM_4K_RESOURCE(NOMADIK_GPIO0_BASE),
68 }, {
69 .dev = {
70 .init_name = "gpio1",
71 .platform_data = cpu8815_gpio + 1,
72 },
73 __MEM_4K_RESOURCE(NOMADIK_GPIO1_BASE),
74 }, {
75 .dev = {
76 .init_name = "gpio2",
77 .platform_data = cpu8815_gpio + 2,
78 },
79 __MEM_4K_RESOURCE(NOMADIK_GPIO2_BASE),
80 }, {
81 .dev = {
82 .init_name = "gpio3",
83 .platform_data = cpu8815_gpio + 3,
84 },
85 __MEM_4K_RESOURCE(NOMADIK_GPIO3_BASE),
86 },
87}; 94};
88 95
89static struct amba_device cpu8815_amba_rng = { 96static struct amba_device cpu8815_amba_rng = {
@@ -93,11 +100,14 @@ static struct amba_device cpu8815_amba_rng = {
93 __MEM_4K_RESOURCE(NOMADIK_RNG_BASE), 100 __MEM_4K_RESOURCE(NOMADIK_RNG_BASE),
94}; 101};
95 102
103static struct platform_device *platform_devs[] __initdata = {
104 cpu8815_platform_gpio + 0,
105 cpu8815_platform_gpio + 1,
106 cpu8815_platform_gpio + 2,
107 cpu8815_platform_gpio + 3,
108};
109
96static struct amba_device *amba_devs[] __initdata = { 110static struct amba_device *amba_devs[] __initdata = {
97 cpu8815_amba_gpio + 0,
98 cpu8815_amba_gpio + 1,
99 cpu8815_amba_gpio + 2,
100 cpu8815_amba_gpio + 3,
101 &cpu8815_amba_rng 111 &cpu8815_amba_rng
102}; 112};
103 113
@@ -105,6 +115,7 @@ static int __init cpu8815_init(void)
105{ 115{
106 int i; 116 int i;
107 117
118 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
108 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) 119 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
109 amba_device_register(amba_devs[i], &iomem_resource); 120 amba_device_register(amba_devs[i], &iomem_resource);
110 return 0; 121 return 0;
diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h
index 61577c9f9a7d..7a81a0420343 100644
--- a/arch/arm/mach-nomadik/include/mach/gpio.h
+++ b/arch/arm/mach-nomadik/include/mach/gpio.h
@@ -1,71 +1,6 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __ASM_ARCH_GPIO_H 1#ifndef __ASM_ARCH_GPIO_H
13#define __ASM_ARCH_GPIO_H 2#define __ASM_ARCH_GPIO_H
14 3
15#include <asm-generic/gpio.h> 4#include <plat/gpio.h>
16
17/*
18 * These currently cause a function call to happen, they may be optimized
19 * if needed by adding cpu-specific defines to identify blocks
20 * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc)
21 */
22#define gpio_get_value __gpio_get_value
23#define gpio_set_value __gpio_set_value
24#define gpio_cansleep __gpio_cansleep
25#define gpio_to_irq __gpio_to_irq
26
27/*
28 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
29 * the "gpio" namespace for generic and cross-machine functions
30 */
31
32/* Register in the logic block */
33#define NMK_GPIO_DAT 0x00
34#define NMK_GPIO_DATS 0x04
35#define NMK_GPIO_DATC 0x08
36#define NMK_GPIO_PDIS 0x0c
37#define NMK_GPIO_DIR 0x10
38#define NMK_GPIO_DIRS 0x14
39#define NMK_GPIO_DIRC 0x18
40#define NMK_GPIO_SLPC 0x1c
41#define NMK_GPIO_AFSLA 0x20
42#define NMK_GPIO_AFSLB 0x24
43
44#define NMK_GPIO_RIMSC 0x40
45#define NMK_GPIO_FIMSC 0x44
46#define NMK_GPIO_IS 0x48
47#define NMK_GPIO_IC 0x4c
48#define NMK_GPIO_RWIMSC 0x50
49#define NMK_GPIO_FWIMSC 0x54
50#define NMK_GPIO_WKS 0x58
51
52/* Alternate functions: function C is set in hw by setting both A and B */
53#define NMK_GPIO_ALT_GPIO 0
54#define NMK_GPIO_ALT_A 1
55#define NMK_GPIO_ALT_B 2
56#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
57
58extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
59extern int nmk_gpio_get_mode(int gpio);
60
61/*
62 * Platform data to register a block: only the initial gpio/irq number.
63 */
64struct nmk_gpio_platform_data {
65 char *name;
66 int first_gpio;
67 int first_irq;
68 int parent_irq;
69};
70 5
71#endif /* __ASM_ARCH_GPIO_H */ 6#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d7733610..4a1c2328bcc3 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -17,8 +17,10 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/irqs.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23#include <asm/pmu.h>
22 24
23#include <plat/control.h> 25#include <plat/control.h>
24#include <plat/tc.h> 26#include <plat/tc.h>
@@ -453,6 +455,37 @@ static void omap_init_mcspi(void)
453static inline void omap_init_mcspi(void) {} 455static inline void omap_init_mcspi(void) {}
454#endif 456#endif
455 457
458static struct resource omap2_pmu_resource = {
459 .start = 3,
460 .end = 3,
461 .flags = IORESOURCE_IRQ,
462};
463
464static struct resource omap3_pmu_resource = {
465 .start = INT_34XX_BENCH_MPU_EMUL,
466 .end = INT_34XX_BENCH_MPU_EMUL,
467 .flags = IORESOURCE_IRQ,
468};
469
470static struct platform_device omap_pmu_device = {
471 .name = "arm-pmu",
472 .id = ARM_PMU_DEVICE_CPU,
473 .num_resources = 1,
474};
475
476static void omap_init_pmu(void)
477{
478 if (cpu_is_omap24xx())
479 omap_pmu_device.resource = &omap2_pmu_resource;
480 else if (cpu_is_omap34xx())
481 omap_pmu_device.resource = &omap3_pmu_resource;
482 else
483 return;
484
485 platform_device_register(&omap_pmu_device);
486}
487
488
456#ifdef CONFIG_OMAP_SHA1_MD5 489#ifdef CONFIG_OMAP_SHA1_MD5
457static struct resource sha1_md5_resources[] = { 490static struct resource sha1_md5_resources[] = {
458 { 491 {
@@ -797,6 +830,7 @@ static int __init omap2_init_devices(void)
797 omap_init_camera(); 830 omap_init_camera();
798 omap_init_mbox(); 831 omap_init_mbox();
799 omap_init_mcspi(); 832 omap_init_mcspi();
833 omap_init_pmu();
800 omap_hdq_init(); 834 omap_hdq_init();
801 omap_init_sti(); 835 omap_init_sti();
802 omap_init_sha1_md5(); 836 omap_init_sha1_md5();
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index e704edb733c0..a01b76b7c956 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := core.o clock.o 5obj-y := core.o
6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o 6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
7obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o 7obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o
8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o 8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o
diff --git a/arch/arm/mach-realview/clock.c b/arch/arm/mach-realview/clock.c
deleted file mode 100644
index a7043115de72..000000000000
--- a/arch/arm/mach-realview/clock.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * linux/arch/arm/mach-realview/clock.c
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/device.h>
14#include <linux/list.h>
15#include <linux/errno.h>
16#include <linux/err.h>
17#include <linux/string.h>
18#include <linux/clk.h>
19#include <linux/mutex.h>
20
21#include <asm/hardware/icst307.h>
22
23#include "clock.h"
24
25int clk_enable(struct clk *clk)
26{
27 return 0;
28}
29EXPORT_SYMBOL(clk_enable);
30
31void clk_disable(struct clk *clk)
32{
33}
34EXPORT_SYMBOL(clk_disable);
35
36unsigned long clk_get_rate(struct clk *clk)
37{
38 return clk->rate;
39}
40EXPORT_SYMBOL(clk_get_rate);
41
42long clk_round_rate(struct clk *clk, unsigned long rate)
43{
44 struct icst307_vco vco;
45 vco = icst307_khz_to_vco(clk->params, rate / 1000);
46 return icst307_khz(clk->params, vco) * 1000;
47}
48EXPORT_SYMBOL(clk_round_rate);
49
50int clk_set_rate(struct clk *clk, unsigned long rate)
51{
52 int ret = -EIO;
53
54 if (clk->setvco) {
55 struct icst307_vco vco;
56
57 vco = icst307_khz_to_vco(clk->params, rate / 1000);
58 clk->rate = icst307_khz(clk->params, vco) * 1000;
59 clk->setvco(clk, vco);
60 ret = 0;
61 }
62 return ret;
63}
64EXPORT_SYMBOL(clk_set_rate);
diff --git a/arch/arm/mach-realview/clock.h b/arch/arm/mach-realview/clock.h
deleted file mode 100644
index ebbb0f06b600..000000000000
--- a/arch/arm/mach-realview/clock.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * linux/arch/arm/mach-realview/clock.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct module;
12struct icst307_params;
13
14struct clk {
15 unsigned long rate;
16 const struct icst307_params *params;
17 void *data;
18 void (*setvco)(struct clk *, struct icst307_vco vco);
19};
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 90bd4ef71b2c..1b468bd490af 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -25,8 +25,6 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/amba/bus.h> 26#include <linux/amba/bus.h>
27#include <linux/amba/clcd.h> 27#include <linux/amba/clcd.h>
28#include <linux/clocksource.h>
29#include <linux/clockchips.h>
30#include <linux/io.h> 28#include <linux/io.h>
31#include <linux/smsc911x.h> 29#include <linux/smsc911x.h>
32#include <linux/ata_platform.h> 30#include <linux/ata_platform.h>
@@ -39,7 +37,7 @@
39#include <asm/leds.h> 37#include <asm/leds.h>
40#include <asm/mach-types.h> 38#include <asm/mach-types.h>
41#include <asm/hardware/arm_timer.h> 39#include <asm/hardware/arm_timer.h>
42#include <asm/hardware/icst307.h> 40#include <asm/hardware/icst.h>
43 41
44#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
45#include <asm/mach/flash.h> 43#include <asm/mach/flash.h>
@@ -48,13 +46,12 @@
48 46
49#include <asm/hardware/gic.h> 47#include <asm/hardware/gic.h>
50 48
49#include <mach/clkdev.h>
51#include <mach/platform.h> 50#include <mach/platform.h>
52#include <mach/irqs.h> 51#include <mach/irqs.h>
52#include <plat/timer-sp.h>
53 53
54#include "core.h" 54#include "core.h"
55#include "clock.h"
56
57#define REALVIEW_REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET)
58 55
59/* used by entry-macro.S and platsmp.c */ 56/* used by entry-macro.S and platsmp.c */
60void __iomem *gic_cpu_base_addr; 57void __iomem *gic_cpu_base_addr;
@@ -78,20 +75,6 @@ void __init realview_adjust_zones(int node, unsigned long *size,
78} 75}
79#endif 76#endif
80 77
81/*
82 * This is the RealView sched_clock implementation. This has
83 * a resolution of 41.7ns, and a maximum value of about 179s.
84 */
85unsigned long long sched_clock(void)
86{
87 unsigned long long v;
88
89 v = (unsigned long long)readl(REALVIEW_REFCOUNTER) * 125;
90 do_div(v, 3);
91
92 return v;
93}
94
95 78
96#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) 79#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
97 80
@@ -273,37 +256,40 @@ struct mmci_platform_data realview_mmc1_plat_data = {
273/* 256/*
274 * Clock handling 257 * Clock handling
275 */ 258 */
276static const struct icst307_params realview_oscvco_params = { 259static const struct icst_params realview_oscvco_params = {
277 .ref = 24000, 260 .ref = 24000000,
278 .vco_max = 200000, 261 .vco_max = ICST307_VCO_MAX,
262 .vco_min = ICST307_VCO_MIN,
279 .vd_min = 4 + 8, 263 .vd_min = 4 + 8,
280 .vd_max = 511 + 8, 264 .vd_max = 511 + 8,
281 .rd_min = 1 + 2, 265 .rd_min = 1 + 2,
282 .rd_max = 127 + 2, 266 .rd_max = 127 + 2,
267 .s2div = icst307_s2div,
268 .idx2s = icst307_idx2s,
283}; 269};
284 270
285static void realview_oscvco_set(struct clk *clk, struct icst307_vco vco) 271static void realview_oscvco_set(struct clk *clk, struct icst_vco vco)
286{ 272{
287 void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET; 273 void __iomem *sys_lock = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_LOCK_OFFSET;
288 void __iomem *sys_osc;
289 u32 val; 274 u32 val;
290 275
291 if (machine_is_realview_pb1176()) 276 val = readl(clk->vcoreg) & ~0x7ffff;
292 sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET;
293 else
294 sys_osc = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET;
295
296 val = readl(sys_osc) & ~0x7ffff;
297 val |= vco.v | (vco.r << 9) | (vco.s << 16); 277 val |= vco.v | (vco.r << 9) | (vco.s << 16);
298 278
299 writel(0xa05f, sys_lock); 279 writel(0xa05f, sys_lock);
300 writel(val, sys_osc); 280 writel(val, clk->vcoreg);
301 writel(0, sys_lock); 281 writel(0, sys_lock);
302} 282}
303 283
284static const struct clk_ops oscvco_clk_ops = {
285 .round = icst_clk_round,
286 .set = icst_clk_set,
287 .setvco = realview_oscvco_set,
288};
289
304static struct clk oscvco_clk = { 290static struct clk oscvco_clk = {
291 .ops = &oscvco_clk_ops,
305 .params = &realview_oscvco_params, 292 .params = &realview_oscvco_params,
306 .setvco = realview_oscvco_set,
307}; 293};
308 294
309/* 295/*
@@ -346,7 +332,13 @@ static struct clk_lookup lookups[] = {
346 332
347static int __init clk_init(void) 333static int __init clk_init(void)
348{ 334{
335 if (machine_is_realview_pb1176())
336 oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET;
337 else
338 oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET;
339
349 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 340 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
341
350 return 0; 342 return 0;
351} 343}
352arch_initcall(clk_init); 344arch_initcall(clk_init);
@@ -643,133 +635,6 @@ void __iomem *timer2_va_base;
643void __iomem *timer3_va_base; 635void __iomem *timer3_va_base;
644 636
645/* 637/*
646 * How long is the timer interval?
647 */
648#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
649#if TIMER_INTERVAL >= 0x100000
650#define TIMER_RELOAD (TIMER_INTERVAL >> 8)
651#define TIMER_DIVISOR (TIMER_CTRL_DIV256)
652#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
653#elif TIMER_INTERVAL >= 0x10000
654#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
655#define TIMER_DIVISOR (TIMER_CTRL_DIV16)
656#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
657#else
658#define TIMER_RELOAD (TIMER_INTERVAL)
659#define TIMER_DIVISOR (TIMER_CTRL_DIV1)
660#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
661#endif
662
663static void timer_set_mode(enum clock_event_mode mode,
664 struct clock_event_device *clk)
665{
666 unsigned long ctrl;
667
668 switch(mode) {
669 case CLOCK_EVT_MODE_PERIODIC:
670 writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD);
671
672 ctrl = TIMER_CTRL_PERIODIC;
673 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
674 break;
675 case CLOCK_EVT_MODE_ONESHOT:
676 /* period set, and timer enabled in 'next_event' hook */
677 ctrl = TIMER_CTRL_ONESHOT;
678 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE;
679 break;
680 case CLOCK_EVT_MODE_UNUSED:
681 case CLOCK_EVT_MODE_SHUTDOWN:
682 default:
683 ctrl = 0;
684 }
685
686 writel(ctrl, timer0_va_base + TIMER_CTRL);
687}
688
689static int timer_set_next_event(unsigned long evt,
690 struct clock_event_device *unused)
691{
692 unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL);
693
694 writel(evt, timer0_va_base + TIMER_LOAD);
695 writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL);
696
697 return 0;
698}
699
700static struct clock_event_device timer0_clockevent = {
701 .name = "timer0",
702 .shift = 32,
703 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
704 .set_mode = timer_set_mode,
705 .set_next_event = timer_set_next_event,
706 .rating = 300,
707 .cpumask = cpu_all_mask,
708};
709
710static void __init realview_clockevents_init(unsigned int timer_irq)
711{
712 timer0_clockevent.irq = timer_irq;
713 timer0_clockevent.mult =
714 div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
715 timer0_clockevent.max_delta_ns =
716 clockevent_delta2ns(0xffffffff, &timer0_clockevent);
717 timer0_clockevent.min_delta_ns =
718 clockevent_delta2ns(0xf, &timer0_clockevent);
719
720 clockevents_register_device(&timer0_clockevent);
721}
722
723/*
724 * IRQ handler for the timer
725 */
726static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
727{
728 struct clock_event_device *evt = &timer0_clockevent;
729
730 /* clear the interrupt */
731 writel(1, timer0_va_base + TIMER_INTCLR);
732
733 evt->event_handler(evt);
734
735 return IRQ_HANDLED;
736}
737
738static struct irqaction realview_timer_irq = {
739 .name = "RealView Timer Tick",
740 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
741 .handler = realview_timer_interrupt,
742};
743
744static cycle_t realview_get_cycles(struct clocksource *cs)
745{
746 return ~readl(timer3_va_base + TIMER_VALUE);
747}
748
749static struct clocksource clocksource_realview = {
750 .name = "timer3",
751 .rating = 200,
752 .read = realview_get_cycles,
753 .mask = CLOCKSOURCE_MASK(32),
754 .shift = 20,
755 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
756};
757
758static void __init realview_clocksource_init(void)
759{
760 /* setup timer 0 as free-running clocksource */
761 writel(0, timer3_va_base + TIMER_CTRL);
762 writel(0xffffffff, timer3_va_base + TIMER_LOAD);
763 writel(0xffffffff, timer3_va_base + TIMER_VALUE);
764 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
765 timer3_va_base + TIMER_CTRL);
766
767 clocksource_realview.mult =
768 clocksource_khz2mult(1000, clocksource_realview.shift);
769 clocksource_register(&clocksource_realview);
770}
771
772/*
773 * Set up the clock source and clock events devices 638 * Set up the clock source and clock events devices
774 */ 639 */
775void __init realview_timer_init(unsigned int timer_irq) 640void __init realview_timer_init(unsigned int timer_irq)
@@ -796,13 +661,8 @@ void __init realview_timer_init(unsigned int timer_irq)
796 writel(0, timer2_va_base + TIMER_CTRL); 661 writel(0, timer2_va_base + TIMER_CTRL);
797 writel(0, timer3_va_base + TIMER_CTRL); 662 writel(0, timer3_va_base + TIMER_CTRL);
798 663
799 /* 664 sp804_clocksource_init(timer3_va_base);
800 * Make irqs happen for the system timer 665 sp804_clockevents_init(timer0_va_base, timer_irq);
801 */
802 setup_irq(timer_irq, &realview_timer_irq);
803
804 realview_clocksource_init();
805 realview_clockevents_init(timer_irq);
806} 666}
807 667
808/* 668/*
diff --git a/arch/arm/mach-realview/include/mach/clkdev.h b/arch/arm/mach-realview/include/mach/clkdev.h
index 04b37a89801c..e58d0771b64e 100644
--- a/arch/arm/mach-realview/include/mach/clkdev.h
+++ b/arch/arm/mach-realview/include/mach/clkdev.h
@@ -1,6 +1,15 @@
1#ifndef __ASM_MACH_CLKDEV_H 1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H 2#define __ASM_MACH_CLKDEV_H
3 3
4#include <plat/clock.h>
5
6struct clk {
7 unsigned long rate;
8 const struct clk_ops *ops;
9 const struct icst_params *params;
10 void __iomem *vcoreg;
11};
12
4#define __clk_get(clk) ({ 1; }) 13#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0) 14#define __clk_put(clk) do { } while (0)
6 15
diff --git a/arch/arm/mach-realview/include/mach/irqs-pb1176.h b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
index 2410d4f8ddd3..830055bb8628 100644
--- a/arch/arm/mach-realview/include/mach/irqs-pb1176.h
+++ b/arch/arm/mach-realview/include/mach/irqs-pb1176.h
@@ -31,6 +31,7 @@
31#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */ 31#define IRQ_DC1176_SOFTINT (IRQ_DC1176_GIC_START + 1) /* Software interrupt */
32#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */ 32#define IRQ_DC1176_COMMRx (IRQ_DC1176_GIC_START + 2) /* Debug Comm Rx interrupt */
33#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */ 33#define IRQ_DC1176_COMMTx (IRQ_DC1176_GIC_START + 3) /* Debug Comm Tx interrupt */
34#define IRQ_DC1176_CORE_PMU (IRQ_DC1176_GIC_START + 7) /* Core PMU interrupt */
34#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */ 35#define IRQ_DC1176_TIMER0 (IRQ_DC1176_GIC_START + 8) /* Timer 0 */
35#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */ 36#define IRQ_DC1176_TIMER1 (IRQ_DC1176_GIC_START + 9) /* Timer 1 */
36#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */ 37#define IRQ_DC1176_TIMER2 (IRQ_DC1176_GIC_START + 10) /* Timer 2 */
diff --git a/arch/arm/mach-realview/include/mach/irqs-pba8.h b/arch/arm/mach-realview/include/mach/irqs-pba8.h
index 86792a9f2ab6..4a88a4edb651 100644
--- a/arch/arm/mach-realview/include/mach/irqs-pba8.h
+++ b/arch/arm/mach-realview/include/mach/irqs-pba8.h
@@ -23,12 +23,6 @@
23 23
24#define IRQ_PBA8_GIC_START 32 24#define IRQ_PBA8_GIC_START 32
25 25
26/* L220
27#define IRQ_PBA8_L220_EVENT (IRQ_PBA8_GIC_START + 29)
28#define IRQ_PBA8_L220_SLAVE (IRQ_PBA8_GIC_START + 30)
29#define IRQ_PBA8_L220_DECODE (IRQ_PBA8_GIC_START + 31)
30*/
31
32/* 26/*
33 * PB-A8 on-board gic irq sources 27 * PB-A8 on-board gic irq sources
34 */ 28 */
@@ -65,6 +59,8 @@
65#define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */ 59#define IRQ_PBA8_TSPEN (IRQ_PBA8_GIC_START + 30) /* Touchscreen pen */
66#define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */ 60#define IRQ_PBA8_TSKPAD (IRQ_PBA8_GIC_START + 31) /* Touchscreen keypad */
67 61
62#define IRQ_PBA8_PMU (IRQ_PBA8_GIC_START + 47) /* Cortex-A8 PMU */
63
68/* ... */ 64/* ... */
69#define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50) 65#define IRQ_PBA8_PCI0 (IRQ_PBA8_GIC_START + 50)
70#define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51) 66#define IRQ_PBA8_PCI1 (IRQ_PBA8_GIC_START + 51)
diff --git a/arch/arm/mach-realview/include/mach/irqs-pbx.h b/arch/arm/mach-realview/include/mach/irqs-pbx.h
index deaad4302b17..206a3001f46b 100644
--- a/arch/arm/mach-realview/include/mach/irqs-pbx.h
+++ b/arch/arm/mach-realview/include/mach/irqs-pbx.h
@@ -22,12 +22,6 @@
22 22
23#define IRQ_PBX_GIC_START 32 23#define IRQ_PBX_GIC_START 32
24 24
25/* L220
26#define IRQ_PBX_L220_EVENT (IRQ_PBX_GIC_START + 29)
27#define IRQ_PBX_L220_SLAVE (IRQ_PBX_GIC_START + 30)
28#define IRQ_PBX_L220_DECODE (IRQ_PBX_GIC_START + 31)
29*/
30
31/* 25/*
32 * PBX on-board gic irq sources 26 * PBX on-board gic irq sources
33 */ 27 */
@@ -77,10 +71,10 @@
77#define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */ 71#define IRQ_PBX_TIMER4_5 (IRQ_PBX_GIC_START + 41) /* Timer 0/1 (default timer) */
78#define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */ 72#define IRQ_PBX_TIMER6_7 (IRQ_PBX_GIC_START + 42) /* Timer 2/3 */
79/* ... */ 73/* ... */
80#define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */ 74#define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 44) /* CPU PMU Interrupts */
81#define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 45) 75#define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 45)
82#define IRQ_PBX_PMU_CPU1 (IRQ_PBX_GIC_START + 46) 76#define IRQ_PBX_PMU_CPU2 (IRQ_PBX_GIC_START + 46)
83#define IRQ_PBX_PMU_CPU0 (IRQ_PBX_GIC_START + 47) 77#define IRQ_PBX_PMU_CPU3 (IRQ_PBX_GIC_START + 47)
84 78
85/* ... */ 79/* ... */
86#define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50) 80#define IRQ_PBX_PCI0 (IRQ_PBX_GIC_START + 50)
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h
index 86c0c4435a46..1b77a27badaf 100644
--- a/arch/arm/mach-realview/include/mach/platform.h
+++ b/arch/arm/mach-realview/include/mach/platform.h
@@ -231,12 +231,6 @@
231#define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ 231#define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */
232#define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ 232#define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */
233 233
234/*
235 * Clean base - dummy
236 *
237 */
238#define CLEAN_BASE REALVIEW_BOOT_ROM_HI
239
240/* 234/*
241 * System controller bit assignment 235 * System controller bit assignment
242 */ 236 */
@@ -249,20 +243,6 @@
249#define REALVIEW_TIMER4_EnSel 21 243#define REALVIEW_TIMER4_EnSel 21
250 244
251 245
252#define MAX_TIMER 2
253#define MAX_PERIOD 699050
254#define TICKS_PER_uSEC 1
255
256/*
257 * These are useconds NOT ticks.
258 *
259 */
260#define mSEC_1 1000
261#define mSEC_5 (mSEC_1 * 5)
262#define mSEC_10 (mSEC_1 * 10)
263#define mSEC_25 (mSEC_1 * 25)
264#define SEC_1 (mSEC_1 * 1000)
265
266#define REALVIEW_CSR_BASE 0x10000000 246#define REALVIEW_CSR_BASE 0x10000000
267#define REALVIEW_CSR_SIZE 0x10000000 247#define REALVIEW_CSR_SIZE 0x10000000
268 248
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 7d857d300558..422ccd70d5f5 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -31,8 +31,8 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35#include <asm/hardware/icst307.h>
36#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
37#include <asm/localtimer.h> 37#include <asm/localtimer.h>
38 38
@@ -44,7 +44,6 @@
44#include <mach/irqs.h> 44#include <mach/irqs.h>
45 45
46#include "core.h" 46#include "core.h"
47#include "clock.h"
48 47
49static struct map_desc realview_eb_io_desc[] __initdata = { 48static struct map_desc realview_eb_io_desc[] __initdata = {
50 { 49 {
@@ -294,6 +293,36 @@ static struct resource realview_eb_isp1761_resources[] = {
294 }, 293 },
295}; 294};
296 295
296static struct resource pmu_resources[] = {
297 [0] = {
298 .start = IRQ_EB11MP_PMU_CPU0,
299 .end = IRQ_EB11MP_PMU_CPU0,
300 .flags = IORESOURCE_IRQ,
301 },
302 [1] = {
303 .start = IRQ_EB11MP_PMU_CPU1,
304 .end = IRQ_EB11MP_PMU_CPU1,
305 .flags = IORESOURCE_IRQ,
306 },
307 [2] = {
308 .start = IRQ_EB11MP_PMU_CPU2,
309 .end = IRQ_EB11MP_PMU_CPU2,
310 .flags = IORESOURCE_IRQ,
311 },
312 [3] = {
313 .start = IRQ_EB11MP_PMU_CPU3,
314 .end = IRQ_EB11MP_PMU_CPU3,
315 .flags = IORESOURCE_IRQ,
316 },
317};
318
319static struct platform_device pmu_device = {
320 .name = "arm-pmu",
321 .id = ARM_PMU_DEVICE_CPU,
322 .num_resources = ARRAY_SIZE(pmu_resources),
323 .resource = pmu_resources,
324};
325
297static void __init gic_init_irq(void) 326static void __init gic_init_irq(void)
298{ 327{
299 if (core_tile_eb11mp() || core_tile_a9mp()) { 328 if (core_tile_eb11mp() || core_tile_a9mp()) {
@@ -407,6 +436,7 @@ static void __init realview_eb_init(void)
407 * Bits: .... ...0 0111 1001 0000 .... .... .... */ 436 * Bits: .... ...0 0111 1001 0000 .... .... .... */
408 l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); 437 l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
409#endif 438#endif
439 platform_device_register(&pmu_device);
410 } 440 }
411 441
412 realview_flash_register(&realview_eb_flash_resource, 1); 442 realview_flash_register(&realview_eb_flash_resource, 1);
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 44392e51dd50..96568ebfa2bb 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -31,8 +31,8 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35#include <asm/hardware/icst307.h>
36#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
37 37
38#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -44,7 +44,6 @@
44#include <mach/irqs.h> 44#include <mach/irqs.h>
45 45
46#include "core.h" 46#include "core.h"
47#include "clock.h"
48 47
49static struct map_desc realview_pb1176_io_desc[] __initdata = { 48static struct map_desc realview_pb1176_io_desc[] __initdata = {
50 { 49 {
@@ -263,6 +262,19 @@ static struct resource realview_pb1176_isp1761_resources[] = {
263 }, 262 },
264}; 263};
265 264
265static struct resource pmu_resource = {
266 .start = IRQ_DC1176_CORE_PMU,
267 .end = IRQ_DC1176_CORE_PMU,
268 .flags = IORESOURCE_IRQ,
269};
270
271static struct platform_device pmu_device = {
272 .name = "arm-pmu",
273 .id = ARM_PMU_DEVICE_CPU,
274 .num_resources = 1,
275 .resource = &pmu_resource,
276};
277
266static void __init gic_init_irq(void) 278static void __init gic_init_irq(void)
267{ 279{
268 /* ARM1176 DevChip GIC, primary */ 280 /* ARM1176 DevChip GIC, primary */
@@ -324,6 +336,7 @@ static void __init realview_pb1176_init(void)
324 realview_eth_register(NULL, realview_pb1176_smsc911x_resources); 336 realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
325 platform_device_register(&realview_i2c_device); 337 platform_device_register(&realview_i2c_device);
326 realview_usb_register(realview_pb1176_isp1761_resources); 338 realview_usb_register(realview_pb1176_isp1761_resources);
339 platform_device_register(&pmu_device);
327 340
328 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 341 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
329 struct amba_device *d = amba_devs[i]; 342 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 3e02731af959..7fbefbbebaf0 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -31,8 +31,8 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35#include <asm/hardware/icst307.h>
36#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
37#include <asm/localtimer.h> 37#include <asm/localtimer.h>
38 38
@@ -45,7 +45,6 @@
45#include <mach/irqs.h> 45#include <mach/irqs.h>
46 46
47#include "core.h" 47#include "core.h"
48#include "clock.h"
49 48
50static struct map_desc realview_pb11mp_io_desc[] __initdata = { 49static struct map_desc realview_pb11mp_io_desc[] __initdata = {
51 { 50 {
@@ -260,6 +259,36 @@ static struct resource realview_pb11mp_isp1761_resources[] = {
260 }, 259 },
261}; 260};
262 261
262static struct resource pmu_resources[] = {
263 [0] = {
264 .start = IRQ_TC11MP_PMU_CPU0,
265 .end = IRQ_TC11MP_PMU_CPU0,
266 .flags = IORESOURCE_IRQ,
267 },
268 [1] = {
269 .start = IRQ_TC11MP_PMU_CPU1,
270 .end = IRQ_TC11MP_PMU_CPU1,
271 .flags = IORESOURCE_IRQ,
272 },
273 [2] = {
274 .start = IRQ_TC11MP_PMU_CPU2,
275 .end = IRQ_TC11MP_PMU_CPU2,
276 .flags = IORESOURCE_IRQ,
277 },
278 [3] = {
279 .start = IRQ_TC11MP_PMU_CPU3,
280 .end = IRQ_TC11MP_PMU_CPU3,
281 .flags = IORESOURCE_IRQ,
282 },
283};
284
285static struct platform_device pmu_device = {
286 .name = "arm-pmu",
287 .id = ARM_PMU_DEVICE_CPU,
288 .num_resources = ARRAY_SIZE(pmu_resources),
289 .resource = pmu_resources,
290};
291
263static void __init gic_init_irq(void) 292static void __init gic_init_irq(void)
264{ 293{
265 unsigned int pldctrl; 294 unsigned int pldctrl;
@@ -329,6 +358,7 @@ static void __init realview_pb11mp_init(void)
329 platform_device_register(&realview_i2c_device); 358 platform_device_register(&realview_i2c_device);
330 platform_device_register(&realview_cf_device); 359 platform_device_register(&realview_cf_device);
331 realview_usb_register(realview_pb11mp_isp1761_resources); 360 realview_usb_register(realview_pb11mp_isp1761_resources);
361 platform_device_register(&pmu_device);
332 362
333 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 363 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
334 struct amba_device *d = amba_devs[i]; 364 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index fe4e25c4201a..d3c113b3dfce 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -30,8 +30,8 @@
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/leds.h> 31#include <asm/leds.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/pmu.h>
33#include <asm/hardware/gic.h> 34#include <asm/hardware/gic.h>
34#include <asm/hardware/icst307.h>
35 35
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 37#include <asm/mach/map.h>
@@ -42,7 +42,6 @@
42#include <mach/irqs.h> 42#include <mach/irqs.h>
43 43
44#include "core.h" 44#include "core.h"
45#include "clock.h"
46 45
47static struct map_desc realview_pba8_io_desc[] __initdata = { 46static struct map_desc realview_pba8_io_desc[] __initdata = {
48 { 47 {
@@ -250,6 +249,19 @@ static struct resource realview_pba8_isp1761_resources[] = {
250 }, 249 },
251}; 250};
252 251
252static struct resource pmu_resource = {
253 .start = IRQ_PBA8_PMU,
254 .end = IRQ_PBA8_PMU,
255 .flags = IORESOURCE_IRQ,
256};
257
258static struct platform_device pmu_device = {
259 .name = "arm-pmu",
260 .id = ARM_PMU_DEVICE_CPU,
261 .num_resources = 1,
262 .resource = &pmu_resource,
263};
264
253static void __init gic_init_irq(void) 265static void __init gic_init_irq(void)
254{ 266{
255 /* ARM PB-A8 on-board GIC */ 267 /* ARM PB-A8 on-board GIC */
@@ -296,6 +308,7 @@ static void __init realview_pba8_init(void)
296 platform_device_register(&realview_i2c_device); 308 platform_device_register(&realview_i2c_device);
297 platform_device_register(&realview_cf_device); 309 platform_device_register(&realview_cf_device);
298 realview_usb_register(realview_pba8_isp1761_resources); 310 realview_usb_register(realview_pba8_isp1761_resources);
311 platform_device_register(&pmu_device);
299 312
300 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 313 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
301 struct amba_device *d = amba_devs[i]; 314 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index d94857eb0690..a235ba30996b 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -29,6 +29,7 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/leds.h> 30#include <asm/leds.h>
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/pmu.h>
32#include <asm/smp_twd.h> 33#include <asm/smp_twd.h>
33#include <asm/hardware/gic.h> 34#include <asm/hardware/gic.h>
34#include <asm/hardware/cache-l2x0.h> 35#include <asm/hardware/cache-l2x0.h>
@@ -270,6 +271,36 @@ static struct resource realview_pbx_isp1761_resources[] = {
270 }, 271 },
271}; 272};
272 273
274static struct resource pmu_resources[] = {
275 [0] = {
276 .start = IRQ_PBX_PMU_CPU0,
277 .end = IRQ_PBX_PMU_CPU0,
278 .flags = IORESOURCE_IRQ,
279 },
280 [1] = {
281 .start = IRQ_PBX_PMU_CPU1,
282 .end = IRQ_PBX_PMU_CPU1,
283 .flags = IORESOURCE_IRQ,
284 },
285 [2] = {
286 .start = IRQ_PBX_PMU_CPU2,
287 .end = IRQ_PBX_PMU_CPU2,
288 .flags = IORESOURCE_IRQ,
289 },
290 [3] = {
291 .start = IRQ_PBX_PMU_CPU3,
292 .end = IRQ_PBX_PMU_CPU3,
293 .flags = IORESOURCE_IRQ,
294 },
295};
296
297static struct platform_device pmu_device = {
298 .name = "arm-pmu",
299 .id = ARM_PMU_DEVICE_CPU,
300 .num_resources = ARRAY_SIZE(pmu_resources),
301 .resource = pmu_resources,
302};
303
273static void __init gic_init_irq(void) 304static void __init gic_init_irq(void)
274{ 305{
275 /* ARM PBX on-board GIC */ 306 /* ARM PBX on-board GIC */
@@ -354,6 +385,7 @@ static void __init realview_pbx_init(void)
354 /* 16KB way size, 8-way associativity, parity disabled 385 /* 16KB way size, 8-way associativity, parity disabled
355 * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */ 386 * Bits: .. 0 0 0 0 1 00 1 0 1 001 0 000 0 .... .... .... */
356 l2x0_init(l2x0_base, 0x02520000, 0xc0000fff); 387 l2x0_init(l2x0_base, 0x02520000, 0xc0000fff);
388 platform_device_register(&pmu_device);
357 } 389 }
358#endif 390#endif
359 391
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig
new file mode 100644
index 000000000000..20d1317cc486
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig
@@ -0,0 +1,33 @@
1#
2# SPEAr3XX Machine configuration file
3#
4
5if ARCH_SPEAR3XX
6
7choice
8 prompt "SPEAr3XX Family"
9 default MACH_SPEAR300
10
11config MACH_SPEAR300
12 bool "SPEAr300"
13 help
14 Supports ST SPEAr300 Machine
15
16config MACH_SPEAR310
17 bool "SPEAr310"
18 help
19 Supports ST SPEAr310 Machine
20
21config MACH_SPEAR320
22 bool "SPEAr320"
23 help
24 Supports ST SPEAr320 Machine
25
26endchoice
27
28# Adding SPEAr3XX machine specific configuration files
29source "arch/arm/mach-spear3xx/Kconfig300"
30source "arch/arm/mach-spear3xx/Kconfig310"
31source "arch/arm/mach-spear3xx/Kconfig320"
32
33endif #ARCH_SPEAR3XX
diff --git a/arch/arm/mach-spear3xx/Kconfig300 b/arch/arm/mach-spear3xx/Kconfig300
new file mode 100644
index 000000000000..c519a05b4ab4
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig300
@@ -0,0 +1,17 @@
1#
2# SPEAr300 machine configuration file
3#
4
5if MACH_SPEAR300
6
7choice
8 prompt "SPEAr300 Boards"
9 default BOARD_SPEAR300_EVB
10
11config BOARD_SPEAR300_EVB
12 bool "SPEAr300 Evaluation Board"
13 help
14 Supports ST SPEAr300 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR300
diff --git a/arch/arm/mach-spear3xx/Kconfig310 b/arch/arm/mach-spear3xx/Kconfig310
new file mode 100644
index 000000000000..60e7442d75bd
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig310
@@ -0,0 +1,17 @@
1#
2# SPEAr310 machine configuration file
3#
4
5if MACH_SPEAR310
6
7choice
8 prompt "SPEAr310 Boards"
9 default BOARD_SPEAR310_EVB
10
11config BOARD_SPEAR310_EVB
12 bool "SPEAr310 Evaluation Board"
13 help
14 Supports ST SPEAr310 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR310
diff --git a/arch/arm/mach-spear3xx/Kconfig320 b/arch/arm/mach-spear3xx/Kconfig320
new file mode 100644
index 000000000000..1c1d438399b8
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig320
@@ -0,0 +1,17 @@
1#
2# SPEAr320 machine configuration file
3#
4
5if MACH_SPEAR320
6
7choice
8 prompt "SPEAr320 Boards"
9 default BOARD_SPEAR320_EVB
10
11config BOARD_SPEAR320_EVB
12 bool "SPEAr320 Evaluation Board"
13 help
14 Supports ST SPEAr320 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR320
diff --git a/arch/arm/mach-spear3xx/Makefile b/arch/arm/mach-spear3xx/Makefile
new file mode 100644
index 000000000000..b24862489704
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Makefile
@@ -0,0 +1,26 @@
1#
2# Makefile for SPEAr3XX machine series
3#
4
5# common files
6obj-y += spear3xx.o clock.o
7
8# spear300 specific files
9obj-$(CONFIG_MACH_SPEAR300) += spear300.o
10
11# spear300 boards files
12obj-$(CONFIG_BOARD_SPEAR300_EVB) += spear300_evb.o
13
14
15# spear310 specific files
16obj-$(CONFIG_MACH_SPEAR310) += spear310.o
17
18# spear310 boards files
19obj-$(CONFIG_BOARD_SPEAR310_EVB) += spear310_evb.o
20
21
22# spear320 specific files
23obj-$(CONFIG_MACH_SPEAR320) += spear320.o
24
25# spear320 boards files
26obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot
new file mode 100644
index 000000000000..7a1f3c0eadb8
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Makefile.boot
@@ -0,0 +1,3 @@
1zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c
new file mode 100644
index 000000000000..39f6ccf22294
--- /dev/null
+++ b/arch/arm/mach-spear3xx/clock.c
@@ -0,0 +1,389 @@
1/*
2 * arch/arm/mach-spear3xx/clock.c
3 *
4 * SPEAr3xx machines clock framework source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <mach/misc_regs.h>
17#include <plat/clock.h>
18
19/* root clks */
20/* 32 KHz oscillator clock */
21static struct clk osc_32k_clk = {
22 .flags = ALWAYS_ENABLED,
23 .rate = 32000,
24};
25
26/* 24 MHz oscillator clock */
27static struct clk osc_24m_clk = {
28 .flags = ALWAYS_ENABLED,
29 .rate = 24000000,
30};
31
32/* clock derived from 32 KHz osc clk */
33/* rtc clock */
34static struct clk rtc_clk = {
35 .pclk = &osc_32k_clk,
36 .en_reg = PERIP1_CLK_ENB,
37 .en_reg_bit = RTC_CLK_ENB,
38 .recalc = &follow_parent,
39};
40
41/* clock derived from 24 MHz osc clk */
42/* pll1 configuration structure */
43static struct pll_clk_config pll1_config = {
44 .mode_reg = PLL1_CTR,
45 .cfg_reg = PLL1_FRQ,
46};
47
48/* PLL1 clock */
49static struct clk pll1_clk = {
50 .pclk = &osc_24m_clk,
51 .en_reg = PLL1_CTR,
52 .en_reg_bit = PLL_ENABLE,
53 .recalc = &pll1_clk_recalc,
54 .private_data = &pll1_config,
55};
56
57/* PLL3 48 MHz clock */
58static struct clk pll3_48m_clk = {
59 .flags = ALWAYS_ENABLED,
60 .pclk = &osc_24m_clk,
61 .rate = 48000000,
62};
63
64/* watch dog timer clock */
65static struct clk wdt_clk = {
66 .flags = ALWAYS_ENABLED,
67 .pclk = &osc_24m_clk,
68 .recalc = &follow_parent,
69};
70
71/* clock derived from pll1 clk */
72/* cpu clock */
73static struct clk cpu_clk = {
74 .flags = ALWAYS_ENABLED,
75 .pclk = &pll1_clk,
76 .recalc = &follow_parent,
77};
78
79/* ahb configuration structure */
80static struct bus_clk_config ahb_config = {
81 .reg = CORE_CLK_CFG,
82 .mask = PLL_HCLK_RATIO_MASK,
83 .shift = PLL_HCLK_RATIO_SHIFT,
84};
85
86/* ahb clock */
87static struct clk ahb_clk = {
88 .flags = ALWAYS_ENABLED,
89 .pclk = &pll1_clk,
90 .recalc = &bus_clk_recalc,
91 .private_data = &ahb_config,
92};
93
94/* uart configurations */
95static struct aux_clk_config uart_config = {
96 .synth_reg = UART_CLK_SYNT,
97};
98
99/* uart parents */
100static struct pclk_info uart_pclk_info[] = {
101 {
102 .pclk = &pll1_clk,
103 .pclk_mask = AUX_CLK_PLL1_MASK,
104 .scalable = 1,
105 }, {
106 .pclk = &pll3_48m_clk,
107 .pclk_mask = AUX_CLK_PLL3_MASK,
108 .scalable = 0,
109 },
110};
111
112/* uart parent select structure */
113static struct pclk_sel uart_pclk_sel = {
114 .pclk_info = uart_pclk_info,
115 .pclk_count = ARRAY_SIZE(uart_pclk_info),
116 .pclk_sel_reg = PERIP_CLK_CFG,
117 .pclk_sel_mask = UART_CLK_MASK,
118};
119
120/* uart clock */
121static struct clk uart_clk = {
122 .en_reg = PERIP1_CLK_ENB,
123 .en_reg_bit = UART_CLK_ENB,
124 .pclk_sel = &uart_pclk_sel,
125 .pclk_sel_shift = UART_CLK_SHIFT,
126 .recalc = &aux_clk_recalc,
127 .private_data = &uart_config,
128};
129
130/* firda configurations */
131static struct aux_clk_config firda_config = {
132 .synth_reg = FIRDA_CLK_SYNT,
133};
134
135/* firda parents */
136static struct pclk_info firda_pclk_info[] = {
137 {
138 .pclk = &pll1_clk,
139 .pclk_mask = AUX_CLK_PLL1_MASK,
140 .scalable = 1,
141 }, {
142 .pclk = &pll3_48m_clk,
143 .pclk_mask = AUX_CLK_PLL3_MASK,
144 .scalable = 0,
145 },
146};
147
148/* firda parent select structure */
149static struct pclk_sel firda_pclk_sel = {
150 .pclk_info = firda_pclk_info,
151 .pclk_count = ARRAY_SIZE(firda_pclk_info),
152 .pclk_sel_reg = PERIP_CLK_CFG,
153 .pclk_sel_mask = FIRDA_CLK_MASK,
154};
155
156/* firda clock */
157static struct clk firda_clk = {
158 .en_reg = PERIP1_CLK_ENB,
159 .en_reg_bit = FIRDA_CLK_ENB,
160 .pclk_sel = &firda_pclk_sel,
161 .pclk_sel_shift = FIRDA_CLK_SHIFT,
162 .recalc = &aux_clk_recalc,
163 .private_data = &firda_config,
164};
165
166/* gpt parents */
167static struct pclk_info gpt_pclk_info[] = {
168 {
169 .pclk = &pll1_clk,
170 .pclk_mask = AUX_CLK_PLL1_MASK,
171 .scalable = 1,
172 }, {
173 .pclk = &pll3_48m_clk,
174 .pclk_mask = AUX_CLK_PLL3_MASK,
175 .scalable = 0,
176 },
177};
178
179/* gpt parent select structure */
180static struct pclk_sel gpt_pclk_sel = {
181 .pclk_info = gpt_pclk_info,
182 .pclk_count = ARRAY_SIZE(gpt_pclk_info),
183 .pclk_sel_reg = PERIP_CLK_CFG,
184 .pclk_sel_mask = GPT_CLK_MASK,
185};
186
187/* gpt0 configurations */
188static struct aux_clk_config gpt0_config = {
189 .synth_reg = PRSC1_CLK_CFG,
190};
191
192/* gpt0 timer clock */
193static struct clk gpt0_clk = {
194 .flags = ALWAYS_ENABLED,
195 .pclk_sel = &gpt_pclk_sel,
196 .pclk_sel_shift = GPT0_CLK_SHIFT,
197 .recalc = &gpt_clk_recalc,
198 .private_data = &gpt0_config,
199};
200
201/* gpt1 configurations */
202static struct aux_clk_config gpt1_config = {
203 .synth_reg = PRSC2_CLK_CFG,
204};
205
206/* gpt1 timer clock */
207static struct clk gpt1_clk = {
208 .en_reg = PERIP1_CLK_ENB,
209 .en_reg_bit = GPT1_CLK_ENB,
210 .pclk_sel = &gpt_pclk_sel,
211 .pclk_sel_shift = GPT1_CLK_SHIFT,
212 .recalc = &gpt_clk_recalc,
213 .private_data = &gpt1_config,
214};
215
216/* gpt2 configurations */
217static struct aux_clk_config gpt2_config = {
218 .synth_reg = PRSC3_CLK_CFG,
219};
220
221/* gpt2 timer clock */
222static struct clk gpt2_clk = {
223 .en_reg = PERIP1_CLK_ENB,
224 .en_reg_bit = GPT2_CLK_ENB,
225 .pclk_sel = &gpt_pclk_sel,
226 .pclk_sel_shift = GPT2_CLK_SHIFT,
227 .recalc = &gpt_clk_recalc,
228 .private_data = &gpt2_config,
229};
230
231/* clock derived from pll3 clk */
232/* usbh clock */
233static struct clk usbh_clk = {
234 .pclk = &pll3_48m_clk,
235 .en_reg = PERIP1_CLK_ENB,
236 .en_reg_bit = USBH_CLK_ENB,
237 .recalc = &follow_parent,
238};
239
240/* usbd clock */
241static struct clk usbd_clk = {
242 .pclk = &pll3_48m_clk,
243 .en_reg = PERIP1_CLK_ENB,
244 .en_reg_bit = USBD_CLK_ENB,
245 .recalc = &follow_parent,
246};
247
248/* clcd clock */
249static struct clk clcd_clk = {
250 .flags = ALWAYS_ENABLED,
251 .pclk = &pll3_48m_clk,
252 .recalc = &follow_parent,
253};
254
255/* clock derived from ahb clk */
256/* apb configuration structure */
257static struct bus_clk_config apb_config = {
258 .reg = CORE_CLK_CFG,
259 .mask = HCLK_PCLK_RATIO_MASK,
260 .shift = HCLK_PCLK_RATIO_SHIFT,
261};
262
263/* apb clock */
264static struct clk apb_clk = {
265 .flags = ALWAYS_ENABLED,
266 .pclk = &ahb_clk,
267 .recalc = &bus_clk_recalc,
268 .private_data = &apb_config,
269};
270
271/* i2c clock */
272static struct clk i2c_clk = {
273 .pclk = &ahb_clk,
274 .en_reg = PERIP1_CLK_ENB,
275 .en_reg_bit = I2C_CLK_ENB,
276 .recalc = &follow_parent,
277};
278
279/* dma clock */
280static struct clk dma_clk = {
281 .pclk = &ahb_clk,
282 .en_reg = PERIP1_CLK_ENB,
283 .en_reg_bit = DMA_CLK_ENB,
284 .recalc = &follow_parent,
285};
286
287/* jpeg clock */
288static struct clk jpeg_clk = {
289 .pclk = &ahb_clk,
290 .en_reg = PERIP1_CLK_ENB,
291 .en_reg_bit = JPEG_CLK_ENB,
292 .recalc = &follow_parent,
293};
294
295/* gmac clock */
296static struct clk gmac_clk = {
297 .pclk = &ahb_clk,
298 .en_reg = PERIP1_CLK_ENB,
299 .en_reg_bit = GMAC_CLK_ENB,
300 .recalc = &follow_parent,
301};
302
303/* smi clock */
304static struct clk smi_clk = {
305 .pclk = &ahb_clk,
306 .en_reg = PERIP1_CLK_ENB,
307 .en_reg_bit = SMI_CLK_ENB,
308 .recalc = &follow_parent,
309};
310
311/* c3 clock */
312static struct clk c3_clk = {
313 .pclk = &ahb_clk,
314 .en_reg = PERIP1_CLK_ENB,
315 .en_reg_bit = C3_CLK_ENB,
316 .recalc = &follow_parent,
317};
318
319/* clock derived from apb clk */
320/* adc clock */
321static struct clk adc_clk = {
322 .pclk = &apb_clk,
323 .en_reg = PERIP1_CLK_ENB,
324 .en_reg_bit = ADC_CLK_ENB,
325 .recalc = &follow_parent,
326};
327
328/* ssp clock */
329static struct clk ssp_clk = {
330 .pclk = &apb_clk,
331 .en_reg = PERIP1_CLK_ENB,
332 .en_reg_bit = SSP_CLK_ENB,
333 .recalc = &follow_parent,
334};
335
336/* gpio clock */
337static struct clk gpio_clk = {
338 .pclk = &apb_clk,
339 .en_reg = PERIP1_CLK_ENB,
340 .en_reg_bit = GPIO_CLK_ENB,
341 .recalc = &follow_parent,
342};
343
344/* array of all spear 3xx clock lookups */
345static struct clk_lookup spear_clk_lookups[] = {
346 /* root clks */
347 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk},
348 { .con_id = "osc_24m_clk", .clk = &osc_24m_clk},
349 /* clock derived from 32 KHz osc clk */
350 { .dev_id = "rtc", .clk = &rtc_clk},
351 /* clock derived from 24 MHz osc clk */
352 { .con_id = "pll1_clk", .clk = &pll1_clk},
353 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk},
354 { .dev_id = "wdt", .clk = &wdt_clk},
355 /* clock derived from pll1 clk */
356 { .con_id = "cpu_clk", .clk = &cpu_clk},
357 { .con_id = "ahb_clk", .clk = &ahb_clk},
358 { .dev_id = "uart", .clk = &uart_clk},
359 { .dev_id = "firda", .clk = &firda_clk},
360 { .dev_id = "gpt0", .clk = &gpt0_clk},
361 { .dev_id = "gpt1", .clk = &gpt1_clk},
362 { .dev_id = "gpt2", .clk = &gpt2_clk},
363 /* clock derived from pll3 clk */
364 { .dev_id = "usbh", .clk = &usbh_clk},
365 { .dev_id = "usbd", .clk = &usbd_clk},
366 { .dev_id = "clcd", .clk = &clcd_clk},
367 /* clock derived from ahb clk */
368 { .con_id = "apb_clk", .clk = &apb_clk},
369 { .dev_id = "i2c", .clk = &i2c_clk},
370 { .dev_id = "dma", .clk = &dma_clk},
371 { .dev_id = "jpeg", .clk = &jpeg_clk},
372 { .dev_id = "gmac", .clk = &gmac_clk},
373 { .dev_id = "smi", .clk = &smi_clk},
374 { .dev_id = "c3", .clk = &c3_clk},
375 /* clock derived from apb clk */
376 { .dev_id = "adc", .clk = &adc_clk},
377 { .dev_id = "ssp", .clk = &ssp_clk},
378 { .dev_id = "gpio", .clk = &gpio_clk},
379};
380
381void __init clk_init(void)
382{
383 int i;
384
385 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
386 clk_register(&spear_clk_lookups[i]);
387
388 recalc_root_clocks();
389}
diff --git a/arch/arm/mach-spear3xx/include/mach/clkdev.h b/arch/arm/mach-spear3xx/include/mach/clkdev.h
new file mode 100644
index 000000000000..a3d07339d9f1
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/clkdev.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/clkdev.h
3 *
4 * Clock Dev framework definitions for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_CLKDEV_H
15#define __MACH_CLKDEV_H
16
17#include <plat/clkdev.h>
18
19#endif /* __MACH_CLKDEV_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/debug-macro.S b/arch/arm/mach-spear3xx/include/mach/debug-macro.S
new file mode 100644
index 000000000000..590519f10d6e
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/debug-macro.S
@@ -0,0 +1,14 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/debug-macro.S
3 *
4 * Debugging macro include header spear3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-spear3xx/include/mach/entry-macro.S b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
new file mode 100644
index 000000000000..947625d6b48d
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
@@ -0,0 +1,46 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <mach/hardware.h>
15#include <mach/spear.h>
16#include <asm/hardware/vic.h>
17
18 .macro disable_fiq
19 .endm
20
21 .macro get_irqnr_preamble, base, tmp
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28 ldr \base, =VA_SPEAR3XX_ML1_VIC_BASE
29 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
30 teq \irqstat, #0
31 beq 1001f @ this will set/reset
32 @ zero register
33 /*
34 * Following code will find bit position of least significang
35 * bit set in irqstat, using following equation
36 * least significant bit set in n = (n & ~(n-1))
37 */
38 sub \tmp, \irqstat, #1 @ tmp = irqstat - 1
39 mvn \tmp, \tmp @ tmp = ~tmp
40 and \irqstat, \irqstat, \tmp @ irqstat &= tmp
41 /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
42 clz \tmp, \irqstat @ tmp = leading zeros
43 rsb \irqnr, \tmp, #0x1F @ irqnr = 32 - tmp - 1
44
451001: /* EQ will be set if no irqs pending */
46 .endm
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
new file mode 100644
index 000000000000..af7e02c909a3
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -0,0 +1,205 @@
1/*
2 * arch/arm/mach-spear3xx/generic.h
3 *
4 * SPEAr3XX machine family generic header file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_GENERIC_H
15#define __MACH_GENERIC_H
16
17#include <asm/mach/time.h>
18#include <asm/mach/map.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/amba/bus.h>
22#include <plat/padmux.h>
23
24/* spear3xx declarations */
25/*
26 * Each GPT has 2 timer channels
27 * Following GPT channels will be used as clock source and clockevent
28 */
29#define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE
30#define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1
31#define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2
32
33/* Add spear3xx family device structure declarations here */
34extern struct amba_device gpio_device;
35extern struct amba_device uart_device;
36extern struct sys_timer spear_sys_timer;
37
38/* Add spear3xx family function declarations here */
39void __init clk_init(void);
40void __init spear3xx_map_io(void);
41void __init spear3xx_init_irq(void);
42void __init spear3xx_init(void);
43void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
44
45/* pad mux declarations */
46#define PMX_FIRDA_MASK (1 << 14)
47#define PMX_I2C_MASK (1 << 13)
48#define PMX_SSP_CS_MASK (1 << 12)
49#define PMX_SSP_MASK (1 << 11)
50#define PMX_MII_MASK (1 << 10)
51#define PMX_GPIO_PIN0_MASK (1 << 9)
52#define PMX_GPIO_PIN1_MASK (1 << 8)
53#define PMX_GPIO_PIN2_MASK (1 << 7)
54#define PMX_GPIO_PIN3_MASK (1 << 6)
55#define PMX_GPIO_PIN4_MASK (1 << 5)
56#define PMX_GPIO_PIN5_MASK (1 << 4)
57#define PMX_UART0_MODEM_MASK (1 << 3)
58#define PMX_UART0_MASK (1 << 2)
59#define PMX_TIMER_3_4_MASK (1 << 1)
60#define PMX_TIMER_1_2_MASK (1 << 0)
61
62/* pad mux devices */
63extern struct pmx_dev pmx_firda;
64extern struct pmx_dev pmx_i2c;
65extern struct pmx_dev pmx_ssp_cs;
66extern struct pmx_dev pmx_ssp;
67extern struct pmx_dev pmx_mii;
68extern struct pmx_dev pmx_gpio_pin0;
69extern struct pmx_dev pmx_gpio_pin1;
70extern struct pmx_dev pmx_gpio_pin2;
71extern struct pmx_dev pmx_gpio_pin3;
72extern struct pmx_dev pmx_gpio_pin4;
73extern struct pmx_dev pmx_gpio_pin5;
74extern struct pmx_dev pmx_uart0_modem;
75extern struct pmx_dev pmx_uart0;
76extern struct pmx_dev pmx_timer_3_4;
77extern struct pmx_dev pmx_timer_1_2;
78
79#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
80/* padmux plgpio devices */
81extern struct pmx_dev pmx_plgpio_0_1;
82extern struct pmx_dev pmx_plgpio_2_3;
83extern struct pmx_dev pmx_plgpio_4_5;
84extern struct pmx_dev pmx_plgpio_6_9;
85extern struct pmx_dev pmx_plgpio_10_27;
86extern struct pmx_dev pmx_plgpio_28;
87extern struct pmx_dev pmx_plgpio_29;
88extern struct pmx_dev pmx_plgpio_30;
89extern struct pmx_dev pmx_plgpio_31;
90extern struct pmx_dev pmx_plgpio_32;
91extern struct pmx_dev pmx_plgpio_33;
92extern struct pmx_dev pmx_plgpio_34_36;
93extern struct pmx_dev pmx_plgpio_37_42;
94extern struct pmx_dev pmx_plgpio_43_44_47_48;
95extern struct pmx_dev pmx_plgpio_45_46_49_50;
96#endif
97
98extern struct pmx_driver pmx_driver;
99
100/* spear300 declarations */
101#ifdef CONFIG_MACH_SPEAR300
102/* Add spear300 machine device structure declarations here */
103extern struct amba_device gpio1_device;
104
105/* pad mux modes */
106extern struct pmx_mode nand_mode;
107extern struct pmx_mode nor_mode;
108extern struct pmx_mode photo_frame_mode;
109extern struct pmx_mode lend_ip_phone_mode;
110extern struct pmx_mode hend_ip_phone_mode;
111extern struct pmx_mode lend_wifi_phone_mode;
112extern struct pmx_mode hend_wifi_phone_mode;
113extern struct pmx_mode ata_pabx_wi2s_mode;
114extern struct pmx_mode ata_pabx_i2s_mode;
115extern struct pmx_mode caml_lcdw_mode;
116extern struct pmx_mode camu_lcd_mode;
117extern struct pmx_mode camu_wlcd_mode;
118extern struct pmx_mode caml_lcd_mode;
119
120/* pad mux devices */
121extern struct pmx_dev pmx_fsmc_2_chips;
122extern struct pmx_dev pmx_fsmc_4_chips;
123extern struct pmx_dev pmx_keyboard;
124extern struct pmx_dev pmx_clcd;
125extern struct pmx_dev pmx_telecom_gpio;
126extern struct pmx_dev pmx_telecom_tdm;
127extern struct pmx_dev pmx_telecom_spi_cs_i2c_clk;
128extern struct pmx_dev pmx_telecom_camera;
129extern struct pmx_dev pmx_telecom_dac;
130extern struct pmx_dev pmx_telecom_i2s;
131extern struct pmx_dev pmx_telecom_boot_pins;
132extern struct pmx_dev pmx_telecom_sdio_4bit;
133extern struct pmx_dev pmx_telecom_sdio_8bit;
134extern struct pmx_dev pmx_gpio1;
135
136void spear300_pmx_init(void);
137
138/* Add spear300 machine function declarations here */
139void __init spear300_init(void);
140
141#endif /* CONFIG_MACH_SPEAR300 */
142
143/* spear310 declarations */
144#ifdef CONFIG_MACH_SPEAR310
145/* Add spear310 machine device structure declarations here */
146
147/* pad mux devices */
148extern struct pmx_dev pmx_emi_cs_0_1_4_5;
149extern struct pmx_dev pmx_emi_cs_2_3;
150extern struct pmx_dev pmx_uart1;
151extern struct pmx_dev pmx_uart2;
152extern struct pmx_dev pmx_uart3_4_5;
153extern struct pmx_dev pmx_fsmc;
154extern struct pmx_dev pmx_rs485_0_1;
155extern struct pmx_dev pmx_tdm0;
156
157void spear310_pmx_init(void);
158
159/* Add spear310 machine function declarations here */
160void __init spear310_init(void);
161
162#endif /* CONFIG_MACH_SPEAR310 */
163
164/* spear320 declarations */
165#ifdef CONFIG_MACH_SPEAR320
166/* Add spear320 machine device structure declarations here */
167
168/* pad mux modes */
169extern struct pmx_mode auto_net_smii_mode;
170extern struct pmx_mode auto_net_mii_mode;
171extern struct pmx_mode auto_exp_mode;
172extern struct pmx_mode small_printers_mode;
173
174/* pad mux devices */
175extern struct pmx_dev pmx_clcd;
176extern struct pmx_dev pmx_emi;
177extern struct pmx_dev pmx_fsmc;
178extern struct pmx_dev pmx_spp;
179extern struct pmx_dev pmx_sdio;
180extern struct pmx_dev pmx_i2s;
181extern struct pmx_dev pmx_uart1;
182extern struct pmx_dev pmx_uart1_modem;
183extern struct pmx_dev pmx_uart2;
184extern struct pmx_dev pmx_touchscreen;
185extern struct pmx_dev pmx_can;
186extern struct pmx_dev pmx_sdio_led;
187extern struct pmx_dev pmx_pwm0;
188extern struct pmx_dev pmx_pwm1;
189extern struct pmx_dev pmx_pwm2;
190extern struct pmx_dev pmx_pwm3;
191extern struct pmx_dev pmx_ssp1;
192extern struct pmx_dev pmx_ssp2;
193extern struct pmx_dev pmx_mii1;
194extern struct pmx_dev pmx_smii0;
195extern struct pmx_dev pmx_smii1;
196extern struct pmx_dev pmx_i2c1;
197
198void spear320_pmx_init(void);
199
200/* Add spear320 machine function declarations here */
201void __init spear320_init(void);
202
203#endif /* CONFIG_MACH_SPEAR320 */
204
205#endif /* __MACH_GENERIC_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/gpio.h b/arch/arm/mach-spear3xx/include/mach/gpio.h
new file mode 100644
index 000000000000..451b2081bfc9
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/gpio.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/gpio.h
3 *
4 * GPIO macros for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_GPIO_H
15#define __MACH_GPIO_H
16
17#include <plat/gpio.h>
18
19#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/hardware.h b/arch/arm/mach-spear3xx/include/mach/hardware.h
new file mode 100644
index 000000000000..4a86e6a3c444
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/hardware.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/hardware.h
3 *
4 * Hardware definitions for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_HARDWARE_H
15#define __MACH_HARDWARE_H
16
17/* Vitual to physical translation of statically mapped space */
18#define IO_ADDRESS(x) (x | 0xF0000000)
19
20#endif /* __MACH_HARDWARE_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/io.h b/arch/arm/mach-spear3xx/include/mach/io.h
new file mode 100644
index 000000000000..30cff8a1f6b5
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/io.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/io.h
3 *
4 * IO definitions for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_IO_H
15#define __MACH_IO_H
16
17#include <plat/io.h>
18
19#endif /* __MACH_IO_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h
new file mode 100644
index 000000000000..7f940b818473
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/irqs.h
@@ -0,0 +1,152 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/irqs.h
3 *
4 * IRQ helper macros for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_IRQS_H
15#define __MACH_IRQS_H
16
17/* SPEAr3xx IRQ definitions */
18#define IRQ_HW_ACCEL_MOD_0 0
19#define IRQ_INTRCOMM_RAS_ARM 1
20#define IRQ_CPU_GPT1_1 2
21#define IRQ_CPU_GPT1_2 3
22#define IRQ_BASIC_GPT1_1 4
23#define IRQ_BASIC_GPT1_2 5
24#define IRQ_BASIC_GPT2_1 6
25#define IRQ_BASIC_GPT2_2 7
26#define IRQ_BASIC_DMA 8
27#define IRQ_BASIC_SMI 9
28#define IRQ_BASIC_RTC 10
29#define IRQ_BASIC_GPIO 11
30#define IRQ_BASIC_WDT 12
31#define IRQ_DDR_CONTROLLER 13
32#define IRQ_SYS_ERROR 14
33#define IRQ_WAKEUP_RCV 15
34#define IRQ_JPEG 16
35#define IRQ_IRDA 17
36#define IRQ_ADC 18
37#define IRQ_UART 19
38#define IRQ_SSP 20
39#define IRQ_I2C 21
40#define IRQ_MAC_1 22
41#define IRQ_MAC_2 23
42#define IRQ_USB_DEV 24
43#define IRQ_USB_H_OHCI_0 25
44#define IRQ_USB_H_EHCI_0 26
45#define IRQ_USB_H_EHCI_1 IRQ_USB_H_EHCI_0
46#define IRQ_USB_H_OHCI_1 27
47#define IRQ_GEN_RAS_1 28
48#define IRQ_GEN_RAS_2 29
49#define IRQ_GEN_RAS_3 30
50#define IRQ_HW_ACCEL_MOD_1 31
51#define IRQ_VIC_END 32
52
53#define VIRQ_START IRQ_VIC_END
54
55/* SPEAr300 Virtual irq definitions */
56#ifdef CONFIG_MACH_SPEAR300
57/* IRQs sharing IRQ_GEN_RAS_1 */
58#define VIRQ_IT_PERS_S (VIRQ_START + 0)
59#define VIRQ_IT_CHANGE_S (VIRQ_START + 1)
60#define VIRQ_I2S (VIRQ_START + 2)
61#define VIRQ_TDM (VIRQ_START + 3)
62#define VIRQ_CAMERA_L (VIRQ_START + 4)
63#define VIRQ_CAMERA_F (VIRQ_START + 5)
64#define VIRQ_CAMERA_V (VIRQ_START + 6)
65#define VIRQ_KEYBOARD (VIRQ_START + 7)
66#define VIRQ_GPIO1 (VIRQ_START + 8)
67
68/* IRQs sharing IRQ_GEN_RAS_3 */
69#define IRQ_CLCD IRQ_GEN_RAS_3
70
71/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
72#define IRQ_SDIO IRQ_INTRCOMM_RAS_ARM
73
74/* GPIO pins virtual irqs */
75#define SPEAR_GPIO_INT_BASE (VIRQ_START + 9)
76#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO_INT_BASE + 8)
77#define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8)
78
79/* SPEAr310 Virtual irq definitions */
80#elif defined(CONFIG_MACH_SPEAR310)
81/* IRQs sharing IRQ_GEN_RAS_1 */
82#define VIRQ_SMII0 (VIRQ_START + 0)
83#define VIRQ_SMII1 (VIRQ_START + 1)
84#define VIRQ_SMII2 (VIRQ_START + 2)
85#define VIRQ_SMII3 (VIRQ_START + 3)
86#define VIRQ_WAKEUP_SMII0 (VIRQ_START + 4)
87#define VIRQ_WAKEUP_SMII1 (VIRQ_START + 5)
88#define VIRQ_WAKEUP_SMII2 (VIRQ_START + 6)
89#define VIRQ_WAKEUP_SMII3 (VIRQ_START + 7)
90
91/* IRQs sharing IRQ_GEN_RAS_2 */
92#define VIRQ_UART1 (VIRQ_START + 8)
93#define VIRQ_UART2 (VIRQ_START + 9)
94#define VIRQ_UART3 (VIRQ_START + 10)
95#define VIRQ_UART4 (VIRQ_START + 11)
96#define VIRQ_UART5 (VIRQ_START + 12)
97
98/* IRQs sharing IRQ_GEN_RAS_3 */
99#define VIRQ_EMI (VIRQ_START + 13)
100#define VIRQ_PLGPIO (VIRQ_START + 14)
101
102/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
103#define VIRQ_TDM_HDLC (VIRQ_START + 15)
104#define VIRQ_RS485_0 (VIRQ_START + 16)
105#define VIRQ_RS485_1 (VIRQ_START + 17)
106
107/* GPIO pins virtual irqs */
108#define SPEAR_GPIO_INT_BASE (VIRQ_START + 18)
109
110/* SPEAr320 Virtual irq definitions */
111#else
112/* IRQs sharing IRQ_GEN_RAS_1 */
113#define VIRQ_EMI (VIRQ_START + 0)
114#define VIRQ_CLCD (VIRQ_START + 1)
115#define VIRQ_SPP (VIRQ_START + 2)
116
117/* IRQs sharing IRQ_GEN_RAS_2 */
118#define IRQ_SDIO IRQ_GEN_RAS_2
119
120/* IRQs sharing IRQ_GEN_RAS_3 */
121#define VIRQ_PLGPIO (VIRQ_START + 3)
122#define VIRQ_I2S_PLAY (VIRQ_START + 4)
123#define VIRQ_I2S_REC (VIRQ_START + 5)
124
125/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
126#define VIRQ_CANU (VIRQ_START + 6)
127#define VIRQ_CANL (VIRQ_START + 7)
128#define VIRQ_UART1 (VIRQ_START + 8)
129#define VIRQ_UART2 (VIRQ_START + 9)
130#define VIRQ_SSP1 (VIRQ_START + 10)
131#define VIRQ_SSP2 (VIRQ_START + 11)
132#define VIRQ_SMII0 (VIRQ_START + 12)
133#define VIRQ_MII1_SMII1 (VIRQ_START + 13)
134#define VIRQ_WAKEUP_SMII0 (VIRQ_START + 14)
135#define VIRQ_WAKEUP_MII1_SMII1 (VIRQ_START + 15)
136#define VIRQ_I2C (VIRQ_START + 16)
137
138/* GPIO pins virtual irqs */
139#define SPEAR_GPIO_INT_BASE (VIRQ_START + 17)
140
141#endif
142
143/* PLGPIO Virtual IRQs */
144#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
145#define SPEAR_PLGPIO_INT_BASE (SPEAR_GPIO_INT_BASE + 8)
146#define SPEAR_GPIO_INT_END (SPEAR_PLGPIO_INT_BASE + 102)
147#endif
148
149#define VIRQ_END SPEAR_GPIO_INT_END
150#define NR_IRQS VIRQ_END
151
152#endif /* __MACH_IRQS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/memory.h b/arch/arm/mach-spear3xx/include/mach/memory.h
new file mode 100644
index 000000000000..51735221ea19
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/memory.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/memory.h
3 *
4 * Memory map for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_MEMORY_H
15#define __MACH_MEMORY_H
16
17#include <plat/memory.h>
18
19#endif /* __MACH_MEMORY_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/misc_regs.h b/arch/arm/mach-spear3xx/include/mach/misc_regs.h
new file mode 100644
index 000000000000..38d767a1aba0
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/misc_regs.h
@@ -0,0 +1,163 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/misc_regs.h
3 *
4 * Miscellaneous registers definitions for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_MISC_REGS_H
15#define __MACH_MISC_REGS_H
16
17#include <mach/spear.h>
18
19#define MISC_BASE VA_SPEAR3XX_ICM3_MISC_REG_BASE
20
21#define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000))
22#define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004))
23#define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008))
24#define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C))
25#define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010))
26#define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014))
27/* PLL_CTR register masks */
28#define PLL_ENABLE 2
29#define PLL_MODE_SHIFT 4
30#define PLL_MODE_MASK 0x3
31#define PLL_MODE_NORMAL 0
32#define PLL_MODE_FRACTION 1
33#define PLL_MODE_DITH_DSB 2
34#define PLL_MODE_DITH_SSB 3
35
36#define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018))
37/* PLL FRQ register masks */
38#define PLL_DIV_N_SHIFT 0
39#define PLL_DIV_N_MASK 0xFF
40#define PLL_DIV_P_SHIFT 8
41#define PLL_DIV_P_MASK 0x7
42#define PLL_NORM_FDBK_M_SHIFT 24
43#define PLL_NORM_FDBK_M_MASK 0xFF
44#define PLL_DITH_FDBK_M_SHIFT 16
45#define PLL_DITH_FDBK_M_MASK 0xFFFF
46
47#define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C))
48#define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020))
49#define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024))
50/* CORE CLK CFG register masks */
51#define PLL_HCLK_RATIO_SHIFT 10
52#define PLL_HCLK_RATIO_MASK 0x3
53#define HCLK_PCLK_RATIO_SHIFT 8
54#define HCLK_PCLK_RATIO_MASK 0x3
55
56#define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028))
57/* PERIP_CLK_CFG register masks */
58#define UART_CLK_SHIFT 4
59#define UART_CLK_MASK 0x1
60#define FIRDA_CLK_SHIFT 5
61#define FIRDA_CLK_MASK 0x3
62#define GPT0_CLK_SHIFT 8
63#define GPT1_CLK_SHIFT 11
64#define GPT2_CLK_SHIFT 12
65#define GPT_CLK_MASK 0x1
66#define AUX_CLK_PLL3_MASK 0
67#define AUX_CLK_PLL1_MASK 1
68
69#define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C))
70/* PERIP1_CLK_ENB register masks */
71#define UART_CLK_ENB 3
72#define SSP_CLK_ENB 5
73#define I2C_CLK_ENB 7
74#define JPEG_CLK_ENB 8
75#define FIRDA_CLK_ENB 10
76#define GPT1_CLK_ENB 11
77#define GPT2_CLK_ENB 12
78#define ADC_CLK_ENB 15
79#define RTC_CLK_ENB 17
80#define GPIO_CLK_ENB 18
81#define DMA_CLK_ENB 19
82#define SMI_CLK_ENB 21
83#define GMAC_CLK_ENB 23
84#define USBD_CLK_ENB 24
85#define USBH_CLK_ENB 25
86#define C3_CLK_ENB 31
87
88#define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030))
89#define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034))
90#define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038))
91/* PERIP1_SOF_RST register masks */
92#define JPEG_SOF_RST 8
93
94#define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C))
95#define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040))
96#define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044))
97#define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048))
98#define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C))
99/* gpt synthesizer register masks */
100#define GPT_MSCALE_SHIFT 0
101#define GPT_MSCALE_MASK 0xFFF
102#define GPT_NSCALE_SHIFT 12
103#define GPT_NSCALE_MASK 0xF
104
105#define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050))
106#define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054))
107#define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C))
108#define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060))
109#define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064))
110#define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068))
111#define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C))
112#define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070))
113#define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074))
114#define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078))
115/* aux clk synthesiser register masks for irda to ras4 */
116#define AUX_EQ_SEL_SHIFT 30
117#define AUX_EQ_SEL_MASK 1
118#define AUX_EQ1_SEL 0
119#define AUX_EQ2_SEL 1
120#define AUX_XSCALE_SHIFT 16
121#define AUX_XSCALE_MASK 0xFFF
122#define AUX_YSCALE_SHIFT 0
123#define AUX_YSCALE_MASK 0xFFF
124
125#define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C))
126#define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080))
127#define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084))
128#define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088))
129#define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C))
130#define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090))
131#define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094))
132#define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098))
133#define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C))
134#define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0))
135#define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4))
136#define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8))
137#define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC))
138#define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0))
139#define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4))
140#define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8))
141#define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC))
142#define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0))
143#define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4))
144#define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8))
145#define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC))
146#define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0))
147#define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4))
148#define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8))
149#define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC))
150#define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0))
151#define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4))
152#define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8))
153#define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC))
154#define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100))
155#define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104))
156#define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108))
157#define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C))
158#define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110))
159#define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114))
160#define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118))
161#define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C))
162
163#endif /* __MACH_MISC_REGS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear.h b/arch/arm/mach-spear3xx/include/mach/spear.h
new file mode 100644
index 000000000000..dcca8568a486
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/spear.h
@@ -0,0 +1,144 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/spear.h
3 *
4 * SPEAr3xx Machine family specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_SPEAR3XX_H
15#define __MACH_SPEAR3XX_H
16
17#include <mach/hardware.h>
18#include <mach/spear300.h>
19#include <mach/spear310.h>
20#include <mach/spear320.h>
21
22#define SPEAR3XX_ML_SDRAM_BASE 0x00000000
23#define SPEAR3XX_ML_SDRAM_SIZE 0x40000000
24
25#define SPEAR3XX_ICM9_BASE 0xC0000000
26#define SPEAR3XX_ICM9_SIZE 0x10000000
27
28/* ICM1 - Low speed connection */
29#define SPEAR3XX_ICM1_2_BASE 0xD0000000
30#define SPEAR3XX_ICM1_2_SIZE 0x10000000
31
32#define SPEAR3XX_ICM1_UART_BASE 0xD0000000
33#define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE)
34#define SPEAR3XX_ICM1_UART_SIZE 0x00080000
35
36#define SPEAR3XX_ICM1_ADC_BASE 0xD0080000
37#define SPEAR3XX_ICM1_ADC_SIZE 0x00080000
38
39#define SPEAR3XX_ICM1_SSP_BASE 0xD0100000
40#define SPEAR3XX_ICM1_SSP_SIZE 0x00080000
41
42#define SPEAR3XX_ICM1_I2C_BASE 0xD0180000
43#define SPEAR3XX_ICM1_I2C_SIZE 0x00080000
44
45#define SPEAR3XX_ICM1_JPEG_BASE 0xD0800000
46#define SPEAR3XX_ICM1_JPEG_SIZE 0x00800000
47
48#define SPEAR3XX_ICM1_IRDA_BASE 0xD1000000
49#define SPEAR3XX_ICM1_IRDA_SIZE 0x00080000
50
51#define SPEAR3XX_ICM1_SRAM_BASE 0xD2800000
52#define SPEAR3XX_ICM1_SRAM_SIZE 0x05800000
53
54/* ICM2 - Application Subsystem */
55#define SPEAR3XX_ICM2_HWACCEL0_BASE 0xD8800000
56#define SPEAR3XX_ICM2_HWACCEL0_SIZE 0x00800000
57
58#define SPEAR3XX_ICM2_HWACCEL1_BASE 0xD9000000
59#define SPEAR3XX_ICM2_HWACCEL1_SIZE 0x00800000
60
61/* ICM4 - High Speed Connection */
62#define SPEAR3XX_ICM4_BASE 0xE0000000
63#define SPEAR3XX_ICM4_SIZE 0x08000000
64
65#define SPEAR3XX_ICM4_MII_BASE 0xE0800000
66#define SPEAR3XX_ICM4_MII_SIZE 0x00800000
67
68#define SPEAR3XX_ICM4_USBD_FIFO_BASE 0xE1000000
69#define SPEAR3XX_ICM4_USBD_FIFO_SIZE 0x00100000
70
71#define SPEAR3XX_ICM4_USBD_CSR_BASE 0xE1100000
72#define SPEAR3XX_ICM4_USBD_CSR_SIZE 0x00100000
73
74#define SPEAR3XX_ICM4_USBD_PLDT_BASE 0xE1200000
75#define SPEAR3XX_ICM4_USBD_PLDT_SIZE 0x00100000
76
77#define SPEAR3XX_ICM4_USB_EHCI0_1_BASE 0xE1800000
78#define SPEAR3XX_ICM4_USB_EHCI0_1_SIZE 0x00100000
79
80#define SPEAR3XX_ICM4_USB_OHCI0_BASE 0xE1900000
81#define SPEAR3XX_ICM4_USB_OHCI0_SIZE 0x00100000
82
83#define SPEAR3XX_ICM4_USB_OHCI1_BASE 0xE2100000
84#define SPEAR3XX_ICM4_USB_OHCI1_SIZE 0x00100000
85
86#define SPEAR3XX_ICM4_USB_ARB_BASE 0xE2800000
87#define SPEAR3XX_ICM4_USB_ARB_SIZE 0x00010000
88
89/* ML1 - Multi Layer CPU Subsystem */
90#define SPEAR3XX_ICM3_ML1_2_BASE 0xF0000000
91#define SPEAR3XX_ICM3_ML1_2_SIZE 0x0F000000
92
93#define SPEAR3XX_ML1_TMR_BASE 0xF0000000
94#define SPEAR3XX_ML1_TMR_SIZE 0x00100000
95
96#define SPEAR3XX_ML1_VIC_BASE 0xF1100000
97#define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE)
98#define SPEAR3XX_ML1_VIC_SIZE 0x00100000
99
100/* ICM3 - Basic Subsystem */
101#define SPEAR3XX_ICM3_SMEM_BASE 0xF8000000
102#define SPEAR3XX_ICM3_SMEM_SIZE 0x04000000
103
104#define SPEAR3XX_ICM3_SMI_CTRL_BASE 0xFC000000
105#define SPEAR3XX_ICM3_SMI_CTRL_SIZE 0x00200000
106
107#define SPEAR3XX_ICM3_DMA_BASE 0xFC400000
108#define SPEAR3XX_ICM3_DMA_SIZE 0x00200000
109
110#define SPEAR3XX_ICM3_SDRAM_CTRL_BASE 0xFC600000
111#define SPEAR3XX_ICM3_SDRAM_CTRL_SIZE 0x00200000
112
113#define SPEAR3XX_ICM3_TMR0_BASE 0xFC800000
114#define SPEAR3XX_ICM3_TMR0_SIZE 0x00080000
115
116#define SPEAR3XX_ICM3_WDT_BASE 0xFC880000
117#define SPEAR3XX_ICM3_WDT_SIZE 0x00080000
118
119#define SPEAR3XX_ICM3_RTC_BASE 0xFC900000
120#define SPEAR3XX_ICM3_RTC_SIZE 0x00080000
121
122#define SPEAR3XX_ICM3_GPIO_BASE 0xFC980000
123#define SPEAR3XX_ICM3_GPIO_SIZE 0x00080000
124
125#define SPEAR3XX_ICM3_SYS_CTRL_BASE 0xFCA00000
126#define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE)
127#define SPEAR3XX_ICM3_SYS_CTRL_SIZE 0x00080000
128
129#define SPEAR3XX_ICM3_MISC_REG_BASE 0xFCA80000
130#define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE)
131#define SPEAR3XX_ICM3_MISC_REG_SIZE 0x00080000
132
133#define SPEAR3XX_ICM3_TMR1_BASE 0xFCB00000
134#define SPEAR3XX_ICM3_TMR1_SIZE 0x00080000
135
136/* Debug uart for linux, will be used for debug and uncompress messages */
137#define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE
138#define VA_SPEAR_DBG_UART_BASE VA_SPEAR3XX_ICM1_UART_BASE
139
140/* Sysctl base for spear platform */
141#define SPEAR_SYS_CTRL_BASE SPEAR3XX_ICM3_SYS_CTRL_BASE
142#define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR3XX_ICM3_SYS_CTRL_BASE
143
144#endif /* __MACH_SPEAR3XX_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h
new file mode 100644
index 000000000000..ccaa76522ee2
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/spear300.h
@@ -0,0 +1,83 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/spear300.h
3 *
4 * SPEAr300 Machine specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifdef CONFIG_MACH_SPEAR300
15
16#ifndef __MACH_SPEAR300_H
17#define __MACH_SPEAR300_H
18
19/* Base address of various IPs */
20#define SPEAR300_TELECOM_BASE 0x50000000
21#define SPEAR300_TELECOM_SIZE 0x10000000
22
23/* Interrupt registers offsets and masks */
24#define SPEAR300_TELECOM_REG_SIZE 0x00010000
25#define INT_ENB_MASK_REG 0x54
26#define INT_STS_MASK_REG 0x58
27#define IT_PERS_S_IRQ_MASK (1 << 0)
28#define IT_CHANGE_S_IRQ_MASK (1 << 1)
29#define I2S_IRQ_MASK (1 << 2)
30#define TDM_IRQ_MASK (1 << 3)
31#define CAMERA_L_IRQ_MASK (1 << 4)
32#define CAMERA_F_IRQ_MASK (1 << 5)
33#define CAMERA_V_IRQ_MASK (1 << 6)
34#define KEYBOARD_IRQ_MASK (1 << 7)
35#define GPIO1_IRQ_MASK (1 << 8)
36
37#define SHIRQ_RAS1_MASK 0x1FF
38
39#define SPEAR300_CLCD_BASE 0x60000000
40#define SPEAR300_CLCD_SIZE 0x10000000
41
42#define SPEAR300_SDIO_BASE 0x70000000
43#define SPEAR300_SDIO_SIZE 0x10000000
44
45#define SPEAR300_NAND_0_BASE 0x80000000
46#define SPEAR300_NAND_0_SIZE 0x04000000
47
48#define SPEAR300_NAND_1_BASE 0x84000000
49#define SPEAR300_NAND_1_SIZE 0x04000000
50
51#define SPEAR300_NAND_2_BASE 0x88000000
52#define SPEAR300_NAND_2_SIZE 0x04000000
53
54#define SPEAR300_NAND_3_BASE 0x8c000000
55#define SPEAR300_NAND_3_SIZE 0x04000000
56
57#define SPEAR300_NOR_0_BASE 0x90000000
58#define SPEAR300_NOR_0_SIZE 0x01000000
59
60#define SPEAR300_NOR_1_BASE 0x91000000
61#define SPEAR300_NOR_1_SIZE 0x01000000
62
63#define SPEAR300_NOR_2_BASE 0x92000000
64#define SPEAR300_NOR_2_SIZE 0x01000000
65
66#define SPEAR300_NOR_3_BASE 0x93000000
67#define SPEAR300_NOR_3_SIZE 0x01000000
68
69#define SPEAR300_FSMC_BASE 0x94000000
70#define SPEAR300_FSMC_SIZE 0x05000000
71
72#define SPEAR300_SOC_CONFIG_BASE 0x99000000
73#define SPEAR300_SOC_CONFIG_SIZE 0x00000008
74
75#define SPEAR300_KEYBOARD_BASE 0xA0000000
76#define SPEAR300_KEYBOARD_SIZE 0x09000000
77
78#define SPEAR300_GPIO_BASE 0xA9000000
79#define SPEAR300_GPIO_SIZE 0x07000000
80
81#endif /* __MACH_SPEAR300_H */
82
83#endif /* CONFIG_MACH_SPEAR300 */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h
new file mode 100644
index 000000000000..b27bb8af3309
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/spear310.h
@@ -0,0 +1,70 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/spear310.h
3 *
4 * SPEAr310 Machine specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifdef CONFIG_MACH_SPEAR310
15
16#ifndef __MACH_SPEAR310_H
17#define __MACH_SPEAR310_H
18
19#define SPEAR310_NAND_BASE 0x40000000
20#define SPEAR310_NAND_SIZE 0x04000000
21
22#define SPEAR310_FSMC_BASE 0x44000000
23#define SPEAR310_FSMC_SIZE 0x01000000
24
25#define SPEAR310_UART1_BASE 0xB2000000
26#define SPEAR310_UART2_BASE 0xB2080000
27#define SPEAR310_UART3_BASE 0xB2100000
28#define SPEAR310_UART4_BASE 0xB2180000
29#define SPEAR310_UART5_BASE 0xB2200000
30#define SPEAR310_UART_SIZE 0x00080000
31
32#define SPEAR310_HDLC_BASE 0xB2800000
33#define SPEAR310_HDLC_SIZE 0x00800000
34
35#define SPEAR310_RS485_0_BASE 0xB3000000
36#define SPEAR310_RS485_0_SIZE 0x00800000
37
38#define SPEAR310_RS485_1_BASE 0xB3800000
39#define SPEAR310_RS485_1_SIZE 0x00800000
40
41#define SPEAR310_SOC_CONFIG_BASE 0xB4000000
42#define SPEAR310_SOC_CONFIG_SIZE 0x00000070
43/* Interrupt registers offsets and masks */
44#define INT_STS_MASK_REG 0x04
45#define SMII0_IRQ_MASK (1 << 0)
46#define SMII1_IRQ_MASK (1 << 1)
47#define SMII2_IRQ_MASK (1 << 2)
48#define SMII3_IRQ_MASK (1 << 3)
49#define WAKEUP_SMII0_IRQ_MASK (1 << 4)
50#define WAKEUP_SMII1_IRQ_MASK (1 << 5)
51#define WAKEUP_SMII2_IRQ_MASK (1 << 6)
52#define WAKEUP_SMII3_IRQ_MASK (1 << 7)
53#define UART1_IRQ_MASK (1 << 8)
54#define UART2_IRQ_MASK (1 << 9)
55#define UART3_IRQ_MASK (1 << 10)
56#define UART4_IRQ_MASK (1 << 11)
57#define UART5_IRQ_MASK (1 << 12)
58#define EMI_IRQ_MASK (1 << 13)
59#define TDM_HDLC_IRQ_MASK (1 << 14)
60#define RS485_0_IRQ_MASK (1 << 15)
61#define RS485_1_IRQ_MASK (1 << 16)
62
63#define SHIRQ_RAS1_MASK 0x000FF
64#define SHIRQ_RAS2_MASK 0x01F00
65#define SHIRQ_RAS3_MASK 0x02000
66#define SHIRQ_INTRCOMM_RAS_MASK 0x1C000
67
68#endif /* __MACH_SPEAR310_H */
69
70#endif /* CONFIG_MACH_SPEAR310 */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h
new file mode 100644
index 000000000000..cacf17a958cd
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/spear320.h
@@ -0,0 +1,96 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/spear320.h
3 *
4 * SPEAr320 Machine specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifdef CONFIG_MACH_SPEAR320
15
16#ifndef __MACH_SPEAR320_H
17#define __MACH_SPEAR320_H
18
19#define SPEAR320_EMI_CTRL_BASE 0x40000000
20#define SPEAR320_EMI_CTRL_SIZE 0x08000000
21
22#define SPEAR320_FSMC_BASE 0x4C000000
23#define SPEAR320_FSMC_SIZE 0x01000000
24
25#define SPEAR320_I2S_BASE 0x60000000
26#define SPEAR320_I2S_SIZE 0x10000000
27
28#define SPEAR320_SDIO_BASE 0x70000000
29#define SPEAR320_SDIO_SIZE 0x10000000
30
31#define SPEAR320_CLCD_BASE 0x90000000
32#define SPEAR320_CLCD_SIZE 0x10000000
33
34#define SPEAR320_PAR_PORT_BASE 0xA0000000
35#define SPEAR320_PAR_PORT_SIZE 0x01000000
36
37#define SPEAR320_CAN0_BASE 0xA1000000
38#define SPEAR320_CAN0_SIZE 0x01000000
39
40#define SPEAR320_CAN1_BASE 0xA2000000
41#define SPEAR320_CAN1_SIZE 0x01000000
42
43#define SPEAR320_UART1_BASE 0xA3000000
44#define SPEAR320_UART2_BASE 0xA4000000
45#define SPEAR320_UART_SIZE 0x01000000
46
47#define SPEAR320_SSP0_BASE 0xA5000000
48#define SPEAR320_SSP0_SIZE 0x01000000
49
50#define SPEAR320_SSP1_BASE 0xA6000000
51#define SPEAR320_SSP1_SIZE 0x01000000
52
53#define SPEAR320_I2C_BASE 0xA7000000
54#define SPEAR320_I2C_SIZE 0x01000000
55
56#define SPEAR320_PWM_BASE 0xA8000000
57#define SPEAR320_PWM_SIZE 0x01000000
58
59#define SPEAR320_SMII0_BASE 0xAA000000
60#define SPEAR320_SMII0_SIZE 0x01000000
61
62#define SPEAR320_SMII1_BASE 0xAB000000
63#define SPEAR320_SMII1_SIZE 0x01000000
64
65#define SPEAR320_SOC_CONFIG_BASE 0xB4000000
66#define SPEAR320_SOC_CONFIG_SIZE 0x00000070
67/* Interrupt registers offsets and masks */
68#define INT_STS_MASK_REG 0x04
69#define INT_CLR_MASK_REG 0x04
70#define INT_ENB_MASK_REG 0x08
71#define GPIO_IRQ_MASK (1 << 0)
72#define I2S_PLAY_IRQ_MASK (1 << 1)
73#define I2S_REC_IRQ_MASK (1 << 2)
74#define EMI_IRQ_MASK (1 << 7)
75#define CLCD_IRQ_MASK (1 << 8)
76#define SPP_IRQ_MASK (1 << 9)
77#define SDIO_IRQ_MASK (1 << 10)
78#define CAN_U_IRQ_MASK (1 << 11)
79#define CAN_L_IRQ_MASK (1 << 12)
80#define UART1_IRQ_MASK (1 << 13)
81#define UART2_IRQ_MASK (1 << 14)
82#define SSP1_IRQ_MASK (1 << 15)
83#define SSP2_IRQ_MASK (1 << 16)
84#define SMII0_IRQ_MASK (1 << 17)
85#define MII1_SMII1_IRQ_MASK (1 << 18)
86#define WAKEUP_SMII0_IRQ_MASK (1 << 19)
87#define WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20)
88#define I2C1_IRQ_MASK (1 << 21)
89
90#define SHIRQ_RAS1_MASK 0x000380
91#define SHIRQ_RAS3_MASK 0x000007
92#define SHIRQ_INTRCOMM_RAS_MASK 0x3FF800
93
94#endif /* __MACH_SPEAR320_H */
95
96#endif /* CONFIG_MACH_SPEAR320 */
diff --git a/arch/arm/mach-spear3xx/include/mach/system.h b/arch/arm/mach-spear3xx/include/mach/system.h
new file mode 100644
index 000000000000..92cee6335c90
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/system.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/system.h
3 *
4 * SPEAr3xx Machine family specific architecture functions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_SYSTEM_H
15#define __MACH_SYSTEM_H
16
17#include <plat/system.h>
18
19#endif /* __MACH_SYSTEM_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/timex.h b/arch/arm/mach-spear3xx/include/mach/timex.h
new file mode 100644
index 000000000000..a38cc9de876f
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/timex.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/timex.h
3 *
4 * SPEAr3XX machine family specific timex definitions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_TIMEX_H
15#define __MACH_TIMEX_H
16
17#include <plat/timex.h>
18
19#endif /* __MACH_TIMEX_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/uncompress.h b/arch/arm/mach-spear3xx/include/mach/uncompress.h
new file mode 100644
index 000000000000..53ba8bbc0dfa
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/uncompress.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_UNCOMPRESS_H
15#define __MACH_UNCOMPRESS_H
16
17#include <plat/uncompress.h>
18
19#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/vmalloc.h b/arch/arm/mach-spear3xx/include/mach/vmalloc.h
new file mode 100644
index 000000000000..df977b3c9a63
--- /dev/null
+++ b/arch/arm/mach-spear3xx/include/mach/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear3xx/include/mach/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr3xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_VMALLOC_H
15#define __MACH_VMALLOC_H
16
17#include <plat/vmalloc.h>
18
19#endif /* __MACH_VMALLOC_H */
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
new file mode 100644
index 000000000000..3560f8c1e723
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -0,0 +1,468 @@
1/*
2 * arch/arm/mach-spear3xx/spear300.c
3 *
4 * SPEAr300 machine source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <asm/irq.h>
18#include <mach/generic.h>
19#include <mach/spear.h>
20#include <plat/shirq.h>
21
22/* pad multiplexing support */
23/* muxing registers */
24#define PAD_MUX_CONFIG_REG 0x00
25#define MODE_CONFIG_REG 0x04
26
27/* modes */
28#define NAND_MODE (1 << 0)
29#define NOR_MODE (1 << 1)
30#define PHOTO_FRAME_MODE (1 << 2)
31#define LEND_IP_PHONE_MODE (1 << 3)
32#define HEND_IP_PHONE_MODE (1 << 4)
33#define LEND_WIFI_PHONE_MODE (1 << 5)
34#define HEND_WIFI_PHONE_MODE (1 << 6)
35#define ATA_PABX_WI2S_MODE (1 << 7)
36#define ATA_PABX_I2S_MODE (1 << 8)
37#define CAML_LCDW_MODE (1 << 9)
38#define CAMU_LCD_MODE (1 << 10)
39#define CAMU_WLCD_MODE (1 << 11)
40#define CAML_LCD_MODE (1 << 12)
41#define ALL_MODES 0x1FFF
42
43struct pmx_mode nand_mode = {
44 .id = NAND_MODE,
45 .name = "nand mode",
46 .mask = 0x00,
47};
48
49struct pmx_mode nor_mode = {
50 .id = NOR_MODE,
51 .name = "nor mode",
52 .mask = 0x01,
53};
54
55struct pmx_mode photo_frame_mode = {
56 .id = PHOTO_FRAME_MODE,
57 .name = "photo frame mode",
58 .mask = 0x02,
59};
60
61struct pmx_mode lend_ip_phone_mode = {
62 .id = LEND_IP_PHONE_MODE,
63 .name = "lend ip phone mode",
64 .mask = 0x03,
65};
66
67struct pmx_mode hend_ip_phone_mode = {
68 .id = HEND_IP_PHONE_MODE,
69 .name = "hend ip phone mode",
70 .mask = 0x04,
71};
72
73struct pmx_mode lend_wifi_phone_mode = {
74 .id = LEND_WIFI_PHONE_MODE,
75 .name = "lend wifi phone mode",
76 .mask = 0x05,
77};
78
79struct pmx_mode hend_wifi_phone_mode = {
80 .id = HEND_WIFI_PHONE_MODE,
81 .name = "hend wifi phone mode",
82 .mask = 0x06,
83};
84
85struct pmx_mode ata_pabx_wi2s_mode = {
86 .id = ATA_PABX_WI2S_MODE,
87 .name = "ata pabx wi2s mode",
88 .mask = 0x07,
89};
90
91struct pmx_mode ata_pabx_i2s_mode = {
92 .id = ATA_PABX_I2S_MODE,
93 .name = "ata pabx i2s mode",
94 .mask = 0x08,
95};
96
97struct pmx_mode caml_lcdw_mode = {
98 .id = CAML_LCDW_MODE,
99 .name = "caml lcdw mode",
100 .mask = 0x0C,
101};
102
103struct pmx_mode camu_lcd_mode = {
104 .id = CAMU_LCD_MODE,
105 .name = "camu lcd mode",
106 .mask = 0x0D,
107};
108
109struct pmx_mode camu_wlcd_mode = {
110 .id = CAMU_WLCD_MODE,
111 .name = "camu wlcd mode",
112 .mask = 0x0E,
113};
114
115struct pmx_mode caml_lcd_mode = {
116 .id = CAML_LCD_MODE,
117 .name = "caml lcd mode",
118 .mask = 0x0F,
119};
120
121/* devices */
122struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = {
123 {
124 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
125 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
126 .mask = PMX_FIRDA_MASK,
127 },
128};
129
130struct pmx_dev pmx_fsmc_2_chips = {
131 .name = "fsmc_2_chips",
132 .modes = pmx_fsmc_2_chips_modes,
133 .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes),
134 .enb_on_reset = 1,
135};
136
137struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = {
138 {
139 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
140 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
141 .mask = PMX_FIRDA_MASK | PMX_UART0_MASK,
142 },
143};
144
145struct pmx_dev pmx_fsmc_4_chips = {
146 .name = "fsmc_4_chips",
147 .modes = pmx_fsmc_4_chips_modes,
148 .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes),
149 .enb_on_reset = 1,
150};
151
152struct pmx_dev_mode pmx_keyboard_modes[] = {
153 {
154 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
155 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
156 CAML_LCDW_MODE | CAMU_LCD_MODE | CAMU_WLCD_MODE |
157 CAML_LCD_MODE,
158 .mask = 0x0,
159 },
160};
161
162struct pmx_dev pmx_keyboard = {
163 .name = "keyboard",
164 .modes = pmx_keyboard_modes,
165 .mode_count = ARRAY_SIZE(pmx_keyboard_modes),
166 .enb_on_reset = 1,
167};
168
169struct pmx_dev_mode pmx_clcd_modes[] = {
170 {
171 .ids = PHOTO_FRAME_MODE,
172 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK ,
173 }, {
174 .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE |
175 CAMU_LCD_MODE | CAML_LCD_MODE,
176 .mask = PMX_TIMER_3_4_MASK,
177 },
178};
179
180struct pmx_dev pmx_clcd = {
181 .name = "clcd",
182 .modes = pmx_clcd_modes,
183 .mode_count = ARRAY_SIZE(pmx_clcd_modes),
184 .enb_on_reset = 1,
185};
186
187struct pmx_dev_mode pmx_telecom_gpio_modes[] = {
188 {
189 .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE,
190 .mask = PMX_MII_MASK,
191 }, {
192 .ids = LEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE,
193 .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
194 }, {
195 .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_WLCD_MODE,
196 .mask = PMX_MII_MASK | PMX_TIMER_3_4_MASK,
197 }, {
198 .ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE,
199 .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK,
200 }, {
201 .ids = ATA_PABX_WI2S_MODE,
202 .mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK
203 | PMX_UART0_MODEM_MASK,
204 },
205};
206
207struct pmx_dev pmx_telecom_gpio = {
208 .name = "telecom_gpio",
209 .modes = pmx_telecom_gpio_modes,
210 .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes),
211 .enb_on_reset = 1,
212};
213
214struct pmx_dev_mode pmx_telecom_tdm_modes[] = {
215 {
216 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
217 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE
218 | HEND_WIFI_PHONE_MODE | ATA_PABX_WI2S_MODE
219 | ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
220 | CAMU_WLCD_MODE | CAML_LCD_MODE,
221 .mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK,
222 },
223};
224
225struct pmx_dev pmx_telecom_tdm = {
226 .name = "telecom_tdm",
227 .modes = pmx_telecom_tdm_modes,
228 .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes),
229 .enb_on_reset = 1,
230};
231
232struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = {
233 {
234 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
235 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE
236 | ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE |
237 CAML_LCDW_MODE | CAML_LCD_MODE,
238 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
239 },
240};
241
242struct pmx_dev pmx_telecom_spi_cs_i2c_clk = {
243 .name = "telecom_spi_cs_i2c_clk",
244 .modes = pmx_telecom_spi_cs_i2c_clk_modes,
245 .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes),
246 .enb_on_reset = 1,
247};
248
249struct pmx_dev_mode pmx_telecom_camera_modes[] = {
250 {
251 .ids = CAML_LCDW_MODE | CAML_LCD_MODE,
252 .mask = PMX_MII_MASK,
253 }, {
254 .ids = CAMU_LCD_MODE | CAMU_WLCD_MODE,
255 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | PMX_MII_MASK,
256 },
257};
258
259struct pmx_dev pmx_telecom_camera = {
260 .name = "telecom_camera",
261 .modes = pmx_telecom_camera_modes,
262 .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes),
263 .enb_on_reset = 1,
264};
265
266struct pmx_dev_mode pmx_telecom_dac_modes[] = {
267 {
268 .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
269 | CAMU_WLCD_MODE | CAML_LCD_MODE,
270 .mask = PMX_TIMER_1_2_MASK,
271 },
272};
273
274struct pmx_dev pmx_telecom_dac = {
275 .name = "telecom_dac",
276 .modes = pmx_telecom_dac_modes,
277 .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes),
278 .enb_on_reset = 1,
279};
280
281struct pmx_dev_mode pmx_telecom_i2s_modes[] = {
282 {
283 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE
284 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
285 ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
286 | CAMU_WLCD_MODE | CAML_LCD_MODE,
287 .mask = PMX_UART0_MODEM_MASK,
288 },
289};
290
291struct pmx_dev pmx_telecom_i2s = {
292 .name = "telecom_i2s",
293 .modes = pmx_telecom_i2s_modes,
294 .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes),
295 .enb_on_reset = 1,
296};
297
298struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = {
299 {
300 .ids = NAND_MODE | NOR_MODE,
301 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
302 PMX_TIMER_3_4_MASK,
303 },
304};
305
306struct pmx_dev pmx_telecom_boot_pins = {
307 .name = "telecom_boot_pins",
308 .modes = pmx_telecom_boot_pins_modes,
309 .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes),
310 .enb_on_reset = 1,
311};
312
313struct pmx_dev_mode pmx_telecom_sdio_4bit_modes[] = {
314 {
315 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
316 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
317 HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
318 CAMU_WLCD_MODE | CAML_LCD_MODE | ATA_PABX_WI2S_MODE |
319 ATA_PABX_I2S_MODE,
320 .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK |
321 PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
322 PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK,
323 },
324};
325
326struct pmx_dev pmx_telecom_sdio_4bit = {
327 .name = "telecom_sdio_4bit",
328 .modes = pmx_telecom_sdio_4bit_modes,
329 .mode_count = ARRAY_SIZE(pmx_telecom_sdio_4bit_modes),
330 .enb_on_reset = 1,
331};
332
333struct pmx_dev_mode pmx_telecom_sdio_8bit_modes[] = {
334 {
335 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
336 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
337 HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
338 CAMU_WLCD_MODE | CAML_LCD_MODE,
339 .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK |
340 PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
341 PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK | PMX_MII_MASK,
342 },
343};
344
345struct pmx_dev pmx_telecom_sdio_8bit = {
346 .name = "telecom_sdio_8bit",
347 .modes = pmx_telecom_sdio_8bit_modes,
348 .mode_count = ARRAY_SIZE(pmx_telecom_sdio_8bit_modes),
349 .enb_on_reset = 1,
350};
351
352struct pmx_dev_mode pmx_gpio1_modes[] = {
353 {
354 .ids = PHOTO_FRAME_MODE,
355 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
356 PMX_TIMER_3_4_MASK,
357 },
358};
359
360struct pmx_dev pmx_gpio1 = {
361 .name = "arm gpio1",
362 .modes = pmx_gpio1_modes,
363 .mode_count = ARRAY_SIZE(pmx_gpio1_modes),
364 .enb_on_reset = 1,
365};
366
367/* pmx driver structure */
368struct pmx_driver pmx_driver = {
369 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f},
370 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
371};
372
373/* Add spear300 specific devices here */
374/* arm gpio1 device registeration */
375static struct pl061_platform_data gpio1_plat_data = {
376 .gpio_base = 8,
377 .irq_base = SPEAR_GPIO1_INT_BASE,
378};
379
380struct amba_device gpio1_device = {
381 .dev = {
382 .init_name = "gpio1",
383 .platform_data = &gpio1_plat_data,
384 },
385 .res = {
386 .start = SPEAR300_GPIO_BASE,
387 .end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1,
388 .flags = IORESOURCE_MEM,
389 },
390 .irq = {VIRQ_GPIO1, NO_IRQ},
391};
392
393/* spear3xx shared irq */
394struct shirq_dev_config shirq_ras1_config[] = {
395 {
396 .virq = VIRQ_IT_PERS_S,
397 .enb_mask = IT_PERS_S_IRQ_MASK,
398 .status_mask = IT_PERS_S_IRQ_MASK,
399 }, {
400 .virq = VIRQ_IT_CHANGE_S,
401 .enb_mask = IT_CHANGE_S_IRQ_MASK,
402 .status_mask = IT_CHANGE_S_IRQ_MASK,
403 }, {
404 .virq = VIRQ_I2S,
405 .enb_mask = I2S_IRQ_MASK,
406 .status_mask = I2S_IRQ_MASK,
407 }, {
408 .virq = VIRQ_TDM,
409 .enb_mask = TDM_IRQ_MASK,
410 .status_mask = TDM_IRQ_MASK,
411 }, {
412 .virq = VIRQ_CAMERA_L,
413 .enb_mask = CAMERA_L_IRQ_MASK,
414 .status_mask = CAMERA_L_IRQ_MASK,
415 }, {
416 .virq = VIRQ_CAMERA_F,
417 .enb_mask = CAMERA_F_IRQ_MASK,
418 .status_mask = CAMERA_F_IRQ_MASK,
419 }, {
420 .virq = VIRQ_CAMERA_V,
421 .enb_mask = CAMERA_V_IRQ_MASK,
422 .status_mask = CAMERA_V_IRQ_MASK,
423 }, {
424 .virq = VIRQ_KEYBOARD,
425 .enb_mask = KEYBOARD_IRQ_MASK,
426 .status_mask = KEYBOARD_IRQ_MASK,
427 }, {
428 .virq = VIRQ_GPIO1,
429 .enb_mask = GPIO1_IRQ_MASK,
430 .status_mask = GPIO1_IRQ_MASK,
431 },
432};
433
434struct spear_shirq shirq_ras1 = {
435 .irq = IRQ_GEN_RAS_1,
436 .dev_config = shirq_ras1_config,
437 .dev_count = ARRAY_SIZE(shirq_ras1_config),
438 .regs = {
439 .enb_reg = INT_ENB_MASK_REG,
440 .status_reg = INT_STS_MASK_REG,
441 .status_reg_mask = SHIRQ_RAS1_MASK,
442 .clear_reg = -1,
443 },
444};
445
446/* spear300 routines */
447void __init spear300_init(void)
448{
449 int ret = 0;
450
451 /* call spear3xx family common init function */
452 spear3xx_init();
453
454 /* shared irq registeration */
455 shirq_ras1.regs.base =
456 ioremap(SPEAR300_TELECOM_BASE, SPEAR300_TELECOM_REG_SIZE);
457 if (shirq_ras1.regs.base) {
458 ret = spear_shirq_register(&shirq_ras1);
459 if (ret)
460 printk(KERN_ERR "Error registering Shared IRQ\n");
461 }
462}
463
464void spear300_pmx_init(void)
465{
466 spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE,
467 SPEAR300_SOC_CONFIG_SIZE);
468}
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
new file mode 100644
index 000000000000..bb21db152a23
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -0,0 +1,77 @@
1/*
2 * arch/arm/mach-spear3xx/spear300_evb.c
3 *
4 * SPEAr300 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/mach/arch.h>
15#include <asm/mach-types.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */
22 &pmx_i2c,
23 &pmx_ssp_cs,
24 &pmx_ssp,
25 &pmx_mii,
26 &pmx_uart0,
27
28 /* spear300 specific devices */
29 &pmx_fsmc_2_chips,
30 &pmx_clcd,
31 &pmx_telecom_sdio_4bit,
32 &pmx_gpio1,
33};
34
35static struct amba_device *amba_devs[] __initdata = {
36 /* spear3xx specific devices */
37 &gpio_device,
38 &uart_device,
39
40 /* spear300 specific devices */
41 &gpio1_device,
42};
43
44static struct platform_device *plat_devs[] __initdata = {
45 /* spear3xx specific devices */
46
47 /* spear300 specific devices */
48};
49
50static void __init spear300_evb_init(void)
51{
52 unsigned int i;
53
54 /* call spear300 machine init function */
55 spear300_init();
56
57 /* padmux initialization */
58 pmx_driver.mode = &photo_frame_mode;
59 pmx_driver.devs = pmx_devs;
60 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
61 spear300_pmx_init();
62
63 /* Add Platform Devices */
64 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
65
66 /* Add Amba Devices */
67 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
68 amba_device_register(amba_devs[i], &iomem_resource);
69}
70
71MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
72 .boot_params = 0x00000100,
73 .map_io = spear3xx_map_io,
74 .init_irq = spear3xx_init_irq,
75 .timer = &spear_sys_timer,
76 .init_machine = spear300_evb_init,
77MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
new file mode 100644
index 000000000000..96a1ab824bac
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -0,0 +1,302 @@
1/*
2 * arch/arm/mach-spear3xx/spear310.c
3 *
4 * SPEAr310 machine source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18#include <plat/shirq.h>
19
20/* pad multiplexing support */
21/* muxing registers */
22#define PAD_MUX_CONFIG_REG 0x08
23
24/* devices */
25struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = {
26 {
27 .ids = 0x00,
28 .mask = PMX_TIMER_3_4_MASK,
29 },
30};
31
32struct pmx_dev pmx_emi_cs_0_1_4_5 = {
33 .name = "emi_cs_0_1_4_5",
34 .modes = pmx_emi_cs_0_1_4_5_modes,
35 .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes),
36 .enb_on_reset = 1,
37};
38
39struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = {
40 {
41 .ids = 0x00,
42 .mask = PMX_TIMER_1_2_MASK,
43 },
44};
45
46struct pmx_dev pmx_emi_cs_2_3 = {
47 .name = "emi_cs_2_3",
48 .modes = pmx_emi_cs_2_3_modes,
49 .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes),
50 .enb_on_reset = 1,
51};
52
53struct pmx_dev_mode pmx_uart1_modes[] = {
54 {
55 .ids = 0x00,
56 .mask = PMX_FIRDA_MASK,
57 },
58};
59
60struct pmx_dev pmx_uart1 = {
61 .name = "uart1",
62 .modes = pmx_uart1_modes,
63 .mode_count = ARRAY_SIZE(pmx_uart1_modes),
64 .enb_on_reset = 1,
65};
66
67struct pmx_dev_mode pmx_uart2_modes[] = {
68 {
69 .ids = 0x00,
70 .mask = PMX_TIMER_1_2_MASK,
71 },
72};
73
74struct pmx_dev pmx_uart2 = {
75 .name = "uart2",
76 .modes = pmx_uart2_modes,
77 .mode_count = ARRAY_SIZE(pmx_uart2_modes),
78 .enb_on_reset = 1,
79};
80
81struct pmx_dev_mode pmx_uart3_4_5_modes[] = {
82 {
83 .ids = 0x00,
84 .mask = PMX_UART0_MODEM_MASK,
85 },
86};
87
88struct pmx_dev pmx_uart3_4_5 = {
89 .name = "uart3_4_5",
90 .modes = pmx_uart3_4_5_modes,
91 .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes),
92 .enb_on_reset = 1,
93};
94
95struct pmx_dev_mode pmx_fsmc_modes[] = {
96 {
97 .ids = 0x00,
98 .mask = PMX_SSP_CS_MASK,
99 },
100};
101
102struct pmx_dev pmx_fsmc = {
103 .name = "fsmc",
104 .modes = pmx_fsmc_modes,
105 .mode_count = ARRAY_SIZE(pmx_fsmc_modes),
106 .enb_on_reset = 1,
107};
108
109struct pmx_dev_mode pmx_rs485_0_1_modes[] = {
110 {
111 .ids = 0x00,
112 .mask = PMX_MII_MASK,
113 },
114};
115
116struct pmx_dev pmx_rs485_0_1 = {
117 .name = "rs485_0_1",
118 .modes = pmx_rs485_0_1_modes,
119 .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes),
120 .enb_on_reset = 1,
121};
122
123struct pmx_dev_mode pmx_tdm0_modes[] = {
124 {
125 .ids = 0x00,
126 .mask = PMX_MII_MASK,
127 },
128};
129
130struct pmx_dev pmx_tdm0 = {
131 .name = "tdm0",
132 .modes = pmx_tdm0_modes,
133 .mode_count = ARRAY_SIZE(pmx_tdm0_modes),
134 .enb_on_reset = 1,
135};
136
137/* pmx driver structure */
138struct pmx_driver pmx_driver = {
139 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
140};
141
142/* Add spear310 specific devices here */
143
144/* spear3xx shared irq */
145struct shirq_dev_config shirq_ras1_config[] = {
146 {
147 .virq = VIRQ_SMII0,
148 .status_mask = SMII0_IRQ_MASK,
149 }, {
150 .virq = VIRQ_SMII1,
151 .status_mask = SMII1_IRQ_MASK,
152 }, {
153 .virq = VIRQ_SMII2,
154 .status_mask = SMII2_IRQ_MASK,
155 }, {
156 .virq = VIRQ_SMII3,
157 .status_mask = SMII3_IRQ_MASK,
158 }, {
159 .virq = VIRQ_WAKEUP_SMII0,
160 .status_mask = WAKEUP_SMII0_IRQ_MASK,
161 }, {
162 .virq = VIRQ_WAKEUP_SMII1,
163 .status_mask = WAKEUP_SMII1_IRQ_MASK,
164 }, {
165 .virq = VIRQ_WAKEUP_SMII2,
166 .status_mask = WAKEUP_SMII2_IRQ_MASK,
167 }, {
168 .virq = VIRQ_WAKEUP_SMII3,
169 .status_mask = WAKEUP_SMII3_IRQ_MASK,
170 },
171};
172
173struct spear_shirq shirq_ras1 = {
174 .irq = IRQ_GEN_RAS_1,
175 .dev_config = shirq_ras1_config,
176 .dev_count = ARRAY_SIZE(shirq_ras1_config),
177 .regs = {
178 .enb_reg = -1,
179 .status_reg = INT_STS_MASK_REG,
180 .status_reg_mask = SHIRQ_RAS1_MASK,
181 .clear_reg = -1,
182 },
183};
184
185struct shirq_dev_config shirq_ras2_config[] = {
186 {
187 .virq = VIRQ_UART1,
188 .status_mask = UART1_IRQ_MASK,
189 }, {
190 .virq = VIRQ_UART2,
191 .status_mask = UART2_IRQ_MASK,
192 }, {
193 .virq = VIRQ_UART3,
194 .status_mask = UART3_IRQ_MASK,
195 }, {
196 .virq = VIRQ_UART4,
197 .status_mask = UART4_IRQ_MASK,
198 }, {
199 .virq = VIRQ_UART5,
200 .status_mask = UART5_IRQ_MASK,
201 },
202};
203
204struct spear_shirq shirq_ras2 = {
205 .irq = IRQ_GEN_RAS_2,
206 .dev_config = shirq_ras2_config,
207 .dev_count = ARRAY_SIZE(shirq_ras2_config),
208 .regs = {
209 .enb_reg = -1,
210 .status_reg = INT_STS_MASK_REG,
211 .status_reg_mask = SHIRQ_RAS2_MASK,
212 .clear_reg = -1,
213 },
214};
215
216struct shirq_dev_config shirq_ras3_config[] = {
217 {
218 .virq = VIRQ_EMI,
219 .status_mask = EMI_IRQ_MASK,
220 },
221};
222
223struct spear_shirq shirq_ras3 = {
224 .irq = IRQ_GEN_RAS_3,
225 .dev_config = shirq_ras3_config,
226 .dev_count = ARRAY_SIZE(shirq_ras3_config),
227 .regs = {
228 .enb_reg = -1,
229 .status_reg = INT_STS_MASK_REG,
230 .status_reg_mask = SHIRQ_RAS3_MASK,
231 .clear_reg = -1,
232 },
233};
234
235struct shirq_dev_config shirq_intrcomm_ras_config[] = {
236 {
237 .virq = VIRQ_TDM_HDLC,
238 .status_mask = TDM_HDLC_IRQ_MASK,
239 }, {
240 .virq = VIRQ_RS485_0,
241 .status_mask = RS485_0_IRQ_MASK,
242 }, {
243 .virq = VIRQ_RS485_1,
244 .status_mask = RS485_1_IRQ_MASK,
245 },
246};
247
248struct spear_shirq shirq_intrcomm_ras = {
249 .irq = IRQ_INTRCOMM_RAS_ARM,
250 .dev_config = shirq_intrcomm_ras_config,
251 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config),
252 .regs = {
253 .enb_reg = -1,
254 .status_reg = INT_STS_MASK_REG,
255 .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK,
256 .clear_reg = -1,
257 },
258};
259
260/* spear310 routines */
261void __init spear310_init(void)
262{
263 void __iomem *base;
264 int ret = 0;
265
266 /* call spear3xx family common init function */
267 spear3xx_init();
268
269 /* shared irq registeration */
270 base = ioremap(SPEAR310_SOC_CONFIG_BASE, SPEAR310_SOC_CONFIG_SIZE);
271 if (base) {
272 /* shirq 1 */
273 shirq_ras1.regs.base = base;
274 ret = spear_shirq_register(&shirq_ras1);
275 if (ret)
276 printk(KERN_ERR "Error registering Shared IRQ 1\n");
277
278 /* shirq 2 */
279 shirq_ras2.regs.base = base;
280 ret = spear_shirq_register(&shirq_ras2);
281 if (ret)
282 printk(KERN_ERR "Error registering Shared IRQ 2\n");
283
284 /* shirq 3 */
285 shirq_ras3.regs.base = base;
286 ret = spear_shirq_register(&shirq_ras3);
287 if (ret)
288 printk(KERN_ERR "Error registering Shared IRQ 3\n");
289
290 /* shirq 4 */
291 shirq_intrcomm_ras.regs.base = base;
292 ret = spear_shirq_register(&shirq_intrcomm_ras);
293 if (ret)
294 printk(KERN_ERR "Error registering Shared IRQ 4\n");
295 }
296}
297
298void spear310_pmx_init(void)
299{
300 spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE,
301 SPEAR310_SOC_CONFIG_SIZE);
302}
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
new file mode 100644
index 000000000000..7facf6643199
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -0,0 +1,84 @@
1/*
2 * arch/arm/mach-spear3xx/spear310_evb.c
3 *
4 * SPEAr310 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/mach/arch.h>
15#include <asm/mach-types.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */
22 &pmx_i2c,
23 &pmx_ssp,
24 &pmx_gpio_pin0,
25 &pmx_gpio_pin1,
26 &pmx_gpio_pin2,
27 &pmx_gpio_pin3,
28 &pmx_gpio_pin4,
29 &pmx_gpio_pin5,
30 &pmx_uart0,
31
32 /* spear310 specific devices */
33 &pmx_emi_cs_0_1_4_5,
34 &pmx_emi_cs_2_3,
35 &pmx_uart1,
36 &pmx_uart2,
37 &pmx_uart3_4_5,
38 &pmx_fsmc,
39 &pmx_rs485_0_1,
40 &pmx_tdm0,
41};
42
43static struct amba_device *amba_devs[] __initdata = {
44 /* spear3xx specific devices */
45 &gpio_device,
46 &uart_device,
47
48 /* spear310 specific devices */
49};
50
51static struct platform_device *plat_devs[] __initdata = {
52 /* spear3xx specific devices */
53
54 /* spear310 specific devices */
55};
56
57static void __init spear310_evb_init(void)
58{
59 unsigned int i;
60
61 /* call spear310 machine init function */
62 spear310_init();
63
64 /* padmux initialization */
65 pmx_driver.mode = NULL;
66 pmx_driver.devs = pmx_devs;
67 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
68 spear310_pmx_init();
69
70 /* Add Platform Devices */
71 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
72
73 /* Add Amba Devices */
74 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
75 amba_device_register(amba_devs[i], &iomem_resource);
76}
77
78MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
79 .boot_params = 0x00000100,
80 .map_io = spear3xx_map_io,
81 .init_irq = spear3xx_init_irq,
82 .timer = &spear_sys_timer,
83 .init_machine = spear310_evb_init,
84MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
new file mode 100644
index 000000000000..6a1219549369
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -0,0 +1,549 @@
1/*
2 * arch/arm/mach-spear3xx/spear320.c
3 *
4 * SPEAr320 machine source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18#include <plat/shirq.h>
19
20/* pad multiplexing support */
21/* muxing registers */
22#define PAD_MUX_CONFIG_REG 0x0C
23#define MODE_CONFIG_REG 0x10
24
25/* modes */
26#define AUTO_NET_SMII_MODE (1 << 0)
27#define AUTO_NET_MII_MODE (1 << 1)
28#define AUTO_EXP_MODE (1 << 2)
29#define SMALL_PRINTERS_MODE (1 << 3)
30#define ALL_MODES 0xF
31
32struct pmx_mode auto_net_smii_mode = {
33 .id = AUTO_NET_SMII_MODE,
34 .name = "Automation Networking SMII Mode",
35 .mask = 0x00,
36};
37
38struct pmx_mode auto_net_mii_mode = {
39 .id = AUTO_NET_MII_MODE,
40 .name = "Automation Networking MII Mode",
41 .mask = 0x01,
42};
43
44struct pmx_mode auto_exp_mode = {
45 .id = AUTO_EXP_MODE,
46 .name = "Automation Expanded Mode",
47 .mask = 0x02,
48};
49
50struct pmx_mode small_printers_mode = {
51 .id = SMALL_PRINTERS_MODE,
52 .name = "Small Printers Mode",
53 .mask = 0x03,
54};
55
56/* devices */
57struct pmx_dev_mode pmx_clcd_modes[] = {
58 {
59 .ids = AUTO_NET_SMII_MODE,
60 .mask = 0x0,
61 },
62};
63
64struct pmx_dev pmx_clcd = {
65 .name = "clcd",
66 .modes = pmx_clcd_modes,
67 .mode_count = ARRAY_SIZE(pmx_clcd_modes),
68 .enb_on_reset = 1,
69};
70
71struct pmx_dev_mode pmx_emi_modes[] = {
72 {
73 .ids = AUTO_EXP_MODE,
74 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
75 },
76};
77
78struct pmx_dev pmx_emi = {
79 .name = "emi",
80 .modes = pmx_emi_modes,
81 .mode_count = ARRAY_SIZE(pmx_emi_modes),
82 .enb_on_reset = 1,
83};
84
85struct pmx_dev_mode pmx_fsmc_modes[] = {
86 {
87 .ids = ALL_MODES,
88 .mask = 0x0,
89 },
90};
91
92struct pmx_dev pmx_fsmc = {
93 .name = "fsmc",
94 .modes = pmx_fsmc_modes,
95 .mode_count = ARRAY_SIZE(pmx_fsmc_modes),
96 .enb_on_reset = 1,
97};
98
99struct pmx_dev_mode pmx_spp_modes[] = {
100 {
101 .ids = SMALL_PRINTERS_MODE,
102 .mask = 0x0,
103 },
104};
105
106struct pmx_dev pmx_spp = {
107 .name = "spp",
108 .modes = pmx_spp_modes,
109 .mode_count = ARRAY_SIZE(pmx_spp_modes),
110 .enb_on_reset = 1,
111};
112
113struct pmx_dev_mode pmx_sdio_modes[] = {
114 {
115 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE |
116 SMALL_PRINTERS_MODE,
117 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
118 },
119};
120
121struct pmx_dev pmx_sdio = {
122 .name = "sdio",
123 .modes = pmx_sdio_modes,
124 .mode_count = ARRAY_SIZE(pmx_sdio_modes),
125 .enb_on_reset = 1,
126};
127
128struct pmx_dev_mode pmx_i2s_modes[] = {
129 {
130 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
131 .mask = PMX_UART0_MODEM_MASK,
132 },
133};
134
135struct pmx_dev pmx_i2s = {
136 .name = "i2s",
137 .modes = pmx_i2s_modes,
138 .mode_count = ARRAY_SIZE(pmx_i2s_modes),
139 .enb_on_reset = 1,
140};
141
142struct pmx_dev_mode pmx_uart1_modes[] = {
143 {
144 .ids = ALL_MODES,
145 .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK,
146 },
147};
148
149struct pmx_dev pmx_uart1 = {
150 .name = "uart1",
151 .modes = pmx_uart1_modes,
152 .mode_count = ARRAY_SIZE(pmx_uart1_modes),
153 .enb_on_reset = 1,
154};
155
156struct pmx_dev_mode pmx_uart1_modem_modes[] = {
157 {
158 .ids = AUTO_EXP_MODE,
159 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK |
160 PMX_SSP_CS_MASK,
161 }, {
162 .ids = SMALL_PRINTERS_MODE,
163 .mask = PMX_GPIO_PIN3_MASK | PMX_GPIO_PIN4_MASK |
164 PMX_GPIO_PIN5_MASK | PMX_SSP_CS_MASK,
165 },
166};
167
168struct pmx_dev pmx_uart1_modem = {
169 .name = "uart1_modem",
170 .modes = pmx_uart1_modem_modes,
171 .mode_count = ARRAY_SIZE(pmx_uart1_modem_modes),
172 .enb_on_reset = 1,
173};
174
175struct pmx_dev_mode pmx_uart2_modes[] = {
176 {
177 .ids = ALL_MODES,
178 .mask = PMX_FIRDA_MASK,
179 },
180};
181
182struct pmx_dev pmx_uart2 = {
183 .name = "uart2",
184 .modes = pmx_uart2_modes,
185 .mode_count = ARRAY_SIZE(pmx_uart2_modes),
186 .enb_on_reset = 1,
187};
188
189struct pmx_dev_mode pmx_touchscreen_modes[] = {
190 {
191 .ids = AUTO_NET_SMII_MODE,
192 .mask = PMX_SSP_CS_MASK,
193 },
194};
195
196struct pmx_dev pmx_touchscreen = {
197 .name = "touchscreen",
198 .modes = pmx_touchscreen_modes,
199 .mode_count = ARRAY_SIZE(pmx_touchscreen_modes),
200 .enb_on_reset = 1,
201};
202
203struct pmx_dev_mode pmx_can_modes[] = {
204 {
205 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE,
206 .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
207 PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK,
208 },
209};
210
211struct pmx_dev pmx_can = {
212 .name = "can",
213 .modes = pmx_can_modes,
214 .mode_count = ARRAY_SIZE(pmx_can_modes),
215 .enb_on_reset = 1,
216};
217
218struct pmx_dev_mode pmx_sdio_led_modes[] = {
219 {
220 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
221 .mask = PMX_SSP_CS_MASK,
222 },
223};
224
225struct pmx_dev pmx_sdio_led = {
226 .name = "sdio_led",
227 .modes = pmx_sdio_led_modes,
228 .mode_count = ARRAY_SIZE(pmx_sdio_led_modes),
229 .enb_on_reset = 1,
230};
231
232struct pmx_dev_mode pmx_pwm0_modes[] = {
233 {
234 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
235 .mask = PMX_UART0_MODEM_MASK,
236 }, {
237 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE,
238 .mask = PMX_MII_MASK,
239 },
240};
241
242struct pmx_dev pmx_pwm0 = {
243 .name = "pwm0",
244 .modes = pmx_pwm0_modes,
245 .mode_count = ARRAY_SIZE(pmx_pwm0_modes),
246 .enb_on_reset = 1,
247};
248
249struct pmx_dev_mode pmx_pwm1_modes[] = {
250 {
251 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
252 .mask = PMX_UART0_MODEM_MASK,
253 }, {
254 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE,
255 .mask = PMX_MII_MASK,
256 },
257};
258
259struct pmx_dev pmx_pwm1 = {
260 .name = "pwm1",
261 .modes = pmx_pwm1_modes,
262 .mode_count = ARRAY_SIZE(pmx_pwm1_modes),
263 .enb_on_reset = 1,
264};
265
266struct pmx_dev_mode pmx_pwm2_modes[] = {
267 {
268 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
269 .mask = PMX_SSP_CS_MASK,
270 }, {
271 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE,
272 .mask = PMX_MII_MASK,
273 },
274};
275
276struct pmx_dev pmx_pwm2 = {
277 .name = "pwm2",
278 .modes = pmx_pwm2_modes,
279 .mode_count = ARRAY_SIZE(pmx_pwm2_modes),
280 .enb_on_reset = 1,
281};
282
283struct pmx_dev_mode pmx_pwm3_modes[] = {
284 {
285 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE,
286 .mask = PMX_MII_MASK,
287 },
288};
289
290struct pmx_dev pmx_pwm3 = {
291 .name = "pwm3",
292 .modes = pmx_pwm3_modes,
293 .mode_count = ARRAY_SIZE(pmx_pwm3_modes),
294 .enb_on_reset = 1,
295};
296
297struct pmx_dev_mode pmx_ssp1_modes[] = {
298 {
299 .ids = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE,
300 .mask = PMX_MII_MASK,
301 },
302};
303
304struct pmx_dev pmx_ssp1 = {
305 .name = "ssp1",
306 .modes = pmx_ssp1_modes,
307 .mode_count = ARRAY_SIZE(pmx_ssp1_modes),
308 .enb_on_reset = 1,
309};
310
311struct pmx_dev_mode pmx_ssp2_modes[] = {
312 {
313 .ids = AUTO_NET_SMII_MODE,
314 .mask = PMX_MII_MASK,
315 },
316};
317
318struct pmx_dev pmx_ssp2 = {
319 .name = "ssp2",
320 .modes = pmx_ssp2_modes,
321 .mode_count = ARRAY_SIZE(pmx_ssp2_modes),
322 .enb_on_reset = 1,
323};
324
325struct pmx_dev_mode pmx_mii1_modes[] = {
326 {
327 .ids = AUTO_NET_MII_MODE,
328 .mask = 0x0,
329 },
330};
331
332struct pmx_dev pmx_mii1 = {
333 .name = "mii1",
334 .modes = pmx_mii1_modes,
335 .mode_count = ARRAY_SIZE(pmx_mii1_modes),
336 .enb_on_reset = 1,
337};
338
339struct pmx_dev_mode pmx_smii0_modes[] = {
340 {
341 .ids = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | SMALL_PRINTERS_MODE,
342 .mask = PMX_MII_MASK,
343 },
344};
345
346struct pmx_dev pmx_smii0 = {
347 .name = "smii0",
348 .modes = pmx_smii0_modes,
349 .mode_count = ARRAY_SIZE(pmx_smii0_modes),
350 .enb_on_reset = 1,
351};
352
353struct pmx_dev_mode pmx_smii1_modes[] = {
354 {
355 .ids = AUTO_NET_SMII_MODE | SMALL_PRINTERS_MODE,
356 .mask = PMX_MII_MASK,
357 },
358};
359
360struct pmx_dev pmx_smii1 = {
361 .name = "smii1",
362 .modes = pmx_smii1_modes,
363 .mode_count = ARRAY_SIZE(pmx_smii1_modes),
364 .enb_on_reset = 1,
365};
366
367struct pmx_dev_mode pmx_i2c1_modes[] = {
368 {
369 .ids = AUTO_EXP_MODE,
370 .mask = 0x0,
371 },
372};
373
374struct pmx_dev pmx_i2c1 = {
375 .name = "i2c1",
376 .modes = pmx_i2c1_modes,
377 .mode_count = ARRAY_SIZE(pmx_i2c1_modes),
378 .enb_on_reset = 1,
379};
380
381/* pmx driver structure */
382struct pmx_driver pmx_driver = {
383 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007},
384 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
385};
386
387/* Add spear320 specific devices here */
388
389/* spear3xx shared irq */
390struct shirq_dev_config shirq_ras1_config[] = {
391 {
392 .virq = VIRQ_EMI,
393 .status_mask = EMI_IRQ_MASK,
394 .clear_mask = EMI_IRQ_MASK,
395 }, {
396 .virq = VIRQ_CLCD,
397 .status_mask = CLCD_IRQ_MASK,
398 .clear_mask = CLCD_IRQ_MASK,
399 }, {
400 .virq = VIRQ_SPP,
401 .status_mask = SPP_IRQ_MASK,
402 .clear_mask = SPP_IRQ_MASK,
403 },
404};
405
406struct spear_shirq shirq_ras1 = {
407 .irq = IRQ_GEN_RAS_1,
408 .dev_config = shirq_ras1_config,
409 .dev_count = ARRAY_SIZE(shirq_ras1_config),
410 .regs = {
411 .enb_reg = -1,
412 .status_reg = INT_STS_MASK_REG,
413 .status_reg_mask = SHIRQ_RAS1_MASK,
414 .clear_reg = INT_CLR_MASK_REG,
415 .reset_to_clear = 1,
416 },
417};
418
419struct shirq_dev_config shirq_ras3_config[] = {
420 {
421 .virq = VIRQ_PLGPIO,
422 .enb_mask = GPIO_IRQ_MASK,
423 .status_mask = GPIO_IRQ_MASK,
424 .clear_mask = GPIO_IRQ_MASK,
425 }, {
426 .virq = VIRQ_I2S_PLAY,
427 .enb_mask = I2S_PLAY_IRQ_MASK,
428 .status_mask = I2S_PLAY_IRQ_MASK,
429 .clear_mask = I2S_PLAY_IRQ_MASK,
430 }, {
431 .virq = VIRQ_I2S_REC,
432 .enb_mask = I2S_REC_IRQ_MASK,
433 .status_mask = I2S_REC_IRQ_MASK,
434 .clear_mask = I2S_REC_IRQ_MASK,
435 },
436};
437
438struct spear_shirq shirq_ras3 = {
439 .irq = IRQ_GEN_RAS_3,
440 .dev_config = shirq_ras3_config,
441 .dev_count = ARRAY_SIZE(shirq_ras3_config),
442 .regs = {
443 .enb_reg = INT_ENB_MASK_REG,
444 .reset_to_enb = 1,
445 .status_reg = INT_STS_MASK_REG,
446 .status_reg_mask = SHIRQ_RAS3_MASK,
447 .clear_reg = INT_CLR_MASK_REG,
448 .reset_to_clear = 1,
449 },
450};
451
452struct shirq_dev_config shirq_intrcomm_ras_config[] = {
453 {
454 .virq = VIRQ_CANU,
455 .status_mask = CAN_U_IRQ_MASK,
456 .clear_mask = CAN_U_IRQ_MASK,
457 }, {
458 .virq = VIRQ_CANL,
459 .status_mask = CAN_L_IRQ_MASK,
460 .clear_mask = CAN_L_IRQ_MASK,
461 }, {
462 .virq = VIRQ_UART1,
463 .status_mask = UART1_IRQ_MASK,
464 .clear_mask = UART1_IRQ_MASK,
465 }, {
466 .virq = VIRQ_UART2,
467 .status_mask = UART2_IRQ_MASK,
468 .clear_mask = UART2_IRQ_MASK,
469 }, {
470 .virq = VIRQ_SSP1,
471 .status_mask = SSP1_IRQ_MASK,
472 .clear_mask = SSP1_IRQ_MASK,
473 }, {
474 .virq = VIRQ_SSP2,
475 .status_mask = SSP2_IRQ_MASK,
476 .clear_mask = SSP2_IRQ_MASK,
477 }, {
478 .virq = VIRQ_SMII0,
479 .status_mask = SMII0_IRQ_MASK,
480 .clear_mask = SMII0_IRQ_MASK,
481 }, {
482 .virq = VIRQ_MII1_SMII1,
483 .status_mask = MII1_SMII1_IRQ_MASK,
484 .clear_mask = MII1_SMII1_IRQ_MASK,
485 }, {
486 .virq = VIRQ_WAKEUP_SMII0,
487 .status_mask = WAKEUP_SMII0_IRQ_MASK,
488 .clear_mask = WAKEUP_SMII0_IRQ_MASK,
489 }, {
490 .virq = VIRQ_WAKEUP_MII1_SMII1,
491 .status_mask = WAKEUP_MII1_SMII1_IRQ_MASK,
492 .clear_mask = WAKEUP_MII1_SMII1_IRQ_MASK,
493 }, {
494 .virq = VIRQ_I2C,
495 .status_mask = I2C1_IRQ_MASK,
496 .clear_mask = I2C1_IRQ_MASK,
497 },
498};
499
500struct spear_shirq shirq_intrcomm_ras = {
501 .irq = IRQ_INTRCOMM_RAS_ARM,
502 .dev_config = shirq_intrcomm_ras_config,
503 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config),
504 .regs = {
505 .enb_reg = -1,
506 .status_reg = INT_STS_MASK_REG,
507 .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK,
508 .clear_reg = INT_CLR_MASK_REG,
509 .reset_to_clear = 1,
510 },
511};
512
513/* spear320 routines */
514void __init spear320_init(void)
515{
516 void __iomem *base;
517 int ret = 0;
518
519 /* call spear3xx family common init function */
520 spear3xx_init();
521
522 /* shared irq registeration */
523 base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE);
524 if (base) {
525 /* shirq 1 */
526 shirq_ras1.regs.base = base;
527 ret = spear_shirq_register(&shirq_ras1);
528 if (ret)
529 printk(KERN_ERR "Error registering Shared IRQ 1\n");
530
531 /* shirq 3 */
532 shirq_ras3.regs.base = base;
533 ret = spear_shirq_register(&shirq_ras3);
534 if (ret)
535 printk(KERN_ERR "Error registering Shared IRQ 3\n");
536
537 /* shirq 4 */
538 shirq_intrcomm_ras.regs.base = base;
539 ret = spear_shirq_register(&shirq_intrcomm_ras);
540 if (ret)
541 printk(KERN_ERR "Error registering Shared IRQ 4\n");
542 }
543}
544
545void spear320_pmx_init(void)
546{
547 spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE,
548 SPEAR320_SOC_CONFIG_SIZE);
549}
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
new file mode 100644
index 000000000000..62ac685a4135
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -0,0 +1,81 @@
1/*
2 * arch/arm/mach-spear3xx/spear320_evb.c
3 *
4 * SPEAr320 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/mach/arch.h>
15#include <asm/mach-types.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */
22 &pmx_i2c,
23 &pmx_ssp,
24 &pmx_mii,
25 &pmx_uart0,
26
27 /* spear320 specific devices */
28 &pmx_fsmc,
29 &pmx_sdio,
30 &pmx_i2s,
31 &pmx_uart1,
32 &pmx_uart2,
33 &pmx_can,
34 &pmx_pwm0,
35 &pmx_pwm1,
36 &pmx_pwm2,
37 &pmx_mii1,
38};
39
40static struct amba_device *amba_devs[] __initdata = {
41 /* spear3xx specific devices */
42 &gpio_device,
43 &uart_device,
44
45 /* spear320 specific devices */
46};
47
48static struct platform_device *plat_devs[] __initdata = {
49 /* spear3xx specific devices */
50
51 /* spear320 specific devices */
52};
53
54static void __init spear320_evb_init(void)
55{
56 unsigned int i;
57
58 /* call spear320 machine init function */
59 spear320_init();
60
61 /* padmux initialization */
62 pmx_driver.mode = &auto_net_mii_mode;
63 pmx_driver.devs = pmx_devs;
64 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
65 spear320_pmx_init();
66
67 /* Add Platform Devices */
68 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
69
70 /* Add Amba Devices */
71 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
72 amba_device_register(amba_devs[i], &iomem_resource);
73}
74
75MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
76 .boot_params = 0x00000100,
77 .map_io = spear3xx_map_io,
78 .init_irq = spear3xx_init_irq,
79 .timer = &spear_sys_timer,
80 .init_machine = spear320_evb_init,
81MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
new file mode 100644
index 000000000000..e87313aeae20
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -0,0 +1,548 @@
1/*
2 * arch/arm/mach-spear3xx/spear3xx.c
3 *
4 * SPEAr3XX machines common source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <linux/io.h>
18#include <asm/hardware/vic.h>
19#include <asm/irq.h>
20#include <asm/mach/arch.h>
21#include <mach/generic.h>
22#include <mach/spear.h>
23
24/* Add spear3xx machines common devices here */
25/* gpio device registeration */
26static struct pl061_platform_data gpio_plat_data = {
27 .gpio_base = 0,
28 .irq_base = SPEAR_GPIO_INT_BASE,
29};
30
31struct amba_device gpio_device = {
32 .dev = {
33 .init_name = "gpio",
34 .platform_data = &gpio_plat_data,
35 },
36 .res = {
37 .start = SPEAR3XX_ICM3_GPIO_BASE,
38 .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
42};
43
44/* uart device registeration */
45struct amba_device uart_device = {
46 .dev = {
47 .init_name = "uart",
48 },
49 .res = {
50 .start = SPEAR3XX_ICM1_UART_BASE,
51 .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 .irq = {IRQ_UART, NO_IRQ},
55};
56
57/* Do spear3xx familiy common initialization part here */
58void __init spear3xx_init(void)
59{
60 /* nothing to do for now */
61}
62
63/* This will initialize vic */
64void __init spear3xx_init_irq(void)
65{
66 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
67}
68
69/* Following will create static virtual/physical mappings */
70struct map_desc spear3xx_io_desc[] __initdata = {
71 {
72 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
73 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
74 .length = SPEAR3XX_ICM1_UART_SIZE,
75 .type = MT_DEVICE
76 }, {
77 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
78 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
79 .length = SPEAR3XX_ML1_VIC_SIZE,
80 .type = MT_DEVICE
81 }, {
82 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
83 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
84 .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE,
85 .type = MT_DEVICE
86 }, {
87 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
88 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
89 .length = SPEAR3XX_ICM3_MISC_REG_SIZE,
90 .type = MT_DEVICE
91 },
92};
93
94/* This will create static memory mapping for selected devices */
95void __init spear3xx_map_io(void)
96{
97 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
98
99 /* This will initialize clock framework */
100 clk_init();
101}
102
103/* pad multiplexing support */
104/* devices */
105struct pmx_dev_mode pmx_firda_modes[] = {
106 {
107 .ids = 0xffffffff,
108 .mask = PMX_FIRDA_MASK,
109 },
110};
111
112struct pmx_dev pmx_firda = {
113 .name = "firda",
114 .modes = pmx_firda_modes,
115 .mode_count = ARRAY_SIZE(pmx_firda_modes),
116 .enb_on_reset = 0,
117};
118
119struct pmx_dev_mode pmx_i2c_modes[] = {
120 {
121 .ids = 0xffffffff,
122 .mask = PMX_I2C_MASK,
123 },
124};
125
126struct pmx_dev pmx_i2c = {
127 .name = "i2c",
128 .modes = pmx_i2c_modes,
129 .mode_count = ARRAY_SIZE(pmx_i2c_modes),
130 .enb_on_reset = 0,
131};
132
133struct pmx_dev_mode pmx_ssp_cs_modes[] = {
134 {
135 .ids = 0xffffffff,
136 .mask = PMX_SSP_CS_MASK,
137 },
138};
139
140struct pmx_dev pmx_ssp_cs = {
141 .name = "ssp_chip_selects",
142 .modes = pmx_ssp_cs_modes,
143 .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes),
144 .enb_on_reset = 0,
145};
146
147struct pmx_dev_mode pmx_ssp_modes[] = {
148 {
149 .ids = 0xffffffff,
150 .mask = PMX_SSP_MASK,
151 },
152};
153
154struct pmx_dev pmx_ssp = {
155 .name = "ssp",
156 .modes = pmx_ssp_modes,
157 .mode_count = ARRAY_SIZE(pmx_ssp_modes),
158 .enb_on_reset = 0,
159};
160
161struct pmx_dev_mode pmx_mii_modes[] = {
162 {
163 .ids = 0xffffffff,
164 .mask = PMX_MII_MASK,
165 },
166};
167
168struct pmx_dev pmx_mii = {
169 .name = "mii",
170 .modes = pmx_mii_modes,
171 .mode_count = ARRAY_SIZE(pmx_mii_modes),
172 .enb_on_reset = 0,
173};
174
175struct pmx_dev_mode pmx_gpio_pin0_modes[] = {
176 {
177 .ids = 0xffffffff,
178 .mask = PMX_GPIO_PIN0_MASK,
179 },
180};
181
182struct pmx_dev pmx_gpio_pin0 = {
183 .name = "gpio_pin0",
184 .modes = pmx_gpio_pin0_modes,
185 .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes),
186 .enb_on_reset = 0,
187};
188
189struct pmx_dev_mode pmx_gpio_pin1_modes[] = {
190 {
191 .ids = 0xffffffff,
192 .mask = PMX_GPIO_PIN1_MASK,
193 },
194};
195
196struct pmx_dev pmx_gpio_pin1 = {
197 .name = "gpio_pin1",
198 .modes = pmx_gpio_pin1_modes,
199 .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes),
200 .enb_on_reset = 0,
201};
202
203struct pmx_dev_mode pmx_gpio_pin2_modes[] = {
204 {
205 .ids = 0xffffffff,
206 .mask = PMX_GPIO_PIN2_MASK,
207 },
208};
209
210struct pmx_dev pmx_gpio_pin2 = {
211 .name = "gpio_pin2",
212 .modes = pmx_gpio_pin2_modes,
213 .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes),
214 .enb_on_reset = 0,
215};
216
217struct pmx_dev_mode pmx_gpio_pin3_modes[] = {
218 {
219 .ids = 0xffffffff,
220 .mask = PMX_GPIO_PIN3_MASK,
221 },
222};
223
224struct pmx_dev pmx_gpio_pin3 = {
225 .name = "gpio_pin3",
226 .modes = pmx_gpio_pin3_modes,
227 .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes),
228 .enb_on_reset = 0,
229};
230
231struct pmx_dev_mode pmx_gpio_pin4_modes[] = {
232 {
233 .ids = 0xffffffff,
234 .mask = PMX_GPIO_PIN4_MASK,
235 },
236};
237
238struct pmx_dev pmx_gpio_pin4 = {
239 .name = "gpio_pin4",
240 .modes = pmx_gpio_pin4_modes,
241 .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes),
242 .enb_on_reset = 0,
243};
244
245struct pmx_dev_mode pmx_gpio_pin5_modes[] = {
246 {
247 .ids = 0xffffffff,
248 .mask = PMX_GPIO_PIN5_MASK,
249 },
250};
251
252struct pmx_dev pmx_gpio_pin5 = {
253 .name = "gpio_pin5",
254 .modes = pmx_gpio_pin5_modes,
255 .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes),
256 .enb_on_reset = 0,
257};
258
259struct pmx_dev_mode pmx_uart0_modem_modes[] = {
260 {
261 .ids = 0xffffffff,
262 .mask = PMX_UART0_MODEM_MASK,
263 },
264};
265
266struct pmx_dev pmx_uart0_modem = {
267 .name = "uart0_modem",
268 .modes = pmx_uart0_modem_modes,
269 .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes),
270 .enb_on_reset = 0,
271};
272
273struct pmx_dev_mode pmx_uart0_modes[] = {
274 {
275 .ids = 0xffffffff,
276 .mask = PMX_UART0_MASK,
277 },
278};
279
280struct pmx_dev pmx_uart0 = {
281 .name = "uart0",
282 .modes = pmx_uart0_modes,
283 .mode_count = ARRAY_SIZE(pmx_uart0_modes),
284 .enb_on_reset = 0,
285};
286
287struct pmx_dev_mode pmx_timer_3_4_modes[] = {
288 {
289 .ids = 0xffffffff,
290 .mask = PMX_TIMER_3_4_MASK,
291 },
292};
293
294struct pmx_dev pmx_timer_3_4 = {
295 .name = "timer_3_4",
296 .modes = pmx_timer_3_4_modes,
297 .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes),
298 .enb_on_reset = 0,
299};
300
301struct pmx_dev_mode pmx_timer_1_2_modes[] = {
302 {
303 .ids = 0xffffffff,
304 .mask = PMX_TIMER_1_2_MASK,
305 },
306};
307
308struct pmx_dev pmx_timer_1_2 = {
309 .name = "timer_1_2",
310 .modes = pmx_timer_1_2_modes,
311 .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes),
312 .enb_on_reset = 0,
313};
314
315#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
316/* plgpios devices */
317struct pmx_dev_mode pmx_plgpio_0_1_modes[] = {
318 {
319 .ids = 0x00,
320 .mask = PMX_FIRDA_MASK,
321 },
322};
323
324struct pmx_dev pmx_plgpio_0_1 = {
325 .name = "plgpio 0 and 1",
326 .modes = pmx_plgpio_0_1_modes,
327 .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes),
328 .enb_on_reset = 1,
329};
330
331struct pmx_dev_mode pmx_plgpio_2_3_modes[] = {
332 {
333 .ids = 0x00,
334 .mask = PMX_UART0_MASK,
335 },
336};
337
338struct pmx_dev pmx_plgpio_2_3 = {
339 .name = "plgpio 2 and 3",
340 .modes = pmx_plgpio_2_3_modes,
341 .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes),
342 .enb_on_reset = 1,
343};
344
345struct pmx_dev_mode pmx_plgpio_4_5_modes[] = {
346 {
347 .ids = 0x00,
348 .mask = PMX_I2C_MASK,
349 },
350};
351
352struct pmx_dev pmx_plgpio_4_5 = {
353 .name = "plgpio 4 and 5",
354 .modes = pmx_plgpio_4_5_modes,
355 .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes),
356 .enb_on_reset = 1,
357};
358
359struct pmx_dev_mode pmx_plgpio_6_9_modes[] = {
360 {
361 .ids = 0x00,
362 .mask = PMX_SSP_MASK,
363 },
364};
365
366struct pmx_dev pmx_plgpio_6_9 = {
367 .name = "plgpio 6 to 9",
368 .modes = pmx_plgpio_6_9_modes,
369 .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes),
370 .enb_on_reset = 1,
371};
372
373struct pmx_dev_mode pmx_plgpio_10_27_modes[] = {
374 {
375 .ids = 0x00,
376 .mask = PMX_MII_MASK,
377 },
378};
379
380struct pmx_dev pmx_plgpio_10_27 = {
381 .name = "plgpio 10 to 27",
382 .modes = pmx_plgpio_10_27_modes,
383 .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes),
384 .enb_on_reset = 1,
385};
386
387struct pmx_dev_mode pmx_plgpio_28_modes[] = {
388 {
389 .ids = 0x00,
390 .mask = PMX_GPIO_PIN0_MASK,
391 },
392};
393
394struct pmx_dev pmx_plgpio_28 = {
395 .name = "plgpio 28",
396 .modes = pmx_plgpio_28_modes,
397 .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes),
398 .enb_on_reset = 1,
399};
400
401struct pmx_dev_mode pmx_plgpio_29_modes[] = {
402 {
403 .ids = 0x00,
404 .mask = PMX_GPIO_PIN1_MASK,
405 },
406};
407
408struct pmx_dev pmx_plgpio_29 = {
409 .name = "plgpio 29",
410 .modes = pmx_plgpio_29_modes,
411 .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes),
412 .enb_on_reset = 1,
413};
414
415struct pmx_dev_mode pmx_plgpio_30_modes[] = {
416 {
417 .ids = 0x00,
418 .mask = PMX_GPIO_PIN2_MASK,
419 },
420};
421
422struct pmx_dev pmx_plgpio_30 = {
423 .name = "plgpio 30",
424 .modes = pmx_plgpio_30_modes,
425 .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes),
426 .enb_on_reset = 1,
427};
428
429struct pmx_dev_mode pmx_plgpio_31_modes[] = {
430 {
431 .ids = 0x00,
432 .mask = PMX_GPIO_PIN3_MASK,
433 },
434};
435
436struct pmx_dev pmx_plgpio_31 = {
437 .name = "plgpio 31",
438 .modes = pmx_plgpio_31_modes,
439 .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes),
440 .enb_on_reset = 1,
441};
442
443struct pmx_dev_mode pmx_plgpio_32_modes[] = {
444 {
445 .ids = 0x00,
446 .mask = PMX_GPIO_PIN4_MASK,
447 },
448};
449
450struct pmx_dev pmx_plgpio_32 = {
451 .name = "plgpio 32",
452 .modes = pmx_plgpio_32_modes,
453 .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes),
454 .enb_on_reset = 1,
455};
456
457struct pmx_dev_mode pmx_plgpio_33_modes[] = {
458 {
459 .ids = 0x00,
460 .mask = PMX_GPIO_PIN5_MASK,
461 },
462};
463
464struct pmx_dev pmx_plgpio_33 = {
465 .name = "plgpio 33",
466 .modes = pmx_plgpio_33_modes,
467 .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes),
468 .enb_on_reset = 1,
469};
470
471struct pmx_dev_mode pmx_plgpio_34_36_modes[] = {
472 {
473 .ids = 0x00,
474 .mask = PMX_SSP_CS_MASK,
475 },
476};
477
478struct pmx_dev pmx_plgpio_34_36 = {
479 .name = "plgpio 34 to 36",
480 .modes = pmx_plgpio_34_36_modes,
481 .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes),
482 .enb_on_reset = 1,
483};
484
485struct pmx_dev_mode pmx_plgpio_37_42_modes[] = {
486 {
487 .ids = 0x00,
488 .mask = PMX_UART0_MODEM_MASK,
489 },
490};
491
492struct pmx_dev pmx_plgpio_37_42 = {
493 .name = "plgpio 37 to 42",
494 .modes = pmx_plgpio_37_42_modes,
495 .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes),
496 .enb_on_reset = 1,
497};
498
499struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = {
500 {
501 .ids = 0x00,
502 .mask = PMX_TIMER_1_2_MASK,
503 },
504};
505
506struct pmx_dev pmx_plgpio_43_44_47_48 = {
507 .name = "plgpio 43, 44, 47 and 48",
508 .modes = pmx_plgpio_43_44_47_48_modes,
509 .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes),
510 .enb_on_reset = 1,
511};
512
513struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = {
514 {
515 .ids = 0x00,
516 .mask = PMX_TIMER_3_4_MASK,
517 },
518};
519
520struct pmx_dev pmx_plgpio_45_46_49_50 = {
521 .name = "plgpio 45, 46, 49 and 50",
522 .modes = pmx_plgpio_45_46_49_50_modes,
523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
524 .enb_on_reset = 1,
525};
526
527#endif
528
529/* spear padmux initialization function */
530void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size)
531{
532 int ret = 0;
533
534 /* pad mux initialization */
535 pmx_driver->base = ioremap(base, size);
536 if (!pmx_driver->base) {
537 ret = -ENOMEM;
538 goto pmx_fail;
539 }
540
541 ret = pmx_register(pmx_driver);
542 iounmap(pmx_driver->base);
543
544pmx_fail:
545 if (ret)
546 printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
547 ret);
548}
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig
new file mode 100644
index 000000000000..bddba034f862
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Kconfig
@@ -0,0 +1,20 @@
1#
2# SPEAr6XX Machine configuration file
3#
4
5if ARCH_SPEAR6XX
6
7choice
8 prompt "SPEAr6XX Family"
9 default MACH_SPEAR600
10
11config MACH_SPEAR600
12 bool "SPEAr600"
13 help
14 Supports ST SPEAr600 Machine
15endchoice
16
17# Adding SPEAr6XX machine specific configuration files
18source "arch/arm/mach-spear6xx/Kconfig600"
19
20endif #ARCH_SPEAR6XX
diff --git a/arch/arm/mach-spear6xx/Kconfig600 b/arch/arm/mach-spear6xx/Kconfig600
new file mode 100644
index 000000000000..9e19f65eb78e
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Kconfig600
@@ -0,0 +1,17 @@
1#
2# SPEAr600 machine configuration file
3#
4
5if MACH_SPEAR600
6
7choice
8 prompt "SPEAr600 Boards"
9 default BOARD_SPEAR600_EVB
10
11config BOARD_SPEAR600_EVB
12 bool "SPEAr600 Evaluation Board"
13 help
14 Supports ST SPEAr600 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR600
diff --git a/arch/arm/mach-spear6xx/Makefile b/arch/arm/mach-spear6xx/Makefile
new file mode 100644
index 000000000000..cc1a4d82d459
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for SPEAr6XX machine series
3#
4
5# common files
6obj-y += clock.o spear6xx.o
7
8# spear600 specific files
9obj-$(CONFIG_MACH_SPEAR600) += spear600.o
10
11# spear600 boards files
12obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
diff --git a/arch/arm/mach-spear6xx/Makefile.boot b/arch/arm/mach-spear6xx/Makefile.boot
new file mode 100644
index 000000000000..7a1f3c0eadb8
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Makefile.boot
@@ -0,0 +1,3 @@
1zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c
new file mode 100644
index 000000000000..13e27c769685
--- /dev/null
+++ b/arch/arm/mach-spear6xx/clock.c
@@ -0,0 +1,483 @@
1/*
2 * arch/arm/mach-spear6xx/clock.c
3 *
4 * SPEAr6xx machines clock framework source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <mach/misc_regs.h>
17#include <plat/clock.h>
18
19/* root clks */
20/* 32 KHz oscillator clock */
21static struct clk osc_32k_clk = {
22 .flags = ALWAYS_ENABLED,
23 .rate = 32000,
24};
25
26/* 30 MHz oscillator clock */
27static struct clk osc_30m_clk = {
28 .flags = ALWAYS_ENABLED,
29 .rate = 30000000,
30};
31
32/* clock derived from 32 KHz osc clk */
33/* rtc clock */
34static struct clk rtc_clk = {
35 .pclk = &osc_32k_clk,
36 .en_reg = PERIP1_CLK_ENB,
37 .en_reg_bit = RTC_CLK_ENB,
38 .recalc = &follow_parent,
39};
40
41/* clock derived from 30 MHz osc clk */
42/* pll1 configuration structure */
43static struct pll_clk_config pll1_config = {
44 .mode_reg = PLL1_CTR,
45 .cfg_reg = PLL1_FRQ,
46};
47
48/* PLL1 clock */
49static struct clk pll1_clk = {
50 .pclk = &osc_30m_clk,
51 .en_reg = PLL1_CTR,
52 .en_reg_bit = PLL_ENABLE,
53 .recalc = &pll1_clk_recalc,
54 .private_data = &pll1_config,
55};
56
57/* PLL3 48 MHz clock */
58static struct clk pll3_48m_clk = {
59 .flags = ALWAYS_ENABLED,
60 .pclk = &osc_30m_clk,
61 .rate = 48000000,
62};
63
64/* watch dog timer clock */
65static struct clk wdt_clk = {
66 .flags = ALWAYS_ENABLED,
67 .pclk = &osc_30m_clk,
68 .recalc = &follow_parent,
69};
70
71/* clock derived from pll1 clk */
72/* cpu clock */
73static struct clk cpu_clk = {
74 .flags = ALWAYS_ENABLED,
75 .pclk = &pll1_clk,
76 .recalc = &follow_parent,
77};
78
79/* ahb configuration structure */
80static struct bus_clk_config ahb_config = {
81 .reg = CORE_CLK_CFG,
82 .mask = PLL_HCLK_RATIO_MASK,
83 .shift = PLL_HCLK_RATIO_SHIFT,
84};
85
86/* ahb clock */
87static struct clk ahb_clk = {
88 .flags = ALWAYS_ENABLED,
89 .pclk = &pll1_clk,
90 .recalc = &bus_clk_recalc,
91 .private_data = &ahb_config,
92};
93
94/* uart parents */
95static struct pclk_info uart_pclk_info[] = {
96 {
97 .pclk = &pll1_clk,
98 .pclk_mask = AUX_CLK_PLL1_MASK,
99 .scalable = 1,
100 }, {
101 .pclk = &pll3_48m_clk,
102 .pclk_mask = AUX_CLK_PLL3_MASK,
103 .scalable = 0,
104 },
105};
106
107/* uart parent select structure */
108static struct pclk_sel uart_pclk_sel = {
109 .pclk_info = uart_pclk_info,
110 .pclk_count = ARRAY_SIZE(uart_pclk_info),
111 .pclk_sel_reg = PERIP_CLK_CFG,
112 .pclk_sel_mask = UART_CLK_MASK,
113};
114
115/* uart configurations */
116static struct aux_clk_config uart_config = {
117 .synth_reg = UART_CLK_SYNT,
118};
119
120/* uart0 clock */
121static struct clk uart0_clk = {
122 .en_reg = PERIP1_CLK_ENB,
123 .en_reg_bit = UART0_CLK_ENB,
124 .pclk_sel = &uart_pclk_sel,
125 .pclk_sel_shift = UART_CLK_SHIFT,
126 .recalc = &aux_clk_recalc,
127 .private_data = &uart_config,
128};
129
130/* uart1 clock */
131static struct clk uart1_clk = {
132 .en_reg = PERIP1_CLK_ENB,
133 .en_reg_bit = UART1_CLK_ENB,
134 .pclk_sel = &uart_pclk_sel,
135 .pclk_sel_shift = UART_CLK_SHIFT,
136 .recalc = &aux_clk_recalc,
137 .private_data = &uart_config,
138};
139
140/* firda configurations */
141static struct aux_clk_config firda_config = {
142 .synth_reg = FIRDA_CLK_SYNT,
143};
144
145/* firda parents */
146static struct pclk_info firda_pclk_info[] = {
147 {
148 .pclk = &pll1_clk,
149 .pclk_mask = AUX_CLK_PLL1_MASK,
150 .scalable = 1,
151 }, {
152 .pclk = &pll3_48m_clk,
153 .pclk_mask = AUX_CLK_PLL3_MASK,
154 .scalable = 0,
155 },
156};
157
158/* firda parent select structure */
159static struct pclk_sel firda_pclk_sel = {
160 .pclk_info = firda_pclk_info,
161 .pclk_count = ARRAY_SIZE(firda_pclk_info),
162 .pclk_sel_reg = PERIP_CLK_CFG,
163 .pclk_sel_mask = FIRDA_CLK_MASK,
164};
165
166/* firda clock */
167static struct clk firda_clk = {
168 .en_reg = PERIP1_CLK_ENB,
169 .en_reg_bit = FIRDA_CLK_ENB,
170 .pclk_sel = &firda_pclk_sel,
171 .pclk_sel_shift = FIRDA_CLK_SHIFT,
172 .recalc = &aux_clk_recalc,
173 .private_data = &firda_config,
174};
175
176/* clcd configurations */
177static struct aux_clk_config clcd_config = {
178 .synth_reg = CLCD_CLK_SYNT,
179};
180
181/* clcd parents */
182static struct pclk_info clcd_pclk_info[] = {
183 {
184 .pclk = &pll1_clk,
185 .pclk_mask = AUX_CLK_PLL1_MASK,
186 .scalable = 1,
187 }, {
188 .pclk = &pll3_48m_clk,
189 .pclk_mask = AUX_CLK_PLL3_MASK,
190 .scalable = 0,
191 },
192};
193
194/* clcd parent select structure */
195static struct pclk_sel clcd_pclk_sel = {
196 .pclk_info = clcd_pclk_info,
197 .pclk_count = ARRAY_SIZE(clcd_pclk_info),
198 .pclk_sel_reg = PERIP_CLK_CFG,
199 .pclk_sel_mask = CLCD_CLK_MASK,
200};
201
202/* clcd clock */
203static struct clk clcd_clk = {
204 .en_reg = PERIP1_CLK_ENB,
205 .en_reg_bit = CLCD_CLK_ENB,
206 .pclk_sel = &clcd_pclk_sel,
207 .pclk_sel_shift = CLCD_CLK_SHIFT,
208 .recalc = &aux_clk_recalc,
209 .private_data = &clcd_config,
210};
211
212/* gpt parents */
213static struct pclk_info gpt_pclk_info[] = {
214 {
215 .pclk = &pll1_clk,
216 .pclk_mask = AUX_CLK_PLL1_MASK,
217 .scalable = 1,
218 }, {
219 .pclk = &pll3_48m_clk,
220 .pclk_mask = AUX_CLK_PLL3_MASK,
221 .scalable = 0,
222 },
223};
224
225/* gpt parent select structure */
226static struct pclk_sel gpt_pclk_sel = {
227 .pclk_info = gpt_pclk_info,
228 .pclk_count = ARRAY_SIZE(gpt_pclk_info),
229 .pclk_sel_reg = PERIP_CLK_CFG,
230 .pclk_sel_mask = GPT_CLK_MASK,
231};
232
233/* gpt0_1 configurations */
234static struct aux_clk_config gpt0_1_config = {
235 .synth_reg = PRSC1_CLK_CFG,
236};
237
238/* gpt0 ARM1 subsystem timer clock */
239static struct clk gpt0_clk = {
240 .flags = ALWAYS_ENABLED,
241 .pclk_sel = &gpt_pclk_sel,
242 .pclk_sel_shift = GPT0_CLK_SHIFT,
243 .recalc = &gpt_clk_recalc,
244 .private_data = &gpt0_1_config,
245};
246
247/* gpt1 timer clock */
248static struct clk gpt1_clk = {
249 .flags = ALWAYS_ENABLED,
250 .pclk_sel = &gpt_pclk_sel,
251 .pclk_sel_shift = GPT1_CLK_SHIFT,
252 .recalc = &gpt_clk_recalc,
253 .private_data = &gpt0_1_config,
254};
255
256/* gpt2 configurations */
257static struct aux_clk_config gpt2_config = {
258 .synth_reg = PRSC2_CLK_CFG,
259};
260
261/* gpt2 timer clock */
262static struct clk gpt2_clk = {
263 .en_reg = PERIP1_CLK_ENB,
264 .en_reg_bit = GPT2_CLK_ENB,
265 .pclk_sel = &gpt_pclk_sel,
266 .pclk_sel_shift = GPT2_CLK_SHIFT,
267 .recalc = &gpt_clk_recalc,
268 .private_data = &gpt2_config,
269};
270
271/* gpt3 configurations */
272static struct aux_clk_config gpt3_config = {
273 .synth_reg = PRSC3_CLK_CFG,
274};
275
276/* gpt3 timer clock */
277static struct clk gpt3_clk = {
278 .en_reg = PERIP1_CLK_ENB,
279 .en_reg_bit = GPT3_CLK_ENB,
280 .pclk_sel = &gpt_pclk_sel,
281 .pclk_sel_shift = GPT3_CLK_SHIFT,
282 .recalc = &gpt_clk_recalc,
283 .private_data = &gpt3_config,
284};
285
286/* clock derived from pll3 clk */
287/* usbh0 clock */
288static struct clk usbh0_clk = {
289 .pclk = &pll3_48m_clk,
290 .en_reg = PERIP1_CLK_ENB,
291 .en_reg_bit = USBH0_CLK_ENB,
292 .recalc = &follow_parent,
293};
294
295/* usbh1 clock */
296static struct clk usbh1_clk = {
297 .pclk = &pll3_48m_clk,
298 .en_reg = PERIP1_CLK_ENB,
299 .en_reg_bit = USBH1_CLK_ENB,
300 .recalc = &follow_parent,
301};
302
303/* usbd clock */
304static struct clk usbd_clk = {
305 .pclk = &pll3_48m_clk,
306 .en_reg = PERIP1_CLK_ENB,
307 .en_reg_bit = USBD_CLK_ENB,
308 .recalc = &follow_parent,
309};
310
311/* clock derived from ahb clk */
312/* apb configuration structure */
313static struct bus_clk_config apb_config = {
314 .reg = CORE_CLK_CFG,
315 .mask = HCLK_PCLK_RATIO_MASK,
316 .shift = HCLK_PCLK_RATIO_SHIFT,
317};
318
319/* apb clock */
320static struct clk apb_clk = {
321 .flags = ALWAYS_ENABLED,
322 .pclk = &ahb_clk,
323 .recalc = &bus_clk_recalc,
324 .private_data = &apb_config,
325};
326
327/* i2c clock */
328static struct clk i2c_clk = {
329 .pclk = &ahb_clk,
330 .en_reg = PERIP1_CLK_ENB,
331 .en_reg_bit = I2C_CLK_ENB,
332 .recalc = &follow_parent,
333};
334
335/* dma clock */
336static struct clk dma_clk = {
337 .pclk = &ahb_clk,
338 .en_reg = PERIP1_CLK_ENB,
339 .en_reg_bit = DMA_CLK_ENB,
340 .recalc = &follow_parent,
341};
342
343/* jpeg clock */
344static struct clk jpeg_clk = {
345 .pclk = &ahb_clk,
346 .en_reg = PERIP1_CLK_ENB,
347 .en_reg_bit = JPEG_CLK_ENB,
348 .recalc = &follow_parent,
349};
350
351/* gmac clock */
352static struct clk gmac_clk = {
353 .pclk = &ahb_clk,
354 .en_reg = PERIP1_CLK_ENB,
355 .en_reg_bit = GMAC_CLK_ENB,
356 .recalc = &follow_parent,
357};
358
359/* smi clock */
360static struct clk smi_clk = {
361 .pclk = &ahb_clk,
362 .en_reg = PERIP1_CLK_ENB,
363 .en_reg_bit = SMI_CLK_ENB,
364 .recalc = &follow_parent,
365};
366
367/* fsmc clock */
368static struct clk fsmc_clk = {
369 .pclk = &ahb_clk,
370 .en_reg = PERIP1_CLK_ENB,
371 .en_reg_bit = FSMC_CLK_ENB,
372 .recalc = &follow_parent,
373};
374
375/* clock derived from apb clk */
376/* adc clock */
377static struct clk adc_clk = {
378 .pclk = &apb_clk,
379 .en_reg = PERIP1_CLK_ENB,
380 .en_reg_bit = ADC_CLK_ENB,
381 .recalc = &follow_parent,
382};
383
384/* ssp0 clock */
385static struct clk ssp0_clk = {
386 .pclk = &apb_clk,
387 .en_reg = PERIP1_CLK_ENB,
388 .en_reg_bit = SSP0_CLK_ENB,
389 .recalc = &follow_parent,
390};
391
392/* ssp1 clock */
393static struct clk ssp1_clk = {
394 .pclk = &apb_clk,
395 .en_reg = PERIP1_CLK_ENB,
396 .en_reg_bit = SSP1_CLK_ENB,
397 .recalc = &follow_parent,
398};
399
400/* ssp2 clock */
401static struct clk ssp2_clk = {
402 .pclk = &apb_clk,
403 .en_reg = PERIP1_CLK_ENB,
404 .en_reg_bit = SSP2_CLK_ENB,
405 .recalc = &follow_parent,
406};
407
408/* gpio0 ARM subsystem clock */
409static struct clk gpio0_clk = {
410 .flags = ALWAYS_ENABLED,
411 .pclk = &apb_clk,
412 .recalc = &follow_parent,
413};
414
415/* gpio1 clock */
416static struct clk gpio1_clk = {
417 .pclk = &apb_clk,
418 .en_reg = PERIP1_CLK_ENB,
419 .en_reg_bit = GPIO1_CLK_ENB,
420 .recalc = &follow_parent,
421};
422
423/* gpio2 clock */
424static struct clk gpio2_clk = {
425 .pclk = &apb_clk,
426 .en_reg = PERIP1_CLK_ENB,
427 .en_reg_bit = GPIO2_CLK_ENB,
428 .recalc = &follow_parent,
429};
430
431/* array of all spear 6xx clock lookups */
432static struct clk_lookup spear_clk_lookups[] = {
433 /* root clks */
434 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk},
435 { .con_id = "osc_30m_clk", .clk = &osc_30m_clk},
436 /* clock derived from 32 KHz os clk */
437 { .dev_id = "rtc", .clk = &rtc_clk},
438 /* clock derived from 30 MHz os clk */
439 { .con_id = "pll1_clk", .clk = &pll1_clk},
440 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk},
441 { .dev_id = "wdt", .clk = &wdt_clk},
442 /* clock derived from pll1 clk */
443 { .con_id = "cpu_clk", .clk = &cpu_clk},
444 { .con_id = "ahb_clk", .clk = &ahb_clk},
445 { .dev_id = "uart0", .clk = &uart0_clk},
446 { .dev_id = "uart1", .clk = &uart1_clk},
447 { .dev_id = "firda", .clk = &firda_clk},
448 { .dev_id = "clcd", .clk = &clcd_clk},
449 { .dev_id = "gpt0", .clk = &gpt0_clk},
450 { .dev_id = "gpt1", .clk = &gpt1_clk},
451 { .dev_id = "gpt2", .clk = &gpt2_clk},
452 { .dev_id = "gpt3", .clk = &gpt3_clk},
453 /* clock derived from pll3 clk */
454 { .dev_id = "usbh0", .clk = &usbh0_clk},
455 { .dev_id = "usbh1", .clk = &usbh1_clk},
456 { .dev_id = "usbd", .clk = &usbd_clk},
457 /* clock derived from ahb clk */
458 { .con_id = "apb_clk", .clk = &apb_clk},
459 { .dev_id = "i2c", .clk = &i2c_clk},
460 { .dev_id = "dma", .clk = &dma_clk},
461 { .dev_id = "jpeg", .clk = &jpeg_clk},
462 { .dev_id = "gmac", .clk = &gmac_clk},
463 { .dev_id = "smi", .clk = &smi_clk},
464 { .dev_id = "fsmc", .clk = &fsmc_clk},
465 /* clock derived from apb clk */
466 { .dev_id = "adc", .clk = &adc_clk},
467 { .dev_id = "ssp0", .clk = &ssp0_clk},
468 { .dev_id = "ssp1", .clk = &ssp1_clk},
469 { .dev_id = "ssp2", .clk = &ssp2_clk},
470 { .dev_id = "gpio0", .clk = &gpio0_clk},
471 { .dev_id = "gpio1", .clk = &gpio1_clk},
472 { .dev_id = "gpio2", .clk = &gpio2_clk},
473};
474
475void __init clk_init(void)
476{
477 int i;
478
479 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
480 clk_register(&spear_clk_lookups[i]);
481
482 recalc_root_clocks();
483}
diff --git a/arch/arm/mach-spear6xx/include/mach/clkdev.h b/arch/arm/mach-spear6xx/include/mach/clkdev.h
new file mode 100644
index 000000000000..05676bf440d3
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/clkdev.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/clkdev.h
3 *
4 * Clock Dev framework definitions for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_CLKDEV_H
15#define __MACH_CLKDEV_H
16
17#include <plat/clkdev.h>
18
19#endif /* __MACH_CLKDEV_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/debug-macro.S b/arch/arm/mach-spear6xx/include/mach/debug-macro.S
new file mode 100644
index 000000000000..0f3ea39edd96
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/debug-macro.S
@@ -0,0 +1,14 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/debug-macro.S
3 *
4 * Debugging macro include header for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-spear6xx/include/mach/entry-macro.S b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
new file mode 100644
index 000000000000..9eaecaeafcf0
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
@@ -0,0 +1,55 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <mach/hardware.h>
15#include <mach/spear.h>
16#include <asm/hardware/vic.h>
17
18 .macro disable_fiq
19 .endm
20
21 .macro get_irqnr_preamble, base, tmp
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28 ldr \base, =VA_SPEAR6XX_CPU_VIC_PRI_BASE
29 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
30 mov \irqnr, #0
31 teq \irqstat, #0
32 bne 1001f
33 ldr \base, =VA_SPEAR6XX_CPU_VIC_SEC_BASE
34 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get status
35 teq \irqstat, #0
36 beq 1002f @ this will set/reset
37 @ zero register
38 mov \irqnr, #32
391001:
40 /*
41 * Following code will find bit position of least significang
42 * bit set in irqstat, using following equation
43 * least significant bit set in n = (n & ~(n-1))
44 */
45 sub \tmp, \irqstat, #1 @ tmp = irqstat - 1
46 mvn \tmp, \tmp @ tmp = ~tmp
47 and \irqstat, \irqstat, \tmp @ irqstat &= tmp
48 /* Now, irqstat is = bit no. of 1st bit set in vic irq status */
49 clz \tmp, \irqstat @ tmp = leading zeros
50
51 rsb \tmp, \tmp, #0x1F @ tmp = 32 - tmp - 1
52 add \irqnr, \irqnr, \tmp
53
541002: /* EQ will be set if no irqs pending */
55 .endm
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h
new file mode 100644
index 000000000000..16205a538756
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/generic.h
@@ -0,0 +1,45 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/generic.h
3 *
4 * SPEAr6XX machine family specific generic header file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_GENERIC_H
15#define __MACH_GENERIC_H
16
17#include <asm/mach/time.h>
18#include <asm/mach/map.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/amba/bus.h>
22
23/*
24 * Each GPT has 2 timer channels
25 * Following GPT channels will be used as clock source and clockevent
26 */
27#define SPEAR_GPT0_BASE SPEAR6XX_CPU_TMR_BASE
28#define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1
29#define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2
30
31/* Add spear6xx family device structure declarations here */
32extern struct amba_device gpio_device[];
33extern struct amba_device uart_device[];
34extern struct sys_timer spear_sys_timer;
35
36/* Add spear6xx family function declarations here */
37void __init spear6xx_map_io(void);
38void __init spear6xx_init_irq(void);
39void __init spear6xx_init(void);
40void __init spear600_init(void);
41void __init clk_init(void);
42
43/* Add spear600 machine device structure declarations here */
44
45#endif /* __MACH_GENERIC_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/gpio.h b/arch/arm/mach-spear6xx/include/mach/gpio.h
new file mode 100644
index 000000000000..3a789dbb69f7
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/gpio.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/gpio.h
3 *
4 * GPIO macros for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_GPIO_H
15#define __MACH_GPIO_H
16
17#include <plat/gpio.h>
18
19#endif /* __MACH_GPIO_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/hardware.h b/arch/arm/mach-spear6xx/include/mach/hardware.h
new file mode 100644
index 000000000000..7545116deca9
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/hardware.h
@@ -0,0 +1,21 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/hardware.h
3 *
4 * Hardware definitions for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_HARDWARE_H
15#define __MACH_HARDWARE_H
16
17/* Vitual to physical translation of statically mapped space */
18#define IO_ADDRESS(x) (x | 0xF0000000)
19
20#endif /* __MACH_HARDWARE_H */
21
diff --git a/arch/arm/mach-spear6xx/include/mach/io.h b/arch/arm/mach-spear6xx/include/mach/io.h
new file mode 100644
index 000000000000..fb7c106cea94
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/io.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/io.h
3 *
4 * IO definitions for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_IO_H
15#define __MACH_IO_H
16
17#include <plat/io.h>
18
19#endif /* __MACH_IO_H */
20
diff --git a/arch/arm/mach-spear6xx/include/mach/irqs.h b/arch/arm/mach-spear6xx/include/mach/irqs.h
new file mode 100644
index 000000000000..8f214b03d75d
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/irqs.h
@@ -0,0 +1,97 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/irqs.h
3 *
4 * IRQ helper macros for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_IRQS_H
15#define __MACH_IRQS_H
16
17/* IRQ definitions */
18/* VIC 1 */
19#define IRQ_INTRCOMM_SW_IRQ 0
20#define IRQ_INTRCOMM_CPU_1 1
21#define IRQ_INTRCOMM_CPU_2 2
22#define IRQ_INTRCOMM_RAS2A11_1 3
23#define IRQ_INTRCOMM_RAS2A11_2 4
24#define IRQ_INTRCOMM_RAS2A12_1 5
25#define IRQ_INTRCOMM_RAS2A12_2 6
26#define IRQ_GEN_RAS_0 7
27#define IRQ_GEN_RAS_1 8
28#define IRQ_GEN_RAS_2 9
29#define IRQ_GEN_RAS_3 10
30#define IRQ_GEN_RAS_4 11
31#define IRQ_GEN_RAS_5 12
32#define IRQ_GEN_RAS_6 13
33#define IRQ_GEN_RAS_7 14
34#define IRQ_GEN_RAS_8 15
35#define IRQ_CPU_GPT1_1 16
36#define IRQ_CPU_GPT1_2 17
37#define IRQ_LOCAL_GPIO 18
38#define IRQ_PLL_UNLOCK 19
39#define IRQ_JPEG 20
40#define IRQ_FSMC 21
41#define IRQ_IRDA 22
42#define IRQ_RESERVED 23
43#define IRQ_UART_0 24
44#define IRQ_UART_1 25
45#define IRQ_SSP_1 26
46#define IRQ_SSP_2 27
47#define IRQ_I2C 28
48#define IRQ_GEN_RAS_9 29
49#define IRQ_GEN_RAS_10 30
50#define IRQ_GEN_RAS_11 31
51
52/* VIC 2 */
53#define IRQ_APPL_GPT1_1 32
54#define IRQ_APPL_GPT1_2 33
55#define IRQ_APPL_GPT2_1 34
56#define IRQ_APPL_GPT2_2 35
57#define IRQ_APPL_GPIO 36
58#define IRQ_APPL_SSP 37
59#define IRQ_APPL_ADC 38
60#define IRQ_APPL_RESERVED 39
61#define IRQ_AHB_EXP_MASTER 40
62#define IRQ_DDR_CONTROLLER 41
63#define IRQ_BASIC_DMA 42
64#define IRQ_BASIC_RESERVED1 43
65#define IRQ_BASIC_SMI 44
66#define IRQ_BASIC_CLCD 45
67#define IRQ_EXP_AHB_1 46
68#define IRQ_EXP_AHB_2 47
69#define IRQ_BASIC_GPT1_1 48
70#define IRQ_BASIC_GPT1_2 49
71#define IRQ_BASIC_RTC 50
72#define IRQ_BASIC_GPIO 51
73#define IRQ_BASIC_WDT 52
74#define IRQ_BASIC_RESERVED 53
75#define IRQ_AHB_EXP_SLAVE 54
76#define IRQ_GMAC_1 55
77#define IRQ_GMAC_2 56
78#define IRQ_USB_DEV 57
79#define IRQ_USB_H_OHCI_0 58
80#define IRQ_USB_H_EHCI_0 59
81#define IRQ_USB_H_OHCI_1 60
82#define IRQ_USB_H_EHCI_1 61
83#define IRQ_EXP_AHB_3 62
84#define IRQ_EXP_AHB_4 63
85
86#define IRQ_VIC_END 64
87
88/* GPIO pins virtual irqs */
89#define SPEAR_GPIO_INT_BASE IRQ_VIC_END
90#define SPEAR_GPIO0_INT_BASE SPEAR_GPIO_INT_BASE
91#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO0_INT_BASE + 8)
92#define SPEAR_GPIO2_INT_BASE (SPEAR_GPIO1_INT_BASE + 8)
93#define SPEAR_GPIO_INT_END (SPEAR_GPIO2_INT_BASE + 8)
94#define VIRTUAL_IRQS (SPEAR_GPIO_INT_END - IRQ_VIC_END)
95#define NR_IRQS (IRQ_VIC_END + VIRTUAL_IRQS)
96
97#endif /* __MACH_IRQS_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/memory.h b/arch/arm/mach-spear6xx/include/mach/memory.h
new file mode 100644
index 000000000000..781f088fc228
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/memory.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/memory.h
3 *
4 * Memory map for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_MEMORY_H
15#define __MACH_MEMORY_H
16
17#include <plat/memory.h>
18
19#endif /* __MACH_MEMORY_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/misc_regs.h b/arch/arm/mach-spear6xx/include/mach/misc_regs.h
new file mode 100644
index 000000000000..03908036b0d0
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/misc_regs.h
@@ -0,0 +1,173 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/misc_regs.h
3 *
4 * Miscellaneous registers definitions for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_MISC_REGS_H
15#define __MACH_MISC_REGS_H
16
17#include <mach/spear.h>
18
19#define MISC_BASE VA_SPEAR6XX_ICM3_MISC_REG_BASE
20
21#define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000))
22#define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004))
23#define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008))
24#define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C))
25#define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010))
26#define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014))
27/* PLL_CTR register masks */
28#define PLL_ENABLE 2
29#define PLL_MODE_SHIFT 4
30#define PLL_MODE_MASK 0x3
31#define PLL_MODE_NORMAL 0
32#define PLL_MODE_FRACTION 1
33#define PLL_MODE_DITH_DSB 2
34#define PLL_MODE_DITH_SSB 3
35
36#define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018))
37/* PLL FRQ register masks */
38#define PLL_DIV_N_SHIFT 0
39#define PLL_DIV_N_MASK 0xFF
40#define PLL_DIV_P_SHIFT 8
41#define PLL_DIV_P_MASK 0x7
42#define PLL_NORM_FDBK_M_SHIFT 24
43#define PLL_NORM_FDBK_M_MASK 0xFF
44#define PLL_DITH_FDBK_M_SHIFT 16
45#define PLL_DITH_FDBK_M_MASK 0xFFFF
46
47#define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C))
48#define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020))
49#define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024))
50/* CORE CLK CFG register masks */
51#define PLL_HCLK_RATIO_SHIFT 10
52#define PLL_HCLK_RATIO_MASK 0x3
53#define HCLK_PCLK_RATIO_SHIFT 8
54#define HCLK_PCLK_RATIO_MASK 0x3
55
56#define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028))
57/* PERIP_CLK_CFG register masks */
58#define CLCD_CLK_SHIFT 2
59#define CLCD_CLK_MASK 0x3
60#define UART_CLK_SHIFT 4
61#define UART_CLK_MASK 0x1
62#define FIRDA_CLK_SHIFT 5
63#define FIRDA_CLK_MASK 0x3
64#define GPT0_CLK_SHIFT 8
65#define GPT1_CLK_SHIFT 10
66#define GPT2_CLK_SHIFT 11
67#define GPT3_CLK_SHIFT 12
68#define GPT_CLK_MASK 0x1
69#define AUX_CLK_PLL3_MASK 0
70#define AUX_CLK_PLL1_MASK 1
71
72#define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C))
73/* PERIP1_CLK_ENB register masks */
74#define UART0_CLK_ENB 3
75#define UART1_CLK_ENB 4
76#define SSP0_CLK_ENB 5
77#define SSP1_CLK_ENB 6
78#define I2C_CLK_ENB 7
79#define JPEG_CLK_ENB 8
80#define FSMC_CLK_ENB 9
81#define FIRDA_CLK_ENB 10
82#define GPT2_CLK_ENB 11
83#define GPT3_CLK_ENB 12
84#define GPIO2_CLK_ENB 13
85#define SSP2_CLK_ENB 14
86#define ADC_CLK_ENB 15
87#define GPT1_CLK_ENB 11
88#define RTC_CLK_ENB 17
89#define GPIO1_CLK_ENB 18
90#define DMA_CLK_ENB 19
91#define SMI_CLK_ENB 21
92#define CLCD_CLK_ENB 22
93#define GMAC_CLK_ENB 23
94#define USBD_CLK_ENB 24
95#define USBH0_CLK_ENB 25
96#define USBH1_CLK_ENB 26
97
98#define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030))
99#define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034))
100#define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038))
101/* PERIP1_SOF_RST register masks */
102#define JPEG_SOF_RST 8
103
104#define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C))
105#define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040))
106#define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044))
107#define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048))
108#define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C))
109/* gpt synthesizer register masks */
110#define GPT_MSCALE_SHIFT 0
111#define GPT_MSCALE_MASK 0xFFF
112#define GPT_NSCALE_SHIFT 12
113#define GPT_NSCALE_MASK 0xF
114
115#define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050))
116#define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054))
117#define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C))
118#define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060))
119#define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064))
120#define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068))
121#define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C))
122#define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070))
123#define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074))
124#define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078))
125/* aux clk synthesiser register masks for irda to ras4 */
126#define AUX_EQ_SEL_SHIFT 30
127#define AUX_EQ_SEL_MASK 1
128#define AUX_EQ1_SEL 0
129#define AUX_EQ2_SEL 1
130#define AUX_XSCALE_SHIFT 16
131#define AUX_XSCALE_MASK 0xFFF
132#define AUX_YSCALE_SHIFT 0
133#define AUX_YSCALE_MASK 0xFFF
134
135#define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C))
136#define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080))
137#define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084))
138#define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088))
139#define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C))
140#define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090))
141#define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094))
142#define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098))
143#define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C))
144#define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0))
145#define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4))
146#define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8))
147#define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC))
148#define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0))
149#define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4))
150#define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8))
151#define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC))
152#define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0))
153#define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4))
154#define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8))
155#define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC))
156#define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0))
157#define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4))
158#define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8))
159#define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC))
160#define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0))
161#define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4))
162#define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8))
163#define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC))
164#define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100))
165#define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104))
166#define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108))
167#define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C))
168#define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110))
169#define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114))
170#define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118))
171#define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C))
172
173#endif /* __MACH_MISC_REGS_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/spear.h b/arch/arm/mach-spear6xx/include/mach/spear.h
new file mode 100644
index 000000000000..a835f5b6b182
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/spear.h
@@ -0,0 +1,173 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/spear.h
3 *
4 * SPEAr6xx Machine family specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_SPEAR6XX_H
15#define __MACH_SPEAR6XX_H
16
17#include <mach/hardware.h>
18#include <mach/spear600.h>
19
20#define SPEAR6XX_ML_SDRAM_BASE 0x00000000
21#define SPEAR6XX_ML_SDRAM_SIZE 0x40000000
22
23/* ICM1 - Low speed connection */
24#define SPEAR6XX_ICM1_BASE 0xD0000000
25#define SPEAR6XX_ICM1_SIZE 0x08000000
26
27#define SPEAR6XX_ICM1_UART0_BASE 0xD0000000
28#define VA_SPEAR6XX_ICM1_UART0_BASE IO_ADDRESS(SPEAR6XX_ICM1_UART0_BASE)
29#define SPEAR6XX_ICM1_UART0_SIZE 0x00080000
30
31#define SPEAR6XX_ICM1_UART1_BASE 0xD0080000
32#define SPEAR6XX_ICM1_UART1_SIZE 0x00080000
33
34#define SPEAR6XX_ICM1_SSP0_BASE 0xD0100000
35#define SPEAR6XX_ICM1_SSP0_SIZE 0x00080000
36
37#define SPEAR6XX_ICM1_SSP1_BASE 0xD0180000
38#define SPEAR6XX_ICM1_SSP1_SIZE 0x00080000
39
40#define SPEAR6XX_ICM1_I2C_BASE 0xD0200000
41#define SPEAR6XX_ICM1_I2C_SIZE 0x00080000
42
43#define SPEAR6XX_ICM1_JPEG_BASE 0xD0800000
44#define SPEAR6XX_ICM1_JPEG_SIZE 0x00800000
45
46#define SPEAR6XX_ICM1_IRDA_BASE 0xD1000000
47#define SPEAR6XX_ICM1_IRDA_SIZE 0x00800000
48
49#define SPEAR6XX_ICM1_FSMC_BASE 0xD1800000
50#define SPEAR6XX_ICM1_FSMC_SIZE 0x00800000
51
52#define SPEAR6XX_ICM1_NAND_BASE 0xD2000000
53#define SPEAR6XX_ICM1_NAND_SIZE 0x00800000
54
55#define SPEAR6XX_ICM1_SRAM_BASE 0xD2800000
56#define SPEAR6XX_ICM1_SRAM_SIZE 0x00800000
57
58/* ICM2 - Application Subsystem */
59#define SPEAR6XX_ICM2_BASE 0xD8000000
60#define SPEAR6XX_ICM2_SIZE 0x08000000
61
62#define SPEAR6XX_ICM2_TMR0_BASE 0xD8000000
63#define SPEAR6XX_ICM2_TMR0_SIZE 0x00080000
64
65#define SPEAR6XX_ICM2_TMR1_BASE 0xD8080000
66#define SPEAR6XX_ICM2_TMR1_SIZE 0x00080000
67
68#define SPEAR6XX_ICM2_GPIO_BASE 0xD8100000
69#define SPEAR6XX_ICM2_GPIO_SIZE 0x00080000
70
71#define SPEAR6XX_ICM2_SPI2_BASE 0xD8180000
72#define SPEAR6XX_ICM2_SPI2_SIZE 0x00080000
73
74#define SPEAR6XX_ICM2_ADC_BASE 0xD8200000
75#define SPEAR6XX_ICM2_ADC_SIZE 0x00080000
76
77/* ML-1, 2 - Multi Layer CPU Subsystem */
78#define SPEAR6XX_ML_CPU_BASE 0xF0000000
79#define SPEAR6XX_ML_CPU_SIZE 0x08000000
80
81#define SPEAR6XX_CPU_TMR_BASE 0xF0000000
82#define SPEAR6XX_CPU_TMR_SIZE 0x00100000
83
84#define SPEAR6XX_CPU_GPIO_BASE 0xF0100000
85#define SPEAR6XX_CPU_GPIO_SIZE 0x00100000
86
87#define SPEAR6XX_CPU_VIC_SEC_BASE 0xF1000000
88#define VA_SPEAR6XX_CPU_VIC_SEC_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_SEC_BASE)
89#define SPEAR6XX_CPU_VIC_SEC_SIZE 0x00100000
90
91#define SPEAR6XX_CPU_VIC_PRI_BASE 0xF1100000
92#define VA_SPEAR6XX_CPU_VIC_PRI_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_PRI_BASE)
93#define SPEAR6XX_CPU_VIC_PRI_SIZE 0x00100000
94
95/* ICM3 - Basic Subsystem */
96#define SPEAR6XX_ICM3_BASE 0xF8000000
97#define SPEAR6XX_ICM3_SIZE 0x08000000
98
99#define SPEAR6XX_ICM3_SMEM_BASE 0xF8000000
100#define SPEAR6XX_ICM3_SMEM_SIZE 0x04000000
101
102#define SPEAR6XX_ICM3_SMI_CTRL_BASE 0xFC000000
103#define SPEAR6XX_ICM3_SMI_CTRL_SIZE 0x00200000
104
105#define SPEAR6XX_ICM3_CLCD_BASE 0xFC200000
106#define SPEAR6XX_ICM3_CLCD_SIZE 0x00200000
107
108#define SPEAR6XX_ICM3_DMA_BASE 0xFC400000
109#define SPEAR6XX_ICM3_DMA_SIZE 0x00200000
110
111#define SPEAR6XX_ICM3_SDRAM_CTRL_BASE 0xFC600000
112#define SPEAR6XX_ICM3_SDRAM_CTRL_SIZE 0x00200000
113
114#define SPEAR6XX_ICM3_TMR_BASE 0xFC800000
115#define SPEAR6XX_ICM3_TMR_SIZE 0x00080000
116
117#define SPEAR6XX_ICM3_WDT_BASE 0xFC880000
118#define SPEAR6XX_ICM3_WDT_SIZE 0x00080000
119
120#define SPEAR6XX_ICM3_RTC_BASE 0xFC900000
121#define SPEAR6XX_ICM3_RTC_SIZE 0x00080000
122
123#define SPEAR6XX_ICM3_GPIO_BASE 0xFC980000
124#define SPEAR6XX_ICM3_GPIO_SIZE 0x00080000
125
126#define SPEAR6XX_ICM3_SYS_CTRL_BASE 0xFCA00000
127#define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR6XX_ICM3_SYS_CTRL_BASE)
128#define SPEAR6XX_ICM3_SYS_CTRL_SIZE 0x00080000
129
130#define SPEAR6XX_ICM3_MISC_REG_BASE 0xFCA80000
131#define VA_SPEAR6XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR6XX_ICM3_MISC_REG_BASE)
132#define SPEAR6XX_ICM3_MISC_REG_SIZE 0x00080000
133
134/* ICM4 - High Speed Connection */
135#define SPEAR6XX_ICM4_BASE 0xE0000000
136#define SPEAR6XX_ICM4_SIZE 0x08000000
137
138#define SPEAR6XX_ICM4_GMAC_BASE 0xE0800000
139#define SPEAR6XX_ICM4_GMAC_SIZE 0x00800000
140
141#define SPEAR6XX_ICM4_USBD_FIFO_BASE 0xE1000000
142#define SPEAR6XX_ICM4_USBD_FIFO_SIZE 0x00100000
143
144#define SPEAR6XX_ICM4_USBD_CSR_BASE 0xE1100000
145#define SPEAR6XX_ICM4_USBD_CSR_SIZE 0x00100000
146
147#define SPEAR6XX_ICM4_USBD_PLDT_BASE 0xE1200000
148#define SPEAR6XX_ICM4_USBD_PLDT_SIZE 0x00100000
149
150#define SPEAR6XX_ICM4_USB_EHCI0_BASE 0xE1800000
151#define SPEAR6XX_ICM4_USB_EHCI0_SIZE 0x00100000
152
153#define SPEAR6XX_ICM4_USB_OHCI0_BASE 0xE1900000
154#define SPEAR6XX_ICM4_USB_OHCI0_SIZE 0x00100000
155
156#define SPEAR6XX_ICM4_USB_EHCI1_BASE 0xE2000000
157#define SPEAR6XX_ICM4_USB_EHCI1_SIZE 0x00100000
158
159#define SPEAR6XX_ICM4_USB_OHCI1_BASE 0xE2100000
160#define SPEAR6XX_ICM4_USB_OHCI1_SIZE 0x00100000
161
162#define SPEAR6XX_ICM4_USB_ARB_BASE 0xE2800000
163#define SPEAR6XX_ICM4_USB_ARB_SIZE 0x00010000
164
165/* Debug uart for linux, will be used for debug and uncompress messages */
166#define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE
167#define VA_SPEAR_DBG_UART_BASE VA_SPEAR6XX_ICM1_UART0_BASE
168
169/* Sysctl base for spear platform */
170#define SPEAR_SYS_CTRL_BASE SPEAR6XX_ICM3_SYS_CTRL_BASE
171#define VA_SPEAR_SYS_CTRL_BASE VA_SPEAR6XX_ICM3_SYS_CTRL_BASE
172
173#endif /* __MACH_SPEAR6XX_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/spear600.h b/arch/arm/mach-spear6xx/include/mach/spear600.h
new file mode 100644
index 000000000000..c068cc50b0fb
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/spear600.h
@@ -0,0 +1,21 @@
1/*
2 * arch/arm/mach-spear66xx/include/mach/spear600.h
3 *
4 * SPEAr600 Machine specific definition
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifdef CONFIG_MACH_SPEAR600
15
16#ifndef __MACH_SPEAR600_H
17#define __MACH_SPEAR600_H
18
19#endif /* __MACH_SPEAR600_H */
20
21#endif /* CONFIG_MACH_SPEAR600 */
diff --git a/arch/arm/mach-spear6xx/include/mach/system.h b/arch/arm/mach-spear6xx/include/mach/system.h
new file mode 100644
index 000000000000..0b1d2be81cfb
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/system.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/system.h
3 *
4 * SPEAr6xx Machine family specific architecture functions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_SYSTEM_H
15#define __MACH_SYSTEM_H
16
17#include <plat/system.h>
18
19#endif /* __MACH_SYSTEM_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/timex.h b/arch/arm/mach-spear6xx/include/mach/timex.h
new file mode 100644
index 000000000000..ac1c5b005695
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/timex.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/timex.h
3 *
4 * SPEAr6XX machine family specific timex definitions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_TIMEX_H
15#define __MACH_TIMEX_H
16
17#include <plat/timex.h>
18
19#endif /* __MACH_TIMEX_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/uncompress.h b/arch/arm/mach-spear6xx/include/mach/uncompress.h
new file mode 100644
index 000000000000..77f0765e21e1
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/uncompress.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_UNCOMPRESS_H
15#define __MACH_UNCOMPRESS_H
16
17#include <plat/uncompress.h>
18
19#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/vmalloc.h b/arch/arm/mach-spear6xx/include/mach/vmalloc.h
new file mode 100644
index 000000000000..4a0b56cb2a91
--- /dev/null
+++ b/arch/arm/mach-spear6xx/include/mach/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-spear6xx/include/mach/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr6xx machine family
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __MACH_VMALLOC_H
15#define __MACH_VMALLOC_H
16
17#include <plat/vmalloc.h>
18
19#endif /* __MACH_VMALLOC_H */
diff --git a/arch/arm/mach-spear6xx/spear600.c b/arch/arm/mach-spear6xx/spear600.c
new file mode 100644
index 000000000000..5c484c433dc1
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear600.c
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-spear6xx/spear600.c
3 *
4 * SPEAr600 machine source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* Add spear600 specific devices here */
20
21void __init spear600_init(void)
22{
23 /* call spear6xx family common init function */
24 spear6xx_init();
25}
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c
new file mode 100644
index 000000000000..daff8d04f7b6
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear600_evb.c
@@ -0,0 +1,51 @@
1/*
2 * arch/arm/mach-spear6xx/spear600_evb.c
3 *
4 * SPEAr600 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <asm/mach/arch.h>
15#include <asm/mach-types.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19static struct amba_device *amba_devs[] __initdata = {
20 &gpio_device[0],
21 &gpio_device[1],
22 &gpio_device[2],
23 &uart_device[0],
24 &uart_device[1],
25};
26
27static struct platform_device *plat_devs[] __initdata = {
28};
29
30static void __init spear600_evb_init(void)
31{
32 unsigned int i;
33
34 /* call spear600 machine init function */
35 spear600_init();
36
37 /* Add Platform Devices */
38 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
39
40 /* Add Amba Devices */
41 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
42 amba_device_register(amba_devs[i], &iomem_resource);
43}
44
45MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
46 .boot_params = 0x00000100,
47 .map_io = spear6xx_map_io,
48 .init_irq = spear6xx_init_irq,
49 .timer = &spear_sys_timer,
50 .init_machine = spear600_evb_init,
51MACHINE_END
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
new file mode 100644
index 000000000000..b67e571d4bf7
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -0,0 +1,158 @@
1/*
2 * arch/arm/mach-spear6xx/spear6xx.c
3 *
4 * SPEAr6XX machines common source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/types.h>
17#include <linux/ptrace.h>
18#include <linux/io.h>
19#include <asm/hardware/vic.h>
20#include <asm/irq.h>
21#include <asm/mach/arch.h>
22#include <mach/irqs.h>
23#include <mach/generic.h>
24#include <mach/spear.h>
25
26/* Add spear6xx machines common devices here */
27/* uart device registeration */
28struct amba_device uart_device[] = {
29 {
30 .dev = {
31 .init_name = "uart0",
32 },
33 .res = {
34 .start = SPEAR6XX_ICM1_UART0_BASE,
35 .end = SPEAR6XX_ICM1_UART0_BASE +
36 SPEAR6XX_ICM1_UART0_SIZE - 1,
37 .flags = IORESOURCE_MEM,
38 },
39 .irq = {IRQ_UART_0, NO_IRQ},
40 }, {
41 .dev = {
42 .init_name = "uart1",
43 },
44 .res = {
45 .start = SPEAR6XX_ICM1_UART1_BASE,
46 .end = SPEAR6XX_ICM1_UART1_BASE +
47 SPEAR6XX_ICM1_UART1_SIZE - 1,
48 .flags = IORESOURCE_MEM,
49 },
50 .irq = {IRQ_UART_1, NO_IRQ},
51 }
52};
53
54/* gpio device registeration */
55static struct pl061_platform_data gpio_plat_data[] = {
56 {
57 .gpio_base = 0,
58 .irq_base = SPEAR_GPIO0_INT_BASE,
59 }, {
60 .gpio_base = 8,
61 .irq_base = SPEAR_GPIO1_INT_BASE,
62 }, {
63 .gpio_base = 16,
64 .irq_base = SPEAR_GPIO2_INT_BASE,
65 },
66};
67
68struct amba_device gpio_device[] = {
69 {
70 .dev = {
71 .init_name = "gpio0",
72 .platform_data = &gpio_plat_data[0],
73 },
74 .res = {
75 .start = SPEAR6XX_CPU_GPIO_BASE,
76 .end = SPEAR6XX_CPU_GPIO_BASE +
77 SPEAR6XX_CPU_GPIO_SIZE - 1,
78 .flags = IORESOURCE_MEM,
79 },
80 .irq = {IRQ_LOCAL_GPIO, NO_IRQ},
81 }, {
82 .dev = {
83 .init_name = "gpio1",
84 .platform_data = &gpio_plat_data[1],
85 },
86 .res = {
87 .start = SPEAR6XX_ICM3_GPIO_BASE,
88 .end = SPEAR6XX_ICM3_GPIO_BASE +
89 SPEAR6XX_ICM3_GPIO_SIZE - 1,
90 .flags = IORESOURCE_MEM,
91 },
92 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
93 }, {
94 .dev = {
95 .init_name = "gpio2",
96 .platform_data = &gpio_plat_data[2],
97 },
98 .res = {
99 .start = SPEAR6XX_ICM2_GPIO_BASE,
100 .end = SPEAR6XX_ICM2_GPIO_BASE +
101 SPEAR6XX_ICM2_GPIO_SIZE - 1,
102 .flags = IORESOURCE_MEM,
103 },
104 .irq = {IRQ_APPL_GPIO, NO_IRQ},
105 }
106};
107
108/* This will add devices, and do machine specific tasks */
109void __init spear6xx_init(void)
110{
111 /* nothing to do for now */
112}
113
114/* This will initialize vic */
115void __init spear6xx_init_irq(void)
116{
117 vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_PRI_BASE, 0, ~0, 0);
118 vic_init((void __iomem *)VA_SPEAR6XX_CPU_VIC_SEC_BASE, 32, ~0, 0);
119}
120
121/* Following will create static virtual/physical mappings */
122static struct map_desc spear6xx_io_desc[] __initdata = {
123 {
124 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE,
125 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE),
126 .length = SPEAR6XX_ICM1_UART0_SIZE,
127 .type = MT_DEVICE
128 }, {
129 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE,
130 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE),
131 .length = SPEAR6XX_CPU_VIC_PRI_SIZE,
132 .type = MT_DEVICE
133 }, {
134 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE,
135 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE),
136 .length = SPEAR6XX_CPU_VIC_SEC_SIZE,
137 .type = MT_DEVICE
138 }, {
139 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE,
140 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE),
141 .length = SPEAR6XX_ICM3_MISC_REG_BASE,
142 .type = MT_DEVICE
143 }, {
144 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE,
145 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE),
146 .length = SPEAR6XX_ICM3_MISC_REG_SIZE,
147 .type = MT_DEVICE
148 },
149};
150
151/* This will create static memory mapping for selected devices */
152void __init spear6xx_map_io(void)
153{
154 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
155
156 /* This will initialize clock framework */
157 clk_init();
158}
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c
index 109f5a6e71c7..783f1236fe1b 100644
--- a/arch/arm/mach-u300/mmc.c
+++ b/arch/arm/mach-u300/mmc.c
@@ -101,11 +101,12 @@ int __devinit mmc_init(struct amba_device *adev)
101 * we have a regulator we can control instead. 101 * we have a regulator we can control instead.
102 */ 102 */
103 /* Nominally 2.85V on our platform */ 103 /* Nominally 2.85V on our platform */
104 mmci_card->mmc0_plat_data.f_max = 24000000;
104 mmci_card->mmc0_plat_data.status = mmc_status; 105 mmci_card->mmc0_plat_data.status = mmc_status;
105 mmci_card->mmc0_plat_data.gpio_wp = -1; 106 mmci_card->mmc0_plat_data.gpio_wp = -1;
106 mmci_card->mmc0_plat_data.gpio_cd = -1; 107 mmci_card->mmc0_plat_data.gpio_cd = -1;
107 mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED | 108 mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED |
108 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA; 109 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
109 110
110 mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data; 111 mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data;
111 112
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 03625d744857..6625e5bbf4d6 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -1,15 +1,42 @@
1menu "ST-Ericsson platform type" 1if ARCH_U8500
2 depends on ARCH_U8500
3 2
4comment "ST-Ericsson Multicore Mobile Platforms" 3config UX500_SOC_COMMON
5 4 bool
6config MACH_U8500_MOP
7 bool "U8500 Early Development platform"
8 default y 5 default y
9 select ARM_GIC 6 select ARM_GIC
10 select HAS_MTU 7 select HAS_MTU
8 select NOMADIK_GPIO
9
10config UX500_SOC_DB8500
11 bool
12
13config UX500_SOC_DB5500
14 bool
15
16choice
17 prompt "Ux500 target platform"
18 default MACH_U8500_MOP
19
20config MACH_U8500_MOP
21 bool "U8500 Development platform"
22 select UX500_SOC_DB8500
11 help 23 help
12 Include support for mop500 development platform 24 Include support for mop500 development platform
13 based on U8500 architecture. The platform is based 25 based on U8500 architecture. The platform is based
14 on early drop silicon version of 8500. 26 on early drop silicon version of 8500.
15endmenu 27
28config MACH_U5500
29 bool "U5500 Development platform"
30 select UX500_SOC_DB5500
31 help
32 Include support for the U5500 development platform.
33endchoice
34
35config UX500_DEBUG_UART
36 int "Ux500 UART to use for low-level debug"
37 default 2
38 help
39 Choose the UART on which kernel low-level debug messages should be
40 output.
41
42endif
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 95e6e24c0042..c7bc4199e3a8 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -2,7 +2,9 @@
2# Makefile for the linux kernel, U8500 machine. 2# Makefile for the linux kernel, U8500 machine.
3# 3#
4 4
5obj-y := clock.o 5obj-y := clock.o cpu.o devices.o
6obj-$(CONFIG_ARCH_U8500) += cpu-u8500.o 6obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o devices-db5500.o
7obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
7obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o 8obj-$(CONFIG_MACH_U8500_MOP) += board-mop500.o
9obj-$(CONFIG_MACH_U5500) += board-u5500.o
8obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o 10obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 803aec1d6728..072196c57263 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -17,37 +17,14 @@
17#include <linux/amba/pl022.h> 17#include <linux/amba/pl022.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <asm/localtimer.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
23 22
24#include <plat/mtu.h>
25#include <plat/i2c.h> 23#include <plat/i2c.h>
26 24
27#include <mach/hardware.h> 25#include <mach/hardware.h>
28#include <mach/setup.h> 26#include <mach/setup.h>
29 27#include <mach/devices.h>
30#define __MEM_4K_RESOURCE(x) \
31 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
32
33/* These are active devices on this board */
34static struct amba_device uart0_device = {
35 .dev = { .init_name = "uart0" },
36 __MEM_4K_RESOURCE(U8500_UART0_BASE),
37 .irq = {IRQ_UART0, NO_IRQ},
38};
39
40static struct amba_device uart1_device = {
41 .dev = { .init_name = "uart1" },
42 __MEM_4K_RESOURCE(U8500_UART1_BASE),
43 .irq = {IRQ_UART1, NO_IRQ},
44};
45
46static struct amba_device uart2_device = {
47 .dev = { .init_name = "uart2" },
48 __MEM_4K_RESOURCE(U8500_UART2_BASE),
49 .irq = {IRQ_UART2, NO_IRQ},
50};
51 28
52static void ab4500_spi_cs_control(u32 command) 29static void ab4500_spi_cs_control(u32 command)
53{ 30{
@@ -93,55 +70,8 @@ static struct pl022_ssp_controller ssp0_platform_data = {
93 .num_chipselect = 5, 70 .num_chipselect = 5,
94}; 71};
95 72
96static struct amba_device pl022_device = {
97 .dev = {
98 .coherent_dma_mask = ~0,
99 .init_name = "pl022",
100 .platform_data = &ssp0_platform_data,
101 },
102 .res = {
103 .start = U8500_SSP0_BASE,
104 .end = U8500_SSP0_BASE + SZ_4K - 1,
105 .flags = IORESOURCE_MEM,
106 },
107 .irq = {IRQ_SSP0, NO_IRQ },
108 /* ST-Ericsson modified id */
109 .periphid = SSP_PER_ID,
110};
111
112static struct amba_device pl031_device = {
113 .dev = {
114 .init_name = "pl031",
115 },
116 .res = {
117 .start = U8500_RTC_BASE,
118 .end = U8500_RTC_BASE + SZ_4K - 1,
119 .flags = IORESOURCE_MEM,
120 },
121 .irq = {IRQ_RTC_RTT, NO_IRQ},
122};
123
124#define U8500_I2C_RESOURCES(id, size) \
125static struct resource u8500_i2c_resources_##id[] = { \
126 [0] = { \
127 .start = U8500_I2C##id##_BASE, \
128 .end = U8500_I2C##id##_BASE + size - 1, \
129 .flags = IORESOURCE_MEM, \
130 }, \
131 [1] = { \
132 .start = IRQ_I2C##id, \
133 .end = IRQ_I2C##id, \
134 .flags = IORESOURCE_IRQ \
135 } \
136}
137
138U8500_I2C_RESOURCES(0, SZ_4K);
139U8500_I2C_RESOURCES(1, SZ_4K);
140U8500_I2C_RESOURCES(2, SZ_4K);
141U8500_I2C_RESOURCES(3, SZ_4K);
142
143#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ 73#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
144static struct nmk_i2c_controller u8500_i2c_##id = { \ 74static struct nmk_i2c_controller u8500_i2c##id##_data = { \
145 /* \ 75 /* \
146 * slave data setup time, which is \ 76 * slave data setup time, which is \
147 * 250 ns,100ns,10ns which is 14,6,2 \ 77 * 250 ns,100ns,10ns which is 14,6,2 \
@@ -169,58 +99,32 @@ U8500_I2C_CONTROLLER(1, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
169U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 99U8500_I2C_CONTROLLER(2, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
170U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD); 100U8500_I2C_CONTROLLER(3, 0xe, 1, 1, 100000, I2C_FREQ_MODE_STANDARD);
171 101
172#define U8500_I2C_PDEVICE(cid) \
173static struct platform_device i2c_controller##cid = { \
174 .name = "nmk-i2c", \
175 .id = cid, \
176 .num_resources = 2, \
177 .resource = u8500_i2c_resources_##cid, \
178 .dev = { \
179 .platform_data = &u8500_i2c_##cid \
180 } \
181}
182
183U8500_I2C_PDEVICE(0);
184U8500_I2C_PDEVICE(1);
185U8500_I2C_PDEVICE(2);
186U8500_I2C_PDEVICE(3);
187
188static struct amba_device *amba_devs[] __initdata = { 102static struct amba_device *amba_devs[] __initdata = {
189 &uart0_device, 103 &ux500_uart0_device,
190 &uart1_device, 104 &ux500_uart1_device,
191 &uart2_device, 105 &ux500_uart2_device,
192 &pl022_device, 106 &u8500_ssp0_device,
193 &pl031_device,
194}; 107};
195 108
196/* add any platform devices here - TODO */ 109/* add any platform devices here - TODO */
197static struct platform_device *platform_devs[] __initdata = { 110static struct platform_device *platform_devs[] __initdata = {
198 &i2c_controller0, 111 &u8500_i2c0_device,
199 &i2c_controller1, 112 &ux500_i2c1_device,
200 &i2c_controller2, 113 &ux500_i2c2_device,
201 &i2c_controller3, 114 &ux500_i2c3_device,
202};
203
204static void __init u8500_timer_init(void)
205{
206#ifdef CONFIG_LOCAL_TIMERS
207 /* Setup the local timer base */
208 twd_base = __io_address(U8500_TWD_BASE);
209#endif
210 /* Setup the MTU base */
211 mtu_base = __io_address(U8500_MTU0_BASE);
212
213 nmdk_timer_init();
214}
215
216static struct sys_timer u8500_timer = {
217 .init = u8500_timer_init,
218}; 115};
219 116
220static void __init u8500_init_machine(void) 117static void __init u8500_init_machine(void)
221{ 118{
222 int i; 119 int i;
223 120
121 u8500_i2c0_device.dev.platform_data = &u8500_i2c0_data;
122 ux500_i2c1_device.dev.platform_data = &u8500_i2c1_data;
123 ux500_i2c2_device.dev.platform_data = &u8500_i2c2_data;
124 ux500_i2c3_device.dev.platform_data = &u8500_i2c3_data;
125
126 u8500_ssp0_device.dev.platform_data = &ssp0_platform_data;
127
224 /* Register the active AMBA devices on this board */ 128 /* Register the active AMBA devices on this board */
225 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) 129 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
226 amba_device_register(amba_devs[i], &iomem_resource); 130 amba_device_register(amba_devs[i], &iomem_resource);
@@ -239,8 +143,8 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
239 .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc, 143 .io_pg_offst = (IO_ADDRESS(U8500_UART2_BASE) >> 18) & 0xfffc,
240 .boot_params = 0x100, 144 .boot_params = 0x100,
241 .map_io = u8500_map_io, 145 .map_io = u8500_map_io,
242 .init_irq = u8500_init_irq, 146 .init_irq = ux500_init_irq,
243 /* we re-use nomadik timer here */ 147 /* we re-use nomadik timer here */
244 .timer = &u8500_timer, 148 .timer = &ux500_timer,
245 .init_machine = u8500_init_machine, 149 .init_machine = u8500_init_machine,
246MACHINE_END 150MACHINE_END
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
new file mode 100644
index 000000000000..4430e69cf538
--- /dev/null
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/init.h>
9#include <linux/platform_device.h>
10#include <linux/amba/bus.h>
11#include <linux/gpio.h>
12
13#include <asm/mach/arch.h>
14#include <asm/mach-types.h>
15
16#include <mach/hardware.h>
17#include <mach/devices.h>
18#include <mach/setup.h>
19
20static struct amba_device *amba_board_devs[] __initdata = {
21 &ux500_uart0_device,
22 &ux500_uart1_device,
23 &ux500_uart2_device,
24};
25
26static void __init u5500_init_machine(void)
27{
28 u5500_init_devices();
29
30 amba_add_devices(amba_board_devs, ARRAY_SIZE(amba_board_devs));
31}
32
33MACHINE_START(U8500, "ST-Ericsson U5500 Platform")
34 .phys_io = UX500_UART0_BASE,
35 .io_pg_offst = (IO_ADDRESS(UX500_UART0_BASE) >> 18) & 0xfffc,
36 .boot_params = 0x00000100,
37 .map_io = u5500_map_io,
38 .init_irq = ux500_init_irq,
39 .timer = &ux500_timer,
40 .init_machine = u5500_init_machine,
41MACHINE_END
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index 8359a73d0041..1b2c9890e8b4 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 ST-Ericsson 2 * Copyright (C) 2009 ST-Ericsson
3 * heavily based on realview platform 3 * Copyright (C) 2009 STMicroelectronics
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as 6 * it under the terms of the GNU General Public License version 2 as
@@ -12,33 +12,130 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/err.h> 13#include <linux/err.h>
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/mutex.h> 15#include <linux/io.h>
16 16
17#include <asm/clkdev.h> 17#include <asm/clkdev.h>
18 18
19/* currently the clk structure 19#include <mach/hardware.h>
20 * just supports rate. This would 20#include "clock.h"
21 * be extended as and when new devices are 21
22 * added - TODO 22#define PRCC_PCKEN 0x00
23 */ 23#define PRCC_PCKDIS 0x04
24struct clk { 24#define PRCC_KCKEN 0x08
25 unsigned long rate; 25#define PRCC_KCKDIS 0x0C
26}; 26
27#define PRCM_YYCLKEN0_MGT_SET 0x510
28#define PRCM_YYCLKEN1_MGT_SET 0x514
29#define PRCM_YYCLKEN0_MGT_CLR 0x518
30#define PRCM_YYCLKEN1_MGT_CLR 0x51C
31#define PRCM_YYCLKEN0_MGT_VAL 0x520
32#define PRCM_YYCLKEN1_MGT_VAL 0x524
33
34#define PRCM_SVAMMDSPCLK_MGT 0x008
35#define PRCM_SIAMMDSPCLK_MGT 0x00C
36#define PRCM_SGACLK_MGT 0x014
37#define PRCM_UARTCLK_MGT 0x018
38#define PRCM_MSP02CLK_MGT 0x01C
39#define PRCM_MSP1CLK_MGT 0x288
40#define PRCM_I2CCLK_MGT 0x020
41#define PRCM_SDMMCCLK_MGT 0x024
42#define PRCM_SLIMCLK_MGT 0x028
43#define PRCM_PER1CLK_MGT 0x02C
44#define PRCM_PER2CLK_MGT 0x030
45#define PRCM_PER3CLK_MGT 0x034
46#define PRCM_PER5CLK_MGT 0x038
47#define PRCM_PER6CLK_MGT 0x03C
48#define PRCM_PER7CLK_MGT 0x040
49#define PRCM_LCDCLK_MGT 0x044
50#define PRCM_BMLCLK_MGT 0x04C
51#define PRCM_HSITXCLK_MGT 0x050
52#define PRCM_HSIRXCLK_MGT 0x054
53#define PRCM_HDMICLK_MGT 0x058
54#define PRCM_APEATCLK_MGT 0x05C
55#define PRCM_APETRACECLK_MGT 0x060
56#define PRCM_MCDECLK_MGT 0x064
57#define PRCM_IPI2CCLK_MGT 0x068
58#define PRCM_DSIALTCLK_MGT 0x06C
59#define PRCM_DMACLK_MGT 0x074
60#define PRCM_B2R2CLK_MGT 0x078
61#define PRCM_TVCLK_MGT 0x07C
62#define PRCM_UNIPROCLK_MGT 0x278
63#define PRCM_SSPCLK_MGT 0x280
64#define PRCM_RNGCLK_MGT 0x284
65#define PRCM_UICCCLK_MGT 0x27C
66
67#define PRCM_MGT_ENABLE (1 << 8)
68
69static DEFINE_SPINLOCK(clocks_lock);
70
71static void __clk_enable(struct clk *clk)
72{
73 if (clk->enabled++ == 0) {
74 if (clk->parent_cluster)
75 __clk_enable(clk->parent_cluster);
76
77 if (clk->parent_periph)
78 __clk_enable(clk->parent_periph);
79
80 if (clk->ops && clk->ops->enable)
81 clk->ops->enable(clk);
82 }
83}
27 84
28int clk_enable(struct clk *clk) 85int clk_enable(struct clk *clk)
29{ 86{
87 unsigned long flags;
88
89 spin_lock_irqsave(&clocks_lock, flags);
90 __clk_enable(clk);
91 spin_unlock_irqrestore(&clocks_lock, flags);
92
30 return 0; 93 return 0;
31} 94}
32EXPORT_SYMBOL(clk_enable); 95EXPORT_SYMBOL(clk_enable);
33 96
97static void __clk_disable(struct clk *clk)
98{
99 if (--clk->enabled == 0) {
100 if (clk->ops && clk->ops->disable)
101 clk->ops->disable(clk);
102
103 if (clk->parent_periph)
104 __clk_disable(clk->parent_periph);
105
106 if (clk->parent_cluster)
107 __clk_disable(clk->parent_cluster);
108 }
109}
110
34void clk_disable(struct clk *clk) 111void clk_disable(struct clk *clk)
35{ 112{
113 unsigned long flags;
114
115 WARN_ON(!clk->enabled);
116
117 spin_lock_irqsave(&clocks_lock, flags);
118 __clk_disable(clk);
119 spin_unlock_irqrestore(&clocks_lock, flags);
36} 120}
37EXPORT_SYMBOL(clk_disable); 121EXPORT_SYMBOL(clk_disable);
38 122
39unsigned long clk_get_rate(struct clk *clk) 123unsigned long clk_get_rate(struct clk *clk)
40{ 124{
41 return clk->rate; 125 unsigned long rate;
126
127 if (clk->ops && clk->ops->get_rate)
128 return clk->ops->get_rate(clk);
129
130 rate = clk->rate;
131 if (!rate) {
132 if (clk->parent_periph)
133 rate = clk_get_rate(clk->parent_periph);
134 else if (clk->parent_cluster)
135 rate = clk_get_rate(clk->parent_cluster);
136 }
137
138 return rate;
42} 139}
43EXPORT_SYMBOL(clk_get_rate); 140EXPORT_SYMBOL(clk_get_rate);
44 141
@@ -56,37 +153,373 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
56} 153}
57EXPORT_SYMBOL(clk_set_rate); 154EXPORT_SYMBOL(clk_set_rate);
58 155
59/* ssp clock */ 156static void clk_prcmu_enable(struct clk *clk)
60static struct clk ssp_clk = { 157{
61 .rate = 48000000, 158 void __iomem *cg_set_reg = __io_address(U8500_PRCMU_BASE)
159 + PRCM_YYCLKEN0_MGT_SET + clk->prcmu_cg_off;
160
161 writel(1 << clk->prcmu_cg_bit, cg_set_reg);
162}
163
164static void clk_prcmu_disable(struct clk *clk)
165{
166 void __iomem *cg_clr_reg = __io_address(U8500_PRCMU_BASE)
167 + PRCM_YYCLKEN0_MGT_CLR + clk->prcmu_cg_off;
168
169 writel(1 << clk->prcmu_cg_bit, cg_clr_reg);
170}
171
172/* ED doesn't have the combined set/clr registers */
173static void clk_prcmu_ed_enable(struct clk *clk)
174{
175 void __iomem *addr = __io_address(U8500_PRCMU_BASE)
176 + clk->prcmu_cg_mgt;
177
178 writel(readl(addr) | PRCM_MGT_ENABLE, addr);
179}
180
181static void clk_prcmu_ed_disable(struct clk *clk)
182{
183 void __iomem *addr = __io_address(U8500_PRCMU_BASE)
184 + clk->prcmu_cg_mgt;
185
186 writel(readl(addr) & ~PRCM_MGT_ENABLE, addr);
187}
188
189static struct clkops clk_prcmu_ops = {
190 .enable = clk_prcmu_enable,
191 .disable = clk_prcmu_disable,
62}; 192};
63 193
64/* fixed clock */ 194static unsigned int clkrst_base[] = {
65static struct clk f38_clk = { 195 [1] = U8500_CLKRST1_BASE,
66 .rate = 38400000, 196 [2] = U8500_CLKRST2_BASE,
197 [3] = U8500_CLKRST3_BASE,
198 [5] = U8500_CLKRST5_BASE,
199 [6] = U8500_CLKRST6_BASE,
200 [7] = U8500_CLKRST7_BASE_ED,
67}; 201};
68 202
69static struct clk_lookup lookups[] = { 203static void clk_prcc_enable(struct clk *clk)
70 { 204{
71 /* UART0 */ 205 void __iomem *addr = __io_address(clkrst_base[clk->cluster]);
72 .dev_id = "uart0", 206
73 .clk = &f38_clk, 207 if (clk->prcc_kernel != -1)
74 }, { /* UART1 */ 208 writel(1 << clk->prcc_kernel, addr + PRCC_KCKEN);
75 .dev_id = "uart1", 209
76 .clk = &f38_clk, 210 if (clk->prcc_bus != -1)
77 }, { /* UART2 */ 211 writel(1 << clk->prcc_bus, addr + PRCC_PCKEN);
78 .dev_id = "uart2", 212}
79 .clk = &f38_clk, 213
80 }, { /* SSP */ 214static void clk_prcc_disable(struct clk *clk)
81 .dev_id = "pl022", 215{
82 .clk = &ssp_clk, 216 void __iomem *addr = __io_address(clkrst_base[clk->cluster]);
83 } 217
218 if (clk->prcc_bus != -1)
219 writel(1 << clk->prcc_bus, addr + PRCC_PCKDIS);
220
221 if (clk->prcc_kernel != -1)
222 writel(1 << clk->prcc_kernel, addr + PRCC_KCKDIS);
223}
224
225static struct clkops clk_prcc_ops = {
226 .enable = clk_prcc_enable,
227 .disable = clk_prcc_disable,
228};
229
230static struct clk clk_32khz = {
231 .rate = 32000,
232};
233
234/*
235 * PRCMU level clock gating
236 */
237
238/* Bank 0 */
239static DEFINE_PRCMU_CLK(svaclk, 0x0, 2, SVAMMDSPCLK);
240static DEFINE_PRCMU_CLK(siaclk, 0x0, 3, SIAMMDSPCLK);
241static DEFINE_PRCMU_CLK(sgaclk, 0x0, 4, SGACLK);
242static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000);
243static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK);
244static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */
245static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000);
246static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 50000000);
247static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK);
248static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK);
249static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK);
250static DEFINE_PRCMU_CLK(per3clk, 0x0, 13, PER3CLK);
251static DEFINE_PRCMU_CLK(per5clk, 0x0, 14, PER5CLK);
252static DEFINE_PRCMU_CLK_RATE(per6clk, 0x0, 15, PER6CLK, 133330000);
253static DEFINE_PRCMU_CLK_RATE(per7clk, 0x0, 16, PER7CLK, 100000000);
254static DEFINE_PRCMU_CLK(lcdclk, 0x0, 17, LCDCLK);
255static DEFINE_PRCMU_CLK(bmlclk, 0x0, 18, BMLCLK);
256static DEFINE_PRCMU_CLK(hsitxclk, 0x0, 19, HSITXCLK);
257static DEFINE_PRCMU_CLK(hsirxclk, 0x0, 20, HSIRXCLK);
258static DEFINE_PRCMU_CLK(hdmiclk, 0x0, 21, HDMICLK);
259static DEFINE_PRCMU_CLK(apeatclk, 0x0, 22, APEATCLK);
260static DEFINE_PRCMU_CLK(apetraceclk, 0x0, 23, APETRACECLK);
261static DEFINE_PRCMU_CLK(mcdeclk, 0x0, 24, MCDECLK);
262static DEFINE_PRCMU_CLK(ipi2clk, 0x0, 25, IPI2CCLK);
263static DEFINE_PRCMU_CLK(dsialtclk, 0x0, 26, DSIALTCLK); /* v1 */
264static DEFINE_PRCMU_CLK(dmaclk, 0x0, 27, DMACLK);
265static DEFINE_PRCMU_CLK(b2r2clk, 0x0, 28, B2R2CLK);
266static DEFINE_PRCMU_CLK(tvclk, 0x0, 29, TVCLK);
267static DEFINE_PRCMU_CLK(uniproclk, 0x0, 30, UNIPROCLK); /* v1 */
268static DEFINE_PRCMU_CLK_RATE(sspclk, 0x0, 31, SSPCLK, 48000000); /* v1 */
269
270/* Bank 1 */
271static DEFINE_PRCMU_CLK(rngclk, 0x4, 0, RNGCLK); /* v1 */
272static DEFINE_PRCMU_CLK(uiccclk, 0x4, 1, UICCCLK); /* v1 */
273
274/*
275 * PRCC level clock gating
276 * Format: per#, clk, PCKEN bit, KCKEN bit, parent
277 */
278
279/* Peripheral Cluster #1 */
280static DEFINE_PRCC_CLK(1, i2c4, 10, 9, &clk_i2cclk);
281static DEFINE_PRCC_CLK(1, gpio0, 9, -1, NULL);
282static DEFINE_PRCC_CLK(1, slimbus0, 8, 8, &clk_slimclk);
283static DEFINE_PRCC_CLK(1, spi3_ed, 7, 7, NULL);
284static DEFINE_PRCC_CLK(1, spi3_v1, 7, -1, NULL);
285static DEFINE_PRCC_CLK(1, i2c2, 6, 6, &clk_i2cclk);
286static DEFINE_PRCC_CLK(1, sdi0, 5, 5, &clk_sdmmcclk);
287static DEFINE_PRCC_CLK(1, msp1_ed, 4, 4, &clk_msp02clk);
288static DEFINE_PRCC_CLK(1, msp1_v1, 4, 4, &clk_msp1clk);
289static DEFINE_PRCC_CLK(1, msp0, 3, 3, &clk_msp02clk);
290static DEFINE_PRCC_CLK(1, i2c1, 2, 2, &clk_i2cclk);
291static DEFINE_PRCC_CLK(1, uart1, 1, 1, &clk_uartclk);
292static DEFINE_PRCC_CLK(1, uart0, 0, 0, &clk_uartclk);
293
294/* Peripheral Cluster #2 */
295
296static DEFINE_PRCC_CLK(2, gpio1_ed, 12, -1, NULL);
297static DEFINE_PRCC_CLK(2, ssitx_ed, 11, -1, NULL);
298static DEFINE_PRCC_CLK(2, ssirx_ed, 10, -1, NULL);
299static DEFINE_PRCC_CLK(2, spi0_ed, 9, -1, NULL);
300static DEFINE_PRCC_CLK(2, sdi3_ed, 8, 6, &clk_sdmmcclk);
301static DEFINE_PRCC_CLK(2, sdi1_ed, 7, 5, &clk_sdmmcclk);
302static DEFINE_PRCC_CLK(2, msp2_ed, 6, 4, &clk_msp02clk);
303static DEFINE_PRCC_CLK(2, sdi4_ed, 4, 2, &clk_sdmmcclk);
304static DEFINE_PRCC_CLK(2, pwl_ed, 3, 1, NULL);
305static DEFINE_PRCC_CLK(2, spi1_ed, 2, -1, NULL);
306static DEFINE_PRCC_CLK(2, spi2_ed, 1, -1, NULL);
307static DEFINE_PRCC_CLK(2, i2c3_ed, 0, 0, &clk_i2cclk);
308
309static DEFINE_PRCC_CLK(2, gpio1_v1, 11, -1, NULL);
310static DEFINE_PRCC_CLK(2, ssitx_v1, 10, 7, NULL);
311static DEFINE_PRCC_CLK(2, ssirx_v1, 9, 6, NULL);
312static DEFINE_PRCC_CLK(2, spi0_v1, 8, -1, NULL);
313static DEFINE_PRCC_CLK(2, sdi3_v1, 7, 5, &clk_sdmmcclk);
314static DEFINE_PRCC_CLK(2, sdi1_v1, 6, 4, &clk_sdmmcclk);
315static DEFINE_PRCC_CLK(2, msp2_v1, 5, 3, &clk_msp02clk);
316static DEFINE_PRCC_CLK(2, sdi4_v1, 4, 2, &clk_sdmmcclk);
317static DEFINE_PRCC_CLK(2, pwl_v1, 3, 1, NULL);
318static DEFINE_PRCC_CLK(2, spi1_v1, 2, -1, NULL);
319static DEFINE_PRCC_CLK(2, spi2_v1, 1, -1, NULL);
320static DEFINE_PRCC_CLK(2, i2c3_v1, 0, 0, &clk_i2cclk);
321
322/* Peripheral Cluster #3 */
323static DEFINE_PRCC_CLK(3, gpio2, 8, -1, NULL);
324static DEFINE_PRCC_CLK(3, sdi5, 7, 7, &clk_sdmmcclk);
325static DEFINE_PRCC_CLK(3, uart2, 6, 6, &clk_uartclk);
326static DEFINE_PRCC_CLK(3, ske, 5, 5, &clk_32khz);
327static DEFINE_PRCC_CLK(3, sdi2, 4, 4, &clk_sdmmcclk);
328static DEFINE_PRCC_CLK(3, i2c0, 3, 3, &clk_i2cclk);
329static DEFINE_PRCC_CLK(3, ssp1_ed, 2, 2, &clk_i2cclk);
330static DEFINE_PRCC_CLK(3, ssp0_ed, 1, 1, &clk_i2cclk);
331static DEFINE_PRCC_CLK(3, ssp1_v1, 2, 2, &clk_sspclk);
332static DEFINE_PRCC_CLK(3, ssp0_v1, 1, 1, &clk_sspclk);
333static DEFINE_PRCC_CLK(3, fsmc, 0, -1, NULL);
334
335/* Peripheral Cluster #4 is in the always on domain */
336
337/* Peripheral Cluster #5 */
338static DEFINE_PRCC_CLK(5, gpio3, 1, -1, NULL);
339static DEFINE_PRCC_CLK(5, usb_ed, 0, 0, &clk_i2cclk);
340static DEFINE_PRCC_CLK(5, usb_v1, 0, 0, NULL);
341
342/* Peripheral Cluster #6 */
343
344static DEFINE_PRCC_CLK(6, mtu1_v1, 8, -1, NULL);
345static DEFINE_PRCC_CLK(6, mtu0_v1, 7, -1, NULL);
346static DEFINE_PRCC_CLK(6, cfgreg_v1, 6, 6, NULL);
347static DEFINE_PRCC_CLK(6, dmc_ed, 6, 6, NULL);
348static DEFINE_PRCC_CLK(6, hash1, 5, -1, NULL);
349static DEFINE_PRCC_CLK(6, unipro_v1, 4, 1, &clk_uniproclk);
350static DEFINE_PRCC_CLK(6, cryp1_ed, 4, -1, NULL);
351static DEFINE_PRCC_CLK(6, pka, 3, -1, NULL);
352static DEFINE_PRCC_CLK(6, hash0, 2, -1, NULL);
353static DEFINE_PRCC_CLK(6, cryp0, 1, -1, NULL);
354static DEFINE_PRCC_CLK(6, rng_ed, 0, 0, &clk_i2cclk);
355static DEFINE_PRCC_CLK(6, rng_v1, 0, 0, &clk_rngclk);
356
357/* Peripheral Cluster #7 */
358
359static DEFINE_PRCC_CLK(7, tzpc0_ed, 4, -1, NULL);
360static DEFINE_PRCC_CLK(7, mtu1_ed, 3, -1, NULL);
361static DEFINE_PRCC_CLK(7, mtu0_ed, 2, -1, NULL);
362static DEFINE_PRCC_CLK(7, wdg_ed, 1, -1, NULL);
363static DEFINE_PRCC_CLK(7, cfgreg_ed, 0, -1, NULL);
364
365static struct clk_lookup u8500_common_clks[] = {
366 /* Peripheral Cluster #1 */
367 CLK(gpio0, "gpio.0", NULL),
368 CLK(gpio0, "gpio.1", NULL),
369 CLK(slimbus0, "slimbus0", NULL),
370 CLK(i2c2, "nmk-i2c.2", NULL),
371 CLK(sdi0, "sdi0", NULL),
372 CLK(msp0, "msp0", NULL),
373 CLK(i2c1, "nmk-i2c.1", NULL),
374 CLK(uart1, "uart1", NULL),
375 CLK(uart0, "uart0", NULL),
376
377 /* Peripheral Cluster #3 */
378 CLK(gpio2, "gpio.2", NULL),
379 CLK(gpio2, "gpio.3", NULL),
380 CLK(gpio2, "gpio.4", NULL),
381 CLK(gpio2, "gpio.5", NULL),
382 CLK(sdi5, "sdi5", NULL),
383 CLK(uart2, "uart2", NULL),
384 CLK(ske, "ske", NULL),
385 CLK(sdi2, "sdi2", NULL),
386 CLK(i2c0, "nmk-i2c.0", NULL),
387 CLK(fsmc, "fsmc", NULL),
388
389 /* Peripheral Cluster #5 */
390 CLK(gpio3, "gpio.8", NULL),
391
392 /* Peripheral Cluster #6 */
393 CLK(hash1, "hash1", NULL),
394 CLK(pka, "pka", NULL),
395 CLK(hash0, "hash0", NULL),
396 CLK(cryp0, "cryp0", NULL),
397
398 /* PRCMU level clock gating */
399
400 /* Bank 0 */
401 CLK(svaclk, "sva", NULL),
402 CLK(siaclk, "sia", NULL),
403 CLK(sgaclk, "sga", NULL),
404 CLK(slimclk, "slim", NULL),
405 CLK(lcdclk, "lcd", NULL),
406 CLK(bmlclk, "bml", NULL),
407 CLK(hsitxclk, "stm-hsi.0", NULL),
408 CLK(hsirxclk, "stm-hsi.1", NULL),
409 CLK(hdmiclk, "hdmi", NULL),
410 CLK(apeatclk, "apeat", NULL),
411 CLK(apetraceclk, "apetrace", NULL),
412 CLK(mcdeclk, "mcde", NULL),
413 CLK(ipi2clk, "ipi2", NULL),
414 CLK(dmaclk, "dma40", NULL),
415 CLK(b2r2clk, "b2r2", NULL),
416 CLK(tvclk, "tv", NULL),
417};
418
419static struct clk_lookup u8500_ed_clks[] = {
420 /* Peripheral Cluster #1 */
421 CLK(spi3_ed, "spi3", NULL),
422 CLK(msp1_ed, "msp1", NULL),
423
424 /* Peripheral Cluster #2 */
425 CLK(gpio1_ed, "gpio.6", NULL),
426 CLK(gpio1_ed, "gpio.7", NULL),
427 CLK(ssitx_ed, "ssitx", NULL),
428 CLK(ssirx_ed, "ssirx", NULL),
429 CLK(spi0_ed, "spi0", NULL),
430 CLK(sdi3_ed, "sdi3", NULL),
431 CLK(sdi1_ed, "sdi1", NULL),
432 CLK(msp2_ed, "msp2", NULL),
433 CLK(sdi4_ed, "sdi4", NULL),
434 CLK(pwl_ed, "pwl", NULL),
435 CLK(spi1_ed, "spi1", NULL),
436 CLK(spi2_ed, "spi2", NULL),
437 CLK(i2c3_ed, "nmk-i2c.3", NULL),
438
439 /* Peripheral Cluster #3 */
440 CLK(ssp1_ed, "ssp1", NULL),
441 CLK(ssp0_ed, "ssp0", NULL),
442
443 /* Peripheral Cluster #5 */
444 CLK(usb_ed, "musb_hdrc.0", "usb"),
445
446 /* Peripheral Cluster #6 */
447 CLK(dmc_ed, "dmc", NULL),
448 CLK(cryp1_ed, "cryp1", NULL),
449 CLK(rng_ed, "rng", NULL),
450
451 /* Peripheral Cluster #7 */
452 CLK(tzpc0_ed, "tzpc0", NULL),
453 CLK(mtu1_ed, "mtu1", NULL),
454 CLK(mtu0_ed, "mtu0", NULL),
455 CLK(wdg_ed, "wdg", NULL),
456 CLK(cfgreg_ed, "cfgreg", NULL),
457};
458
459static struct clk_lookup u8500_v1_clks[] = {
460 /* Peripheral Cluster #1 */
461 CLK(i2c4, "nmk-i2c.4", NULL),
462 CLK(spi3_v1, "spi3", NULL),
463 CLK(msp1_v1, "msp1", NULL),
464
465 /* Peripheral Cluster #2 */
466 CLK(gpio1_v1, "gpio.6", NULL),
467 CLK(gpio1_v1, "gpio.7", NULL),
468 CLK(ssitx_v1, "ssitx", NULL),
469 CLK(ssirx_v1, "ssirx", NULL),
470 CLK(spi0_v1, "spi0", NULL),
471 CLK(sdi3_v1, "sdi3", NULL),
472 CLK(sdi1_v1, "sdi1", NULL),
473 CLK(msp2_v1, "msp2", NULL),
474 CLK(sdi4_v1, "sdi4", NULL),
475 CLK(pwl_v1, "pwl", NULL),
476 CLK(spi1_v1, "spi1", NULL),
477 CLK(spi2_v1, "spi2", NULL),
478 CLK(i2c3_v1, "nmk-i2c.3", NULL),
479
480 /* Peripheral Cluster #3 */
481 CLK(ssp1_v1, "ssp1", NULL),
482 CLK(ssp0_v1, "ssp0", NULL),
483
484 /* Peripheral Cluster #5 */
485 CLK(usb_v1, "musb_hdrc.0", "usb"),
486
487 /* Peripheral Cluster #6 */
488 CLK(mtu1_v1, "mtu1", NULL),
489 CLK(mtu0_v1, "mtu0", NULL),
490 CLK(cfgreg_v1, "cfgreg", NULL),
491 CLK(hash1, "hash1", NULL),
492 CLK(unipro_v1, "unipro", NULL),
493 CLK(rng_v1, "rng", NULL),
494
495 /* PRCMU level clock gating */
496
497 /* Bank 0 */
498 CLK(uniproclk, "uniproclk", NULL),
499 CLK(dsialtclk, "dsialt", NULL),
500
501 /* Bank 1 */
502 CLK(rngclk, "rng", NULL),
503 CLK(uiccclk, "uicc", NULL),
84}; 504};
85 505
86static int __init clk_init(void) 506static int __init clk_init(void)
87{ 507{
88 /* register the clock lookups */ 508 if (cpu_is_u8500ed()) {
89 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 509 clk_prcmu_ops.enable = clk_prcmu_ed_enable;
510 clk_prcmu_ops.disable = clk_prcmu_ed_disable;
511 } else if (cpu_is_u5500()) {
512 /* Clock tree for U5500 not implemented yet */
513 clk_prcc_ops.enable = clk_prcc_ops.disable = NULL;
514 clk_prcmu_ops.enable = clk_prcmu_ops.disable = NULL;
515 }
516
517 clkdev_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks));
518 if (cpu_is_u8500ed())
519 clkdev_add_table(u8500_ed_clks, ARRAY_SIZE(u8500_ed_clks));
520 else
521 clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks));
522
90 return 0; 523 return 0;
91} 524}
92arch_initcall(clk_init); 525arch_initcall(clk_init);
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h
new file mode 100644
index 000000000000..e4f99b65026f
--- /dev/null
+++ b/arch/arm/mach-ux500/clock.h
@@ -0,0 +1,125 @@
1/*
2 * Copyright (C) 2010 ST-Ericsson
3 * Copyright (C) 2009 STMicroelectronics
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10/**
11 * struct clkops - ux500 clock operations
12 * @enable: function to enable the clock
13 * @disable: function to disable the clock
14 * @get_rate: function to get the current clock rate
15 *
16 * This structure contains function pointers to functions that will be used to
17 * control the clock. All of these functions are optional. If get_rate is
18 * NULL, the rate in the struct clk will be used.
19 */
20struct clkops {
21 void (*enable) (struct clk *);
22 void (*disable) (struct clk *);
23 unsigned long (*get_rate) (struct clk *);
24};
25
26/**
27 * struct clk - ux500 clock structure
28 * @ops: pointer to clkops struct used to control this clock
29 * @name: name, for debugging
30 * @enabled: refcount. positive if enabled, zero if disabled
31 * @rate: fixed rate for clocks which don't implement
32 * ops->getrate
33 * @prcmu_cg_off: address offset of the combined enable/disable register
34 * (used on u8500v1)
35 * @prcmu_cg_bit: bit in the combined enable/disable register (used on
36 * u8500v1)
37 * @prcmu_cg_mgt: address of the enable/disable register (used on
38 * u8500ed)
39 * @cluster: peripheral cluster number
40 * @prcc_bus: bit for the bus clock in the peripheral's CLKRST
41 * @prcc_kernel: bit for the kernel clock in the peripheral's CLKRST.
42 * -1 if no kernel clock exists.
43 * @parent_cluster: pointer to parent's cluster clk struct
44 * @parent_periph: pointer to parent's peripheral clk struct
45 *
46 * Peripherals are organised into clusters, and each cluster has an associated
47 * bus clock. Some peripherals also have a parent peripheral clock.
48 *
49 * In order to enable a clock for a peripheral, we need to enable:
50 * (1) the parent cluster (bus) clock at the PRCMU level
51 * (2) the parent peripheral clock (if any) at the PRCMU level
52 * (3) the peripheral's bus & kernel clock at the PRCC level
53 *
54 * (1) and (2) are handled by defining clk structs (DEFINE_PRCMU_CLK) for each
55 * of the cluster and peripheral clocks, and hooking these as the parents of
56 * the individual peripheral clocks.
57 *
58 * (3) is handled by specifying the bits in the PRCC control registers required
59 * to enable these clocks and modifying them in the ->enable and
60 * ->disable callbacks of the peripheral clocks (DEFINE_PRCC_CLK).
61 *
62 * This structure describes both the PRCMU-level clocks and PRCC-level clocks.
63 * The prcmu_* fields are only used for the PRCMU clocks, and the cluster,
64 * prcc, and parent pointers are only used for the PRCC-level clocks.
65 */
66struct clk {
67 const struct clkops *ops;
68 const char *name;
69 unsigned int enabled;
70
71 unsigned long rate;
72 struct list_head list;
73
74 /* These three are only for PRCMU clks */
75
76 unsigned int prcmu_cg_off;
77 unsigned int prcmu_cg_bit;
78 unsigned int prcmu_cg_mgt;
79
80 /* The rest are only for PRCC clks */
81
82 int cluster;
83 unsigned int prcc_bus;
84 unsigned int prcc_kernel;
85
86 struct clk *parent_cluster;
87 struct clk *parent_periph;
88};
89
90#define DEFINE_PRCMU_CLK(_name, _cg_off, _cg_bit, _reg) \
91struct clk clk_##_name = { \
92 .name = #_name, \
93 .ops = &clk_prcmu_ops, \
94 .prcmu_cg_off = _cg_off, \
95 .prcmu_cg_bit = _cg_bit, \
96 .prcmu_cg_mgt = PRCM_##_reg##_MGT \
97 }
98
99#define DEFINE_PRCMU_CLK_RATE(_name, _cg_off, _cg_bit, _reg, _rate) \
100struct clk clk_##_name = { \
101 .name = #_name, \
102 .ops = &clk_prcmu_ops, \
103 .prcmu_cg_off = _cg_off, \
104 .prcmu_cg_bit = _cg_bit, \
105 .rate = _rate, \
106 .prcmu_cg_mgt = PRCM_##_reg##_MGT \
107 }
108
109#define DEFINE_PRCC_CLK(_pclust, _name, _bus_en, _kernel_en, _kernclk) \
110struct clk clk_##_name = { \
111 .name = #_name, \
112 .ops = &clk_prcc_ops, \
113 .cluster = _pclust, \
114 .prcc_bus = _bus_en, \
115 .prcc_kernel = _kernel_en, \
116 .parent_cluster = &clk_per##_pclust##clk, \
117 .parent_periph = _kernclk \
118 }
119
120#define CLK(_clk, _devname, _conname) \
121 { \
122 .clk = &clk_##_clk, \
123 .dev_id = _devname, \
124 .con_id = _conname, \
125 }
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c
new file mode 100644
index 000000000000..6a3ac4539f16
--- /dev/null
+++ b/arch/arm/mach-ux500/cpu-db5500.c
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/platform_device.h>
9#include <linux/amba/bus.h>
10#include <linux/io.h>
11
12#include <asm/mach/map.h>
13
14#include <mach/hardware.h>
15#include <mach/devices.h>
16#include <mach/setup.h>
17
18static struct map_desc u5500_io_desc[] __initdata = {
19 __IO_DEV_DESC(U5500_GPIO0_BASE, SZ_4K),
20 __IO_DEV_DESC(U5500_GPIO1_BASE, SZ_4K),
21 __IO_DEV_DESC(U5500_GPIO2_BASE, SZ_4K),
22 __IO_DEV_DESC(U5500_GPIO3_BASE, SZ_4K),
23 __IO_DEV_DESC(U5500_GPIO4_BASE, SZ_4K),
24};
25
26static struct platform_device *u5500_platform_devs[] __initdata = {
27 &u5500_gpio_devs[0],
28 &u5500_gpio_devs[1],
29 &u5500_gpio_devs[2],
30 &u5500_gpio_devs[3],
31 &u5500_gpio_devs[4],
32 &u5500_gpio_devs[5],
33 &u5500_gpio_devs[6],
34 &u5500_gpio_devs[7],
35};
36
37void __init u5500_map_io(void)
38{
39 ux500_map_io();
40
41 iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc));
42}
43
44void __init u5500_init_devices(void)
45{
46 ux500_init_devices();
47
48 platform_add_devices(u5500_platform_devs,
49 ARRAY_SIZE(u5500_platform_devs));
50}
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 397bc1f9ed94..d04299f3b6b5 100644
--- a/arch/arm/mach-ux500/cpu-u8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -13,44 +13,55 @@
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/gpio.h>
16#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/io.h>
17 19
18#include <asm/hardware/gic.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20#include <mach/hardware.h> 21#include <mach/hardware.h>
22#include <mach/setup.h>
23#include <mach/devices.h>
21 24
22/* add any platform devices here - TODO */
23static struct platform_device *platform_devs[] __initdata = { 25static struct platform_device *platform_devs[] __initdata = {
24 /* yet to be added, add i2c0, gpio.. */ 26 &u8500_gpio_devs[0],
27 &u8500_gpio_devs[1],
28 &u8500_gpio_devs[2],
29 &u8500_gpio_devs[3],
30 &u8500_gpio_devs[4],
31 &u8500_gpio_devs[5],
32 &u8500_gpio_devs[6],
33 &u8500_gpio_devs[7],
34 &u8500_gpio_devs[8],
25}; 35};
26 36
27#define __IO_DEV_DESC(x, sz) { \
28 .virtual = IO_ADDRESS(x), \
29 .pfn = __phys_to_pfn(x), \
30 .length = sz, \
31 .type = MT_DEVICE, \
32}
33
34/* minimum static i/o mapping required to boot U8500 platforms */ 37/* minimum static i/o mapping required to boot U8500 platforms */
35static struct map_desc u8500_io_desc[] __initdata = { 38static struct map_desc u8500_io_desc[] __initdata = {
36 __IO_DEV_DESC(U8500_UART2_BASE, SZ_4K), 39 __IO_DEV_DESC(U8500_PRCMU_BASE, SZ_4K),
37 __IO_DEV_DESC(U8500_GIC_CPU_BASE, SZ_4K), 40 __IO_DEV_DESC(U8500_GPIO0_BASE, SZ_4K),
38 __IO_DEV_DESC(U8500_GIC_DIST_BASE, SZ_4K), 41 __IO_DEV_DESC(U8500_GPIO1_BASE, SZ_4K),
42 __IO_DEV_DESC(U8500_GPIO2_BASE, SZ_4K),
43 __IO_DEV_DESC(U8500_GPIO3_BASE, SZ_4K),
44};
45
46static struct map_desc u8500ed_io_desc[] __initdata = {
47 __IO_DEV_DESC(U8500_MTU0_BASE_ED, SZ_4K),
48 __IO_DEV_DESC(U8500_CLKRST7_BASE_ED, SZ_8K),
49};
50
51static struct map_desc u8500v1_io_desc[] __initdata = {
39 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K), 52 __IO_DEV_DESC(U8500_MTU0_BASE, SZ_4K),
40 __IO_DEV_DESC(U8500_TWD_BASE, SZ_4K),
41 __IO_DEV_DESC(U8500_SCU_BASE, SZ_4K),
42 __IO_DEV_DESC(U8500_BACKUPRAM0_BASE, SZ_8K),
43}; 53};
44 54
45void __init u8500_map_io(void) 55void __init u8500_map_io(void)
46{ 56{
57 ux500_map_io();
58
47 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 59 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
48}
49 60
50void __init u8500_init_irq(void) 61 if (cpu_is_u8500ed())
51{ 62 iotable_init(u8500ed_io_desc, ARRAY_SIZE(u8500ed_io_desc));
52 gic_dist_init(0, __io_address(U8500_GIC_DIST_BASE), 29); 63 else
53 gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); 64 iotable_init(u8500v1_io_desc, ARRAY_SIZE(u8500v1_io_desc));
54} 65}
55 66
56/* 67/*
@@ -58,6 +69,8 @@ void __init u8500_init_irq(void)
58 */ 69 */
59void __init u8500_init_devices(void) 70void __init u8500_init_devices(void)
60{ 71{
72 ux500_init_devices();
73
61 /* Register the platform devices */ 74 /* Register the platform devices */
62 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 75 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
63 76
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
new file mode 100644
index 000000000000..d81ad023963c
--- /dev/null
+++ b/arch/arm/mach-ux500/cpu.c
@@ -0,0 +1,99 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/platform_device.h>
9#include <linux/amba/bus.h>
10#include <linux/io.h>
11#include <linux/clk.h>
12
13#include <asm/hardware/cache-l2x0.h>
14#include <asm/hardware/gic.h>
15#include <asm/mach/map.h>
16#include <asm/localtimer.h>
17
18#include <plat/mtu.h>
19#include <mach/hardware.h>
20#include <mach/setup.h>
21#include <mach/devices.h>
22
23#include "clock.h"
24
25static struct map_desc ux500_io_desc[] __initdata = {
26 __IO_DEV_DESC(UX500_UART0_BASE, SZ_4K),
27 __IO_DEV_DESC(UX500_UART2_BASE, SZ_4K),
28
29 __IO_DEV_DESC(UX500_GIC_CPU_BASE, SZ_4K),
30 __IO_DEV_DESC(UX500_GIC_DIST_BASE, SZ_4K),
31 __IO_DEV_DESC(UX500_L2CC_BASE, SZ_4K),
32 __IO_DEV_DESC(UX500_TWD_BASE, SZ_4K),
33 __IO_DEV_DESC(UX500_SCU_BASE, SZ_4K),
34
35 __IO_DEV_DESC(UX500_CLKRST1_BASE, SZ_4K),
36 __IO_DEV_DESC(UX500_CLKRST2_BASE, SZ_4K),
37 __IO_DEV_DESC(UX500_CLKRST3_BASE, SZ_4K),
38 __IO_DEV_DESC(UX500_CLKRST5_BASE, SZ_4K),
39 __IO_DEV_DESC(UX500_CLKRST6_BASE, SZ_4K),
40
41 __IO_DEV_DESC(UX500_MTU0_BASE, SZ_4K),
42 __IO_DEV_DESC(UX500_MTU1_BASE, SZ_4K),
43
44 __IO_DEV_DESC(UX500_BACKUPRAM0_BASE, SZ_8K),
45};
46
47static struct amba_device *ux500_amba_devs[] __initdata = {
48 &ux500_pl031_device,
49};
50
51void __init ux500_map_io(void)
52{
53 iotable_init(ux500_io_desc, ARRAY_SIZE(ux500_io_desc));
54}
55
56void __init ux500_init_devices(void)
57{
58 amba_add_devices(ux500_amba_devs, ARRAY_SIZE(ux500_amba_devs));
59}
60
61void __init ux500_init_irq(void)
62{
63 gic_dist_init(0, __io_address(UX500_GIC_DIST_BASE), 29);
64 gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE));
65}
66
67#ifdef CONFIG_CACHE_L2X0
68static int ux500_l2x0_init(void)
69{
70 void __iomem *l2x0_base;
71
72 l2x0_base = __io_address(UX500_L2CC_BASE);
73
74 /* 64KB way size, 8 way associativity, force WA */
75 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);
76
77 return 0;
78}
79early_initcall(ux500_l2x0_init);
80#endif
81
82static void __init ux500_timer_init(void)
83{
84#ifdef CONFIG_LOCAL_TIMERS
85 /* Setup the local timer base */
86 twd_base = __io_address(UX500_TWD_BASE);
87#endif
88 /* Setup the MTU base */
89 if (cpu_is_u8500ed())
90 mtu_base = __io_address(U8500_MTU0_BASE_ED);
91 else
92 mtu_base = __io_address(UX500_MTU0_BASE);
93
94 nmdk_timer_init();
95}
96
97struct sys_timer ux500_timer = {
98 .init = ux500_timer_init,
99};
diff --git a/arch/arm/mach-ux500/devices-db5500.c b/arch/arm/mach-ux500/devices-db5500.c
new file mode 100644
index 000000000000..33e5b56bebb6
--- /dev/null
+++ b/arch/arm/mach-ux500/devices-db5500.c
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/platform_device.h>
9#include <linux/interrupt.h>
10#include <linux/gpio.h>
11
12#include <mach/hardware.h>
13#include <mach/devices.h>
14
15static struct nmk_gpio_platform_data u5500_gpio_data[] = {
16 GPIO_DATA("GPIO-0-31", 0),
17 GPIO_DATA("GPIO-32-63", 32), /* 36..63 not routed to pin */
18 GPIO_DATA("GPIO-64-95", 64), /* 83..95 not routed to pin */
19 GPIO_DATA("GPIO-96-127", 96), /* 102..127 not routed to pin */
20 GPIO_DATA("GPIO-128-159", 128), /* 149..159 not routed to pin */
21 GPIO_DATA("GPIO-160-191", 160),
22 GPIO_DATA("GPIO-192-223", 192),
23 GPIO_DATA("GPIO-224-255", 224), /* 228..255 not routed to pin */
24};
25
26static struct resource u5500_gpio_resources[] = {
27 GPIO_RESOURCE(0),
28 GPIO_RESOURCE(1),
29 GPIO_RESOURCE(2),
30 GPIO_RESOURCE(3),
31 GPIO_RESOURCE(4),
32 GPIO_RESOURCE(5),
33 GPIO_RESOURCE(6),
34 GPIO_RESOURCE(7),
35};
36
37struct platform_device u5500_gpio_devs[] = {
38 GPIO_DEVICE(0),
39 GPIO_DEVICE(1),
40 GPIO_DEVICE(2),
41 GPIO_DEVICE(3),
42 GPIO_DEVICE(4),
43 GPIO_DEVICE(5),
44 GPIO_DEVICE(6),
45 GPIO_DEVICE(7),
46};
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
new file mode 100644
index 000000000000..20334236afce
--- /dev/null
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -0,0 +1,107 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/kernel.h>
9#include <linux/platform_device.h>
10#include <linux/interrupt.h>
11#include <linux/io.h>
12#include <linux/gpio.h>
13#include <linux/amba/bus.h>
14
15#include <mach/hardware.h>
16#include <mach/setup.h>
17
18static struct nmk_gpio_platform_data u8500_gpio_data[] = {
19 GPIO_DATA("GPIO-0-31", 0),
20 GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */
21 GPIO_DATA("GPIO-64-95", 64),
22 GPIO_DATA("GPIO-96-127", 96), /* 98..127 not routed to pin */
23 GPIO_DATA("GPIO-128-159", 128),
24 GPIO_DATA("GPIO-160-191", 160), /* 172..191 not routed to pin */
25 GPIO_DATA("GPIO-192-223", 192),
26 GPIO_DATA("GPIO-224-255", 224), /* 231..255 not routed to pin */
27 GPIO_DATA("GPIO-256-288", 256), /* 268..288 not routed to pin */
28};
29
30static struct resource u8500_gpio_resources[] = {
31 GPIO_RESOURCE(0),
32 GPIO_RESOURCE(1),
33 GPIO_RESOURCE(2),
34 GPIO_RESOURCE(3),
35 GPIO_RESOURCE(4),
36 GPIO_RESOURCE(5),
37 GPIO_RESOURCE(6),
38 GPIO_RESOURCE(7),
39 GPIO_RESOURCE(8),
40};
41
42struct platform_device u8500_gpio_devs[] = {
43 GPIO_DEVICE(0),
44 GPIO_DEVICE(1),
45 GPIO_DEVICE(2),
46 GPIO_DEVICE(3),
47 GPIO_DEVICE(4),
48 GPIO_DEVICE(5),
49 GPIO_DEVICE(6),
50 GPIO_DEVICE(7),
51 GPIO_DEVICE(8),
52};
53
54struct amba_device u8500_ssp0_device = {
55 .dev = {
56 .coherent_dma_mask = ~0,
57 .init_name = "ssp0",
58 },
59 .res = {
60 .start = U8500_SSP0_BASE,
61 .end = U8500_SSP0_BASE + SZ_4K - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 .irq = {IRQ_SSP0, NO_IRQ },
65 /* ST-Ericsson modified id */
66 .periphid = SSP_PER_ID,
67};
68
69static struct resource u8500_i2c0_resources[] = {
70 [0] = {
71 .start = U8500_I2C0_BASE,
72 .end = U8500_I2C0_BASE + SZ_4K - 1,
73 .flags = IORESOURCE_MEM,
74 },
75 [1] = {
76 .start = IRQ_I2C0,
77 .end = IRQ_I2C0,
78 .flags = IORESOURCE_IRQ,
79 }
80};
81
82struct platform_device u8500_i2c0_device = {
83 .name = "nmk-i2c",
84 .id = 0,
85 .resource = u8500_i2c0_resources,
86 .num_resources = ARRAY_SIZE(u8500_i2c0_resources),
87};
88
89static struct resource u8500_i2c4_resources[] = {
90 [0] = {
91 .start = U8500_I2C4_BASE,
92 .end = U8500_I2C4_BASE + SZ_4K - 1,
93 .flags = IORESOURCE_MEM,
94 },
95 [1] = {
96 .start = IRQ_I2C4,
97 .end = IRQ_I2C4,
98 .flags = IORESOURCE_IRQ,
99 }
100};
101
102struct platform_device u8500_i2c4_device = {
103 .name = "nmk-i2c",
104 .id = 4,
105 .resource = u8500_i2c4_resources,
106 .num_resources = ARRAY_SIZE(u8500_i2c4_resources),
107};
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c
new file mode 100644
index 000000000000..8a268893cb7f
--- /dev/null
+++ b/arch/arm/mach-ux500/devices.c
@@ -0,0 +1,88 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#include <linux/kernel.h>
9#include <linux/platform_device.h>
10#include <linux/interrupt.h>
11#include <linux/io.h>
12#include <linux/amba/bus.h>
13
14#include <mach/hardware.h>
15#include <mach/setup.h>
16
17#define __MEM_4K_RESOURCE(x) \
18 .res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
19
20struct amba_device ux500_pl031_device = {
21 .dev = {
22 .init_name = "pl031",
23 },
24 .res = {
25 .start = UX500_RTC_BASE,
26 .end = UX500_RTC_BASE + SZ_4K - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 .irq = {IRQ_RTC_RTT, NO_IRQ},
30};
31
32struct amba_device ux500_uart0_device = {
33 .dev = { .init_name = "uart0" },
34 __MEM_4K_RESOURCE(UX500_UART0_BASE),
35 .irq = {IRQ_UART0, NO_IRQ},
36};
37
38struct amba_device ux500_uart1_device = {
39 .dev = { .init_name = "uart1" },
40 __MEM_4K_RESOURCE(UX500_UART1_BASE),
41 .irq = {IRQ_UART1, NO_IRQ},
42};
43
44struct amba_device ux500_uart2_device = {
45 .dev = { .init_name = "uart2" },
46 __MEM_4K_RESOURCE(UX500_UART2_BASE),
47 .irq = {IRQ_UART2, NO_IRQ},
48};
49
50#define UX500_I2C_RESOURCES(id, size) \
51static struct resource ux500_i2c##id##_resources[] = { \
52 [0] = { \
53 .start = UX500_I2C##id##_BASE, \
54 .end = UX500_I2C##id##_BASE + size - 1, \
55 .flags = IORESOURCE_MEM, \
56 }, \
57 [1] = { \
58 .start = IRQ_I2C##id, \
59 .end = IRQ_I2C##id, \
60 .flags = IORESOURCE_IRQ \
61 } \
62}
63
64UX500_I2C_RESOURCES(1, SZ_4K);
65UX500_I2C_RESOURCES(2, SZ_4K);
66UX500_I2C_RESOURCES(3, SZ_4K);
67
68#define UX500_I2C_PDEVICE(cid) \
69struct platform_device ux500_i2c##cid##_device = { \
70 .name = "nmk-i2c", \
71 .id = cid, \
72 .num_resources = 2, \
73 .resource = ux500_i2c##cid##_resources, \
74}
75
76UX500_I2C_PDEVICE(1);
77UX500_I2C_PDEVICE(2);
78UX500_I2C_PDEVICE(3);
79
80void __init amba_add_devices(struct amba_device *devs[], int num)
81{
82 int i;
83
84 for (i = 0; i < num; i++) {
85 struct amba_device *d = devs[i];
86 amba_device_register(d, &iomem_resource);
87 }
88}
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h
new file mode 100644
index 000000000000..545c80fc8024
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#ifndef __MACH_DB5500_REGS_H
8#define __MACH_DB5500_REGS_H
9
10#define U5500_PER1_BASE 0xA0020000
11#define U5500_PER2_BASE 0xA0010000
12#define U5500_PER3_BASE 0x80140000
13#define U5500_PER4_BASE 0x80150000
14#define U5500_PER5_BASE 0x80100000
15#define U5500_PER6_BASE 0x80120000
16
17#define U5500_GIC_DIST_BASE 0xA0411000
18#define U5500_GIC_CPU_BASE 0xA0410100
19#define U5500_DMA_BASE 0x90030000
20#define U5500_MCDE_BASE 0xA0400000
21#define U5500_MODEM_BASE 0xB0000000
22#define U5500_L2CC_BASE 0xA0412000
23#define U5500_SCU_BASE 0xA0410000
24#define U5500_DSI1_BASE 0xA0401000
25#define U5500_DSI2_BASE 0xA0402000
26#define U5500_SIA_BASE 0xA0100000
27#define U5500_SVA_BASE 0x80200000
28#define U5500_HSEM_BASE 0xA0000000
29#define U5500_NAND0_BASE 0x60000000
30#define U5500_NAND1_BASE 0x70000000
31#define U5500_TWD_BASE 0xa0410600
32#define U5500_B2R2_BASE 0xa0200000
33
34#define U5500_FSMC_BASE (U5500_PER1_BASE + 0x0000)
35#define U5500_SDI0_BASE (U5500_PER1_BASE + 0x1000)
36#define U5500_SDI2_BASE (U5500_PER1_BASE + 0x2000)
37#define U5500_UART0_BASE (U5500_PER1_BASE + 0x3000)
38#define U5500_I2C1_BASE (U5500_PER1_BASE + 0x4000)
39#define U5500_MSP0_BASE (U5500_PER1_BASE + 0x5000)
40#define U5500_GPIO0_BASE (U5500_PER1_BASE + 0xE000)
41#define U5500_CLKRST1_BASE (U5500_PER1_BASE + 0xF000)
42
43#define U5500_USBOTG_BASE (U5500_PER2_BASE + 0x0000)
44#define U5500_GPIO1_BASE (U5500_PER2_BASE + 0xE000)
45#define U5500_CLKRST2_BASE (U5500_PER2_BASE + 0xF000)
46
47#define U5500_KEYPAD_BASE (U5500_PER3_BASE + 0x0000)
48#define U5500_PWM_BASE (U5500_PER3_BASE + 0x1000)
49#define U5500_GPIO3_BASE (U5500_PER3_BASE + 0xE000)
50#define U5500_CLKRST3_BASE (U5500_PER3_BASE + 0xF000)
51
52#define U5500_BACKUPRAM0_BASE (U5500_PER4_BASE + 0x0000)
53#define U5500_BACKUPRAM1_BASE (U5500_PER4_BASE + 0x1000)
54#define U5500_RTT0_BASE (U5500_PER4_BASE + 0x2000)
55#define U5500_RTT1_BASE (U5500_PER4_BASE + 0x3000)
56#define U5500_RTC_BASE (U5500_PER4_BASE + 0x4000)
57#define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000)
58#define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000)
59#define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000)
60#define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000)
61#define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000)
62#define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000)
63
64#define U5500_SPI0_BASE (U5500_PER5_BASE + 0x0000)
65#define U5500_SPI1_BASE (U5500_PER5_BASE + 0x1000)
66#define U5500_SPI2_BASE (U5500_PER5_BASE + 0x2000)
67#define U5500_SPI3_BASE (U5500_PER5_BASE + 0x3000)
68#define U5500_UART1_BASE (U5500_PER5_BASE + 0x4000)
69#define U5500_UART2_BASE (U5500_PER5_BASE + 0x5000)
70#define U5500_UART3_BASE (U5500_PER5_BASE + 0x6000)
71#define U5500_SDI1_BASE (U5500_PER5_BASE + 0x7000)
72#define U5500_SDI3_BASE (U5500_PER5_BASE + 0x8000)
73#define U5500_SDI4_BASE (U5500_PER5_BASE + 0x9000)
74#define U5500_I2C2_BASE (U5500_PER5_BASE + 0xA000)
75#define U5500_I2C3_BASE (U5500_PER5_BASE + 0xB000)
76#define U5500_MSP2_BASE (U5500_PER5_BASE + 0xC000)
77#define U5500_IRDA_BASE (U5500_PER5_BASE + 0xD000)
78#define U5500_IRRC_BASE (U5500_PER5_BASE + 0x10000)
79#define U5500_GPIO4_BASE (U5500_PER5_BASE + 0x1E000)
80#define U5500_CLKRST5_BASE (U5500_PER5_BASE + 0x1F000)
81
82#define U5500_RNG_BASE (U5500_PER6_BASE + 0x0000)
83#define U5500_HASH0_BASE (U5500_PER6_BASE + 0x1000)
84#define U5500_HASH1_BASE (U5500_PER6_BASE + 0x2000)
85#define U5500_PKA_BASE (U5500_PER6_BASE + 0x4000)
86#define U5500_PKAM_BASE (U5500_PER6_BASE + 0x5000)
87#define U5500_MTU0_BASE (U5500_PER6_BASE + 0x6000)
88#define U5500_MTU1_BASE (U5500_PER6_BASE + 0x7000)
89#define U5500_CR_BASE (U5500_PER6_BASE + 0x8000)
90#define U5500_CRYP0_BASE (U5500_PER6_BASE + 0xA000)
91#define U5500_CRYP1_BASE (U5500_PER6_BASE + 0xB000)
92#define U5500_CLKRST6_BASE (U5500_PER6_BASE + 0xF000)
93
94#define U5500_GPIOBANK0_BASE U5500_GPIO0_BASE
95#define U5500_GPIOBANK1_BASE (U5500_GPIO0_BASE + 0x80)
96#define U5500_GPIOBANK2_BASE U5500_GPIO1_BASE
97#define U5500_GPIOBANK3_BASE U5500_GPIO2_BASE
98#define U5500_GPIOBANK4_BASE U5500_GPIO3_BASE
99#define U5500_GPIOBANK5_BASE U5500_GPIO4_BASE
100#define U5500_GPIOBANK6_BASE (U5500_GPIO4_BASE + 0x80)
101#define U5500_GPIOBANK7_BASE (U5500_GPIO4_BASE + 0x100)
102
103#endif
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h
new file mode 100644
index 000000000000..9169e1e382a3
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h
@@ -0,0 +1,135 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#ifndef __MACH_DB8500_REGS_H
8#define __MACH_DB8500_REGS_H
9
10#define U8500_PER3_BASE 0x80000000
11#define U8500_STM_BASE 0x80100000
12#define U8500_STM_REG_BASE (U8500_STM_BASE + 0xF000)
13#define U8500_PER2_BASE 0x80110000
14#define U8500_PER1_BASE 0x80120000
15#define U8500_B2R2_BASE 0x80130000
16#define U8500_HSEM_BASE 0x80140000
17#define U8500_PER4_BASE 0x80150000
18#define U8500_ICN_BASE 0x81000000
19
20#define U8500_BOOT_ROM_BASE 0x90000000
21/* ASIC ID is at 0xff4 offset within this region */
22#define U8500_ASIC_ID_BASE 0x9001F000
23
24#define U8500_PER6_BASE 0xa03c0000
25#define U8500_PER5_BASE 0xa03e0000
26#define U8500_PER7_BASE_ED 0xa03d0000
27
28#define U8500_SVA_BASE 0xa0100000
29#define U8500_SIA_BASE 0xa0200000
30
31#define U8500_SGA_BASE 0xa0300000
32#define U8500_MCDE_BASE 0xa0350000
33#define U8500_DMA_BASE_ED 0xa0362000
34#define U8500_DMA_BASE 0x801C0000 /* v1 */
35
36#define U8500_SBAG_BASE 0xa0390000
37
38#define U8500_SCU_BASE 0xa0410000
39#define U8500_GIC_CPU_BASE 0xa0410100
40#define U8500_TWD_BASE 0xa0410600
41#define U8500_GIC_DIST_BASE 0xa0411000
42#define U8500_L2CC_BASE 0xa0412000
43
44#define U8500_MODEM_I2C 0xb7e02000
45
46#define U8500_GPIO0_BASE (U8500_PER1_BASE + 0xE000)
47#define U8500_GPIO1_BASE (U8500_PER3_BASE + 0xE000)
48#define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xE000)
49#define U8500_GPIO3_BASE (U8500_PER5_BASE + 0x1E000)
50
51/* per7 base addressess */
52#define U8500_CR_BASE_ED (U8500_PER7_BASE_ED + 0x8000)
53#define U8500_MTU0_BASE_ED (U8500_PER7_BASE_ED + 0xa000)
54#define U8500_MTU1_BASE_ED (U8500_PER7_BASE_ED + 0xb000)
55#define U8500_TZPC0_BASE_ED (U8500_PER7_BASE_ED + 0xc000)
56#define U8500_CLKRST7_BASE_ED (U8500_PER7_BASE_ED + 0xf000)
57
58#define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000)
59#define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000)
60
61/* per6 base addressess */
62#define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000)
63#define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000)
64#define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000)
65#define U8500_MTU0_BASE (U8500_PER6_BASE + 0x6000) /* v1 */
66#define U8500_MTU1_BASE (U8500_PER6_BASE + 0x7000) /* v1 */
67#define U8500_CR_BASE (U8500_PER6_BASE + 0x8000) /* v1 */
68#define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000)
69#define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000)
70#define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000)
71
72/* per5 base addressess */
73#define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000)
74#define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000)
75
76/* per4 base addressess */
77#define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x00000)
78#define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x01000)
79#define U8500_RTT0_BASE (U8500_PER4_BASE + 0x02000)
80#define U8500_RTT1_BASE (U8500_PER4_BASE + 0x03000)
81#define U8500_RTC_BASE (U8500_PER4_BASE + 0x04000)
82#define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000)
83#define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000)
84#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000)
85#define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x0f000)
86
87/* per3 base addresses */
88#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000)
89#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000)
90#define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000)
91#define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000)
92#define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000)
93#define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000)
94#define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000)
95#define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000)
96#define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000)
97
98/* per2 base addressess */
99#define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000)
100#define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000)
101#define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000)
102#define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000)
103#define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000)
104#define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000)
105#define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000)
106#define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000)
107#define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000)
108#define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000)
109#define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000)
110#define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000)
111
112/* per1 base addresses */
113#define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000)
114#define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000)
115#define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000)
116#define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000)
117#define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000)
118#define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000)
119#define U8500_I2C4_BASE (U8500_PER1_BASE + 0xa000)
120#define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xb000)
121#define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000)
122
123#define U8500_SHRM_GOP_INTERRUPT_BASE 0xB7C00040
124
125#define U8500_GPIOBANK0_BASE U8500_GPIO0_BASE
126#define U8500_GPIOBANK1_BASE (U8500_GPIO0_BASE + 0x80)
127#define U8500_GPIOBANK2_BASE U8500_GPIO1_BASE
128#define U8500_GPIOBANK3_BASE (U8500_GPIO1_BASE + 0x80)
129#define U8500_GPIOBANK4_BASE (U8500_GPIO1_BASE + 0x100)
130#define U8500_GPIOBANK5_BASE (U8500_GPIO1_BASE + 0x180)
131#define U8500_GPIOBANK6_BASE U8500_GPIO2_BASE
132#define U8500_GPIOBANK7_BASE (U8500_GPIO2_BASE + 0x80)
133#define U8500_GPIOBANK8_BASE U8500_GPIO3_BASE
134
135#endif
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S
index 09cbfda8aee5..c5203b7ea552 100644
--- a/arch/arm/mach-ux500/include/mach/debug-macro.S
+++ b/arch/arm/mach-ux500/include/mach/debug-macro.S
@@ -10,11 +10,19 @@
10 */ 10 */
11#include <mach/hardware.h> 11#include <mach/hardware.h>
12 12
13#if CONFIG_UX500_DEBUG_UART > 2
14#error Invalid Ux500 debug UART
15#endif
16
17#define __UX500_UART(n) UX500_UART##n##_BASE
18#define UX500_UART(n) __UX500_UART(n)
19#define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART)
20
13 .macro addruart, rx, tmp 21 .macro addruart, rx, tmp
14 mrc p15, 0, \rx, c1, c0 22 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled? 23 tst \rx, #1 @ MMU enabled?
16 ldreq \rx, =U8500_UART2_BASE @ no, physical address 24 ldreq \rx, =UART_BASE @ no, physical address
17 ldrne \rx, =IO_ADDRESS(U8500_UART2_BASE) @ yes, virtual address 25 ldrne \rx, =IO_ADDRESS(UART_BASE) @ yes, virtual address
18 .endm 26 .endm
19 27
20#include <asm/hardware/debug-pl01x.S> 28#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/include/mach/devices.h
new file mode 100644
index 000000000000..0422af00a56e
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/devices.h
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#ifndef __ASM_ARCH_DEVICES_H__
8#define __ASM_ARCH_DEVICES_H__
9
10struct platform_device;
11struct amba_device;
12
13extern struct platform_device u5500_gpio_devs[];
14extern struct platform_device u8500_gpio_devs[];
15
16extern struct amba_device ux500_pl031_device;
17extern struct amba_device u8500_ssp0_device;
18extern struct amba_device ux500_uart0_device;
19extern struct amba_device ux500_uart1_device;
20extern struct amba_device ux500_uart2_device;
21
22extern struct platform_device ux500_i2c1_device;
23extern struct platform_device ux500_i2c2_device;
24extern struct platform_device ux500_i2c3_device;
25
26extern struct platform_device u8500_i2c0_device;
27extern struct platform_device u8500_i2c4_device;
28
29#endif
diff --git a/arch/arm/mach-ux500/include/mach/entry-macro.S b/arch/arm/mach-ux500/include/mach/entry-macro.S
index eece3301fef7..60ea88db8283 100644
--- a/arch/arm/mach-ux500/include/mach/entry-macro.S
+++ b/arch/arm/mach-ux500/include/mach/entry-macro.S
@@ -17,7 +17,7 @@
17 .endm 17 .endm
18 18
19 .macro get_irqnr_preamble, base, tmp 19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =IO_ADDRESS(U8500_GIC_CPU_BASE) 20 ldr \base, =IO_ADDRESS(UX500_GIC_CPU_BASE)
21 .endm 21 .endm
22 22
23 .macro arch_ret_to_user, tmp1, tmp2 23 .macro arch_ret_to_user, tmp1, tmp2
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h
new file mode 100644
index 000000000000..d548a622e7d2
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/gpio.h
@@ -0,0 +1,50 @@
1#ifndef __ASM_ARCH_GPIO_H
2#define __ASM_ARCH_GPIO_H
3
4/*
5 * 288 (#267 is the highest one actually hooked up) onchip GPIOs, plus enough
6 * room for a couple of GPIO expanders.
7 */
8#define ARCH_NR_GPIOS 350
9
10#include <plat/gpio.h>
11
12#define __GPIO_RESOURCE(soc, block) \
13 { \
14 .start = soc##_GPIOBANK##block##_BASE, \
15 .end = soc##_GPIOBANK##block##_BASE + 127, \
16 .flags = IORESOURCE_MEM, \
17 }, \
18 { \
19 .start = IRQ_GPIO##block, \
20 .end = IRQ_GPIO##block, \
21 .flags = IORESOURCE_IRQ, \
22 }
23
24#define __GPIO_DEVICE(soc, block) \
25 { \
26 .name = "gpio", \
27 .id = block, \
28 .num_resources = 2, \
29 .resource = &soc##_gpio_resources[block * 2], \
30 .dev = { \
31 .platform_data = &soc##_gpio_data[block], \
32 }, \
33 }
34
35#define GPIO_DATA(_name, first) \
36 { \
37 .name = _name, \
38 .first_gpio = first, \
39 .first_irq = NOMADIK_GPIO_TO_IRQ(first), \
40 }
41
42#ifdef CONFIG_UX500_SOC_DB8500
43#define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block)
44#define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block)
45#elif defined(CONFIG_UX500_SOC_DB5500)
46#define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block)
47#define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block)
48#endif
49
50#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index 04ea836969b3..8656379a8309 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -23,109 +23,106 @@
23 23
24/* typesafe io address */ 24/* typesafe io address */
25#define __io_address(n) __io(IO_ADDRESS(n)) 25#define __io_address(n) __io(IO_ADDRESS(n))
26/* used by some plat-nomadik code */
27#define io_p2v(n) __io_address(n)
26 28
27/* 29#include <mach/db8500-regs.h>
28 * Base address definitions for U8500 Onchip IPs. All the 30#include <mach/db5500-regs.h>
29 * peripherals are contained in a single 1 Mbyte region, with 31
30 * AHB peripherals at the bottom and APB peripherals at the 32#ifdef CONFIG_UX500_SOC_DB8500
31 * top of the region. PER stands for PERIPHERAL region which 33#define UX500(periph) U8500_##periph##_BASE
32 * itself divided into sub regions. 34#elif defined(CONFIG_UX500_SOC_DB5500)
33 */ 35#define UX500(periph) U5500_##periph##_BASE
34#define U8500_PER3_BASE 0x80000000 36#endif
35#define U8500_PER2_BASE 0x80110000 37
36#define U8500_PER1_BASE 0x80120000 38#define UX500_BACKUPRAM0_BASE UX500(BACKUPRAM0)
37#define U8500_PER4_BASE 0x80150000 39#define UX500_BACKUPRAM1_BASE UX500(BACKUPRAM1)
38 40#define UX500_B2R2_BASE UX500(B2R2)
39#define U8500_PER6_BASE 0xa03c0000 41
40#define U8500_PER5_BASE 0xa03e0000 42#define UX500_CLKRST1_BASE UX500(CLKRST1)
41#define U8500_PER7_BASE 0xa03d0000 43#define UX500_CLKRST2_BASE UX500(CLKRST2)
42 44#define UX500_CLKRST3_BASE UX500(CLKRST3)
43#define U8500_SVA_BASE 0xa0100000 45#define UX500_CLKRST5_BASE UX500(CLKRST5)
44#define U8500_SIA_BASE 0xa0200000 46#define UX500_CLKRST6_BASE UX500(CLKRST6)
45 47
46#define U8500_SGA_BASE 0xa0300000 48#define UX500_DMA_BASE UX500(DMA)
47#define U8500_MCDE_BASE 0xa0350000 49#define UX500_FSMC_BASE UX500(FSMC)
48#define U8500_DMA_BASE 0xa0362000 50
49 51#define UX500_GIC_CPU_BASE UX500(GIC_CPU)
50#define U8500_SCU_BASE 0xa0410000 52#define UX500_GIC_DIST_BASE UX500(GIC_DIST)
51#define U8500_GIC_CPU_BASE 0xa0410100 53
52#define U8500_TWD_BASE 0xa0410600 54#define UX500_I2C1_BASE UX500(I2C1)
53#define U8500_GIC_DIST_BASE 0xa0411000 55#define UX500_I2C2_BASE UX500(I2C2)
54#define U8500_L2CC_BASE 0xa0412000 56#define UX500_I2C3_BASE UX500(I2C3)
55 57
56#define U8500_TWD_SIZE 0x100 58#define UX500_L2CC_BASE UX500(L2CC)
57 59#define UX500_MCDE_BASE UX500(MCDE)
58/* per7 base addressess */ 60#define UX500_MTU0_BASE UX500(MTU0)
59#define U8500_CR_BASE (U8500_PER7_BASE + 0x8000) 61#define UX500_MTU1_BASE UX500(MTU1)
60#define U8500_MTU0_BASE (U8500_PER7_BASE + 0xa000) 62#define UX500_PRCMU_BASE UX500(PRCMU)
61#define U8500_MTU1_BASE (U8500_PER7_BASE + 0xb000) 63
62#define U8500_TZPC0_BASE (U8500_PER7_BASE + 0xc000) 64#define UX500_RNG_BASE UX500(RNG)
63#define U8500_CLKRST7_BASE (U8500_PER7_BASE + 0xf000) 65#define UX500_RTC_BASE UX500(RTC)
64 66
65/* per6 base addressess */ 67#define UX500_SCU_BASE UX500(SCU)
66#define U8500_RNG_BASE (U8500_PER6_BASE + 0x0000) 68
67#define U8500_PKA_BASE (U8500_PER6_BASE + 0x1000) 69#define UX500_SDI0_BASE UX500(SDI0)
68#define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) 70#define UX500_SDI1_BASE UX500(SDI1)
69#define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) 71#define UX500_SDI2_BASE UX500(SDI2)
70#define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) 72#define UX500_SDI3_BASE UX500(SDI3)
71#define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000) 73#define UX500_SDI4_BASE UX500(SDI4)
72 74
73/* per5 base addressess */ 75#define UX500_SPI0_BASE UX500(SPI0)
74#define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) 76#define UX500_SPI1_BASE UX500(SPI1)
75#define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000) 77#define UX500_SPI2_BASE UX500(SPI2)
76#define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000) 78#define UX500_SPI3_BASE UX500(SPI3)
77 79
78/* per4 base addressess */ 80#define UX500_SIA_BASE UX500(SIA)
79#define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000) 81#define UX500_SVA_BASE UX500(SVA)
80#define U8500_BACKUPRAM1_BASE (U8500_PER4_BASE + 0x1000) 82
81#define U8500_RTT0_BASE (U8500_PER4_BASE + 0x2000) 83#define UX500_TWD_BASE UX500(TWD)
82#define U8500_RTT1_BASE (U8500_PER4_BASE + 0x3000) 84
83#define U8500_RTC_BASE (U8500_PER4_BASE + 0x4000) 85#define UX500_UART0_BASE UX500(UART0)
84#define U8500_SCR_BASE (U8500_PER4_BASE + 0x5000) 86#define UX500_UART1_BASE UX500(UART1)
85#define U8500_DMC_BASE (U8500_PER4_BASE + 0x6000) 87#define UX500_UART2_BASE UX500(UART2)
86#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x7000) 88
87 89#define UX500_USBOTG_BASE UX500(USBOTG)
88/* per3 base addressess */
89#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000)
90#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000)
91#define U8500_SSP1_BASE (U8500_PER3_BASE + 0x3000)
92#define U8500_I2C0_BASE (U8500_PER3_BASE + 0x4000)
93#define U8500_SDI2_BASE (U8500_PER3_BASE + 0x5000)
94#define U8500_SKE_BASE (U8500_PER3_BASE + 0x6000)
95#define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000)
96#define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000)
97#define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000)
98#define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000)
99
100/* per2 base addressess */
101#define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000)
102#define U8500_SPI2_BASE (U8500_PER2_BASE + 0x1000)
103#define U8500_SPI1_BASE (U8500_PER2_BASE + 0x2000)
104#define U8500_PWL_BASE (U8500_PER2_BASE + 0x3000)
105#define U8500_SDI4_BASE (U8500_PER2_BASE + 0x4000)
106#define U8500_MSP2_BASE (U8500_PER2_BASE + 0x7000)
107#define U8500_SDI1_BASE (U8500_PER2_BASE + 0x8000)
108#define U8500_SDI3_BASE (U8500_PER2_BASE + 0x9000)
109#define U8500_SPI0_BASE (U8500_PER2_BASE + 0xa000)
110#define U8500_HSIR_BASE (U8500_PER2_BASE + 0xb000)
111#define U8500_HSIT_BASE (U8500_PER2_BASE + 0xc000)
112#define U8500_GPIO2_BASE (U8500_PER2_BASE + 0xe000)
113#define U8500_CLKRST2_BASE (U8500_PER2_BASE + 0xf000)
114
115/* per1 base addresses */
116#define U8500_UART0_BASE (U8500_PER1_BASE + 0x0000)
117#define U8500_UART1_BASE (U8500_PER1_BASE + 0x1000)
118#define U8500_I2C1_BASE (U8500_PER1_BASE + 0x2000)
119#define U8500_MSP0_BASE (U8500_PER1_BASE + 0x3000)
120#define U8500_MSP1_BASE (U8500_PER1_BASE + 0x4000)
121#define U8500_SDI0_BASE (U8500_PER1_BASE + 0x6000)
122#define U8500_I2C2_BASE (U8500_PER1_BASE + 0x8000)
123#define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000)
124#define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000)
125#define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000)
126#define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000)
127 90
128/* ST-Ericsson modified pl022 id */ 91/* ST-Ericsson modified pl022 id */
129#define SSP_PER_ID 0x01080022 92#define SSP_PER_ID 0x01080022
130 93
94#ifndef __ASSEMBLY__
95
96#include <asm/cputype.h>
97
98static inline bool cpu_is_u8500(void)
99{
100#ifdef CONFIG_UX500_SOC_DB8500
101 return 1;
102#else
103 return 0;
104#endif
105}
106
107static inline bool cpu_is_u8500ed(void)
108{
109 return cpu_is_u8500() && (read_cpuid_id() & 15) == 0;
110}
111
112static inline bool cpu_is_u8500v1(void)
113{
114 return cpu_is_u8500() && (read_cpuid_id() & 15) == 1;
115}
116
117static inline bool cpu_is_u5500(void)
118{
119#ifdef CONFIG_UX500_SOC_DB5500
120 return 1;
121#else
122 return 0;
123#endif
124}
125
126#endif
127
131#endif /* __MACH_HARDWARE_H */ 128#endif /* __MACH_HARDWARE_H */
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/include/mach/irqs.h
index 394b5dd2200f..7970684b1d09 100644
--- a/arch/arm/mach-ux500/include/mach/irqs.h
+++ b/arch/arm/mach-ux500/include/mach/irqs.h
@@ -42,6 +42,7 @@
42#define IRQ_AB4500 (IRQ_SHPI_START + 40) 42#define IRQ_AB4500 (IRQ_SHPI_START + 40)
43#define IRQ_DISP (IRQ_SHPI_START + 48) 43#define IRQ_DISP (IRQ_SHPI_START + 48)
44#define IRQ_SiPI3 (IRQ_SHPI_START + 49) 44#define IRQ_SiPI3 (IRQ_SHPI_START + 49)
45#define IRQ_I2C4 (IRQ_SHPI_START + 51)
45#define IRQ_SSP1 (IRQ_SHPI_START + 52) 46#define IRQ_SSP1 (IRQ_SHPI_START + 52)
46#define IRQ_I2C2 (IRQ_SHPI_START + 55) 47#define IRQ_I2C2 (IRQ_SHPI_START + 55)
47#define IRQ_SDMMC0 (IRQ_SHPI_START + 60) 48#define IRQ_SDMMC0 (IRQ_SHPI_START + 60)
@@ -66,6 +67,12 @@
66/* There are 128 shared peripheral interrupts assigned to 67/* There are 128 shared peripheral interrupts assigned to
67 * INTID[160:32]. The first 32 interrupts are reserved. 68 * INTID[160:32]. The first 32 interrupts are reserved.
68 */ 69 */
69#define NR_IRQS 161 70#define U8500_SOC_NR_IRQS 161
71
72/* After chip-specific IRQ numbers we have the GPIO ones */
73#define NOMADIK_NR_GPIO 288
74#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + U8500_SOC_NR_IRQS)
75#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - U8500_SOC_NR_IRQS)
76#define NR_IRQS NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
70 77
71#endif /*ASM_ARCH_IRQS_H*/ 78#endif /*ASM_ARCH_IRQS_H*/
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index cf0ce1687f24..e978dbd9e210 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -14,10 +14,28 @@
14#include <asm/mach/time.h> 14#include <asm/mach/time.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17extern void u8500_map_io(void); 17extern void __init ux500_map_io(void);
18extern void u8500_init_devices(void); 18extern void __init u5500_map_io(void);
19extern void u8500_init_irq(void); 19extern void __init u8500_map_io(void);
20
21extern void __init ux500_init_devices(void);
22extern void __init u5500_init_devices(void);
23extern void __init u8500_init_devices(void);
24
25extern void __init ux500_init_irq(void);
20/* We re-use nomadik_timer for this platform */ 26/* We re-use nomadik_timer for this platform */
21extern void nmdk_timer_init(void); 27extern void nmdk_timer_init(void);
22 28
29extern void __init amba_add_devices(struct amba_device *devs[], int num);
30
31struct sys_timer;
32extern struct sys_timer ux500_timer;
33
34#define __IO_DEV_DESC(x, sz) { \
35 .virtual = IO_ADDRESS(x), \
36 .pfn = __phys_to_pfn(x), \
37 .length = sz, \
38 .type = MT_DEVICE, \
39}
40
23#endif /* __ASM_ARCH_SETUP_H */ 41#endif /* __ASM_ARCH_SETUP_H */
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 8dfe7ca245d8..438ef16aec90 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -30,7 +30,7 @@ volatile int __cpuinitdata pen_release = -1;
30 30
31static unsigned int __init get_core_count(void) 31static unsigned int __init get_core_count(void)
32{ 32{
33 return scu_get_core_count(__io_address(U8500_SCU_BASE)); 33 return scu_get_core_count(__io_address(UX500_SCU_BASE));
34} 34}
35 35
36static DEFINE_SPINLOCK(boot_lock); 36static DEFINE_SPINLOCK(boot_lock);
@@ -44,7 +44,7 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
44 * core (e.g. timer irq), then they will not have been enabled 44 * core (e.g. timer irq), then they will not have been enabled
45 * for us: do so 45 * for us: do so
46 */ 46 */
47 gic_cpu_init(0, __io_address(U8500_GIC_CPU_BASE)); 47 gic_cpu_init(0, __io_address(UX500_GIC_CPU_BASE));
48 48
49 /* 49 /*
50 * let the primary processor know we're out of the 50 * let the primary processor know we're out of the
@@ -75,7 +75,8 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
75 * that it has been released by resetting pen_release. 75 * that it has been released by resetting pen_release.
76 */ 76 */
77 pen_release = cpu; 77 pen_release = cpu;
78 flush_cache_all(); 78 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
79 outer_clean_range(__pa(&pen_release), __pa(&pen_release) + 1);
79 80
80 timeout = jiffies + (1 * HZ); 81 timeout = jiffies + (1 * HZ);
81 while (time_before(jiffies, timeout)) { 82 while (time_before(jiffies, timeout)) {
@@ -105,12 +106,12 @@ static void __init wakeup_secondary(void)
105 */ 106 */
106#define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4 107#define U8500_CPU1_JUMPADDR_OFFSET 0x1FF4
107 __raw_writel(virt_to_phys(u8500_secondary_startup), 108 __raw_writel(virt_to_phys(u8500_secondary_startup),
108 (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + 109 __io_address(UX500_BACKUPRAM0_BASE) +
109 U8500_CPU1_JUMPADDR_OFFSET); 110 U8500_CPU1_JUMPADDR_OFFSET);
110 111
111#define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0 112#define U8500_CPU1_WAKEMAGIC_OFFSET 0x1FF0
112 __raw_writel(0xA1FEED01, 113 __raw_writel(0xA1FEED01,
113 (void __iomem *)IO_ADDRESS(U8500_BACKUPRAM0_BASE) + 114 __io_address(UX500_BACKUPRAM0_BASE) +
114 U8500_CPU1_WAKEMAGIC_OFFSET); 115 U8500_CPU1_WAKEMAGIC_OFFSET);
115 116
116 /* make sure write buffer is drained */ 117 /* make sure write buffer is drained */
@@ -171,7 +172,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
171 * boot CPU, but only if we have more than one CPU. 172 * boot CPU, but only if we have more than one CPU.
172 */ 173 */
173 percpu_timer_setup(); 174 percpu_timer_setup();
174 scu_enable(__io_address(U8500_SCU_BASE)); 175 scu_enable(__io_address(UX500_SCU_BASE));
175 wakeup_secondary(); 176 wakeup_secondary();
176 } 177 }
177} 178}
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
index ba81e70ed813..97cf4d831b0c 100644
--- a/arch/arm/mach-versatile/Makefile
+++ b/arch/arm/mach-versatile/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := core.o clock.o 5obj-y := core.o
6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o 6obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o 7obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
8obj-$(CONFIG_PCI) += pci.o 8obj-$(CONFIG_PCI) += pci.o
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
deleted file mode 100644
index c50a44ea7ee6..000000000000
--- a/arch/arm/mach-versatile/clock.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * linux/arch/arm/mach-versatile/clock.c
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/device.h>
14#include <linux/list.h>
15#include <linux/errno.h>
16#include <linux/err.h>
17#include <linux/string.h>
18#include <linux/clk.h>
19#include <linux/mutex.h>
20
21#include <asm/clkdev.h>
22#include <asm/hardware/icst307.h>
23
24#include "clock.h"
25
26int clk_enable(struct clk *clk)
27{
28 return 0;
29}
30EXPORT_SYMBOL(clk_enable);
31
32void clk_disable(struct clk *clk)
33{
34}
35EXPORT_SYMBOL(clk_disable);
36
37unsigned long clk_get_rate(struct clk *clk)
38{
39 return clk->rate;
40}
41EXPORT_SYMBOL(clk_get_rate);
42
43long clk_round_rate(struct clk *clk, unsigned long rate)
44{
45 struct icst307_vco vco;
46 vco = icst307_khz_to_vco(clk->params, rate / 1000);
47 return icst307_khz(clk->params, vco) * 1000;
48}
49EXPORT_SYMBOL(clk_round_rate);
50
51int clk_set_rate(struct clk *clk, unsigned long rate)
52{
53 int ret = -EIO;
54
55 if (clk->setvco) {
56 struct icst307_vco vco;
57
58 vco = icst307_khz_to_vco(clk->params, rate / 1000);
59 clk->rate = icst307_khz(clk->params, vco) * 1000;
60 clk->setvco(clk, vco);
61 ret = 0;
62 }
63 return ret;
64}
65EXPORT_SYMBOL(clk_set_rate);
diff --git a/arch/arm/mach-versatile/clock.h b/arch/arm/mach-versatile/clock.h
deleted file mode 100644
index 03468fdc3e58..000000000000
--- a/arch/arm/mach-versatile/clock.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * linux/arch/arm/mach-versatile/clock.h
3 *
4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11struct module;
12struct icst307_params;
13
14struct clk {
15 unsigned long rate;
16 const struct icst307_params *params;
17 u32 oscoff;
18 void *data;
19 void (*setvco)(struct clk *, struct icst307_vco vco);
20};
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 9ddb49b1cb71..60baba65635e 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -28,18 +28,14 @@
28#include <linux/amba/clcd.h> 28#include <linux/amba/clcd.h>
29#include <linux/amba/pl061.h> 29#include <linux/amba/pl061.h>
30#include <linux/amba/mmci.h> 30#include <linux/amba/mmci.h>
31#include <linux/clocksource.h>
32#include <linux/clockchips.h>
33#include <linux/cnt32_to_63.h>
34#include <linux/io.h> 31#include <linux/io.h>
35 32
36#include <asm/clkdev.h> 33#include <asm/clkdev.h>
37#include <asm/system.h> 34#include <asm/system.h>
38#include <mach/hardware.h>
39#include <asm/irq.h> 35#include <asm/irq.h>
40#include <asm/leds.h> 36#include <asm/leds.h>
41#include <asm/hardware/arm_timer.h> 37#include <asm/hardware/arm_timer.h>
42#include <asm/hardware/icst307.h> 38#include <asm/hardware/icst.h>
43#include <asm/hardware/vic.h> 39#include <asm/hardware/vic.h>
44#include <asm/mach-types.h> 40#include <asm/mach-types.h>
45 41
@@ -48,9 +44,12 @@
48#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
49#include <asm/mach/time.h> 45#include <asm/mach/time.h>
50#include <asm/mach/map.h> 46#include <asm/mach/map.h>
47#include <mach/clkdev.h>
48#include <mach/hardware.h>
49#include <mach/platform.h>
50#include <plat/timer-sp.h>
51 51
52#include "core.h" 52#include "core.h"
53#include "clock.h"
54 53
55/* 54/*
56 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx 55 * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
@@ -58,7 +57,6 @@
58 * 57 *
59 * Setup a VA for the Versatile Vectored Interrupt Controller. 58 * Setup a VA for the Versatile Vectored Interrupt Controller.
60 */ 59 */
61#define __io_address(n) __io(IO_ADDRESS(n))
62#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 60#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE)
63#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 61#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE)
64 62
@@ -228,27 +226,6 @@ void __init versatile_map_io(void)
228 iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); 226 iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc));
229} 227}
230 228
231#define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET)
232
233/*
234 * This is the Versatile sched_clock implementation. This has
235 * a resolution of 41.7ns, and a maximum value of about 35583 days.
236 *
237 * The return value is guaranteed to be monotonic in that range as
238 * long as there is always less than 89 seconds between successive
239 * calls to this function.
240 */
241unsigned long long sched_clock(void)
242{
243 unsigned long long v = cnt32_to_63(readl(VERSATILE_REFCOUNTER));
244
245 /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
246 v *= 125<<1;
247 do_div(v, 3<<1);
248
249 return v;
250}
251
252 229
253#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) 230#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
254 231
@@ -379,33 +356,40 @@ static struct mmci_platform_data mmc0_plat_data = {
379/* 356/*
380 * Clock handling 357 * Clock handling
381 */ 358 */
382static const struct icst307_params versatile_oscvco_params = { 359static const struct icst_params versatile_oscvco_params = {
383 .ref = 24000, 360 .ref = 24000000,
384 .vco_max = 200000, 361 .vco_max = ICST307_VCO_MAX,
362 .vco_min = ICST307_VCO_MIN,
385 .vd_min = 4 + 8, 363 .vd_min = 4 + 8,
386 .vd_max = 511 + 8, 364 .vd_max = 511 + 8,
387 .rd_min = 1 + 2, 365 .rd_min = 1 + 2,
388 .rd_max = 127 + 2, 366 .rd_max = 127 + 2,
367 .s2div = icst307_s2div,
368 .idx2s = icst307_idx2s,
389}; 369};
390 370
391static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) 371static void versatile_oscvco_set(struct clk *clk, struct icst_vco vco)
392{ 372{
393 void __iomem *sys = __io_address(VERSATILE_SYS_BASE); 373 void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET;
394 void __iomem *sys_lock = sys + VERSATILE_SYS_LOCK_OFFSET;
395 u32 val; 374 u32 val;
396 375
397 val = readl(sys + clk->oscoff) & ~0x7ffff; 376 val = readl(clk->vcoreg) & ~0x7ffff;
398 val |= vco.v | (vco.r << 9) | (vco.s << 16); 377 val |= vco.v | (vco.r << 9) | (vco.s << 16);
399 378
400 writel(0xa05f, sys_lock); 379 writel(0xa05f, sys_lock);
401 writel(val, sys + clk->oscoff); 380 writel(val, clk->vcoreg);
402 writel(0, sys_lock); 381 writel(0, sys_lock);
403} 382}
404 383
384static const struct clk_ops osc4_clk_ops = {
385 .round = icst_clk_round,
386 .set = icst_clk_set,
387 .setvco = versatile_oscvco_set,
388};
389
405static struct clk osc4_clk = { 390static struct clk osc4_clk = {
391 .ops = &osc4_clk_ops,
406 .params = &versatile_oscvco_params, 392 .params = &versatile_oscvco_params,
407 .oscoff = VERSATILE_SYS_OSCCLCD_OFFSET,
408 .setvco = versatile_oscvco_set,
409}; 393};
410 394
411/* 395/*
@@ -851,6 +835,8 @@ void __init versatile_init(void)
851{ 835{
852 int i; 836 int i;
853 837
838 osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
839
854 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 840 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
855 841
856 platform_device_register(&versatile_flash_device); 842 platform_device_register(&versatile_flash_device);
@@ -874,120 +860,6 @@ void __init versatile_init(void)
874#define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) 860#define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20)
875#define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) 861#define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE)
876#define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) 862#define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20)
877#define VA_IC_BASE __io_address(VERSATILE_VIC_BASE)
878
879/*
880 * How long is the timer interval?
881 */
882#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
883#if TIMER_INTERVAL >= 0x100000
884#define TIMER_RELOAD (TIMER_INTERVAL >> 8)
885#define TIMER_DIVISOR (TIMER_CTRL_DIV256)
886#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
887#elif TIMER_INTERVAL >= 0x10000
888#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
889#define TIMER_DIVISOR (TIMER_CTRL_DIV16)
890#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
891#else
892#define TIMER_RELOAD (TIMER_INTERVAL)
893#define TIMER_DIVISOR (TIMER_CTRL_DIV1)
894#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
895#endif
896
897static void timer_set_mode(enum clock_event_mode mode,
898 struct clock_event_device *clk)
899{
900 unsigned long ctrl;
901
902 switch(mode) {
903 case CLOCK_EVT_MODE_PERIODIC:
904 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
905
906 ctrl = TIMER_CTRL_PERIODIC;
907 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
908 break;
909 case CLOCK_EVT_MODE_ONESHOT:
910 /* period set, and timer enabled in 'next_event' hook */
911 ctrl = TIMER_CTRL_ONESHOT;
912 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE;
913 break;
914 case CLOCK_EVT_MODE_UNUSED:
915 case CLOCK_EVT_MODE_SHUTDOWN:
916 default:
917 ctrl = 0;
918 }
919
920 writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
921}
922
923static int timer_set_next_event(unsigned long evt,
924 struct clock_event_device *unused)
925{
926 unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
927
928 writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
929 writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
930
931 return 0;
932}
933
934static struct clock_event_device timer0_clockevent = {
935 .name = "timer0",
936 .shift = 32,
937 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
938 .set_mode = timer_set_mode,
939 .set_next_event = timer_set_next_event,
940};
941
942/*
943 * IRQ handler for the timer
944 */
945static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id)
946{
947 struct clock_event_device *evt = &timer0_clockevent;
948
949 writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
950
951 evt->event_handler(evt);
952
953 return IRQ_HANDLED;
954}
955
956static struct irqaction versatile_timer_irq = {
957 .name = "Versatile Timer Tick",
958 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
959 .handler = versatile_timer_interrupt,
960};
961
962static cycle_t versatile_get_cycles(struct clocksource *cs)
963{
964 return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
965}
966
967static struct clocksource clocksource_versatile = {
968 .name = "timer3",
969 .rating = 200,
970 .read = versatile_get_cycles,
971 .mask = CLOCKSOURCE_MASK(32),
972 .shift = 20,
973 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
974};
975
976static int __init versatile_clocksource_init(void)
977{
978 /* setup timer3 as free-running clocksource */
979 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
980 writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
981 writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
982 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
983 TIMER3_VA_BASE + TIMER_CTRL);
984
985 clocksource_versatile.mult =
986 clocksource_khz2mult(1000, clocksource_versatile.shift);
987 clocksource_register(&clocksource_versatile);
988
989 return 0;
990}
991 863
992/* 864/*
993 * Set up timer interrupt, and return the current time in seconds. 865 * Set up timer interrupt, and return the current time in seconds.
@@ -1016,22 +888,8 @@ static void __init versatile_timer_init(void)
1016 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 888 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
1017 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 889 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
1018 890
1019 /* 891 sp804_clocksource_init(TIMER3_VA_BASE);
1020 * Make irqs happen for the system timer 892 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1);
1021 */
1022 setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
1023
1024 versatile_clocksource_init();
1025
1026 timer0_clockevent.mult =
1027 div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
1028 timer0_clockevent.max_delta_ns =
1029 clockevent_delta2ns(0xffffffff, &timer0_clockevent);
1030 timer0_clockevent.min_delta_ns =
1031 clockevent_delta2ns(0xf, &timer0_clockevent);
1032
1033 timer0_clockevent.cpumask = cpumask_of(0);
1034 clockevents_register_device(&timer0_clockevent);
1035} 893}
1036 894
1037struct sys_timer versatile_timer = { 895struct sys_timer versatile_timer = {
diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h
index 04b37a89801c..e58d0771b64e 100644
--- a/arch/arm/mach-versatile/include/mach/clkdev.h
+++ b/arch/arm/mach-versatile/include/mach/clkdev.h
@@ -1,6 +1,15 @@
1#ifndef __ASM_MACH_CLKDEV_H 1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H 2#define __ASM_MACH_CLKDEV_H
3 3
4#include <plat/clock.h>
5
6struct clk {
7 unsigned long rate;
8 const struct clk_ops *ops;
9 const struct icst_params *params;
10 void __iomem *vcoreg;
11};
12
4#define __clk_get(clk) ({ 1; }) 13#define __clk_get(clk) ({ 1; })
5#define __clk_put(clk) do { } while (0) 14#define __clk_put(clk) do { } while (0)
6 15
diff --git a/arch/arm/mach-versatile/include/mach/entry-macro.S b/arch/arm/mach-versatile/include/mach/entry-macro.S
index 8c8020980585..e6f7c1663160 100644
--- a/arch/arm/mach-versatile/include/mach/entry-macro.S
+++ b/arch/arm/mach-versatile/include/mach/entry-macro.S
@@ -8,6 +8,7 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10#include <mach/hardware.h> 10#include <mach/hardware.h>
11#include <mach/platform.h>
11#include <asm/hardware/vic.h> 12#include <asm/hardware/vic.h>
12 13
13 .macro disable_fiq 14 .macro disable_fiq
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
index 7aa906c93154..4f8f99aac938 100644
--- a/arch/arm/mach-versatile/include/mach/hardware.h
+++ b/arch/arm/mach-versatile/include/mach/hardware.h
@@ -23,7 +23,6 @@
23#define __ASM_ARCH_HARDWARE_H 23#define __ASM_ARCH_HARDWARE_H
24 24
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26#include <mach/platform.h>
27 26
28/* 27/*
29 * PCI space virtual addresses 28 * PCI space virtual addresses
@@ -49,4 +48,6 @@
49/* macro to get at IO space when running virtually */ 48/* macro to get at IO space when running virtually */
50#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) 49#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
51 50
51#define __io_address(n) __io(IO_ADDRESS(n))
52
52#endif 53#endif
diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h
index 83207395191a..ec087407b163 100644
--- a/arch/arm/mach-versatile/include/mach/platform.h
+++ b/arch/arm/mach-versatile/include/mach/platform.h
@@ -205,7 +205,7 @@
205#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */ 205#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
206#define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */ 206#define VERSATILE_DMAC_BASE 0x10130000 /* DMA controller */
207#define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */ 207#define VERSATILE_VIC_BASE 0x10140000 /* Vectored interrupt controller */
208#define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */ 208#define VERSATILE_PERIPH_BASE 0x10150000 /* off-chip peripherals alias from */
209 /* 0x10000000 - 0x100FFFFF */ 209 /* 0x10000000 - 0x100FFFFF */
210#define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */ 210#define VERSATILE_AHBM_BASE 0x101D0000 /* AHB monitor */
211#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ 211#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
@@ -213,7 +213,7 @@
213#define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */ 213#define VERSATILE_TIMER0_1_BASE 0x101E2000 /* Timer 0 and 1 */
214#define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */ 214#define VERSATILE_TIMER2_3_BASE 0x101E3000 /* Timer 2 and 3 */
215#define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */ 215#define VERSATILE_GPIO0_BASE 0x101E4000 /* GPIO port 0 */
216#define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */ 216#define VERSATILE_GPIO1_BASE 0x101E5000 /* GPIO port 1 */
217#define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */ 217#define VERSATILE_GPIO2_BASE 0x101E6000 /* GPIO port 2 */
218#define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */ 218#define VERSATILE_GPIO3_BASE 0x101E7000 /* GPIO port 3 */
219#define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */ 219#define VERSATILE_RTC_BASE 0x101E8000 /* Real Time Clock */
@@ -379,12 +379,6 @@
379#define SIC_INT_PCI3 30 379#define SIC_INT_PCI3 30
380 380
381 381
382/*
383 * Clean base - dummy
384 *
385 */
386#define CLEAN_BASE VERSATILE_BOOT_ROM_HI
387
388/* 382/*
389 * System controller bit assignment 383 * System controller bit assignment
390 */ 384 */
@@ -397,20 +391,6 @@
397#define VERSATILE_TIMER4_EnSel 21 391#define VERSATILE_TIMER4_EnSel 21
398 392
399 393
400#define MAX_TIMER 2
401#define MAX_PERIOD 699050
402#define TICKS_PER_uSEC 1
403
404/*
405 * These are useconds NOT ticks.
406 *
407 */
408#define mSEC_1 1000
409#define mSEC_5 (mSEC_1 * 5)
410#define mSEC_10 (mSEC_1 * 10)
411#define mSEC_25 (mSEC_1 * 25)
412#define SEC_1 (mSEC_1 * 1000)
413
414#define VERSATILE_CSR_BASE 0x10000000 394#define VERSATILE_CSR_BASE 0x10000000
415#define VERSATILE_CSR_SIZE 0x10000000 395#define VERSATILE_CSR_SIZE 0x10000000
416 396
@@ -432,5 +412,3 @@
432#endif 412#endif
433 413
434#endif 414#endif
435
436/* END */
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
new file mode 100644
index 000000000000..3f19b660a165
--- /dev/null
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -0,0 +1,9 @@
1menu "Versatile Express platform type"
2 depends on ARCH_VEXPRESS
3
4config ARCH_VEXPRESS_CA9X4
5 bool "Versatile Express Cortex-A9x4 tile"
6 select CPU_V7
7 select ARM_GIC
8
9endmenu
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
new file mode 100644
index 000000000000..1b71b77ade22
--- /dev/null
+++ b/arch/arm/mach-vexpress/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := v2m.o
6obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o
7obj-$(CONFIG_SMP) += platsmp.o headsmp.o
8obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot
new file mode 100644
index 000000000000..07c2d9c457ec
--- /dev/null
+++ b/arch/arm/mach-vexpress/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x60008000
2params_phys-y := 0x60000100
3initrd_phys-y := 0x60800000
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
new file mode 100644
index 000000000000..57dd95ce41f9
--- /dev/null
+++ b/arch/arm/mach-vexpress/core.h
@@ -0,0 +1,26 @@
1#define __MMIO_P2V(x) (((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000)
2#define MMIO_P2V(x) ((void __iomem *)__MMIO_P2V(x))
3
4#define AMBA_DEVICE(name,busid,base,plat) \
5struct amba_device name##_device = { \
6 .dev = { \
7 .coherent_dma_mask = ~0UL, \
8 .init_name = busid, \
9 .platform_data = plat, \
10 }, \
11 .res = { \
12 .start = base, \
13 .end = base + SZ_4K - 1, \
14 .flags = IORESOURCE_MEM, \
15 }, \
16 .dma_mask = ~0UL, \
17 .irq = IRQ_##base, \
18 /* .dma = DMA_##base,*/ \
19}
20
21struct map_desc;
22
23void v2m_map_io(struct map_desc *tile, size_t num);
24extern struct sys_timer v2m_timer;
25
26extern void __iomem *gic_cpu_base_addr;
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
new file mode 100644
index 000000000000..e6f73030d5f0
--- /dev/null
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -0,0 +1,249 @@
1/*
2 * Versatile Express Core Tile Cortex A9x4 Support
3 */
4#include <linux/init.h>
5#include <linux/device.h>
6#include <linux/dma-mapping.h>
7#include <linux/platform_device.h>
8#include <linux/amba/bus.h>
9#include <linux/amba/clcd.h>
10
11#include <asm/clkdev.h>
12#include <asm/hardware/arm_timer.h>
13#include <asm/hardware/cache-l2x0.h>
14#include <asm/hardware/gic.h>
15#include <asm/mach-types.h>
16#include <asm/pmu.h>
17
18#include <mach/clkdev.h>
19#include <mach/ct-ca9x4.h>
20
21#include <plat/timer-sp.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/time.h>
26
27#include "core.h"
28
29#include <mach/motherboard.h>
30
31#define V2M_PA_CS7 0x10000000
32
33static struct map_desc ct_ca9x4_io_desc[] __initdata = {
34 {
35 .virtual = __MMIO_P2V(CT_CA9X4_MPIC),
36 .pfn = __phys_to_pfn(CT_CA9X4_MPIC),
37 .length = SZ_16K,
38 .type = MT_DEVICE,
39 }, {
40 .virtual = __MMIO_P2V(CT_CA9X4_SP804_TIMER),
41 .pfn = __phys_to_pfn(CT_CA9X4_SP804_TIMER),
42 .length = SZ_4K,
43 .type = MT_DEVICE,
44 }, {
45 .virtual = __MMIO_P2V(CT_CA9X4_L2CC),
46 .pfn = __phys_to_pfn(CT_CA9X4_L2CC),
47 .length = SZ_4K,
48 .type = MT_DEVICE,
49 },
50};
51
52static void __init ct_ca9x4_map_io(void)
53{
54 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
55}
56
57void __iomem *gic_cpu_base_addr;
58
59static void __init ct_ca9x4_init_irq(void)
60{
61 gic_cpu_base_addr = MMIO_P2V(A9_MPCORE_GIC_CPU);
62 gic_dist_init(0, MMIO_P2V(A9_MPCORE_GIC_DIST), 29);
63 gic_cpu_init(0, gic_cpu_base_addr);
64}
65
66#if 0
67static void ct_ca9x4_timer_init(void)
68{
69 writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
70 writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
71
72 sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1));
73 sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0);
74}
75
76static struct sys_timer ct_ca9x4_timer = {
77 .init = ct_ca9x4_timer_init,
78};
79#endif
80
81static struct clcd_panel xvga_panel = {
82 .mode = {
83 .name = "XVGA",
84 .refresh = 60,
85 .xres = 1024,
86 .yres = 768,
87 .pixclock = 15384,
88 .left_margin = 168,
89 .right_margin = 8,
90 .upper_margin = 29,
91 .lower_margin = 3,
92 .hsync_len = 144,
93 .vsync_len = 6,
94 .sync = 0,
95 .vmode = FB_VMODE_NONINTERLACED,
96 },
97 .width = -1,
98 .height = -1,
99 .tim2 = TIM2_BCD | TIM2_IPC,
100 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
101 .bpp = 16,
102};
103
104static void ct_ca9x4_clcd_enable(struct clcd_fb *fb)
105{
106 v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0);
107 v2m_cfg_write(SYS_CFG_DVIMODE | SYS_CFG_SITE_DB1, 2);
108}
109
110static int ct_ca9x4_clcd_setup(struct clcd_fb *fb)
111{
112 unsigned long framesize = 1024 * 768 * 2;
113 dma_addr_t dma;
114
115 fb->panel = &xvga_panel;
116
117 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
118 &dma, GFP_KERNEL);
119 if (!fb->fb.screen_base) {
120 printk(KERN_ERR "CLCD: unable to map frame buffer\n");
121 return -ENOMEM;
122 }
123 fb->fb.fix.smem_start = dma;
124 fb->fb.fix.smem_len = framesize;
125
126 return 0;
127}
128
129static int ct_ca9x4_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
130{
131 return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base,
132 fb->fb.fix.smem_start, fb->fb.fix.smem_len);
133}
134
135static void ct_ca9x4_clcd_remove(struct clcd_fb *fb)
136{
137 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
138 fb->fb.screen_base, fb->fb.fix.smem_start);
139}
140
141static struct clcd_board ct_ca9x4_clcd_data = {
142 .name = "CT-CA9X4",
143 .check = clcdfb_check,
144 .decode = clcdfb_decode,
145 .enable = ct_ca9x4_clcd_enable,
146 .setup = ct_ca9x4_clcd_setup,
147 .mmap = ct_ca9x4_clcd_mmap,
148 .remove = ct_ca9x4_clcd_remove,
149};
150
151static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data);
152static AMBA_DEVICE(dmc, "ct:dmc", CT_CA9X4_DMC, NULL);
153static AMBA_DEVICE(smc, "ct:smc", CT_CA9X4_SMC, NULL);
154static AMBA_DEVICE(gpio, "ct:gpio", CT_CA9X4_GPIO, NULL);
155
156static struct amba_device *ct_ca9x4_amba_devs[] __initdata = {
157 &clcd_device,
158 &dmc_device,
159 &smc_device,
160 &gpio_device,
161};
162
163
164static long ct_round(struct clk *clk, unsigned long rate)
165{
166 return rate;
167}
168
169static int ct_set(struct clk *clk, unsigned long rate)
170{
171 return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_DB1 | 1, rate);
172}
173
174static const struct clk_ops osc1_clk_ops = {
175 .round = ct_round,
176 .set = ct_set,
177};
178
179static struct clk osc1_clk = {
180 .ops = &osc1_clk_ops,
181 .rate = 24000000,
182};
183
184static struct clk_lookup lookups[] = {
185 { /* CLCD */
186 .dev_id = "ct:clcd",
187 .clk = &osc1_clk,
188 },
189};
190
191static struct resource pmu_resources[] = {
192 [0] = {
193 .start = IRQ_CT_CA9X4_PMU_CPU0,
194 .end = IRQ_CT_CA9X4_PMU_CPU0,
195 .flags = IORESOURCE_IRQ,
196 },
197 [1] = {
198 .start = IRQ_CT_CA9X4_PMU_CPU1,
199 .end = IRQ_CT_CA9X4_PMU_CPU1,
200 .flags = IORESOURCE_IRQ,
201 },
202 [2] = {
203 .start = IRQ_CT_CA9X4_PMU_CPU2,
204 .end = IRQ_CT_CA9X4_PMU_CPU2,
205 .flags = IORESOURCE_IRQ,
206 },
207 [3] = {
208 .start = IRQ_CT_CA9X4_PMU_CPU3,
209 .end = IRQ_CT_CA9X4_PMU_CPU3,
210 .flags = IORESOURCE_IRQ,
211 },
212};
213
214static struct platform_device pmu_device = {
215 .name = "arm-pmu",
216 .id = ARM_PMU_DEVICE_CPU,
217 .num_resources = ARRAY_SIZE(pmu_resources),
218 .resource = pmu_resources,
219};
220
221static void ct_ca9x4_init(void)
222{
223 int i;
224
225#ifdef CONFIG_CACHE_L2X0
226 l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff);
227#endif
228
229 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
230
231 for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++)
232 amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);
233
234 platform_device_register(&pmu_device);
235}
236
237MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
238 .phys_io = V2M_UART0,
239 .io_pg_offst = (__MMIO_P2V(V2M_UART0) >> 18) & 0xfffc,
240 .boot_params = PHYS_OFFSET + 0x00000100,
241 .map_io = ct_ca9x4_map_io,
242 .init_irq = ct_ca9x4_init_irq,
243#if 0
244 .timer = &ct_ca9x4_timer,
245#else
246 .timer = &v2m_timer,
247#endif
248 .init_machine = ct_ca9x4_init,
249MACHINE_END
diff --git a/arch/arm/mach-vexpress/headsmp.S b/arch/arm/mach-vexpress/headsmp.S
new file mode 100644
index 000000000000..8a78ff68e1ee
--- /dev/null
+++ b/arch/arm/mach-vexpress/headsmp.S
@@ -0,0 +1,39 @@
1/*
2 * linux/arch/arm/mach-vexpress/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * Versatile Express specific entry point for secondary CPUs. This
18 * provides a "holding pen" into which all secondary cores are held
19 * until we're ready for them to initialise.
20 */
21ENTRY(vexpress_secondary_startup)
22 mrc p15, 0, r0, c0, c0, 5
23 and r0, r0, #15
24 adr r4, 1f
25 ldmia r4, {r5, r6}
26 sub r4, r4, r5
27 add r6, r6, r4
28pen: ldr r7, [r6]
29 cmp r7, r0
30 bne pen
31
32 /*
33 * we've been released from the holding pen: secondary_stack
34 * should now contain the SVC stack for this core
35 */
36 b secondary_startup
37
381: .long .
39 .long pen_release
diff --git a/arch/arm/mach-vexpress/include/mach/clkdev.h b/arch/arm/mach-vexpress/include/mach/clkdev.h
new file mode 100644
index 000000000000..3f8307d73cad
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/clkdev.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4#include <plat/clock.h>
5
6struct clk {
7 const struct clk_ops *ops;
8 unsigned long rate;
9 const struct icst_params *params;
10};
11
12#define __clk_get(clk) ({ 1; })
13#define __clk_put(clk) do { } while (0)
14
15#endif
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
new file mode 100644
index 000000000000..8650f04136ef
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -0,0 +1,47 @@
1#ifndef __MACH_CT_CA9X4_H
2#define __MACH_CT_CA9X4_H
3
4/*
5 * Physical base addresses
6 */
7#define CT_CA9X4_CLCDC (0x10020000)
8#define CT_CA9X4_AXIRAM (0x10060000)
9#define CT_CA9X4_DMC (0x100e0000)
10#define CT_CA9X4_SMC (0x100e1000)
11#define CT_CA9X4_SCC (0x100e2000)
12#define CT_CA9X4_SP804_TIMER (0x100e4000)
13#define CT_CA9X4_SP805_WDT (0x100e5000)
14#define CT_CA9X4_TZPC (0x100e6000)
15#define CT_CA9X4_GPIO (0x100e8000)
16#define CT_CA9X4_FASTAXI (0x100e9000)
17#define CT_CA9X4_SLOWAXI (0x100ea000)
18#define CT_CA9X4_TZASC (0x100ec000)
19#define CT_CA9X4_CORESIGHT (0x10200000)
20#define CT_CA9X4_MPIC (0x1e000000)
21#define CT_CA9X4_SYSTIMER (0x1e004000)
22#define CT_CA9X4_SYSWDT (0x1e007000)
23#define CT_CA9X4_L2CC (0x1e00a000)
24
25#define CT_CA9X4_TIMER0 (CT_CA9X4_SP804_TIMER + 0x000)
26#define CT_CA9X4_TIMER1 (CT_CA9X4_SP804_TIMER + 0x020)
27
28#define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000)
29#define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100)
30#define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200)
31#define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000)
32
33/*
34 * Interrupts. Those in {} are for AMBA devices
35 */
36#define IRQ_CT_CA9X4_CLCDC { 76 }
37#define IRQ_CT_CA9X4_DMC { -1 }
38#define IRQ_CT_CA9X4_SMC { 77, 78 }
39#define IRQ_CT_CA9X4_TIMER0 80
40#define IRQ_CT_CA9X4_TIMER1 81
41#define IRQ_CT_CA9X4_GPIO { 82 }
42#define IRQ_CT_CA9X4_PMU_CPU0 92
43#define IRQ_CT_CA9X4_PMU_CPU1 93
44#define IRQ_CT_CA9X4_PMU_CPU2 94
45#define IRQ_CT_CA9X4_PMU_CPU3 95
46
47#endif
diff --git a/arch/arm/mach-vexpress/include/mach/debug-macro.S b/arch/arm/mach-vexpress/include/mach/debug-macro.S
new file mode 100644
index 000000000000..5167e2aceeba
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/debug-macro.S
@@ -0,0 +1,23 @@
1/* arch/arm/mach-realview/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#define DEBUG_LL_UART_OFFSET 0x00009000
14
15 .macro addruart,rx,tmp
16 mrc p15, 0, \rx, c1, c0
17 tst \rx, #1 @ MMU enabled?
18 moveq \rx, #0x10000000
19 movne \rx, #0xf8000000 @ virtual base
20 orr \rx, \rx, #DEBUG_LL_UART_OFFSET
21 .endm
22
23#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-vexpress/include/mach/entry-macro.S b/arch/arm/mach-vexpress/include/mach/entry-macro.S
new file mode 100644
index 000000000000..20e9fb514f0a
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/entry-macro.S
@@ -0,0 +1,67 @@
1#include <asm/hardware/gic.h>
2
3 .macro disable_fiq
4 .endm
5
6 .macro get_irqnr_preamble, base, tmp
7 ldr \base, =gic_cpu_base_addr
8 ldr \base, [\base]
9 .endm
10
11 .macro arch_ret_to_user, tmp1, tmp2
12 .endm
13
14 /*
15 * The interrupt numbering scheme is defined in the
16 * interrupt controller spec. To wit:
17 *
18 * Interrupts 0-15 are IPI
19 * 16-28 are reserved
20 * 29-31 are local. We allow 30 to be used for the watchdog.
21 * 32-1020 are global
22 * 1021-1022 are reserved
23 * 1023 is "spurious" (no interrupt)
24 *
25 * For now, we ignore all local interrupts so only return an interrupt if it's
26 * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.
27 *
28 * A simple read from the controller will tell us the number of the highest
29 * priority enabled interrupt. We then just need to check whether it is in the
30 * valid range for an IRQ (30-1020 inclusive).
31 */
32
33 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
34 ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */
35 ldr \tmp, =1021
36 bic \irqnr, \irqstat, #0x1c00
37 cmp \irqnr, #29
38 cmpcc \irqnr, \irqnr
39 cmpne \irqnr, \tmp
40 cmpcs \irqnr, \irqnr
41 .endm
42
43 /* We assume that irqstat (the raw value of the IRQ acknowledge
44 * register) is preserved from the macro above.
45 * If there is an IPI, we immediately signal end of interrupt on the
46 * controller, since this requires the original irqstat value which
47 * we won't easily be able to recreate later.
48 */
49
50 .macro test_for_ipi, irqnr, irqstat, base, tmp
51 bic \irqnr, \irqstat, #0x1c00
52 cmp \irqnr, #16
53 strcc \irqstat, [\base, #GIC_CPU_EOI]
54 cmpcs \irqnr, \irqnr
55 .endm
56
57 /* As above, this assumes that irqstat and base are preserved.. */
58
59 .macro test_for_ltirq, irqnr, irqstat, base, tmp
60 bic \irqnr, \irqstat, #0x1c00
61 mov \tmp, #0
62 cmp \irqnr, #29
63 moveq \tmp, #1
64 streq \irqstat, [\base, #GIC_CPU_EOI]
65 cmp \tmp, #0
66 .endm
67
diff --git a/arch/arm/mach-vexpress/include/mach/hardware.h b/arch/arm/mach-vexpress/include/mach/hardware.h
new file mode 100644
index 000000000000..40a8c178f10d
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/hardware.h
@@ -0,0 +1 @@
/* empty */
diff --git a/arch/arm/mach-vexpress/include/mach/io.h b/arch/arm/mach-vexpress/include/mach/io.h
new file mode 100644
index 000000000000..748bb524ee71
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/io.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/io.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffffffff
24
25#define __io(a) __typesafe_io(a)
26#define __mem_pci(a) (a)
27
28#endif
diff --git a/arch/arm/mach-vexpress/include/mach/irqs.h b/arch/arm/mach-vexpress/include/mach/irqs.h
new file mode 100644
index 000000000000..7054cbfc9de5
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/irqs.h
@@ -0,0 +1,4 @@
1#define IRQ_LOCALTIMER 29
2#define IRQ_LOCALWDOG 30
3
4#define NR_IRQS 128
diff --git a/arch/arm/mach-vexpress/include/mach/memory.h b/arch/arm/mach-vexpress/include/mach/memory.h
new file mode 100644
index 000000000000..be28232ae639
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/memory.h
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/memory.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23#define PHYS_OFFSET UL(0x60000000)
24
25#endif
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h
new file mode 100644
index 000000000000..98a8ded055bf
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/motherboard.h
@@ -0,0 +1,121 @@
1#ifndef __MACH_MOTHERBOARD_H
2#define __MACH_MOTHERBOARD_H
3
4/*
5 * Physical addresses, offset from V2M_PA_CS0-3
6 */
7#define V2M_NOR0 (V2M_PA_CS0)
8#define V2M_NOR1 (V2M_PA_CS1)
9#define V2M_SRAM (V2M_PA_CS2)
10#define V2M_VIDEO_SRAM (V2M_PA_CS3 + 0x00000000)
11#define V2M_LAN9118 (V2M_PA_CS3 + 0x02000000)
12#define V2M_ISP1761 (V2M_PA_CS3 + 0x03000000)
13
14/*
15 * Physical addresses, offset from V2M_PA_CS7
16 */
17#define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000)
18#define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000)
19#define V2M_SERIAL_BUS_PCI (V2M_PA_CS7 + 0x00002000)
20
21#define V2M_AACI (V2M_PA_CS7 + 0x00004000)
22#define V2M_MMCI (V2M_PA_CS7 + 0x00005000)
23#define V2M_KMI0 (V2M_PA_CS7 + 0x00006000)
24#define V2M_KMI1 (V2M_PA_CS7 + 0x00007000)
25
26#define V2M_UART0 (V2M_PA_CS7 + 0x00009000)
27#define V2M_UART1 (V2M_PA_CS7 + 0x0000a000)
28#define V2M_UART2 (V2M_PA_CS7 + 0x0000b000)
29#define V2M_UART3 (V2M_PA_CS7 + 0x0000c000)
30
31#define V2M_WDT (V2M_PA_CS7 + 0x0000f000)
32
33#define V2M_TIMER01 (V2M_PA_CS7 + 0x00011000)
34#define V2M_TIMER23 (V2M_PA_CS7 + 0x00012000)
35
36#define V2M_SERIAL_BUS_DVI (V2M_PA_CS7 + 0x00016000)
37#define V2M_RTC (V2M_PA_CS7 + 0x00017000)
38
39#define V2M_CF (V2M_PA_CS7 + 0x0001a000)
40#define V2M_CLCD (V2M_PA_CS7 + 0x0001f000)
41
42#define V2M_SYS_ID (V2M_SYSREGS + 0x000)
43#define V2M_SYS_SW (V2M_SYSREGS + 0x004)
44#define V2M_SYS_LED (V2M_SYSREGS + 0x008)
45#define V2M_SYS_100HZ (V2M_SYSREGS + 0x024)
46#define V2M_SYS_FLAGS (V2M_SYSREGS + 0x030)
47#define V2M_SYS_FLAGSSET (V2M_SYSREGS + 0x030)
48#define V2M_SYS_FLAGSCLR (V2M_SYSREGS + 0x034)
49#define V2M_SYS_NVFLAGS (V2M_SYSREGS + 0x038)
50#define V2M_SYS_NVFLAGSSET (V2M_SYSREGS + 0x038)
51#define V2M_SYS_NVFLAGSCLR (V2M_SYSREGS + 0x03c)
52#define V2M_SYS_MCI (V2M_SYSREGS + 0x048)
53#define V2M_SYS_FLASH (V2M_SYSREGS + 0x03c)
54#define V2M_SYS_CFGSW (V2M_SYSREGS + 0x058)
55#define V2M_SYS_24MHZ (V2M_SYSREGS + 0x05c)
56#define V2M_SYS_MISC (V2M_SYSREGS + 0x060)
57#define V2M_SYS_DMA (V2M_SYSREGS + 0x064)
58#define V2M_SYS_PROCID0 (V2M_SYSREGS + 0x084)
59#define V2M_SYS_PROCID1 (V2M_SYSREGS + 0x088)
60#define V2M_SYS_CFGDATA (V2M_SYSREGS + 0x0a0)
61#define V2M_SYS_CFGCTRL (V2M_SYSREGS + 0x0a4)
62#define V2M_SYS_CFGSTAT (V2M_SYSREGS + 0x0a8)
63
64#define V2M_TIMER0 (V2M_TIMER01 + 0x000)
65#define V2M_TIMER1 (V2M_TIMER01 + 0x020)
66
67#define V2M_TIMER2 (V2M_TIMER23 + 0x000)
68#define V2M_TIMER3 (V2M_TIMER23 + 0x020)
69
70
71/*
72 * Interrupts. Those in {} are for AMBA devices
73 */
74#define IRQ_V2M_WDT { (32 + 0) }
75#define IRQ_V2M_TIMER0 (32 + 2)
76#define IRQ_V2M_TIMER1 (32 + 2)
77#define IRQ_V2M_TIMER2 (32 + 3)
78#define IRQ_V2M_TIMER3 (32 + 3)
79#define IRQ_V2M_RTC { (32 + 4) }
80#define IRQ_V2M_UART0 { (32 + 5) }
81#define IRQ_V2M_UART1 { (32 + 6) }
82#define IRQ_V2M_UART2 { (32 + 7) }
83#define IRQ_V2M_UART3 { (32 + 8) }
84#define IRQ_V2M_MMCI { (32 + 9), (32 + 10) }
85#define IRQ_V2M_AACI { (32 + 11) }
86#define IRQ_V2M_KMI0 { (32 + 12) }
87#define IRQ_V2M_KMI1 { (32 + 13) }
88#define IRQ_V2M_CLCD { (32 + 14) }
89#define IRQ_V2M_LAN9118 (32 + 15)
90#define IRQ_V2M_ISP1761 (32 + 16)
91#define IRQ_V2M_PCIE (32 + 17)
92
93
94/*
95 * Configuration
96 */
97#define SYS_CFG_START (1 << 31)
98#define SYS_CFG_WRITE (1 << 30)
99#define SYS_CFG_OSC (1 << 20)
100#define SYS_CFG_VOLT (2 << 20)
101#define SYS_CFG_AMP (3 << 20)
102#define SYS_CFG_TEMP (4 << 20)
103#define SYS_CFG_RESET (5 << 20)
104#define SYS_CFG_SCC (6 << 20)
105#define SYS_CFG_MUXFPGA (7 << 20)
106#define SYS_CFG_SHUTDOWN (8 << 20)
107#define SYS_CFG_REBOOT (9 << 20)
108#define SYS_CFG_DVIMODE (11 << 20)
109#define SYS_CFG_POWER (12 << 20)
110#define SYS_CFG_SITE_MB (0 << 16)
111#define SYS_CFG_SITE_DB1 (1 << 16)
112#define SYS_CFG_SITE_DB2 (2 << 16)
113#define SYS_CFG_STACK(n) ((n) << 12)
114
115#define SYS_CFG_ERR (1 << 1)
116#define SYS_CFG_COMPLETE (1 << 0)
117
118int v2m_cfg_write(u32 devfn, u32 data);
119int v2m_cfg_read(u32 devfn, u32 *data);
120
121#endif
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h
new file mode 100644
index 000000000000..72a9621ed087
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/smp.h
@@ -0,0 +1,21 @@
1#ifndef __MACH_SMP_H
2#define __MACH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6#define hard_smp_processor_id() \
7 ({ \
8 unsigned int cpunum; \
9 __asm__("mrc p15, 0, %0, c0, c0, 5" \
10 : "=r" (cpunum)); \
11 cpunum &= 0x0F; \
12 })
13
14/*
15 * We use IRQ1 as the IPI
16 */
17static inline void smp_cross_call(const struct cpumask *mask)
18{
19 gic_raise_softirq(mask, 1);
20}
21#endif
diff --git a/arch/arm/mach-vexpress/include/mach/system.h b/arch/arm/mach-vexpress/include/mach/system.h
new file mode 100644
index 000000000000..899a4e628a4c
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/system.h
@@ -0,0 +1,37 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/system.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __ASM_ARCH_SYSTEM_H
22#define __ASM_ARCH_SYSTEM_H
23
24static inline void arch_idle(void)
25{
26 /*
27 * This should do all the clock switching
28 * and wait for interrupt tricks
29 */
30 cpu_do_idle();
31}
32
33static inline void arch_reset(char mode, const char *cmd)
34{
35}
36
37#endif
diff --git a/arch/arm/mach-vexpress/include/mach/timex.h b/arch/arm/mach-vexpress/include/mach/timex.h
new file mode 100644
index 000000000000..00029bacd43c
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/timex.h
@@ -0,0 +1,23 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/timex.h
3 *
4 * RealView architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
new file mode 100644
index 000000000000..7972c5748d0e
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -0,0 +1,52 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/uncompress.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
21#define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c))
22#define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30))
23#define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18))
24
25#define get_uart_base() (0x10000000 + 0x00009000)
26
27/*
28 * This does not append a newline
29 */
30static inline void putc(int c)
31{
32 unsigned long base = get_uart_base();
33
34 while (AMBA_UART_FR(base) & (1 << 5))
35 barrier();
36
37 AMBA_UART_DR(base) = c;
38}
39
40static inline void flush(void)
41{
42 unsigned long base = get_uart_base();
43
44 while (AMBA_UART_FR(base) & (1 << 3))
45 barrier();
46}
47
48/*
49 * nothing to do
50 */
51#define arch_decomp_setup()
52#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vexpress/include/mach/vmalloc.h b/arch/arm/mach-vexpress/include/mach/vmalloc.h
new file mode 100644
index 000000000000..f43a36ef678b
--- /dev/null
+++ b/arch/arm/mach-vexpress/include/mach/vmalloc.h
@@ -0,0 +1,21 @@
1/*
2 * arch/arm/mach-vexpress/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 * Copyright (C) 2000 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#define VMALLOC_END 0xf8000000UL
diff --git a/arch/arm/mach-vexpress/localtimer.c b/arch/arm/mach-vexpress/localtimer.c
new file mode 100644
index 000000000000..c0e3a59a0bfc
--- /dev/null
+++ b/arch/arm/mach-vexpress/localtimer.c
@@ -0,0 +1,26 @@
1/*
2 * linux/arch/arm/mach-vexpress/localtimer.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/smp.h>
13#include <linux/clockchips.h>
14
15#include <asm/smp_twd.h>
16#include <asm/localtimer.h>
17#include <mach/irqs.h>
18
19/*
20 * Setup the local clock events for a CPU.
21 */
22void __cpuinit local_timer_setup(struct clock_event_device *evt)
23{
24 evt->irq = IRQ_LOCALTIMER;
25 twd_timer_setup(evt);
26}
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
new file mode 100644
index 000000000000..670970699ba9
--- /dev/null
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -0,0 +1,190 @@
1/*
2 * linux/arch/arm/mach-vexpress/platsmp.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/jiffies.h>
16#include <linux/smp.h>
17#include <linux/io.h>
18
19#include <asm/cacheflush.h>
20#include <asm/localtimer.h>
21#include <asm/smp_scu.h>
22#include <asm/unified.h>
23
24#include <mach/ct-ca9x4.h>
25#include <mach/motherboard.h>
26#define V2M_PA_CS7 0x10000000
27
28#include "core.h"
29
30extern void vexpress_secondary_startup(void);
31
32/*
33 * control for which core is the next to come out of the secondary
34 * boot "holding pen"
35 */
36volatile int __cpuinitdata pen_release = -1;
37
38static void __iomem *scu_base_addr(void)
39{
40 return MMIO_P2V(A9_MPCORE_SCU);
41}
42
43static DEFINE_SPINLOCK(boot_lock);
44
45void __cpuinit platform_secondary_init(unsigned int cpu)
46{
47 trace_hardirqs_off();
48
49 /*
50 * if any interrupts are already enabled for the primary
51 * core (e.g. timer irq), then they will not have been enabled
52 * for us: do so
53 */
54 gic_cpu_init(0, gic_cpu_base_addr);
55
56 /*
57 * let the primary processor know we're out of the
58 * pen, then head off into the C entry point
59 */
60 pen_release = -1;
61 smp_wmb();
62
63 /*
64 * Synchronise with the boot thread.
65 */
66 spin_lock(&boot_lock);
67 spin_unlock(&boot_lock);
68}
69
70int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
71{
72 unsigned long timeout;
73
74 /*
75 * Set synchronisation state between this boot processor
76 * and the secondary one
77 */
78 spin_lock(&boot_lock);
79
80 /*
81 * This is really belt and braces; we hold unintended secondary
82 * CPUs in the holding pen until we're ready for them. However,
83 * since we haven't sent them a soft interrupt, they shouldn't
84 * be there.
85 */
86 pen_release = cpu;
87 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
88 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
89
90 /*
91 * Send the secondary CPU a soft interrupt, thereby causing
92 * the boot monitor to read the system wide flags register,
93 * and branch to the address found there.
94 */
95 smp_cross_call(cpumask_of(cpu));
96
97 timeout = jiffies + (1 * HZ);
98 while (time_before(jiffies, timeout)) {
99 smp_rmb();
100 if (pen_release == -1)
101 break;
102
103 udelay(10);
104 }
105
106 /*
107 * now the secondary core is starting up let it run its
108 * calibrations, then wait for it to finish
109 */
110 spin_unlock(&boot_lock);
111
112 return pen_release != -1 ? -ENOSYS : 0;
113}
114
115/*
116 * Initialise the CPU possible map early - this describes the CPUs
117 * which may be present or become present in the system.
118 */
119void __init smp_init_cpus(void)
120{
121 void __iomem *scu_base = scu_base_addr();
122 unsigned int i, ncores;
123
124 ncores = scu_base ? scu_get_core_count(scu_base) : 1;
125
126 /* sanity check */
127 if (ncores == 0) {
128 printk(KERN_ERR
129 "vexpress: strange CM count of 0? Default to 1\n");
130
131 ncores = 1;
132 }
133
134 if (ncores > NR_CPUS) {
135 printk(KERN_WARNING
136 "vexpress: no. of cores (%d) greater than configured "
137 "maximum of %d - clipping\n",
138 ncores, NR_CPUS);
139 ncores = NR_CPUS;
140 }
141
142 for (i = 0; i < ncores; i++)
143 set_cpu_possible(i, true);
144}
145
146void __init smp_prepare_cpus(unsigned int max_cpus)
147{
148 unsigned int ncores = num_possible_cpus();
149 unsigned int cpu = smp_processor_id();
150 int i;
151
152 smp_store_cpu_info(cpu);
153
154 /*
155 * are we trying to boot more cores than exist?
156 */
157 if (max_cpus > ncores)
158 max_cpus = ncores;
159
160 /*
161 * Initialise the present map, which describes the set of CPUs
162 * actually populated at the present time.
163 */
164 for (i = 0; i < max_cpus; i++)
165 set_cpu_present(i, true);
166
167 /*
168 * Initialise the SCU if there are more than one CPU and let
169 * them know where to start.
170 */
171 if (max_cpus > 1) {
172 /*
173 * Enable the local timer or broadcast device for the
174 * boot CPU, but only if we have more than one CPU.
175 */
176 percpu_timer_setup();
177
178 scu_enable(scu_base_addr());
179
180 /*
181 * Write the address of secondary startup into the
182 * system-wide flags register. The boot monitor waits
183 * until it receives a soft interrupt, and then the
184 * secondary CPU branches to this address.
185 */
186 writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
187 writel(BSYM(virt_to_phys(vexpress_secondary_startup)),
188 MMIO_P2V(V2M_SYS_FLAGSSET));
189 }
190}
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
new file mode 100644
index 000000000000..d250711b8c7a
--- /dev/null
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -0,0 +1,361 @@
1/*
2 * Versatile Express V2M Motherboard Support
3 */
4#include <linux/device.h>
5#include <linux/amba/bus.h>
6#include <linux/amba/mmci.h>
7#include <linux/io.h>
8#include <linux/init.h>
9#include <linux/platform_device.h>
10#include <linux/smsc911x.h>
11#include <linux/spinlock.h>
12#include <linux/sysdev.h>
13#include <linux/usb/isp1760.h>
14
15#include <asm/clkdev.h>
16#include <asm/sizes.h>
17#include <asm/mach/flash.h>
18#include <asm/mach/map.h>
19#include <asm/mach/time.h>
20#include <asm/hardware/arm_timer.h>
21
22#include <mach/clkdev.h>
23#include <mach/motherboard.h>
24
25#include <plat/timer-sp.h>
26
27#include "core.h"
28
29#define V2M_PA_CS0 0x40000000
30#define V2M_PA_CS1 0x44000000
31#define V2M_PA_CS2 0x48000000
32#define V2M_PA_CS3 0x4c000000
33#define V2M_PA_CS7 0x10000000
34
35static struct map_desc v2m_io_desc[] __initdata = {
36 {
37 .virtual = __MMIO_P2V(V2M_PA_CS7),
38 .pfn = __phys_to_pfn(V2M_PA_CS7),
39 .length = SZ_128K,
40 .type = MT_DEVICE,
41 },
42};
43
44void __init v2m_map_io(struct map_desc *tile, size_t num)
45{
46 iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
47 iotable_init(tile, num);
48}
49
50
51static void v2m_timer_init(void)
52{
53 writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
54 writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
55
56 sp804_clocksource_init(MMIO_P2V(V2M_TIMER1));
57 sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
58}
59
60struct sys_timer v2m_timer = {
61 .init = v2m_timer_init,
62};
63
64
65static DEFINE_SPINLOCK(v2m_cfg_lock);
66
67int v2m_cfg_write(u32 devfn, u32 data)
68{
69 /* Configuration interface broken? */
70 u32 val;
71
72 printk("%s: writing %08x to %08x\n", __func__, data, devfn);
73
74 devfn |= SYS_CFG_START | SYS_CFG_WRITE;
75
76 spin_lock(&v2m_cfg_lock);
77 val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
78 writel(val & ~SYS_CFG_COMPLETE, MMIO_P2V(V2M_SYS_CFGSTAT));
79
80 writel(data, MMIO_P2V(V2M_SYS_CFGDATA));
81 writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
82
83 do {
84 val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
85 } while (val == 0);
86 spin_unlock(&v2m_cfg_lock);
87
88 return !!(val & SYS_CFG_ERR);
89}
90
91int v2m_cfg_read(u32 devfn, u32 *data)
92{
93 u32 val;
94
95 devfn |= SYS_CFG_START;
96
97 spin_lock(&v2m_cfg_lock);
98 writel(0, MMIO_P2V(V2M_SYS_CFGSTAT));
99 writel(devfn, MMIO_P2V(V2M_SYS_CFGCTRL));
100
101 mb();
102
103 do {
104 cpu_relax();
105 val = readl(MMIO_P2V(V2M_SYS_CFGSTAT));
106 } while (val == 0);
107
108 *data = readl(MMIO_P2V(V2M_SYS_CFGDATA));
109 spin_unlock(&v2m_cfg_lock);
110
111 return !!(val & SYS_CFG_ERR);
112}
113
114
115static struct resource v2m_pcie_i2c_resource = {
116 .start = V2M_SERIAL_BUS_PCI,
117 .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1,
118 .flags = IORESOURCE_MEM,
119};
120
121static struct platform_device v2m_pcie_i2c_device = {
122 .name = "versatile-i2c",
123 .id = 0,
124 .num_resources = 1,
125 .resource = &v2m_pcie_i2c_resource,
126};
127
128static struct resource v2m_ddc_i2c_resource = {
129 .start = V2M_SERIAL_BUS_DVI,
130 .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1,
131 .flags = IORESOURCE_MEM,
132};
133
134static struct platform_device v2m_ddc_i2c_device = {
135 .name = "versatile-i2c",
136 .id = 1,
137 .num_resources = 1,
138 .resource = &v2m_ddc_i2c_resource,
139};
140
141static struct resource v2m_eth_resources[] = {
142 {
143 .start = V2M_LAN9118,
144 .end = V2M_LAN9118 + SZ_64K - 1,
145 .flags = IORESOURCE_MEM,
146 }, {
147 .start = IRQ_V2M_LAN9118,
148 .end = IRQ_V2M_LAN9118,
149 .flags = IORESOURCE_IRQ,
150 },
151};
152
153static struct smsc911x_platform_config v2m_eth_config = {
154 .flags = SMSC911X_USE_32BIT,
155 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
156 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
157 .phy_interface = PHY_INTERFACE_MODE_MII,
158};
159
160static struct platform_device v2m_eth_device = {
161 .name = "smsc911x",
162 .id = -1,
163 .resource = v2m_eth_resources,
164 .num_resources = ARRAY_SIZE(v2m_eth_resources),
165 .dev.platform_data = &v2m_eth_config,
166};
167
168static struct resource v2m_usb_resources[] = {
169 {
170 .start = V2M_ISP1761,
171 .end = V2M_ISP1761 + SZ_128K - 1,
172 .flags = IORESOURCE_MEM,
173 }, {
174 .start = IRQ_V2M_ISP1761,
175 .end = IRQ_V2M_ISP1761,
176 .flags = IORESOURCE_IRQ,
177 },
178};
179
180static struct isp1760_platform_data v2m_usb_config = {
181 .is_isp1761 = true,
182 .bus_width_16 = false,
183 .port1_otg = true,
184 .analog_oc = false,
185 .dack_polarity_high = false,
186 .dreq_polarity_high = false,
187};
188
189static struct platform_device v2m_usb_device = {
190 .name = "isp1760",
191 .id = -1,
192 .resource = v2m_usb_resources,
193 .num_resources = ARRAY_SIZE(v2m_usb_resources),
194 .dev.platform_data = &v2m_usb_config,
195};
196
197static int v2m_flash_init(void)
198{
199 writel(0, MMIO_P2V(V2M_SYS_FLASH));
200 return 0;
201}
202
203static void v2m_flash_exit(void)
204{
205 writel(0, MMIO_P2V(V2M_SYS_FLASH));
206}
207
208static void v2m_flash_set_vpp(int on)
209{
210 writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
211}
212
213static struct flash_platform_data v2m_flash_data = {
214 .map_name = "cfi_probe",
215 .width = 4,
216 .init = v2m_flash_init,
217 .exit = v2m_flash_exit,
218 .set_vpp = v2m_flash_set_vpp,
219};
220
221static struct resource v2m_flash_resources[] = {
222 {
223 .start = V2M_NOR0,
224 .end = V2M_NOR0 + SZ_64M - 1,
225 .flags = IORESOURCE_MEM,
226 }, {
227 .start = V2M_NOR1,
228 .end = V2M_NOR1 + SZ_64M - 1,
229 .flags = IORESOURCE_MEM,
230 },
231};
232
233static struct platform_device v2m_flash_device = {
234 .name = "armflash",
235 .id = -1,
236 .resource = v2m_flash_resources,
237 .num_resources = ARRAY_SIZE(v2m_flash_resources),
238 .dev.platform_data = &v2m_flash_data,
239};
240
241
242static unsigned int v2m_mmci_status(struct device *dev)
243{
244 return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0));
245}
246
247static struct mmci_platform_data v2m_mmci_data = {
248 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
249 .status = v2m_mmci_status,
250};
251
252static AMBA_DEVICE(aaci, "mb:aaci", V2M_AACI, NULL);
253static AMBA_DEVICE(mmci, "mb:mmci", V2M_MMCI, &v2m_mmci_data);
254static AMBA_DEVICE(kmi0, "mb:kmi0", V2M_KMI0, NULL);
255static AMBA_DEVICE(kmi1, "mb:kmi1", V2M_KMI1, NULL);
256static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL);
257static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL);
258static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL);
259static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL);
260static AMBA_DEVICE(wdt, "mb:wdt", V2M_WDT, NULL);
261static AMBA_DEVICE(rtc, "mb:rtc", V2M_RTC, NULL);
262
263static struct amba_device *v2m_amba_devs[] __initdata = {
264 &aaci_device,
265 &mmci_device,
266 &kmi0_device,
267 &kmi1_device,
268 &uart0_device,
269 &uart1_device,
270 &uart2_device,
271 &uart3_device,
272 &wdt_device,
273 &rtc_device,
274};
275
276
277static long v2m_osc_round(struct clk *clk, unsigned long rate)
278{
279 return rate;
280}
281
282static int v2m_osc1_set(struct clk *clk, unsigned long rate)
283{
284 return v2m_cfg_write(SYS_CFG_OSC | SYS_CFG_SITE_MB | 1, rate);
285}
286
287static const struct clk_ops osc1_clk_ops = {
288 .round = v2m_osc_round,
289 .set = v2m_osc1_set,
290};
291
292static struct clk osc1_clk = {
293 .ops = &osc1_clk_ops,
294 .rate = 24000000,
295};
296
297static struct clk osc2_clk = {
298 .rate = 24000000,
299};
300
301static struct clk_lookup v2m_lookups[] = {
302 { /* UART0 */
303 .dev_id = "mb:uart0",
304 .clk = &osc2_clk,
305 }, { /* UART1 */
306 .dev_id = "mb:uart1",
307 .clk = &osc2_clk,
308 }, { /* UART2 */
309 .dev_id = "mb:uart2",
310 .clk = &osc2_clk,
311 }, { /* UART3 */
312 .dev_id = "mb:uart3",
313 .clk = &osc2_clk,
314 }, { /* KMI0 */
315 .dev_id = "mb:kmi0",
316 .clk = &osc2_clk,
317 }, { /* KMI1 */
318 .dev_id = "mb:kmi1",
319 .clk = &osc2_clk,
320 }, { /* MMC0 */
321 .dev_id = "mb:mmci",
322 .clk = &osc2_clk,
323 }, { /* CLCD */
324 .dev_id = "mb:clcd",
325 .clk = &osc1_clk,
326 },
327};
328
329static void v2m_power_off(void)
330{
331 if (v2m_cfg_write(SYS_CFG_SHUTDOWN | SYS_CFG_SITE_MB, 0))
332 printk(KERN_EMERG "Unable to shutdown\n");
333}
334
335static void v2m_restart(char str, const char *cmd)
336{
337 if (v2m_cfg_write(SYS_CFG_REBOOT | SYS_CFG_SITE_MB, 0))
338 printk(KERN_EMERG "Unable to reboot\n");
339}
340
341static int __init v2m_init(void)
342{
343 int i;
344
345 clkdev_add_table(v2m_lookups, ARRAY_SIZE(v2m_lookups));
346
347 platform_device_register(&v2m_pcie_i2c_device);
348 platform_device_register(&v2m_ddc_i2c_device);
349 platform_device_register(&v2m_flash_device);
350 platform_device_register(&v2m_eth_device);
351 platform_device_register(&v2m_usb_device);
352
353 for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++)
354 amba_device_register(v2m_amba_devs[i], &iomem_resource);
355
356 pm_power_off = v2m_power_off;
357 arm_pm_restart = v2m_restart;
358
359 return 0;
360}
361arch_initcall(v2m_init);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 573528d9c6d8..33027301639e 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -754,7 +754,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
754config CACHE_L2X0 754config CACHE_L2X0
755 bool "Enable the L2x0 outer cache controller" 755 bool "Enable the L2x0 outer cache controller"
756 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 756 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
757 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || ARCH_NOMADIK || ARCH_OMAP4 757 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \
758 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4
758 default y 759 default y
759 select OUTER_CACHE 760 select OUTER_CACHE
760 help 761 help
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile
index 36bff0325959..69b09c1cec8b 100644
--- a/arch/arm/plat-iop/Makefile
+++ b/arch/arm/plat-iop/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_IOP32X) += time.o
13obj-$(CONFIG_ARCH_IOP32X) += io.o 13obj-$(CONFIG_ARCH_IOP32X) += io.o
14obj-$(CONFIG_ARCH_IOP32X) += cp6.o 14obj-$(CONFIG_ARCH_IOP32X) += cp6.o
15obj-$(CONFIG_ARCH_IOP32X) += adma.o 15obj-$(CONFIG_ARCH_IOP32X) += adma.o
16obj-$(CONFIG_ARCH_IOP32X) += pmu.o
16 17
17# IOP33X 18# IOP33X
18obj-$(CONFIG_ARCH_IOP33X) += gpio.o 19obj-$(CONFIG_ARCH_IOP33X) += gpio.o
@@ -23,6 +24,7 @@ obj-$(CONFIG_ARCH_IOP33X) += time.o
23obj-$(CONFIG_ARCH_IOP33X) += io.o 24obj-$(CONFIG_ARCH_IOP33X) += io.o
24obj-$(CONFIG_ARCH_IOP33X) += cp6.o 25obj-$(CONFIG_ARCH_IOP33X) += cp6.o
25obj-$(CONFIG_ARCH_IOP33X) += adma.o 26obj-$(CONFIG_ARCH_IOP33X) += adma.o
27obj-$(CONFIG_ARCH_IOP33X) += pmu.o
26 28
27# IOP13XX 29# IOP13XX
28obj-$(CONFIG_ARCH_IOP13XX) += cp6.o 30obj-$(CONFIG_ARCH_IOP13XX) += cp6.o
diff --git a/arch/arm/plat-iop/pmu.c b/arch/arm/plat-iop/pmu.c
new file mode 100644
index 000000000000..a2024b8685a1
--- /dev/null
+++ b/arch/arm/plat-iop/pmu.c
@@ -0,0 +1,40 @@
1/*
2 * PMU IRQ registration for the iop3xx xscale PMU families.
3 * Copyright (C) 2010 Will Deacon, ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/platform_device.h>
12#include <asm/pmu.h>
13#include <mach/irqs.h>
14
15static struct resource pmu_resource = {
16#ifdef CONFIG_ARCH_IOP32X
17 .start = IRQ_IOP32X_CORE_PMU,
18 .end = IRQ_IOP32X_CORE_PMU,
19#endif
20#ifdef CONFIG_ARCH_IOP33X
21 .start = IRQ_IOP33X_CORE_PMU,
22 .end = IRQ_IOP33X_CORE_PMU,
23#endif
24 .flags = IORESOURCE_IRQ,
25};
26
27static struct platform_device pmu_device = {
28 .name = "arm-pmu",
29 .id = ARM_PMU_DEVICE_CPU,
30 .resource = &pmu_resource,
31 .num_resources = 1,
32};
33
34static int __init iop3xx_pmu_init(void)
35{
36 platform_device_register(&pmu_device);
37 return 0;
38}
39
40arch_initcall(iop3xx_pmu_init);
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index 159daf583f85..5da3f97c537b 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -19,4 +19,9 @@ config HAS_MTU
19 to multiple interrupt generating programmable 19 to multiple interrupt generating programmable
20 32-bit free running decrementing counters. 20 32-bit free running decrementing counters.
21 21
22config NOMADIK_GPIO
23 bool
24 help
25 Support for the Nomadik GPIO controller.
26
22endif 27endif
diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile
index 37c7cdd0f8f0..c33547361bd7 100644
--- a/arch/arm/plat-nomadik/Makefile
+++ b/arch/arm/plat-nomadik/Makefile
@@ -3,3 +3,4 @@
3# Licensed under GPLv2 3# Licensed under GPLv2
4 4
5obj-$(CONFIG_HAS_MTU) += timer.o 5obj-$(CONFIG_HAS_MTU) += timer.o
6obj-$(CONFIG_NOMADIK_GPIO) += gpio.o
diff --git a/arch/arm/mach-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 9a09b2791e03..d28900cfa541 100644
--- a/arch/arm/mach-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -13,8 +13,10 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/amba/bus.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/clk.h>
19#include <linux/err.h>
18#include <linux/gpio.h> 20#include <linux/gpio.h>
19#include <linux/spinlock.h> 21#include <linux/spinlock.h>
20#include <linux/interrupt.h> 22#include <linux/interrupt.h>
@@ -35,8 +37,9 @@
35struct nmk_gpio_chip { 37struct nmk_gpio_chip {
36 struct gpio_chip chip; 38 struct gpio_chip chip;
37 void __iomem *addr; 39 void __iomem *addr;
40 struct clk *clk;
38 unsigned int parent_irq; 41 unsigned int parent_irq;
39 spinlock_t *lock; 42 spinlock_t lock;
40 /* Keep track of configured edges */ 43 /* Keep track of configured edges */
41 u32 edge_rising; 44 u32 edge_rising;
42 u32 edge_falling; 45 u32 edge_falling;
@@ -107,40 +110,37 @@ static void nmk_gpio_irq_ack(unsigned int irq)
107 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); 110 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
108} 111}
109 112
110static void nmk_gpio_irq_mask(unsigned int irq) 113static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
114 int gpio, bool enable)
111{ 115{
112 int gpio; 116 u32 bitmask = nmk_gpio_get_bitmask(gpio);
113 struct nmk_gpio_chip *nmk_chip; 117 u32 reg;
114 unsigned long flags;
115 u32 bitmask, reg;
116
117 gpio = NOMADIK_IRQ_TO_GPIO(irq);
118 nmk_chip = get_irq_chip_data(irq);
119 bitmask = nmk_gpio_get_bitmask(gpio);
120 if (!nmk_chip)
121 return;
122 118
123 /* we must individually clear the two edges */ 119 /* we must individually set/clear the two edges */
124 spin_lock_irqsave(&nmk_chip->lock, flags);
125 if (nmk_chip->edge_rising & bitmask) { 120 if (nmk_chip->edge_rising & bitmask) {
126 reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC); 121 reg = readl(nmk_chip->addr + NMK_GPIO_RIMSC);
127 reg &= ~bitmask; 122 if (enable)
128 writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC); 123 reg |= bitmask;
124 else
125 reg &= ~bitmask;
126 writel(reg, nmk_chip->addr + NMK_GPIO_RIMSC);
129 } 127 }
130 if (nmk_chip->edge_falling & bitmask) { 128 if (nmk_chip->edge_falling & bitmask) {
131 reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC); 129 reg = readl(nmk_chip->addr + NMK_GPIO_FIMSC);
132 reg &= ~bitmask; 130 if (enable)
133 writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC); 131 reg |= bitmask;
132 else
133 reg &= ~bitmask;
134 writel(reg, nmk_chip->addr + NMK_GPIO_FIMSC);
134 } 135 }
135 spin_unlock_irqrestore(&nmk_chip->lock, flags); 136}
136};
137 137
138static void nmk_gpio_irq_unmask(unsigned int irq) 138static void nmk_gpio_irq_modify(unsigned int irq, bool enable)
139{ 139{
140 int gpio; 140 int gpio;
141 struct nmk_gpio_chip *nmk_chip; 141 struct nmk_gpio_chip *nmk_chip;
142 unsigned long flags; 142 unsigned long flags;
143 u32 bitmask, reg; 143 u32 bitmask;
144 144
145 gpio = NOMADIK_IRQ_TO_GPIO(irq); 145 gpio = NOMADIK_IRQ_TO_GPIO(irq);
146 nmk_chip = get_irq_chip_data(irq); 146 nmk_chip = get_irq_chip_data(irq);
@@ -148,23 +148,24 @@ static void nmk_gpio_irq_unmask(unsigned int irq)
148 if (!nmk_chip) 148 if (!nmk_chip)
149 return; 149 return;
150 150
151 /* we must individually set the two edges */
152 spin_lock_irqsave(&nmk_chip->lock, flags); 151 spin_lock_irqsave(&nmk_chip->lock, flags);
153 if (nmk_chip->edge_rising & bitmask) { 152 __nmk_gpio_irq_modify(nmk_chip, gpio, enable);
154 reg = readl(nmk_chip->addr + NMK_GPIO_RWIMSC);
155 reg |= bitmask;
156 writel(reg, nmk_chip->addr + NMK_GPIO_RWIMSC);
157 }
158 if (nmk_chip->edge_falling & bitmask) {
159 reg = readl(nmk_chip->addr + NMK_GPIO_FWIMSC);
160 reg |= bitmask;
161 writel(reg, nmk_chip->addr + NMK_GPIO_FWIMSC);
162 }
163 spin_unlock_irqrestore(&nmk_chip->lock, flags); 153 spin_unlock_irqrestore(&nmk_chip->lock, flags);
164} 154}
165 155
156static void nmk_gpio_irq_mask(unsigned int irq)
157{
158 nmk_gpio_irq_modify(irq, false);
159};
160
161static void nmk_gpio_irq_unmask(unsigned int irq)
162{
163 nmk_gpio_irq_modify(irq, true);
164}
165
166static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) 166static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
167{ 167{
168 bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED);
168 int gpio; 169 int gpio;
169 struct nmk_gpio_chip *nmk_chip; 170 struct nmk_gpio_chip *nmk_chip;
170 unsigned long flags; 171 unsigned long flags;
@@ -183,19 +184,21 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
183 184
184 spin_lock_irqsave(&nmk_chip->lock, flags); 185 spin_lock_irqsave(&nmk_chip->lock, flags);
185 186
187 if (enabled)
188 __nmk_gpio_irq_modify(nmk_chip, gpio, false);
189
186 nmk_chip->edge_rising &= ~bitmask; 190 nmk_chip->edge_rising &= ~bitmask;
187 if (type & IRQ_TYPE_EDGE_RISING) 191 if (type & IRQ_TYPE_EDGE_RISING)
188 nmk_chip->edge_rising |= bitmask; 192 nmk_chip->edge_rising |= bitmask;
189 writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC);
190 193
191 nmk_chip->edge_falling &= ~bitmask; 194 nmk_chip->edge_falling &= ~bitmask;
192 if (type & IRQ_TYPE_EDGE_FALLING) 195 if (type & IRQ_TYPE_EDGE_FALLING)
193 nmk_chip->edge_falling |= bitmask; 196 nmk_chip->edge_falling |= bitmask;
194 writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC);
195 197
196 spin_unlock_irqrestore(&nmk_chip->lock, flags); 198 if (enabled)
199 __nmk_gpio_irq_modify(nmk_chip, gpio, true);
197 200
198 nmk_gpio_irq_unmask(irq); 201 spin_unlock_irqrestore(&nmk_chip->lock, flags);
199 202
200 return 0; 203 return 0;
201} 204}
@@ -211,21 +214,27 @@ static struct irq_chip nmk_gpio_irq_chip = {
211static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 214static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
212{ 215{
213 struct nmk_gpio_chip *nmk_chip; 216 struct nmk_gpio_chip *nmk_chip;
214 struct irq_chip *host_chip; 217 struct irq_chip *host_chip = get_irq_chip(irq);
215 unsigned int gpio_irq; 218 unsigned int gpio_irq;
216 u32 pending; 219 u32 pending;
217 unsigned int first_irq; 220 unsigned int first_irq;
218 221
222 if (host_chip->mask_ack)
223 host_chip->mask_ack(irq);
224 else {
225 host_chip->mask(irq);
226 if (host_chip->ack)
227 host_chip->ack(irq);
228 }
229
219 nmk_chip = get_irq_data(irq); 230 nmk_chip = get_irq_data(irq);
220 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); 231 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base);
221 while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { 232 while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) {
222 gpio_irq = first_irq + __ffs(pending); 233 gpio_irq = first_irq + __ffs(pending);
223 generic_handle_irq(gpio_irq); 234 generic_handle_irq(gpio_irq);
224 } 235 }
225 if (0) {/* don't ack parent irq, as ack == disable */ 236
226 host_chip = get_irq_chip(irq); 237 host_chip->unmask(irq);
227 host_chip->ack(irq);
228 }
229} 238}
230 239
231static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) 240static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
@@ -239,6 +248,7 @@ static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
239 set_irq_handler(i, handle_edge_irq); 248 set_irq_handler(i, handle_edge_irq);
240 set_irq_flags(i, IRQF_VALID); 249 set_irq_flags(i, IRQF_VALID);
241 set_irq_chip_data(i, nmk_chip); 250 set_irq_chip_data(i, nmk_chip);
251 set_irq_type(i, IRQ_TYPE_EDGE_FALLING);
242 } 252 }
243 set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); 253 set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler);
244 set_irq_data(nmk_chip->parent_irq, nmk_chip); 254 set_irq_data(nmk_chip->parent_irq, nmk_chip);
@@ -297,30 +307,59 @@ static struct gpio_chip nmk_gpio_template = {
297 .can_sleep = 0, 307 .can_sleep = 0,
298}; 308};
299 309
300static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id) 310static int __init nmk_gpio_probe(struct platform_device *dev)
301{ 311{
302 struct nmk_gpio_platform_data *pdata; 312 struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
303 struct nmk_gpio_chip *nmk_chip; 313 struct nmk_gpio_chip *nmk_chip;
304 struct gpio_chip *chip; 314 struct gpio_chip *chip;
315 struct resource *res;
316 struct clk *clk;
317 int irq;
305 int ret; 318 int ret;
306 319
307 pdata = dev->dev.platform_data; 320 if (!pdata)
308 ret = amba_request_regions(dev, pdata->name); 321 return -ENODEV;
309 if (ret) 322
310 return ret; 323 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
324 if (!res) {
325 ret = -ENOENT;
326 goto out;
327 }
328
329 irq = platform_get_irq(dev, 0);
330 if (irq < 0) {
331 ret = irq;
332 goto out;
333 }
334
335 if (request_mem_region(res->start, resource_size(res),
336 dev_name(&dev->dev)) == NULL) {
337 ret = -EBUSY;
338 goto out;
339 }
340
341 clk = clk_get(&dev->dev, NULL);
342 if (IS_ERR(clk)) {
343 ret = PTR_ERR(clk);
344 goto out_release;
345 }
346
347 clk_enable(clk);
311 348
312 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL); 349 nmk_chip = kzalloc(sizeof(*nmk_chip), GFP_KERNEL);
313 if (!nmk_chip) { 350 if (!nmk_chip) {
314 ret = -ENOMEM; 351 ret = -ENOMEM;
315 goto out_amba; 352 goto out_clk;
316 } 353 }
317 /* 354 /*
318 * The virt address in nmk_chip->addr is in the nomadik register space, 355 * The virt address in nmk_chip->addr is in the nomadik register space,
319 * so we can simply convert the resource address, without remapping 356 * so we can simply convert the resource address, without remapping
320 */ 357 */
321 nmk_chip->addr = io_p2v(dev->res.start); 358 nmk_chip->clk = clk;
359 nmk_chip->addr = io_p2v(res->start);
322 nmk_chip->chip = nmk_gpio_template; 360 nmk_chip->chip = nmk_gpio_template;
323 nmk_chip->parent_irq = pdata->parent_irq; 361 nmk_chip->parent_irq = irq;
362 spin_lock_init(&nmk_chip->lock);
324 363
325 chip = &nmk_chip->chip; 364 chip = &nmk_chip->chip;
326 chip->base = pdata->first_gpio; 365 chip->base = pdata->first_gpio;
@@ -332,7 +371,7 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id)
332 if (ret) 371 if (ret)
333 goto out_free; 372 goto out_free;
334 373
335 amba_set_drvdata(dev, nmk_chip); 374 platform_set_drvdata(dev, nmk_chip);
336 375
337 nmk_gpio_init_irq(nmk_chip); 376 nmk_gpio_init_irq(nmk_chip);
338 377
@@ -340,51 +379,50 @@ static int __init nmk_gpio_probe(struct amba_device *dev, struct amba_id *id)
340 nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr); 379 nmk_chip->chip.base, nmk_chip->chip.base+31, nmk_chip->addr);
341 return 0; 380 return 0;
342 381
343 out_free: 382out_free:
344 kfree(nmk_chip); 383 kfree(nmk_chip);
345 out_amba: 384out_clk:
346 amba_release_regions(dev); 385 clk_disable(clk);
386 clk_put(clk);
387out_release:
388 release_mem_region(res->start, resource_size(res));
389out:
347 dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret, 390 dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
348 pdata->first_gpio, pdata->first_gpio+31); 391 pdata->first_gpio, pdata->first_gpio+31);
349 return ret; 392 return ret;
350} 393}
351 394
352static int nmk_gpio_remove(struct amba_device *dev) 395static int __exit nmk_gpio_remove(struct platform_device *dev)
353{ 396{
354 struct nmk_gpio_chip *nmk_chip; 397 struct nmk_gpio_chip *nmk_chip;
398 struct resource *res;
355 399
356 nmk_chip = amba_get_drvdata(dev); 400 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
401
402 nmk_chip = platform_get_drvdata(dev);
357 gpiochip_remove(&nmk_chip->chip); 403 gpiochip_remove(&nmk_chip->chip);
404 clk_disable(nmk_chip->clk);
405 clk_put(nmk_chip->clk);
358 kfree(nmk_chip); 406 kfree(nmk_chip);
359 amba_release_regions(dev); 407 release_mem_region(res->start, resource_size(res));
360 return 0; 408 return 0;
361} 409}
362 410
363 411
364/* We have 0x1f080060 and 0x1f180060, accept both using the mask */ 412static struct platform_driver nmk_gpio_driver = {
365static struct amba_id nmk_gpio_ids[] = { 413 .driver = {
366 {
367 .id = 0x1f080060,
368 .mask = 0xffefffff,
369 },
370 {0, 0},
371};
372
373static struct amba_driver nmk_gpio_driver = {
374 .drv = {
375 .owner = THIS_MODULE, 414 .owner = THIS_MODULE,
376 .name = "gpio", 415 .name = "gpio",
377 }, 416 },
378 .probe = nmk_gpio_probe, 417 .probe = nmk_gpio_probe,
379 .remove = nmk_gpio_remove, 418 .remove = __exit_p(nmk_gpio_remove),
380 .suspend = NULL, /* to be done */ 419 .suspend = NULL, /* to be done */
381 .resume = NULL, 420 .resume = NULL,
382 .id_table = nmk_gpio_ids,
383}; 421};
384 422
385static int __init nmk_gpio_init(void) 423static int __init nmk_gpio_init(void)
386{ 424{
387 return amba_driver_register(&nmk_gpio_driver); 425 return platform_driver_register(&nmk_gpio_driver);
388} 426}
389 427
390arch_initcall(nmk_gpio_init); 428arch_initcall(nmk_gpio_init);
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
new file mode 100644
index 000000000000..4200811249ca
--- /dev/null
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -0,0 +1,70 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __ASM_PLAT_GPIO_H
13#define __ASM_PLAT_GPIO_H
14
15#include <asm-generic/gpio.h>
16
17/*
18 * These currently cause a function call to happen, they may be optimized
19 * if needed by adding cpu-specific defines to identify blocks
20 * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc)
21 */
22#define gpio_get_value __gpio_get_value
23#define gpio_set_value __gpio_set_value
24#define gpio_cansleep __gpio_cansleep
25#define gpio_to_irq __gpio_to_irq
26
27/*
28 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
29 * the "gpio" namespace for generic and cross-machine functions
30 */
31
32/* Register in the logic block */
33#define NMK_GPIO_DAT 0x00
34#define NMK_GPIO_DATS 0x04
35#define NMK_GPIO_DATC 0x08
36#define NMK_GPIO_PDIS 0x0c
37#define NMK_GPIO_DIR 0x10
38#define NMK_GPIO_DIRS 0x14
39#define NMK_GPIO_DIRC 0x18
40#define NMK_GPIO_SLPC 0x1c
41#define NMK_GPIO_AFSLA 0x20
42#define NMK_GPIO_AFSLB 0x24
43
44#define NMK_GPIO_RIMSC 0x40
45#define NMK_GPIO_FIMSC 0x44
46#define NMK_GPIO_IS 0x48
47#define NMK_GPIO_IC 0x4c
48#define NMK_GPIO_RWIMSC 0x50
49#define NMK_GPIO_FWIMSC 0x54
50#define NMK_GPIO_WKS 0x58
51
52/* Alternate functions: function C is set in hw by setting both A and B */
53#define NMK_GPIO_ALT_GPIO 0
54#define NMK_GPIO_ALT_A 1
55#define NMK_GPIO_ALT_B 2
56#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
57
58extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
59extern int nmk_gpio_get_mode(int gpio);
60
61/*
62 * Platform data to register a block: only the initial gpio/irq number.
63 */
64struct nmk_gpio_platform_data {
65 char *name;
66 int first_gpio;
67 int first_irq;
68};
69
70#endif /* __ASM_PLAT_GPIO_H */
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index fa7cb3a57cbf..0ff3798769ab 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -2,7 +2,7 @@
2 * linux/arch/arm/mach-nomadik/timer.c 2 * linux/arch/arm/mach-nomadik/timer.c
3 * 3 *
4 * Copyright (C) 2008 STMicroelectronics 4 * Copyright (C) 2008 STMicroelectronics
5 * Copyright (C) 2009 Alessandro Rubini, somewhat based on at91sam926x 5 * Copyright (C) 2010 Alessandro Rubini
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2, as 8 * it under the terms of the GNU General Public License version 2, as
@@ -18,123 +18,150 @@
18 18
19#include <plat/mtu.h> 19#include <plat/mtu.h>
20 20
21static u32 nmdk_count; /* accumulated count */ 21void __iomem *mtu_base; /* ssigned by machine code */
22static u32 nmdk_cycle; /* write-once */
23
24/* setup by the platform code */
25void __iomem *mtu_base;
26 22
27/* 23/*
28 * clocksource: the MTU device is a decrementing counters, so we negate 24 * Kernel assumes that sched_clock can be called early
29 * the value being read. 25 * but the MTU may not yet be initialized.
30 */ 26 */
31static cycle_t nmdk_read_timer(struct clocksource *cs) 27static cycle_t nmdk_read_timer_dummy(struct clocksource *cs)
32{ 28{
33 u32 count = readl(mtu_base + MTU_VAL(0)); 29 return 0;
34 return nmdk_count + nmdk_cycle - count; 30}
35 31
32/* clocksource: MTU decrements, so we negate the value being read. */
33static cycle_t nmdk_read_timer(struct clocksource *cs)
34{
35 return -readl(mtu_base + MTU_VAL(0));
36} 36}
37 37
38static struct clocksource nmdk_clksrc = { 38static struct clocksource nmdk_clksrc = {
39 .name = "mtu_0", 39 .name = "mtu_0",
40 .rating = 120, 40 .rating = 200,
41 .read = nmdk_read_timer, 41 .read = nmdk_read_timer_dummy,
42 .mask = CLOCKSOURCE_MASK(32),
42 .shift = 20, 43 .shift = 20,
43 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 44 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
44}; 45};
45 46
46/* 47/*
47 * Clockevent device: currently only periodic mode is supported 48 * Override the global weak sched_clock symbol with this
49 * local implementation which uses the clocksource to get some
50 * better resolution when scheduling the kernel. We accept that
51 * this wraps around for now, since it is just a relative time
52 * stamp. (Inspired by OMAP implementation.)
48 */ 53 */
54unsigned long long notrace sched_clock(void)
55{
56 return clocksource_cyc2ns(nmdk_clksrc.read(
57 &nmdk_clksrc),
58 nmdk_clksrc.mult,
59 nmdk_clksrc.shift);
60}
61
62/* Clockevent device: use one-shot mode */
49static void nmdk_clkevt_mode(enum clock_event_mode mode, 63static void nmdk_clkevt_mode(enum clock_event_mode mode,
50 struct clock_event_device *dev) 64 struct clock_event_device *dev)
51{ 65{
66 u32 cr;
67
52 switch (mode) { 68 switch (mode) {
53 case CLOCK_EVT_MODE_PERIODIC: 69 case CLOCK_EVT_MODE_PERIODIC:
54 /* count current value? */ 70 pr_err("%s: periodic mode not supported\n", __func__);
55 writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC);
56 break; 71 break;
57 case CLOCK_EVT_MODE_ONESHOT: 72 case CLOCK_EVT_MODE_ONESHOT:
58 BUG(); /* Not supported, yet */ 73 /* Load highest value, enable device, enable interrupts */
59 /* FALLTHROUGH */ 74 cr = readl(mtu_base + MTU_CR(1));
75 writel(0, mtu_base + MTU_LR(1));
76 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));
77 writel(0x2, mtu_base + MTU_IMSC);
78 break;
60 case CLOCK_EVT_MODE_SHUTDOWN: 79 case CLOCK_EVT_MODE_SHUTDOWN:
61 case CLOCK_EVT_MODE_UNUSED: 80 case CLOCK_EVT_MODE_UNUSED:
62 writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); 81 /* disable irq */
82 writel(0, mtu_base + MTU_IMSC);
63 break; 83 break;
64 case CLOCK_EVT_MODE_RESUME: 84 case CLOCK_EVT_MODE_RESUME:
65 break; 85 break;
66 } 86 }
67} 87}
68 88
89static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
90{
91 /* writing the value has immediate effect */
92 writel(evt, mtu_base + MTU_LR(1));
93 return 0;
94}
95
69static struct clock_event_device nmdk_clkevt = { 96static struct clock_event_device nmdk_clkevt = {
70 .name = "mtu_0", 97 .name = "mtu_1",
71 .features = CLOCK_EVT_FEAT_PERIODIC, 98 .features = CLOCK_EVT_FEAT_ONESHOT,
72 .shift = 32, 99 .shift = 32,
73 .rating = 100, 100 .rating = 200,
74 .set_mode = nmdk_clkevt_mode, 101 .set_mode = nmdk_clkevt_mode,
102 .set_next_event = nmdk_clkevt_next,
75}; 103};
76 104
77/* 105/*
78 * IRQ Handler for the timer 0 of the MTU block. The irq is not shared 106 * IRQ Handler for timer 1 of the MTU block.
79 * as we are the only users of mtu0 by now.
80 */ 107 */
81static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id) 108static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id)
82{ 109{
83 /* ack: "interrupt clear register" */ 110 struct clock_event_device *evdev = dev_id;
84 writel(1 << 0, mtu_base + MTU_ICR);
85
86 /* we can't count lost ticks, unfortunately */
87 nmdk_count += nmdk_cycle;
88 nmdk_clkevt.event_handler(&nmdk_clkevt);
89 111
112 writel(1 << 1, mtu_base + MTU_ICR); /* Interrupt clear reg */
113 evdev->event_handler(evdev);
90 return IRQ_HANDLED; 114 return IRQ_HANDLED;
91} 115}
92 116
93/*
94 * Set up timer interrupt, and return the current time in seconds.
95 */
96static struct irqaction nmdk_timer_irq = { 117static struct irqaction nmdk_timer_irq = {
97 .name = "Nomadik Timer Tick", 118 .name = "Nomadik Timer Tick",
98 .flags = IRQF_DISABLED | IRQF_TIMER, 119 .flags = IRQF_DISABLED | IRQF_TIMER,
99 .handler = nmdk_timer_interrupt, 120 .handler = nmdk_timer_interrupt,
121 .dev_id = &nmdk_clkevt,
100}; 122};
101 123
102static void nmdk_timer_reset(void)
103{
104 u32 cr;
105
106 writel(0, mtu_base + MTU_CR(0)); /* off */
107
108 /* configure load and background-load, and fire it up */
109 writel(nmdk_cycle, mtu_base + MTU_LR(0));
110 writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
111 cr = MTU_CRn_PERIODIC | MTU_CRn_PRESCALE_1 | MTU_CRn_32BITS;
112 writel(cr, mtu_base + MTU_CR(0));
113 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
114}
115
116void __init nmdk_timer_init(void) 124void __init nmdk_timer_init(void)
117{ 125{
118 unsigned long rate; 126 unsigned long rate;
119 int bits; 127 u32 cr = MTU_CRn_32BITS;;
120 128
121 rate = CLOCK_TICK_RATE; /* 2.4MHz */ 129 /*
122 nmdk_cycle = (rate + HZ/2) / HZ; 130 * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:
131 * use a divide-by-16 counter if it's more than 16MHz
132 */
133 rate = CLOCK_TICK_RATE;
134 if (rate > 16 << 20) {
135 rate /= 16;
136 cr |= MTU_CRn_PRESCALE_16;
137 } else {
138 cr |= MTU_CRn_PRESCALE_1;
139 }
123 140
124 /* Init the timer and register clocksource */ 141 /* Timer 0 is the free running clocksource */
125 nmdk_timer_reset(); 142 writel(cr, mtu_base + MTU_CR(0));
143 writel(0, mtu_base + MTU_LR(0));
144 writel(0, mtu_base + MTU_BGLR(0));
145 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
126 146
127 nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift); 147 nmdk_clksrc.mult = clocksource_hz2mult(rate, nmdk_clksrc.shift);
128 bits = 8*sizeof(nmdk_count); 148 /* Now the scheduling clock is ready */
129 nmdk_clksrc.mask = CLOCKSOURCE_MASK(bits); 149 nmdk_clksrc.read = nmdk_read_timer;
130 150
131 if (clocksource_register(&nmdk_clksrc)) 151 if (clocksource_register(&nmdk_clksrc))
132 printk(KERN_ERR "timer: failed to initialize clock " 152 pr_err("timer: failed to initialize clock source %s\n",
133 "source %s\n", nmdk_clksrc.name); 153 nmdk_clksrc.name);
154
155 /* Timer 1 is used for events, fix according to rate */
156 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
157 nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift);
158 nmdk_clkevt.max_delta_ns =
159 clockevent_delta2ns(0xffffffff, &nmdk_clkevt);
160 nmdk_clkevt.min_delta_ns =
161 clockevent_delta2ns(0x00000002, &nmdk_clkevt);
162 nmdk_clkevt.cpumask = cpumask_of(0);
134 163
135 /* Register irq and clockevents */ 164 /* Register irq and clockevents */
136 setup_irq(IRQ_MTU0, &nmdk_timer_irq); 165 setup_irq(IRQ_MTU0, &nmdk_timer_irq);
137 nmdk_clkevt.mult = div_sc(rate, NSEC_PER_SEC, nmdk_clkevt.shift);
138 nmdk_clkevt.cpumask = cpumask_of(0);
139 clockevents_register_device(&nmdk_clkevt); 166 clockevents_register_device(&nmdk_clkevt);
140} 167}
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile
index 0264bfb0ca4f..f68da35f4fb3 100644
--- a/arch/arm/plat-pxa/Makefile
+++ b/arch/arm/plat-pxa/Makefile
@@ -2,7 +2,7 @@
2# Makefile for code common across different PXA processor families 2# Makefile for code common across different PXA processor families
3# 3#
4 4
5obj-y := dma.o 5obj-y := dma.o pmu.o
6 6
7obj-$(CONFIG_GENERIC_GPIO) += gpio.o 7obj-$(CONFIG_GENERIC_GPIO) += gpio.o
8obj-$(CONFIG_PXA3xx) += mfp.o 8obj-$(CONFIG_PXA3xx) += mfp.o
diff --git a/arch/arm/plat-pxa/pmu.c b/arch/arm/plat-pxa/pmu.c
new file mode 100644
index 000000000000..267ceb6feb2f
--- /dev/null
+++ b/arch/arm/plat-pxa/pmu.c
@@ -0,0 +1,33 @@
1/*
2 * PMU IRQ registration for the PXA xscale PMU families.
3 * Copyright (C) 2010 Will Deacon, ARM Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/platform_device.h>
12#include <asm/pmu.h>
13#include <mach/irqs.h>
14
15static struct resource pmu_resource = {
16 .start = IRQ_PMU,
17 .end = IRQ_PMU,
18 .flags = IORESOURCE_IRQ,
19};
20
21static struct platform_device pmu_device = {
22 .name = "arm-pmu",
23 .id = ARM_PMU_DEVICE_CPU,
24 .resource = &pmu_resource,
25 .num_resources = 1,
26};
27
28static int __init pxa_pmu_init(void)
29{
30 platform_device_register(&pmu_device);
31 return 0;
32}
33arch_initcall(pxa_pmu_init);
diff --git a/arch/arm/plat-spear/Kconfig b/arch/arm/plat-spear/Kconfig
new file mode 100644
index 000000000000..1bb3dbce8810
--- /dev/null
+++ b/arch/arm/plat-spear/Kconfig
@@ -0,0 +1,31 @@
1#
2# SPEAr Platform configuration file
3#
4
5if PLAT_SPEAR
6
7choice
8 prompt "ST SPEAr Family"
9 default ARCH_SPEAR3XX
10
11config ARCH_SPEAR3XX
12 bool "SPEAr3XX"
13 select ARM_VIC
14 select CPU_ARM926T
15 help
16 Supports for ARM's SPEAR3XX family
17
18config ARCH_SPEAR6XX
19 bool "SPEAr6XX"
20 select ARM_VIC
21 select CPU_ARM926T
22 help
23 Supports for ARM's SPEAR6XX family
24
25endchoice
26
27# Adding SPEAr machine specific configuration files
28source "arch/arm/mach-spear3xx/Kconfig"
29source "arch/arm/mach-spear6xx/Kconfig"
30
31endif
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile
new file mode 100644
index 000000000000..eb89540aeda9
--- /dev/null
+++ b/arch/arm/plat-spear/Makefile
@@ -0,0 +1,8 @@
1#
2# SPEAr Platform specific Makefile
3#
4
5# Common support
6obj-y := clock.o padmux.o time.o
7
8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o
diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c
new file mode 100644
index 000000000000..ee4f90e534d8
--- /dev/null
+++ b/arch/arm/plat-spear/clock.c
@@ -0,0 +1,435 @@
1/*
2 * arch/arm/plat-spear/clock.c
3 *
4 * Clock framework for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/bug.h>
15#include <linux/err.h>
16#include <linux/io.h>
17#include <linux/list.h>
18#include <linux/module.h>
19#include <linux/spinlock.h>
20#include <mach/misc_regs.h>
21#include <plat/clock.h>
22
23static DEFINE_SPINLOCK(clocks_lock);
24static LIST_HEAD(root_clks);
25
26static void propagate_rate(struct list_head *);
27
28static int generic_clk_enable(struct clk *clk)
29{
30 unsigned int val;
31
32 if (!clk->en_reg)
33 return -EFAULT;
34
35 val = readl(clk->en_reg);
36 if (unlikely(clk->flags & RESET_TO_ENABLE))
37 val &= ~(1 << clk->en_reg_bit);
38 else
39 val |= 1 << clk->en_reg_bit;
40
41 writel(val, clk->en_reg);
42
43 return 0;
44}
45
46static void generic_clk_disable(struct clk *clk)
47{
48 unsigned int val;
49
50 if (!clk->en_reg)
51 return;
52
53 val = readl(clk->en_reg);
54 if (unlikely(clk->flags & RESET_TO_ENABLE))
55 val |= 1 << clk->en_reg_bit;
56 else
57 val &= ~(1 << clk->en_reg_bit);
58
59 writel(val, clk->en_reg);
60}
61
62/* generic clk ops */
63static struct clkops generic_clkops = {
64 .enable = generic_clk_enable,
65 .disable = generic_clk_disable,
66};
67
68/*
69 * clk_enable - inform the system when the clock source should be running.
70 * @clk: clock source
71 *
72 * If the clock can not be enabled/disabled, this should return success.
73 *
74 * Returns success (0) or negative errno.
75 */
76int clk_enable(struct clk *clk)
77{
78 unsigned long flags;
79 int ret = 0;
80
81 if (!clk || IS_ERR(clk))
82 return -EFAULT;
83
84 spin_lock_irqsave(&clocks_lock, flags);
85 if (clk->usage_count == 0) {
86 if (clk->ops && clk->ops->enable)
87 ret = clk->ops->enable(clk);
88 }
89 clk->usage_count++;
90 spin_unlock_irqrestore(&clocks_lock, flags);
91
92 return ret;
93}
94EXPORT_SYMBOL(clk_enable);
95
96/*
97 * clk_disable - inform the system when the clock source is no longer required.
98 * @clk: clock source
99 *
100 * Inform the system that a clock source is no longer required by
101 * a driver and may be shut down.
102 *
103 * Implementation detail: if the clock source is shared between
104 * multiple drivers, clk_enable() calls must be balanced by the
105 * same number of clk_disable() calls for the clock source to be
106 * disabled.
107 */
108void clk_disable(struct clk *clk)
109{
110 unsigned long flags;
111
112 if (!clk || IS_ERR(clk))
113 return;
114
115 WARN_ON(clk->usage_count == 0);
116
117 spin_lock_irqsave(&clocks_lock, flags);
118 clk->usage_count--;
119 if (clk->usage_count == 0) {
120 if (clk->ops && clk->ops->disable)
121 clk->ops->disable(clk);
122 }
123 spin_unlock_irqrestore(&clocks_lock, flags);
124}
125EXPORT_SYMBOL(clk_disable);
126
127/**
128 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
129 * This is only valid once the clock source has been enabled.
130 * @clk: clock source
131 */
132unsigned long clk_get_rate(struct clk *clk)
133{
134 unsigned long flags, rate;
135
136 spin_lock_irqsave(&clocks_lock, flags);
137 rate = clk->rate;
138 spin_unlock_irqrestore(&clocks_lock, flags);
139
140 return rate;
141}
142EXPORT_SYMBOL(clk_get_rate);
143
144/**
145 * clk_set_parent - set the parent clock source for this clock
146 * @clk: clock source
147 * @parent: parent clock source
148 *
149 * Returns success (0) or negative errno.
150 */
151int clk_set_parent(struct clk *clk, struct clk *parent)
152{
153 int i, found = 0, val = 0;
154 unsigned long flags;
155
156 if (!clk || IS_ERR(clk) || !parent || IS_ERR(parent))
157 return -EFAULT;
158 if (clk->usage_count)
159 return -EBUSY;
160 if (!clk->pclk_sel)
161 return -EPERM;
162 if (clk->pclk == parent)
163 return 0;
164
165 for (i = 0; i < clk->pclk_sel->pclk_count; i++) {
166 if (clk->pclk_sel->pclk_info[i].pclk == parent) {
167 found = 1;
168 break;
169 }
170 }
171
172 if (!found)
173 return -EINVAL;
174
175 spin_lock_irqsave(&clocks_lock, flags);
176 /* reflect parent change in hardware */
177 val = readl(clk->pclk_sel->pclk_sel_reg);
178 val &= ~(clk->pclk_sel->pclk_sel_mask << clk->pclk_sel_shift);
179 val |= clk->pclk_sel->pclk_info[i].pclk_mask << clk->pclk_sel_shift;
180 writel(val, clk->pclk_sel->pclk_sel_reg);
181 spin_unlock_irqrestore(&clocks_lock, flags);
182
183 /* reflect parent change in software */
184 clk->recalc(clk);
185 propagate_rate(&clk->children);
186 return 0;
187}
188EXPORT_SYMBOL(clk_set_parent);
189
190/* registers clock in platform clock framework */
191void clk_register(struct clk_lookup *cl)
192{
193 struct clk *clk = cl->clk;
194 unsigned long flags;
195
196 if (!clk || IS_ERR(clk))
197 return;
198
199 spin_lock_irqsave(&clocks_lock, flags);
200
201 INIT_LIST_HEAD(&clk->children);
202 if (clk->flags & ALWAYS_ENABLED)
203 clk->ops = NULL;
204 else if (!clk->ops)
205 clk->ops = &generic_clkops;
206
207 /* root clock don't have any parents */
208 if (!clk->pclk && !clk->pclk_sel) {
209 list_add(&clk->sibling, &root_clks);
210 /* add clocks with only one parent to parent's children list */
211 } else if (clk->pclk && !clk->pclk_sel) {
212 list_add(&clk->sibling, &clk->pclk->children);
213 } else {
214 /* add clocks with > 1 parent to 1st parent's children list */
215 list_add(&clk->sibling,
216 &clk->pclk_sel->pclk_info[0].pclk->children);
217 }
218 spin_unlock_irqrestore(&clocks_lock, flags);
219
220 /* add clock to arm clockdev framework */
221 clkdev_add(cl);
222}
223
224/**
225 * propagate_rate - recalculate and propagate all clocks in list head
226 *
227 * Recalculates all root clocks in list head, which if the clock's .recalc is
228 * set correctly, should also propagate their rates.
229 */
230static void propagate_rate(struct list_head *lhead)
231{
232 struct clk *clkp, *_temp;
233
234 list_for_each_entry_safe(clkp, _temp, lhead, sibling) {
235 if (clkp->recalc)
236 clkp->recalc(clkp);
237 propagate_rate(&clkp->children);
238 }
239}
240
241/* returns current programmed clocks clock info structure */
242static struct pclk_info *pclk_info_get(struct clk *clk)
243{
244 unsigned int mask, i;
245 unsigned long flags;
246 struct pclk_info *info = NULL;
247
248 spin_lock_irqsave(&clocks_lock, flags);
249 mask = (readl(clk->pclk_sel->pclk_sel_reg) >> clk->pclk_sel_shift)
250 & clk->pclk_sel->pclk_sel_mask;
251
252 for (i = 0; i < clk->pclk_sel->pclk_count; i++) {
253 if (clk->pclk_sel->pclk_info[i].pclk_mask == mask)
254 info = &clk->pclk_sel->pclk_info[i];
255 }
256 spin_unlock_irqrestore(&clocks_lock, flags);
257
258 return info;
259}
260
261/*
262 * Set pclk as cclk's parent and add clock sibling node to current parents
263 * children list
264 */
265static void change_parent(struct clk *cclk, struct clk *pclk)
266{
267 unsigned long flags;
268
269 spin_lock_irqsave(&clocks_lock, flags);
270 list_del(&cclk->sibling);
271 list_add(&cclk->sibling, &pclk->children);
272
273 cclk->pclk = pclk;
274 spin_unlock_irqrestore(&clocks_lock, flags);
275}
276
277/*
278 * calculates current programmed rate of pll1
279 *
280 * In normal mode
281 * rate = (2 * M[15:8] * Fin)/(N * 2^P)
282 *
283 * In Dithered mode
284 * rate = (2 * M[15:0] * Fin)/(256 * N * 2^P)
285 */
286void pll1_clk_recalc(struct clk *clk)
287{
288 struct pll_clk_config *config = clk->private_data;
289 unsigned int num = 2, den = 0, val, mode = 0;
290 unsigned long flags;
291
292 spin_lock_irqsave(&clocks_lock, flags);
293 mode = (readl(config->mode_reg) >> PLL_MODE_SHIFT) &
294 PLL_MODE_MASK;
295
296 val = readl(config->cfg_reg);
297 /* calculate denominator */
298 den = (val >> PLL_DIV_P_SHIFT) & PLL_DIV_P_MASK;
299 den = 1 << den;
300 den *= (val >> PLL_DIV_N_SHIFT) & PLL_DIV_N_MASK;
301
302 /* calculate numerator & denominator */
303 if (!mode) {
304 /* Normal mode */
305 num *= (val >> PLL_NORM_FDBK_M_SHIFT) & PLL_NORM_FDBK_M_MASK;
306 } else {
307 /* Dithered mode */
308 num *= (val >> PLL_DITH_FDBK_M_SHIFT) & PLL_DITH_FDBK_M_MASK;
309 den *= 256;
310 }
311
312 clk->rate = (((clk->pclk->rate/10000) * num) / den) * 10000;
313 spin_unlock_irqrestore(&clocks_lock, flags);
314}
315
316/* calculates current programmed rate of ahb or apb bus */
317void bus_clk_recalc(struct clk *clk)
318{
319 struct bus_clk_config *config = clk->private_data;
320 unsigned int div;
321 unsigned long flags;
322
323 spin_lock_irqsave(&clocks_lock, flags);
324 div = ((readl(config->reg) >> config->shift) & config->mask) + 1;
325 clk->rate = (unsigned long)clk->pclk->rate / div;
326 spin_unlock_irqrestore(&clocks_lock, flags);
327}
328
329/*
330 * calculates current programmed rate of auxiliary synthesizers
331 * used by: UART, FIRDA
332 *
333 * Fout from synthesizer can be given from two equations:
334 * Fout1 = (Fin * X/Y)/2
335 * Fout2 = Fin * X/Y
336 *
337 * Selection of eqn 1 or 2 is programmed in register
338 */
339void aux_clk_recalc(struct clk *clk)
340{
341 struct aux_clk_config *config = clk->private_data;
342 struct pclk_info *pclk_info = NULL;
343 unsigned int num = 1, den = 1, val, eqn;
344 unsigned long flags;
345
346 /* get current programmed parent */
347 pclk_info = pclk_info_get(clk);
348 if (!pclk_info) {
349 spin_lock_irqsave(&clocks_lock, flags);
350 clk->pclk = NULL;
351 clk->rate = 0;
352 spin_unlock_irqrestore(&clocks_lock, flags);
353 return;
354 }
355
356 change_parent(clk, pclk_info->pclk);
357
358 spin_lock_irqsave(&clocks_lock, flags);
359 if (pclk_info->scalable) {
360 val = readl(config->synth_reg);
361
362 eqn = (val >> AUX_EQ_SEL_SHIFT) & AUX_EQ_SEL_MASK;
363 if (eqn == AUX_EQ1_SEL)
364 den *= 2;
365
366 /* calculate numerator */
367 num = (val >> AUX_XSCALE_SHIFT) & AUX_XSCALE_MASK;
368
369 /* calculate denominator */
370 den *= (val >> AUX_YSCALE_SHIFT) & AUX_YSCALE_MASK;
371 val = (((clk->pclk->rate/10000) * num) / den) * 10000;
372 } else
373 val = clk->pclk->rate;
374
375 clk->rate = val;
376 spin_unlock_irqrestore(&clocks_lock, flags);
377}
378
379/*
380 * calculates current programmed rate of gpt synthesizers
381 * Fout from synthesizer can be given from below equations:
382 * Fout= Fin/((2 ^ (N+1)) * (M+1))
383 */
384void gpt_clk_recalc(struct clk *clk)
385{
386 struct aux_clk_config *config = clk->private_data;
387 struct pclk_info *pclk_info = NULL;
388 unsigned int div = 1, val;
389 unsigned long flags;
390
391 pclk_info = pclk_info_get(clk);
392 if (!pclk_info) {
393 spin_lock_irqsave(&clocks_lock, flags);
394 clk->pclk = NULL;
395 clk->rate = 0;
396 spin_unlock_irqrestore(&clocks_lock, flags);
397 return;
398 }
399
400 change_parent(clk, pclk_info->pclk);
401
402 spin_lock_irqsave(&clocks_lock, flags);
403 if (pclk_info->scalable) {
404 val = readl(config->synth_reg);
405 div += (val >> GPT_MSCALE_SHIFT) & GPT_MSCALE_MASK;
406 div *= 1 << (((val >> GPT_NSCALE_SHIFT) & GPT_NSCALE_MASK) + 1);
407 }
408
409 clk->rate = (unsigned long)clk->pclk->rate / div;
410 spin_unlock_irqrestore(&clocks_lock, flags);
411}
412
413/*
414 * Used for clocks that always have same value as the parent clock divided by a
415 * fixed divisor
416 */
417void follow_parent(struct clk *clk)
418{
419 unsigned long flags;
420
421 spin_lock_irqsave(&clocks_lock, flags);
422 clk->rate = clk->pclk->rate;
423 spin_unlock_irqrestore(&clocks_lock, flags);
424}
425
426/**
427 * recalc_root_clocks - recalculate and propagate all root clocks
428 *
429 * Recalculates all root clocks (clocks with no parent), which if the
430 * clock's .recalc is set correctly, should also propagate their rates.
431 */
432void recalc_root_clocks(void)
433{
434 propagate_rate(&root_clks);
435}
diff --git a/arch/arm/plat-spear/include/plat/clkdev.h b/arch/arm/plat-spear/include/plat/clkdev.h
new file mode 100644
index 000000000000..a2d0112fcaf7
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/clkdev.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-spear/include/plat/clkdev.h
3 *
4 * Clock Dev framework definitions for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_CLKDEV_H
15#define __PLAT_CLKDEV_H
16
17#define __clk_get(clk) ({ 1; })
18#define __clk_put(clk) do { } while (0)
19
20#endif /* __PLAT_CLKDEV_H */
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h
new file mode 100644
index 000000000000..298bafc0a52f
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/clock.h
@@ -0,0 +1,126 @@
1/*
2 * arch/arm/plat-spear/include/plat/clock.h
3 *
4 * Clock framework definitions for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_CLOCK_H
15#define __PLAT_CLOCK_H
16
17#include <linux/list.h>
18#include <asm/clkdev.h>
19#include <linux/types.h>
20
21/* clk structure flags */
22#define ALWAYS_ENABLED (1 << 0) /* clock always enabled */
23#define RESET_TO_ENABLE (1 << 1) /* reset register bit to enable clk */
24
25/**
26 * struct clkops - clock operations
27 * @enable: pointer to clock enable function
28 * @disable: pointer to clock disable function
29 */
30struct clkops {
31 int (*enable) (struct clk *);
32 void (*disable) (struct clk *);
33};
34
35/**
36 * struct pclk_info - parents info
37 * @pclk: pointer to parent clk
38 * @pclk_mask: value to be written for selecting this parent
39 * @scalable: Is parent scalable (1 - YES, 0 - NO)
40 */
41struct pclk_info {
42 struct clk *pclk;
43 u8 pclk_mask;
44 u8 scalable;
45};
46
47/**
48 * struct pclk_sel - parents selection configuration
49 * @pclk_info: pointer to array of parent clock info
50 * @pclk_count: number of parents
51 * @pclk_sel_reg: register for selecting a parent
52 * @pclk_sel_mask: mask for selecting parent (can be used to clear bits also)
53 */
54struct pclk_sel {
55 struct pclk_info *pclk_info;
56 u8 pclk_count;
57 unsigned int *pclk_sel_reg;
58 unsigned int pclk_sel_mask;
59};
60
61/**
62 * struct clk - clock structure
63 * @usage_count: num of users who enabled this clock
64 * @flags: flags for clock properties
65 * @rate: programmed clock rate in Hz
66 * @en_reg: clk enable/disable reg
67 * @en_reg_bit: clk enable/disable bit
68 * @ops: clk enable/disable ops - generic_clkops selected if NULL
69 * @recalc: pointer to clock rate recalculate function
70 * @pclk: current parent clk
71 * @pclk_sel: pointer to parent selection structure
72 * @pclk_sel_shift: register shift for selecting parent of this clock
73 * @children: list for childrens or this clock
74 * @sibling: node for list of clocks having same parents
75 * @private_data: clock specific private data
76 */
77struct clk {
78 unsigned int usage_count;
79 unsigned int flags;
80 unsigned long rate;
81 unsigned int *en_reg;
82 u8 en_reg_bit;
83 const struct clkops *ops;
84 void (*recalc) (struct clk *);
85
86 struct clk *pclk;
87 struct pclk_sel *pclk_sel;
88 unsigned int pclk_sel_shift;
89
90 struct list_head children;
91 struct list_head sibling;
92 void *private_data;
93};
94
95/* pll configuration structure */
96struct pll_clk_config {
97 unsigned int *mode_reg;
98 unsigned int *cfg_reg;
99};
100
101/* ahb and apb bus configuration structure */
102struct bus_clk_config {
103 unsigned int *reg;
104 unsigned int mask;
105 unsigned int shift;
106};
107
108/*
109 * Aux clk configuration structure: applicable to GPT, UART and FIRDA
110 */
111struct aux_clk_config {
112 unsigned int *synth_reg;
113};
114
115/* platform specific clock functions */
116void clk_register(struct clk_lookup *cl);
117void recalc_root_clocks(void);
118
119/* clock recalc functions */
120void follow_parent(struct clk *clk);
121void pll1_clk_recalc(struct clk *clk);
122void bus_clk_recalc(struct clk *clk);
123void gpt_clk_recalc(struct clk *clk);
124void aux_clk_recalc(struct clk *clk);
125
126#endif /* __PLAT_CLOCK_H */
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S
new file mode 100644
index 000000000000..1670734b7e51
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/debug-macro.S
@@ -0,0 +1,38 @@
1/*
2 * arch/arm/plat-spear/include/plat/debug-macro.S
3 *
4 * Debugging macro include header for spear platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/amba/serial.h>
15#include <mach/spear.h>
16
17 .macro addruart, rx
18 mrc p15, 0, \rx, c1, c0
19 tst \rx, #1 @ MMU enabled?
20 moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base
21 movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base
22 .endm
23
24 .macro senduart, rd, rx
25 strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER
26 .endm
27
28 .macro waituart, rd, rx
291001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
30 tst \rd, #UART01x_FR_TXFF @ TX_FULL
31 bne 1001b
32 .endm
33
34 .macro busyuart, rd, rx
351002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
36 tst \rd, #UART011_FR_TXFE @ TX_EMPTY
37 beq 1002b
38 .endm
diff --git a/arch/arm/plat-spear/include/plat/gpio.h b/arch/arm/plat-spear/include/plat/gpio.h
new file mode 100644
index 000000000000..b857c91257dd
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/gpio.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-spear/include/plat/gpio.h
3 *
4 * GPIO macros for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_GPIO_H
15#define __PLAT_GPIO_H
16
17#include <asm-generic/gpio.h>
18
19#define gpio_get_value __gpio_get_value
20#define gpio_set_value __gpio_set_value
21#define gpio_cansleep __gpio_cansleep
22#define gpio_to_irq __gpio_to_irq
23
24#endif /* __PLAT_GPIO_H */
diff --git a/arch/arm/plat-spear/include/plat/io.h b/arch/arm/plat-spear/include/plat/io.h
new file mode 100644
index 000000000000..4d4ba822b3eb
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/io.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/plat-spear/include/plat/io.h
3 *
4 * IO definitions for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_IO_H
15#define __PLAT_IO_H
16
17#define IO_SPACE_LIMIT 0xFFFFFFFF
18
19#define __io(a) __typesafe_io(a)
20#define __mem_pci(a) (a)
21
22#endif /* __PLAT_IO_H */
diff --git a/arch/arm/plat-spear/include/plat/memory.h b/arch/arm/plat-spear/include/plat/memory.h
new file mode 100644
index 000000000000..27a4aba77343
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/memory.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-spear/include/plat/memory.h
3 *
4 * Memory map for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_MEMORY_H
15#define __PLAT_MEMORY_H
16
17/* Physical DRAM offset */
18#define PHYS_OFFSET UL(0x00000000)
19
20#endif /* __PLAT_MEMORY_H */
diff --git a/arch/arm/plat-spear/include/plat/padmux.h b/arch/arm/plat-spear/include/plat/padmux.h
new file mode 100644
index 000000000000..877f3adcf610
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/padmux.h
@@ -0,0 +1,92 @@
1/*
2 * arch/arm/plat-spear/include/plat/padmux.h
3 *
4 * SPEAr platform specific gpio pads muxing file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_PADMUX_H
15#define __PLAT_PADMUX_H
16
17#include <linux/types.h>
18
19/*
20 * struct pmx_reg: configuration structure for mode reg and mux reg
21 *
22 * offset: offset of mode reg
23 * mask: mask of mode reg
24 */
25struct pmx_reg {
26 u32 offset;
27 u32 mask;
28};
29
30/*
31 * struct pmx_dev_mode: configuration structure every group of modes of a device
32 *
33 * ids: all modes for this configuration
34 * mask: mask for supported mode
35 */
36struct pmx_dev_mode {
37 u32 ids;
38 u32 mask;
39};
40
41/*
42 * struct pmx_mode: mode definition structure
43 *
44 * name: mode name
45 * mask: mode mask
46 */
47struct pmx_mode {
48 char *name;
49 u32 id;
50 u32 mask;
51};
52
53/*
54 * struct pmx_dev: device definition structure
55 *
56 * name: device name
57 * modes: device configuration array for different modes supported
58 * mode_count: size of modes array
59 * is_active: is peripheral active/enabled
60 * enb_on_reset: if 1, mask bits to be cleared in reg otherwise to be set in reg
61 */
62struct pmx_dev {
63 char *name;
64 struct pmx_dev_mode *modes;
65 u8 mode_count;
66 bool is_active;
67 bool enb_on_reset;
68};
69
70/*
71 * struct pmx_driver: driver definition structure
72 *
73 * mode: mode to be set
74 * devs: array of pointer to pmx devices
75 * devs_count: ARRAY_SIZE of devs
76 * base: base address of soc config registers
77 * mode_reg: structure of mode config register
78 * mux_reg: structure of device mux config register
79 */
80struct pmx_driver {
81 struct pmx_mode *mode;
82 struct pmx_dev **devs;
83 u8 devs_count;
84 u32 *base;
85 struct pmx_reg mode_reg;
86 struct pmx_reg mux_reg;
87};
88
89/* pmx functions */
90int pmx_register(struct pmx_driver *driver);
91
92#endif /* __PLAT_PADMUX_H */
diff --git a/arch/arm/plat-spear/include/plat/shirq.h b/arch/arm/plat-spear/include/plat/shirq.h
new file mode 100644
index 000000000000..03ed8b585dcf
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/shirq.h
@@ -0,0 +1,73 @@
1/*
2 * arch/arm/plat-spear/include/plat/shirq.h
3 *
4 * SPEAr platform shared irq layer header file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_SHIRQ_H
15#define __PLAT_SHIRQ_H
16
17#include <linux/irq.h>
18#include <linux/types.h>
19
20/*
21 * struct shirq_dev_config: shared irq device configuration
22 *
23 * virq: virtual irq number of device
24 * enb_mask: enable mask of device
25 * status_mask: status mask of device
26 * clear_mask: clear mask of device
27 */
28struct shirq_dev_config {
29 u32 virq;
30 u32 enb_mask;
31 u32 status_mask;
32 u32 clear_mask;
33};
34
35/*
36 * struct shirq_regs: shared irq register configuration
37 *
38 * base: base address of shared irq register
39 * enb_reg: enable register offset
40 * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt
41 * status_reg: status register offset
42 * status_reg_mask: status register valid mask
43 * clear_reg: clear register offset
44 * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt
45 */
46struct shirq_regs {
47 void __iomem *base;
48 u32 enb_reg;
49 u32 reset_to_enb;
50 u32 status_reg;
51 u32 status_reg_mask;
52 u32 clear_reg;
53 u32 reset_to_clear;
54};
55
56/*
57 * struct spear_shirq: shared irq structure
58 *
59 * irq: hardware irq number
60 * dev_config: array of device config structures which are using "irq" line
61 * dev_count: size of dev_config array
62 * regs: register configuration for shared irq block
63 */
64struct spear_shirq {
65 u32 irq;
66 struct shirq_dev_config *dev_config;
67 u32 dev_count;
68 struct shirq_regs regs;
69};
70
71int spear_shirq_register(struct spear_shirq *shirq);
72
73#endif /* __PLAT_SHIRQ_H */
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h
new file mode 100644
index 000000000000..55a4e405d578
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/system.h
@@ -0,0 +1,41 @@
1/*
2 * arch/arm/plat-spear/include/plat/system.h
3 *
4 * SPEAr platform specific architecture functions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_SYSTEM_H
15#define __PLAT_SYSTEM_H
16
17#include <asm/hardware/sp810.h>
18#include <linux/io.h>
19#include <mach/spear.h>
20
21static inline void arch_idle(void)
22{
23 /*
24 * This should do all the clock switching
25 * and wait for interrupt tricks
26 */
27 cpu_do_idle();
28}
29
30static inline void arch_reset(char mode, const char *cmd)
31{
32 if (mode == 's') {
33 /* software reset, Jump into ROM at address 0 */
34 cpu_reset(0);
35 } else {
36 /* hardware reset, Use on-chip reset capability */
37 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
38 }
39}
40
41#endif /* __PLAT_SYSTEM_H */
diff --git a/arch/arm/plat-spear/include/plat/timex.h b/arch/arm/plat-spear/include/plat/timex.h
new file mode 100644
index 000000000000..914d09dd50fd
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/timex.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/plat-spear/include/plat/timex.h
3 *
4 * SPEAr platform specific timex definitions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_TIMEX_H
15#define __PLAT_TIMEX_H
16
17#define CLOCK_TICK_RATE 48000000
18
19#endif /* __PLAT_TIMEX_H */
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
new file mode 100644
index 000000000000..99ba6789cc97
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -0,0 +1,43 @@
1/*
2 * arch/arm/plat-spear/include/plat/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/io.h>
15#include <linux/amba/serial.h>
16#include <mach/spear.h>
17
18#ifndef __PLAT_UNCOMPRESS_H
19#define __PLAT_UNCOMPRESS_H
20/*
21 * This does not append a newline
22 */
23static inline void putc(int c)
24{
25 void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE;
26
27 while (readl(base + UART01x_FR) & UART01x_FR_TXFF)
28 barrier();
29
30 writel(c, base + UART01x_DR);
31}
32
33static inline void flush(void)
34{
35}
36
37/*
38 * nothing to do
39 */
40#define arch_decomp_setup()
41#define arch_decomp_wdog()
42
43#endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h
new file mode 100644
index 000000000000..09e9372aea21
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/vmalloc.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/plat-spear/include/plat/vmalloc.h
3 *
4 * Defining Vmalloc area for SPEAr platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_VMALLOC_H
15#define __PLAT_VMALLOC_H
16
17#define VMALLOC_END 0xF0000000
18
19#endif /* __PLAT_VMALLOC_H */
diff --git a/arch/arm/plat-spear/padmux.c b/arch/arm/plat-spear/padmux.c
new file mode 100644
index 000000000000..d2aab3adcdeb
--- /dev/null
+++ b/arch/arm/plat-spear/padmux.c
@@ -0,0 +1,164 @@
1/*
2 * arch/arm/plat-spear/include/plat/padmux.c
3 *
4 * SPEAr platform specific gpio pads muxing source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/err.h>
15#include <linux/io.h>
16#include <linux/slab.h>
17#include <plat/padmux.h>
18
19/*
20 * struct pmx: pmx definition structure
21 *
22 * base: base address of configuration registers
23 * mode_reg: mode configurations
24 * mux_reg: muxing configurations
25 * active_mode: pointer to current active mode
26 */
27struct pmx {
28 u32 base;
29 struct pmx_reg mode_reg;
30 struct pmx_reg mux_reg;
31 struct pmx_mode *active_mode;
32};
33
34static struct pmx *pmx;
35
36/**
37 * pmx_mode_set - Enables an multiplexing mode
38 * @mode - pointer to pmx mode
39 *
40 * It will set mode of operation in hardware.
41 * Returns -ve on Err otherwise 0
42 */
43static int pmx_mode_set(struct pmx_mode *mode)
44{
45 u32 val;
46
47 if (!mode->name)
48 return -EFAULT;
49
50 pmx->active_mode = mode;
51
52 val = readl(pmx->base + pmx->mode_reg.offset);
53 val &= ~pmx->mode_reg.mask;
54 val |= mode->mask & pmx->mode_reg.mask;
55 writel(val, pmx->base + pmx->mode_reg.offset);
56
57 return 0;
58}
59
60/**
61 * pmx_devs_enable - Enables list of devices
62 * @devs - pointer to pmx device array
63 * @count - number of devices to enable
64 *
65 * It will enable pads for all required peripherals once and only once.
66 * If peripheral is not supported by current mode then request is rejected.
67 * Conflicts between peripherals are not handled and peripherals will be
68 * enabled in the order they are present in pmx_dev array.
69 * In case of conflicts last peripheral enalbed will be present.
70 * Returns -ve on Err otherwise 0
71 */
72static int pmx_devs_enable(struct pmx_dev **devs, u8 count)
73{
74 u32 val, i, mask;
75
76 if (!count)
77 return -EINVAL;
78
79 val = readl(pmx->base + pmx->mux_reg.offset);
80 for (i = 0; i < count; i++) {
81 u8 j = 0;
82
83 if (!devs[i]->name || !devs[i]->modes) {
84 printk(KERN_ERR "padmux: dev name or modes is null\n");
85 continue;
86 }
87 /* check if peripheral exists in active mode */
88 if (pmx->active_mode) {
89 bool found = false;
90 for (j = 0; j < devs[i]->mode_count; j++) {
91 if (devs[i]->modes[j].ids &
92 pmx->active_mode->id) {
93 found = true;
94 break;
95 }
96 }
97 if (found == false) {
98 printk(KERN_ERR "%s device not available in %s"\
99 "mode\n", devs[i]->name,
100 pmx->active_mode->name);
101 continue;
102 }
103 }
104
105 /* enable peripheral */
106 mask = devs[i]->modes[j].mask & pmx->mux_reg.mask;
107 if (devs[i]->enb_on_reset)
108 val &= ~mask;
109 else
110 val |= mask;
111
112 devs[i]->is_active = true;
113 }
114 writel(val, pmx->base + pmx->mux_reg.offset);
115 kfree(pmx);
116
117 /* this will ensure that multiplexing can't be changed now */
118 pmx = (struct pmx *)-1;
119
120 return 0;
121}
122
123/**
124 * pmx_register - registers a platform requesting pad mux feature
125 * @driver - pointer to driver structure containing driver specific parameters
126 *
127 * Also this must be called only once. This will allocate memory for pmx
128 * structure, will call pmx_mode_set, will call pmx_devs_enable.
129 * Returns -ve on Err otherwise 0
130 */
131int pmx_register(struct pmx_driver *driver)
132{
133 int ret = 0;
134
135 if (pmx)
136 return -EPERM;
137 if (!driver->base || !driver->devs)
138 return -EFAULT;
139
140 pmx = kzalloc(sizeof(*pmx), GFP_KERNEL);
141 if (!pmx)
142 return -ENOMEM;
143
144 pmx->base = (u32)driver->base;
145 pmx->mode_reg.offset = driver->mode_reg.offset;
146 pmx->mode_reg.mask = driver->mode_reg.mask;
147 pmx->mux_reg.offset = driver->mux_reg.offset;
148 pmx->mux_reg.mask = driver->mux_reg.mask;
149
150 /* choose mode to enable */
151 if (driver->mode) {
152 ret = pmx_mode_set(driver->mode);
153 if (ret)
154 goto pmx_fail;
155 }
156 ret = pmx_devs_enable(driver->devs, driver->devs_count);
157 if (ret)
158 goto pmx_fail;
159
160 return 0;
161
162pmx_fail:
163 return ret;
164}
diff --git a/arch/arm/plat-spear/shirq.c b/arch/arm/plat-spear/shirq.c
new file mode 100644
index 000000000000..2172d6946aea
--- /dev/null
+++ b/arch/arm/plat-spear/shirq.c
@@ -0,0 +1,118 @@
1/*
2 * arch/arm/plat-spear/shirq.c
3 *
4 * SPEAr platform shared irq layer source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/err.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/spinlock.h>
18#include <plat/shirq.h>
19
20struct spear_shirq *shirq;
21static DEFINE_SPINLOCK(lock);
22
23static void shirq_irq_mask(unsigned irq)
24{
25 struct spear_shirq *shirq = get_irq_chip_data(irq);
26 u32 val, id = irq - shirq->dev_config[0].virq;
27 unsigned long flags;
28
29 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1)
30 return;
31
32 spin_lock_irqsave(&lock, flags);
33 val = readl(shirq->regs.base + shirq->regs.enb_reg);
34 if (shirq->regs.reset_to_enb)
35 val |= shirq->dev_config[id].enb_mask;
36 else
37 val &= ~(shirq->dev_config[id].enb_mask);
38 writel(val, shirq->regs.base + shirq->regs.enb_reg);
39 spin_unlock_irqrestore(&lock, flags);
40}
41
42static void shirq_irq_unmask(unsigned irq)
43{
44 struct spear_shirq *shirq = get_irq_chip_data(irq);
45 u32 val, id = irq - shirq->dev_config[0].virq;
46 unsigned long flags;
47
48 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1)
49 return;
50
51 spin_lock_irqsave(&lock, flags);
52 val = readl(shirq->regs.base + shirq->regs.enb_reg);
53 if (shirq->regs.reset_to_enb)
54 val &= ~(shirq->dev_config[id].enb_mask);
55 else
56 val |= shirq->dev_config[id].enb_mask;
57 writel(val, shirq->regs.base + shirq->regs.enb_reg);
58 spin_unlock_irqrestore(&lock, flags);
59}
60
61static struct irq_chip shirq_chip = {
62 .name = "spear_shirq",
63 .ack = shirq_irq_mask,
64 .mask = shirq_irq_mask,
65 .unmask = shirq_irq_unmask,
66};
67
68static void shirq_handler(unsigned irq, struct irq_desc *desc)
69{
70 u32 i, val, mask;
71 struct spear_shirq *shirq = get_irq_data(irq);
72
73 desc->chip->ack(irq);
74 while ((val = readl(shirq->regs.base + shirq->regs.status_reg) &
75 shirq->regs.status_reg_mask)) {
76 for (i = 0; (i < shirq->dev_count) && val; i++) {
77 if (!(shirq->dev_config[i].status_mask & val))
78 continue;
79
80 generic_handle_irq(shirq->dev_config[i].virq);
81
82 /* clear interrupt */
83 val &= ~shirq->dev_config[i].status_mask;
84 if ((shirq->regs.clear_reg == -1) ||
85 shirq->dev_config[i].clear_mask == -1)
86 continue;
87 mask = readl(shirq->regs.base + shirq->regs.clear_reg);
88 if (shirq->regs.reset_to_clear)
89 mask &= ~shirq->dev_config[i].clear_mask;
90 else
91 mask |= shirq->dev_config[i].clear_mask;
92 writel(mask, shirq->regs.base + shirq->regs.clear_reg);
93 }
94 }
95 desc->chip->unmask(irq);
96}
97
98int spear_shirq_register(struct spear_shirq *shirq)
99{
100 int i;
101
102 if (!shirq || !shirq->dev_config || !shirq->regs.base)
103 return -EFAULT;
104
105 if (!shirq->dev_count)
106 return -EINVAL;
107
108 set_irq_chained_handler(shirq->irq, shirq_handler);
109 for (i = 0; i < shirq->dev_count; i++) {
110 set_irq_chip(shirq->dev_config[i].virq, &shirq_chip);
111 set_irq_handler(shirq->dev_config[i].virq, handle_simple_irq);
112 set_irq_flags(shirq->dev_config[i].virq, IRQF_VALID);
113 set_irq_chip_data(shirq->dev_config[i].virq, shirq);
114 }
115
116 set_irq_data(shirq->irq, shirq);
117 return 0;
118}
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
new file mode 100644
index 000000000000..a1025d38f383
--- /dev/null
+++ b/arch/arm/plat-spear/time.c
@@ -0,0 +1,292 @@
1/*
2 * arch/arm/plat-spear/time.c
3 *
4 * Copyright (C) 2009 ST Microelectronics
5 * Shiraz Hashim<shiraz.hashim@st.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/clk.h>
13#include <linux/clockchips.h>
14#include <linux/clocksource.h>
15#include <linux/err.h>
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/io.h>
19#include <linux/kernel.h>
20#include <linux/time.h>
21#include <linux/irq.h>
22#include <asm/mach/time.h>
23#include <mach/irqs.h>
24#include <mach/hardware.h>
25#include <mach/spear.h>
26#include <mach/generic.h>
27
28/*
29 * We would use TIMER0 and TIMER1 as clockevent and clocksource.
30 * Timer0 and Timer1 both belong to same gpt block in cpu subbsystem. Further
31 * they share same functional clock. Any change in one's functional clock will
32 * also affect other timer.
33 */
34
35#define CLKEVT 0 /* gpt0, channel0 as clockevent */
36#define CLKSRC 1 /* gpt0, channel1 as clocksource */
37
38/* Register offsets, x is channel number */
39#define CR(x) ((x) * 0x80 + 0x80)
40#define IR(x) ((x) * 0x80 + 0x84)
41#define LOAD(x) ((x) * 0x80 + 0x88)
42#define COUNT(x) ((x) * 0x80 + 0x8C)
43
44/* Reg bit definitions */
45#define CTRL_INT_ENABLE 0x0100
46#define CTRL_ENABLE 0x0020
47#define CTRL_ONE_SHOT 0x0010
48
49#define CTRL_PRESCALER1 0x0
50#define CTRL_PRESCALER2 0x1
51#define CTRL_PRESCALER4 0x2
52#define CTRL_PRESCALER8 0x3
53#define CTRL_PRESCALER16 0x4
54#define CTRL_PRESCALER32 0x5
55#define CTRL_PRESCALER64 0x6
56#define CTRL_PRESCALER128 0x7
57#define CTRL_PRESCALER256 0x8
58
59#define INT_STATUS 0x1
60
61static __iomem void *gpt_base;
62static struct clk *gpt_clk;
63
64static void clockevent_set_mode(enum clock_event_mode mode,
65 struct clock_event_device *clk_event_dev);
66static int clockevent_next_event(unsigned long evt,
67 struct clock_event_device *clk_event_dev);
68
69/*
70 * Following clocksource_set_clock and clockevent_set_clock picked
71 * from arch/mips/kernel/time.c
72 */
73
74void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
75{
76 u64 temp;
77 u32 shift;
78
79 /* Find a shift value */
80 for (shift = 32; shift > 0; shift--) {
81 temp = (u64) NSEC_PER_SEC << shift;
82 do_div(temp, clock);
83 if ((temp >> 32) == 0)
84 break;
85 }
86 cs->shift = shift;
87 cs->mult = (u32) temp;
88}
89
90void __init clockevent_set_clock(struct clock_event_device *cd,
91 unsigned int clock)
92{
93 u64 temp;
94 u32 shift;
95
96 /* Find a shift value */
97 for (shift = 32; shift > 0; shift--) {
98 temp = (u64) clock << shift;
99 do_div(temp, NSEC_PER_SEC);
100 if ((temp >> 32) == 0)
101 break;
102 }
103 cd->shift = shift;
104 cd->mult = (u32) temp;
105}
106
107static cycle_t clocksource_read_cycles(struct clocksource *cs)
108{
109 return (cycle_t) readw(gpt_base + COUNT(CLKSRC));
110}
111
112static struct clocksource clksrc = {
113 .name = "tmr1",
114 .rating = 200, /* its a pretty decent clock */
115 .read = clocksource_read_cycles,
116 .mask = 0xFFFF, /* 16 bits */
117 .mult = 0, /* to be computed */
118 .shift = 0, /* to be computed */
119 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
120};
121
122static void spear_clocksource_init(void)
123{
124 u32 tick_rate;
125 u16 val;
126
127 /* program the prescaler (/256)*/
128 writew(CTRL_PRESCALER256, gpt_base + CR(CLKSRC));
129
130 /* find out actual clock driving Timer */
131 tick_rate = clk_get_rate(gpt_clk);
132 tick_rate >>= CTRL_PRESCALER256;
133
134 writew(0xFFFF, gpt_base + LOAD(CLKSRC));
135
136 val = readw(gpt_base + CR(CLKSRC));
137 val &= ~CTRL_ONE_SHOT; /* autoreload mode */
138 val |= CTRL_ENABLE ;
139 writew(val, gpt_base + CR(CLKSRC));
140
141 clocksource_set_clock(&clksrc, tick_rate);
142
143 /* register the clocksource */
144 clocksource_register(&clksrc);
145}
146
147static struct clock_event_device clkevt = {
148 .name = "tmr0",
149 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
150 .set_mode = clockevent_set_mode,
151 .set_next_event = clockevent_next_event,
152 .shift = 0, /* to be computed */
153};
154
155static void clockevent_set_mode(enum clock_event_mode mode,
156 struct clock_event_device *clk_event_dev)
157{
158 u32 period;
159 u16 val;
160
161 /* stop the timer */
162 val = readw(gpt_base + CR(CLKEVT));
163 val &= ~CTRL_ENABLE;
164 writew(val, gpt_base + CR(CLKEVT));
165
166 switch (mode) {
167 case CLOCK_EVT_MODE_PERIODIC:
168 period = clk_get_rate(gpt_clk) / HZ;
169 period >>= CTRL_PRESCALER16;
170 writew(period, gpt_base + LOAD(CLKEVT));
171
172 val = readw(gpt_base + CR(CLKEVT));
173 val &= ~CTRL_ONE_SHOT;
174 val |= CTRL_ENABLE | CTRL_INT_ENABLE;
175 writew(val, gpt_base + CR(CLKEVT));
176
177 break;
178 case CLOCK_EVT_MODE_ONESHOT:
179 val = readw(gpt_base + CR(CLKEVT));
180 val |= CTRL_ONE_SHOT;
181 writew(val, gpt_base + CR(CLKEVT));
182
183 break;
184 case CLOCK_EVT_MODE_UNUSED:
185 case CLOCK_EVT_MODE_SHUTDOWN:
186 case CLOCK_EVT_MODE_RESUME:
187
188 break;
189 default:
190 pr_err("Invalid mode requested\n");
191 break;
192 }
193}
194
195static int clockevent_next_event(unsigned long cycles,
196 struct clock_event_device *clk_event_dev)
197{
198 u16 val;
199
200 writew(cycles, gpt_base + LOAD(CLKEVT));
201
202 val = readw(gpt_base + CR(CLKEVT));
203 val |= CTRL_ENABLE | CTRL_INT_ENABLE;
204 writew(val, gpt_base + CR(CLKEVT));
205
206 return 0;
207}
208
209static irqreturn_t spear_timer_interrupt(int irq, void *dev_id)
210{
211 struct clock_event_device *evt = &clkevt;
212
213 writew(INT_STATUS, gpt_base + IR(CLKEVT));
214
215 evt->event_handler(evt);
216
217 return IRQ_HANDLED;
218}
219
220static struct irqaction spear_timer_irq = {
221 .name = "timer",
222 .flags = IRQF_DISABLED | IRQF_TIMER,
223 .handler = spear_timer_interrupt
224};
225
226static void __init spear_clockevent_init(void)
227{
228 u32 tick_rate;
229
230 /* program the prescaler */
231 writew(CTRL_PRESCALER16, gpt_base + CR(CLKEVT));
232
233 tick_rate = clk_get_rate(gpt_clk);
234 tick_rate >>= CTRL_PRESCALER16;
235
236 clockevent_set_clock(&clkevt, tick_rate);
237
238 clkevt.max_delta_ns = clockevent_delta2ns(0xfff0,
239 &clkevt);
240 clkevt.min_delta_ns = clockevent_delta2ns(3, &clkevt);
241
242 clkevt.cpumask = cpumask_of(0);
243
244 clockevents_register_device(&clkevt);
245
246 setup_irq(SPEAR_GPT0_CHAN0_IRQ, &spear_timer_irq);
247}
248
249void __init spear_setup_timer(void)
250{
251 struct clk *pll3_clk;
252
253 if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) {
254 pr_err("%s:cannot get IO addr\n", __func__);
255 return;
256 }
257
258 gpt_base = (void __iomem *)ioremap(SPEAR_GPT0_BASE, SZ_1K);
259 if (!gpt_base) {
260 pr_err("%s:ioremap failed for gpt\n", __func__);
261 goto err_mem;
262 }
263
264 gpt_clk = clk_get_sys("gpt0", NULL);
265 if (!gpt_clk) {
266 pr_err("%s:couldn't get clk for gpt\n", __func__);
267 goto err_iomap;
268 }
269
270 pll3_clk = clk_get(NULL, "pll3_48m_clk");
271 if (!pll3_clk) {
272 pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__);
273 goto err_iomap;
274 }
275
276 clk_set_parent(gpt_clk, pll3_clk);
277
278 spear_clockevent_init();
279 spear_clocksource_init();
280
281 return;
282
283err_iomap:
284 iounmap(gpt_base);
285
286err_mem:
287 release_mem_region(SPEAR_GPT0_BASE, SZ_1K);
288}
289
290struct sys_timer spear_sys_timer = {
291 .init = spear_setup_timer,
292};
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
new file mode 100644
index 000000000000..9b1a66816aa6
--- /dev/null
+++ b/arch/arm/plat-versatile/Makefile
@@ -0,0 +1,4 @@
1obj-y := clock.o
2obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
3obj-$(CONFIG_ARCH_REALVIEW) += sched-clock.o
4obj-$(CONFIG_ARCH_VERSATILE) += sched-clock.o
diff --git a/arch/arm/mach-integrator/clock.c b/arch/arm/plat-versatile/clock.c
index 989ecf5f5c46..5c8b6564fdc2 100644
--- a/arch/arm/mach-integrator/clock.c
+++ b/arch/arm/plat-versatile/clock.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-integrator/clock.c 2 * linux/arch/arm/plat-versatile/clock.c
3 * 3 *
4 * Copyright (C) 2004 ARM Limited. 4 * Copyright (C) 2004 ARM Limited.
5 * Written by Deep Blue Solutions Limited. 5 * Written by Deep Blue Solutions Limited.
@@ -14,7 +14,8 @@
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16 16
17#include <asm/clkdev.h> 17#include <asm/hardware/icst.h>
18
18#include <mach/clkdev.h> 19#include <mach/clkdev.h>
19 20
20int clk_enable(struct clk *clk) 21int clk_enable(struct clk *clk)
@@ -36,24 +37,38 @@ EXPORT_SYMBOL(clk_get_rate);
36 37
37long clk_round_rate(struct clk *clk, unsigned long rate) 38long clk_round_rate(struct clk *clk, unsigned long rate)
38{ 39{
39 struct icst525_vco vco; 40 long ret = -EIO;
40 vco = icst525_khz_to_vco(clk->params, rate / 1000); 41 if (clk->ops && clk->ops->round)
41 return icst525_khz(clk->params, vco) * 1000; 42 ret = clk->ops->round(clk, rate);
43 return ret;
42} 44}
43EXPORT_SYMBOL(clk_round_rate); 45EXPORT_SYMBOL(clk_round_rate);
44 46
45int clk_set_rate(struct clk *clk, unsigned long rate) 47int clk_set_rate(struct clk *clk, unsigned long rate)
46{ 48{
47 int ret = -EIO; 49 int ret = -EIO;
48 50 if (clk->ops && clk->ops->set)
49 if (clk->setvco) { 51 ret = clk->ops->set(clk, rate);
50 struct icst525_vco vco;
51
52 vco = icst525_khz_to_vco(clk->params, rate / 1000);
53 clk->rate = icst525_khz(clk->params, vco) * 1000;
54 clk->setvco(clk, vco);
55 ret = 0;
56 }
57 return ret; 52 return ret;
58} 53}
59EXPORT_SYMBOL(clk_set_rate); 54EXPORT_SYMBOL(clk_set_rate);
55
56long icst_clk_round(struct clk *clk, unsigned long rate)
57{
58 struct icst_vco vco;
59 vco = icst_hz_to_vco(clk->params, rate);
60 return icst_hz(clk->params, vco);
61}
62EXPORT_SYMBOL(icst_clk_round);
63
64int icst_clk_set(struct clk *clk, unsigned long rate)
65{
66 struct icst_vco vco;
67
68 vco = icst_hz_to_vco(clk->params, rate);
69 clk->rate = icst_hz(clk->params, vco);
70 clk->ops->setvco(clk, vco);
71
72 return 0;
73}
74EXPORT_SYMBOL(icst_clk_set);
diff --git a/arch/arm/plat-versatile/include/plat/clock.h b/arch/arm/plat-versatile/include/plat/clock.h
new file mode 100644
index 000000000000..3cfb024ccd70
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/clock.h
@@ -0,0 +1,15 @@
1#ifndef PLAT_CLOCK_H
2#define PLAT_CLOCK_H
3
4#include <asm/hardware/icst.h>
5
6struct clk_ops {
7 long (*round)(struct clk *, unsigned long);
8 int (*set)(struct clk *, unsigned long);
9 void (*setvco)(struct clk *, struct icst_vco);
10};
11
12int icst_clk_set(struct clk *, unsigned long);
13long icst_clk_round(struct clk *, unsigned long);
14
15#endif
diff --git a/arch/arm/plat-versatile/include/plat/timer-sp.h b/arch/arm/plat-versatile/include/plat/timer-sp.h
new file mode 100644
index 000000000000..21e75e30d497
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/timer-sp.h
@@ -0,0 +1,2 @@
1void sp804_clocksource_init(void __iomem *);
2void sp804_clockevents_init(void __iomem *, unsigned int);
diff --git a/arch/arm/plat-versatile/sched-clock.c b/arch/arm/plat-versatile/sched-clock.c
new file mode 100644
index 000000000000..9768cf7e83d7
--- /dev/null
+++ b/arch/arm/plat-versatile/sched-clock.c
@@ -0,0 +1,53 @@
1/*
2 * linux/arch/arm/plat-versatile/sched-clock.c
3 *
4 * Copyright (C) 1999 - 2003 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#include <linux/cnt32_to_63.h>
22#include <linux/io.h>
23#include <asm/div64.h>
24
25#include <mach/hardware.h>
26#include <mach/platform.h>
27
28#ifdef VERSATILE_SYS_BASE
29#define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET)
30#endif
31
32#ifdef REALVIEW_SYS_BASE
33#define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_24MHz_OFFSET)
34#endif
35
36/*
37 * This is the Realview and Versatile sched_clock implementation. This
38 * has a resolution of 41.7ns, and a maximum value of about 35583 days.
39 *
40 * The return value is guaranteed to be monotonic in that range as
41 * long as there is always less than 89 seconds between successive
42 * calls to this function.
43 */
44unsigned long long sched_clock(void)
45{
46 unsigned long long v = cnt32_to_63(readl(REFCOUNTER));
47
48 /* the <<1 gets rid of the cnt_32_to_63 top bit saving on a bic insn */
49 v *= 125<<1;
50 do_div(v, 3<<1);
51
52 return v;
53}
diff --git a/arch/arm/plat-versatile/timer-sp.c b/arch/arm/plat-versatile/timer-sp.c
new file mode 100644
index 000000000000..fb0d1c299718
--- /dev/null
+++ b/arch/arm/plat-versatile/timer-sp.c
@@ -0,0 +1,156 @@
1/*
2 * linux/arch/arm/plat-versatile/timer-sp.c
3 *
4 * Copyright (C) 1999 - 2003 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#include <linux/clocksource.h>
22#include <linux/clockchips.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/io.h>
26
27#include <asm/hardware/arm_timer.h>
28
29#include <plat/timer-sp.h>
30
31/*
32 * These timers are currently always setup to be clocked at 1MHz.
33 */
34#define TIMER_FREQ_KHZ (1000)
35#define TIMER_RELOAD (TIMER_FREQ_KHZ * 1000 / HZ)
36
37static void __iomem *clksrc_base;
38
39static cycle_t sp804_read(struct clocksource *cs)
40{
41 return ~readl(clksrc_base + TIMER_VALUE);
42}
43
44static struct clocksource clocksource_sp804 = {
45 .name = "timer3",
46 .rating = 200,
47 .read = sp804_read,
48 .mask = CLOCKSOURCE_MASK(32),
49 .shift = 20,
50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
51};
52
53void __init sp804_clocksource_init(void __iomem *base)
54{
55 struct clocksource *cs = &clocksource_sp804;
56
57 clksrc_base = base;
58
59 /* setup timer 0 as free-running clocksource */
60 writel(0, clksrc_base + TIMER_CTRL);
61 writel(0xffffffff, clksrc_base + TIMER_LOAD);
62 writel(0xffffffff, clksrc_base + TIMER_VALUE);
63 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
64 clksrc_base + TIMER_CTRL);
65
66 cs->mult = clocksource_khz2mult(TIMER_FREQ_KHZ, cs->shift);
67 clocksource_register(cs);
68}
69
70
71static void __iomem *clkevt_base;
72
73/*
74 * IRQ handler for the timer
75 */
76static irqreturn_t sp804_timer_interrupt(int irq, void *dev_id)
77{
78 struct clock_event_device *evt = dev_id;
79
80 /* clear the interrupt */
81 writel(1, clkevt_base + TIMER_INTCLR);
82
83 evt->event_handler(evt);
84
85 return IRQ_HANDLED;
86}
87
88static void sp804_set_mode(enum clock_event_mode mode,
89 struct clock_event_device *evt)
90{
91 unsigned long ctrl = TIMER_CTRL_32BIT | TIMER_CTRL_IE;
92
93 writel(ctrl, clkevt_base + TIMER_CTRL);
94
95 switch (mode) {
96 case CLOCK_EVT_MODE_PERIODIC:
97 writel(TIMER_RELOAD, clkevt_base + TIMER_LOAD);
98 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
99 break;
100
101 case CLOCK_EVT_MODE_ONESHOT:
102 /* period set, and timer enabled in 'next_event' hook */
103 ctrl |= TIMER_CTRL_ONESHOT;
104 break;
105
106 case CLOCK_EVT_MODE_UNUSED:
107 case CLOCK_EVT_MODE_SHUTDOWN:
108 default:
109 break;
110 }
111
112 writel(ctrl, clkevt_base + TIMER_CTRL);
113}
114
115static int sp804_set_next_event(unsigned long next,
116 struct clock_event_device *evt)
117{
118 unsigned long ctrl = readl(clkevt_base + TIMER_CTRL);
119
120 writel(next, clkevt_base + TIMER_LOAD);
121 writel(ctrl | TIMER_CTRL_ENABLE, clkevt_base + TIMER_CTRL);
122
123 return 0;
124}
125
126static struct clock_event_device sp804_clockevent = {
127 .name = "timer0",
128 .shift = 32,
129 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
130 .set_mode = sp804_set_mode,
131 .set_next_event = sp804_set_next_event,
132 .rating = 300,
133 .cpumask = cpu_all_mask,
134};
135
136static struct irqaction sp804_timer_irq = {
137 .name = "timer",
138 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
139 .handler = sp804_timer_interrupt,
140 .dev_id = &sp804_clockevent,
141};
142
143void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq)
144{
145 struct clock_event_device *evt = &sp804_clockevent;
146
147 clkevt_base = base;
148
149 evt->irq = timer_irq;
150 evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift);
151 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
152 evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
153
154 setup_irq(timer_irq, &sp804_timer_irq);
155 clockevents_register_device(evt);
156}
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 9c6170cd9aac..87ab0568bb0e 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -564,7 +564,7 @@ config I2C_STU300
564 564
565config I2C_VERSATILE 565config I2C_VERSATILE
566 tristate "ARM Versatile/Realview I2C bus support" 566 tristate "ARM Versatile/Realview I2C bus support"
567 depends on ARCH_VERSATILE || ARCH_REALVIEW 567 depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS
568 select I2C_ALGOBIT 568 select I2C_ALGOBIT
569 help 569 help
570 Say yes if you want to support the I2C serial bus on ARMs Versatile 570 Say yes if you want to support the I2C serial bus on ARMs Versatile
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 84c103a7ee13..ff115d920888 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -55,14 +55,16 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired)
55 host->cclk = host->mclk / (2 * (clk + 1)); 55 host->cclk = host->mclk / (2 * (clk + 1));
56 } 56 }
57 if (host->hw_designer == AMBA_VENDOR_ST) 57 if (host->hw_designer == AMBA_VENDOR_ST)
58 clk |= MCI_FCEN; /* Bug fix in ST IP block */ 58 clk |= MCI_ST_FCEN; /* Bug fix in ST IP block */
59 clk |= MCI_CLK_ENABLE; 59 clk |= MCI_CLK_ENABLE;
60 /* This hasn't proven to be worthwhile */ 60 /* This hasn't proven to be worthwhile */
61 /* clk |= MCI_CLK_PWRSAVE; */ 61 /* clk |= MCI_CLK_PWRSAVE; */
62 } 62 }
63 63
64 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) 64 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
65 clk |= MCI_WIDE_BUS; 65 clk |= MCI_4BIT_BUS;
66 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)
67 clk |= MCI_ST_8BIT_BUS;
66 68
67 writel(clk, host->base + MMCICLOCK); 69 writel(clk, host->base + MMCICLOCK);
68} 70}
@@ -629,7 +631,18 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
629 631
630 mmc->ops = &mmci_ops; 632 mmc->ops = &mmci_ops;
631 mmc->f_min = (host->mclk + 511) / 512; 633 mmc->f_min = (host->mclk + 511) / 512;
632 mmc->f_max = min(host->mclk, fmax); 634 /*
635 * If the platform data supplies a maximum operating
636 * frequency, this takes precedence. Else, we fall back
637 * to using the module parameter, which has a (low)
638 * default value in case it is not specified. Either
639 * value must not exceed the clock rate into the block,
640 * of course.
641 */
642 if (plat->f_max)
643 mmc->f_max = min(host->mclk, plat->f_max);
644 else
645 mmc->f_max = min(host->mclk, fmax);
633 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); 646 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
634 647
635#ifdef CONFIG_REGULATOR 648#ifdef CONFIG_REGULATOR
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index 1ceb9a90f59b..d77062e5e3af 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -25,9 +25,11 @@
25#define MCI_CLK_ENABLE (1 << 8) 25#define MCI_CLK_ENABLE (1 << 8)
26#define MCI_CLK_PWRSAVE (1 << 9) 26#define MCI_CLK_PWRSAVE (1 << 9)
27#define MCI_CLK_BYPASS (1 << 10) 27#define MCI_CLK_BYPASS (1 << 10)
28#define MCI_WIDE_BUS (1 << 11) 28#define MCI_4BIT_BUS (1 << 11)
29/* 8bit wide buses supported in ST Micro versions */
30#define MCI_ST_8BIT_BUS (1 << 12)
29/* HW flow control on the ST Micro version */ 31/* HW flow control on the ST Micro version */
30#define MCI_FCEN (1 << 13) 32#define MCI_ST_FCEN (1 << 13)
31 33
32#define MMCIARGUMENT 0x008 34#define MMCIARGUMENT 0x008
33#define MMCICOMMAND 0x00c 35#define MMCICOMMAND 0x00c
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 2c9bf9b68327..eed3c2d8dd1c 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -38,6 +38,7 @@
38#include <linux/dma-mapping.h> 38#include <linux/dma-mapping.h>
39#include <linux/atmel_pdc.h> 39#include <linux/atmel_pdc.h>
40#include <linux/atmel_serial.h> 40#include <linux/atmel_serial.h>
41#include <linux/uaccess.h>
41 42
42#include <asm/io.h> 43#include <asm/io.h>
43 44
@@ -59,6 +60,9 @@
59 60
60#include <linux/serial_core.h> 61#include <linux/serial_core.h>
61 62
63static void atmel_start_rx(struct uart_port *port);
64static void atmel_stop_rx(struct uart_port *port);
65
62#ifdef CONFIG_SERIAL_ATMEL_TTYAT 66#ifdef CONFIG_SERIAL_ATMEL_TTYAT
63 67
64/* Use device name ttyAT, major 204 and minor 154-169. This is necessary if we 68/* Use device name ttyAT, major 204 and minor 154-169. This is necessary if we
@@ -93,6 +97,7 @@
93#define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR) 97#define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR)
94#define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) 98#define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR)
95#define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) 99#define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR)
100#define UART_PUT_TTGR(port, v) __raw_writel(v, (port)->membase + ATMEL_US_TTGR)
96 101
97 /* PDC registers */ 102 /* PDC registers */
98#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) 103#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR)
@@ -147,6 +152,9 @@ struct atmel_uart_port {
147 unsigned int irq_status_prev; 152 unsigned int irq_status_prev;
148 153
149 struct circ_buf rx_ring; 154 struct circ_buf rx_ring;
155
156 struct serial_rs485 rs485; /* rs485 settings */
157 unsigned int tx_done_mask;
150}; 158};
151 159
152static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART]; 160static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
@@ -187,6 +195,46 @@ static bool atmel_use_dma_tx(struct uart_port *port)
187} 195}
188#endif 196#endif
189 197
198/* Enable or disable the rs485 support */
199void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
200{
201 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
202 unsigned int mode;
203
204 spin_lock(&port->lock);
205
206 /* Disable interrupts */
207 UART_PUT_IDR(port, atmel_port->tx_done_mask);
208
209 mode = UART_GET_MR(port);
210
211 /* Resetting serial mode to RS232 (0x0) */
212 mode &= ~ATMEL_US_USMODE;
213
214 atmel_port->rs485 = *rs485conf;
215
216 if (rs485conf->flags & SER_RS485_ENABLED) {
217 dev_dbg(port->dev, "Setting UART to RS485\n");
218 atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;
219 UART_PUT_TTGR(port, rs485conf->delay_rts_before_send);
220 mode |= ATMEL_US_USMODE_RS485;
221 } else {
222 dev_dbg(port->dev, "Setting UART to RS232\n");
223 if (atmel_use_dma_tx(port))
224 atmel_port->tx_done_mask = ATMEL_US_ENDTX |
225 ATMEL_US_TXBUFE;
226 else
227 atmel_port->tx_done_mask = ATMEL_US_TXRDY;
228 }
229 UART_PUT_MR(port, mode);
230
231 /* Enable interrupts */
232 UART_PUT_IER(port, atmel_port->tx_done_mask);
233
234 spin_unlock(&port->lock);
235
236}
237
190/* 238/*
191 * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty. 239 * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty.
192 */ 240 */
@@ -202,6 +250,7 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
202{ 250{
203 unsigned int control = 0; 251 unsigned int control = 0;
204 unsigned int mode; 252 unsigned int mode;
253 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
205 254
206#ifdef CONFIG_ARCH_AT91RM9200 255#ifdef CONFIG_ARCH_AT91RM9200
207 if (cpu_is_at91rm9200()) { 256 if (cpu_is_at91rm9200()) {
@@ -236,6 +285,17 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
236 mode |= ATMEL_US_CHMODE_LOC_LOOP; 285 mode |= ATMEL_US_CHMODE_LOC_LOOP;
237 else 286 else
238 mode |= ATMEL_US_CHMODE_NORMAL; 287 mode |= ATMEL_US_CHMODE_NORMAL;
288
289 /* Resetting serial mode to RS232 (0x0) */
290 mode &= ~ATMEL_US_USMODE;
291
292 if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
293 dev_dbg(port->dev, "Setting UART to RS485\n");
294 UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send);
295 mode |= ATMEL_US_USMODE_RS485;
296 } else {
297 dev_dbg(port->dev, "Setting UART to RS232\n");
298 }
239 UART_PUT_MR(port, mode); 299 UART_PUT_MR(port, mode);
240} 300}
241 301
@@ -268,12 +328,17 @@ static u_int atmel_get_mctrl(struct uart_port *port)
268 */ 328 */
269static void atmel_stop_tx(struct uart_port *port) 329static void atmel_stop_tx(struct uart_port *port)
270{ 330{
331 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
332
271 if (atmel_use_dma_tx(port)) { 333 if (atmel_use_dma_tx(port)) {
272 /* disable PDC transmit */ 334 /* disable PDC transmit */
273 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); 335 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);
274 UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); 336 }
275 } else 337 /* Disable interrupts */
276 UART_PUT_IDR(port, ATMEL_US_TXRDY); 338 UART_PUT_IDR(port, atmel_port->tx_done_mask);
339
340 if (atmel_port->rs485.flags & SER_RS485_ENABLED)
341 atmel_start_rx(port);
277} 342}
278 343
279/* 344/*
@@ -281,17 +346,39 @@ static void atmel_stop_tx(struct uart_port *port)
281 */ 346 */
282static void atmel_start_tx(struct uart_port *port) 347static void atmel_start_tx(struct uart_port *port)
283{ 348{
349 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
350
284 if (atmel_use_dma_tx(port)) { 351 if (atmel_use_dma_tx(port)) {
285 if (UART_GET_PTSR(port) & ATMEL_PDC_TXTEN) 352 if (UART_GET_PTSR(port) & ATMEL_PDC_TXTEN)
286 /* The transmitter is already running. Yes, we 353 /* The transmitter is already running. Yes, we
287 really need this.*/ 354 really need this.*/
288 return; 355 return;
289 356
290 UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); 357 if (atmel_port->rs485.flags & SER_RS485_ENABLED)
358 atmel_stop_rx(port);
359
291 /* re-enable PDC transmit */ 360 /* re-enable PDC transmit */
292 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); 361 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);
293 } else 362 }
294 UART_PUT_IER(port, ATMEL_US_TXRDY); 363 /* Enable interrupts */
364 UART_PUT_IER(port, atmel_port->tx_done_mask);
365}
366
367/*
368 * start receiving - port is in process of being opened.
369 */
370static void atmel_start_rx(struct uart_port *port)
371{
372 UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */
373
374 if (atmel_use_dma_rx(port)) {
375 /* enable PDC controller */
376 UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT |
377 port->read_status_mask);
378 UART_PUT_PTCR(port, ATMEL_PDC_RXTEN);
379 } else {
380 UART_PUT_IER(port, ATMEL_US_RXRDY);
381 }
295} 382}
296 383
297/* 384/*
@@ -302,9 +389,11 @@ static void atmel_stop_rx(struct uart_port *port)
302 if (atmel_use_dma_rx(port)) { 389 if (atmel_use_dma_rx(port)) {
303 /* disable PDC receive */ 390 /* disable PDC receive */
304 UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); 391 UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS);
305 UART_PUT_IDR(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT); 392 UART_PUT_IDR(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT |
306 } else 393 port->read_status_mask);
394 } else {
307 UART_PUT_IDR(port, ATMEL_US_RXRDY); 395 UART_PUT_IDR(port, ATMEL_US_RXRDY);
396 }
308} 397}
309 398
310/* 399/*
@@ -428,8 +517,9 @@ static void atmel_rx_chars(struct uart_port *port)
428static void atmel_tx_chars(struct uart_port *port) 517static void atmel_tx_chars(struct uart_port *port)
429{ 518{
430 struct circ_buf *xmit = &port->state->xmit; 519 struct circ_buf *xmit = &port->state->xmit;
520 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
431 521
432 if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) { 522 if (port->x_char && UART_GET_CSR(port) & atmel_port->tx_done_mask) {
433 UART_PUT_CHAR(port, port->x_char); 523 UART_PUT_CHAR(port, port->x_char);
434 port->icount.tx++; 524 port->icount.tx++;
435 port->x_char = 0; 525 port->x_char = 0;
@@ -437,7 +527,7 @@ static void atmel_tx_chars(struct uart_port *port)
437 if (uart_circ_empty(xmit) || uart_tx_stopped(port)) 527 if (uart_circ_empty(xmit) || uart_tx_stopped(port))
438 return; 528 return;
439 529
440 while (UART_GET_CSR(port) & ATMEL_US_TXRDY) { 530 while (UART_GET_CSR(port) & atmel_port->tx_done_mask) {
441 UART_PUT_CHAR(port, xmit->buf[xmit->tail]); 531 UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
442 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 532 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
443 port->icount.tx++; 533 port->icount.tx++;
@@ -449,7 +539,8 @@ static void atmel_tx_chars(struct uart_port *port)
449 uart_write_wakeup(port); 539 uart_write_wakeup(port);
450 540
451 if (!uart_circ_empty(xmit)) 541 if (!uart_circ_empty(xmit))
452 UART_PUT_IER(port, ATMEL_US_TXRDY); 542 /* Enable interrupts */
543 UART_PUT_IER(port, atmel_port->tx_done_mask);
453} 544}
454 545
455/* 546/*
@@ -501,18 +592,10 @@ atmel_handle_transmit(struct uart_port *port, unsigned int pending)
501{ 592{
502 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 593 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
503 594
504 if (atmel_use_dma_tx(port)) { 595 if (pending & atmel_port->tx_done_mask) {
505 /* PDC transmit */ 596 /* Either PDC or interrupt transmission */
506 if (pending & (ATMEL_US_ENDTX | ATMEL_US_TXBUFE)) { 597 UART_PUT_IDR(port, atmel_port->tx_done_mask);
507 UART_PUT_IDR(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); 598 tasklet_schedule(&atmel_port->tasklet);
508 tasklet_schedule(&atmel_port->tasklet);
509 }
510 } else {
511 /* Interrupt transmit */
512 if (pending & ATMEL_US_TXRDY) {
513 UART_PUT_IDR(port, ATMEL_US_TXRDY);
514 tasklet_schedule(&atmel_port->tasklet);
515 }
516 } 599 }
517} 600}
518 601
@@ -590,9 +673,15 @@ static void atmel_tx_dma(struct uart_port *port)
590 673
591 UART_PUT_TPR(port, pdc->dma_addr + xmit->tail); 674 UART_PUT_TPR(port, pdc->dma_addr + xmit->tail);
592 UART_PUT_TCR(port, count); 675 UART_PUT_TCR(port, count);
593 /* re-enable PDC transmit and interrupts */ 676 /* re-enable PDC transmit */
594 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); 677 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);
595 UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); 678 /* Enable interrupts */
679 UART_PUT_IER(port, atmel_port->tx_done_mask);
680 } else {
681 if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
682 /* DMA done, stop TX, start RX for RS485 */
683 atmel_start_rx(port);
684 }
596 } 685 }
597 686
598 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 687 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -1017,6 +1106,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
1017{ 1106{
1018 unsigned long flags; 1107 unsigned long flags;
1019 unsigned int mode, imr, quot, baud; 1108 unsigned int mode, imr, quot, baud;
1109 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
1020 1110
1021 /* Get current mode register */ 1111 /* Get current mode register */
1022 mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL 1112 mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL
@@ -1115,6 +1205,17 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
1115 /* disable receiver and transmitter */ 1205 /* disable receiver and transmitter */
1116 UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); 1206 UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS);
1117 1207
1208 /* Resetting serial mode to RS232 (0x0) */
1209 mode &= ~ATMEL_US_USMODE;
1210
1211 if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
1212 dev_dbg(port->dev, "Setting UART to RS485\n");
1213 UART_PUT_TTGR(port, atmel_port->rs485.delay_rts_before_send);
1214 mode |= ATMEL_US_USMODE_RS485;
1215 } else {
1216 dev_dbg(port->dev, "Setting UART to RS232\n");
1217 }
1218
1118 /* set the parity, stop bits and data size */ 1219 /* set the parity, stop bits and data size */
1119 UART_PUT_MR(port, mode); 1220 UART_PUT_MR(port, mode);
1120 1221
@@ -1231,6 +1332,35 @@ static void atmel_poll_put_char(struct uart_port *port, unsigned char ch)
1231} 1332}
1232#endif 1333#endif
1233 1334
1335static int
1336atmel_ioctl(struct uart_port *port, unsigned int cmd, unsigned long arg)
1337{
1338 struct serial_rs485 rs485conf;
1339
1340 switch (cmd) {
1341 case TIOCSRS485:
1342 if (copy_from_user(&rs485conf, (struct serial_rs485 *) arg,
1343 sizeof(rs485conf)))
1344 return -EFAULT;
1345
1346 atmel_config_rs485(port, &rs485conf);
1347 break;
1348
1349 case TIOCGRS485:
1350 if (copy_to_user((struct serial_rs485 *) arg,
1351 &(to_atmel_uart_port(port)->rs485),
1352 sizeof(rs485conf)))
1353 return -EFAULT;
1354 break;
1355
1356 default:
1357 return -ENOIOCTLCMD;
1358 }
1359 return 0;
1360}
1361
1362
1363
1234static struct uart_ops atmel_pops = { 1364static struct uart_ops atmel_pops = {
1235 .tx_empty = atmel_tx_empty, 1365 .tx_empty = atmel_tx_empty,
1236 .set_mctrl = atmel_set_mctrl, 1366 .set_mctrl = atmel_set_mctrl,
@@ -1250,6 +1380,7 @@ static struct uart_ops atmel_pops = {
1250 .config_port = atmel_config_port, 1380 .config_port = atmel_config_port,
1251 .verify_port = atmel_verify_port, 1381 .verify_port = atmel_verify_port,
1252 .pm = atmel_serial_pm, 1382 .pm = atmel_serial_pm,
1383 .ioctl = atmel_ioctl,
1253#ifdef CONFIG_CONSOLE_POLL 1384#ifdef CONFIG_CONSOLE_POLL
1254 .poll_get_char = atmel_poll_get_char, 1385 .poll_get_char = atmel_poll_get_char,
1255 .poll_put_char = atmel_poll_put_char, 1386 .poll_put_char = atmel_poll_put_char,
@@ -1265,13 +1396,12 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
1265 struct uart_port *port = &atmel_port->uart; 1396 struct uart_port *port = &atmel_port->uart;
1266 struct atmel_uart_data *data = pdev->dev.platform_data; 1397 struct atmel_uart_data *data = pdev->dev.platform_data;
1267 1398
1268 port->iotype = UPIO_MEM; 1399 port->iotype = UPIO_MEM;
1269 port->flags = UPF_BOOT_AUTOCONF; 1400 port->flags = UPF_BOOT_AUTOCONF;
1270 port->ops = &atmel_pops; 1401 port->ops = &atmel_pops;
1271 port->fifosize = 1; 1402 port->fifosize = 1;
1272 port->line = pdev->id; 1403 port->line = pdev->id;
1273 port->dev = &pdev->dev; 1404 port->dev = &pdev->dev;
1274
1275 port->mapbase = pdev->resource[0].start; 1405 port->mapbase = pdev->resource[0].start;
1276 port->irq = pdev->resource[1].start; 1406 port->irq = pdev->resource[1].start;
1277 1407
@@ -1299,8 +1429,16 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
1299 1429
1300 atmel_port->use_dma_rx = data->use_dma_rx; 1430 atmel_port->use_dma_rx = data->use_dma_rx;
1301 atmel_port->use_dma_tx = data->use_dma_tx; 1431 atmel_port->use_dma_tx = data->use_dma_tx;
1302 if (atmel_use_dma_tx(port)) 1432 atmel_port->rs485 = data->rs485;
1433 /* Use TXEMPTY for interrupt when rs485 else TXRDY or ENDTX|TXBUFE */
1434 if (atmel_port->rs485.flags & SER_RS485_ENABLED)
1435 atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;
1436 else if (atmel_use_dma_tx(port)) {
1303 port->fifosize = PDC_BUFFER_SIZE; 1437 port->fifosize = PDC_BUFFER_SIZE;
1438 atmel_port->tx_done_mask = ATMEL_US_ENDTX | ATMEL_US_TXBUFE;
1439 } else {
1440 atmel_port->tx_done_mask = ATMEL_US_TXRDY;
1441 }
1304} 1442}
1305 1443
1306/* 1444/*
@@ -1334,6 +1472,7 @@ static void atmel_console_putchar(struct uart_port *port, int ch)
1334static void atmel_console_write(struct console *co, const char *s, u_int count) 1472static void atmel_console_write(struct console *co, const char *s, u_int count)
1335{ 1473{
1336 struct uart_port *port = &atmel_ports[co->index].uart; 1474 struct uart_port *port = &atmel_ports[co->index].uart;
1475 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
1337 unsigned int status, imr; 1476 unsigned int status, imr;
1338 unsigned int pdc_tx; 1477 unsigned int pdc_tx;
1339 1478
@@ -1341,7 +1480,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
1341 * First, save IMR and then disable interrupts 1480 * First, save IMR and then disable interrupts
1342 */ 1481 */
1343 imr = UART_GET_IMR(port); 1482 imr = UART_GET_IMR(port);
1344 UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY); 1483 UART_PUT_IDR(port, ATMEL_US_RXRDY | atmel_port->tx_done_mask);
1345 1484
1346 /* Store PDC transmit status and disable it */ 1485 /* Store PDC transmit status and disable it */
1347 pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN; 1486 pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN;
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 12ac9cd32a07..b3bd22ef82ba 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -366,6 +366,13 @@ rescan:
366 if (is_done) 366 if (is_done)
367 done(ep, req, 0); 367 done(ep, req, 0);
368 else if (ep->is_pingpong) { 368 else if (ep->is_pingpong) {
369 /*
370 * One dummy read to delay the code because of a HW glitch:
371 * CSR returns bad RXCOUNT when read too soon after updating
372 * RX_DATA_BK flags.
373 */
374 csr = __raw_readl(creg);
375
369 bufferspace -= count; 376 bufferspace -= count;
370 buf += count; 377 buf += count;
371 goto rescan; 378 goto rescan;
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index 6b4241748dda..7e466fe72025 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -6,8 +6,29 @@
6 6
7#include <linux/mmc/host.h> 7#include <linux/mmc/host.h>
8 8
9/**
10 * struct mmci_platform_data - platform configuration for the MMCI
11 * (also known as PL180) block.
12 * @f_max: the maximum operational frequency for this host in this
13 * platform configuration. When this is specified it takes precedence
14 * over the module parameter for the same frequency.
15 * @ocr_mask: available voltages on the 4 pins from the block, this
16 * is ignored if a regulator is used, see the MMC_VDD_* masks in
17 * mmc/host.h
18 * @translate_vdd: a callback function to translate a MMC_VDD_*
19 * mask into a value to be binary or:ed and written into the
20 * MMCIPWR register of the block
21 * @status: if no GPIO read function was given to the block in
22 * gpio_wp (below) this function will be called to determine
23 * whether a card is present in the MMC slot or not
24 * @gpio_wp: read this GPIO pin to see if the card is write protected
25 * @gpio_cd: read this GPIO pin to detect card insertion
26 * @capabilities: the capabilities of the block as implemented in
27 * this platform, signify anything MMC_CAP_* from mmc/host.h
28 */
9struct mmci_platform_data { 29struct mmci_platform_data {
10 unsigned int ocr_mask; /* available voltages */ 30 unsigned int f_max;
31 unsigned int ocr_mask;
11 u32 (*translate_vdd)(struct device *, unsigned int); 32 u32 (*translate_vdd)(struct device *, unsigned int);
12 unsigned int (*status)(struct device *); 33 unsigned int (*status)(struct device *);
13 int gpio_wp; 34 int gpio_wp;