aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/GPIO.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Overview.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/S3C2412.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/S3C2413.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/Suspend.txt2
-rw-r--r--Documentation/arm/Samsung-S3C24XX/USB-Host.txt2
-rw-r--r--Documentation/filesystems/ocfs2.txt6
-rw-r--r--arch/arm/Kconfig16
-rw-r--r--arch/arm/Makefile7
-rw-r--r--arch/arm/boot/compressed/head.S6
-rw-r--r--arch/arm/configs/dove_defconfig1620
-rw-r--r--arch/arm/include/asm/hardware/cache-tauros2.h11
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h18
-rw-r--r--arch/arm/include/asm/kmap_types.h6
-rw-r--r--arch/arm/kernel/head-nommu.S2
-rw-r--r--arch/arm/kernel/head.S2
-rw-r--r--arch/arm/kernel/vmlinux.lds.S85
-rw-r--r--arch/arm/mach-at91/Kconfig91
-rw-r--r--arch/arm/mach-dove/Kconfig14
-rw-r--r--arch/arm/mach-dove/Makefile3
-rw-r--r--arch/arm/mach-dove/Makefile.boot3
-rw-r--r--arch/arm/mach-dove/addr-map.c149
-rw-r--r--arch/arm/mach-dove/common.c781
-rw-r--r--arch/arm/mach-dove/common.h40
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c102
-rw-r--r--arch/arm/mach-dove/include/mach/bridge-regs.h58
-rw-r--r--arch/arm/mach-dove/include/mach/debug-macro.S20
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h180
-rw-r--r--arch/arm/mach-dove/include/mach/entry-macro.S39
-rw-r--r--arch/arm/mach-dove/include/mach/gpio.h49
-rw-r--r--arch/arm/mach-dove/include/mach/hardware.h26
-rw-r--r--arch/arm/mach-dove/include/mach/io.h20
-rw-r--r--arch/arm/mach-dove/include/mach/irqs.h101
-rw-r--r--arch/arm/mach-dove/include/mach/memory.h10
-rw-r--r--arch/arm/mach-dove/include/mach/pm.h54
-rw-r--r--arch/arm/mach-dove/include/mach/system.h36
-rw-r--r--arch/arm/mach-dove/include/mach/timex.h9
-rw-r--r--arch/arm/mach-dove/include/mach/uncompress.h37
-rw-r--r--arch/arm/mach-dove/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-dove/irq.c133
-rw-r--r--arch/arm/mach-dove/pcie.c238
-rw-r--r--arch/arm/mach-iop13xx/include/mach/time.h18
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c1
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c1
-rw-r--r--arch/arm/mach-iop32x/em7210.c1
-rw-r--r--arch/arm/mach-iop32x/glantank.c1
-rw-r--r--arch/arm/mach-iop32x/iq31244.c1
-rw-r--r--arch/arm/mach-iop32x/iq80321.c1
-rw-r--r--arch/arm/mach-iop32x/n2100.c1
-rw-r--r--arch/arm/mach-iop33x/iq80331.c1
-rw-r--r--arch/arm/mach-iop33x/iq80332.c1
-rw-r--r--arch/arm/mach-kirkwood/Kconfig12
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c108
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c154
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.c113
-rw-r--r--arch/arm/mach-kirkwood/tsx1x-common.h7
-rw-r--r--arch/arm/mach-mx2/Kconfig2
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c4
-rw-r--r--arch/arm/mach-mx2/devices.c78
-rw-r--r--arch/arm/mach-mx2/devices.h3
-rw-r--r--arch/arm/mach-mx2/pca100.c2
-rw-r--r--arch/arm/mach-mx3/Kconfig3
-rw-r--r--arch/arm/mach-mx3/Makefile4
-rw-r--r--arch/arm/mach-mx3/armadillo5x0.c60
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c41
-rw-r--r--arch/arm/mach-mx3/clock.c6
-rw-r--r--arch/arm/mach-mx3/cpu.c57
-rw-r--r--arch/arm/mach-mx3/devices.c44
-rw-r--r--arch/arm/mach-mx3/devices.h2
-rw-r--r--arch/arm/mach-mx3/mx31lilly-db.c10
-rw-r--r--arch/arm/mach-mx3/mx31lilly.c57
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c198
-rw-r--r--arch/arm/mach-mx3/mx31lite.c175
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c86
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c192
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c249
-rw-r--r--arch/arm/mach-mx3/pcm043.c7
-rw-r--r--arch/arm/mach-s3c2400/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c2410/Kconfig8
-rw-r--r--arch/arm/mach-s3c2410/Makefile3
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c4
-rw-r--r--arch/arm/mach-s3c2410/cpu-freq.c2
-rw-r--r--arch/arm/mach-s3c2410/h1940-bluetooth.c88
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-cpld.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-irq.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-map.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/bast-pmu.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-fns.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/osiris-map.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-clock.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-power.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-s3c2410/include/mach/vr1000-irq.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c19
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c105
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c4
-rw-r--r--arch/arm/mach-s3c2410/pll.c2
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c11
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c10
-rw-r--r--arch/arm/mach-s3c2440/Kconfig13
-rw-r--r--arch/arm/mach-s3c2440/Makefile4
-rw-r--r--arch/arm/mach-s3c2440/irq.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c29
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c9
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris-dvs.c194
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c47
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c11
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c6
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/map.h2
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/regs-clock.h4
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h4
-rw-r--r--arch/arm/mach-s3c6400/include/mach/regs-fb.h236
-rw-r--r--arch/arm/mach-s3c6400/s3c6400.c1
-rw-r--r--arch/arm/mach-s3c6410/cpu.c1
-rw-r--r--arch/arm/mach-s3c6410/mach-hmt.c2
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c52
-rw-r--r--arch/arm/mach-s5pc100/Kconfig14
-rw-r--r--arch/arm/mach-s5pc100/Makefile4
-rw-r--r--arch/arm/mach-s5pc100/cpu.c29
-rw-r--r--arch/arm/mach-s5pc100/include/mach/gpio.h230
-rw-r--r--arch/arm/mach-s5pc100/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-s5pc100/include/mach/map.h87
-rw-r--r--arch/arm/mach-s5pc100/include/mach/regs-fb.h139
-rw-r--r--arch/arm/mach-s5pc100/include/mach/system.h13
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c89
-rw-r--r--arch/arm/mach-s5pc100/setup-sdhci.c65
-rw-r--r--arch/arm/mm/Kconfig11
-rw-r--r--arch/arm/mm/Makefile2
-rw-r--r--arch/arm/mm/cache-tauros2.c263
-rw-r--r--arch/arm/mm/proc-v6.S33
-rw-r--r--arch/arm/mm/proc-xsc3.S2
-rw-r--r--arch/arm/plat-iop/time.c176
-rw-r--r--arch/arm/plat-mxc/Kconfig10
-rw-r--r--arch/arm/plat-mxc/Makefile3
-rw-r--r--arch/arm/plat-mxc/audmux-v1.c53
-rw-r--r--arch/arm/plat-mxc/audmux-v2.c74
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c3
-rw-r--r--arch/arm/plat-mxc/gpio.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/audmux.h52
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31lite.h39
-rw-r--r--arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h26
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h17
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h207
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h315
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h341
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h237
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h201
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h418
-rw-r--r--arch/arm/plat-mxc/include/mach/ulpi.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h2
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c36
-rw-r--r--arch/arm/plat-mxc/ulpi.c113
-rw-r--r--arch/arm/plat-s3c/Kconfig11
-rw-r--r--arch/arm/plat-s3c/Makefile1
-rw-r--r--arch/arm/plat-s3c/clock.c4
-rw-r--r--arch/arm/plat-s3c/dev-hsmmc2.c69
-rw-r--r--arch/arm/plat-s3c/dev-i2c0.c2
-rw-r--r--arch/arm/plat-s3c/dev-i2c1.c2
-rw-r--r--arch/arm/plat-s3c/dev-nand.c97
-rw-r--r--arch/arm/plat-s3c/dma.c2
-rw-r--r--arch/arm/plat-s3c/include/plat/audio-simtec.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu-freq.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/cpu.h6
-rw-r--r--arch/arm/plat-s3c/include/plat/dma.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/fb.h7
-rw-r--r--arch/arm/plat-s3c/include/plat/iic.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/nand.h8
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-fb-v4.h235
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-nand.h4
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-serial.h2
-rw-r--r--arch/arm/plat-s3c/include/plat/sdhci.h78
-rw-r--r--arch/arm/plat-s3c/pm-check.c2
-rw-r--r--arch/arm/plat-s3c/pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig7
-rw-r--r--arch/arm/plat-s3c24xx/Makefile1
-rw-r--r--arch/arm/plat-s3c24xx/clock-dclk.c2
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c2
-rw-r--r--arch/arm/plat-s3c24xx/dma.c4
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/mci.h25
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-dma.h2
-rw-r--r--arch/arm/plat-s3c24xx/irq-pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c4
-rw-r--r--arch/arm/plat-s3c24xx/pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-iotiming.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2412-iotiming.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-cpufreq.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x-clock.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x-irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/simtec-audio.c77
-rw-r--r--arch/arm/plat-s3c64xx/cpu.c5
-rw-r--r--arch/arm/plat-s3c64xx/cpufreq.c40
-rw-r--r--arch/arm/plat-s3c64xx/gpiolib.c12
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h6
-rw-r--r--arch/arm/plat-s3c64xx/irq-eint.c19
-rw-r--r--arch/arm/plat-s3c64xx/setup-sdhci-gpio.c20
-rw-r--r--arch/arm/plat-s5pc1xx/Kconfig18
-rw-r--r--arch/arm/plat-s5pc1xx/Makefile11
-rw-r--r--arch/arm/plat-s5pc1xx/clock.c728
-rw-r--r--arch/arm/plat-s5pc1xx/cpu.c10
-rw-r--r--arch/arm/plat-s5pc1xx/gpio-config.c62
-rw-r--r--arch/arm/plat-s5pc1xx/gpiolib.c503
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h32
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h44
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/irqs.h15
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-clock.h212
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h70
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-power.h84
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/s5pc100.h5
-rw-r--r--arch/arm/plat-s5pc1xx/irq-eint.c281
-rw-r--r--arch/arm/plat-s5pc1xx/irq-gpio.c266
-rw-r--r--arch/arm/plat-s5pc1xx/irq.c2
-rw-r--r--arch/arm/plat-s5pc1xx/s5pc100-clock.c1555
-rw-r--r--arch/arm/plat-s5pc1xx/setup-fb-24bpp.c49
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c0.c7
-rw-r--r--arch/arm/plat-s5pc1xx/setup-i2c1.c7
-rw-r--r--arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c86
-rw-r--r--arch/arm/plat-samsung/Kconfig17
-rw-r--r--arch/arm/plat-samsung/Makefile11
-rw-r--r--arch/avr32/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-pnx.c5
-rw-r--r--drivers/rtc/Kconfig2
-rw-r--r--drivers/serial/s3c2410.c2
-rw-r--r--drivers/serial/s3c2412.c2
-rw-r--r--drivers/serial/s3c2440.c2
-rw-r--r--drivers/serial/s3c24a0.c2
-rw-r--r--drivers/serial/samsung.c2
-rw-r--r--drivers/serial/samsung.h2
-rw-r--r--drivers/video/Kconfig5
-rw-r--r--drivers/watchdog/pnx4008_wdt.c4
-rw-r--r--fs/ocfs2/file.c3
-rw-r--r--fs/ocfs2/ocfs2.h7
-rw-r--r--fs/ocfs2/refcounttree.c69
-rw-r--r--fs/ocfs2/super.c20
-rw-r--r--fs/ocfs2/uptodate.c5
-rw-r--r--include/linux/i2c-pnx.h2
250 files changed, 12675 insertions, 2282 deletions
diff --git a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
index 26422f0f9080..b87292e05f2f 100644
--- a/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
+++ b/Documentation/arm/Samsung-S3C24XX/EB2410ITX.txt
@@ -55,4 +55,4 @@ Maintainers
55 This board is maintained by Simtec Electronics. 55 This board is maintained by Simtec Electronics.
56 56
57 57
58(c) 2004 Ben Dooks, Simtec Electronics 58Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/GPIO.txt b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
index 948c8718d967..2af2cf39915f 100644
--- a/Documentation/arm/Samsung-S3C24XX/GPIO.txt
+++ b/Documentation/arm/Samsung-S3C24XX/GPIO.txt
@@ -134,4 +134,4 @@ Authour
134 134
135 135
136Ben Dooks, 03 October 2004 136Ben Dooks, 03 October 2004
137(c) 2004 Ben Dooks, Simtec Electronics 137Copyright 2004 Ben Dooks, Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/Overview.txt b/Documentation/arm/Samsung-S3C24XX/Overview.txt
index cff6227b4484..081892df4fda 100644
--- a/Documentation/arm/Samsung-S3C24XX/Overview.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Overview.txt
@@ -299,4 +299,4 @@ Port Contributors
299Document Author 299Document Author
300--------------- 300---------------
301 301
302Ben Dooks, (c) 2004-2005,2006 Simtec Electronics 302Ben Dooks, Copyright 2004-2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
index 295d971a15ed..f057876b920b 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
+++ b/Documentation/arm/Samsung-S3C24XX/S3C2412.txt
@@ -117,4 +117,4 @@ ATA
117Document Author 117Document Author
118--------------- 118---------------
119 119
120Ben Dooks, (c) 2006 Simtec Electronics 120Ben Dooks, Copyright 2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
index ab2a88858f12..909bdc7dd7b5 100644
--- a/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
+++ b/Documentation/arm/Samsung-S3C24XX/S3C2413.txt
@@ -18,4 +18,4 @@ Camera Interface
18Document Author 18Document Author
19--------------- 19---------------
20 20
21Ben Dooks, (c) 2006 Simtec Electronics 21Ben Dooks, Copyright 2006 Simtec Electronics
diff --git a/Documentation/arm/Samsung-S3C24XX/Suspend.txt b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
index a30fe510572b..7edd0e2e6c5b 100644
--- a/Documentation/arm/Samsung-S3C24XX/Suspend.txt
+++ b/Documentation/arm/Samsung-S3C24XX/Suspend.txt
@@ -133,5 +133,5 @@ Configuration
133Document Author 133Document Author
134--------------- 134---------------
135 135
136Ben Dooks, (c) 2004 Simtec Electronics 136Ben Dooks, Copyright 2004 Simtec Electronics
137 137
diff --git a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
index 67671eba4231..f82b1faefad5 100644
--- a/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
+++ b/Documentation/arm/Samsung-S3C24XX/USB-Host.txt
@@ -90,4 +90,4 @@ Platform Data
90Document Author 90Document Author
91--------------- 91---------------
92 92
93Ben Dooks, (c) 2005 Simtec Electronics 93Ben Dooks, Copyright 2005 Simtec Electronics
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index c2a0871280a0..c58b9f5ba002 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -20,15 +20,16 @@ Lots of code taken from ext3 and other projects.
20Authors in alphabetical order: 20Authors in alphabetical order:
21Joel Becker <joel.becker@oracle.com> 21Joel Becker <joel.becker@oracle.com>
22Zach Brown <zach.brown@oracle.com> 22Zach Brown <zach.brown@oracle.com>
23Mark Fasheh <mark.fasheh@oracle.com> 23Mark Fasheh <mfasheh@suse.com>
24Kurt Hackel <kurt.hackel@oracle.com> 24Kurt Hackel <kurt.hackel@oracle.com>
25Tao Ma <tao.ma@oracle.com>
25Sunil Mushran <sunil.mushran@oracle.com> 26Sunil Mushran <sunil.mushran@oracle.com>
26Manish Singh <manish.singh@oracle.com> 27Manish Singh <manish.singh@oracle.com>
28Tiger Yang <tiger.yang@oracle.com>
27 29
28Caveats 30Caveats
29======= 31=======
30Features which OCFS2 does not support yet: 32Features which OCFS2 does not support yet:
31 - quotas
32 - Directory change notification (F_NOTIFY) 33 - Directory change notification (F_NOTIFY)
33 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) 34 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
34 35
@@ -70,7 +71,6 @@ commit=nrsec (*) Ocfs2 can be told to sync all its data and metadata
70 performance. 71 performance.
71localalloc=8(*) Allows custom localalloc size in MB. If the value is too 72localalloc=8(*) Allows custom localalloc size in MB. If the value is too
72 large, the fs will silently revert it to the default. 73 large, the fs will silently revert it to the default.
73 Localalloc is not enabled for local mounts.
74localflocks This disables cluster aware flock. 74localflocks This disables cluster aware flock.
75inode64 Indicates that Ocfs2 is allowed to create inodes at 75inode64 Indicates that Ocfs2 is allowed to create inodes at
76 any location in the filesystem, including those which 76 any location in the filesystem, including those which
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1c4119c60040..7d0818797c85 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -433,6 +433,17 @@ config ARCH_L7200
433 If you have any questions or comments about the Linux kernel port 433 If you have any questions or comments about the Linux kernel port
434 to this board, send e-mail to <sjhill@cotw.com>. 434 to this board, send e-mail to <sjhill@cotw.com>.
435 435
436config ARCH_DOVE
437 bool "Marvell Dove"
438 select PCI
439 select GENERIC_GPIO
440 select ARCH_REQUIRE_GPIOLIB
441 select GENERIC_TIME
442 select GENERIC_CLOCKEVENTS
443 select PLAT_ORION
444 help
445 Support for the Marvell Dove SoC 88AP510
446
436config ARCH_KIRKWOOD 447config ARCH_KIRKWOOD
437 bool "Marvell Kirkwood" 448 bool "Marvell Kirkwood"
438 select CPU_FEROCEON 449 select CPU_FEROCEON
@@ -747,6 +758,9 @@ source "arch/arm/mach-orion5x/Kconfig"
747 758
748source "arch/arm/mach-kirkwood/Kconfig" 759source "arch/arm/mach-kirkwood/Kconfig"
749 760
761source "arch/arm/mach-dove/Kconfig"
762
763source "arch/arm/plat-samsung/Kconfig"
750source "arch/arm/plat-s3c24xx/Kconfig" 764source "arch/arm/plat-s3c24xx/Kconfig"
751source "arch/arm/plat-s3c64xx/Kconfig" 765source "arch/arm/plat-s3c64xx/Kconfig"
752source "arch/arm/plat-s3c/Kconfig" 766source "arch/arm/plat-s3c/Kconfig"
@@ -810,6 +824,8 @@ config ARCH_ACORN
810 824
811config PLAT_IOP 825config PLAT_IOP
812 bool 826 bool
827 select GENERIC_CLOCKEVENTS
828 select GENERIC_TIME
813 829
814config PLAT_ORION 830config PLAT_ORION
815 bool 831 bool
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index a73caaf66763..8c0d08fbd991 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -122,6 +122,7 @@ machine-$(CONFIG_ARCH_AT91) := at91
122machine-$(CONFIG_ARCH_BCMRING) := bcmring 122machine-$(CONFIG_ARCH_BCMRING) := bcmring
123machine-$(CONFIG_ARCH_CLPS711X) := clps711x 123machine-$(CONFIG_ARCH_CLPS711X) := clps711x
124machine-$(CONFIG_ARCH_DAVINCI) := davinci 124machine-$(CONFIG_ARCH_DAVINCI) := davinci
125machine-$(CONFIG_ARCH_DOVE) := dove
125machine-$(CONFIG_ARCH_EBSA110) := ebsa110 126machine-$(CONFIG_ARCH_EBSA110) := ebsa110
126machine-$(CONFIG_ARCH_EP93XX) := ep93xx 127machine-$(CONFIG_ARCH_EP93XX) := ep93xx
127machine-$(CONFIG_ARCH_GEMINI) := gemini 128machine-$(CONFIG_ARCH_GEMINI) := gemini
@@ -178,9 +179,9 @@ plat-$(CONFIG_ARCH_OMAP) := omap
178plat-$(CONFIG_PLAT_IOP) := iop 179plat-$(CONFIG_PLAT_IOP) := iop
179plat-$(CONFIG_PLAT_ORION) := orion 180plat-$(CONFIG_PLAT_ORION) := orion
180plat-$(CONFIG_PLAT_PXA) := pxa 181plat-$(CONFIG_PLAT_PXA) := pxa
181plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c 182plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c samsung
182plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c 183plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c samsung
183plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c 184plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c samsung
184plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx 185plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
185 186
186ifeq ($(CONFIG_ARCH_EBSA110),y) 187ifeq ($(CONFIG_ARCH_EBSA110),y)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index fa6fbf45cf3b..d356af7cef82 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -743,6 +743,12 @@ proc_types:
743 W(b) __armv4_mmu_cache_off 743 W(b) __armv4_mmu_cache_off
744 W(b) __armv6_mmu_cache_flush 744 W(b) __armv6_mmu_cache_flush
745 745
746 .word 0x560f5810 @ Marvell PJ4 ARMv6
747 .word 0xff0ffff0
748 W(b) __armv4_mmu_cache_on
749 W(b) __armv4_mmu_cache_off
750 W(b) __armv6_mmu_cache_flush
751
746 .word 0x000f0000 @ new CPU Id 752 .word 0x000f0000 @ new CPU Id
747 .word 0x000f0000 753 .word 0x000f0000
748 W(b) __armv7_mmu_cache_on 754 W(b) __armv7_mmu_cache_on
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
new file mode 100644
index 000000000000..b3a491675d59
--- /dev/null
+++ b/arch/arm/configs/dove_defconfig
@@ -0,0 +1,1620 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6
4# Tue Nov 24 13:53:37 2009
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
37# CONFIG_POSIX_MQUEUE is not set
38# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set
40# CONFIG_AUDIT is not set
41
42#
43# RCU Subsystem
44#
45CONFIG_TREE_RCU=y
46# CONFIG_TREE_PREEMPT_RCU is not set
47# CONFIG_RCU_TRACE is not set
48CONFIG_RCU_FANOUT=32
49# CONFIG_RCU_FANOUT_EXACT is not set
50# CONFIG_TREE_RCU_TRACE is not set
51# CONFIG_IKCONFIG is not set
52CONFIG_LOG_BUF_SHIFT=14
53# CONFIG_GROUP_SCHED is not set
54# CONFIG_CGROUPS is not set
55# CONFIG_SYSFS_DEPRECATED_V2 is not set
56# CONFIG_RELAY is not set
57# CONFIG_NAMESPACES is not set
58# CONFIG_BLK_DEV_INITRD is not set
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y
61CONFIG_ANON_INODES=y
62CONFIG_EMBEDDED=y
63CONFIG_UID16=y
64CONFIG_SYSCTL_SYSCALL=y
65CONFIG_KALLSYMS=y
66# CONFIG_KALLSYMS_ALL is not set
67# CONFIG_KALLSYMS_EXTRA_PASS is not set
68CONFIG_HOTPLUG=y
69CONFIG_PRINTK=y
70CONFIG_BUG=y
71CONFIG_ELF_CORE=y
72CONFIG_BASE_FULL=y
73CONFIG_FUTEX=y
74CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y
78CONFIG_SHMEM=y
79CONFIG_AIO=y
80
81#
82# Kernel Performance Events And Counters
83#
84CONFIG_VM_EVENT_COUNTERS=y
85CONFIG_PCI_QUIRKS=y
86CONFIG_COMPAT_BRK=y
87CONFIG_SLAB=y
88# CONFIG_SLUB is not set
89# CONFIG_SLOB is not set
90# CONFIG_PROFILING is not set
91CONFIG_HAVE_OPROFILE=y
92# CONFIG_KPROBES is not set
93CONFIG_HAVE_KPROBES=y
94CONFIG_HAVE_KRETPROBES=y
95
96#
97# GCOV-based kernel profiling
98#
99# CONFIG_GCOV_KERNEL is not set
100# CONFIG_SLOW_WORK is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set
107CONFIG_MODULE_UNLOAD=y
108# CONFIG_MODULE_FORCE_UNLOAD is not set
109# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y
112CONFIG_LBDAF=y
113# CONFIG_BLK_DEV_BSG is not set
114# CONFIG_BLK_DEV_INTEGRITY is not set
115
116#
117# IO Schedulers
118#
119CONFIG_IOSCHED_NOOP=y
120CONFIG_IOSCHED_AS=y
121CONFIG_IOSCHED_DEADLINE=y
122CONFIG_IOSCHED_CFQ=y
123# CONFIG_DEFAULT_AS is not set
124# CONFIG_DEFAULT_DEADLINE is not set
125CONFIG_DEFAULT_CFQ=y
126# CONFIG_DEFAULT_NOOP is not set
127CONFIG_DEFAULT_IOSCHED="cfq"
128# CONFIG_FREEZER is not set
129
130#
131# System Type
132#
133CONFIG_MMU=y
134# CONFIG_ARCH_AAEC2000 is not set
135# CONFIG_ARCH_INTEGRATOR is not set
136# CONFIG_ARCH_REALVIEW is not set
137# CONFIG_ARCH_VERSATILE is not set
138# CONFIG_ARCH_AT91 is not set
139# CONFIG_ARCH_CLPS711X is not set
140# CONFIG_ARCH_GEMINI is not set
141# CONFIG_ARCH_EBSA110 is not set
142# CONFIG_ARCH_EP93XX is not set
143# CONFIG_ARCH_FOOTBRIDGE is not set
144# CONFIG_ARCH_MXC is not set
145# CONFIG_ARCH_STMP3XXX is not set
146# CONFIG_ARCH_NETX is not set
147# CONFIG_ARCH_H720X is not set
148# CONFIG_ARCH_NOMADIK is not set
149# CONFIG_ARCH_IOP13XX is not set
150# CONFIG_ARCH_IOP32X is not set
151# CONFIG_ARCH_IOP33X is not set
152# CONFIG_ARCH_IXP23XX is not set
153# CONFIG_ARCH_IXP2000 is not set
154# CONFIG_ARCH_IXP4XX is not set
155# CONFIG_ARCH_L7200 is not set
156CONFIG_ARCH_DOVE=y
157# CONFIG_ARCH_KIRKWOOD is not set
158# CONFIG_ARCH_LOKI is not set
159# CONFIG_ARCH_MV78XX0 is not set
160# CONFIG_ARCH_ORION5X is not set
161# CONFIG_ARCH_MMP is not set
162# CONFIG_ARCH_KS8695 is not set
163# CONFIG_ARCH_NS9XXX is not set
164# CONFIG_ARCH_W90X900 is not set
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set
172# CONFIG_ARCH_S5PC1XX is not set
173# CONFIG_ARCH_SHARK is not set
174# CONFIG_ARCH_LH7A40X is not set
175# CONFIG_ARCH_U300 is not set
176# CONFIG_ARCH_DAVINCI is not set
177# CONFIG_ARCH_OMAP is not set
178# CONFIG_ARCH_BCMRING is not set
179
180#
181# Marvell Dove Implementations
182#
183CONFIG_MACH_DOVE_DB=y
184CONFIG_PLAT_ORION=y
185
186#
187# Processor Type
188#
189CONFIG_CPU_32=y
190CONFIG_CPU_V6=y
191CONFIG_CPU_32v6K=y
192CONFIG_CPU_32v6=y
193CONFIG_CPU_ABRT_EV6=y
194CONFIG_CPU_PABRT_V6=y
195CONFIG_CPU_CACHE_V6=y
196CONFIG_CPU_CACHE_VIPT=y
197CONFIG_CPU_COPY_V6=y
198CONFIG_CPU_TLB_V6=y
199CONFIG_CPU_HAS_ASID=y
200CONFIG_CPU_CP15=y
201CONFIG_CPU_CP15_MMU=y
202
203#
204# Processor Features
205#
206CONFIG_ARM_THUMB=y
207# CONFIG_CPU_ICACHE_DISABLE is not set
208# CONFIG_CPU_DCACHE_DISABLE is not set
209# CONFIG_CPU_BPREDICT_DISABLE is not set
210CONFIG_OUTER_CACHE=y
211CONFIG_CACHE_TAUROS2=y
212CONFIG_ARM_L1_CACHE_SHIFT=5
213# CONFIG_ARM_ERRATA_411920 is not set
214
215#
216# Bus support
217#
218CONFIG_PCI=y
219CONFIG_PCI_SYSCALL=y
220# CONFIG_ARCH_SUPPORTS_MSI is not set
221CONFIG_PCI_LEGACY=y
222# CONFIG_PCI_DEBUG is not set
223# CONFIG_PCI_STUB is not set
224# CONFIG_PCI_IOV is not set
225# CONFIG_PCCARD is not set
226
227#
228# Kernel Features
229#
230CONFIG_TICK_ONESHOT=y
231CONFIG_NO_HZ=y
232CONFIG_HIGH_RES_TIMERS=y
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
242CONFIG_AEABI=y
243CONFIG_OABI_COMPAT=y
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=4
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=0x0
269CONFIG_ZBOOT_ROM_BSS=0x0
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
288CONFIG_VFP=y
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
297# CONFIG_BINFMT_MISC is not set
298
299#
300# Power management options
301#
302# CONFIG_PM is not set
303CONFIG_ARCH_SUSPEND_POSSIBLE=y
304CONFIG_NET=y
305
306#
307# Networking options
308#
309CONFIG_PACKET=y
310CONFIG_PACKET_MMAP=y
311CONFIG_UNIX=y
312CONFIG_XFRM=y
313# CONFIG_XFRM_USER is not set
314# CONFIG_XFRM_SUB_POLICY is not set
315# CONFIG_XFRM_MIGRATE is not set
316# CONFIG_XFRM_STATISTICS is not set
317# CONFIG_NET_KEY is not set
318CONFIG_INET=y
319CONFIG_IP_MULTICAST=y
320# CONFIG_IP_ADVANCED_ROUTER is not set
321CONFIG_IP_FIB_HASH=y
322CONFIG_IP_PNP=y
323CONFIG_IP_PNP_DHCP=y
324CONFIG_IP_PNP_BOOTP=y
325# CONFIG_IP_PNP_RARP is not set
326# CONFIG_NET_IPIP is not set
327# CONFIG_NET_IPGRE is not set
328# CONFIG_IP_MROUTE is not set
329# CONFIG_ARPD is not set
330# CONFIG_SYN_COOKIES is not set
331# CONFIG_INET_AH is not set
332# CONFIG_INET_ESP is not set
333# CONFIG_INET_IPCOMP is not set
334# CONFIG_INET_XFRM_TUNNEL is not set
335# CONFIG_INET_TUNNEL is not set
336CONFIG_INET_XFRM_MODE_TRANSPORT=y
337CONFIG_INET_XFRM_MODE_TUNNEL=y
338CONFIG_INET_XFRM_MODE_BEET=y
339CONFIG_INET_LRO=y
340CONFIG_INET_DIAG=y
341CONFIG_INET_TCP_DIAG=y
342# CONFIG_TCP_CONG_ADVANCED is not set
343CONFIG_TCP_CONG_CUBIC=y
344CONFIG_DEFAULT_TCP_CONG="cubic"
345# CONFIG_TCP_MD5SIG is not set
346# CONFIG_IPV6 is not set
347# CONFIG_NETWORK_SECMARK is not set
348# CONFIG_NETFILTER is not set
349# CONFIG_IP_DCCP is not set
350# CONFIG_IP_SCTP is not set
351# CONFIG_RDS is not set
352# CONFIG_TIPC is not set
353# CONFIG_ATM is not set
354# CONFIG_BRIDGE is not set
355# CONFIG_NET_DSA is not set
356# CONFIG_VLAN_8021Q is not set
357# CONFIG_DECNET is not set
358# CONFIG_LLC2 is not set
359# CONFIG_IPX is not set
360# CONFIG_ATALK is not set
361# CONFIG_X25 is not set
362# CONFIG_LAPB is not set
363# CONFIG_ECONET is not set
364# CONFIG_WAN_ROUTER is not set
365# CONFIG_PHONET is not set
366# CONFIG_IEEE802154 is not set
367# CONFIG_NET_SCHED is not set
368# CONFIG_DCB is not set
369
370#
371# Network testing
372#
373# CONFIG_NET_PKTGEN is not set
374# CONFIG_HAMRADIO is not set
375# CONFIG_CAN is not set
376# CONFIG_IRDA is not set
377# CONFIG_BT is not set
378# CONFIG_AF_RXRPC is not set
379# CONFIG_WIRELESS is not set
380# CONFIG_WIMAX is not set
381# CONFIG_RFKILL is not set
382# CONFIG_NET_9P is not set
383
384#
385# Device Drivers
386#
387
388#
389# Generic Driver Options
390#
391CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
392# CONFIG_DEVTMPFS is not set
393CONFIG_STANDALONE=y
394CONFIG_PREVENT_FIRMWARE_BUILD=y
395CONFIG_FW_LOADER=y
396CONFIG_FIRMWARE_IN_KERNEL=y
397CONFIG_EXTRA_FIRMWARE=""
398# CONFIG_DEBUG_DRIVER is not set
399# CONFIG_DEBUG_DEVRES is not set
400# CONFIG_SYS_HYPERVISOR is not set
401# CONFIG_CONNECTOR is not set
402CONFIG_MTD=y
403# CONFIG_MTD_DEBUG is not set
404# CONFIG_MTD_TESTS is not set
405# CONFIG_MTD_CONCAT is not set
406CONFIG_MTD_PARTITIONS=y
407# CONFIG_MTD_REDBOOT_PARTS is not set
408CONFIG_MTD_CMDLINE_PARTS=y
409# CONFIG_MTD_AFS_PARTS is not set
410# CONFIG_MTD_AR7_PARTS is not set
411
412#
413# User Modules And Translation Layers
414#
415CONFIG_MTD_CHAR=y
416CONFIG_MTD_BLKDEVS=y
417CONFIG_MTD_BLOCK=y
418# CONFIG_FTL is not set
419# CONFIG_NFTL is not set
420# CONFIG_INFTL is not set
421# CONFIG_RFD_FTL is not set
422# CONFIG_SSFDC is not set
423# CONFIG_MTD_OOPS is not set
424
425#
426# RAM/ROM/Flash chip drivers
427#
428CONFIG_MTD_CFI=y
429CONFIG_MTD_JEDECPROBE=y
430CONFIG_MTD_GEN_PROBE=y
431CONFIG_MTD_CFI_ADV_OPTIONS=y
432CONFIG_MTD_CFI_NOSWAP=y
433# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
434# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
435CONFIG_MTD_CFI_GEOMETRY=y
436CONFIG_MTD_MAP_BANK_WIDTH_1=y
437CONFIG_MTD_MAP_BANK_WIDTH_2=y
438# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
439# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
440# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
441# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
442CONFIG_MTD_CFI_I1=y
443CONFIG_MTD_CFI_I2=y
444# CONFIG_MTD_CFI_I4 is not set
445# CONFIG_MTD_CFI_I8 is not set
446# CONFIG_MTD_OTP is not set
447CONFIG_MTD_CFI_INTELEXT=y
448# CONFIG_MTD_CFI_AMDSTD is not set
449CONFIG_MTD_CFI_STAA=y
450CONFIG_MTD_CFI_UTIL=y
451# CONFIG_MTD_RAM is not set
452# CONFIG_MTD_ROM is not set
453# CONFIG_MTD_ABSENT is not set
454
455#
456# Mapping drivers for chip access
457#
458# CONFIG_MTD_COMPLEX_MAPPINGS is not set
459CONFIG_MTD_PHYSMAP=y
460# CONFIG_MTD_PHYSMAP_COMPAT is not set
461# CONFIG_MTD_ARM_INTEGRATOR is not set
462# CONFIG_MTD_IMPA7 is not set
463# CONFIG_MTD_INTEL_VR_NOR is not set
464# CONFIG_MTD_PLATRAM is not set
465
466#
467# Self-contained MTD device drivers
468#
469# CONFIG_MTD_PMC551 is not set
470# CONFIG_MTD_DATAFLASH is not set
471CONFIG_MTD_M25P80=y
472CONFIG_M25PXX_USE_FAST_READ=y
473# CONFIG_MTD_SST25L is not set
474# CONFIG_MTD_SLRAM is not set
475# CONFIG_MTD_PHRAM is not set
476# CONFIG_MTD_MTDRAM is not set
477# CONFIG_MTD_BLOCK2MTD is not set
478
479#
480# Disk-On-Chip Device Drivers
481#
482# CONFIG_MTD_DOC2000 is not set
483# CONFIG_MTD_DOC2001 is not set
484# CONFIG_MTD_DOC2001PLUS is not set
485# CONFIG_MTD_NAND is not set
486# CONFIG_MTD_ONENAND is not set
487
488#
489# LPDDR flash memory drivers
490#
491# CONFIG_MTD_LPDDR is not set
492
493#
494# UBI - Unsorted block images
495#
496CONFIG_MTD_UBI=y
497CONFIG_MTD_UBI_WL_THRESHOLD=4096
498CONFIG_MTD_UBI_BEB_RESERVE=1
499# CONFIG_MTD_UBI_GLUEBI is not set
500
501#
502# UBI debugging options
503#
504# CONFIG_MTD_UBI_DEBUG is not set
505# CONFIG_PARPORT is not set
506CONFIG_BLK_DEV=y
507# CONFIG_BLK_CPQ_DA is not set
508# CONFIG_BLK_CPQ_CISS_DA is not set
509# CONFIG_BLK_DEV_DAC960 is not set
510# CONFIG_BLK_DEV_UMEM is not set
511# CONFIG_BLK_DEV_COW_COMMON is not set
512CONFIG_BLK_DEV_LOOP=y
513# CONFIG_BLK_DEV_CRYPTOLOOP is not set
514# CONFIG_BLK_DEV_NBD is not set
515# CONFIG_BLK_DEV_SX8 is not set
516# CONFIG_BLK_DEV_UB is not set
517CONFIG_BLK_DEV_RAM=y
518CONFIG_BLK_DEV_RAM_COUNT=1
519CONFIG_BLK_DEV_RAM_SIZE=4096
520# CONFIG_BLK_DEV_XIP is not set
521# CONFIG_CDROM_PKTCDVD is not set
522# CONFIG_ATA_OVER_ETH is not set
523# CONFIG_MG_DISK is not set
524# CONFIG_MISC_DEVICES is not set
525CONFIG_HAVE_IDE=y
526# CONFIG_IDE is not set
527
528#
529# SCSI device support
530#
531# CONFIG_RAID_ATTRS is not set
532CONFIG_SCSI=y
533CONFIG_SCSI_DMA=y
534# CONFIG_SCSI_TGT is not set
535# CONFIG_SCSI_NETLINK is not set
536# CONFIG_SCSI_PROC_FS is not set
537
538#
539# SCSI support type (disk, tape, CD-ROM)
540#
541CONFIG_BLK_DEV_SD=y
542# CONFIG_CHR_DEV_ST is not set
543# CONFIG_CHR_DEV_OSST is not set
544# CONFIG_BLK_DEV_SR is not set
545# CONFIG_CHR_DEV_SG is not set
546# CONFIG_CHR_DEV_SCH is not set
547# CONFIG_SCSI_MULTI_LUN is not set
548# CONFIG_SCSI_CONSTANTS is not set
549# CONFIG_SCSI_LOGGING is not set
550# CONFIG_SCSI_SCAN_ASYNC is not set
551CONFIG_SCSI_WAIT_SCAN=m
552
553#
554# SCSI Transports
555#
556# CONFIG_SCSI_SPI_ATTRS is not set
557# CONFIG_SCSI_FC_ATTRS is not set
558# CONFIG_SCSI_ISCSI_ATTRS is not set
559# CONFIG_SCSI_SAS_LIBSAS is not set
560# CONFIG_SCSI_SRP_ATTRS is not set
561# CONFIG_SCSI_LOWLEVEL is not set
562# CONFIG_SCSI_DH is not set
563# CONFIG_SCSI_OSD_INITIATOR is not set
564CONFIG_ATA=y
565# CONFIG_ATA_NONSTANDARD is not set
566CONFIG_ATA_VERBOSE_ERROR=y
567CONFIG_SATA_PMP=y
568# CONFIG_SATA_AHCI is not set
569# CONFIG_SATA_SIL24 is not set
570CONFIG_ATA_SFF=y
571# CONFIG_SATA_SVW is not set
572# CONFIG_ATA_PIIX is not set
573CONFIG_SATA_MV=y
574# CONFIG_SATA_NV is not set
575# CONFIG_PDC_ADMA is not set
576# CONFIG_SATA_QSTOR is not set
577# CONFIG_SATA_PROMISE is not set
578# CONFIG_SATA_SX4 is not set
579# CONFIG_SATA_SIL is not set
580# CONFIG_SATA_SIS is not set
581# CONFIG_SATA_ULI is not set
582# CONFIG_SATA_VIA is not set
583# CONFIG_SATA_VITESSE is not set
584# CONFIG_SATA_INIC162X is not set
585# CONFIG_PATA_ALI is not set
586# CONFIG_PATA_AMD is not set
587# CONFIG_PATA_ARTOP is not set
588# CONFIG_PATA_ATP867X is not set
589# CONFIG_PATA_ATIIXP is not set
590# CONFIG_PATA_CMD640_PCI is not set
591# CONFIG_PATA_CMD64X is not set
592# CONFIG_PATA_CS5520 is not set
593# CONFIG_PATA_CS5530 is not set
594# CONFIG_PATA_CYPRESS is not set
595# CONFIG_PATA_EFAR is not set
596# CONFIG_ATA_GENERIC is not set
597# CONFIG_PATA_HPT366 is not set
598# CONFIG_PATA_HPT37X is not set
599# CONFIG_PATA_HPT3X2N is not set
600# CONFIG_PATA_HPT3X3 is not set
601# CONFIG_PATA_IT821X is not set
602# CONFIG_PATA_IT8213 is not set
603# CONFIG_PATA_JMICRON is not set
604# CONFIG_PATA_TRIFLEX is not set
605# CONFIG_PATA_MARVELL is not set
606# CONFIG_PATA_MPIIX is not set
607# CONFIG_PATA_OLDPIIX is not set
608# CONFIG_PATA_NETCELL is not set
609# CONFIG_PATA_NINJA32 is not set
610# CONFIG_PATA_NS87410 is not set
611# CONFIG_PATA_NS87415 is not set
612# CONFIG_PATA_OPTI is not set
613# CONFIG_PATA_OPTIDMA is not set
614# CONFIG_PATA_PDC_OLD is not set
615# CONFIG_PATA_RADISYS is not set
616# CONFIG_PATA_RDC is not set
617# CONFIG_PATA_RZ1000 is not set
618# CONFIG_PATA_SC1200 is not set
619# CONFIG_PATA_SERVERWORKS is not set
620# CONFIG_PATA_PDC2027X is not set
621# CONFIG_PATA_SIL680 is not set
622# CONFIG_PATA_SIS is not set
623# CONFIG_PATA_VIA is not set
624# CONFIG_PATA_WINBOND is not set
625# CONFIG_PATA_PLATFORM is not set
626# CONFIG_PATA_SCH is not set
627# CONFIG_MD is not set
628# CONFIG_FUSION is not set
629
630#
631# IEEE 1394 (FireWire) support
632#
633
634#
635# You can enable one or both FireWire driver stacks.
636#
637
638#
639# See the help texts for more information.
640#
641# CONFIG_FIREWIRE is not set
642# CONFIG_IEEE1394 is not set
643# CONFIG_I2O is not set
644CONFIG_NETDEVICES=y
645# CONFIG_DUMMY is not set
646# CONFIG_BONDING is not set
647# CONFIG_MACVLAN is not set
648# CONFIG_EQUALIZER is not set
649# CONFIG_TUN is not set
650# CONFIG_VETH is not set
651# CONFIG_ARCNET is not set
652CONFIG_PHYLIB=y
653
654#
655# MII PHY device drivers
656#
657# CONFIG_MARVELL_PHY is not set
658# CONFIG_DAVICOM_PHY is not set
659# CONFIG_QSEMI_PHY is not set
660# CONFIG_LXT_PHY is not set
661# CONFIG_CICADA_PHY is not set
662# CONFIG_VITESSE_PHY is not set
663# CONFIG_SMSC_PHY is not set
664# CONFIG_BROADCOM_PHY is not set
665# CONFIG_ICPLUS_PHY is not set
666# CONFIG_REALTEK_PHY is not set
667# CONFIG_NATIONAL_PHY is not set
668# CONFIG_STE10XP is not set
669# CONFIG_LSI_ET1011C_PHY is not set
670# CONFIG_FIXED_PHY is not set
671# CONFIG_MDIO_BITBANG is not set
672# CONFIG_NET_ETHERNET is not set
673CONFIG_NETDEV_1000=y
674# CONFIG_ACENIC is not set
675# CONFIG_DL2K is not set
676# CONFIG_E1000 is not set
677# CONFIG_E1000E is not set
678# CONFIG_IP1000 is not set
679# CONFIG_IGB is not set
680# CONFIG_IGBVF is not set
681# CONFIG_NS83820 is not set
682# CONFIG_HAMACHI is not set
683# CONFIG_YELLOWFIN is not set
684# CONFIG_R8169 is not set
685# CONFIG_SIS190 is not set
686# CONFIG_SKGE is not set
687# CONFIG_SKY2 is not set
688# CONFIG_VIA_VELOCITY is not set
689# CONFIG_TIGON3 is not set
690# CONFIG_BNX2 is not set
691# CONFIG_CNIC is not set
692CONFIG_MV643XX_ETH=y
693# CONFIG_QLA3XXX is not set
694# CONFIG_ATL1 is not set
695# CONFIG_ATL1E is not set
696# CONFIG_ATL1C is not set
697# CONFIG_JME is not set
698# CONFIG_NETDEV_10000 is not set
699# CONFIG_TR is not set
700CONFIG_WLAN=y
701# CONFIG_WLAN_PRE80211 is not set
702# CONFIG_WLAN_80211 is not set
703
704#
705# Enable WiMAX (Networking options) to see the WiMAX drivers
706#
707
708#
709# USB Network Adapters
710#
711# CONFIG_USB_CATC is not set
712# CONFIG_USB_KAWETH is not set
713# CONFIG_USB_PEGASUS is not set
714# CONFIG_USB_RTL8150 is not set
715# CONFIG_USB_USBNET is not set
716# CONFIG_WAN is not set
717# CONFIG_FDDI is not set
718# CONFIG_HIPPI is not set
719# CONFIG_PPP is not set
720# CONFIG_SLIP is not set
721# CONFIG_NET_FC is not set
722# CONFIG_NETCONSOLE is not set
723# CONFIG_NETPOLL is not set
724# CONFIG_NET_POLL_CONTROLLER is not set
725# CONFIG_ISDN is not set
726# CONFIG_PHONE is not set
727
728#
729# Input device support
730#
731CONFIG_INPUT=y
732# CONFIG_INPUT_FF_MEMLESS is not set
733CONFIG_INPUT_POLLDEV=y
734
735#
736# Userland interfaces
737#
738# CONFIG_INPUT_MOUSEDEV is not set
739# CONFIG_INPUT_JOYDEV is not set
740CONFIG_INPUT_EVDEV=y
741# CONFIG_INPUT_EVBUG is not set
742
743#
744# Input Device Drivers
745#
746CONFIG_INPUT_KEYBOARD=y
747# CONFIG_KEYBOARD_ADP5588 is not set
748# CONFIG_KEYBOARD_ATKBD is not set
749# CONFIG_QT2160 is not set
750# CONFIG_KEYBOARD_LKKBD is not set
751# CONFIG_KEYBOARD_GPIO is not set
752# CONFIG_KEYBOARD_MATRIX is not set
753# CONFIG_KEYBOARD_MAX7359 is not set
754# CONFIG_KEYBOARD_NEWTON is not set
755# CONFIG_KEYBOARD_OPENCORES is not set
756# CONFIG_KEYBOARD_STOWAWAY is not set
757# CONFIG_KEYBOARD_SUNKBD is not set
758# CONFIG_KEYBOARD_XTKBD is not set
759CONFIG_INPUT_MOUSE=y
760# CONFIG_MOUSE_PS2 is not set
761# CONFIG_MOUSE_SERIAL is not set
762# CONFIG_MOUSE_APPLETOUCH is not set
763# CONFIG_MOUSE_BCM5974 is not set
764# CONFIG_MOUSE_VSXXXAA is not set
765# CONFIG_MOUSE_GPIO is not set
766# CONFIG_MOUSE_SYNAPTICS_I2C is not set
767# CONFIG_INPUT_JOYSTICK is not set
768# CONFIG_INPUT_TABLET is not set
769# CONFIG_INPUT_TOUCHSCREEN is not set
770# CONFIG_INPUT_MISC is not set
771
772#
773# Hardware I/O ports
774#
775# CONFIG_SERIO is not set
776# CONFIG_GAMEPORT is not set
777
778#
779# Character devices
780#
781CONFIG_VT=y
782CONFIG_CONSOLE_TRANSLATIONS=y
783CONFIG_VT_CONSOLE=y
784CONFIG_HW_CONSOLE=y
785# CONFIG_VT_HW_CONSOLE_BINDING is not set
786# CONFIG_DEVKMEM is not set
787# CONFIG_SERIAL_NONSTANDARD is not set
788# CONFIG_NOZOMI is not set
789
790#
791# Serial drivers
792#
793CONFIG_SERIAL_8250=y
794CONFIG_SERIAL_8250_CONSOLE=y
795# CONFIG_SERIAL_8250_PCI is not set
796CONFIG_SERIAL_8250_NR_UARTS=4
797CONFIG_SERIAL_8250_RUNTIME_UARTS=2
798# CONFIG_SERIAL_8250_EXTENDED is not set
799
800#
801# Non-8250 serial port support
802#
803# CONFIG_SERIAL_MAX3100 is not set
804CONFIG_SERIAL_CORE=y
805CONFIG_SERIAL_CORE_CONSOLE=y
806# CONFIG_SERIAL_JSM is not set
807CONFIG_UNIX98_PTYS=y
808# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
809CONFIG_LEGACY_PTYS=y
810CONFIG_LEGACY_PTY_COUNT=16
811# CONFIG_IPMI_HANDLER is not set
812# CONFIG_HW_RANDOM is not set
813# CONFIG_R3964 is not set
814# CONFIG_APPLICOM is not set
815# CONFIG_RAW_DRIVER is not set
816# CONFIG_TCG_TPM is not set
817CONFIG_DEVPORT=y
818CONFIG_I2C=y
819CONFIG_I2C_BOARDINFO=y
820CONFIG_I2C_COMPAT=y
821CONFIG_I2C_CHARDEV=y
822CONFIG_I2C_HELPER_AUTO=y
823
824#
825# I2C Hardware Bus support
826#
827
828#
829# PC SMBus host controller drivers
830#
831# CONFIG_I2C_ALI1535 is not set
832# CONFIG_I2C_ALI1563 is not set
833# CONFIG_I2C_ALI15X3 is not set
834# CONFIG_I2C_AMD756 is not set
835# CONFIG_I2C_AMD8111 is not set
836# CONFIG_I2C_I801 is not set
837# CONFIG_I2C_ISCH is not set
838# CONFIG_I2C_PIIX4 is not set
839# CONFIG_I2C_NFORCE2 is not set
840# CONFIG_I2C_SIS5595 is not set
841# CONFIG_I2C_SIS630 is not set
842# CONFIG_I2C_SIS96X is not set
843# CONFIG_I2C_VIA is not set
844# CONFIG_I2C_VIAPRO is not set
845
846#
847# I2C system bus drivers (mostly embedded / system-on-chip)
848#
849# CONFIG_I2C_GPIO is not set
850CONFIG_I2C_MV64XXX=y
851# CONFIG_I2C_OCORES is not set
852# CONFIG_I2C_SIMTEC is not set
853
854#
855# External I2C/SMBus adapter drivers
856#
857# CONFIG_I2C_PARPORT_LIGHT is not set
858# CONFIG_I2C_TAOS_EVM is not set
859# CONFIG_I2C_TINY_USB is not set
860
861#
862# Graphics adapter I2C/DDC channel drivers
863#
864# CONFIG_I2C_VOODOO3 is not set
865
866#
867# Other I2C/SMBus bus drivers
868#
869# CONFIG_I2C_PCA_PLATFORM is not set
870# CONFIG_I2C_STUB is not set
871
872#
873# Miscellaneous I2C Chip support
874#
875# CONFIG_DS1682 is not set
876# CONFIG_SENSORS_TSL2550 is not set
877# CONFIG_I2C_DEBUG_CORE is not set
878# CONFIG_I2C_DEBUG_ALGO is not set
879# CONFIG_I2C_DEBUG_BUS is not set
880# CONFIG_I2C_DEBUG_CHIP is not set
881CONFIG_SPI=y
882# CONFIG_SPI_DEBUG is not set
883CONFIG_SPI_MASTER=y
884
885#
886# SPI Master Controller Drivers
887#
888# CONFIG_SPI_BITBANG is not set
889# CONFIG_SPI_GPIO is not set
890CONFIG_SPI_ORION=y
891
892#
893# SPI Protocol Masters
894#
895# CONFIG_SPI_SPIDEV is not set
896# CONFIG_SPI_TLE62X0 is not set
897
898#
899# PPS support
900#
901# CONFIG_PPS is not set
902CONFIG_ARCH_REQUIRE_GPIOLIB=y
903CONFIG_GPIOLIB=y
904# CONFIG_DEBUG_GPIO is not set
905# CONFIG_GPIO_SYSFS is not set
906
907#
908# Memory mapped GPIO expanders:
909#
910
911#
912# I2C GPIO expanders:
913#
914# CONFIG_GPIO_MAX732X is not set
915# CONFIG_GPIO_PCA953X is not set
916# CONFIG_GPIO_PCF857X is not set
917
918#
919# PCI GPIO expanders:
920#
921# CONFIG_GPIO_BT8XX is not set
922# CONFIG_GPIO_LANGWELL is not set
923
924#
925# SPI GPIO expanders:
926#
927# CONFIG_GPIO_MAX7301 is not set
928# CONFIG_GPIO_MCP23S08 is not set
929# CONFIG_GPIO_MC33880 is not set
930
931#
932# AC97 GPIO expanders:
933#
934# CONFIG_W1 is not set
935# CONFIG_POWER_SUPPLY is not set
936# CONFIG_HWMON is not set
937# CONFIG_THERMAL is not set
938# CONFIG_WATCHDOG is not set
939CONFIG_SSB_POSSIBLE=y
940
941#
942# Sonics Silicon Backplane
943#
944# CONFIG_SSB is not set
945
946#
947# Multifunction device drivers
948#
949# CONFIG_MFD_CORE is not set
950# CONFIG_MFD_SM501 is not set
951# CONFIG_MFD_ASIC3 is not set
952# CONFIG_HTC_EGPIO is not set
953# CONFIG_HTC_PASIC3 is not set
954# CONFIG_TPS65010 is not set
955# CONFIG_TWL4030_CORE is not set
956# CONFIG_MFD_TMIO is not set
957# CONFIG_MFD_TC6393XB is not set
958# CONFIG_PMIC_DA903X is not set
959# CONFIG_MFD_WM8400 is not set
960# CONFIG_MFD_WM831X is not set
961# CONFIG_MFD_WM8350_I2C is not set
962# CONFIG_MFD_PCF50633 is not set
963# CONFIG_MFD_MC13783 is not set
964# CONFIG_AB3100_CORE is not set
965# CONFIG_EZX_PCAP is not set
966# CONFIG_REGULATOR is not set
967# CONFIG_MEDIA_SUPPORT is not set
968
969#
970# Graphics support
971#
972CONFIG_VGA_ARB=y
973# CONFIG_DRM is not set
974# CONFIG_VGASTATE is not set
975# CONFIG_VIDEO_OUTPUT_CONTROL is not set
976# CONFIG_FB is not set
977# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
978
979#
980# Display device support
981#
982# CONFIG_DISPLAY_SUPPORT is not set
983
984#
985# Console display driver support
986#
987# CONFIG_VGA_CONSOLE is not set
988CONFIG_DUMMY_CONSOLE=y
989# CONFIG_SOUND is not set
990CONFIG_HID_SUPPORT=y
991CONFIG_HID=y
992# CONFIG_HIDRAW is not set
993
994#
995# USB Input Devices
996#
997CONFIG_USB_HID=y
998# CONFIG_HID_PID is not set
999# CONFIG_USB_HIDDEV is not set
1000
1001#
1002# Special HID drivers
1003#
1004# CONFIG_HID_A4TECH is not set
1005# CONFIG_HID_APPLE is not set
1006# CONFIG_HID_BELKIN is not set
1007# CONFIG_HID_CHERRY is not set
1008# CONFIG_HID_CHICONY is not set
1009# CONFIG_HID_CYPRESS is not set
1010# CONFIG_HID_DRAGONRISE is not set
1011# CONFIG_HID_EZKEY is not set
1012# CONFIG_HID_KYE is not set
1013# CONFIG_HID_GYRATION is not set
1014# CONFIG_HID_TWINHAN is not set
1015# CONFIG_HID_KENSINGTON is not set
1016# CONFIG_HID_LOGITECH is not set
1017# CONFIG_HID_MICROSOFT is not set
1018# CONFIG_HID_MONTEREY is not set
1019# CONFIG_HID_NTRIG is not set
1020# CONFIG_HID_PANTHERLORD is not set
1021# CONFIG_HID_PETALYNX is not set
1022# CONFIG_HID_SAMSUNG is not set
1023# CONFIG_HID_SONY is not set
1024# CONFIG_HID_SUNPLUS is not set
1025# CONFIG_HID_GREENASIA is not set
1026# CONFIG_HID_SMARTJOYPLUS is not set
1027# CONFIG_HID_TOPSEED is not set
1028# CONFIG_HID_THRUSTMASTER is not set
1029# CONFIG_HID_ZEROPLUS is not set
1030CONFIG_USB_SUPPORT=y
1031CONFIG_USB_ARCH_HAS_HCD=y
1032CONFIG_USB_ARCH_HAS_OHCI=y
1033CONFIG_USB_ARCH_HAS_EHCI=y
1034CONFIG_USB=y
1035# CONFIG_USB_DEBUG is not set
1036# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1037
1038#
1039# Miscellaneous USB options
1040#
1041CONFIG_USB_DEVICEFS=y
1042CONFIG_USB_DEVICE_CLASS=y
1043# CONFIG_USB_DYNAMIC_MINORS is not set
1044# CONFIG_USB_OTG is not set
1045# CONFIG_USB_OTG_WHITELIST is not set
1046# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1047# CONFIG_USB_MON is not set
1048# CONFIG_USB_WUSB is not set
1049# CONFIG_USB_WUSB_CBAF is not set
1050
1051#
1052# USB Host Controller Drivers
1053#
1054# CONFIG_USB_C67X00_HCD is not set
1055# CONFIG_USB_XHCI_HCD is not set
1056CONFIG_USB_EHCI_HCD=y
1057CONFIG_USB_EHCI_ROOT_HUB_TT=y
1058CONFIG_USB_EHCI_TT_NEWSCHED=y
1059# CONFIG_USB_OXU210HP_HCD is not set
1060# CONFIG_USB_ISP116X_HCD is not set
1061# CONFIG_USB_ISP1760_HCD is not set
1062# CONFIG_USB_ISP1362_HCD is not set
1063# CONFIG_USB_OHCI_HCD is not set
1064# CONFIG_USB_UHCI_HCD is not set
1065# CONFIG_USB_SL811_HCD is not set
1066# CONFIG_USB_R8A66597_HCD is not set
1067# CONFIG_USB_WHCI_HCD is not set
1068# CONFIG_USB_HWA_HCD is not set
1069# CONFIG_USB_MUSB_HDRC is not set
1070
1071#
1072# USB Device Class drivers
1073#
1074# CONFIG_USB_ACM is not set
1075# CONFIG_USB_PRINTER is not set
1076# CONFIG_USB_WDM is not set
1077# CONFIG_USB_TMC is not set
1078
1079#
1080# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1081#
1082
1083#
1084# also be needed; see USB_STORAGE Help for more info
1085#
1086CONFIG_USB_STORAGE=y
1087# CONFIG_USB_STORAGE_DEBUG is not set
1088# CONFIG_USB_STORAGE_DATAFAB is not set
1089# CONFIG_USB_STORAGE_FREECOM is not set
1090# CONFIG_USB_STORAGE_ISD200 is not set
1091# CONFIG_USB_STORAGE_USBAT is not set
1092# CONFIG_USB_STORAGE_SDDR09 is not set
1093# CONFIG_USB_STORAGE_SDDR55 is not set
1094# CONFIG_USB_STORAGE_JUMPSHOT is not set
1095# CONFIG_USB_STORAGE_ALAUDA is not set
1096# CONFIG_USB_STORAGE_ONETOUCH is not set
1097# CONFIG_USB_STORAGE_KARMA is not set
1098# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1099# CONFIG_USB_LIBUSUAL is not set
1100
1101#
1102# USB Imaging devices
1103#
1104# CONFIG_USB_MDC800 is not set
1105# CONFIG_USB_MICROTEK is not set
1106
1107#
1108# USB port drivers
1109#
1110# CONFIG_USB_SERIAL is not set
1111
1112#
1113# USB Miscellaneous drivers
1114#
1115# CONFIG_USB_EMI62 is not set
1116# CONFIG_USB_EMI26 is not set
1117# CONFIG_USB_ADUTUX is not set
1118# CONFIG_USB_SEVSEG is not set
1119# CONFIG_USB_RIO500 is not set
1120# CONFIG_USB_LEGOTOWER is not set
1121# CONFIG_USB_LCD is not set
1122# CONFIG_USB_BERRY_CHARGE is not set
1123# CONFIG_USB_LED is not set
1124# CONFIG_USB_CYPRESS_CY7C63 is not set
1125# CONFIG_USB_CYTHERM is not set
1126# CONFIG_USB_IDMOUSE is not set
1127# CONFIG_USB_FTDI_ELAN is not set
1128# CONFIG_USB_APPLEDISPLAY is not set
1129# CONFIG_USB_SISUSBVGA is not set
1130# CONFIG_USB_LD is not set
1131# CONFIG_USB_TRANCEVIBRATOR is not set
1132# CONFIG_USB_IOWARRIOR is not set
1133# CONFIG_USB_TEST is not set
1134# CONFIG_USB_ISIGHTFW is not set
1135# CONFIG_USB_VST is not set
1136# CONFIG_USB_GADGET is not set
1137
1138#
1139# OTG and related infrastructure
1140#
1141# CONFIG_USB_GPIO_VBUS is not set
1142# CONFIG_NOP_USB_XCEIV is not set
1143# CONFIG_UWB is not set
1144# CONFIG_MMC is not set
1145# CONFIG_MEMSTICK is not set
1146# CONFIG_NEW_LEDS is not set
1147# CONFIG_ACCESSIBILITY is not set
1148# CONFIG_INFINIBAND is not set
1149CONFIG_RTC_LIB=y
1150CONFIG_RTC_CLASS=y
1151CONFIG_RTC_HCTOSYS=y
1152CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1153# CONFIG_RTC_DEBUG is not set
1154
1155#
1156# RTC interfaces
1157#
1158CONFIG_RTC_INTF_SYSFS=y
1159CONFIG_RTC_INTF_PROC=y
1160CONFIG_RTC_INTF_DEV=y
1161# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1162# CONFIG_RTC_DRV_TEST is not set
1163
1164#
1165# I2C RTC drivers
1166#
1167# CONFIG_RTC_DRV_DS1307 is not set
1168# CONFIG_RTC_DRV_DS1374 is not set
1169# CONFIG_RTC_DRV_DS1672 is not set
1170# CONFIG_RTC_DRV_MAX6900 is not set
1171# CONFIG_RTC_DRV_RS5C372 is not set
1172# CONFIG_RTC_DRV_ISL1208 is not set
1173# CONFIG_RTC_DRV_X1205 is not set
1174# CONFIG_RTC_DRV_PCF8563 is not set
1175# CONFIG_RTC_DRV_PCF8583 is not set
1176# CONFIG_RTC_DRV_M41T80 is not set
1177# CONFIG_RTC_DRV_S35390A is not set
1178# CONFIG_RTC_DRV_FM3130 is not set
1179# CONFIG_RTC_DRV_RX8581 is not set
1180# CONFIG_RTC_DRV_RX8025 is not set
1181
1182#
1183# SPI RTC drivers
1184#
1185# CONFIG_RTC_DRV_M41T94 is not set
1186# CONFIG_RTC_DRV_DS1305 is not set
1187# CONFIG_RTC_DRV_DS1390 is not set
1188# CONFIG_RTC_DRV_MAX6902 is not set
1189# CONFIG_RTC_DRV_R9701 is not set
1190# CONFIG_RTC_DRV_RS5C348 is not set
1191# CONFIG_RTC_DRV_DS3234 is not set
1192# CONFIG_RTC_DRV_PCF2123 is not set
1193
1194#
1195# Platform RTC drivers
1196#
1197# CONFIG_RTC_DRV_CMOS is not set
1198# CONFIG_RTC_DRV_DS1286 is not set
1199# CONFIG_RTC_DRV_DS1511 is not set
1200# CONFIG_RTC_DRV_DS1553 is not set
1201# CONFIG_RTC_DRV_DS1742 is not set
1202# CONFIG_RTC_DRV_STK17TA8 is not set
1203# CONFIG_RTC_DRV_M48T86 is not set
1204# CONFIG_RTC_DRV_M48T35 is not set
1205# CONFIG_RTC_DRV_M48T59 is not set
1206# CONFIG_RTC_DRV_BQ4802 is not set
1207# CONFIG_RTC_DRV_V3020 is not set
1208
1209#
1210# on-CPU RTC drivers
1211#
1212CONFIG_RTC_DRV_MV=y
1213CONFIG_DMADEVICES=y
1214
1215#
1216# DMA Devices
1217#
1218CONFIG_MV_XOR=y
1219CONFIG_DMA_ENGINE=y
1220
1221#
1222# DMA Clients
1223#
1224# CONFIG_NET_DMA is not set
1225# CONFIG_ASYNC_TX_DMA is not set
1226# CONFIG_DMATEST is not set
1227# CONFIG_AUXDISPLAY is not set
1228# CONFIG_UIO is not set
1229
1230#
1231# TI VLYNQ
1232#
1233# CONFIG_STAGING is not set
1234
1235#
1236# File systems
1237#
1238CONFIG_EXT2_FS=y
1239# CONFIG_EXT2_FS_XATTR is not set
1240# CONFIG_EXT2_FS_XIP is not set
1241CONFIG_EXT3_FS=y
1242# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1243# CONFIG_EXT3_FS_XATTR is not set
1244# CONFIG_EXT4_FS is not set
1245CONFIG_JBD=y
1246# CONFIG_JBD_DEBUG is not set
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_GFS2_FS is not set
1252# CONFIG_OCFS2_FS is not set
1253# CONFIG_BTRFS_FS is not set
1254# CONFIG_NILFS2_FS is not set
1255CONFIG_FILE_LOCKING=y
1256CONFIG_FSNOTIFY=y
1257CONFIG_DNOTIFY=y
1258CONFIG_INOTIFY=y
1259CONFIG_INOTIFY_USER=y
1260# CONFIG_QUOTA is not set
1261# CONFIG_AUTOFS_FS is not set
1262# CONFIG_AUTOFS4_FS is not set
1263# CONFIG_FUSE_FS is not set
1264
1265#
1266# Caches
1267#
1268# CONFIG_FSCACHE is not set
1269
1270#
1271# CD-ROM/DVD Filesystems
1272#
1273CONFIG_ISO9660_FS=y
1274CONFIG_JOLIET=y
1275# CONFIG_ZISOFS is not set
1276CONFIG_UDF_FS=m
1277CONFIG_UDF_NLS=y
1278
1279#
1280# DOS/FAT/NT Filesystems
1281#
1282CONFIG_FAT_FS=y
1283CONFIG_MSDOS_FS=y
1284CONFIG_VFAT_FS=y
1285CONFIG_FAT_DEFAULT_CODEPAGE=437
1286CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1287# CONFIG_NTFS_FS is not set
1288
1289#
1290# Pseudo filesystems
1291#
1292CONFIG_PROC_FS=y
1293CONFIG_PROC_SYSCTL=y
1294CONFIG_PROC_PAGE_MONITOR=y
1295CONFIG_SYSFS=y
1296CONFIG_TMPFS=y
1297# CONFIG_TMPFS_POSIX_ACL is not set
1298# CONFIG_HUGETLB_PAGE is not set
1299# CONFIG_CONFIGFS_FS is not set
1300CONFIG_MISC_FILESYSTEMS=y
1301# CONFIG_ADFS_FS is not set
1302# CONFIG_AFFS_FS is not set
1303# CONFIG_HFS_FS is not set
1304# CONFIG_HFSPLUS_FS is not set
1305# CONFIG_BEFS_FS is not set
1306# CONFIG_BFS_FS is not set
1307# CONFIG_EFS_FS is not set
1308CONFIG_JFFS2_FS=y
1309CONFIG_JFFS2_FS_DEBUG=0
1310CONFIG_JFFS2_FS_WRITEBUFFER=y
1311# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1312# CONFIG_JFFS2_SUMMARY is not set
1313# CONFIG_JFFS2_FS_XATTR is not set
1314# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1315CONFIG_JFFS2_ZLIB=y
1316# CONFIG_JFFS2_LZO is not set
1317CONFIG_JFFS2_RTIME=y
1318# CONFIG_JFFS2_RUBIN is not set
1319# CONFIG_UBIFS_FS is not set
1320# CONFIG_CRAMFS is not set
1321# CONFIG_SQUASHFS is not set
1322# CONFIG_VXFS_FS is not set
1323# CONFIG_MINIX_FS is not set
1324# CONFIG_OMFS_FS is not set
1325# CONFIG_HPFS_FS is not set
1326# CONFIG_QNX4FS_FS is not set
1327# CONFIG_ROMFS_FS is not set
1328# CONFIG_SYSV_FS is not set
1329# CONFIG_UFS_FS is not set
1330CONFIG_NETWORK_FILESYSTEMS=y
1331CONFIG_NFS_FS=y
1332CONFIG_NFS_V3=y
1333# CONFIG_NFS_V3_ACL is not set
1334# CONFIG_NFS_V4 is not set
1335CONFIG_ROOT_NFS=y
1336# CONFIG_NFSD is not set
1337CONFIG_LOCKD=y
1338CONFIG_LOCKD_V4=y
1339CONFIG_NFS_COMMON=y
1340CONFIG_SUNRPC=y
1341# CONFIG_RPCSEC_GSS_KRB5 is not set
1342# CONFIG_RPCSEC_GSS_SPKM3 is not set
1343# CONFIG_SMB_FS is not set
1344# CONFIG_CIFS is not set
1345# CONFIG_NCP_FS is not set
1346# CONFIG_CODA_FS is not set
1347# CONFIG_AFS_FS is not set
1348
1349#
1350# Partition Types
1351#
1352CONFIG_PARTITION_ADVANCED=y
1353# CONFIG_ACORN_PARTITION is not set
1354# CONFIG_OSF_PARTITION is not set
1355# CONFIG_AMIGA_PARTITION is not set
1356# CONFIG_ATARI_PARTITION is not set
1357# CONFIG_MAC_PARTITION is not set
1358CONFIG_MSDOS_PARTITION=y
1359# CONFIG_BSD_DISKLABEL is not set
1360# CONFIG_MINIX_SUBPARTITION is not set
1361# CONFIG_SOLARIS_X86_PARTITION is not set
1362# CONFIG_UNIXWARE_DISKLABEL is not set
1363# CONFIG_LDM_PARTITION is not set
1364# CONFIG_SGI_PARTITION is not set
1365# CONFIG_ULTRIX_PARTITION is not set
1366# CONFIG_SUN_PARTITION is not set
1367# CONFIG_KARMA_PARTITION is not set
1368# CONFIG_EFI_PARTITION is not set
1369# CONFIG_SYSV68_PARTITION is not set
1370CONFIG_NLS=y
1371CONFIG_NLS_DEFAULT="iso8859-1"
1372CONFIG_NLS_CODEPAGE_437=y
1373# CONFIG_NLS_CODEPAGE_737 is not set
1374# CONFIG_NLS_CODEPAGE_775 is not set
1375CONFIG_NLS_CODEPAGE_850=y
1376# CONFIG_NLS_CODEPAGE_852 is not set
1377# CONFIG_NLS_CODEPAGE_855 is not set
1378# CONFIG_NLS_CODEPAGE_857 is not set
1379# CONFIG_NLS_CODEPAGE_860 is not set
1380# CONFIG_NLS_CODEPAGE_861 is not set
1381# CONFIG_NLS_CODEPAGE_862 is not set
1382# CONFIG_NLS_CODEPAGE_863 is not set
1383# CONFIG_NLS_CODEPAGE_864 is not set
1384# CONFIG_NLS_CODEPAGE_865 is not set
1385# CONFIG_NLS_CODEPAGE_866 is not set
1386# CONFIG_NLS_CODEPAGE_869 is not set
1387# CONFIG_NLS_CODEPAGE_936 is not set
1388# CONFIG_NLS_CODEPAGE_950 is not set
1389# CONFIG_NLS_CODEPAGE_932 is not set
1390# CONFIG_NLS_CODEPAGE_949 is not set
1391# CONFIG_NLS_CODEPAGE_874 is not set
1392# CONFIG_NLS_ISO8859_8 is not set
1393# CONFIG_NLS_CODEPAGE_1250 is not set
1394# CONFIG_NLS_CODEPAGE_1251 is not set
1395# CONFIG_NLS_ASCII is not set
1396CONFIG_NLS_ISO8859_1=y
1397CONFIG_NLS_ISO8859_2=y
1398# CONFIG_NLS_ISO8859_3 is not set
1399# CONFIG_NLS_ISO8859_4 is not set
1400# CONFIG_NLS_ISO8859_5 is not set
1401# CONFIG_NLS_ISO8859_6 is not set
1402# CONFIG_NLS_ISO8859_7 is not set
1403# CONFIG_NLS_ISO8859_9 is not set
1404# CONFIG_NLS_ISO8859_13 is not set
1405# CONFIG_NLS_ISO8859_14 is not set
1406# CONFIG_NLS_ISO8859_15 is not set
1407# CONFIG_NLS_KOI8_R is not set
1408# CONFIG_NLS_KOI8_U is not set
1409CONFIG_NLS_UTF8=y
1410# CONFIG_DLM is not set
1411
1412#
1413# Kernel hacking
1414#
1415# CONFIG_PRINTK_TIME is not set
1416CONFIG_ENABLE_WARN_DEPRECATED=y
1417CONFIG_ENABLE_MUST_CHECK=y
1418CONFIG_FRAME_WARN=1024
1419CONFIG_MAGIC_SYSRQ=y
1420# CONFIG_STRIP_ASM_SYMS is not set
1421# CONFIG_UNUSED_SYMBOLS is not set
1422CONFIG_DEBUG_FS=y
1423# CONFIG_HEADERS_CHECK is not set
1424CONFIG_DEBUG_KERNEL=y
1425# CONFIG_DEBUG_SHIRQ is not set
1426CONFIG_DETECT_SOFTLOCKUP=y
1427# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1428CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1429CONFIG_DETECT_HUNG_TASK=y
1430# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1431CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1432# CONFIG_SCHED_DEBUG is not set
1433# CONFIG_SCHEDSTATS is not set
1434CONFIG_TIMER_STATS=y
1435# CONFIG_DEBUG_OBJECTS is not set
1436# CONFIG_DEBUG_SLAB is not set
1437# CONFIG_DEBUG_KMEMLEAK is not set
1438# CONFIG_DEBUG_RT_MUTEXES is not set
1439# CONFIG_RT_MUTEX_TESTER is not set
1440# CONFIG_DEBUG_SPINLOCK is not set
1441# CONFIG_DEBUG_MUTEXES is not set
1442# CONFIG_DEBUG_LOCK_ALLOC is not set
1443# CONFIG_PROVE_LOCKING is not set
1444# CONFIG_LOCK_STAT is not set
1445# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1446# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1447# CONFIG_DEBUG_KOBJECT is not set
1448# CONFIG_DEBUG_BUGVERBOSE is not set
1449CONFIG_DEBUG_INFO=y
1450# CONFIG_DEBUG_VM is not set
1451# CONFIG_DEBUG_WRITECOUNT is not set
1452# CONFIG_DEBUG_MEMORY_INIT is not set
1453# CONFIG_DEBUG_LIST is not set
1454# CONFIG_DEBUG_SG is not set
1455# CONFIG_DEBUG_NOTIFIERS is not set
1456# CONFIG_DEBUG_CREDENTIALS is not set
1457# CONFIG_BOOT_PRINTK_DELAY is not set
1458# CONFIG_RCU_TORTURE_TEST is not set
1459# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1460# CONFIG_BACKTRACE_SELF_TEST is not set
1461# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1462# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1463# CONFIG_FAULT_INJECTION is not set
1464# CONFIG_LATENCYTOP is not set
1465CONFIG_SYSCTL_SYSCALL_CHECK=y
1466# CONFIG_PAGE_POISONING is not set
1467CONFIG_HAVE_FUNCTION_TRACER=y
1468CONFIG_TRACING_SUPPORT=y
1469CONFIG_FTRACE=y
1470# CONFIG_FUNCTION_TRACER is not set
1471# CONFIG_IRQSOFF_TRACER is not set
1472# CONFIG_SCHED_TRACER is not set
1473# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1474# CONFIG_BOOT_TRACER is not set
1475CONFIG_BRANCH_PROFILE_NONE=y
1476# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1477# CONFIG_PROFILE_ALL_BRANCHES is not set
1478# CONFIG_STACK_TRACER is not set
1479# CONFIG_KMEMTRACE is not set
1480# CONFIG_WORKQUEUE_TRACER is not set
1481# CONFIG_BLK_DEV_IO_TRACE is not set
1482# CONFIG_DYNAMIC_DEBUG is not set
1483# CONFIG_SAMPLES is not set
1484CONFIG_HAVE_ARCH_KGDB=y
1485# CONFIG_KGDB is not set
1486CONFIG_ARM_UNWIND=y
1487CONFIG_DEBUG_USER=y
1488CONFIG_DEBUG_ERRORS=y
1489# CONFIG_DEBUG_STACK_USAGE is not set
1490# CONFIG_DEBUG_LL is not set
1491
1492#
1493# Security options
1494#
1495# CONFIG_KEYS is not set
1496# CONFIG_SECURITY is not set
1497# CONFIG_SECURITYFS is not set
1498# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1499CONFIG_CRYPTO=y
1500
1501#
1502# Crypto core or helper
1503#
1504CONFIG_CRYPTO_ALGAPI=y
1505CONFIG_CRYPTO_ALGAPI2=y
1506CONFIG_CRYPTO_AEAD2=y
1507CONFIG_CRYPTO_BLKCIPHER=y
1508CONFIG_CRYPTO_BLKCIPHER2=y
1509CONFIG_CRYPTO_HASH=y
1510CONFIG_CRYPTO_HASH2=y
1511CONFIG_CRYPTO_RNG2=y
1512CONFIG_CRYPTO_PCOMP=y
1513CONFIG_CRYPTO_MANAGER=y
1514CONFIG_CRYPTO_MANAGER2=y
1515# CONFIG_CRYPTO_GF128MUL is not set
1516CONFIG_CRYPTO_NULL=y
1517CONFIG_CRYPTO_WORKQUEUE=y
1518# CONFIG_CRYPTO_CRYPTD is not set
1519# CONFIG_CRYPTO_AUTHENC is not set
1520# CONFIG_CRYPTO_TEST is not set
1521
1522#
1523# Authenticated Encryption with Associated Data
1524#
1525# CONFIG_CRYPTO_CCM is not set
1526# CONFIG_CRYPTO_GCM is not set
1527# CONFIG_CRYPTO_SEQIV is not set
1528
1529#
1530# Block modes
1531#
1532CONFIG_CRYPTO_CBC=y
1533# CONFIG_CRYPTO_CTR is not set
1534# CONFIG_CRYPTO_CTS is not set
1535CONFIG_CRYPTO_ECB=m
1536# CONFIG_CRYPTO_LRW is not set
1537CONFIG_CRYPTO_PCBC=m
1538# CONFIG_CRYPTO_XTS is not set
1539
1540#
1541# Hash modes
1542#
1543CONFIG_CRYPTO_HMAC=y
1544# CONFIG_CRYPTO_XCBC is not set
1545# CONFIG_CRYPTO_VMAC is not set
1546
1547#
1548# Digest
1549#
1550CONFIG_CRYPTO_CRC32C=y
1551# CONFIG_CRYPTO_GHASH is not set
1552CONFIG_CRYPTO_MD4=y
1553CONFIG_CRYPTO_MD5=y
1554# CONFIG_CRYPTO_MICHAEL_MIC is not set
1555# CONFIG_CRYPTO_RMD128 is not set
1556# CONFIG_CRYPTO_RMD160 is not set
1557# CONFIG_CRYPTO_RMD256 is not set
1558# CONFIG_CRYPTO_RMD320 is not set
1559CONFIG_CRYPTO_SHA1=y
1560CONFIG_CRYPTO_SHA256=y
1561CONFIG_CRYPTO_SHA512=y
1562# CONFIG_CRYPTO_TGR192 is not set
1563# CONFIG_CRYPTO_WP512 is not set
1564
1565#
1566# Ciphers
1567#
1568CONFIG_CRYPTO_AES=y
1569# CONFIG_CRYPTO_ANUBIS is not set
1570# CONFIG_CRYPTO_ARC4 is not set
1571CONFIG_CRYPTO_BLOWFISH=y
1572# CONFIG_CRYPTO_CAMELLIA is not set
1573# CONFIG_CRYPTO_CAST5 is not set
1574# CONFIG_CRYPTO_CAST6 is not set
1575CONFIG_CRYPTO_DES=y
1576# CONFIG_CRYPTO_FCRYPT is not set
1577# CONFIG_CRYPTO_KHAZAD is not set
1578# CONFIG_CRYPTO_SALSA20 is not set
1579# CONFIG_CRYPTO_SEED is not set
1580# CONFIG_CRYPTO_SERPENT is not set
1581CONFIG_CRYPTO_TEA=y
1582CONFIG_CRYPTO_TWOFISH=y
1583CONFIG_CRYPTO_TWOFISH_COMMON=y
1584
1585#
1586# Compression
1587#
1588CONFIG_CRYPTO_DEFLATE=y
1589# CONFIG_CRYPTO_ZLIB is not set
1590CONFIG_CRYPTO_LZO=y
1591
1592#
1593# Random Number Generation
1594#
1595# CONFIG_CRYPTO_ANSI_CPRNG is not set
1596CONFIG_CRYPTO_HW=y
1597# CONFIG_CRYPTO_DEV_MV_CESA is not set
1598# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1599# CONFIG_BINARY_PRINTF is not set
1600
1601#
1602# Library routines
1603#
1604CONFIG_BITREVERSE=y
1605CONFIG_GENERIC_FIND_LAST_BIT=y
1606CONFIG_CRC_CCITT=y
1607CONFIG_CRC16=y
1608# CONFIG_CRC_T10DIF is not set
1609CONFIG_CRC_ITU_T=m
1610CONFIG_CRC32=y
1611# CONFIG_CRC7 is not set
1612CONFIG_LIBCRC32C=y
1613CONFIG_ZLIB_INFLATE=y
1614CONFIG_ZLIB_DEFLATE=y
1615CONFIG_LZO_COMPRESS=y
1616CONFIG_LZO_DECOMPRESS=y
1617CONFIG_HAS_IOMEM=y
1618CONFIG_HAS_IOPORT=y
1619CONFIG_HAS_DMA=y
1620CONFIG_NLATTR=y
diff --git a/arch/arm/include/asm/hardware/cache-tauros2.h b/arch/arm/include/asm/hardware/cache-tauros2.h
new file mode 100644
index 000000000000..538f17ca905b
--- /dev/null
+++ b/arch/arm/include/asm/hardware/cache-tauros2.h
@@ -0,0 +1,11 @@
1/*
2 * arch/arm/include/asm/hardware/cache-tauros2.h
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11extern void __init tauros2_init(void);
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 8d60ad267e3a..5daea2961d48 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -234,7 +234,13 @@ extern int iop3xx_get_init_atu(void);
234void iop3xx_map_io(void); 234void iop3xx_map_io(void);
235void iop_init_cp6_handler(void); 235void iop_init_cp6_handler(void);
236void iop_init_time(unsigned long tickrate); 236void iop_init_time(unsigned long tickrate);
237unsigned long iop_gettimeoffset(void); 237
238static inline u32 read_tmr0(void)
239{
240 u32 val;
241 asm volatile("mrc p6, 0, %0, c0, c1, 0" : "=r" (val));
242 return val;
243}
238 244
239static inline void write_tmr0(u32 val) 245static inline void write_tmr0(u32 val)
240{ 246{
@@ -253,6 +259,11 @@ static inline u32 read_tcr0(void)
253 return val; 259 return val;
254} 260}
255 261
262static inline void write_tcr0(u32 val)
263{
264 asm volatile("mcr p6, 0, %0, c2, c1, 0" : : "r" (val));
265}
266
256static inline u32 read_tcr1(void) 267static inline u32 read_tcr1(void)
257{ 268{
258 u32 val; 269 u32 val;
@@ -260,6 +271,11 @@ static inline u32 read_tcr1(void)
260 return val; 271 return val;
261} 272}
262 273
274static inline void write_tcr1(u32 val)
275{
276 asm volatile("mcr p6, 0, %0, c3, c1, 0" : : "r" (val));
277}
278
263static inline void write_trr0(u32 val) 279static inline void write_trr0(u32 val)
264{ 280{
265 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val)); 281 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (val));
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index d16ec97ec9a9..c019949a5189 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -22,4 +22,10 @@ enum km_type {
22 KM_TYPE_NR 22 KM_TYPE_NR
23}; 23};
24 24
25#ifdef CONFIG_DEBUG_HIGHMEM
26#define KM_NMI (-1)
27#define KM_NMI_PTE (-1)
28#define KM_IRQ_PTE (-1)
29#endif
30
25#endif 31#endif
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index e5dfc2895e24..573b803dc6bf 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,7 +32,7 @@
32 * numbers for r1. 32 * numbers for r1.
33 * 33 *
34 */ 34 */
35 .section ".text.head", "ax" 35 __HEAD
36ENTRY(stext) 36ENTRY(stext)
37 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 37 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
38 @ and irqs disabled 38 @ and irqs disabled
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 38ccbe1d3b2c..eb62bf947212 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -74,7 +74,7 @@
74 * crap here - that's what the boot loader (or in extreme, well justified 74 * crap here - that's what the boot loader (or in extreme, well justified
75 * circumstances, zImage) is for. 75 * circumstances, zImage) is for.
76 */ 76 */
77 .section ".text.head", "ax" 77 __HEAD
78ENTRY(stext) 78ENTRY(stext)
79 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 79 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
80 @ and irqs disabled 80 @ and irqs disabled
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index aecf87dfbaec..71151bd87a36 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -24,13 +24,11 @@ SECTIONS
24#else 24#else
25 . = PAGE_OFFSET + TEXT_OFFSET; 25 . = PAGE_OFFSET + TEXT_OFFSET;
26#endif 26#endif
27 .text.head : {
28 _stext = .;
29 _sinittext = .;
30 *(.text.head)
31 }
32 27
33 .init : { /* Init code and data */ 28 .init : { /* Init code and data */
29 _stext = .;
30 _sinittext = .;
31 HEAD_TEXT
34 INIT_TEXT 32 INIT_TEXT
35 _einittext = .; 33 _einittext = .;
36 __proc_info_begin = .; 34 __proc_info_begin = .;
@@ -42,43 +40,31 @@ SECTIONS
42 __tagtable_begin = .; 40 __tagtable_begin = .;
43 *(.taglist.init) 41 *(.taglist.init)
44 __tagtable_end = .; 42 __tagtable_end = .;
45 . = ALIGN(16); 43
46 __setup_start = .; 44 INIT_SETUP(16)
47 *(.init.setup) 45
48 __setup_end = .;
49 __early_begin = .; 46 __early_begin = .;
50 *(.early_param.init) 47 *(.early_param.init)
51 __early_end = .; 48 __early_end = .;
52 __initcall_start = .; 49
53 INITCALLS 50 INIT_CALLS
54 __initcall_end = .; 51 CON_INITCALL
55 __con_initcall_start = .; 52 SECURITY_INITCALL
56 *(.con_initcall.init) 53 INIT_RAM_FS
57 __con_initcall_end = .; 54
58 __security_initcall_start = .;
59 *(.security_initcall.init)
60 __security_initcall_end = .;
61#ifdef CONFIG_BLK_DEV_INITRD
62 . = ALIGN(32);
63 __initramfs_start = .;
64 usr/built-in.o(.init.ramfs)
65 __initramfs_end = .;
66#endif
67 . = ALIGN(PAGE_SIZE);
68 __per_cpu_load = .;
69 __per_cpu_start = .;
70 *(.data.percpu.page_aligned)
71 *(.data.percpu)
72 *(.data.percpu.shared_aligned)
73 __per_cpu_end = .;
74#ifndef CONFIG_XIP_KERNEL 55#ifndef CONFIG_XIP_KERNEL
75 __init_begin = _stext; 56 __init_begin = _stext;
76 INIT_DATA 57 INIT_DATA
77 . = ALIGN(PAGE_SIZE);
78 __init_end = .;
79#endif 58#endif
80 } 59 }
81 60
61 PERCPU(PAGE_SIZE)
62
63#ifndef CONFIG_XIP_KERNEL
64 . = ALIGN(PAGE_SIZE);
65 __init_end = .;
66#endif
67
82 /DISCARD/ : { /* Exit code and data */ 68 /DISCARD/ : { /* Exit code and data */
83 EXIT_TEXT 69 EXIT_TEXT
84 EXIT_DATA 70 EXIT_DATA
@@ -157,7 +143,7 @@ SECTIONS
157 * first, the init task union, aligned 143 * first, the init task union, aligned
158 * to an 8192 byte boundary. 144 * to an 8192 byte boundary.
159 */ 145 */
160 *(.data.init_task) 146 INIT_TASK_DATA(THREAD_SIZE)
161 147
162#ifdef CONFIG_XIP_KERNEL 148#ifdef CONFIG_XIP_KERNEL
163 . = ALIGN(PAGE_SIZE); 149 . = ALIGN(PAGE_SIZE);
@@ -167,17 +153,8 @@ SECTIONS
167 __init_end = .; 153 __init_end = .;
168#endif 154#endif
169 155
170 . = ALIGN(PAGE_SIZE); 156 NOSAVE_DATA
171 __nosave_begin = .; 157 CACHELINE_ALIGNED_DATA(32)
172 *(.data.nosave)
173 . = ALIGN(PAGE_SIZE);
174 __nosave_end = .;
175
176 /*
177 * then the cacheline aligned data
178 */
179 . = ALIGN(32);
180 *(.data.cacheline_aligned)
181 158
182 /* 159 /*
183 * The exception fixup table (might need resorting at runtime) 160 * The exception fixup table (might need resorting at runtime)
@@ -256,20 +233,10 @@ SECTIONS
256 } 233 }
257#endif 234#endif
258 235
259 .bss : { 236 BSS_SECTION(0, 0, 0)
260 __bss_start = .; /* BSS */ 237 _end = .;
261 *(.bss) 238
262 *(COMMON) 239 STABS_DEBUG
263 __bss_stop = .;
264 _end = .;
265 }
266 /* Stabs debugging sections. */
267 .stab 0 : { *(.stab) }
268 .stabstr 0 : { *(.stabstr) }
269 .stab.excl 0 : { *(.stab.excl) }
270 .stab.exclstr 0 : { *(.stab.exclstr) }
271 .stab.index 0 : { *(.stab.index) }
272 .stab.indexstr 0 : { *(.stab.indexstr) }
273 .comment 0 : { *(.comment) } 240 .comment 0 : { *(.comment) }
274} 241}
275 242
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 2fd88437348b..3df124e54267 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -1,5 +1,20 @@
1if ARCH_AT91 1if ARCH_AT91
2 2
3config HAVE_AT91_DATAFLASH_CARD
4 bool
5
6config HAVE_NAND_ATMEL_BUSWIDTH_16
7 bool
8
9config HAVE_AT91_USART3
10 bool
11
12config HAVE_AT91_USART4
13 bool
14
15config HAVE_AT91_USART5
16 bool
17
3menu "Atmel AT91 System-on-Chip" 18menu "Atmel AT91 System-on-Chip"
4 19
5choice 20choice
@@ -10,54 +25,69 @@ config ARCH_AT91RM9200
10 select CPU_ARM920T 25 select CPU_ARM920T
11 select GENERIC_TIME 26 select GENERIC_TIME
12 select GENERIC_CLOCKEVENTS 27 select GENERIC_CLOCKEVENTS
28 select HAVE_AT91_USART3
13 29
14config ARCH_AT91SAM9260 30config ARCH_AT91SAM9260
15 bool "AT91SAM9260 or AT91SAM9XE" 31 bool "AT91SAM9260 or AT91SAM9XE"
16 select CPU_ARM926T 32 select CPU_ARM926T
17 select GENERIC_TIME 33 select GENERIC_TIME
18 select GENERIC_CLOCKEVENTS 34 select GENERIC_CLOCKEVENTS
35 select HAVE_AT91_USART3
36 select HAVE_AT91_USART4
37 select HAVE_AT91_USART5
19 38
20config ARCH_AT91SAM9261 39config ARCH_AT91SAM9261
21 bool "AT91SAM9261" 40 bool "AT91SAM9261"
22 select CPU_ARM926T 41 select CPU_ARM926T
23 select GENERIC_TIME 42 select GENERIC_TIME
24 select GENERIC_CLOCKEVENTS 43 select GENERIC_CLOCKEVENTS
44 select HAVE_FB_ATMEL
25 45
26config ARCH_AT91SAM9G10 46config ARCH_AT91SAM9G10
27 bool "AT91SAM9G10" 47 bool "AT91SAM9G10"
28 select CPU_ARM926T 48 select CPU_ARM926T
29 select GENERIC_TIME 49 select GENERIC_TIME
30 select GENERIC_CLOCKEVENTS 50 select GENERIC_CLOCKEVENTS
51 select HAVE_FB_ATMEL
31 52
32config ARCH_AT91SAM9263 53config ARCH_AT91SAM9263
33 bool "AT91SAM9263" 54 bool "AT91SAM9263"
34 select CPU_ARM926T 55 select CPU_ARM926T
35 select GENERIC_TIME 56 select GENERIC_TIME
36 select GENERIC_CLOCKEVENTS 57 select GENERIC_CLOCKEVENTS
58 select HAVE_FB_ATMEL
37 59
38config ARCH_AT91SAM9RL 60config ARCH_AT91SAM9RL
39 bool "AT91SAM9RL" 61 bool "AT91SAM9RL"
40 select CPU_ARM926T 62 select CPU_ARM926T
41 select GENERIC_TIME 63 select GENERIC_TIME
42 select GENERIC_CLOCKEVENTS 64 select GENERIC_CLOCKEVENTS
65 select HAVE_AT91_USART3
66 select HAVE_FB_ATMEL
43 67
44config ARCH_AT91SAM9G20 68config ARCH_AT91SAM9G20
45 bool "AT91SAM9G20" 69 bool "AT91SAM9G20"
46 select CPU_ARM926T 70 select CPU_ARM926T
47 select GENERIC_TIME 71 select GENERIC_TIME
48 select GENERIC_CLOCKEVENTS 72 select GENERIC_CLOCKEVENTS
73 select HAVE_AT91_USART3
74 select HAVE_AT91_USART4
75 select HAVE_AT91_USART5
49 76
50config ARCH_AT91SAM9G45 77config ARCH_AT91SAM9G45
51 bool "AT91SAM9G45" 78 bool "AT91SAM9G45"
52 select CPU_ARM926T 79 select CPU_ARM926T
53 select GENERIC_TIME 80 select GENERIC_TIME
54 select GENERIC_CLOCKEVENTS 81 select GENERIC_CLOCKEVENTS
82 select HAVE_AT91_USART3
83 select HAVE_FB_ATMEL
55 84
56config ARCH_AT91CAP9 85config ARCH_AT91CAP9
57 bool "AT91CAP9" 86 bool "AT91CAP9"
58 select CPU_ARM926T 87 select CPU_ARM926T
59 select GENERIC_TIME 88 select GENERIC_TIME
60 select GENERIC_CLOCKEVENTS 89 select GENERIC_CLOCKEVENTS
90 select HAVE_FB_ATMEL
61 91
62config ARCH_AT91X40 92config ARCH_AT91X40
63 bool "AT91x40" 93 bool "AT91x40"
@@ -76,89 +106,79 @@ comment "AT91RM9200 Board Type"
76 106
77config MACH_ONEARM 107config MACH_ONEARM
78 bool "Ajeco 1ARM Single Board Computer" 108 bool "Ajeco 1ARM Single Board Computer"
79 depends on ARCH_AT91RM9200
80 help 109 help
81 Select this if you are using Ajeco's 1ARM Single Board Computer. 110 Select this if you are using Ajeco's 1ARM Single Board Computer.
82 <http://www.ajeco.fi/products.htm> 111 <http://www.ajeco.fi/products.htm>
83 112
84config ARCH_AT91RM9200DK 113config ARCH_AT91RM9200DK
85 bool "Atmel AT91RM9200-DK Development board" 114 bool "Atmel AT91RM9200-DK Development board"
86 depends on ARCH_AT91RM9200 115 select HAVE_AT91_DATAFLASH_CARD
87 help 116 help
88 Select this if you are using Atmel's AT91RM9200-DK Development board. 117 Select this if you are using Atmel's AT91RM9200-DK Development board.
89 (Discontinued) 118 (Discontinued)
90 119
91config MACH_AT91RM9200EK 120config MACH_AT91RM9200EK
92 bool "Atmel AT91RM9200-EK Evaluation Kit" 121 bool "Atmel AT91RM9200-EK Evaluation Kit"
93 depends on ARCH_AT91RM9200 122 select HAVE_AT91_DATAFLASH_CARD
94 help 123 help
95 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit. 124 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
96 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507> 125 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
97 126
98config MACH_CSB337 127config MACH_CSB337
99 bool "Cogent CSB337" 128 bool "Cogent CSB337"
100 depends on ARCH_AT91RM9200
101 help 129 help
102 Select this if you are using Cogent's CSB337 board. 130 Select this if you are using Cogent's CSB337 board.
103 <http://www.cogcomp.com/csb_csb337.htm> 131 <http://www.cogcomp.com/csb_csb337.htm>
104 132
105config MACH_CSB637 133config MACH_CSB637
106 bool "Cogent CSB637" 134 bool "Cogent CSB637"
107 depends on ARCH_AT91RM9200
108 help 135 help
109 Select this if you are using Cogent's CSB637 board. 136 Select this if you are using Cogent's CSB637 board.
110 <http://www.cogcomp.com/csb_csb637.htm> 137 <http://www.cogcomp.com/csb_csb637.htm>
111 138
112config MACH_CARMEVA 139config MACH_CARMEVA
113 bool "Conitec ARM&EVA" 140 bool "Conitec ARM&EVA"
114 depends on ARCH_AT91RM9200
115 help 141 help
116 Select this if you are using Conitec's AT91RM9200-MCU-Module. 142 Select this if you are using Conitec's AT91RM9200-MCU-Module.
117 <http://www.conitec.net/english/linuxboard.htm> 143 <http://www.conitec.net/english/linuxboard.htm>
118 144
119config MACH_ATEB9200 145config MACH_ATEB9200
120 bool "Embest ATEB9200" 146 bool "Embest ATEB9200"
121 depends on ARCH_AT91RM9200
122 help 147 help
123 Select this if you are using Embest's ATEB9200 board. 148 Select this if you are using Embest's ATEB9200 board.
124 <http://www.embedinfo.com/english/product/ATEB9200.asp> 149 <http://www.embedinfo.com/english/product/ATEB9200.asp>
125 150
126config MACH_KB9200 151config MACH_KB9200
127 bool "KwikByte KB920x" 152 bool "KwikByte KB920x"
128 depends on ARCH_AT91RM9200
129 help 153 help
130 Select this if you are using KwikByte's KB920x board. 154 Select this if you are using KwikByte's KB920x board.
131 <http://kwikbyte.com/KB9202_description_new.htm> 155 <http://kwikbyte.com/KB9202_description_new.htm>
132 156
133config MACH_PICOTUX2XX 157config MACH_PICOTUX2XX
134 bool "picotux 200" 158 bool "picotux 200"
135 depends on ARCH_AT91RM9200
136 help 159 help
137 Select this if you are using a picotux 200. 160 Select this if you are using a picotux 200.
138 <http://www.picotux.com/> 161 <http://www.picotux.com/>
139 162
140config MACH_KAFA 163config MACH_KAFA
141 bool "Sperry-Sun KAFA board" 164 bool "Sperry-Sun KAFA board"
142 depends on ARCH_AT91RM9200
143 help 165 help
144 Select this if you are using Sperry-Sun's KAFA board. 166 Select this if you are using Sperry-Sun's KAFA board.
145 167
146config MACH_ECBAT91 168config MACH_ECBAT91
147 bool "emQbit ECB_AT91 SBC" 169 bool "emQbit ECB_AT91 SBC"
148 depends on ARCH_AT91RM9200 170 select HAVE_AT91_DATAFLASH_CARD
149 help 171 help
150 Select this if you are using emQbit's ECB_AT91 board. 172 Select this if you are using emQbit's ECB_AT91 board.
151 <http://wiki.emqbit.com/free-ecb-at91> 173 <http://wiki.emqbit.com/free-ecb-at91>
152 174
153config MACH_YL9200 175config MACH_YL9200
154 bool "ucDragon YL-9200" 176 bool "ucDragon YL-9200"
155 depends on ARCH_AT91RM9200
156 help 177 help
157 Select this if you are using the ucDragon YL-9200 board. 178 Select this if you are using the ucDragon YL-9200 board.
158 179
159config MACH_CPUAT91 180config MACH_CPUAT91
160 bool "Eukrea CPUAT91" 181 bool "Eukrea CPUAT91"
161 depends on ARCH_AT91RM9200
162 help 182 help
163 Select this if you are using the Eukrea Electromatique's 183 Select this if you are using the Eukrea Electromatique's
164 CPUAT91 board <http://www.eukrea.com/>. 184 CPUAT91 board <http://www.eukrea.com/>.
@@ -173,7 +193,6 @@ comment "AT91SAM9260 Variants"
173 193
174config ARCH_AT91SAM9260_SAM9XE 194config ARCH_AT91SAM9260_SAM9XE
175 bool "AT91SAM9XE" 195 bool "AT91SAM9XE"
176 depends on ARCH_AT91SAM9260
177 help 196 help
178 Select this if you are using Atmel's AT91SAM9XE System-on-Chip. 197 Select this if you are using Atmel's AT91SAM9XE System-on-Chip.
179 They are basically AT91SAM9260s with various sizes of embedded Flash. 198 They are basically AT91SAM9260s with various sizes of embedded Flash.
@@ -182,28 +201,27 @@ comment "AT91SAM9260 / AT91SAM9XE Board Type"
182 201
183config MACH_AT91SAM9260EK 202config MACH_AT91SAM9260EK
184 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" 203 bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
185 depends on ARCH_AT91SAM9260 204 select HAVE_AT91_DATAFLASH_CARD
205 select HAVE_NAND_ATMEL_BUSWIDTH_16
186 help 206 help
187 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit 207 Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
188 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> 208 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
189 209
190config MACH_CAM60 210config MACH_CAM60
191 bool "KwikByte KB9260 (CAM60) board" 211 bool "KwikByte KB9260 (CAM60) board"
192 depends on ARCH_AT91SAM9260
193 help 212 help
194 Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260. 213 Select this if you are using KwikByte's KB9260 (CAM60) board based on the Atmel AT91SAM9260.
195 <http://www.kwikbyte.com/KB9260.html> 214 <http://www.kwikbyte.com/KB9260.html>
196 215
197config MACH_SAM9_L9260 216config MACH_SAM9_L9260
198 bool "Olimex SAM9-L9260 board" 217 bool "Olimex SAM9-L9260 board"
199 depends on ARCH_AT91SAM9260 218 select HAVE_AT91_DATAFLASH_CARD
200 help 219 help
201 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260. 220 Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
202 <http://www.olimex.com/dev/sam9-L9260.html> 221 <http://www.olimex.com/dev/sam9-L9260.html>
203 222
204config MACH_AFEB9260 223config MACH_AFEB9260
205 bool "Custom afeb9260 board v1" 224 bool "Custom afeb9260 board v1"
206 depends on ARCH_AT91SAM9260
207 help 225 help
208 Select this if you are using custom afeb9260 board based on 226 Select this if you are using custom afeb9260 board based on
209 open hardware design. Select this for revision 1 of the board. 227 open hardware design. Select this for revision 1 of the board.
@@ -212,21 +230,18 @@ config MACH_AFEB9260
212 230
213config MACH_USB_A9260 231config MACH_USB_A9260
214 bool "CALAO USB-A9260" 232 bool "CALAO USB-A9260"
215 depends on ARCH_AT91SAM9260
216 help 233 help
217 Select this if you are using a Calao Systems USB-A9260. 234 Select this if you are using a Calao Systems USB-A9260.
218 <http://www.calao-systems.com> 235 <http://www.calao-systems.com>
219 236
220config MACH_QIL_A9260 237config MACH_QIL_A9260
221 bool "CALAO QIL-A9260 board" 238 bool "CALAO QIL-A9260 board"
222 depends on ARCH_AT91SAM9260
223 help 239 help
224 Select this if you are using a Calao Systems QIL-A9260 Board. 240 Select this if you are using a Calao Systems QIL-A9260 Board.
225 <http://www.calao-systems.com> 241 <http://www.calao-systems.com>
226 242
227config MACH_CPU9260 243config MACH_CPU9260
228 bool "Eukrea CPU9260 board" 244 bool "Eukrea CPU9260 board"
229 depends on ARCH_AT91SAM9260
230 help 245 help
231 Select this if you are using a Eukrea Electromatique's 246 Select this if you are using a Eukrea Electromatique's
232 CPU9260 Board <http://www.eukrea.com/> 247 CPU9260 Board <http://www.eukrea.com/>
@@ -241,7 +256,8 @@ comment "AT91SAM9261 Board Type"
241 256
242config MACH_AT91SAM9261EK 257config MACH_AT91SAM9261EK
243 bool "Atmel AT91SAM9261-EK Evaluation Kit" 258 bool "Atmel AT91SAM9261-EK Evaluation Kit"
244 depends on ARCH_AT91SAM9261 259 select HAVE_AT91_DATAFLASH_CARD
260 select HAVE_NAND_ATMEL_BUSWIDTH_16
245 help 261 help
246 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit. 262 Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
247 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820> 263 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
@@ -256,7 +272,8 @@ comment "AT91SAM9G10 Board Type"
256 272
257config MACH_AT91SAM9G10EK 273config MACH_AT91SAM9G10EK
258 bool "Atmel AT91SAM9G10-EK Evaluation Kit" 274 bool "Atmel AT91SAM9G10-EK Evaluation Kit"
259 depends on ARCH_AT91SAM9G10 275 select HAVE_AT91_DATAFLASH_CARD
276 select HAVE_NAND_ATMEL_BUSWIDTH_16
260 help 277 help
261 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit. 278 Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
262 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588> 279 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
@@ -271,21 +288,21 @@ comment "AT91SAM9263 Board Type"
271 288
272config MACH_AT91SAM9263EK 289config MACH_AT91SAM9263EK
273 bool "Atmel AT91SAM9263-EK Evaluation Kit" 290 bool "Atmel AT91SAM9263-EK Evaluation Kit"
274 depends on ARCH_AT91SAM9263 291 select HAVE_AT91_DATAFLASH_CARD
292 select HAVE_NAND_ATMEL_BUSWIDTH_16
275 help 293 help
276 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit. 294 Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
277 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057> 295 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
278 296
279config MACH_USB_A9263 297config MACH_USB_A9263
280 bool "CALAO USB-A9263" 298 bool "CALAO USB-A9263"
281 depends on ARCH_AT91SAM9263
282 help 299 help
283 Select this if you are using a Calao Systems USB-A9263. 300 Select this if you are using a Calao Systems USB-A9263.
284 <http://www.calao-systems.com> 301 <http://www.calao-systems.com>
285 302
286config MACH_NEOCORE926 303config MACH_NEOCORE926
287 bool "Adeneo NEOCORE926" 304 bool "Adeneo NEOCORE926"
288 depends on ARCH_AT91SAM9263 305 select HAVE_AT91_DATAFLASH_CARD
289 help 306 help
290 Select this if you are using the Adeneo Neocore 926 board. 307 Select this if you are using the Adeneo Neocore 926 board.
291 308
@@ -299,7 +316,6 @@ comment "AT91SAM9RL Board Type"
299 316
300config MACH_AT91SAM9RLEK 317config MACH_AT91SAM9RLEK
301 bool "Atmel AT91SAM9RL-EK Evaluation Kit" 318 bool "Atmel AT91SAM9RL-EK Evaluation Kit"
302 depends on ARCH_AT91SAM9RL
303 help 319 help
304 Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit. 320 Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
305 321
@@ -313,14 +329,15 @@ comment "AT91SAM9G20 Board Type"
313 329
314config MACH_AT91SAM9G20EK 330config MACH_AT91SAM9G20EK
315 bool "Atmel AT91SAM9G20-EK Evaluation Kit" 331 bool "Atmel AT91SAM9G20-EK Evaluation Kit"
316 depends on ARCH_AT91SAM9G20 332 select HAVE_AT91_DATAFLASH_CARD
333 select HAVE_NAND_ATMEL_BUSWIDTH_16
317 help 334 help
318 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit 335 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
319 that embeds only one SD/MMC slot. 336 that embeds only one SD/MMC slot.
320 337
321config MACH_AT91SAM9G20EK_2MMC 338config MACH_AT91SAM9G20EK_2MMC
322 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots" 339 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
323 depends on ARCH_AT91SAM9G20 340 select HAVE_NAND_ATMEL_BUSWIDTH_16
324 help 341 help
325 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit 342 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
326 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and 343 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
@@ -328,7 +345,6 @@ config MACH_AT91SAM9G20EK_2MMC
328 345
329config MACH_CPU9G20 346config MACH_CPU9G20
330 bool "Eukrea CPU9G20 board" 347 bool "Eukrea CPU9G20 board"
331 depends on ARCH_AT91SAM9G20
332 help 348 help
333 Select this if you are using a Eukrea Electromatique's 349 Select this if you are using a Eukrea Electromatique's
334 CPU9G20 Board <http://www.eukrea.com/> 350 CPU9G20 Board <http://www.eukrea.com/>
@@ -343,7 +359,7 @@ comment "AT91SAM9G45 Board Type"
343 359
344config MACH_AT91SAM9G45EKES 360config MACH_AT91SAM9G45EKES
345 bool "Atmel AT91SAM9G45-EKES Evaluation Kit" 361 bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
346 depends on ARCH_AT91SAM9G45 362 select HAVE_NAND_ATMEL_BUSWIDTH_16
347 help 363 help
348 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit. 364 Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
349 "ES" at the end of the name means that this board is an 365 "ES" at the end of the name means that this board is an
@@ -359,7 +375,8 @@ comment "AT91CAP9 Board Type"
359 375
360config MACH_AT91CAP9ADK 376config MACH_AT91CAP9ADK
361 bool "Atmel AT91CAP9A-DK Evaluation Kit" 377 bool "Atmel AT91CAP9A-DK Evaluation Kit"
362 depends on ARCH_AT91CAP9 378 select HAVE_AT91_DATAFLASH_CARD
379 select HAVE_NAND_ATMEL_BUSWIDTH_16
363 help 380 help
364 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit. 381 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
365 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138> 382 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
@@ -388,13 +405,13 @@ comment "AT91 Board Options"
388 405
389config MTD_AT91_DATAFLASH_CARD 406config MTD_AT91_DATAFLASH_CARD
390 bool "Enable DataFlash Card support" 407 bool "Enable DataFlash Card support"
391 depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_NEOCORE926) 408 depends on HAVE_AT91_DATAFLASH_CARD
392 help 409 help
393 Enable support for the DataFlash card. 410 Enable support for the DataFlash card.
394 411
395config MTD_NAND_ATMEL_BUSWIDTH_16 412config MTD_NAND_ATMEL_BUSWIDTH_16
396 bool "Enable 16-bit data bus interface to NAND flash" 413 bool "Enable 16-bit data bus interface to NAND flash"
397 depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G20EK_2MMC || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK) 414 depends on HAVE_NAND_ATMEL_BUSWIDTH_16
398 help 415 help
399 On AT91SAM926x boards both types of NAND flash can be present 416 On AT91SAM926x boards both types of NAND flash can be present
400 (8 and 16 bit data bus width). 417 (8 and 16 bit data bus width).
@@ -456,15 +473,15 @@ config AT91_EARLY_USART2
456 473
457config AT91_EARLY_USART3 474config AT91_EARLY_USART3
458 bool "USART3" 475 bool "USART3"
459 depends on (ARCH_AT91RM9200 || ARCH_AT91SAM9RL || ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 || ARCH_AT91SAM9G45) 476 depends on HAVE_AT91_USART3
460 477
461config AT91_EARLY_USART4 478config AT91_EARLY_USART4
462 bool "USART4" 479 bool "USART4"
463 depends on ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 480 depends on HAVE_AT91_USART4
464 481
465config AT91_EARLY_USART5 482config AT91_EARLY_USART5
466 bool "USART5" 483 bool "USART5"
467 depends on ARCH_AT91SAM9260 || ARCH_AT91SAM9G20 484 depends on HAVE_AT91_USART5
468 485
469endchoice 486endchoice
470 487
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
new file mode 100644
index 000000000000..3b9a32ace909
--- /dev/null
+++ b/arch/arm/mach-dove/Kconfig
@@ -0,0 +1,14 @@
1if ARCH_DOVE
2
3menu "Marvell Dove Implementations"
4
5config MACH_DOVE_DB
6 bool "Marvell DB-MV88AP510 Development Board"
7 select I2C_BOARDINFO
8 help
9 Say 'Y' here if you want your kernel to support the
10 Marvell DB-MV88AP510 Development Board.
11
12endmenu
13
14endif
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
new file mode 100644
index 000000000000..7ab3be53f642
--- /dev/null
+++ b/arch/arm/mach-dove/Makefile
@@ -0,0 +1,3 @@
1obj-y += common.o addr-map.o irq.o pcie.o
2
3obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
diff --git a/arch/arm/mach-dove/Makefile.boot b/arch/arm/mach-dove/Makefile.boot
new file mode 100644
index 000000000000..67039c3e0c48
--- /dev/null
+++ b/arch/arm/mach-dove/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-dove/addr-map.c b/arch/arm/mach-dove/addr-map.c
new file mode 100644
index 000000000000..00be4fc26dd7
--- /dev/null
+++ b/arch/arm/mach-dove/addr-map.c
@@ -0,0 +1,149 @@
1/*
2 * arch/arm/mach-dove/addr-map.c
3 *
4 * Address map functions for Marvell Dove 88AP510 SoC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <asm/mach/arch.h>
16#include <asm/setup.h>
17#include "common.h"
18
19/*
20 * Generic Address Decode Windows bit settings
21 */
22#define TARGET_DDR 0x0
23#define TARGET_BOOTROM 0x1
24#define TARGET_CESA 0x3
25#define TARGET_PCIE0 0x4
26#define TARGET_PCIE1 0x8
27#define TARGET_SCRATCHPAD 0xd
28
29#define ATTR_CESA 0x01
30#define ATTR_BOOTROM 0xfd
31#define ATTR_DEV_SPI0_ROM 0xfe
32#define ATTR_DEV_SPI1_ROM 0xfb
33#define ATTR_PCIE_IO 0xe0
34#define ATTR_PCIE_MEM 0xe8
35#define ATTR_SCRATCHPAD 0x0
36
37/*
38 * CPU Address Decode Windows registers
39 */
40#define WIN_CTRL(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x0)
41#define WIN_BASE(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x4)
42#define WIN_REMAP_LO(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0x8)
43#define WIN_REMAP_HI(n) (BRIDGE_VIRT_BASE + ((n) << 4) + 0xc)
44
45struct mbus_dram_target_info dove_mbus_dram_info;
46
47static inline void __iomem *ddr_map_sc(int i)
48{
49 return (void __iomem *)(DOVE_MC_VIRT_BASE + 0x100 + ((i) << 4));
50}
51
52static int cpu_win_can_remap(int win)
53{
54 if (win < 4)
55 return 1;
56
57 return 0;
58}
59
60static void __init setup_cpu_win(int win, u32 base, u32 size,
61 u8 target, u8 attr, int remap)
62{
63 u32 ctrl;
64
65 base &= 0xffff0000;
66 ctrl = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1;
67
68 writel(base, WIN_BASE(win));
69 writel(ctrl, WIN_CTRL(win));
70 if (cpu_win_can_remap(win)) {
71 if (remap < 0)
72 remap = base;
73 writel(remap & 0xffff0000, WIN_REMAP_LO(win));
74 writel(0, WIN_REMAP_HI(win));
75 }
76}
77
78void __init dove_setup_cpu_mbus(void)
79{
80 int i;
81 int cs;
82
83 /*
84 * First, disable and clear windows.
85 */
86 for (i = 0; i < 8; i++) {
87 writel(0, WIN_BASE(i));
88 writel(0, WIN_CTRL(i));
89 if (cpu_win_can_remap(i)) {
90 writel(0, WIN_REMAP_LO(i));
91 writel(0, WIN_REMAP_HI(i));
92 }
93 }
94
95 /*
96 * Setup windows for PCIe IO+MEM space.
97 */
98 setup_cpu_win(0, DOVE_PCIE0_IO_PHYS_BASE, DOVE_PCIE0_IO_SIZE,
99 TARGET_PCIE0, ATTR_PCIE_IO, DOVE_PCIE0_IO_BUS_BASE);
100 setup_cpu_win(1, DOVE_PCIE1_IO_PHYS_BASE, DOVE_PCIE1_IO_SIZE,
101 TARGET_PCIE1, ATTR_PCIE_IO, DOVE_PCIE1_IO_BUS_BASE);
102 setup_cpu_win(2, DOVE_PCIE0_MEM_PHYS_BASE, DOVE_PCIE0_MEM_SIZE,
103 TARGET_PCIE0, ATTR_PCIE_MEM, -1);
104 setup_cpu_win(3, DOVE_PCIE1_MEM_PHYS_BASE, DOVE_PCIE1_MEM_SIZE,
105 TARGET_PCIE1, ATTR_PCIE_MEM, -1);
106
107 /*
108 * Setup window for CESA engine.
109 */
110 setup_cpu_win(4, DOVE_CESA_PHYS_BASE, DOVE_CESA_SIZE,
111 TARGET_CESA, ATTR_CESA, -1);
112
113 /*
114 * Setup the Window to the BootROM for Standby and Sleep Resume
115 */
116 setup_cpu_win(5, DOVE_BOOTROM_PHYS_BASE, DOVE_BOOTROM_SIZE,
117 TARGET_BOOTROM, ATTR_BOOTROM, -1);
118
119 /*
120 * Setup the Window to the PMU Scratch Pad space
121 */
122 setup_cpu_win(6, DOVE_SCRATCHPAD_PHYS_BASE, DOVE_SCRATCHPAD_SIZE,
123 TARGET_SCRATCHPAD, ATTR_SCRATCHPAD, -1);
124
125 /*
126 * Setup MBUS dram target info.
127 */
128 dove_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
129
130 for (i = 0, cs = 0; i < 2; i++) {
131 u32 map = readl(ddr_map_sc(i));
132
133 /*
134 * Chip select enabled?
135 */
136 if (map & 1) {
137 struct mbus_dram_window *w;
138
139 w = &dove_mbus_dram_info.cs[cs++];
140 w->cs_index = i;
141 w->mbus_attr = 0; /* CS address decoding done inside */
142 /* the DDR controller, no need to */
143 /* provide attributes */
144 w->base = map & 0xff800000;
145 w->size = 0x100000 << (((map & 0x000f0000) >> 16) - 4);
146 }
147 }
148 dove_mbus_dram_info.num_cs = cs;
149}
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
new file mode 100644
index 000000000000..806972a68c87
--- /dev/null
+++ b/arch/arm/mach-dove/common.c
@@ -0,0 +1,781 @@
1/*
2 * arch/arm/mach-dove/common.c
3 *
4 * Core functions for Marvell Dove 88AP510 System On Chip
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/delay.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/pci.h>
16#include <linux/serial_8250.h>
17#include <linux/clk.h>
18#include <linux/mbus.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/mv643xx_i2c.h>
21#include <linux/ata_platform.h>
22#include <linux/spi/orion_spi.h>
23#include <linux/gpio.h>
24#include <asm/page.h>
25#include <asm/setup.h>
26#include <asm/timex.h>
27#include <asm/hardware/cache-tauros2.h>
28#include <asm/mach/map.h>
29#include <asm/mach/time.h>
30#include <asm/mach/pci.h>
31#include <mach/dove.h>
32#include <mach/bridge-regs.h>
33#include <asm/mach/arch.h>
34#include <linux/irq.h>
35#include <plat/mv_xor.h>
36#include <plat/ehci-orion.h>
37#include <plat/time.h>
38#include "common.h"
39
40/*****************************************************************************
41 * I/O Address Mapping
42 ****************************************************************************/
43static struct map_desc dove_io_desc[] __initdata = {
44 {
45 .virtual = DOVE_SB_REGS_VIRT_BASE,
46 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
47 .length = DOVE_SB_REGS_SIZE,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = DOVE_NB_REGS_VIRT_BASE,
51 .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE),
52 .length = DOVE_NB_REGS_SIZE,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = DOVE_PCIE0_IO_VIRT_BASE,
56 .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE),
57 .length = DOVE_PCIE0_IO_SIZE,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = DOVE_PCIE1_IO_VIRT_BASE,
61 .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE),
62 .length = DOVE_PCIE1_IO_SIZE,
63 .type = MT_DEVICE,
64 },
65};
66
67void __init dove_map_io(void)
68{
69 iotable_init(dove_io_desc, ARRAY_SIZE(dove_io_desc));
70}
71
72/*****************************************************************************
73 * EHCI
74 ****************************************************************************/
75static struct orion_ehci_data dove_ehci_data = {
76 .dram = &dove_mbus_dram_info,
77 .phy_version = EHCI_PHY_NA,
78};
79
80static u64 ehci_dmamask = DMA_BIT_MASK(32);
81
82/*****************************************************************************
83 * EHCI0
84 ****************************************************************************/
85static struct resource dove_ehci0_resources[] = {
86 {
87 .start = DOVE_USB0_PHYS_BASE,
88 .end = DOVE_USB0_PHYS_BASE + SZ_4K - 1,
89 .flags = IORESOURCE_MEM,
90 }, {
91 .start = IRQ_DOVE_USB0,
92 .end = IRQ_DOVE_USB0,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
97static struct platform_device dove_ehci0 = {
98 .name = "orion-ehci",
99 .id = 0,
100 .dev = {
101 .dma_mask = &ehci_dmamask,
102 .coherent_dma_mask = DMA_BIT_MASK(32),
103 .platform_data = &dove_ehci_data,
104 },
105 .resource = dove_ehci0_resources,
106 .num_resources = ARRAY_SIZE(dove_ehci0_resources),
107};
108
109void __init dove_ehci0_init(void)
110{
111 platform_device_register(&dove_ehci0);
112}
113
114/*****************************************************************************
115 * EHCI1
116 ****************************************************************************/
117static struct resource dove_ehci1_resources[] = {
118 {
119 .start = DOVE_USB1_PHYS_BASE,
120 .end = DOVE_USB1_PHYS_BASE + SZ_4K - 1,
121 .flags = IORESOURCE_MEM,
122 }, {
123 .start = IRQ_DOVE_USB1,
124 .end = IRQ_DOVE_USB1,
125 .flags = IORESOURCE_IRQ,
126 },
127};
128
129static struct platform_device dove_ehci1 = {
130 .name = "orion-ehci",
131 .id = 1,
132 .dev = {
133 .dma_mask = &ehci_dmamask,
134 .coherent_dma_mask = DMA_BIT_MASK(32),
135 .platform_data = &dove_ehci_data,
136 },
137 .resource = dove_ehci1_resources,
138 .num_resources = ARRAY_SIZE(dove_ehci1_resources),
139};
140
141void __init dove_ehci1_init(void)
142{
143 platform_device_register(&dove_ehci1);
144}
145
146/*****************************************************************************
147 * GE00
148 ****************************************************************************/
149struct mv643xx_eth_shared_platform_data dove_ge00_shared_data = {
150 .t_clk = 0,
151 .dram = &dove_mbus_dram_info,
152};
153
154static struct resource dove_ge00_shared_resources[] = {
155 {
156 .name = "ge00 base",
157 .start = DOVE_GE00_PHYS_BASE + 0x2000,
158 .end = DOVE_GE00_PHYS_BASE + SZ_16K - 1,
159 .flags = IORESOURCE_MEM,
160 },
161};
162
163static struct platform_device dove_ge00_shared = {
164 .name = MV643XX_ETH_SHARED_NAME,
165 .id = 0,
166 .dev = {
167 .platform_data = &dove_ge00_shared_data,
168 },
169 .num_resources = 1,
170 .resource = dove_ge00_shared_resources,
171};
172
173static struct resource dove_ge00_resources[] = {
174 {
175 .name = "ge00 irq",
176 .start = IRQ_DOVE_GE00_SUM,
177 .end = IRQ_DOVE_GE00_SUM,
178 .flags = IORESOURCE_IRQ,
179 },
180};
181
182static struct platform_device dove_ge00 = {
183 .name = MV643XX_ETH_NAME,
184 .id = 0,
185 .num_resources = 1,
186 .resource = dove_ge00_resources,
187 .dev = {
188 .coherent_dma_mask = 0xffffffff,
189 },
190};
191
192void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data)
193{
194 eth_data->shared = &dove_ge00_shared;
195 dove_ge00.dev.platform_data = eth_data;
196
197 platform_device_register(&dove_ge00_shared);
198 platform_device_register(&dove_ge00);
199}
200
201/*****************************************************************************
202 * SoC RTC
203 ****************************************************************************/
204static struct resource dove_rtc_resource[] = {
205 {
206 .start = DOVE_RTC_PHYS_BASE,
207 .end = DOVE_RTC_PHYS_BASE + 32 - 1,
208 .flags = IORESOURCE_MEM,
209 }, {
210 .start = IRQ_DOVE_RTC,
211 .flags = IORESOURCE_IRQ,
212 }
213};
214
215void __init dove_rtc_init(void)
216{
217 platform_device_register_simple("rtc-mv", -1, dove_rtc_resource, 2);
218}
219
220/*****************************************************************************
221 * SATA
222 ****************************************************************************/
223static struct resource dove_sata_resources[] = {
224 {
225 .name = "sata base",
226 .start = DOVE_SATA_PHYS_BASE,
227 .end = DOVE_SATA_PHYS_BASE + 0x5000 - 1,
228 .flags = IORESOURCE_MEM,
229 }, {
230 .name = "sata irq",
231 .start = IRQ_DOVE_SATA,
232 .end = IRQ_DOVE_SATA,
233 .flags = IORESOURCE_IRQ,
234 },
235};
236
237static struct platform_device dove_sata = {
238 .name = "sata_mv",
239 .id = 0,
240 .dev = {
241 .coherent_dma_mask = DMA_BIT_MASK(32),
242 },
243 .num_resources = ARRAY_SIZE(dove_sata_resources),
244 .resource = dove_sata_resources,
245};
246
247void __init dove_sata_init(struct mv_sata_platform_data *sata_data)
248{
249 sata_data->dram = &dove_mbus_dram_info;
250 dove_sata.dev.platform_data = sata_data;
251 platform_device_register(&dove_sata);
252}
253
254/*****************************************************************************
255 * UART0
256 ****************************************************************************/
257static struct plat_serial8250_port dove_uart0_data[] = {
258 {
259 .mapbase = DOVE_UART0_PHYS_BASE,
260 .membase = (char *)DOVE_UART0_VIRT_BASE,
261 .irq = IRQ_DOVE_UART_0,
262 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
263 .iotype = UPIO_MEM,
264 .regshift = 2,
265 .uartclk = 0,
266 }, {
267 },
268};
269
270static struct resource dove_uart0_resources[] = {
271 {
272 .start = DOVE_UART0_PHYS_BASE,
273 .end = DOVE_UART0_PHYS_BASE + SZ_256 - 1,
274 .flags = IORESOURCE_MEM,
275 }, {
276 .start = IRQ_DOVE_UART_0,
277 .end = IRQ_DOVE_UART_0,
278 .flags = IORESOURCE_IRQ,
279 },
280};
281
282static struct platform_device dove_uart0 = {
283 .name = "serial8250",
284 .id = 0,
285 .dev = {
286 .platform_data = dove_uart0_data,
287 },
288 .resource = dove_uart0_resources,
289 .num_resources = ARRAY_SIZE(dove_uart0_resources),
290};
291
292void __init dove_uart0_init(void)
293{
294 platform_device_register(&dove_uart0);
295}
296
297/*****************************************************************************
298 * UART1
299 ****************************************************************************/
300static struct plat_serial8250_port dove_uart1_data[] = {
301 {
302 .mapbase = DOVE_UART1_PHYS_BASE,
303 .membase = (char *)DOVE_UART1_VIRT_BASE,
304 .irq = IRQ_DOVE_UART_1,
305 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
306 .iotype = UPIO_MEM,
307 .regshift = 2,
308 .uartclk = 0,
309 }, {
310 },
311};
312
313static struct resource dove_uart1_resources[] = {
314 {
315 .start = DOVE_UART1_PHYS_BASE,
316 .end = DOVE_UART1_PHYS_BASE + SZ_256 - 1,
317 .flags = IORESOURCE_MEM,
318 }, {
319 .start = IRQ_DOVE_UART_1,
320 .end = IRQ_DOVE_UART_1,
321 .flags = IORESOURCE_IRQ,
322 },
323};
324
325static struct platform_device dove_uart1 = {
326 .name = "serial8250",
327 .id = 1,
328 .dev = {
329 .platform_data = dove_uart1_data,
330 },
331 .resource = dove_uart1_resources,
332 .num_resources = ARRAY_SIZE(dove_uart1_resources),
333};
334
335void __init dove_uart1_init(void)
336{
337 platform_device_register(&dove_uart1);
338}
339
340/*****************************************************************************
341 * UART2
342 ****************************************************************************/
343static struct plat_serial8250_port dove_uart2_data[] = {
344 {
345 .mapbase = DOVE_UART2_PHYS_BASE,
346 .membase = (char *)DOVE_UART2_VIRT_BASE,
347 .irq = IRQ_DOVE_UART_2,
348 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
349 .iotype = UPIO_MEM,
350 .regshift = 2,
351 .uartclk = 0,
352 }, {
353 },
354};
355
356static struct resource dove_uart2_resources[] = {
357 {
358 .start = DOVE_UART2_PHYS_BASE,
359 .end = DOVE_UART2_PHYS_BASE + SZ_256 - 1,
360 .flags = IORESOURCE_MEM,
361 }, {
362 .start = IRQ_DOVE_UART_2,
363 .end = IRQ_DOVE_UART_2,
364 .flags = IORESOURCE_IRQ,
365 },
366};
367
368static struct platform_device dove_uart2 = {
369 .name = "serial8250",
370 .id = 2,
371 .dev = {
372 .platform_data = dove_uart2_data,
373 },
374 .resource = dove_uart2_resources,
375 .num_resources = ARRAY_SIZE(dove_uart2_resources),
376};
377
378void __init dove_uart2_init(void)
379{
380 platform_device_register(&dove_uart2);
381}
382
383/*****************************************************************************
384 * UART3
385 ****************************************************************************/
386static struct plat_serial8250_port dove_uart3_data[] = {
387 {
388 .mapbase = DOVE_UART3_PHYS_BASE,
389 .membase = (char *)DOVE_UART3_VIRT_BASE,
390 .irq = IRQ_DOVE_UART_3,
391 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
392 .iotype = UPIO_MEM,
393 .regshift = 2,
394 .uartclk = 0,
395 }, {
396 },
397};
398
399static struct resource dove_uart3_resources[] = {
400 {
401 .start = DOVE_UART3_PHYS_BASE,
402 .end = DOVE_UART3_PHYS_BASE + SZ_256 - 1,
403 .flags = IORESOURCE_MEM,
404 }, {
405 .start = IRQ_DOVE_UART_3,
406 .end = IRQ_DOVE_UART_3,
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct platform_device dove_uart3 = {
412 .name = "serial8250",
413 .id = 3,
414 .dev = {
415 .platform_data = dove_uart3_data,
416 },
417 .resource = dove_uart3_resources,
418 .num_resources = ARRAY_SIZE(dove_uart3_resources),
419};
420
421void __init dove_uart3_init(void)
422{
423 platform_device_register(&dove_uart3);
424}
425
426/*****************************************************************************
427 * SPI0
428 ****************************************************************************/
429static struct orion_spi_info dove_spi0_data = {
430 .tclk = 0,
431};
432
433static struct resource dove_spi0_resources[] = {
434 {
435 .start = DOVE_SPI0_PHYS_BASE,
436 .end = DOVE_SPI0_PHYS_BASE + SZ_512 - 1,
437 .flags = IORESOURCE_MEM,
438 }, {
439 .start = IRQ_DOVE_SPI0,
440 .end = IRQ_DOVE_SPI0,
441 .flags = IORESOURCE_IRQ,
442 },
443};
444
445static struct platform_device dove_spi0 = {
446 .name = "orion_spi",
447 .id = 0,
448 .resource = dove_spi0_resources,
449 .dev = {
450 .platform_data = &dove_spi0_data,
451 },
452 .num_resources = ARRAY_SIZE(dove_spi0_resources),
453};
454
455void __init dove_spi0_init(void)
456{
457 platform_device_register(&dove_spi0);
458}
459
460/*****************************************************************************
461 * SPI1
462 ****************************************************************************/
463static struct orion_spi_info dove_spi1_data = {
464 .tclk = 0,
465};
466
467static struct resource dove_spi1_resources[] = {
468 {
469 .start = DOVE_SPI1_PHYS_BASE,
470 .end = DOVE_SPI1_PHYS_BASE + SZ_512 - 1,
471 .flags = IORESOURCE_MEM,
472 }, {
473 .start = IRQ_DOVE_SPI1,
474 .end = IRQ_DOVE_SPI1,
475 .flags = IORESOURCE_IRQ,
476 },
477};
478
479static struct platform_device dove_spi1 = {
480 .name = "orion_spi",
481 .id = 1,
482 .resource = dove_spi1_resources,
483 .dev = {
484 .platform_data = &dove_spi1_data,
485 },
486 .num_resources = ARRAY_SIZE(dove_spi1_resources),
487};
488
489void __init dove_spi1_init(void)
490{
491 platform_device_register(&dove_spi1);
492}
493
494/*****************************************************************************
495 * I2C
496 ****************************************************************************/
497static struct mv64xxx_i2c_pdata dove_i2c_data = {
498 .freq_m = 10, /* assumes 166 MHz TCLK gets 94.3kHz */
499 .freq_n = 3,
500 .timeout = 1000, /* Default timeout of 1 second */
501};
502
503static struct resource dove_i2c_resources[] = {
504 {
505 .name = "i2c base",
506 .start = DOVE_I2C_PHYS_BASE,
507 .end = DOVE_I2C_PHYS_BASE + 0x20 - 1,
508 .flags = IORESOURCE_MEM,
509 }, {
510 .name = "i2c irq",
511 .start = IRQ_DOVE_I2C,
512 .end = IRQ_DOVE_I2C,
513 .flags = IORESOURCE_IRQ,
514 },
515};
516
517static struct platform_device dove_i2c = {
518 .name = MV64XXX_I2C_CTLR_NAME,
519 .id = 0,
520 .num_resources = ARRAY_SIZE(dove_i2c_resources),
521 .resource = dove_i2c_resources,
522 .dev = {
523 .platform_data = &dove_i2c_data,
524 },
525};
526
527void __init dove_i2c_init(void)
528{
529 platform_device_register(&dove_i2c);
530}
531
532/*****************************************************************************
533 * Time handling
534 ****************************************************************************/
535static int get_tclk(void)
536{
537 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
538 return 166666667;
539}
540
541static void dove_timer_init(void)
542{
543 orion_time_init(IRQ_DOVE_BRIDGE, get_tclk());
544}
545
546struct sys_timer dove_timer = {
547 .init = dove_timer_init,
548};
549
550/*****************************************************************************
551 * XOR
552 ****************************************************************************/
553static struct mv_xor_platform_shared_data dove_xor_shared_data = {
554 .dram = &dove_mbus_dram_info,
555};
556
557/*****************************************************************************
558 * XOR 0
559 ****************************************************************************/
560static u64 dove_xor0_dmamask = DMA_BIT_MASK(32);
561
562static struct resource dove_xor0_shared_resources[] = {
563 {
564 .name = "xor 0 low",
565 .start = DOVE_XOR0_PHYS_BASE,
566 .end = DOVE_XOR0_PHYS_BASE + 0xff,
567 .flags = IORESOURCE_MEM,
568 }, {
569 .name = "xor 0 high",
570 .start = DOVE_XOR0_HIGH_PHYS_BASE,
571 .end = DOVE_XOR0_HIGH_PHYS_BASE + 0xff,
572 .flags = IORESOURCE_MEM,
573 },
574};
575
576static struct platform_device dove_xor0_shared = {
577 .name = MV_XOR_SHARED_NAME,
578 .id = 0,
579 .dev = {
580 .platform_data = &dove_xor_shared_data,
581 },
582 .num_resources = ARRAY_SIZE(dove_xor0_shared_resources),
583 .resource = dove_xor0_shared_resources,
584};
585
586static struct resource dove_xor00_resources[] = {
587 [0] = {
588 .start = IRQ_DOVE_XOR_00,
589 .end = IRQ_DOVE_XOR_00,
590 .flags = IORESOURCE_IRQ,
591 },
592};
593
594static struct mv_xor_platform_data dove_xor00_data = {
595 .shared = &dove_xor0_shared,
596 .hw_id = 0,
597 .pool_size = PAGE_SIZE,
598};
599
600static struct platform_device dove_xor00_channel = {
601 .name = MV_XOR_NAME,
602 .id = 0,
603 .num_resources = ARRAY_SIZE(dove_xor00_resources),
604 .resource = dove_xor00_resources,
605 .dev = {
606 .dma_mask = &dove_xor0_dmamask,
607 .coherent_dma_mask = DMA_BIT_MASK(64),
608 .platform_data = (void *)&dove_xor00_data,
609 },
610};
611
612static struct resource dove_xor01_resources[] = {
613 [0] = {
614 .start = IRQ_DOVE_XOR_01,
615 .end = IRQ_DOVE_XOR_01,
616 .flags = IORESOURCE_IRQ,
617 },
618};
619
620static struct mv_xor_platform_data dove_xor01_data = {
621 .shared = &dove_xor0_shared,
622 .hw_id = 1,
623 .pool_size = PAGE_SIZE,
624};
625
626static struct platform_device dove_xor01_channel = {
627 .name = MV_XOR_NAME,
628 .id = 1,
629 .num_resources = ARRAY_SIZE(dove_xor01_resources),
630 .resource = dove_xor01_resources,
631 .dev = {
632 .dma_mask = &dove_xor0_dmamask,
633 .coherent_dma_mask = DMA_BIT_MASK(64),
634 .platform_data = (void *)&dove_xor01_data,
635 },
636};
637
638void __init dove_xor0_init(void)
639{
640 platform_device_register(&dove_xor0_shared);
641
642 /*
643 * two engines can't do memset simultaneously, this limitation
644 * satisfied by removing memset support from one of the engines.
645 */
646 dma_cap_set(DMA_MEMCPY, dove_xor00_data.cap_mask);
647 dma_cap_set(DMA_XOR, dove_xor00_data.cap_mask);
648 platform_device_register(&dove_xor00_channel);
649
650 dma_cap_set(DMA_MEMCPY, dove_xor01_data.cap_mask);
651 dma_cap_set(DMA_MEMSET, dove_xor01_data.cap_mask);
652 dma_cap_set(DMA_XOR, dove_xor01_data.cap_mask);
653 platform_device_register(&dove_xor01_channel);
654}
655
656/*****************************************************************************
657 * XOR 1
658 ****************************************************************************/
659static u64 dove_xor1_dmamask = DMA_BIT_MASK(32);
660
661static struct resource dove_xor1_shared_resources[] = {
662 {
663 .name = "xor 0 low",
664 .start = DOVE_XOR1_PHYS_BASE,
665 .end = DOVE_XOR1_PHYS_BASE + 0xff,
666 .flags = IORESOURCE_MEM,
667 }, {
668 .name = "xor 0 high",
669 .start = DOVE_XOR1_HIGH_PHYS_BASE,
670 .end = DOVE_XOR1_HIGH_PHYS_BASE + 0xff,
671 .flags = IORESOURCE_MEM,
672 },
673};
674
675static struct platform_device dove_xor1_shared = {
676 .name = MV_XOR_SHARED_NAME,
677 .id = 1,
678 .dev = {
679 .platform_data = &dove_xor_shared_data,
680 },
681 .num_resources = ARRAY_SIZE(dove_xor1_shared_resources),
682 .resource = dove_xor1_shared_resources,
683};
684
685static struct resource dove_xor10_resources[] = {
686 [0] = {
687 .start = IRQ_DOVE_XOR_10,
688 .end = IRQ_DOVE_XOR_10,
689 .flags = IORESOURCE_IRQ,
690 },
691};
692
693static struct mv_xor_platform_data dove_xor10_data = {
694 .shared = &dove_xor1_shared,
695 .hw_id = 0,
696 .pool_size = PAGE_SIZE,
697};
698
699static struct platform_device dove_xor10_channel = {
700 .name = MV_XOR_NAME,
701 .id = 2,
702 .num_resources = ARRAY_SIZE(dove_xor10_resources),
703 .resource = dove_xor10_resources,
704 .dev = {
705 .dma_mask = &dove_xor1_dmamask,
706 .coherent_dma_mask = DMA_BIT_MASK(64),
707 .platform_data = (void *)&dove_xor10_data,
708 },
709};
710
711static struct resource dove_xor11_resources[] = {
712 [0] = {
713 .start = IRQ_DOVE_XOR_11,
714 .end = IRQ_DOVE_XOR_11,
715 .flags = IORESOURCE_IRQ,
716 },
717};
718
719static struct mv_xor_platform_data dove_xor11_data = {
720 .shared = &dove_xor1_shared,
721 .hw_id = 1,
722 .pool_size = PAGE_SIZE,
723};
724
725static struct platform_device dove_xor11_channel = {
726 .name = MV_XOR_NAME,
727 .id = 3,
728 .num_resources = ARRAY_SIZE(dove_xor11_resources),
729 .resource = dove_xor11_resources,
730 .dev = {
731 .dma_mask = &dove_xor1_dmamask,
732 .coherent_dma_mask = DMA_BIT_MASK(64),
733 .platform_data = (void *)&dove_xor11_data,
734 },
735};
736
737void __init dove_xor1_init(void)
738{
739 platform_device_register(&dove_xor1_shared);
740
741 /*
742 * two engines can't do memset simultaneously, this limitation
743 * satisfied by removing memset support from one of the engines.
744 */
745 dma_cap_set(DMA_MEMCPY, dove_xor10_data.cap_mask);
746 dma_cap_set(DMA_XOR, dove_xor10_data.cap_mask);
747 platform_device_register(&dove_xor10_channel);
748
749 dma_cap_set(DMA_MEMCPY, dove_xor11_data.cap_mask);
750 dma_cap_set(DMA_MEMSET, dove_xor11_data.cap_mask);
751 dma_cap_set(DMA_XOR, dove_xor11_data.cap_mask);
752 platform_device_register(&dove_xor11_channel);
753}
754
755void __init dove_init(void)
756{
757 int tclk;
758
759 tclk = get_tclk();
760
761 printk(KERN_INFO "Dove 88AP510 SoC, ");
762 printk(KERN_INFO "TCLK = %dMHz\n", (tclk + 499999) / 1000000);
763
764#ifdef CONFIG_CACHE_TAUROS2
765 tauros2_init();
766#endif
767 dove_setup_cpu_mbus();
768
769 dove_ge00_shared_data.t_clk = tclk;
770 dove_uart0_data[0].uartclk = tclk;
771 dove_uart1_data[0].uartclk = tclk;
772 dove_uart2_data[0].uartclk = tclk;
773 dove_uart3_data[0].uartclk = tclk;
774 dove_spi0_data.tclk = tclk;
775 dove_spi1_data.tclk = tclk;
776
777 /* internal devices that every board has */
778 dove_rtc_init();
779 dove_xor0_init();
780 dove_xor1_init();
781}
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
new file mode 100644
index 000000000000..b29e8937de4f
--- /dev/null
+++ b/arch/arm/mach-dove/common.h
@@ -0,0 +1,40 @@
1/*
2 * arch/arm/mach-dove/common.h
3 *
4 * Core functions for Marvell Dove 88AP510 System On Chip
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ARCH_DOVE_COMMON_H
12#define __ARCH_DOVE_COMMON_H
13
14struct mv643xx_eth_platform_data;
15struct mv_sata_platform_data;
16
17extern struct sys_timer dove_timer;
18extern struct mbus_dram_target_info dove_mbus_dram_info;
19
20/*
21 * Basic Dove init functions used early by machine-setup.
22 */
23void dove_map_io(void);
24void dove_init(void);
25void dove_init_irq(void);
26void dove_setup_cpu_mbus(void);
27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
28void dove_sata_init(struct mv_sata_platform_data *sata_data);
29void dove_pcie_init(int init_port0, int init_port1);
30void dove_ehci0_init(void);
31void dove_ehci1_init(void);
32void dove_uart0_init(void);
33void dove_uart1_init(void);
34void dove_uart2_init(void);
35void dove_uart3_init(void);
36void dove_spi0_init(void);
37void dove_spi1_init(void);
38void dove_i2c_init(void);
39
40#endif
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
new file mode 100644
index 000000000000..f2971b745224
--- /dev/null
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -0,0 +1,102 @@
1/*
2 * arch/arm/mach-dove/dove-db-setup.c
3 *
4 * Marvell DB-MV88AP510-BP Development Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/irq.h>
15#include <linux/mtd/physmap.h>
16#include <linux/mtd/nand.h>
17#include <linux/timer.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/i2c.h>
21#include <linux/pci.h>
22#include <linux/spi/spi.h>
23#include <linux/spi/orion_spi.h>
24#include <linux/spi/flash.h>
25#include <linux/gpio.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <mach/dove.h>
29#include "common.h"
30
31static struct mv643xx_eth_platform_data dove_db_ge00_data = {
32 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
33};
34
35static struct mv_sata_platform_data dove_db_sata_data = {
36 .n_ports = 1,
37};
38
39/*****************************************************************************
40 * SPI Devices:
41 * SPI0: 4M Flash ST-M25P32-VMF6P
42 ****************************************************************************/
43static const struct flash_platform_data dove_db_spi_flash_data = {
44 .type = "m25p64",
45};
46
47static struct spi_board_info __initdata dove_db_spi_flash_info[] = {
48 {
49 .modalias = "m25p80",
50 .platform_data = &dove_db_spi_flash_data,
51 .irq = -1,
52 .max_speed_hz = 20000000,
53 .bus_num = 0,
54 .chip_select = 0,
55 },
56};
57
58/*****************************************************************************
59 * PCI
60 ****************************************************************************/
61static int __init dove_db_pci_init(void)
62{
63 if (machine_is_dove_db())
64 dove_pcie_init(1, 1);
65
66 return 0;
67}
68
69subsys_initcall(dove_db_pci_init);
70
71/*****************************************************************************
72 * Board Init
73 ****************************************************************************/
74static void __init dove_db_init(void)
75{
76 /*
77 * Basic Dove setup. Needs to be called early.
78 */
79 dove_init();
80
81 dove_ge00_init(&dove_db_ge00_data);
82 dove_ehci0_init();
83 dove_ehci1_init();
84 dove_sata_init(&dove_db_sata_data);
85 dove_spi0_init();
86 dove_spi1_init();
87 dove_uart0_init();
88 dove_uart1_init();
89 dove_i2c_init();
90 spi_register_board_info(dove_db_spi_flash_info,
91 ARRAY_SIZE(dove_db_spi_flash_info));
92}
93
94MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
95 .phys_io = DOVE_SB_REGS_PHYS_BASE,
96 .io_pg_offst = ((DOVE_SB_REGS_VIRT_BASE) >> 18) & 0xfffc,
97 .boot_params = 0x00000100,
98 .init_machine = dove_db_init,
99 .map_io = dove_map_io,
100 .init_irq = dove_init_irq,
101 .timer = &dove_timer,
102MACHINE_END
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
new file mode 100644
index 000000000000..214a4c31f069
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -0,0 +1,58 @@
1/*
2 * arch/arm/mach-dove/include/mach/bridge-regs.h
3 *
4 * Mbus-L to Mbus Bridge Registers
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_BRIDGE_REGS_H
12#define __ASM_ARCH_BRIDGE_REGS_H
13
14#include <mach/dove.h>
15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0000)
17
18#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104)
19#define CPU_CTRL_PCIE0_LINK 0x00000001
20#define CPU_RESET 0x00000002
21#define CPU_CTRL_PCIE1_LINK 0x00000008
22
23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108)
24#define SOFT_RESET_OUT_EN 0x00000004
25
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
27#define SOFT_RESET 0x00000001
28
29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
30#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
31#define BRIDGE_INT_TIMER0 0x0002
32#define BRIDGE_INT_TIMER1 0x0004
33#define BRIDGE_INT_TIMER1_CLR (~0x0004)
34
35#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
36#define IRQ_CAUSE_LOW_OFF 0x0000
37#define IRQ_MASK_LOW_OFF 0x0004
38#define FIQ_MASK_LOW_OFF 0x0008
39#define ENDPOINT_MASK_LOW_OFF 0x000c
40#define IRQ_CAUSE_HIGH_OFF 0x0010
41#define IRQ_MASK_HIGH_OFF 0x0014
42#define FIQ_MASK_HIGH_OFF 0x0018
43#define ENDPOINT_MASK_HIGH_OFF 0x001c
44#define PCIE_INTERRUPT_MASK_OFF 0x0020
45
46#define IRQ_MASK_LOW (IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)
47#define FIQ_MASK_LOW (IRQ_VIRT_BASE + FIQ_MASK_LOW_OFF)
48#define ENDPOINT_MASK_LOW (IRQ_VIRT_BASE + ENDPOINT_MASK_LOW_OFF)
49#define IRQ_MASK_HIGH (IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)
50#define FIQ_MASK_HIGH (IRQ_VIRT_BASE + FIQ_MASK_HIGH_OFF)
51#define ENDPOINT_MASK_HIGH (IRQ_VIRT_BASE + ENDPOINT_MASK_HIGH_OFF)
52#define PCIE_INTERRUPT_MASK (IRQ_VIRT_BASE + PCIE_INTERRUPT_MASK_OFF)
53
54#define POWER_MANAGEMENT (BRIDGE_VIRT_BASE | 0x011c)
55
56#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300)
57
58#endif
diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S
new file mode 100644
index 000000000000..9b89ec7d3040
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/debug-macro.S
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-dove/include/mach/debug-macro.S
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7*/
8
9#include <mach/bridge-regs.h>
10
11 .macro addruart,rx
12 mrc p15, 0, \rx, c1, c0
13 tst \rx, #1 @ MMU enabled?
14 ldreq \rx, =DOVE_SB_REGS_PHYS_BASE
15 ldrne \rx, =DOVE_SB_REGS_VIRT_BASE
16 orr \rx, \rx, #0x00012000
17 .endm
18
19#define UART_SHIFT 2
20#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
new file mode 100644
index 000000000000..f6a08397f046
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -0,0 +1,180 @@
1/*
2 * arch/arm/mach-dove/include/mach/dove.h
3 *
4 * Generic definitions for Marvell Dove 88AP510 SoC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_DOVE_H
12#define __ASM_ARCH_DOVE_H
13
14#include <mach/vmalloc.h>
15
16/*
17 * Marvell Dove address maps.
18 *
19 * phys virt size
20 * c8000000 fdb00000 1M Cryptographic SRAM
21 * e0000000 @runtime 128M PCIe-0 Memory space
22 * e8000000 @runtime 128M PCIe-1 Memory space
23 * f1000000 fde00000 8M on-chip south-bridge registers
24 * f1800000 fe600000 8M on-chip north-bridge registers
25 * f2000000 fee00000 1M PCIe-0 I/O space
26 * f2100000 fef00000 1M PCIe-1 I/O space
27 */
28
29#define DOVE_CESA_PHYS_BASE 0xc8000000
30#define DOVE_CESA_VIRT_BASE 0xfdb00000
31#define DOVE_CESA_SIZE SZ_1M
32
33#define DOVE_PCIE0_MEM_PHYS_BASE 0xe0000000
34#define DOVE_PCIE0_MEM_SIZE SZ_128M
35
36#define DOVE_PCIE1_MEM_PHYS_BASE 0xe8000000
37#define DOVE_PCIE1_MEM_SIZE SZ_128M
38
39#define DOVE_BOOTROM_PHYS_BASE 0xf8000000
40#define DOVE_BOOTROM_SIZE SZ_128M
41
42#define DOVE_SCRATCHPAD_PHYS_BASE 0xf0000000
43#define DOVE_SCRATCHPAD_VIRT_BASE 0xfdd00000
44#define DOVE_SCRATCHPAD_SIZE SZ_1M
45
46#define DOVE_SB_REGS_PHYS_BASE 0xf1000000
47#define DOVE_SB_REGS_VIRT_BASE 0xfde00000
48#define DOVE_SB_REGS_SIZE SZ_8M
49
50#define DOVE_NB_REGS_PHYS_BASE 0xf1800000
51#define DOVE_NB_REGS_VIRT_BASE 0xfe600000
52#define DOVE_NB_REGS_SIZE SZ_8M
53
54#define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000
55#define DOVE_PCIE0_IO_VIRT_BASE 0xfee00000
56#define DOVE_PCIE0_IO_BUS_BASE 0x00000000
57#define DOVE_PCIE0_IO_SIZE SZ_1M
58
59#define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000
60#define DOVE_PCIE1_IO_VIRT_BASE 0xfef00000
61#define DOVE_PCIE1_IO_BUS_BASE 0x00100000
62#define DOVE_PCIE1_IO_SIZE SZ_1M
63
64/*
65 * Dove Core Registers Map
66 */
67
68/* SPI, I2C, UART */
69#define DOVE_I2C_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x11000)
70#define DOVE_UART0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12000)
71#define DOVE_UART0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12000)
72#define DOVE_UART1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12100)
73#define DOVE_UART1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12100)
74#define DOVE_UART2_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12200)
75#define DOVE_UART2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12200)
76#define DOVE_UART3_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x12300)
77#define DOVE_UART3_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x12300)
78#define DOVE_SPI0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x10600)
79#define DOVE_SPI1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x14600)
80
81/* North-South Bridge */
82#define BRIDGE_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x20000)
83
84/* Cryptographic Engine */
85#define DOVE_CRYPT_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x30000)
86
87/* PCIe 0 */
88#define DOVE_PCIE0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x40000)
89
90/* USB */
91#define DOVE_USB0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x50000)
92#define DOVE_USB1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x51000)
93
94/* XOR 0 Engine */
95#define DOVE_XOR0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60800)
96#define DOVE_XOR0_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60800)
97#define DOVE_XOR0_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60A00)
98#define DOVE_XOR0_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60A00)
99
100/* XOR 1 Engine */
101#define DOVE_XOR1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60900)
102#define DOVE_XOR1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60900)
103#define DOVE_XOR1_HIGH_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x60B00)
104#define DOVE_XOR1_HIGH_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x60B00)
105
106/* Gigabit Ethernet */
107#define DOVE_GE00_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x70000)
108
109/* PCIe 1 */
110#define DOVE_PCIE1_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0x80000)
111
112/* CAFE */
113#define DOVE_SDIO0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x92000)
114#define DOVE_SDIO1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x90000)
115#define DOVE_CAM_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x94000)
116#define DOVE_CAFE_WIN_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0x98000)
117
118/* SATA */
119#define DOVE_SATA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xa0000)
120
121/* I2S/SPDIF */
122#define DOVE_AUD0_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb0000)
123#define DOVE_AUD1_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xb4000)
124
125/* NAND Flash Controller */
126#define DOVE_NFC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xc0000)
127
128/* MPP, GPIO, Reset Sampling */
129#define DOVE_MPP_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0200)
130#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
131#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014)
132#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018)
133#define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400)
134#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c)
135#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1)
136#define DOVE_NAND_GPIO_EN (1 << 0)
137#define DOVE_MPP_CTRL4_VIRT_BASE (DOVE_GPIO_VIRT_BASE + 0x40)
138
139
140/* Power Management */
141#define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0000)
142
143/* Real Time Clock */
144#define DOVE_RTC_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xd8500)
145
146/* AC97 */
147#define DOVE_AC97_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe0000)
148#define DOVE_AC97_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe0000)
149
150/* Peripheral DMA */
151#define DOVE_PDMA_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xe4000)
152#define DOVE_PDMA_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe4000)
153
154#define DOVE_GLOBAL_CONFIG_1 (DOVE_SB_REGS_VIRT_BASE | 0xe802C)
155#define DOVE_TWSI_ENABLE_OPTION1 (1 << 7)
156#define DOVE_GLOBAL_CONFIG_2 (DOVE_SB_REGS_VIRT_BASE | 0xe8030)
157#define DOVE_TWSI_ENABLE_OPTION2 (1 << 20)
158#define DOVE_TWSI_ENABLE_OPTION3 (1 << 21)
159#define DOVE_TWSI_OPTION3_GPIO (1 << 22)
160#define DOVE_SSP_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE | 0xec000)
161#define DOVE_SSP_CTRL_STATUS_1 (DOVE_SB_REGS_VIRT_BASE | 0xe8034)
162#define DOVE_SSP_ON_AU1 (1 << 0)
163#define DOVE_SSP_CLOCK_ENABLE (1 << 1)
164#define DOVE_SSP_BPB_CLOCK_SRC_SSP (1 << 11)
165/* Memory Controller */
166#define DOVE_MC_VIRT_BASE (DOVE_NB_REGS_VIRT_BASE | 0x00000)
167
168/* LCD Controller */
169#define DOVE_LCD_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000)
170#define DOVE_LCD1_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x20000)
171#define DOVE_LCD2_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x10000)
172#define DOVE_LCD_DCON_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x30000)
173
174/* Graphic Engine */
175#define DOVE_GPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x40000)
176
177/* Video Engine */
178#define DOVE_VPU_PHYS_BASE (DOVE_NB_REGS_PHYS_BASE | 0x400000)
179
180#endif
diff --git a/arch/arm/mach-dove/include/mach/entry-macro.S b/arch/arm/mach-dove/include/mach/entry-macro.S
new file mode 100644
index 000000000000..e84c78c2a8b7
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * arch/arm/mach-dove/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Marvell Dove platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <mach/bridge-regs.h>
12
13 .macro disable_fiq
14 .endm
15
16 .macro arch_ret_to_user, tmp1, tmp2
17 .endm
18
19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =IRQ_VIRT_BASE
21 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 @ check low interrupts
25 ldr \irqstat, [\base, #IRQ_CAUSE_LOW_OFF]
26 ldr \tmp, [\base, #IRQ_MASK_LOW_OFF]
27 mov \irqnr, #31
28 ands \irqstat, \irqstat, \tmp
29
30 @ if no low interrupts set, check high interrupts
31 ldreq \irqstat, [\base, #IRQ_CAUSE_HIGH_OFF]
32 ldreq \tmp, [\base, #IRQ_MASK_HIGH_OFF]
33 moveq \irqnr, #63
34 andeqs \irqstat, \irqstat, \tmp
35
36 @ find first active interrupt source
37 clzne \irqstat, \irqstat
38 subne \irqnr, \irqnr, \irqstat
39 .endm
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h
new file mode 100644
index 000000000000..0ee70ff39e11
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/gpio.h
@@ -0,0 +1,49 @@
1/*
2 * arch/arm/mach-dove/include/mach/gpio.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <asm/errno.h>
13#include <mach/irqs.h>
14#include <plat/gpio.h>
15#include <asm-generic/gpio.h> /* cansleep wrappers */
16
17#define GPIO_MAX 64
18
19#define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00)
20#define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20)
21
22#define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : GPIO_BASE_HI)
23
24#define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00)
25#define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04)
26#define GPIO_BLINK_EN(pin) (GPIO_BASE(pin) + 0x08)
27#define GPIO_IN_POL(pin) (GPIO_BASE(pin) + 0x0c)
28#define GPIO_DATA_IN(pin) (GPIO_BASE(pin) + 0x10)
29#define GPIO_EDGE_CAUSE(pin) (GPIO_BASE(pin) + 0x14)
30#define GPIO_EDGE_MASK(pin) (GPIO_BASE(pin) + 0x18)
31#define GPIO_LEVEL_MASK(pin) (GPIO_BASE(pin) + 0x1c)
32
33static inline int gpio_to_irq(int pin)
34{
35 if (pin < NR_GPIO_IRQS)
36 return pin + IRQ_DOVE_GPIO_START;
37
38 return -EINVAL;
39}
40
41static inline int irq_to_gpio(int irq)
42{
43 if (IRQ_DOVE_GPIO_START < irq && irq < NR_IRQS)
44 return irq - IRQ_DOVE_GPIO_START;
45
46 return -EINVAL;
47}
48
49#endif
diff --git a/arch/arm/mach-dove/include/mach/hardware.h b/arch/arm/mach-dove/include/mach/hardware.h
new file mode 100644
index 000000000000..32b0826e7873
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/hardware.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/mach-dove/include/mach/hardware.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_HARDWARE_H
10#define __ASM_ARCH_HARDWARE_H
11
12#include "dove.h"
13
14#define pcibios_assign_all_busses() 1
15
16#define PCIBIOS_MIN_IO 0x1000
17#define PCIBIOS_MIN_MEM 0x01000000
18#define PCIMEM_BASE DOVE_PCIE0_MEM_PHYS_BASE
19
20
21/* Macros below are required for compatibility with PXA AC'97 driver. */
22#define __REG(x) (*((volatile u32 *)((x) - DOVE_SB_REGS_PHYS_BASE + \
23 DOVE_SB_REGS_VIRT_BASE)))
24#define __PREG(x) (((u32)&(x)) - DOVE_SB_REGS_VIRT_BASE + \
25 DOVE_SB_REGS_PHYS_BASE)
26#endif
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h
new file mode 100644
index 000000000000..3b3e4721ce2e
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/io.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-dove/include/mach/io.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_IO_H
10#define __ASM_ARCH_IO_H
11
12#include "dove.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16#define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
17 DOVE_PCIE0_IO_VIRT_BASE))
18#define __mem_pci(a) (a)
19
20#endif
diff --git a/arch/arm/mach-dove/include/mach/irqs.h b/arch/arm/mach-dove/include/mach/irqs.h
new file mode 100644
index 000000000000..46681466f92b
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/irqs.h
@@ -0,0 +1,101 @@
1/*
2 * arch/arm/mach-dove/include/mach/irqs.h
3 *
4 * IRQ definitions for Marvell Dove 88AP510 SoC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H
13
14/*
15 * Dove Low Interrupt Controller
16 */
17#define IRQ_DOVE_BRIDGE 0
18#define IRQ_DOVE_H2C 1
19#define IRQ_DOVE_C2H 2
20#define IRQ_DOVE_NAND 3
21#define IRQ_DOVE_PDMA 4
22#define IRQ_DOVE_SPI1 5
23#define IRQ_DOVE_SPI0 6
24#define IRQ_DOVE_UART_0 7
25#define IRQ_DOVE_UART_1 8
26#define IRQ_DOVE_UART_2 9
27#define IRQ_DOVE_UART_3 10
28#define IRQ_DOVE_I2C 11
29#define IRQ_DOVE_GPIO_0_7 12
30#define IRQ_DOVE_GPIO_8_15 13
31#define IRQ_DOVE_GPIO_16_23 14
32#define IRQ_DOVE_PCIE0_ERR 15
33#define IRQ_DOVE_PCIE0 16
34#define IRQ_DOVE_PCIE1_ERR 17
35#define IRQ_DOVE_PCIE1 18
36#define IRQ_DOVE_I2S0 19
37#define IRQ_DOVE_I2S0_ERR 20
38#define IRQ_DOVE_I2S1 21
39#define IRQ_DOVE_I2S1_ERR 22
40#define IRQ_DOVE_USB_ERR 23
41#define IRQ_DOVE_USB0 24
42#define IRQ_DOVE_USB1 25
43#define IRQ_DOVE_GE00_RX 26
44#define IRQ_DOVE_GE00_TX 27
45#define IRQ_DOVE_GE00_MISC 28
46#define IRQ_DOVE_GE00_SUM 29
47#define IRQ_DOVE_GE00_ERR 30
48#define IRQ_DOVE_CRYPTO 31
49
50/*
51 * Dove High Interrupt Controller
52 */
53#define IRQ_DOVE_AC97 32
54#define IRQ_DOVE_PMU 33
55#define IRQ_DOVE_CAM 34
56#define IRQ_DOVE_SDIO0 35
57#define IRQ_DOVE_SDIO1 36
58#define IRQ_DOVE_SDIO0_WAKEUP 37
59#define IRQ_DOVE_SDIO1_WAKEUP 38
60#define IRQ_DOVE_XOR_00 39
61#define IRQ_DOVE_XOR_01 40
62#define IRQ_DOVE_XOR0_ERR 41
63#define IRQ_DOVE_XOR_10 42
64#define IRQ_DOVE_XOR_11 43
65#define IRQ_DOVE_XOR1_ERR 44
66#define IRQ_DOVE_LCD_DCON 45
67#define IRQ_DOVE_LCD1 46
68#define IRQ_DOVE_LCD0 47
69#define IRQ_DOVE_GPU 48
70#define IRQ_DOVE_PERFORM_MNTR 49
71#define IRQ_DOVE_VPRO_DMA1 51
72#define IRQ_DOVE_SSP_TIMER 54
73#define IRQ_DOVE_SSP 55
74#define IRQ_DOVE_MC_L2_ERR 56
75#define IRQ_DOVE_CRYPTO_ERR 59
76#define IRQ_DOVE_GPIO_24_31 60
77#define IRQ_DOVE_HIGH_GPIO 61
78#define IRQ_DOVE_SATA 62
79
80/*
81 * DOVE General Purpose Pins
82 */
83#define IRQ_DOVE_GPIO_START 64
84#define NR_GPIO_IRQS 64
85
86/*
87 * PMU interrupts
88 */
89#define IRQ_DOVE_PMU_START (IRQ_DOVE_GPIO_START + NR_GPIO_IRQS)
90#define NR_PMU_IRQS 7
91#define IRQ_DOVE_RTC (IRQ_DOVE_PMU_START + 5)
92
93#define NR_IRQS (IRQ_DOVE_PMU_START + NR_PMU_IRQS)
94
95/* Required for compatability with PXA AC97 driver. */
96#define IRQ_AC97 IRQ_DOVE_AC97
97/* Required for compatability with PXA DMA driver. */
98#define IRQ_DMA IRQ_DOVE_PDMA
99/* Required for compatability with PXA NAND driver */
100#define IRQ_NAND IRQ_DOVE_NAND
101#endif
diff --git a/arch/arm/mach-dove/include/mach/memory.h b/arch/arm/mach-dove/include/mach/memory.h
new file mode 100644
index 000000000000..d66872074946
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/memory.h
@@ -0,0 +1,10 @@
1/*
2 * arch/arm/mach-dove/include/mach/memory.h
3 */
4
5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H
7
8#define PHYS_OFFSET UL(0x00000000)
9
10#endif
diff --git a/arch/arm/mach-dove/include/mach/pm.h b/arch/arm/mach-dove/include/mach/pm.h
new file mode 100644
index 000000000000..3ad9f946a9e8
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/pm.h
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/mach-dove/include/mach/pm.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_PM_H
10#define __ASM_ARCH_PM_H
11
12#include <asm/errno.h>
13#include <mach/irqs.h>
14
15#define CLOCK_GATING_CONTROL (DOVE_PMU_VIRT_BASE + 0x38)
16#define CLOCK_GATING_USB0_MASK (1 << 0)
17#define CLOCK_GATING_USB1_MASK (1 << 1)
18#define CLOCK_GATING_GBE_MASK (1 << 2)
19#define CLOCK_GATING_SATA_MASK (1 << 3)
20#define CLOCK_GATING_PCIE0_MASK (1 << 4)
21#define CLOCK_GATING_PCIE1_MASK (1 << 5)
22#define CLOCK_GATING_SDIO0_MASK (1 << 8)
23#define CLOCK_GATING_SDIO1_MASK (1 << 9)
24#define CLOCK_GATING_NAND_MASK (1 << 10)
25#define CLOCK_GATING_CAMERA_MASK (1 << 11)
26#define CLOCK_GATING_I2S0_MASK (1 << 12)
27#define CLOCK_GATING_I2S1_MASK (1 << 13)
28#define CLOCK_GATING_CRYPTO_MASK (1 << 15)
29#define CLOCK_GATING_AC97_MASK (1 << 21)
30#define CLOCK_GATING_PDMA_MASK (1 << 22)
31#define CLOCK_GATING_XOR0_MASK (1 << 23)
32#define CLOCK_GATING_XOR1_MASK (1 << 24)
33#define CLOCK_GATING_GIGA_PHY_MASK (1 << 30)
34
35#define PMU_INTERRUPT_CAUSE (DOVE_PMU_VIRT_BASE + 0x50)
36#define PMU_INTERRUPT_MASK (DOVE_PMU_VIRT_BASE + 0x54)
37
38static inline int pmu_to_irq(int pin)
39{
40 if (pin < NR_PMU_IRQS)
41 return pin + IRQ_DOVE_PMU_START;
42
43 return -EINVAL;
44}
45
46static inline int irq_to_pmu(int irq)
47{
48 if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS)
49 return irq - IRQ_DOVE_PMU_START;
50
51 return -EINVAL;
52}
53
54#endif
diff --git a/arch/arm/mach-dove/include/mach/system.h b/arch/arm/mach-dove/include/mach/system.h
new file mode 100644
index 000000000000..356afda56853
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/system.h
@@ -0,0 +1,36 @@
1/*
2 * arch/arm/mach-dove/include/mach/system.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#ifndef __ASM_ARCH_SYSTEM_H
10#define __ASM_ARCH_SYSTEM_H
11
12#include <mach/bridge-regs.h>
13
14static inline void arch_idle(void)
15{
16 cpu_do_idle();
17}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 /*
22 * Enable soft reset to assert RSTOUTn.
23 */
24 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
25
26 /*
27 * Assert soft reset.
28 */
29 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
30
31 while (1)
32 ;
33}
34
35
36#endif
diff --git a/arch/arm/mach-dove/include/mach/timex.h b/arch/arm/mach-dove/include/mach/timex.h
new file mode 100644
index 000000000000..251d538541db
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/timex.h
@@ -0,0 +1,9 @@
1/*
2 * arch/arm/mach-dove/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
new file mode 100644
index 000000000000..2c5cdd7a3eed
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -0,0 +1,37 @@
1/*
2 * arch/arm/mach-dove/include/mach/uncompress.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#include <mach/dove.h>
10
11#define UART_THR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x0))
12#define UART_LSR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x14))
13
14#define LSR_THRE 0x20
15
16static void putc(const char c)
17{
18 int i;
19
20 for (i = 0; i < 0x1000; i++) {
21 /* Transmit fifo not full? */
22 if (*UART_LSR & LSR_THRE)
23 break;
24 }
25
26 *UART_THR = c;
27}
28
29static void flush(void)
30{
31}
32
33/*
34 * nothing to do
35 */
36#define arch_decomp_setup()
37#define arch_decomp_wdog()
diff --git a/arch/arm/mach-dove/include/mach/vmalloc.h b/arch/arm/mach-dove/include/mach/vmalloc.h
new file mode 100644
index 000000000000..8b2c974755c6
--- /dev/null
+++ b/arch/arm/mach-dove/include/mach/vmalloc.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-dove/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfd800000
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
new file mode 100644
index 000000000000..61bfcb3b08c2
--- /dev/null
+++ b/arch/arm/mach-dove/irq.c
@@ -0,0 +1,133 @@
1/*
2 * arch/arm/mach-dove/irq.c
3 *
4 * Dove IRQ handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/gpio.h>
15#include <linux/io.h>
16#include <asm/mach/arch.h>
17#include <plat/irq.h>
18#include <asm/mach/irq.h>
19#include <mach/pm.h>
20#include <mach/bridge-regs.h>
21#include "common.h"
22
23static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
24{
25 int irqoff;
26 BUG_ON(irq < IRQ_DOVE_GPIO_0_7 || irq > IRQ_DOVE_HIGH_GPIO);
27
28 irqoff = irq <= IRQ_DOVE_GPIO_16_23 ? irq - IRQ_DOVE_GPIO_0_7 :
29 3 + irq - IRQ_DOVE_GPIO_24_31;
30
31 orion_gpio_irq_handler(irqoff << 3);
32 if (irq == IRQ_DOVE_HIGH_GPIO) {
33 orion_gpio_irq_handler(40);
34 orion_gpio_irq_handler(48);
35 orion_gpio_irq_handler(56);
36 }
37}
38
39static void pmu_irq_mask(unsigned int irq)
40{
41 int pin = irq_to_pmu(irq);
42 u32 u;
43
44 u = readl(PMU_INTERRUPT_MASK);
45 u &= ~(1 << (pin & 31));
46 writel(u, PMU_INTERRUPT_MASK);
47}
48
49static void pmu_irq_unmask(unsigned int irq)
50{
51 int pin = irq_to_pmu(irq);
52 u32 u;
53
54 u = readl(PMU_INTERRUPT_MASK);
55 u |= 1 << (pin & 31);
56 writel(u, PMU_INTERRUPT_MASK);
57}
58
59static void pmu_irq_ack(unsigned int irq)
60{
61 int pin = irq_to_pmu(irq);
62 u32 u;
63
64 u = ~(1 << (pin & 31));
65 writel(u, PMU_INTERRUPT_CAUSE);
66}
67
68static struct irq_chip pmu_irq_chip = {
69 .name = "pmu_irq",
70 .mask = pmu_irq_mask,
71 .unmask = pmu_irq_unmask,
72 .ack = pmu_irq_ack,
73};
74
75static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
76{
77 unsigned long cause = readl(PMU_INTERRUPT_CAUSE);
78
79 cause &= readl(PMU_INTERRUPT_MASK);
80 if (cause == 0) {
81 do_bad_IRQ(irq, desc);
82 return;
83 }
84
85 for (irq = 0; irq < NR_PMU_IRQS; irq++) {
86 if (!(cause & (1 << irq)))
87 continue;
88 irq = pmu_to_irq(irq);
89 desc = irq_desc + irq;
90 desc_handle_irq(irq, desc);
91 }
92}
93
94void __init dove_init_irq(void)
95{
96 int i;
97
98 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
99 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
100
101 /*
102 * Mask and clear GPIO IRQ interrupts.
103 */
104 writel(0, GPIO_LEVEL_MASK(0));
105 writel(0, GPIO_EDGE_MASK(0));
106 writel(0, GPIO_EDGE_CAUSE(0));
107
108 /*
109 * Mask and clear PMU interrupts
110 */
111 writel(0, PMU_INTERRUPT_MASK);
112 writel(0, PMU_INTERRUPT_CAUSE);
113
114 for (i = IRQ_DOVE_GPIO_START; i < IRQ_DOVE_PMU_START; i++) {
115 set_irq_chip(i, &orion_gpio_irq_chip);
116 set_irq_handler(i, handle_level_irq);
117 irq_desc[i].status |= IRQ_LEVEL;
118 set_irq_flags(i, IRQF_VALID);
119 }
120 set_irq_chained_handler(IRQ_DOVE_GPIO_0_7, gpio_irq_handler);
121 set_irq_chained_handler(IRQ_DOVE_GPIO_8_15, gpio_irq_handler);
122 set_irq_chained_handler(IRQ_DOVE_GPIO_16_23, gpio_irq_handler);
123 set_irq_chained_handler(IRQ_DOVE_GPIO_24_31, gpio_irq_handler);
124 set_irq_chained_handler(IRQ_DOVE_HIGH_GPIO, gpio_irq_handler);
125
126 for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
127 set_irq_chip(i, &pmu_irq_chip);
128 set_irq_handler(i, handle_level_irq);
129 irq_desc[i].status |= IRQ_LEVEL;
130 set_irq_flags(i, IRQF_VALID);
131 }
132 set_irq_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler);
133}
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c
new file mode 100644
index 000000000000..502d1ca2f4b7
--- /dev/null
+++ b/arch/arm/mach-dove/pcie.c
@@ -0,0 +1,238 @@
1/*
2 * arch/arm/mach-dove/pcie.c
3 *
4 * PCIe functions for Marvell Dove 88AP510 SoC
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/mbus.h>
14#include <asm/mach/pci.h>
15#include <asm/mach/arch.h>
16#include <asm/setup.h>
17#include <asm/delay.h>
18#include <plat/pcie.h>
19#include <mach/irqs.h>
20#include <mach/bridge-regs.h>
21#include "common.h"
22
23struct pcie_port {
24 u8 index;
25 u8 root_bus_nr;
26 void __iomem *base;
27 spinlock_t conf_lock;
28 char io_space_name[16];
29 char mem_space_name[16];
30 struct resource res[2];
31};
32
33static struct pcie_port pcie_port[2];
34static int num_pcie_ports;
35
36
37static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
38{
39 struct pcie_port *pp;
40
41 if (nr >= num_pcie_ports)
42 return 0;
43
44 pp = &pcie_port[nr];
45 pp->root_bus_nr = sys->busnr;
46
47 /*
48 * Generic PCIe unit setup.
49 */
50 orion_pcie_set_local_bus_nr(pp->base, sys->busnr);
51
52 orion_pcie_setup(pp->base, &dove_mbus_dram_info);
53
54 /*
55 * IORESOURCE_IO
56 */
57 snprintf(pp->io_space_name, sizeof(pp->io_space_name),
58 "PCIe %d I/O", pp->index);
59 pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
60 pp->res[0].name = pp->io_space_name;
61 if (pp->index == 0) {
62 pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE;
63 pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1;
64 } else {
65 pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE;
66 pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1;
67 }
68 pp->res[0].flags = IORESOURCE_IO;
69 if (request_resource(&ioport_resource, &pp->res[0]))
70 panic("Request PCIe IO resource failed\n");
71 sys->resource[0] = &pp->res[0];
72
73 /*
74 * IORESOURCE_MEM
75 */
76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
77 "PCIe %d MEM", pp->index);
78 pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0;
79 pp->res[1].name = pp->mem_space_name;
80 if (pp->index == 0) {
81 pp->res[1].start = DOVE_PCIE0_MEM_PHYS_BASE;
82 pp->res[1].end = pp->res[1].start + DOVE_PCIE0_MEM_SIZE - 1;
83 } else {
84 pp->res[1].start = DOVE_PCIE1_MEM_PHYS_BASE;
85 pp->res[1].end = pp->res[1].start + DOVE_PCIE1_MEM_SIZE - 1;
86 }
87 pp->res[1].flags = IORESOURCE_MEM;
88 if (request_resource(&iomem_resource, &pp->res[1]))
89 panic("Request PCIe Memory resource failed\n");
90 sys->resource[1] = &pp->res[1];
91
92 sys->resource[2] = NULL;
93
94 return 1;
95}
96
97static struct pcie_port *bus_to_port(int bus)
98{
99 int i;
100
101 for (i = num_pcie_ports - 1; i >= 0; i--) {
102 int rbus = pcie_port[i].root_bus_nr;
103 if (rbus != -1 && rbus <= bus)
104 break;
105 }
106
107 return i >= 0 ? pcie_port + i : NULL;
108}
109
110static int pcie_valid_config(struct pcie_port *pp, int bus, int dev)
111{
112 /*
113 * Don't go out when trying to access nonexisting devices
114 * on the local bus.
115 */
116 if (bus == pp->root_bus_nr && dev > 1)
117 return 0;
118
119 return 1;
120}
121
122static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
123 int size, u32 *val)
124{
125 struct pcie_port *pp = bus_to_port(bus->number);
126 unsigned long flags;
127 int ret;
128
129 if (pcie_valid_config(pp, bus->number, PCI_SLOT(devfn)) == 0) {
130 *val = 0xffffffff;
131 return PCIBIOS_DEVICE_NOT_FOUND;
132 }
133
134 spin_lock_irqsave(&pp->conf_lock, flags);
135 ret = orion_pcie_rd_conf(pp->base, bus, devfn, where, size, val);
136 spin_unlock_irqrestore(&pp->conf_lock, flags);
137
138 return ret;
139}
140
141static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
142 int where, int size, u32 val)
143{
144 struct pcie_port *pp = bus_to_port(bus->number);
145 unsigned long flags;
146 int ret;
147
148 if (pcie_valid_config(pp, bus->number, PCI_SLOT(devfn)) == 0)
149 return PCIBIOS_DEVICE_NOT_FOUND;
150
151 spin_lock_irqsave(&pp->conf_lock, flags);
152 ret = orion_pcie_wr_conf(pp->base, bus, devfn, where, size, val);
153 spin_unlock_irqrestore(&pp->conf_lock, flags);
154
155 return ret;
156}
157
158static struct pci_ops pcie_ops = {
159 .read = pcie_rd_conf,
160 .write = pcie_wr_conf,
161};
162
163static void __devinit rc_pci_fixup(struct pci_dev *dev)
164{
165 /*
166 * Prevent enumeration of root complex.
167 */
168 if (dev->bus->parent == NULL && dev->devfn == 0) {
169 int i;
170
171 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
172 dev->resource[i].start = 0;
173 dev->resource[i].end = 0;
174 dev->resource[i].flags = 0;
175 }
176 }
177}
178DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
179
180static struct pci_bus __init *
181dove_pcie_scan_bus(int nr, struct pci_sys_data *sys)
182{
183 struct pci_bus *bus;
184
185 if (nr < num_pcie_ports) {
186 bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
187 } else {
188 bus = NULL;
189 BUG();
190 }
191
192 return bus;
193}
194
195static int __init dove_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
196{
197 struct pcie_port *pp = bus_to_port(dev->bus->number);
198
199 return pp->index ? IRQ_DOVE_PCIE1 : IRQ_DOVE_PCIE0;
200}
201
202static struct hw_pci dove_pci __initdata = {
203 .nr_controllers = 2,
204 .swizzle = pci_std_swizzle,
205 .setup = dove_pcie_setup,
206 .scan = dove_pcie_scan_bus,
207 .map_irq = dove_pcie_map_irq,
208};
209
210static void __init add_pcie_port(int index, unsigned long base)
211{
212 printk(KERN_INFO "Dove PCIe port %d: ", index);
213
214 if (orion_pcie_link_up((void __iomem *)base)) {
215 struct pcie_port *pp = &pcie_port[num_pcie_ports++];
216
217 printk(KERN_INFO "link up\n");
218
219 pp->index = index;
220 pp->root_bus_nr = -1;
221 pp->base = (void __iomem *)base;
222 spin_lock_init(&pp->conf_lock);
223 memset(pp->res, 0, sizeof(pp->res));
224 } else {
225 printk(KERN_INFO "link down, ignoring\n");
226 }
227}
228
229void __init dove_pcie_init(int init_port0, int init_port1)
230{
231 if (init_port0)
232 add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
233
234 if (init_port1)
235 add_pcie_port(1, DOVE_PCIE1_VIRT_BASE);
236
237 pci_common_init(&dove_pci);
238}
diff --git a/arch/arm/mach-iop13xx/include/mach/time.h b/arch/arm/mach-iop13xx/include/mach/time.h
index d6d52527589d..f1c00d6d560b 100644
--- a/arch/arm/mach-iop13xx/include/mach/time.h
+++ b/arch/arm/mach-iop13xx/include/mach/time.h
@@ -20,7 +20,6 @@
20#define IOP13XX_CORE_FREQ_1200 (5 << 16) 20#define IOP13XX_CORE_FREQ_1200 (5 << 16)
21 21
22void iop_init_time(unsigned long tickrate); 22void iop_init_time(unsigned long tickrate);
23unsigned long iop_gettimeoffset(void);
24 23
25static inline unsigned long iop13xx_core_freq(void) 24static inline unsigned long iop13xx_core_freq(void)
26{ 25{
@@ -66,6 +65,13 @@ static inline unsigned long iop13xx_xsi_bus_ratio(void)
66 return 2; 65 return 2;
67} 66}
68 67
68static inline u32 read_tmr0(void)
69{
70 u32 val;
71 asm volatile("mrc p6, 0, %0, c0, c9, 0" : "=r" (val));
72 return val;
73}
74
69static inline void write_tmr0(u32 val) 75static inline void write_tmr0(u32 val)
70{ 76{
71 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val)); 77 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (val));
@@ -83,6 +89,11 @@ static inline u32 read_tcr0(void)
83 return val; 89 return val;
84} 90}
85 91
92static inline void write_tcr0(u32 val)
93{
94 asm volatile("mcr p6, 0, %0, c2, c9, 0" : : "r" (val));
95}
96
86static inline u32 read_tcr1(void) 97static inline u32 read_tcr1(void)
87{ 98{
88 u32 val; 99 u32 val;
@@ -90,6 +101,11 @@ static inline u32 read_tcr1(void)
90 return val; 101 return val;
91} 102}
92 103
104static inline void write_tcr1(u32 val)
105{
106 asm volatile("mcr p6, 0, %0, c3, c9, 0" : : "r" (val));
107}
108
93static inline void write_trr0(u32 val) 109static inline void write_trr0(u32 val)
94{ 110{
95 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val)); 111 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (val));
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index 5051c03d437c..f91f3154577d 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -87,7 +87,6 @@ static void __init iq81340mc_timer_init(void)
87 87
88static struct sys_timer iq81340mc_timer = { 88static struct sys_timer iq81340mc_timer = {
89 .init = iq81340mc_timer_init, 89 .init = iq81340mc_timer_init,
90 .offset = iop_gettimeoffset,
91}; 90};
92 91
93MACHINE_START(IQ81340MC, "Intel IQ81340MC") 92MACHINE_START(IQ81340MC, "Intel IQ81340MC")
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index bc443073a8e3..ddb7a3435de9 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -89,7 +89,6 @@ static void __init iq81340sc_timer_init(void)
89 89
90static struct sys_timer iq81340sc_timer = { 90static struct sys_timer iq81340sc_timer = {
91 .init = iq81340sc_timer_init, 91 .init = iq81340sc_timer_init,
92 .offset = iop_gettimeoffset,
93}; 92};
94 93
95MACHINE_START(IQ81340SC, "Intel IQ81340SC") 94MACHINE_START(IQ81340SC, "Intel IQ81340SC")
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 3ad4696ade42..2bef9b6e1cc9 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -42,7 +42,6 @@ static void __init em7210_timer_init(void)
42 42
43static struct sys_timer em7210_timer = { 43static struct sys_timer em7210_timer = {
44 .init = em7210_timer_init, 44 .init = em7210_timer_init,
45 .offset = iop_gettimeoffset,
46}; 45};
47 46
48/* 47/*
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index a9c2dfdb2507..93370a46b620 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -47,7 +47,6 @@ static void __init glantank_timer_init(void)
47 47
48static struct sys_timer glantank_timer = { 48static struct sys_timer glantank_timer = {
49 .init = glantank_timer_init, 49 .init = glantank_timer_init,
50 .offset = iop_gettimeoffset,
51}; 50};
52 51
53 52
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index dd1cd9904518..a7a08dda7f33 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -78,7 +78,6 @@ static void __init iq31244_timer_init(void)
78 78
79static struct sys_timer iq31244_timer = { 79static struct sys_timer iq31244_timer = {
80 .init = iq31244_timer_init, 80 .init = iq31244_timer_init,
81 .offset = iop_gettimeoffset,
82}; 81};
83 82
84 83
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index fbe27798759d..0200f80c1e17 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -46,7 +46,6 @@ static void __init iq80321_timer_init(void)
46 46
47static struct sys_timer iq80321_timer = { 47static struct sys_timer iq80321_timer = {
48 .init = iq80321_timer_init, 48 .init = iq80321_timer_init,
49 .offset = iop_gettimeoffset,
50}; 49};
51 50
52 51
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index d2e427899729..2a5c637639bb 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -53,7 +53,6 @@ static void __init n2100_timer_init(void)
53 53
54static struct sys_timer n2100_timer = { 54static struct sys_timer n2100_timer = {
55 .init = n2100_timer_init, 55 .init = n2100_timer_init,
56 .offset = iop_gettimeoffset,
57}; 56};
58 57
59 58
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index d51e10cddf20..394e95a30b75 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -48,7 +48,6 @@ static void __init iq80331_timer_init(void)
48 48
49static struct sys_timer iq80331_timer = { 49static struct sys_timer iq80331_timer = {
50 .init = iq80331_timer_init, 50 .init = iq80331_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 92fb44cdbcad..a40badf126c2 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -48,7 +48,6 @@ static void __init iq80332_timer_init(void)
48 48
49static struct sys_timer iq80332_timer = { 49static struct sys_timer iq80332_timer = {
50 .init = iq80332_timer_init, 50 .init = iq80332_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 0aca451b216d..8bf09ae5b347 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -33,10 +33,18 @@ config MACH_SHEEVAPLUG
33 Marvell SheevaPlug Reference Board. 33 Marvell SheevaPlug Reference Board.
34 34
35config MACH_TS219 35config MACH_TS219
36 bool "QNAP TS-119 and TS-219 Turbo NAS" 36 bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS"
37 help 37 help
38 Say 'Y' here if you want your kernel to support the 38 Say 'Y' here if you want your kernel to support the
39 QNAP TS-119 and TS-219 Turbo NAS devices. 39 QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS
40 devices.
41
42config MACH_TS41X
43 bool "QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS"
44 help
45 Say 'Y' here if you want your kernel to support the
46 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS
47 devices.
40 48
41config MACH_OPENRD_BASE 49config MACH_OPENRD_BASE
42 bool "Marvell OpenRD Base Board" 50 bool "Marvell OpenRD Base Board"
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 80ab0ec90ee1..9f2f67b2b63d 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -5,7 +5,8 @@ obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o 6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_TS219) += ts219-setup.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o 10obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o
10 11
11obj-$(CONFIG_CPU_IDLE) += cpuidle.o 12obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index ec1a64f263d2..2830f0fe80e0 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * QNAP TS-119/TS-219 Turbo NAS Board Setup 3 * QNAP TS-11x/TS-21x Turbo NAS Board Setup
4 * 4 *
5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com> 5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com> 6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
@@ -14,87 +14,17 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h>
18#include <linux/spi/flash.h>
19#include <linux/spi/spi.h>
20#include <linux/spi/orion_spi.h>
21#include <linux/i2c.h> 17#include <linux/i2c.h>
22#include <linux/mv643xx_eth.h> 18#include <linux/mv643xx_eth.h>
23#include <linux/ata_platform.h> 19#include <linux/ata_platform.h>
24#include <linux/gpio_keys.h> 20#include <linux/gpio_keys.h>
25#include <linux/input.h> 21#include <linux/input.h>
26#include <linux/timex.h>
27#include <linux/serial_reg.h>
28#include <linux/pci.h>
29#include <asm/mach-types.h> 22#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
31#include <mach/kirkwood.h> 24#include <mach/kirkwood.h>
32#include "common.h" 25#include "common.h"
33#include "mpp.h" 26#include "mpp.h"
34 27#include "tsx1x-common.h"
35/****************************************************************************
36 * 16 MiB NOR flash. The struct mtd_partition is not in the same order as the
37 * partitions on the device because we want to keep compatability with
38 * the QNAP firmware.
39 * Layout as used by QNAP:
40 * 0x00000000-0x00080000 : "U-Boot"
41 * 0x00200000-0x00400000 : "Kernel"
42 * 0x00400000-0x00d00000 : "RootFS"
43 * 0x00d00000-0x01000000 : "RootFS2"
44 * 0x00080000-0x000c0000 : "U-Boot Config"
45 * 0x000c0000-0x00200000 : "NAS Config"
46 *
47 * We'll use "RootFS1" instead of "RootFS" to stay compatible with the layout
48 * used by the QNAP TS-109/TS-209.
49 *
50 ***************************************************************************/
51
52static struct mtd_partition qnap_ts219_partitions[] = {
53 {
54 .name = "U-Boot",
55 .size = 0x00080000,
56 .offset = 0,
57 .mask_flags = MTD_WRITEABLE,
58 }, {
59 .name = "Kernel",
60 .size = 0x00200000,
61 .offset = 0x00200000,
62 }, {
63 .name = "RootFS1",
64 .size = 0x00900000,
65 .offset = 0x00400000,
66 }, {
67 .name = "RootFS2",
68 .size = 0x00300000,
69 .offset = 0x00d00000,
70 }, {
71 .name = "U-Boot Config",
72 .size = 0x00040000,
73 .offset = 0x00080000,
74 }, {
75 .name = "NAS Config",
76 .size = 0x00140000,
77 .offset = 0x000c0000,
78 },
79};
80
81static const struct flash_platform_data qnap_ts219_flash = {
82 .type = "m25p128",
83 .name = "spi_flash",
84 .parts = qnap_ts219_partitions,
85 .nr_parts = ARRAY_SIZE(qnap_ts219_partitions),
86};
87
88static struct spi_board_info __initdata qnap_ts219_spi_slave_info[] = {
89 {
90 .modalias = "m25p80",
91 .platform_data = &qnap_ts219_flash,
92 .irq = -1,
93 .max_speed_hz = 20000000,
94 .bus_num = 0,
95 .chip_select = 0,
96 },
97};
98 28
99static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = { 29static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = {
100 I2C_BOARD_INFO("s35390a", 0x30), 30 I2C_BOARD_INFO("s35390a", 0x30),
@@ -152,36 +82,10 @@ static unsigned int qnap_ts219_mpp_config[] __initdata = {
152 MPP14_UART1_RXD, /* PIC controller */ 82 MPP14_UART1_RXD, /* PIC controller */
153 MPP15_GPIO, /* USB Copy button */ 83 MPP15_GPIO, /* USB Copy button */
154 MPP16_GPIO, /* Reset button */ 84 MPP16_GPIO, /* Reset button */
85 MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */
155 0 86 0
156}; 87};
157 88
158
159/*****************************************************************************
160 * QNAP TS-x19 specific power off method via UART1-attached PIC
161 ****************************************************************************/
162
163#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
164
165void qnap_ts219_power_off(void)
166{
167 /* 19200 baud divisor */
168 const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200));
169
170 pr_info("%s: triggering power-off...\n", __func__);
171
172 /* hijack UART1 and reset into sane state (19200,8n1) */
173 writel(0x83, UART1_REG(LCR));
174 writel(divisor & 0xff, UART1_REG(DLL));
175 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
176 writel(0x03, UART1_REG(LCR));
177 writel(0x00, UART1_REG(IER));
178 writel(0x00, UART1_REG(FCR));
179 writel(0x00, UART1_REG(MCR));
180
181 /* send the power-off command 'A' to PIC */
182 writel('A', UART1_REG(TX));
183}
184
185static void __init qnap_ts219_init(void) 89static void __init qnap_ts219_init(void)
186{ 90{
187 /* 91 /*
@@ -192,9 +96,7 @@ static void __init qnap_ts219_init(void)
192 96
193 kirkwood_uart0_init(); 97 kirkwood_uart0_init();
194 kirkwood_uart1_init(); /* A PIC controller is connected here. */ 98 kirkwood_uart1_init(); /* A PIC controller is connected here. */
195 spi_register_board_info(qnap_ts219_spi_slave_info, 99 qnap_tsx1x_register_flash();
196 ARRAY_SIZE(qnap_ts219_spi_slave_info));
197 kirkwood_spi_init();
198 kirkwood_i2c_init(); 100 kirkwood_i2c_init();
199 i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1); 101 i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1);
200 kirkwood_ge00_init(&qnap_ts219_ge00_data); 102 kirkwood_ge00_init(&qnap_ts219_ge00_data);
@@ -202,7 +104,7 @@ static void __init qnap_ts219_init(void)
202 kirkwood_ehci_init(); 104 kirkwood_ehci_init();
203 platform_device_register(&qnap_ts219_button_device); 105 platform_device_register(&qnap_ts219_button_device);
204 106
205 pm_power_off = qnap_ts219_power_off; 107 pm_power_off = qnap_tsx1x_power_off;
206 108
207} 109}
208 110
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
new file mode 100644
index 000000000000..de49c2d9e74b
--- /dev/null
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -0,0 +1,154 @@
1/*
2 *
3 * QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS Board Setup
4 *
5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/mv643xx_eth.h>
19#include <linux/ata_platform.h>
20#include <linux/gpio_keys.h>
21#include <linux/input.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <mach/kirkwood.h>
25#include "common.h"
26#include "mpp.h"
27#include "tsx1x-common.h"
28
29static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = {
30 I2C_BOARD_INFO("s35390a", 0x30),
31};
32
33static struct mv643xx_eth_platform_data qnap_ts41x_ge00_data = {
34 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
35};
36
37static struct mv643xx_eth_platform_data qnap_ts41x_ge01_data = {
38 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
39};
40
41static struct mv_sata_platform_data qnap_ts41x_sata_data = {
42 .n_ports = 2,
43};
44
45static struct gpio_keys_button qnap_ts41x_buttons[] = {
46 {
47 .code = KEY_COPY,
48 .gpio = 43,
49 .desc = "USB Copy",
50 .active_low = 1,
51 },
52 {
53 .code = KEY_RESTART,
54 .gpio = 37,
55 .desc = "Reset",
56 .active_low = 1,
57 },
58};
59
60static struct gpio_keys_platform_data qnap_ts41x_button_data = {
61 .buttons = qnap_ts41x_buttons,
62 .nbuttons = ARRAY_SIZE(qnap_ts41x_buttons),
63};
64
65static struct platform_device qnap_ts41x_button_device = {
66 .name = "gpio-keys",
67 .id = -1,
68 .num_resources = 0,
69 .dev = {
70 .platform_data = &qnap_ts41x_button_data,
71 }
72};
73
74static unsigned int qnap_ts41x_mpp_config[] __initdata = {
75 MPP0_SPI_SCn,
76 MPP1_SPI_MOSI,
77 MPP2_SPI_SCK,
78 MPP3_SPI_MISO,
79 MPP6_SYSRST_OUTn,
80 MPP7_PEX_RST_OUTn,
81 MPP8_TW_SDA,
82 MPP9_TW_SCK,
83 MPP10_UART0_TXD,
84 MPP11_UART0_RXD,
85 MPP13_UART1_TXD, /* PIC controller */
86 MPP14_UART1_RXD, /* PIC controller */
87 MPP15_SATA0_ACTn,
88 MPP16_SATA1_ACTn,
89 MPP20_GE1_0,
90 MPP21_GE1_1,
91 MPP22_GE1_2,
92 MPP23_GE1_3,
93 MPP24_GE1_4,
94 MPP25_GE1_5,
95 MPP26_GE1_6,
96 MPP27_GE1_7,
97 MPP30_GE1_10,
98 MPP31_GE1_11,
99 MPP32_GE1_12,
100 MPP33_GE1_13,
101 MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */
102 MPP37_GPIO, /* Reset button */
103 MPP43_GPIO, /* USB Copy button */
104 MPP44_GPIO, /* Board ID: 0: TS-419U, 1: TS-419 */
105 MPP45_GPIO, /* JP1: 0: console, 1: LCD */
106 MPP46_GPIO, /* External SATA HDD1 error indicator */
107 MPP47_GPIO, /* External SATA HDD2 error indicator */
108 MPP48_GPIO, /* External SATA HDD3 error indicator */
109 MPP49_GPIO, /* External SATA HDD4 error indicator */
110 0
111};
112
113static void __init qnap_ts41x_init(void)
114{
115 /*
116 * Basic setup. Needs to be called early.
117 */
118 kirkwood_init();
119 kirkwood_mpp_conf(qnap_ts41x_mpp_config);
120
121 kirkwood_uart0_init();
122 kirkwood_uart1_init(); /* A PIC controller is connected here. */
123 qnap_tsx1x_register_flash();
124 kirkwood_i2c_init();
125 i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1);
126 kirkwood_ge00_init(&qnap_ts41x_ge00_data);
127 kirkwood_ge01_init(&qnap_ts41x_ge01_data);
128 kirkwood_sata_init(&qnap_ts41x_sata_data);
129 kirkwood_ehci_init();
130 platform_device_register(&qnap_ts41x_button_device);
131
132 pm_power_off = qnap_tsx1x_power_off;
133
134}
135
136static int __init ts41x_pci_init(void)
137{
138 if (machine_is_ts41x())
139 kirkwood_pcie_init();
140
141 return 0;
142}
143subsys_initcall(ts41x_pci_init);
144
145MACHINE_START(TS41X, "QNAP TS-41x")
146 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
147 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
148 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
149 .boot_params = 0x00000100,
150 .init_machine = qnap_ts41x_init,
151 .map_io = kirkwood_map_io,
152 .init_irq = kirkwood_init_irq,
153 .timer = &kirkwood_timer,
154MACHINE_END
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c
new file mode 100644
index 000000000000..7221c20b2afa
--- /dev/null
+++ b/arch/arm/mach-kirkwood/tsx1x-common.c
@@ -0,0 +1,113 @@
1#include <linux/kernel.h>
2#include <linux/pci.h>
3#include <linux/platform_device.h>
4#include <linux/mtd/physmap.h>
5#include <linux/spi/flash.h>
6#include <linux/spi/spi.h>
7#include <linux/spi/orion_spi.h>
8#include <linux/serial_reg.h>
9#include <mach/kirkwood.h>
10#include "common.h"
11
12/*
13 * QNAP TS-x1x Boards flash
14 */
15
16/****************************************************************************
17 * 16 MiB NOR flash. The struct mtd_partition is not in the same order as the
18 * partitions on the device because we want to keep compatability with
19 * the QNAP firmware.
20 * Layout as used by QNAP:
21 * 0x00000000-0x00080000 : "U-Boot"
22 * 0x00200000-0x00400000 : "Kernel"
23 * 0x00400000-0x00d00000 : "RootFS"
24 * 0x00d00000-0x01000000 : "RootFS2"
25 * 0x00080000-0x000c0000 : "U-Boot Config"
26 * 0x000c0000-0x00200000 : "NAS Config"
27 *
28 * We'll use "RootFS1" instead of "RootFS" to stay compatible with the layout
29 * used by the QNAP TS-109/TS-209.
30 *
31 ***************************************************************************/
32
33struct mtd_partition qnap_tsx1x_partitions[] = {
34 {
35 .name = "U-Boot",
36 .size = 0x00080000,
37 .offset = 0,
38 .mask_flags = MTD_WRITEABLE,
39 }, {
40 .name = "Kernel",
41 .size = 0x00200000,
42 .offset = 0x00200000,
43 }, {
44 .name = "RootFS1",
45 .size = 0x00900000,
46 .offset = 0x00400000,
47 }, {
48 .name = "RootFS2",
49 .size = 0x00300000,
50 .offset = 0x00d00000,
51 }, {
52 .name = "U-Boot Config",
53 .size = 0x00040000,
54 .offset = 0x00080000,
55 }, {
56 .name = "NAS Config",
57 .size = 0x00140000,
58 .offset = 0x000c0000,
59 },
60};
61
62const struct flash_platform_data qnap_tsx1x_flash = {
63 .type = "m25p128",
64 .name = "spi_flash",
65 .parts = qnap_tsx1x_partitions,
66 .nr_parts = ARRAY_SIZE(qnap_tsx1x_partitions),
67};
68
69struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = {
70 {
71 .modalias = "m25p80",
72 .platform_data = &qnap_tsx1x_flash,
73 .irq = -1,
74 .max_speed_hz = 20000000,
75 .bus_num = 0,
76 .chip_select = 0,
77 },
78};
79
80void qnap_tsx1x_register_flash(void)
81{
82 spi_register_board_info(qnap_tsx1x_spi_slave_info,
83 ARRAY_SIZE(qnap_tsx1x_spi_slave_info));
84 kirkwood_spi_init();
85}
86
87
88/*****************************************************************************
89 * QNAP TS-x1x specific power off method via UART1-attached PIC
90 ****************************************************************************/
91
92#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
93
94void qnap_tsx1x_power_off(void)
95{
96 /* 19200 baud divisor */
97 const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200));
98
99 pr_info("%s: triggering power-off...\n", __func__);
100
101 /* hijack UART1 and reset into sane state (19200,8n1) */
102 writel(0x83, UART1_REG(LCR));
103 writel(divisor & 0xff, UART1_REG(DLL));
104 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
105 writel(0x03, UART1_REG(LCR));
106 writel(0x00, UART1_REG(IER));
107 writel(0x00, UART1_REG(FCR));
108 writel(0x00, UART1_REG(MCR));
109
110 /* send the power-off command 'A' to PIC */
111 writel('A', UART1_REG(TX));
112}
113
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h
new file mode 100644
index 000000000000..9a592962a6ea
--- /dev/null
+++ b/arch/arm/mach-kirkwood/tsx1x-common.h
@@ -0,0 +1,7 @@
1#ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H
2#define __ARCH_KIRKWOOD_TSX1X_COMMON_H
3
4extern void qnap_tsx1x_register_flash(void);
5extern void qnap_tsx1x_power_off(void);
6
7#endif
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index c8a2eac4d13c..3e14da3698b5 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -6,11 +6,13 @@ choice
6 6
7config MACH_MX21 7config MACH_MX21
8 bool "i.MX21 support" 8 bool "i.MX21 support"
9 select ARCH_MXC_AUDMUX_V1
9 help 10 help
10 This enables support for Freescale's MX2 based i.MX21 processor. 11 This enables support for Freescale's MX2 based i.MX21 processor.
11 12
12config MACH_MX27 13config MACH_MX27
13 bool "i.MX27 support" 14 bool "i.MX27 support"
15 select ARCH_MXC_AUDMUX_V1
14 help 16 help
15 This enables support for Freescale's MX2 based i.MX27 processor. 17 This enables support for Freescale's MX2 based i.MX27 processor.
16 18
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index ff5e33298914..aa640b4876c9 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -651,8 +651,8 @@ static struct clk_lookup lookups[] = {
651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1) 651 _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk) 652 _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1) 653 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
654 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) 654 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
655 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) 655 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) 656 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk) 657 _REGISTER_CLOCK(NULL, "vpu", vpu_clk)
658 _REGISTER_CLOCK(NULL, "dma", dma_clk) 658 _REGISTER_CLOCK(NULL, "dma", dma_clk)
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 50199aff0143..3d398ce09b31 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -530,6 +530,84 @@ struct platform_device mxc_usbh2 = {
530}; 530};
531#endif 531#endif
532 532
533static struct resource imx_ssi_resources0[] = {
534 {
535 .start = SSI1_BASE_ADDR,
536 .end = SSI1_BASE_ADDR + 0x6F,
537 .flags = IORESOURCE_MEM,
538 }, {
539 .start = MXC_INT_SSI1,
540 .end = MXC_INT_SSI1,
541 .flags = IORESOURCE_IRQ,
542 }, {
543 .name = "tx0",
544 .start = DMA_REQ_SSI1_TX0,
545 .end = DMA_REQ_SSI1_TX0,
546 .flags = IORESOURCE_DMA,
547 }, {
548 .name = "rx0",
549 .start = DMA_REQ_SSI1_RX0,
550 .end = DMA_REQ_SSI1_RX0,
551 .flags = IORESOURCE_DMA,
552 }, {
553 .name = "tx1",
554 .start = DMA_REQ_SSI1_TX1,
555 .end = DMA_REQ_SSI1_TX1,
556 .flags = IORESOURCE_DMA,
557 }, {
558 .name = "rx1",
559 .start = DMA_REQ_SSI1_RX1,
560 .end = DMA_REQ_SSI1_RX1,
561 .flags = IORESOURCE_DMA,
562 },
563};
564
565static struct resource imx_ssi_resources1[] = {
566 {
567 .start = SSI2_BASE_ADDR,
568 .end = SSI2_BASE_ADDR + 0x6F,
569 .flags = IORESOURCE_MEM,
570 }, {
571 .start = MXC_INT_SSI2,
572 .end = MXC_INT_SSI2,
573 .flags = IORESOURCE_IRQ,
574 }, {
575 .name = "tx0",
576 .start = DMA_REQ_SSI2_TX0,
577 .end = DMA_REQ_SSI2_TX0,
578 .flags = IORESOURCE_DMA,
579 }, {
580 .name = "rx0",
581 .start = DMA_REQ_SSI2_RX0,
582 .end = DMA_REQ_SSI2_RX0,
583 .flags = IORESOURCE_DMA,
584 }, {
585 .name = "tx1",
586 .start = DMA_REQ_SSI2_TX1,
587 .end = DMA_REQ_SSI2_TX1,
588 .flags = IORESOURCE_DMA,
589 }, {
590 .name = "rx1",
591 .start = DMA_REQ_SSI2_RX1,
592 .end = DMA_REQ_SSI2_RX1,
593 .flags = IORESOURCE_DMA,
594 },
595};
596
597struct platform_device imx_ssi_device0 = {
598 .name = "imx-ssi",
599 .id = 0,
600 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
601 .resource = imx_ssi_resources0,
602};
603
604struct platform_device imx_ssi_device1 = {
605 .name = "imx-ssi",
606 .id = 1,
607 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
608 .resource = imx_ssi_resources1,
609};
610
533/* GPIO port description */ 611/* GPIO port description */
534static struct mxc_gpio_port imx_gpio_ports[] = { 612static struct mxc_gpio_port imx_gpio_ports[] = {
535 { 613 {
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index d315406d6725..97306aa18f1c 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -26,4 +26,5 @@ extern struct platform_device mxc_usbh2;
26extern struct platform_device mxc_spi_device0; 26extern struct platform_device mxc_spi_device0;
27extern struct platform_device mxc_spi_device1; 27extern struct platform_device mxc_spi_device1;
28extern struct platform_device mxc_spi_device2; 28extern struct platform_device mxc_spi_device2;
29 29extern struct platform_device imx_ssi_device0;
30extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/pca100.c
index fe5b165b88cc..aea3d340d2e1 100644
--- a/arch/arm/mach-mx2/pca100.c
+++ b/arch/arm/mach-mx2/pca100.c
@@ -237,7 +237,7 @@ MACHINE_START(PCA100, "phyCARD-i.MX27")
237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
238 .boot_params = PHYS_OFFSET + 0x100, 238 .boot_params = PHYS_OFFSET + 0x100,
239 .map_io = mx27_map_io, 239 .map_io = mx27_map_io,
240 .init_irq = mxc_init_irq, 240 .init_irq = mx27_init_irq,
241 .init_machine = pca100_init, 241 .init_machine = pca100_init,
242 .timer = &pca100_timer, 242 .timer = &pca100_timer,
243MACHINE_END 243MACHINE_END
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 851f2458bf65..0177b8a5fe3a 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -2,11 +2,13 @@ if ARCH_MX3
2 2
3config ARCH_MX31 3config ARCH_MX31
4 select ARCH_HAS_RNGA 4 select ARCH_HAS_RNGA
5 select ARCH_MXC_AUDMUX_V2
5 bool 6 bool
6 7
7config ARCH_MX35 8config ARCH_MX35
8 bool 9 bool
9 select ARCH_MXC_IOMUX_V3 10 select ARCH_MXC_IOMUX_V3
11 select ARCH_MXC_AUDMUX_V2
10 12
11comment "MX3 platforms:" 13comment "MX3 platforms:"
12 14
@@ -61,6 +63,7 @@ config MACH_MX31_3DS
61config MACH_MX31MOBOARD 63config MACH_MX31MOBOARD
62 bool "Support mx31moboard platforms (EPFL Mobots group)" 64 bool "Support mx31moboard platforms (EPFL Mobots group)"
63 select ARCH_MX31 65 select ARCH_MX31
66 select MXC_ULPI
64 help 67 help
65 Include support for mx31moboard platform. This includes specific 68 Include support for mx31moboard platform. This includes specific
66 configurations for the board and its peripherals. 69 configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 6b9775471be6..940035cacae8 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -4,12 +4,12 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := mm.o devices.o 7obj-y := mm.o devices.o cpu.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o 8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o 9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o mx31lite-db.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 13obj-$(CONFIG_MACH_PCM037) += pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o 14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o
15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 776c0ee1b3cd..54aab401dbdf 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -33,6 +33,9 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/input.h>
37#include <linux/gpio_keys.h>
38#include <linux/i2c.h>
36 39
37#include <mach/hardware.h> 40#include <mach/hardware.h>
38#include <asm/mach-types.h> 41#include <asm/mach-types.h>
@@ -97,6 +100,47 @@ static int armadillo5x0_pins[] = {
97 MX31_PIN_FPSHIFT__FPSHIFT, 100 MX31_PIN_FPSHIFT__FPSHIFT,
98 MX31_PIN_DRDY0__DRDY0, 101 MX31_PIN_DRDY0__DRDY0,
99 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/ 102 IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
103 /* I2C2 */
104 MX31_PIN_CSPI2_MOSI__SCL,
105 MX31_PIN_CSPI2_MISO__SDA,
106};
107
108/* RTC over I2C*/
109#define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4)
110
111static struct i2c_board_info armadillo5x0_i2c_rtc = {
112 I2C_BOARD_INFO("s35390a", 0x30),
113};
114
115/* GPIO BUTTONS */
116static struct gpio_keys_button armadillo5x0_buttons[] = {
117 {
118 .code = KEY_ENTER, /*28*/
119 .gpio = IOMUX_TO_GPIO(MX31_PIN_SCLK0),
120 .active_low = 1,
121 .desc = "menu",
122 .wakeup = 1,
123 }, {
124 .code = KEY_BACK, /*158*/
125 .gpio = IOMUX_TO_GPIO(MX31_PIN_SRST0),
126 .active_low = 1,
127 .desc = "back",
128 .wakeup = 1,
129 }
130};
131
132static struct gpio_keys_platform_data armadillo5x0_button_data = {
133 .buttons = armadillo5x0_buttons,
134 .nbuttons = ARRAY_SIZE(armadillo5x0_buttons),
135};
136
137static struct platform_device armadillo5x0_button_device = {
138 .name = "gpio-keys",
139 .id = -1,
140 .num_resources = 0,
141 .dev = {
142 .platform_data = &armadillo5x0_button_data,
143 }
100}; 144};
101 145
102/* 146/*
@@ -278,7 +322,7 @@ static struct resource armadillo5x0_smc911x_resources[] = {
278}; 322};
279 323
280static struct smsc911x_platform_config smsc911x_info = { 324static struct smsc911x_platform_config smsc911x_info = {
281 .flags = SMSC911X_USE_32BIT, 325 .flags = SMSC911X_USE_16BIT,
282 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 326 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
283 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 327 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
284}; 328};
@@ -300,6 +344,8 @@ static struct imxuart_platform_data uart_pdata = {
300 344
301static struct platform_device *devices[] __initdata = { 345static struct platform_device *devices[] __initdata = {
302 &armadillo5x0_smc911x_device, 346 &armadillo5x0_smc911x_device,
347 &mxc_i2c_device1,
348 &armadillo5x0_button_device,
303}; 349};
304 350
305/* 351/*
@@ -335,6 +381,18 @@ static void __init armadillo5x0_init(void)
335 381
336 /* set NAND page size to 2k if not configured via boot mode pins */ 382 /* set NAND page size to 2k if not configured via boot mode pins */
337 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR); 383 __raw_writel(__raw_readl(MXC_CCM_RCSR) | (1 << 30), MXC_CCM_RCSR);
384
385 /* RTC */
386 /* Get RTC IRQ and register the chip */
387 if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) {
388 if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0)
389 armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO);
390 else
391 gpio_free(ARMADILLO5X0_RTC_GPIO);
392 }
393 if (armadillo5x0_i2c_rtc.irq == 0)
394 pr_warning("armadillo5x0_init: failed to get RTC IRQ\n");
395 i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1);
338} 396}
339 397
340static void __init armadillo5x0_timer_init(void) 398static void __init armadillo5x0_timer_init(void)
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index c595260ec1f9..02a9a18e1189 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -335,7 +335,7 @@ static void clk_cgr_disable(struct clk *clk)
335 335
336DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL); 336DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL);
337DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL); 337DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL);
338DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); 338/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); */
339DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL); 339DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL);
340DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL); 340DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL);
341DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL); 341DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL);
@@ -381,12 +381,41 @@ DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL);
381DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL); 381DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL);
382DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); 382DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL);
383DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); 383DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL);
384DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL); 384DEFINE_CLOCK(audmux_clk, 0, CCM_CGR2, 30, NULL, NULL);
385 385
386DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL); 386DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL);
387DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); 387DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL);
388DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); 388DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL);
389 389
390static int clk_dummy_enable(struct clk *clk)
391{
392 return 0;
393}
394
395static void clk_dummy_disable(struct clk *clk)
396{
397}
398
399static unsigned long get_rate_nfc(struct clk *clk)
400{
401 unsigned long div1;
402
403 div1 = (__raw_readl(CCM_BASE + CCM_PDR4) >> 28) + 1;
404
405 return get_rate_ahb(NULL) / div1;
406}
407
408/* NAND Controller: It seems it can't be disabled */
409static struct clk nfc_clk = {
410 .id = 0,
411 .enable_reg = 0,
412 .enable_shift = 0,
413 .get_rate = get_rate_nfc,
414 .set_rate = NULL, /* set_rate_nfc, */
415 .enable = clk_dummy_enable,
416 .disable = clk_dummy_disable
417};
418
390#define _REGISTER_CLOCK(d, n, c) \ 419#define _REGISTER_CLOCK(d, n, c) \
391 { \ 420 { \
392 .dev_id = d, \ 421 .dev_id = d, \
@@ -397,7 +426,6 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL);
397static struct clk_lookup lookups[] = { 426static struct clk_lookup lookups[] = {
398 _REGISTER_CLOCK(NULL, "asrc", asrc_clk) 427 _REGISTER_CLOCK(NULL, "asrc", asrc_clk)
399 _REGISTER_CLOCK(NULL, "ata", ata_clk) 428 _REGISTER_CLOCK(NULL, "ata", ata_clk)
400 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
401 _REGISTER_CLOCK(NULL, "can", can1_clk) 429 _REGISTER_CLOCK(NULL, "can", can1_clk)
402 _REGISTER_CLOCK(NULL, "can", can2_clk) 430 _REGISTER_CLOCK(NULL, "can", can2_clk)
403 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk) 431 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
@@ -434,8 +462,8 @@ static struct clk_lookup lookups[] = {
434 _REGISTER_CLOCK(NULL, "sdma", sdma_clk) 462 _REGISTER_CLOCK(NULL, "sdma", sdma_clk)
435 _REGISTER_CLOCK(NULL, "spba", spba_clk) 463 _REGISTER_CLOCK(NULL, "spba", spba_clk)
436 _REGISTER_CLOCK(NULL, "spdif", spdif_clk) 464 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
437 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) 465 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
438 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) 466 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
439 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk) 467 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
440 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk) 468 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
441 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 469 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
@@ -445,10 +473,11 @@ static struct clk_lookup lookups[] = {
445 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk) 473 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usbotg_clk)
446 _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk) 474 _REGISTER_CLOCK("imx-wdt.0", NULL, wdog_clk)
447 _REGISTER_CLOCK(NULL, "max", max_clk) 475 _REGISTER_CLOCK(NULL, "max", max_clk)
448 _REGISTER_CLOCK(NULL, "admux", admux_clk) 476 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
449 _REGISTER_CLOCK(NULL, "csi", csi_clk) 477 _REGISTER_CLOCK(NULL, "csi", csi_clk)
450 _REGISTER_CLOCK(NULL, "iim", iim_clk) 478 _REGISTER_CLOCK(NULL, "iim", iim_clk)
451 _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) 479 _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk)
480 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
452}; 481};
453 482
454int __init mx35_clocks_init() 483int __init mx35_clocks_init()
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index b2a3bcf8266e..27a318af0d20 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -558,8 +558,8 @@ static struct clk_lookup lookups[] = {
558 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk) 558 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk)
559 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk) 559 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
560 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk) 560 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
561 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk) 561 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
562 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk) 562 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
563 _REGISTER_CLOCK(NULL, "firi", firi_clk) 563 _REGISTER_CLOCK(NULL, "firi", firi_clk)
564 _REGISTER_CLOCK(NULL, "ata", ata_clk) 564 _REGISTER_CLOCK(NULL, "ata", ata_clk)
565 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 565 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
@@ -616,6 +616,8 @@ int __init mx31_clocks_init(unsigned long fref)
616 616
617 clk_enable(&serial_pll_clk); 617 clk_enable(&serial_pll_clk);
618 618
619 mx31_read_cpu_rev();
620
619 if (mx31_revision() >= CHIP_REV_2_0) { 621 if (mx31_revision() >= CHIP_REV_2_0) {
620 reg = __raw_readl(MXC_CCM_PMCR1); 622 reg = __raw_readl(MXC_CCM_PMCR1);
621 /* No PLL restart on DVFS switch; enable auto EMI handshake */ 623 /* No PLL restart on DVFS switch; enable auto EMI handshake */
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c
new file mode 100644
index 000000000000..db828809c675
--- /dev/null
+++ b/arch/arm/mach-mx3/cpu.c
@@ -0,0 +1,57 @@
1/*
2 * MX3 CPU type detection
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
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
12#include <linux/module.h>
13#include <linux/io.h>
14#include <mach/hardware.h>
15#include <mach/iim.h>
16
17unsigned int mx31_cpu_rev;
18EXPORT_SYMBOL(mx31_cpu_rev);
19
20struct mx3_cpu_type {
21 u8 srev;
22 const char *name;
23 const char *v;
24 unsigned int rev;
25};
26
27static struct mx3_cpu_type mx31_cpu_type[] __initdata = {
28 { .srev = 0x00, .name = "i.MX31(L)", .v = "1.0", .rev = CHIP_REV_1_0 },
29 { .srev = 0x10, .name = "i.MX31", .v = "1.1", .rev = CHIP_REV_1_1 },
30 { .srev = 0x11, .name = "i.MX31L", .v = "1.1", .rev = CHIP_REV_1_1 },
31 { .srev = 0x12, .name = "i.MX31", .v = "1.15", .rev = CHIP_REV_1_1 },
32 { .srev = 0x13, .name = "i.MX31L", .v = "1.15", .rev = CHIP_REV_1_1 },
33 { .srev = 0x14, .name = "i.MX31", .v = "1.2", .rev = CHIP_REV_1_2 },
34 { .srev = 0x15, .name = "i.MX31L", .v = "1.2", .rev = CHIP_REV_1_2 },
35 { .srev = 0x28, .name = "i.MX31", .v = "2.0", .rev = CHIP_REV_2_0 },
36 { .srev = 0x29, .name = "i.MX31L", .v = "2.0", .rev = CHIP_REV_2_0 },
37};
38
39void __init mx31_read_cpu_rev(void)
40{
41 u32 i, srev;
42
43 /* read SREV register from IIM module */
44 srev = __raw_readl(IO_ADDRESS(IIM_BASE_ADDR) + MXC_IIMSREV);
45
46 for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
47 if (srev == mx31_cpu_type[i].srev) {
48 printk(KERN_INFO
49 "CPU identified as %s, silicon rev %s\n",
50 mx31_cpu_type[i].name, mx31_cpu_type[i].v);
51
52 mx31_cpu_rev = mx31_cpu_type[i].rev;
53 return;
54 }
55
56 printk(KERN_WARNING "Unknown CPU identifier. srev = %02x\n", srev);
57}
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index e6abe181b967..6adb586515ea 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -537,6 +537,44 @@ struct platform_device mxc_fec_device = {
537}; 537};
538#endif 538#endif
539 539
540static struct resource imx_ssi_resources0[] = {
541 {
542 .start = SSI1_BASE_ADDR,
543 .end = SSI1_BASE_ADDR + 0xfff,
544 .flags = IORESOURCE_MEM,
545 }, {
546 .start = MX31_INT_SSI1,
547 .end = MX31_INT_SSI1,
548 .flags = IORESOURCE_IRQ,
549 },
550};
551
552static struct resource imx_ssi_resources1[] = {
553 {
554 .start = SSI2_BASE_ADDR,
555 .end = SSI2_BASE_ADDR + 0xfff,
556 .flags = IORESOURCE_MEM
557 }, {
558 .start = MX31_INT_SSI2,
559 .end = MX31_INT_SSI2,
560 .flags = IORESOURCE_IRQ,
561 },
562};
563
564struct platform_device imx_ssi_device0 = {
565 .name = "imx-ssi",
566 .id = 0,
567 .num_resources = ARRAY_SIZE(imx_ssi_resources0),
568 .resource = imx_ssi_resources0,
569};
570
571struct platform_device imx_ssi_device1 = {
572 .name = "imx-ssi",
573 .id = 1,
574 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
575 .resource = imx_ssi_resources1,
576};
577
540static int mx3_devices_init(void) 578static int mx3_devices_init(void)
541{ 579{
542 if (cpu_is_mx31()) { 580 if (cpu_is_mx31()) {
@@ -546,7 +584,7 @@ static int mx3_devices_init(void)
546 } 584 }
547 if (cpu_is_mx35()) { 585 if (cpu_is_mx35()) {
548 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR; 586 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
549 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff; 587 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0x1fff;
550 otg_resources[0].start = MX35_OTG_BASE_ADDR; 588 otg_resources[0].start = MX35_OTG_BASE_ADDR;
551 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; 589 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
552 otg_resources[1].start = MXC_INT_USBOTG; 590 otg_resources[1].start = MXC_INT_USBOTG;
@@ -555,6 +593,10 @@ static int mx3_devices_init(void)
555 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff; 593 mxc_usbh1_resources[0].end = MX35_OTG_BASE_ADDR + 0x5ff;
556 mxc_usbh1_resources[1].start = MXC_INT_USBHS; 594 mxc_usbh1_resources[1].start = MXC_INT_USBHS;
557 mxc_usbh1_resources[1].end = MXC_INT_USBHS; 595 mxc_usbh1_resources[1].end = MXC_INT_USBHS;
596 imx_ssi_resources0[1].start = MX35_INT_SSI1;
597 imx_ssi_resources0[1].end = MX35_INT_SSI1;
598 imx_ssi_resources1[1].start = MX35_INT_SSI2;
599 imx_ssi_resources1[1].end = MX35_INT_SSI2;
558 } 600 }
559 601
560 return 0; 602 return 0;
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index ab87419dc9a0..42cf175eac6b 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -23,4 +23,6 @@ extern struct platform_device mxc_rnga_device;
23extern struct platform_device mxc_spi_device0; 23extern struct platform_device mxc_spi_device0;
24extern struct platform_device mxc_spi_device1; 24extern struct platform_device mxc_spi_device1;
25extern struct platform_device mxc_spi_device2; 25extern struct platform_device mxc_spi_device2;
26extern struct platform_device imx_ssi_device0;
27extern struct platform_device imx_ssi_device1;
26 28
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
index 3b3a78f49c23..7aebd74a12e8 100644
--- a/arch/arm/mach-mx3/mx31lilly-db.c
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -109,6 +109,9 @@ static int mxc_mmc1_get_ro(struct device *dev)
109 109
110static int gpio_det, gpio_wp; 110static int gpio_det, gpio_wp;
111 111
112#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
113 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
114
112static int mxc_mmc1_init(struct device *dev, 115static int mxc_mmc1_init(struct device *dev,
113 irq_handler_t detect_irq, void *data) 116 irq_handler_t detect_irq, void *data)
114{ 117{
@@ -117,6 +120,13 @@ static int mxc_mmc1_init(struct device *dev,
117 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1); 120 gpio_det = IOMUX_TO_GPIO(MX31_PIN_GPIO1_1);
118 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0); 121 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_LCS0);
119 122
123 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0, MMC_PAD_CFG);
124 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1, MMC_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2, MMC_PAD_CFG);
126 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3, MMC_PAD_CFG);
127 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG);
128 mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG);
129
120 ret = gpio_request(gpio_det, "MMC detect"); 130 ret = gpio_request(gpio_det, "MMC detect");
121 if (ret) 131 if (ret)
122 return ret; 132 return ret;
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
index 423025150f6f..9ce029f554b9 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -31,6 +31,8 @@
31#include <linux/interrupt.h> 31#include <linux/interrupt.h>
32#include <linux/smsc911x.h> 32#include <linux/smsc911x.h>
33#include <linux/mtd/physmap.h> 33#include <linux/mtd/physmap.h>
34#include <linux/spi/spi.h>
35#include <linux/mfd/mc13783.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
@@ -41,6 +43,7 @@
41#include <mach/common.h> 43#include <mach/common.h>
42#include <mach/iomux-mx3.h> 44#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lilly.h> 45#include <mach/board-mx31lilly.h>
46#include <mach/spi.h>
44 47
45#include "devices.h" 48#include "devices.h"
46 49
@@ -108,7 +111,36 @@ static struct platform_device physmap_flash_device = {
108static struct platform_device *devices[] __initdata = { 111static struct platform_device *devices[] __initdata = {
109 &smsc91x_device, 112 &smsc91x_device,
110 &physmap_flash_device, 113 &physmap_flash_device,
111 &mxc_i2c_device1, 114};
115
116/* SPI */
117
118static int spi_internal_chipselect[] = {
119 MXC_SPI_CS(0),
120 MXC_SPI_CS(1),
121 MXC_SPI_CS(2),
122};
123
124static struct spi_imx_master spi0_pdata = {
125 .chipselect = spi_internal_chipselect,
126 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
127};
128
129static struct spi_imx_master spi1_pdata = {
130 .chipselect = spi_internal_chipselect,
131 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
132};
133
134static struct mc13783_platform_data mc13783_pdata __initdata = {
135 .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN,
136};
137
138static struct spi_board_info mc13783_dev __initdata = {
139 .modalias = "mc13783",
140 .max_speed_hz = 1000000,
141 .bus_num = 1,
142 .chip_select = 0,
143 .platform_data = &mc13783_pdata,
112}; 144};
113 145
114static int mx31lilly_baseboard; 146static int mx31lilly_baseboard;
@@ -128,8 +160,27 @@ static void __init mx31lilly_board_init(void)
128 } 160 }
129 161
130 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS"); 162 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
131 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL"); 163
132 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA"); 164 /* SPI */
165 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SCLK__SCLK, "SPI1_CLK");
166 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MOSI__MOSI, "SPI1_TX");
167 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MISO__MISO, "SPI1_RX");
168 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SPI_RDY__SPI_RDY, "SPI1_RDY");
169 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS0__SS0, "SPI1_SS0");
170 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS1__SS1, "SPI1_SS1");
171 mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS2__SS2, "SPI1_SS2");
172
173 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SCLK__SCLK, "SPI2_CLK");
174 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__MOSI, "SPI2_TX");
175 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__MISO, "SPI2_RX");
176 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, "SPI2_RDY");
177 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS0__SS0, "SPI2_SS0");
178 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1");
179 mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2");
180
181 mxc_register_device(&mxc_spi_device0, &spi0_pdata);
182 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
183 spi_register_board_info(&mc13783_dev, 1);
133 184
134 platform_add_devices(devices, ARRAY_SIZE(devices)); 185 platform_add_devices(devices, ARRAY_SIZE(devices));
135} 186}
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
new file mode 100644
index 000000000000..694611d6b057
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -0,0 +1,198 @@
1/*
2 * LogicPD i.MX31 SOM-LV development board support
3 *
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
5 *
6 * based on code for other MX31 boards,
7 *
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#include <linux/kernel.h>
28#include <linux/types.h>
29#include <linux/init.h>
30#include <linux/gpio.h>
31#include <linux/platform_device.h>
32#include <linux/leds.h>
33#include <linux/platform_device.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38
39#include <mach/hardware.h>
40#include <mach/common.h>
41#include <mach/imx-uart.h>
42#include <mach/iomux-mx3.h>
43#include <mach/board-mx31lite.h>
44#include <mach/mmc.h>
45#include <mach/spi.h>
46
47#include "devices.h"
48
49/*
50 * This file contains board-specific initialization routines for the
51 * LogicPD i.MX31 SOM-LV development board, aka 'LiteKit'.
52 * If you design an own baseboard for the module, use this file as base
53 * for support code.
54 */
55
56static unsigned int litekit_db_board_pins[] __initdata = {
57 /* UART1 */
58 MX31_PIN_CTS1__CTS1,
59 MX31_PIN_RTS1__RTS1,
60 MX31_PIN_TXD1__TXD1,
61 MX31_PIN_RXD1__RXD1,
62 /* SPI 0 */
63 MX31_PIN_CSPI1_SCLK__SCLK,
64 MX31_PIN_CSPI1_MOSI__MOSI,
65 MX31_PIN_CSPI1_MISO__MISO,
66 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
67 MX31_PIN_CSPI1_SS0__SS0,
68 MX31_PIN_CSPI1_SS1__SS1,
69 MX31_PIN_CSPI1_SS2__SS2,
70};
71
72/* UART */
73static struct imxuart_platform_data uart_pdata __initdata = {
74 .flags = IMXUART_HAVE_RTSCTS,
75};
76
77/* MMC */
78
79static int gpio_det, gpio_wp;
80
81#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
82 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
83
84static int mxc_mmc1_get_ro(struct device *dev)
85{
86 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_LCS0));
87}
88
89static int mxc_mmc1_init(struct device *dev,
90 irq_handler_t detect_irq, void *data)
91{
92 int ret;
93
94 gpio_det = IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1);
95 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_GPIO1_6);
96
97 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0, MMC_PAD_CFG);
98 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1, MMC_PAD_CFG);
99 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2, MMC_PAD_CFG);
100 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3, MMC_PAD_CFG);
101 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG);
102 mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG);
103
104 ret = gpio_request(gpio_det, "MMC detect");
105 if (ret)
106 return ret;
107
108 ret = gpio_request(gpio_wp, "MMC w/p");
109 if (ret)
110 goto exit_free_det;
111
112 gpio_direction_input(gpio_det);
113 gpio_direction_input(gpio_wp);
114
115 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq,
116 IRQF_DISABLED | IRQF_TRIGGER_FALLING,
117 "MMC detect", data);
118 if (ret)
119 goto exit_free_wp;
120
121 return 0;
122
123exit_free_wp:
124 gpio_free(gpio_wp);
125
126exit_free_det:
127 gpio_free(gpio_det);
128
129 return ret;
130}
131
132static void mxc_mmc1_exit(struct device *dev, void *data)
133{
134 gpio_free(gpio_det);
135 gpio_free(gpio_wp);
136 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data);
137}
138
139static struct imxmmc_platform_data mmc_pdata = {
140 .get_ro = mxc_mmc1_get_ro,
141 .init = mxc_mmc1_init,
142 .exit = mxc_mmc1_exit,
143};
144
145/* SPI */
146
147static int spi_internal_chipselect[] = {
148 MXC_SPI_CS(0),
149 MXC_SPI_CS(1),
150 MXC_SPI_CS(2),
151};
152
153static struct spi_imx_master spi0_pdata = {
154 .chipselect = spi_internal_chipselect,
155 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
156};
157
158/* GPIO LEDs */
159
160static struct gpio_led litekit_leds[] = {
161 {
162 .name = "GPIO0",
163 .gpio = IOMUX_TO_GPIO(MX31_PIN_COMPARE),
164 .active_low = 1,
165 .default_state = LEDS_GPIO_DEFSTATE_OFF,
166 },
167 {
168 .name = "GPIO1",
169 .gpio = IOMUX_TO_GPIO(MX31_PIN_CAPTURE),
170 .active_low = 1,
171 .default_state = LEDS_GPIO_DEFSTATE_OFF,
172 }
173};
174
175static struct gpio_led_platform_data litekit_led_platform_data = {
176 .leds = litekit_leds,
177 .num_leds = ARRAY_SIZE(litekit_leds),
178};
179
180static struct platform_device litekit_led_device = {
181 .name = "leds-gpio",
182 .id = -1,
183 .dev = {
184 .platform_data = &litekit_led_platform_data,
185 },
186};
187
188void __init mx31lite_db_init(void)
189{
190 mxc_iomux_setup_multiple_pins(litekit_db_board_pins,
191 ARRAY_SIZE(litekit_db_board_pins),
192 "development board pins");
193 mxc_register_device(&mxc_uart_device0, &uart_pdata);
194 mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
195 mxc_register_device(&mxc_spi_device0, &spi0_pdata);
196 platform_device_register(&litekit_led_device);
197}
198
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index a8d57decdfdb..def6b6736594 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mx31lite.c
@@ -2,6 +2,7 @@
2 * Copyright (C) 2000 Deep Blue Solutions Ltd 2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved. 4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
5 * 6 *
6 * 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
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -25,38 +26,47 @@
25#include <linux/platform_device.h> 26#include <linux/platform_device.h>
26#include <linux/gpio.h> 27#include <linux/gpio.h>
27#include <linux/smsc911x.h> 28#include <linux/smsc911x.h>
29#include <linux/mfd/mc13783.h>
30#include <linux/spi/spi.h>
31#include <linux/usb/otg.h>
32#include <linux/usb/ulpi.h>
33#include <linux/mtd/physmap.h>
28 34
29#include <mach/hardware.h>
30#include <asm/mach-types.h> 35#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
32#include <asm/mach/time.h> 37#include <asm/mach/time.h>
33#include <asm/mach/map.h> 38#include <asm/mach/map.h>
34#include <mach/common.h>
35#include <asm/page.h> 39#include <asm/page.h>
36#include <asm/setup.h> 40#include <asm/setup.h>
41
42#include <mach/hardware.h>
43#include <mach/common.h>
37#include <mach/board-mx31lite.h> 44#include <mach/board-mx31lite.h>
38#include <mach/imx-uart.h> 45#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 46#include <mach/iomux-mx3.h>
40#include <mach/irqs.h> 47#include <mach/irqs.h>
41#include <mach/mxc_nand.h> 48#include <mach/mxc_nand.h>
49#include <mach/spi.h>
50#include <mach/mxc_ehci.h>
51#include <mach/ulpi.h>
52
42#include "devices.h" 53#include "devices.h"
43 54
44/* 55/*
45 * This file contains the board-specific initialization routines. 56 * This file contains the module-specific initialization routines.
46 */ 57 */
47 58
48static unsigned int mx31lite_pins[] = { 59static unsigned int mx31lite_pins[] = {
49 /* UART1 */
50 MX31_PIN_CTS1__CTS1,
51 MX31_PIN_RTS1__RTS1,
52 MX31_PIN_TXD1__TXD1,
53 MX31_PIN_RXD1__RXD1,
54 /* LAN9117 IRQ pin */ 60 /* LAN9117 IRQ pin */
55 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), 61 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
56}; 62 /* SPI 1 */
57 63 MX31_PIN_CSPI2_SCLK__SCLK,
58static struct imxuart_platform_data uart_pdata = { 64 MX31_PIN_CSPI2_MOSI__MOSI,
59 .flags = IMXUART_HAVE_RTSCTS, 65 MX31_PIN_CSPI2_MISO__MISO,
66 MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
67 MX31_PIN_CSPI2_SS0__SS0,
68 MX31_PIN_CSPI2_SS1__SS1,
69 MX31_PIN_CSPI2_SS2__SS2,
60}; 70};
61 71
62static struct mxc_nand_platform_data mx31lite_nand_board_info = { 72static struct mxc_nand_platform_data mx31lite_nand_board_info = {
@@ -93,6 +103,111 @@ static struct platform_device smsc911x_device = {
93}; 103};
94 104
95/* 105/*
106 * SPI
107 *
108 * The MC13783 is the only hard-wired SPI device on the module.
109 */
110
111static int spi_internal_chipselect[] = {
112 MXC_SPI_CS(0),
113};
114
115static struct spi_imx_master spi1_pdata = {
116 .chipselect = spi_internal_chipselect,
117 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
118};
119
120static struct mc13783_platform_data mc13783_pdata __initdata = {
121 .flags = MC13783_USE_RTC |
122 MC13783_USE_REGULATOR,
123};
124
125static struct spi_board_info mc13783_spi_dev __initdata = {
126 .modalias = "mc13783",
127 .max_speed_hz = 1000000,
128 .bus_num = 1,
129 .chip_select = 0,
130 .platform_data = &mc13783_pdata,
131 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
132};
133
134/*
135 * USB
136 */
137
138#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
139 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
140
141static int usbh2_init(struct platform_device *pdev)
142{
143 int pins[] = {
144 MX31_PIN_USBH2_DATA0__USBH2_DATA0,
145 MX31_PIN_USBH2_DATA1__USBH2_DATA1,
146 MX31_PIN_USBH2_CLK__USBH2_CLK,
147 MX31_PIN_USBH2_DIR__USBH2_DIR,
148 MX31_PIN_USBH2_NXT__USBH2_NXT,
149 MX31_PIN_USBH2_STP__USBH2_STP,
150 };
151
152 mxc_iomux_setup_multiple_pins(pins, ARRAY_SIZE(pins), "USB H2");
153
154 mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG);
155 mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG);
156 mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG);
157 mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG);
158 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG);
159 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG);
160 mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG);
161 mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG);
162 mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG);
163 mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG);
164 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG);
165 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG);
166
167 mxc_iomux_set_gpr(MUX_PGP_UH2, true);
168
169 /* chip select */
170 mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE1, IOMUX_CONFIG_GPIO),
171 "USBH2_CS");
172 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS");
173 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0);
174
175 return 0;
176}
177
178static struct mxc_usbh_platform_data usbh2_pdata = {
179 .init = usbh2_init,
180 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
181 .flags = MXC_EHCI_POWER_PINS_ENABLED,
182};
183
184/*
185 * NOR flash
186 */
187
188static struct physmap_flash_data nor_flash_data = {
189 .width = 2,
190};
191
192static struct resource nor_flash_resource = {
193 .start = 0xa0000000,
194 .end = 0xa1ffffff,
195 .flags = IORESOURCE_MEM,
196};
197
198static struct platform_device physmap_flash_device = {
199 .name = "physmap-flash",
200 .id = 0,
201 .dev = {
202 .platform_data = &nor_flash_data,
203 },
204 .resource = &nor_flash_resource,
205 .num_resources = 1,
206};
207
208
209
210/*
96 * This structure defines the MX31 memory map. 211 * This structure defines the MX31 memory map.
97 */ 212 */
98static struct map_desc mx31lite_io_desc[] __initdata = { 213static struct map_desc mx31lite_io_desc[] __initdata = {
@@ -118,19 +233,40 @@ void __init mx31lite_map_io(void)
118 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); 233 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
119} 234}
120 235
121/* 236static int mx31lite_baseboard;
122 * Board specific initialization. 237core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444);
123 */ 238
124static void __init mxc_board_init(void) 239static void __init mxc_board_init(void)
125{ 240{
126 int ret; 241 int ret;
127 242
243 switch (mx31lite_baseboard) {
244 case MX31LITE_NOBOARD:
245 break;
246 case MX31LITE_DB:
247 mx31lite_db_init();
248 break;
249 default:
250 printk(KERN_ERR "Illegal mx31lite_baseboard type %d\n",
251 mx31lite_baseboard);
252 }
253
128 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins), 254 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
129 "mx31lite"); 255 "mx31lite");
130 256
131 mxc_register_device(&mxc_uart_device0, &uart_pdata); 257 /* NOR and NAND flash */
258 platform_device_register(&physmap_flash_device);
132 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info); 259 mxc_register_device(&mxc_nand_device, &mx31lite_nand_board_info);
133 260
261 mxc_register_device(&mxc_spi_device1, &spi1_pdata);
262 spi_register_board_info(&mc13783_spi_dev, 1);
263
264 /* USB */
265 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
266 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
267
268 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
269
134 /* SMSC9117 IRQ pin */ 270 /* SMSC9117 IRQ pin */
135 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); 271 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
136 if (ret) 272 if (ret)
@@ -150,12 +286,7 @@ struct sys_timer mx31lite_timer = {
150 .init = mx31lite_timer_init, 286 .init = mx31lite_timer_init,
151}; 287};
152 288
153/* 289MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
154 * The following uses standard kernel macros defined in arch.h in order to
155 * initialize __mach_desc_MX31LITE data structure.
156 */
157
158MACHINE_START(MX31LITE, "LogicPD MX31 LITEKIT")
159 /* Maintainer: Freescale Semiconductor, Inc. */ 290 /* Maintainer: Freescale Semiconductor, Inc. */
160 .phys_io = AIPS1_BASE_ADDR, 291 .phys_io = AIPS1_BASE_ADDR,
161 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 292 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 5592cdb8d0ad..8fc624f141cb 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -22,11 +22,15 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/types.h> 23#include <linux/types.h>
24 24
25#include <linux/usb/otg.h>
26
25#include <mach/common.h> 27#include <mach/common.h>
26#include <mach/imx-uart.h> 28#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h> 29#include <mach/iomux-mx3.h>
28#include <mach/hardware.h> 30#include <mach/hardware.h>
29#include <mach/mmc.h> 31#include <mach/mmc.h>
32#include <mach/mxc_ehci.h>
33#include <mach/ulpi.h>
30 34
31#include "devices.h" 35#include "devices.h"
32 36
@@ -39,6 +43,12 @@ static unsigned int devboard_pins[] = {
39 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0, 43 MX31_PIN_PC_READY__SD2_DATA1, MX31_PIN_PC_WAIT_B__SD2_DATA0,
40 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 44 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
41 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 45 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
46 /* USB H1 */
47 MX31_PIN_CSPI1_MISO__USBH1_RXDP, MX31_PIN_CSPI1_MOSI__USBH1_RXDM,
48 MX31_PIN_CSPI1_SS0__USBH1_TXDM, MX31_PIN_CSPI1_SS1__USBH1_TXDP,
49 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
50 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
51 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
42}; 52};
43 53
44static struct imxuart_platform_data uart_pdata = { 54static struct imxuart_platform_data uart_pdata = {
@@ -98,6 +108,80 @@ static struct imxmmc_platform_data sdhc2_pdata = {
98 .exit = devboard_sdhc2_exit, 108 .exit = devboard_sdhc2_exit,
99}; 109};
100 110
111#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
112 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
113
114static int devboard_usbh1_hw_init(struct platform_device *pdev)
115{
116 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
117
118 mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, USB_PAD_CFG);
119 mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, USB_PAD_CFG);
120 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, USB_PAD_CFG);
121 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, USB_PAD_CFG);
122 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, USB_PAD_CFG);
123 mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, USB_PAD_CFG);
124 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
125 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
126
127 return 0;
128}
129
130#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
131#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
132
133static int devboard_isp1105_init(struct otg_transceiver *otg)
134{
135 int ret = gpio_request(USBH1_MODE, "usbh1-mode");
136 if (ret)
137 return ret;
138 /* single ended */
139 gpio_direction_output(USBH1_MODE, 0);
140
141 ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen");
142 if (ret) {
143 gpio_free(USBH1_MODE);
144 return ret;
145 }
146 gpio_direction_output(USBH1_VBUSEN_B, 1);
147
148 return 0;
149}
150
151
152static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
153{
154 if (on)
155 gpio_set_value(USBH1_VBUSEN_B, 0);
156 else
157 gpio_set_value(USBH1_VBUSEN_B, 1);
158
159 return 0;
160}
161
162static struct mxc_usbh_platform_data usbh1_pdata = {
163 .init = devboard_usbh1_hw_init,
164 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
165 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
166};
167
168static int __init devboard_usbh1_init(void)
169{
170 struct otg_transceiver *otg;
171
172 otg = kzalloc(sizeof(*otg), GFP_KERNEL);
173 if (!otg)
174 return -ENOMEM;
175
176 otg->label = "ISP1105";
177 otg->init = devboard_isp1105_init;
178 otg->set_vbus = devboard_isp1105_set_vbus;
179
180 usbh1_pdata.otg = otg;
181
182 return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
183}
184
101/* 185/*
102 * system init for baseboard usage. Will be called by mx31moboard init. 186 * system init for baseboard usage. Will be called by mx31moboard init.
103 */ 187 */
@@ -111,4 +195,6 @@ void __init mx31moboard_devboard_init(void)
111 mxc_register_device(&mxc_uart_device1, &uart_pdata); 195 mxc_register_device(&mxc_uart_device1, &uart_pdata);
112 196
113 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 197 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
198
199 devboard_usbh1_init();
114} 200}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 2bfaffb344f0..85184a35e674 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -16,17 +16,26 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */ 17 */
18 18
19#include <linux/delay.h>
19#include <linux/gpio.h> 20#include <linux/gpio.h>
20#include <linux/init.h> 21#include <linux/init.h>
21#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/i2c.h>
24#include <linux/spi/spi.h>
22#include <linux/platform_device.h> 25#include <linux/platform_device.h>
23#include <linux/types.h> 26#include <linux/types.h>
24 27
28#include <linux/usb/otg.h>
29
25#include <mach/common.h> 30#include <mach/common.h>
26#include <mach/hardware.h> 31#include <mach/hardware.h>
27#include <mach/imx-uart.h> 32#include <mach/imx-uart.h>
28#include <mach/iomux-mx3.h> 33#include <mach/iomux-mx3.h>
29#include <mach/mmc.h> 34#include <mach/mmc.h>
35#include <mach/mxc_ehci.h>
36#include <mach/ulpi.h>
37
38#include <media/soc_camera.h>
30 39
31#include "devices.h" 40#include "devices.h"
32 41
@@ -37,7 +46,6 @@ static unsigned int marxbot_pins[] = {
37 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD, 46 MX31_PIN_PC_CD2_B__SD2_CLK, MX31_PIN_PC_CD1_B__SD2_CMD,
38 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29, 47 MX31_PIN_ATA_DIOR__GPIO3_28, MX31_PIN_ATA_DIOW__GPIO3_29,
39 /* CSI */ 48 /* CSI */
40 MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
41 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7, 49 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
42 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9, 50 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
43 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11, 51 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
@@ -45,10 +53,19 @@ static unsigned int marxbot_pins[] = {
45 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15, 53 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
46 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK, 54 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
47 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC, 55 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
56 MX31_PIN_CSI_D4__GPIO3_4, MX31_PIN_CSI_D5__GPIO3_5,
48 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1, 57 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
49 MX31_PIN_TXD2__GPIO1_28, 58 MX31_PIN_TXD2__GPIO1_28,
50 /* dsPIC resets */ 59 /* dsPIC resets */
51 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22, 60 MX31_PIN_STXD5__GPIO1_21, MX31_PIN_SRXD5__GPIO1_22,
61 /*battery detection */
62 MX31_PIN_LCS0__GPIO3_23,
63 /* USB H1 */
64 MX31_PIN_CSPI1_MISO__USBH1_RXDP, MX31_PIN_CSPI1_MOSI__USBH1_RXDM,
65 MX31_PIN_CSPI1_SS0__USBH1_TXDM, MX31_PIN_CSPI1_SS1__USBH1_TXDP,
66 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
67 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
68 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
52}; 69};
53 70
54#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) 71#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
@@ -120,6 +137,166 @@ static void dspics_resets_init(void)
120 } 137 }
121} 138}
122 139
140static struct spi_board_info marxbot_spi_board_info[] __initdata = {
141 {
142 .modalias = "spidev",
143 .max_speed_hz = 300000,
144 .bus_num = 1,
145 .chip_select = 1, /* according spi1_cs[] ! */
146 },
147};
148
149#define TURRETCAM_POWER IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
150#define BASECAM_POWER IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
151#define TURRETCAM_RST_B IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
152#define BASECAM_RST_B IOMUX_TO_GPIO(MX31_PIN_CSI_D4)
153#define CAM_CHOICE IOMUX_TO_GPIO(MX31_PIN_TXD2)
154
155static int marxbot_basecam_power(struct device *dev, int on)
156{
157 gpio_set_value(BASECAM_POWER, !on);
158 return 0;
159}
160
161static int marxbot_basecam_reset(struct device *dev)
162{
163 gpio_set_value(BASECAM_RST_B, 0);
164 udelay(100);
165 gpio_set_value(BASECAM_RST_B, 1);
166 return 0;
167}
168
169static struct i2c_board_info marxbot_i2c_devices[] = {
170 {
171 I2C_BOARD_INFO("mt9t031", 0x5d),
172 },
173};
174
175static struct soc_camera_link base_iclink = {
176 .bus_id = 0, /* Must match with the camera ID */
177 .power = marxbot_basecam_power,
178 .reset = marxbot_basecam_reset,
179 .board_info = &marxbot_i2c_devices[0],
180 .i2c_adapter_id = 0,
181 .module_name = "mt9t031",
182};
183
184static struct platform_device marxbot_camera[] = {
185 {
186 .name = "soc-camera-pdrv",
187 .id = 0,
188 .dev = {
189 .platform_data = &base_iclink,
190 },
191 },
192};
193
194static struct platform_device *marxbot_cameras[] __initdata = {
195 &marxbot_camera[0],
196};
197
198static int __init marxbot_cam_init(void)
199{
200 int ret = gpio_request(CAM_CHOICE, "cam-choice");
201 if (ret)
202 return ret;
203 gpio_direction_output(CAM_CHOICE, 1);
204
205 ret = gpio_request(BASECAM_RST_B, "basecam-reset");
206 if (ret)
207 return ret;
208 gpio_direction_output(BASECAM_RST_B, 1);
209 ret = gpio_request(BASECAM_POWER, "basecam-standby");
210 if (ret)
211 return ret;
212 gpio_direction_output(BASECAM_POWER, 0);
213
214 ret = gpio_request(TURRETCAM_RST_B, "turretcam-reset");
215 if (ret)
216 return ret;
217 gpio_direction_output(TURRETCAM_RST_B, 1);
218 ret = gpio_request(TURRETCAM_POWER, "turretcam-standby");
219 if (ret)
220 return ret;
221 gpio_direction_output(TURRETCAM_POWER, 0);
222
223 return 0;
224}
225
226#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
227 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
228
229static int marxbot_usbh1_hw_init(struct platform_device *pdev)
230{
231 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
232
233 mxc_iomux_set_pad(MX31_PIN_CSPI1_MISO, USB_PAD_CFG);
234 mxc_iomux_set_pad(MX31_PIN_CSPI1_MOSI, USB_PAD_CFG);
235 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS0, USB_PAD_CFG);
236 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS1, USB_PAD_CFG);
237 mxc_iomux_set_pad(MX31_PIN_CSPI1_SS2, USB_PAD_CFG);
238 mxc_iomux_set_pad(MX31_PIN_CSPI1_SCLK, USB_PAD_CFG);
239 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
240 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
241
242 return 0;
243}
244
245#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
246#define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE)
247
248static int marxbot_isp1105_init(struct otg_transceiver *otg)
249{
250 int ret = gpio_request(USBH1_MODE, "usbh1-mode");
251 if (ret)
252 return ret;
253 /* single ended */
254 gpio_direction_output(USBH1_MODE, 0);
255
256 ret = gpio_request(USBH1_VBUSEN_B, "usbh1-vbusen");
257 if (ret) {
258 gpio_free(USBH1_MODE);
259 return ret;
260 }
261 gpio_direction_output(USBH1_VBUSEN_B, 1);
262
263 return 0;
264}
265
266
267static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
268{
269 if (on)
270 gpio_set_value(USBH1_VBUSEN_B, 0);
271 else
272 gpio_set_value(USBH1_VBUSEN_B, 1);
273
274 return 0;
275}
276
277static struct mxc_usbh_platform_data usbh1_pdata = {
278 .init = marxbot_usbh1_hw_init,
279 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
280 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
281};
282
283static int __init marxbot_usbh1_init(void)
284{
285 struct otg_transceiver *otg;
286
287 otg = kzalloc(sizeof(*otg), GFP_KERNEL);
288 if (!otg)
289 return -ENOMEM;
290
291 otg->label = "ISP1105";
292 otg->init = marxbot_isp1105_init;
293 otg->set_vbus = marxbot_isp1105_set_vbus;
294
295 usbh1_pdata.otg = otg;
296
297 return mxc_register_device(&mx31_usbh1, &usbh1_pdata);
298}
299
123/* 300/*
124 * system init for baseboard usage. Will be called by mx31moboard init. 301 * system init for baseboard usage. Will be called by mx31moboard init.
125 */ 302 */
@@ -133,4 +310,17 @@ void __init mx31moboard_marxbot_init(void)
133 dspics_resets_init(); 310 dspics_resets_init();
134 311
135 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 312 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
313
314 spi_register_board_info(marxbot_spi_board_info,
315 ARRAY_SIZE(marxbot_spi_board_info));
316
317 marxbot_cam_init();
318 platform_add_devices(marxbot_cameras, ARRAY_SIZE(marxbot_cameras));
319
320 /* battery present pin */
321 gpio_request(IOMUX_TO_GPIO(MX31_PIN_LCS0), "bat-present");
322 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_LCS0));
323 gpio_export(IOMUX_TO_GPIO(MX31_PIN_LCS0), false);
324
325 marxbot_usbh1_init();
136} 326}
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index 9243de54041a..1ec679a3c72f 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/dma-mapping.h>
20#include <linux/fsl_devices.h> 21#include <linux/fsl_devices.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22#include <linux/init.h> 23#include <linux/init.h>
@@ -26,8 +27,14 @@
26#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
27#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
28#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/regulator/machine.h>
31#include <linux/mfd/mc13783.h>
32#include <linux/spi/spi.h>
29#include <linux/types.h> 33#include <linux/types.h>
30 34
35#include <linux/usb/otg.h>
36#include <linux/usb/ulpi.h>
37
31#include <asm/mach-types.h> 38#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
33#include <asm/mach/time.h> 40#include <asm/mach/time.h>
@@ -37,16 +44,20 @@
37#include <mach/hardware.h> 44#include <mach/hardware.h>
38#include <mach/imx-uart.h> 45#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h> 46#include <mach/iomux-mx3.h>
47#include <mach/ipu.h>
40#include <mach/i2c.h> 48#include <mach/i2c.h>
41#include <mach/mmc.h> 49#include <mach/mmc.h>
42#include <mach/mx31.h> 50#include <mach/mxc_ehci.h>
51#include <mach/mx3_camera.h>
52#include <mach/spi.h>
53#include <mach/ulpi.h>
43 54
44#include "devices.h" 55#include "devices.h"
45 56
46static unsigned int moboard_pins[] = { 57static unsigned int moboard_pins[] = {
47 /* UART0 */ 58 /* UART0 */
48 MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
49 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1, 59 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
60 MX31_PIN_CTS1__GPIO2_7,
50 /* UART4 */ 61 /* UART4 */
51 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5, 62 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
52 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5, 63 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
@@ -73,12 +84,31 @@ static unsigned int moboard_pins[] = {
73 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR, 84 MX31_PIN_USBOTG_CLK__USBOTG_CLK, MX31_PIN_USBOTG_DIR__USBOTG_DIR,
74 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP, 85 MX31_PIN_USBOTG_NXT__USBOTG_NXT, MX31_PIN_USBOTG_STP__USBOTG_STP,
75 MX31_PIN_USB_OC__GPIO1_30, 86 MX31_PIN_USB_OC__GPIO1_30,
87 /* USB H2 */
88 MX31_PIN_USBH2_DATA0__USBH2_DATA0,
89 MX31_PIN_USBH2_DATA1__USBH2_DATA1,
90 MX31_PIN_STXD3__USBH2_DATA2, MX31_PIN_SRXD3__USBH2_DATA3,
91 MX31_PIN_SCK3__USBH2_DATA4, MX31_PIN_SFS3__USBH2_DATA5,
92 MX31_PIN_STXD6__USBH2_DATA6, MX31_PIN_SRXD6__USBH2_DATA7,
93 MX31_PIN_USBH2_CLK__USBH2_CLK, MX31_PIN_USBH2_DIR__USBH2_DIR,
94 MX31_PIN_USBH2_NXT__USBH2_NXT, MX31_PIN_USBH2_STP__USBH2_STP,
95 MX31_PIN_SCK6__GPIO1_25,
76 /* LEDs */ 96 /* LEDs */
77 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, 97 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
78 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, 98 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
79 /* SEL */ 99 /* SEL */
80 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9, 100 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
81 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11, 101 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
102 /* SPI1 */
103 MX31_PIN_CSPI2_MOSI__MOSI, MX31_PIN_CSPI2_MISO__MISO,
104 MX31_PIN_CSPI2_SCLK__SCLK, MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
105 MX31_PIN_CSPI2_SS0__SS0, MX31_PIN_CSPI2_SS2__SS2,
106 /* Atlas IRQ */
107 MX31_PIN_GPIO1_3__GPIO1_3,
108 /* SPI2 */
109 MX31_PIN_CSPI3_MOSI__MOSI, MX31_PIN_CSPI3_MISO__MISO,
110 MX31_PIN_CSPI3_SCLK__SCLK, MX31_PIN_CSPI3_SPI_RDY__SPI_RDY,
111 MX31_PIN_CSPI2_SS1__CSPI3_SS1,
82}; 112};
83 113
84static struct physmap_flash_data mx31moboard_flash_data = { 114static struct physmap_flash_data mx31moboard_flash_data = {
@@ -101,7 +131,18 @@ static struct platform_device mx31moboard_flash = {
101 .num_resources = 1, 131 .num_resources = 1,
102}; 132};
103 133
104static struct imxuart_platform_data uart_pdata = { 134static int moboard_uart0_init(struct platform_device *pdev)
135{
136 gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack");
137 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
138 return 0;
139}
140
141static struct imxuart_platform_data uart0_pdata = {
142 .init = moboard_uart0_init,
143};
144
145static struct imxuart_platform_data uart4_pdata = {
105 .flags = IMXUART_HAVE_RTSCTS, 146 .flags = IMXUART_HAVE_RTSCTS,
106}; 147};
107 148
@@ -113,6 +154,103 @@ static struct imxi2c_platform_data moboard_i2c1_pdata = {
113 .bitrate = 100000, 154 .bitrate = 100000,
114}; 155};
115 156
157static int moboard_spi1_cs[] = {
158 MXC_SPI_CS(0),
159 MXC_SPI_CS(2),
160};
161
162static struct spi_imx_master moboard_spi1_master = {
163 .chipselect = moboard_spi1_cs,
164 .num_chipselect = ARRAY_SIZE(moboard_spi1_cs),
165};
166
167static struct regulator_consumer_supply sdhc_consumers[] = {
168 {
169 .dev = &mxcsdhc_device0.dev,
170 .supply = "sdhc0_vcc",
171 },
172 {
173 .dev = &mxcsdhc_device1.dev,
174 .supply = "sdhc1_vcc",
175 },
176};
177
178static struct regulator_init_data sdhc_vreg_data = {
179 .constraints = {
180 .min_uV = 2700000,
181 .max_uV = 3000000,
182 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
183 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
184 .valid_modes_mask = REGULATOR_MODE_NORMAL |
185 REGULATOR_MODE_FAST,
186 .always_on = 0,
187 .boot_on = 1,
188 },
189 .num_consumer_supplies = ARRAY_SIZE(sdhc_consumers),
190 .consumer_supplies = sdhc_consumers,
191};
192
193static struct regulator_consumer_supply cam_consumers[] = {
194 {
195 .dev = &mx3_camera.dev,
196 .supply = "cam_vcc",
197 },
198};
199
200static struct regulator_init_data cam_vreg_data = {
201 .constraints = {
202 .min_uV = 2700000,
203 .max_uV = 3000000,
204 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
205 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
206 .valid_modes_mask = REGULATOR_MODE_NORMAL |
207 REGULATOR_MODE_FAST,
208 .always_on = 0,
209 .boot_on = 1,
210 },
211 .num_consumer_supplies = ARRAY_SIZE(cam_consumers),
212 .consumer_supplies = cam_consumers,
213};
214
215static struct mc13783_regulator_init_data moboard_regulators[] = {
216 {
217 .id = MC13783_REGU_VMMC1,
218 .init_data = &sdhc_vreg_data,
219 },
220 {
221 .id = MC13783_REGU_VCAM,
222 .init_data = &cam_vreg_data,
223 },
224};
225
226static struct mc13783_platform_data moboard_pmic = {
227 .regulators = moboard_regulators,
228 .num_regulators = ARRAY_SIZE(moboard_regulators),
229 .flags = MC13783_USE_REGULATOR | MC13783_USE_RTC,
230 MC13783_USE_ADC,
231};
232
233static struct spi_board_info moboard_spi_board_info[] __initdata = {
234 {
235 .modalias = "mc13783",
236 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
237 .max_speed_hz = 300000,
238 .bus_num = 1,
239 .chip_select = 0,
240 .platform_data = &moboard_pmic,
241 .mode = SPI_CS_HIGH,
242 },
243};
244
245static int moboard_spi2_cs[] = {
246 MXC_SPI_CS(1),
247};
248
249static struct spi_imx_master moboard_spi2_master = {
250 .chipselect = moboard_spi2_cs,
251 .num_chipselect = ARRAY_SIZE(moboard_spi2_cs),
252};
253
116#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0) 254#define SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_ATA_CS0)
117#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1) 255#define SDHC1_WP IOMUX_TO_GPIO(MX31_PIN_ATA_CS1)
118 256
@@ -208,6 +346,56 @@ static struct fsl_usb2_platform_data usb_pdata = {
208 .phy_mode = FSL_USB2_PHY_ULPI, 346 .phy_mode = FSL_USB2_PHY_ULPI,
209}; 347};
210 348
349#define USBH2_EN_B IOMUX_TO_GPIO(MX31_PIN_SCK6)
350
351static int moboard_usbh2_hw_init(struct platform_device *pdev)
352{
353 int ret = gpio_request(USBH2_EN_B, "usbh2-en");
354 if (ret)
355 return ret;
356
357 mxc_iomux_set_gpr(MUX_PGP_UH2, true);
358
359 mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, USB_PAD_CFG);
360 mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, USB_PAD_CFG);
361 mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, USB_PAD_CFG);
362 mxc_iomux_set_pad(MX31_PIN_USBH2_STP, USB_PAD_CFG);
363 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, USB_PAD_CFG);
364 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, USB_PAD_CFG);
365 mxc_iomux_set_pad(MX31_PIN_SRXD6, USB_PAD_CFG);
366 mxc_iomux_set_pad(MX31_PIN_STXD6, USB_PAD_CFG);
367 mxc_iomux_set_pad(MX31_PIN_SFS3, USB_PAD_CFG);
368 mxc_iomux_set_pad(MX31_PIN_SCK3, USB_PAD_CFG);
369 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG);
370 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG);
371
372 gpio_direction_output(USBH2_EN_B, 0);
373
374 return 0;
375}
376
377static int moboard_usbh2_hw_exit(struct platform_device *pdev)
378{
379 gpio_free(USBH2_EN_B);
380 return 0;
381}
382
383static struct mxc_usbh_platform_data usbh2_pdata = {
384 .init = moboard_usbh2_hw_init,
385 .exit = moboard_usbh2_hw_exit,
386 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
387 .flags = MXC_EHCI_POWER_PINS_ENABLED,
388};
389
390static int __init moboard_usbh2_init(void)
391{
392 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
393 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
394
395 return mxc_register_device(&mx31_usbh2, &usbh2_pdata);
396}
397
398
211static struct gpio_led mx31moboard_leds[] = { 399static struct gpio_led mx31moboard_leds[] = {
212 { 400 {
213 .name = "coreboard-led-0:red:running", 401 .name = "coreboard-led-0:red:running",
@@ -266,11 +454,48 @@ static void mx31moboard_init_sel_gpios(void)
266 } 454 }
267} 455}
268 456
457static struct ipu_platform_data mx3_ipu_data = {
458 .irq_base = MXC_IPU_IRQ_START,
459};
460
269static struct platform_device *devices[] __initdata = { 461static struct platform_device *devices[] __initdata = {
270 &mx31moboard_flash, 462 &mx31moboard_flash,
271 &mx31moboard_leds_device, 463 &mx31moboard_leds_device,
272}; 464};
273 465
466static struct mx3_camera_pdata camera_pdata = {
467 .dma_dev = &mx3_ipu.dev,
468 .flags = MX3_CAMERA_DATAWIDTH_8 | MX3_CAMERA_DATAWIDTH_10,
469 .mclk_10khz = 4800,
470};
471
472#define CAMERA_BUF_SIZE (4*1024*1024)
473
474static int __init mx31moboard_cam_alloc_dma(const size_t buf_size)
475{
476 dma_addr_t dma_handle;
477 void *buf;
478 int dma;
479
480 if (buf_size < 2 * 1024 * 1024)
481 return -EINVAL;
482
483 buf = dma_alloc_coherent(NULL, buf_size, &dma_handle, GFP_KERNEL);
484 if (!buf) {
485 pr_err("%s: cannot allocate camera buffer-memory\n", __func__);
486 return -ENOMEM;
487 }
488
489 memset(buf, 0, buf_size);
490
491 dma = dma_declare_coherent_memory(&mx3_camera.dev,
492 dma_handle, dma_handle, buf_size,
493 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
494
495 /* The way we call dma_declare_coherent_memory only a malloc can fail */
496 return dma & DMA_MEMORY_MAP ? 0 : -ENOMEM;
497}
498
274static int mx31moboard_baseboard; 499static int mx31moboard_baseboard;
275core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444); 500core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
276 501
@@ -284,20 +509,34 @@ static void __init mxc_board_init(void)
284 509
285 platform_add_devices(devices, ARRAY_SIZE(devices)); 510 platform_add_devices(devices, ARRAY_SIZE(devices));
286 511
287 mxc_register_device(&mxc_uart_device0, &uart_pdata); 512 mxc_register_device(&mxc_uart_device0, &uart0_pdata);
288 mxc_register_device(&mxc_uart_device4, &uart_pdata); 513
514 mxc_register_device(&mxc_uart_device4, &uart4_pdata);
289 515
290 mx31moboard_init_sel_gpios(); 516 mx31moboard_init_sel_gpios();
291 517
292 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); 518 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
293 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); 519 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
294 520
521 mxc_register_device(&mxc_spi_device1, &moboard_spi1_master);
522 mxc_register_device(&mxc_spi_device2, &moboard_spi2_master);
523
524 gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq");
525 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3));
526 spi_register_board_info(moboard_spi_board_info,
527 ARRAY_SIZE(moboard_spi_board_info));
528
295 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); 529 mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata);
296 530
531 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
532 if (!mx31moboard_cam_alloc_dma(CAMERA_BUF_SIZE))
533 mxc_register_device(&mx3_camera, &camera_pdata);
534
297 usb_xcvr_reset(); 535 usb_xcvr_reset();
298 536
299 moboard_usbotg_init(); 537 moboard_usbotg_init();
300 mxc_register_device(&mxc_otg_udc_device, &usb_pdata); 538 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
539 moboard_usbh2_init();
301 540
302 switch (mx31moboard_baseboard) { 541 switch (mx31moboard_baseboard) {
303 case MX31NOBOARD: 542 case MX31NOBOARD:
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
index e18a224671fa..e3aa829be586 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -43,6 +43,7 @@
43#include <mach/iomux-mx35.h> 43#include <mach/iomux-mx35.h>
44#include <mach/ipu.h> 44#include <mach/ipu.h>
45#include <mach/mx3fb.h> 45#include <mach/mx3fb.h>
46#include <mach/mxc_nand.h>
46 47
47#include "devices.h" 48#include "devices.h"
48 49
@@ -206,6 +207,11 @@ static struct pad_desc pcm043_pads[] = {
206 MX35_PAD_ATA_CS0__GPIO2_6, 207 MX35_PAD_ATA_CS0__GPIO2_6,
207}; 208};
208 209
210static struct mxc_nand_platform_data pcm037_nand_board_info = {
211 .width = 1,
212 .hw_ecc = 1,
213};
214
209/* 215/*
210 * Board specific initialization. 216 * Board specific initialization.
211 */ 217 */
@@ -216,6 +222,7 @@ static void __init mxc_board_init(void)
216 platform_add_devices(devices, ARRAY_SIZE(devices)); 222 platform_add_devices(devices, ARRAY_SIZE(devices));
217 223
218 mxc_register_device(&mxc_uart_device0, &uart_pdata); 224 mxc_register_device(&mxc_uart_device0, &uart_pdata);
225 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
219 226
220 mxc_register_device(&mxc_uart_device1, &uart_pdata); 227 mxc_register_device(&mxc_uart_device1, &uart_pdata);
221 228
diff --git a/arch/arm/mach-s3c2400/include/mach/map.h b/arch/arm/mach-s3c2400/include/mach/map.h
index 1535540edc82..3fd889200e99 100644
--- a/arch/arm/mach-s3c2400/include/mach/map.h
+++ b/arch/arm/mach-s3c2400/include/mach/map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2400/include/mach/map.h 1/* arch/arm/mach-s3c2400/include/mach/map.h
2 * 2 *
3 * Copyright 2003,2007 Simtec Electronics 3 * Copyright 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 3d4e9da3fa52..dd1fcc7e6708 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -81,6 +81,14 @@ config ARCH_H1940
81 help 81 help
82 Say Y here if you are using the HP IPAQ H1940 82 Say Y here if you are using the HP IPAQ H1940
83 83
84config H1940BT
85 tristate "Control the state of H1940 bluetooth chip"
86 depends on ARCH_H1940
87 select RFKILL
88 help
89 This is a simple driver that is able to control
90 the state of built in bluetooth chip on h1940.
91
84config PM_H1940 92config PM_H1940
85 bool 93 bool
86 help 94 help
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 2ab5ba4b266f..0d468e96e83e 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -21,7 +21,8 @@ obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o
21# Machine support 21# Machine support
22 22
23obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o 23obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
24obj-$(CONFIG_ARCH_H1940) += mach-h1940.o h1940-bluetooth.o 24obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
25obj-$(CONFIG_H1940BT) += h1940-bluetooth.o
25obj-$(CONFIG_PM_H1940) += pm-h1940.o 26obj-$(CONFIG_PM_H1940) += pm-h1940.o
26obj-$(CONFIG_MACH_N30) += mach-n30.o 27obj-$(CONFIG_MACH_N30) += mach-n30.o
27obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o 28obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
index 9a37c87152b0..217b102866d0 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/bast-irq.c 1/* linux/arch/arm/mach-s3c2410/bast-irq.c
2 * 2 *
3 * Copyright (c) 2003,2005 Simtec Electronics 3 * Copyright 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -141,7 +141,7 @@ static __init int bast_irq_init(void)
141 unsigned int i; 141 unsigned int i;
142 142
143 if (machine_is_bast()) { 143 if (machine_is_bast()) {
144 printk(KERN_INFO "BAST PC104 IRQ routing, (c) 2005 Simtec Electronics\n"); 144 printk(KERN_INFO "BAST PC104 IRQ routing, Copyright 2005 Simtec Electronics\n");
145 145
146 /* zap all the IRQs */ 146 /* zap all the IRQs */
147 147
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
index 9d1186877d08..75189df995ae 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/cpu-freq.c 1/* linux/arch/arm/mach-s3c2410/cpu-freq.c
2 * 2 *
3 * Copyright (c) 2006,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index 5aabf117cbb0..b7d1f8d27bc2 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -17,6 +17,7 @@
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/leds.h> 18#include <linux/leds.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/rfkill.h>
20 21
21#include <mach/regs-gpio.h> 22#include <mach/regs-gpio.h>
22#include <mach/hardware.h> 23#include <mach/hardware.h>
@@ -24,21 +25,10 @@
24 25
25#define DRV_NAME "h1940-bt" 26#define DRV_NAME "h1940-bt"
26 27
27#ifdef CONFIG_LEDS_H1940
28DEFINE_LED_TRIGGER(bt_led_trigger);
29#endif
30
31static int state;
32
33/* Bluetooth control */ 28/* Bluetooth control */
34static void h1940bt_enable(int on) 29static void h1940bt_enable(int on)
35{ 30{
36 if (on) { 31 if (on) {
37#ifdef CONFIG_LEDS_H1940
38 /* flashing Blue */
39 led_trigger_event(bt_led_trigger, LED_HALF);
40#endif
41
42 /* Power on the chip */ 32 /* Power on the chip */
43 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); 33 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER);
44 /* Reset the chip */ 34 /* Reset the chip */
@@ -46,48 +36,31 @@ static void h1940bt_enable(int on)
46 s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 36 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
47 mdelay(10); 37 mdelay(10);
48 s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 38 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
49
50 state = 1;
51 } 39 }
52 else { 40 else {
53#ifdef CONFIG_LEDS_H1940
54 led_trigger_event(bt_led_trigger, 0);
55#endif
56
57 s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 41 s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
58 mdelay(10); 42 mdelay(10);
59 s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 43 s3c2410_gpio_setpin(S3C2410_GPH(1), 0);
60 mdelay(10); 44 mdelay(10);
61 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); 45 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0);
62
63 state = 0;
64 } 46 }
65} 47}
66 48
67static ssize_t h1940bt_show(struct device *dev, struct device_attribute *attr, char *buf) 49static int h1940bt_set_block(void *data, bool blocked)
68{ 50{
69 return snprintf(buf, PAGE_SIZE, "%d\n", state); 51 h1940bt_enable(!blocked);
52 return 0;
70} 53}
71 54
72static ssize_t h1940bt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) 55static const struct rfkill_ops h1940bt_rfkill_ops = {
73{ 56 .set_block = h1940bt_set_block,
74 int new_state; 57};
75 char *endp;
76
77 new_state = simple_strtoul(buf, &endp, 0);
78 if (*endp && !isspace(*endp))
79 return -EINVAL;
80
81 h1940bt_enable(new_state);
82
83 return count;
84}
85static DEVICE_ATTR(enable, 0644,
86 h1940bt_show,
87 h1940bt_store);
88 58
89static int __init h1940bt_probe(struct platform_device *pdev) 59static int __init h1940bt_probe(struct platform_device *pdev)
90{ 60{
61 struct rfkill *rfk;
62 int ret = 0;
63
91 /* Configures BT serial port GPIOs */ 64 /* Configures BT serial port GPIOs */
92 s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); 65 s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0);
93 s3c2410_gpio_pullup(S3C2410_GPH(0), 1); 66 s3c2410_gpio_pullup(S3C2410_GPH(0), 1);
@@ -98,21 +71,44 @@ static int __init h1940bt_probe(struct platform_device *pdev)
98 s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); 71 s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0);
99 s3c2410_gpio_pullup(S3C2410_GPH(3), 1); 72 s3c2410_gpio_pullup(S3C2410_GPH(3), 1);
100 73
101#ifdef CONFIG_LEDS_H1940
102 led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger);
103#endif
104 74
105 /* disable BT by default */ 75 rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
106 h1940bt_enable(0); 76 &h1940bt_rfkill_ops, NULL);
77 if (!rfk) {
78 ret = -ENOMEM;
79 goto err_rfk_alloc;
80 }
81
82 rfkill_set_led_trigger_name(rfk, "h1940-bluetooth");
83
84 ret = rfkill_register(rfk);
85 if (ret)
86 goto err_rfkill;
87
88 platform_set_drvdata(pdev, rfk);
89
90 return 0;
107 91
108 return device_create_file(&pdev->dev, &dev_attr_enable); 92err_rfkill:
93 rfkill_destroy(rfk);
94err_rfk_alloc:
95 return ret;
109} 96}
110 97
111static int h1940bt_remove(struct platform_device *pdev) 98static int h1940bt_remove(struct platform_device *pdev)
112{ 99{
113#ifdef CONFIG_LEDS_H1940 100 struct rfkill *rfk = platform_get_drvdata(pdev);
114 led_trigger_unregister_simple(bt_led_trigger); 101
115#endif 102 platform_set_drvdata(pdev, NULL);
103
104 if (rfk) {
105 rfkill_unregister(rfk);
106 rfkill_destroy(rfk);
107 }
108 rfk = NULL;
109
110 h1940bt_enable(0);
111
116 return 0; 112 return 0;
117} 113}
118 114
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h b/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
index 20493b048360..bee2a7a932a0 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-cpld.h 1/* arch/arm/mach-s3c2410/include/mach/bast-cpld.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * BAST - CPLD control constants 6 * BAST - CPLD control constants
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-irq.h b/arch/arm/mach-s3c2410/include/mach/bast-irq.h
index 501c202b53cf..cac428c42e7f 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-irq.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-irq.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-irq.h 1/* arch/arm/mach-s3c2410/include/mach/bast-irq.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - IRQ Number definitions 6 * Machine BAST - IRQ Number definitions
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-map.h b/arch/arm/mach-s3c2410/include/mach/bast-map.h
index c2c5baf07345..6e7dc9d0cf0e 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-map.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-map.h 1/* arch/arm/mach-s3c2410/include/mach/bast-map.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine BAST - Memory map definitions 6 * Machine BAST - Memory map definitions
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h b/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
index 61684cb8ce59..4c38b39b741d 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
+++ b/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/bast-pmu.h 1/* arch/arm/mach-s3c2410/include/mach/bast-pmu.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * Vincent Sanders <vince@simtec.co.uk> 5 * Vincent Sanders <vince@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index 92e2687009ea..08ac5f96c012 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h 1/* arch/arm/mach-s3c2410/include/mach/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C24XX DMA support 6 * Samsung S3C24XX DMA support
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
index 801dff13858d..035a493952db 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h 1/* arch/arm/mach-s3c2410/include/mach/gpio-fns.h
2 * 2 *
3 * Copyright (c) 2003,2009 Simtec Electronics 3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - hardware 6 * S3C2410 - hardware
diff --git a/arch/arm/mach-s3c2410/include/mach/osiris-map.h b/arch/arm/mach-s3c2410/include/mach/osiris-map.h
index 639eff523d4e..17380f848428 100644
--- a/arch/arm/mach-s3c2410/include/mach/osiris-map.h
+++ b/arch/arm/mach-s3c2410/include/mach/osiris-map.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/osiris-map.h 1/* arch/arm/mach-s3c2410/include/mach/osiris-map.h
2 * 2 *
3 * (c) 2005 Simtec Electronics 3 * Copyright 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/ 4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-clock.h
index 2a5d90e957fb..9a0d169be137 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-clock.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-clock.h 1/* arch/arm/mach-s3c2410/include/mach/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index f6e8eec879c8..ebc85c6dadbf 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-gpio.h 1/* arch/arm/mach-s3c2410/include/mach/regs-gpio.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2004 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-power.h b/arch/arm/mach-s3c2410/include/mach/regs-power.h
index 2d36353f57d7..4932b87bdf3d 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-power.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-power.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-power.h 1/* arch/arm/mach-s3c2410/include/mach/regs-power.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c2410/include/mach/uncompress.h b/arch/arm/mach-s3c2410/include/mach/uncompress.h
index c9432103750d..72f756c5e504 100644
--- a/arch/arm/mach-s3c2410/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c2410/include/mach/uncompress.h
@@ -1,7 +1,6 @@
1
2/* arch/arm/mach-s3c2410/include/mach/uncompress.h 1/* arch/arm/mach-s3c2410/include/mach/uncompress.h
3 * 2 *
4 * Copyright (c) 2003, 2007 Simtec Electronics 3 * Copyright (c) 2003-2007 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
7 * 6 *
diff --git a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h b/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
index f53f85b4ad8b..47add133b8ee 100644
--- a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
+++ b/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/vr1000-irq.h 1/* arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine VR1000 - IRQ Number definitions 6 * Machine VR1000 - IRQ Number definitions
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 647c9adb018f..4c79ac8a6c33 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/mach-bast.c 1/* linux/arch/arm/mach-s3c2410/mach-bast.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright 2003-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -61,11 +61,12 @@
61#include <plat/devs.h> 61#include <plat/devs.h>
62#include <plat/cpu.h> 62#include <plat/cpu.h>
63#include <plat/cpu-freq.h> 63#include <plat/cpu-freq.h>
64#include <plat/audio-simtec.h>
64 65
65#include "usb-simtec.h" 66#include "usb-simtec.h"
66#include "nor-simtec.h" 67#include "nor-simtec.h"
67 68
68#define COPYRIGHT ", (c) 2004-2005 Simtec Electronics" 69#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
69 70
70/* macros for virtual address mods for the io space entries */ 71/* macros for virtual address mods for the io space entries */
71#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5) 72#define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
@@ -247,7 +248,7 @@ static int chip0_map[] = { 1 };
247static int chip1_map[] = { 2 }; 248static int chip1_map[] = { 2 };
248static int chip2_map[] = { 3 }; 249static int chip2_map[] = { 3 };
249 250
250static struct mtd_partition bast_default_nand_part[] = { 251static struct mtd_partition __initdata bast_default_nand_part[] = {
251 [0] = { 252 [0] = {
252 .name = "Boot Agent", 253 .name = "Boot Agent",
253 .size = SZ_16K, 254 .size = SZ_16K,
@@ -273,7 +274,7 @@ static struct mtd_partition bast_default_nand_part[] = {
273 * socket. 274 * socket.
274*/ 275*/
275 276
276static struct s3c2410_nand_set bast_nand_sets[] = { 277static struct s3c2410_nand_set __initdata bast_nand_sets[] = {
277 [0] = { 278 [0] = {
278 .name = "SmartMedia", 279 .name = "SmartMedia",
279 .nr_chips = 1, 280 .nr_chips = 1,
@@ -323,7 +324,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
323 __raw_writeb(tmp, BAST_VA_CTRL2); 324 __raw_writeb(tmp, BAST_VA_CTRL2);
324} 325}
325 326
326static struct s3c2410_platform_nand bast_nand_info = { 327static struct s3c2410_platform_nand __initdata bast_nand_info = {
327 .tacls = 30, 328 .tacls = 30,
328 .twrph0 = 60, 329 .twrph0 = 60,
329 .twrph1 = 60, 330 .twrph1 = 60,
@@ -608,6 +609,11 @@ static struct s3c_cpufreq_board __initdata bast_cpufreq = {
608 .need_io = 1, 609 .need_io = 1,
609}; 610};
610 611
612static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {
613 .have_mic = 1,
614 .have_lout = 1,
615};
616
611static void __init bast_map_io(void) 617static void __init bast_map_io(void)
612{ 618{
613 /* initialise the clocks */ 619 /* initialise the clocks */
@@ -625,7 +631,6 @@ static void __init bast_map_io(void)
625 631
626 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks)); 632 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
627 633
628 s3c_device_nand.dev.platform_data = &bast_nand_info;
629 s3c_device_hwmon.dev.platform_data = &bast_hwmon_info; 634 s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
630 635
631 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 636 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
@@ -639,6 +644,7 @@ static void __init bast_init(void)
639 sysdev_register(&bast_pm_sysdev); 644 sysdev_register(&bast_pm_sysdev);
640 645
641 s3c_i2c0_set_platdata(&bast_i2c_info); 646 s3c_i2c0_set_platdata(&bast_i2c_info);
647 s3c_nand_set_platdata(&bast_nand_info);
642 s3c24xx_fb_set_platdata(&bast_fb_info); 648 s3c24xx_fb_set_platdata(&bast_fb_info);
643 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices)); 649 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
644 650
@@ -647,6 +653,7 @@ static void __init bast_init(void)
647 653
648 usb_simtec_init(); 654 usb_simtec_init();
649 nor_simtec_init(); 655 nor_simtec_init();
656 simtec_audio_add(NULL, true, &bast_audio);
650 657
651 s3c_cpufreq_setboard(&bast_cpufreq); 658 s3c_cpufreq_setboard(&bast_cpufreq);
652} 659}
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index d9cd5ddecf4a..49053254c98d 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -21,6 +21,11 @@
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
26#include <video/platform_lcd.h>
27
28#include <linux/mmc/host.h>
24 29
25#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -32,9 +37,12 @@
32 37
33#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
34#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
35#include <mach/regs-gpio.h>
36#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
37 41
42#include <mach/regs-gpio.h>
43#include <mach/gpio-fns.h>
44#include <mach/gpio-nrs.h>
45
38#include <mach/h1940.h> 46#include <mach/h1940.h>
39#include <mach/h1940-latch.h> 47#include <mach/h1940-latch.h>
40#include <mach/fb.h> 48#include <mach/fb.h>
@@ -46,6 +54,7 @@
46#include <plat/cpu.h> 54#include <plat/cpu.h>
47#include <plat/pll.h> 55#include <plat/pll.h>
48#include <plat/pm.h> 56#include <plat/pm.h>
57#include <plat/mci.h>
49 58
50static struct map_desc h1940_iodesc[] __initdata = { 59static struct map_desc h1940_iodesc[] __initdata = {
51 [0] = { 60 [0] = {
@@ -171,16 +180,90 @@ static struct s3c2410fb_mach_info h1940_fb_info __initdata = {
171 .gpdup_mask= 0xffffffff, 180 .gpdup_mask= 0xffffffff,
172}; 181};
173 182
174static struct platform_device s3c_device_leds = { 183static struct platform_device h1940_device_leds = {
175 .name = "h1940-leds", 184 .name = "h1940-leds",
176 .id = -1, 185 .id = -1,
177}; 186};
178 187
179static struct platform_device s3c_device_bluetooth = { 188static struct platform_device h1940_device_bluetooth = {
180 .name = "h1940-bt", 189 .name = "h1940-bt",
181 .id = -1, 190 .id = -1,
182}; 191};
183 192
193static struct s3c24xx_mci_pdata h1940_mmc_cfg = {
194 .gpio_detect = S3C2410_GPF(5),
195 .gpio_wprotect = S3C2410_GPH(8),
196 .set_power = NULL,
197 .ocr_avail = MMC_VDD_32_33,
198};
199
200static int h1940_backlight_init(struct device *dev)
201{
202 gpio_request(S3C2410_GPB(0), "Backlight");
203
204 s3c2410_gpio_setpin(S3C2410_GPB(0), 0);
205 s3c2410_gpio_pullup(S3C2410_GPB(0), 0);
206 s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPB0_TOUT0);
207
208 return 0;
209}
210
211static void h1940_backlight_exit(struct device *dev)
212{
213 s3c2410_gpio_cfgpin(S3C2410_GPB(0), 1/*S3C2410_GPB0_OUTP*/);
214}
215
216static struct platform_pwm_backlight_data backlight_data = {
217 .pwm_id = 0,
218 .max_brightness = 100,
219 .dft_brightness = 50,
220 /* tcnt = 0x31 */
221 .pwm_period_ns = 36296,
222 .init = h1940_backlight_init,
223 .exit = h1940_backlight_exit,
224};
225
226static struct platform_device h1940_backlight = {
227 .name = "pwm-backlight",
228 .dev = {
229 .parent = &s3c_device_timer[0].dev,
230 .platform_data = &backlight_data,
231 },
232 .id = -1,
233};
234
235static void h1940_lcd_power_set(struct plat_lcd_data *pd,
236 unsigned int power)
237{
238 int value;
239
240 if (!power) {
241 /* set to 3ec */
242 s3c2410_gpio_setpin(S3C2410_GPC(0), 0);
243 /* wait for 3ac */
244 do {
245 value = s3c2410_gpio_getpin(S3C2410_GPC(6));
246 } while (value);
247 /* set to 38c */
248 s3c2410_gpio_setpin(S3C2410_GPC(5), 0);
249 } else {
250 /* Set to 3ac */
251 s3c2410_gpio_setpin(S3C2410_GPC(5), 1);
252 /* Set to 3ad */
253 s3c2410_gpio_setpin(S3C2410_GPC(0), 1);
254 }
255}
256
257static struct plat_lcd_data h1940_lcd_power_data = {
258 .set_power = h1940_lcd_power_set,
259};
260
261static struct platform_device h1940_lcd_powerdev = {
262 .name = "platform-lcd",
263 .dev.parent = &s3c_device_lcd.dev,
264 .dev.platform_data = &h1940_lcd_power_data,
265};
266
184static struct platform_device *h1940_devices[] __initdata = { 267static struct platform_device *h1940_devices[] __initdata = {
185 &s3c_device_usb, 268 &s3c_device_usb,
186 &s3c_device_lcd, 269 &s3c_device_lcd,
@@ -188,8 +271,13 @@ static struct platform_device *h1940_devices[] __initdata = {
188 &s3c_device_i2c0, 271 &s3c_device_i2c0,
189 &s3c_device_iis, 272 &s3c_device_iis,
190 &s3c_device_usbgadget, 273 &s3c_device_usbgadget,
191 &s3c_device_leds, 274 &h1940_device_leds,
192 &s3c_device_bluetooth, 275 &h1940_device_bluetooth,
276 &s3c_device_sdi,
277 &s3c_device_rtc,
278 &s3c_device_timer[0],
279 &h1940_backlight,
280 &h1940_lcd_powerdev,
193}; 281};
194 282
195static void __init h1940_map_io(void) 283static void __init h1940_map_io(void)
@@ -219,6 +307,8 @@ static void __init h1940_init(void)
219 s3c24xx_udc_set_platdata(&h1940_udc_cfg); 307 s3c24xx_udc_set_platdata(&h1940_udc_cfg);
220 s3c_i2c0_set_platdata(NULL); 308 s3c_i2c0_set_platdata(NULL);
221 309
310 s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
311
222 /* Turn off suspend on both USB ports, and switch the 312 /* Turn off suspend on both USB ports, and switch the
223 * selectable USB port to USB device mode. */ 313 * selectable USB port to USB device mode. */
224 314
@@ -231,6 +321,11 @@ static void __init h1940_init(void)
231 | (0x03 << S3C24XX_PLLCON_SDIVSHIFT); 321 | (0x03 << S3C24XX_PLLCON_SDIVSHIFT);
232 writel(tmp, S3C2410_UPLLCON); 322 writel(tmp, S3C2410_UPLLCON);
233 323
324 gpio_request(S3C2410_GPC(0), "LCD power");
325 gpio_request(S3C2410_GPC(5), "LCD power");
326 gpio_request(S3C2410_GPC(6), "LCD power");
327
328
234 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); 329 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
235} 330}
236 331
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 0f6ed61af415..0405712c2263 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -338,7 +338,7 @@ static struct platform_device *n35_devices[] __initdata = {
338 &n35_button_device, 338 &n35_button_device,
339}; 339};
340 340
341static struct s3c2410_platform_i2c n30_i2ccfg = { 341static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
342 .flags = 0, 342 .flags = 0,
343 .slave_addr = 0x10, 343 .slave_addr = 0x10,
344 .frequency = 10*1000, 344 .frequency = 10*1000,
@@ -500,8 +500,8 @@ static void __init n30_init_irq(void)
500static void __init n30_init(void) 500static void __init n30_init(void)
501{ 501{
502 s3c24xx_fb_set_platdata(&n30_fb_info); 502 s3c24xx_fb_set_platdata(&n30_fb_info);
503 s3c_device_i2c0.dev.platform_data = &n30_i2ccfg;
504 s3c24xx_udc_set_platdata(&n30_udc_cfg); 503 s3c24xx_udc_set_platdata(&n30_udc_cfg);
504 s3c_i2c0_set_platdata(&n30_i2ccfg);
505 505
506 /* Turn off suspend on both USB ports, and switch the 506 /* Turn off suspend on both USB ports, and switch the
507 * selectable USB port to USB device mode. */ 507 * selectable USB port to USB device mode. */
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 2cc9849eb448..ab092bcda393 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -258,7 +258,7 @@ static struct platform_device *qt2410_devices[] __initdata = {
258 &qt2410_led, 258 &qt2410_led,
259}; 259};
260 260
261static struct mtd_partition qt2410_nand_part[] = { 261static struct mtd_partition __initdata qt2410_nand_part[] = {
262 [0] = { 262 [0] = {
263 .name = "U-Boot", 263 .name = "U-Boot",
264 .size = 0x30000, 264 .size = 0x30000,
@@ -286,7 +286,7 @@ static struct mtd_partition qt2410_nand_part[] = {
286 }, 286 },
287}; 287};
288 288
289static struct s3c2410_nand_set qt2410_nand_sets[] = { 289static struct s3c2410_nand_set __initdata qt2410_nand_sets[] = {
290 [0] = { 290 [0] = {
291 .name = "NAND", 291 .name = "NAND",
292 .nr_chips = 1, 292 .nr_chips = 1,
@@ -299,7 +299,7 @@ static struct s3c2410_nand_set qt2410_nand_sets[] = {
299 * chips and beyond. 299 * chips and beyond.
300 */ 300 */
301 301
302static struct s3c2410_platform_nand qt2410_nand_info = { 302static struct s3c2410_platform_nand __initdata qt2410_nand_info = {
303 .tacls = 20, 303 .tacls = 20,
304 .twrph0 = 60, 304 .twrph0 = 60,
305 .twrph1 = 20, 305 .twrph1 = 20,
@@ -331,7 +331,7 @@ static void __init qt2410_map_io(void)
331 331
332static void __init qt2410_machine_init(void) 332static void __init qt2410_machine_init(void)
333{ 333{
334 s3c_device_nand.dev.platform_data = &qt2410_nand_info; 334 s3c_nand_set_platdata(&qt2410_nand_info);
335 335
336 switch (tft_type) { 336 switch (tft_type) {
337 case 'p': /* production */ 337 case 'p': /* production */
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 1628cc773a2c..0d61fb577170 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c 1/* linux/arch/arm/mach-s3c2410/mach-vr1000.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright (c) 2003-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Machine support for Thorcom VR1000 board. Designed for Thorcom by 6 * Machine support for Thorcom VR1000 board. Designed for Thorcom by
@@ -49,6 +49,7 @@
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/cpu.h> 50#include <plat/cpu.h>
51#include <plat/iic.h> 51#include <plat/iic.h>
52#include <plat/audio-simtec.h>
52 53
53#include "usb-simtec.h" 54#include "usb-simtec.h"
54#include "nor-simtec.h" 55#include "nor-simtec.h"
@@ -393,6 +394,7 @@ static void __init vr1000_init(void)
393 ARRAY_SIZE(vr1000_i2c_devs)); 394 ARRAY_SIZE(vr1000_i2c_devs));
394 395
395 nor_simtec_init(); 396 nor_simtec_init();
397 simtec_audio_add(NULL, true, NULL);
396} 398}
397 399
398MACHINE_START(VR1000, "Thorcom-VR1000") 400MACHINE_START(VR1000, "Thorcom-VR1000")
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
index f178c2fd9d85..8338865e11c0 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/pll.c 1/* arch/arm/mach-s3c2410/pll.c
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk> 6 * Vincent Sanders <vince@arm.linux.org.uk>
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 50e25fc5f8ab..6b9d0d83a6f9 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c 1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics 3 * Copyright 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -108,7 +108,7 @@ int usb_simtec_init(void)
108{ 108{
109 int ret; 109 int ret;
110 110
111 printk("USB Power Control, (c) 2004 Simtec Electronics\n"); 111 printk("USB Power Control, Copyright 2004 Simtec Electronics\n");
112 112
113 ret = gpio_request(S3C2410_GPB(4), "USB power control"); 113 ret = gpio_request(S3C2410_GPB(4), "USB power control");
114 if (ret < 0) { 114 if (ret < 0) {
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 8df506eac903..c9fa3fca486c 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -96,7 +96,7 @@ static struct s3c2410_uartcfg jive_uartcfgs[] = {
96 * 0x017d0000-0x02bd0000 : cramfs B 96 * 0x017d0000-0x02bd0000 : cramfs B
97 * 0x02bd0000-0x03fd0000 : yaffs 97 * 0x02bd0000-0x03fd0000 : yaffs
98 */ 98 */
99static struct mtd_partition jive_imageA_nand_part[] = { 99static struct mtd_partition __initdata jive_imageA_nand_part[] = {
100 100
101#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER 101#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
102 /* Don't allow access to the bootloader from linux */ 102 /* Don't allow access to the bootloader from linux */
@@ -154,7 +154,7 @@ static struct mtd_partition jive_imageA_nand_part[] = {
154 }, 154 },
155}; 155};
156 156
157static struct mtd_partition jive_imageB_nand_part[] = { 157static struct mtd_partition __initdata jive_imageB_nand_part[] = {
158 158
159#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER 159#ifdef CONFIG_MACH_JIVE_SHOW_BOOTLOADER
160 /* Don't allow access to the bootloader from linux */ 160 /* Don't allow access to the bootloader from linux */
@@ -213,7 +213,7 @@ static struct mtd_partition jive_imageB_nand_part[] = {
213 }, 213 },
214}; 214};
215 215
216static struct s3c2410_nand_set jive_nand_sets[] = { 216static struct s3c2410_nand_set __initdata jive_nand_sets[] = {
217 [0] = { 217 [0] = {
218 .name = "flash", 218 .name = "flash",
219 .nr_chips = 1, 219 .nr_chips = 1,
@@ -222,7 +222,7 @@ static struct s3c2410_nand_set jive_nand_sets[] = {
222 }, 222 },
223}; 223};
224 224
225static struct s3c2410_platform_nand jive_nand_info = { 225static struct s3c2410_platform_nand __initdata jive_nand_info = {
226 /* set taken from osiris nand timings, possibly still conservative */ 226 /* set taken from osiris nand timings, possibly still conservative */
227 .tacls = 30, 227 .tacls = 30,
228 .twrph0 = 55, 228 .twrph0 = 55,
@@ -631,7 +631,8 @@ static void __init jive_machine_init(void)
631 631
632 s3c_pm_init(); 632 s3c_pm_init();
633 633
634 s3c_device_nand.dev.platform_data = &jive_nand_info; 634 /** TODO - check that this is after the cmdline option! */
635 s3c_nand_set_platdata(&jive_nand_info);
635 636
636 /* initialise the spi */ 637 /* initialise the spi */
637 638
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 11e8ad49fc7b..a6ba591b26bb 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -76,7 +76,7 @@ static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
76 } 76 }
77}; 77};
78 78
79static struct mtd_partition vstms_nand_part[] = { 79static struct mtd_partition __initdata vstms_nand_part[] = {
80 [0] = { 80 [0] = {
81 .name = "Boot Agent", 81 .name = "Boot Agent",
82 .size = 0x7C000, 82 .size = 0x7C000,
@@ -99,7 +99,7 @@ static struct mtd_partition vstms_nand_part[] = {
99 }, 99 },
100}; 100};
101 101
102static struct s3c2410_nand_set vstms_nand_sets[] = { 102static struct s3c2410_nand_set __initdata vstms_nand_sets[] = {
103 [0] = { 103 [0] = {
104 .name = "NAND", 104 .name = "NAND",
105 .nr_chips = 1, 105 .nr_chips = 1,
@@ -112,7 +112,7 @@ static struct s3c2410_nand_set vstms_nand_sets[] = {
112 * chips and beyond. 112 * chips and beyond.
113*/ 113*/
114 114
115static struct s3c2410_platform_nand vstms_nand_info = { 115static struct s3c2410_platform_nand __initdata vstms_nand_info = {
116 .tacls = 20, 116 .tacls = 20,
117 .twrph0 = 60, 117 .twrph0 = 60,
118 .twrph1 = 20, 118 .twrph1 = 20,
@@ -143,8 +143,6 @@ static void __init vstms_fixup(struct machine_desc *desc,
143 143
144static void __init vstms_map_io(void) 144static void __init vstms_map_io(void)
145{ 145{
146 s3c_device_nand.dev.platform_data = &vstms_nand_info;
147
148 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc)); 146 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
149 s3c24xx_init_clocks(12000000); 147 s3c24xx_init_clocks(12000000);
150 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs)); 148 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
@@ -153,6 +151,8 @@ static void __init vstms_map_io(void)
153static void __init vstms_init(void) 151static void __init vstms_init(void)
154{ 152{
155 s3c_i2c0_set_platdata(NULL); 153 s3c_i2c0_set_platdata(NULL);
154 s3c_nand_set_platdata(&vstms_nand_info);
155
156 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices)); 156 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
157} 157}
158 158
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index a8b69d77571b..cf10e14b7b49 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -53,6 +53,19 @@ config MACH_OSIRIS
53 Say Y here if you are using the Simtec IM2440D20 module, also 53 Say Y here if you are using the Simtec IM2440D20 module, also
54 known as the Osiris. 54 known as the Osiris.
55 55
56config MACH_OSIRIS_DVS
57 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver"
58 depends on MACH_OSIRIS
59 select TPS65010
60 help
61 Say Y/M here if you want to have dynamic voltage scaling support
62 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011.
63
64 The DVS driver alters the voltage supplied to the ARM core
65 depending on the frequency it is running at. The driver itself
66 does not do any of the frequency alteration, which is left up
67 to the cpufreq driver.
68
56config MACH_RX3715 69config MACH_RX3715
57 bool "HP iPAQ rx3715" 70 bool "HP iPAQ rx3715"
58 select CPU_S3C2440 71 select CPU_S3C2440
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
index bfadcf684a2a..5f3224531885 100644
--- a/arch/arm/mach-s3c2440/Makefile
+++ b/arch/arm/mach-s3c2440/Makefile
@@ -23,3 +23,7 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
23obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o 23obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
24obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o 24obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
25obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o 25obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
26
27# extra machine support
28
29obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c
index 63c5ab65727f..0c049b95c378 100644
--- a/arch/arm/mach-s3c2440/irq.c
+++ b/arch/arm/mach-s3c2440/irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/irq.c 1/* linux/arch/arm/mach-s3c2440/irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 68f3870991bf..62a4c3eba97f 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-anubis.c 1/* linux/arch/arm/mach-s3c2440/mach-anubis.c
2 * 2 *
3 * Copyright (c) 2003-2005,2008 Simtec Electronics 3 * Copyright 2003-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -53,8 +53,9 @@
53#include <plat/clock.h> 53#include <plat/clock.h>
54#include <plat/devs.h> 54#include <plat/devs.h>
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/audio-simtec.h>
56 57
57#define COPYRIGHT ", (c) 2005 Simtec Electronics" 58#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
58 59
59static struct map_desc anubis_iodesc[] __initdata = { 60static struct map_desc anubis_iodesc[] __initdata = {
60 /* ISA IO areas */ 61 /* ISA IO areas */
@@ -138,7 +139,7 @@ static int external_map[] = { 2 };
138static int chip0_map[] = { 0 }; 139static int chip0_map[] = { 0 };
139static int chip1_map[] = { 1 }; 140static int chip1_map[] = { 1 };
140 141
141static struct mtd_partition anubis_default_nand_part[] = { 142static struct mtd_partition __initdata anubis_default_nand_part[] = {
142 [0] = { 143 [0] = {
143 .name = "Boot Agent", 144 .name = "Boot Agent",
144 .size = SZ_16K, 145 .size = SZ_16K,
@@ -161,7 +162,7 @@ static struct mtd_partition anubis_default_nand_part[] = {
161 } 162 }
162}; 163};
163 164
164static struct mtd_partition anubis_default_nand_part_large[] = { 165static struct mtd_partition __initdata anubis_default_nand_part_large[] = {
165 [0] = { 166 [0] = {
166 .name = "Boot Agent", 167 .name = "Boot Agent",
167 .size = SZ_128K, 168 .size = SZ_128K,
@@ -191,7 +192,7 @@ static struct mtd_partition anubis_default_nand_part_large[] = {
191 * socket. 192 * socket.
192*/ 193*/
193 194
194static struct s3c2410_nand_set anubis_nand_sets[] = { 195static struct s3c2410_nand_set __initdata anubis_nand_sets[] = {
195 [1] = { 196 [1] = {
196 .name = "External", 197 .name = "External",
197 .nr_chips = 1, 198 .nr_chips = 1,
@@ -233,7 +234,7 @@ static void anubis_nand_select(struct s3c2410_nand_set *set, int slot)
233 __raw_writeb(tmp, ANUBIS_VA_CTRL1); 234 __raw_writeb(tmp, ANUBIS_VA_CTRL1);
234} 235}
235 236
236static struct s3c2410_platform_nand anubis_nand_info = { 237static struct s3c2410_platform_nand __initdata anubis_nand_info = {
237 .tacls = 25, 238 .tacls = 25,
238 .twrph0 = 55, 239 .twrph0 = 55,
239 .twrph1 = 40, 240 .twrph1 = 40,
@@ -437,6 +438,17 @@ static struct i2c_board_info anubis_i2c_devs[] __initdata = {
437 } 438 }
438}; 439};
439 440
441/* Audio setup */
442static struct s3c24xx_audio_simtec_pdata __initdata anubis_audio = {
443 .have_mic = 1,
444 .have_lout = 1,
445 .output_cdclk = 1,
446 .use_mpllin = 1,
447 .amp_gpio = S3C2410_GPB(2),
448 .amp_gain[0] = S3C2410_GPD(10),
449 .amp_gain[1] = S3C2410_GPD(11),
450};
451
440static void __init anubis_map_io(void) 452static void __init anubis_map_io(void)
441{ 453{
442 /* initialise the clocks */ 454 /* initialise the clocks */
@@ -454,8 +466,6 @@ static void __init anubis_map_io(void)
454 466
455 s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks)); 467 s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
456 468
457 s3c_device_nand.dev.platform_data = &anubis_nand_info;
458
459 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); 469 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
460 s3c24xx_init_clocks(0); 470 s3c24xx_init_clocks(0);
461 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); 471 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
@@ -476,6 +486,9 @@ static void __init anubis_map_io(void)
476static void __init anubis_init(void) 486static void __init anubis_init(void)
477{ 487{
478 s3c_i2c0_set_platdata(NULL); 488 s3c_i2c0_set_platdata(NULL);
489 s3c_nand_set_platdata(&anubis_nand_info);
490 simtec_audio_add(NULL, false, &anubis_audio);
491
479 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices)); 492 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
480 493
481 i2c_register_board_info(0, anubis_i2c_devs, 494 i2c_register_board_info(0, anubis_i2c_devs,
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index dfc7010935da..aa69290e04c6 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -96,7 +96,7 @@ static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = {
96 96
97/* NAND Flash on AT2440EVB board */ 97/* NAND Flash on AT2440EVB board */
98 98
99static struct mtd_partition at2440evb_default_nand_part[] = { 99static struct mtd_partition __initdata at2440evb_default_nand_part[] = {
100 [0] = { 100 [0] = {
101 .name = "Boot Agent", 101 .name = "Boot Agent",
102 .size = SZ_256K, 102 .size = SZ_256K,
@@ -114,7 +114,7 @@ static struct mtd_partition at2440evb_default_nand_part[] = {
114 }, 114 },
115}; 115};
116 116
117static struct s3c2410_nand_set at2440evb_nand_sets[] = { 117static struct s3c2410_nand_set __initdata at2440evb_nand_sets[] = {
118 [0] = { 118 [0] = {
119 .name = "nand", 119 .name = "nand",
120 .nr_chips = 1, 120 .nr_chips = 1,
@@ -123,7 +123,7 @@ static struct s3c2410_nand_set at2440evb_nand_sets[] = {
123 }, 123 },
124}; 124};
125 125
126static struct s3c2410_platform_nand at2440evb_nand_info = { 126static struct s3c2410_platform_nand __initdata at2440evb_nand_info = {
127 .tacls = 25, 127 .tacls = 25,
128 .twrph0 = 55, 128 .twrph0 = 55,
129 .twrph1 = 40, 129 .twrph1 = 40,
@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = {
216 216
217static void __init at2440evb_map_io(void) 217static void __init at2440evb_map_io(void)
218{ 218{
219 s3c_device_nand.dev.platform_data = &at2440evb_nand_info;
220 s3c_device_sdi.name = "s3c2440-sdi";
221 s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata; 219 s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
222 220
223 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); 221 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
@@ -228,6 +226,7 @@ static void __init at2440evb_map_io(void)
228static void __init at2440evb_init(void) 226static void __init at2440evb_init(void)
229{ 227{
230 s3c24xx_fb_set_platdata(&at2440evb_fb_info); 228 s3c24xx_fb_set_platdata(&at2440evb_fb_info);
229 s3c_nand_set_platdata(&at2440evb_nand_info);
231 s3c_i2c0_set_platdata(NULL); 230 s3c_i2c0_set_platdata(NULL);
232 231
233 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices)); 232 platform_add_devices(at2440evb_devices, ARRAY_SIZE(at2440evb_devices));
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 1c3382fefdd2..547d4fc99131 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -532,7 +532,6 @@ static void __init mini2440_map_io(void)
532 s3c24xx_init_clocks(12000000); 532 s3c24xx_init_clocks(12000000);
533 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); 533 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
534 534
535 s3c_device_nand.dev.platform_data = &mini2440_nand_info;
536 s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg; 535 s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
537} 536}
538 537
@@ -677,8 +676,11 @@ static void __init mini2440_init(void)
677 printk("\n"); 676 printk("\n");
678 s3c24xx_fb_set_platdata(&mini2440_fb_info); 677 s3c24xx_fb_set_platdata(&mini2440_fb_info);
679 } 678 }
679
680 s3c24xx_udc_set_platdata(&mini2440_udc_cfg); 680 s3c24xx_udc_set_platdata(&mini2440_udc_cfg);
681 s3c_nand_set_platdata(&mini2440_nand_info);
681 s3c_i2c0_set_platdata(NULL); 682 s3c_i2c0_set_platdata(NULL);
683
682 i2c_register_board_info(0, mini2440_i2c_devs, 684 i2c_register_board_info(0, mini2440_i2c_devs,
683 ARRAY_SIZE(mini2440_i2c_devs)); 685 ARRAY_SIZE(mini2440_i2c_devs));
684 686
diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
new file mode 100644
index 000000000000..ad2792dfbee1
--- /dev/null
+++ b/arch/arm/mach-s3c2440/mach-osiris-dvs.c
@@ -0,0 +1,194 @@
1/* linux/arch/arm/mach-s3c2440/mach-osiris-dvs.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Simtec Osiris Dynamic Voltage Scaling support.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
17#include <linux/cpufreq.h>
18#include <linux/gpio.h>
19
20#include <linux/i2c/tps65010.h>
21
22#include <plat/cpu-freq.h>
23
24#define OSIRIS_GPIO_DVS S3C2410_GPB(5)
25
26static bool dvs_en;
27
28static void osiris_dvs_tps_setdvs(bool on)
29{
30 unsigned vregs1 = 0, vdcdc2 = 0;
31
32 if (!on) {
33 vdcdc2 = TPS_VCORE_DISCH | TPS_LP_COREOFF;
34 vregs1 = TPS_LDO1_OFF; /* turn off in low-power mode */
35 }
36
37 dvs_en = on;
38 vdcdc2 |= TPS_VCORE_1_3V | TPS_VCORE_LP_1_0V;
39 vregs1 |= TPS_LDO2_ENABLE | TPS_LDO1_ENABLE;
40
41 tps65010_config_vregs1(vregs1);
42 tps65010_config_vdcdc2(vdcdc2);
43}
44
45static bool is_dvs(struct s3c_freq *f)
46{
47 /* at the moment, we assume ARMCLK = HCLK => DVS */
48 return f->armclk == f->hclk;
49}
50
51/* keep track of current state */
52static bool cur_dvs = false;
53
54static int osiris_dvs_notify(struct notifier_block *nb,
55 unsigned long val, void *data)
56{
57 struct cpufreq_freqs *cf = data;
58 struct s3c_cpufreq_freqs *freqs = to_s3c_cpufreq(cf);
59 bool old_dvs = is_dvs(&freqs->old);
60 bool new_dvs = is_dvs(&freqs->new);
61 int ret = 0;
62
63 if (!dvs_en)
64 return 0;
65
66 printk(KERN_DEBUG "%s: old %ld,%ld new %ld,%ld\n", __func__,
67 freqs->old.armclk, freqs->old.hclk,
68 freqs->new.armclk, freqs->new.hclk);
69
70 switch (val) {
71 case CPUFREQ_PRECHANGE:
72 if (old_dvs & !new_dvs ||
73 cur_dvs & !new_dvs) {
74 pr_debug("%s: exiting dvs\n", __func__);
75 cur_dvs = false;
76 gpio_set_value(OSIRIS_GPIO_DVS, 1);
77 }
78 break;
79 case CPUFREQ_POSTCHANGE:
80 if (!old_dvs & new_dvs ||
81 !cur_dvs & new_dvs) {
82 pr_debug("entering dvs\n");
83 cur_dvs = true;
84 gpio_set_value(OSIRIS_GPIO_DVS, 0);
85 }
86 break;
87 }
88
89 return ret;
90}
91
92static struct notifier_block osiris_dvs_nb = {
93 .notifier_call = osiris_dvs_notify,
94};
95
96static int __devinit osiris_dvs_probe(struct platform_device *pdev)
97{
98 int ret;
99
100 dev_info(&pdev->dev, "initialising\n");
101
102 ret = gpio_request(OSIRIS_GPIO_DVS, "osiris-dvs");
103 if (ret) {
104 dev_err(&pdev->dev, "cannot claim gpio\n");
105 goto err_nogpio;
106 }
107
108 /* start with dvs disabled */
109 gpio_direction_output(OSIRIS_GPIO_DVS, 1);
110
111 ret = cpufreq_register_notifier(&osiris_dvs_nb,
112 CPUFREQ_TRANSITION_NOTIFIER);
113 if (ret) {
114 dev_err(&pdev->dev, "failed to register with cpufreq\n");
115 goto err_nofreq;
116 }
117
118 osiris_dvs_tps_setdvs(true);
119
120 return 0;
121
122err_nofreq:
123 gpio_free(OSIRIS_GPIO_DVS);
124
125err_nogpio:
126 return ret;
127}
128
129static int __devexit osiris_dvs_remove(struct platform_device *pdev)
130{
131 dev_info(&pdev->dev, "exiting\n");
132
133 /* disable any current dvs */
134 gpio_set_value(OSIRIS_GPIO_DVS, 1);
135 osiris_dvs_tps_setdvs(false);
136
137 cpufreq_unregister_notifier(&osiris_dvs_nb,
138 CPUFREQ_TRANSITION_NOTIFIER);
139
140 gpio_free(OSIRIS_GPIO_DVS);
141
142 return 0;
143}
144
145/* the CONFIG_PM block is so small, it isn't worth actaully compiling it
146 * out if the configuration isn't set. */
147
148static int osiris_dvs_suspend(struct device *dev)
149{
150 gpio_set_value(OSIRIS_GPIO_DVS, 1);
151 osiris_dvs_tps_setdvs(false);
152 cur_dvs = false;
153
154 return 0;
155}
156
157static int osiris_dvs_resume(struct device *dev)
158{
159 osiris_dvs_tps_setdvs(true);
160 return 0;
161}
162
163static const struct dev_pm_ops osiris_dvs_pm = {
164 .suspend = osiris_dvs_suspend,
165 .resume = osiris_dvs_resume,
166};
167
168static struct platform_driver osiris_dvs_driver = {
169 .probe = osiris_dvs_probe,
170 .remove = __devexit_p(osiris_dvs_remove),
171 .driver = {
172 .name = "osiris-dvs",
173 .owner = THIS_MODULE,
174 .pm = &osiris_dvs_pm,
175 },
176};
177
178static int __init osiris_dvs_init(void)
179{
180 return platform_driver_register(&osiris_dvs_driver);
181}
182
183static void __exit osiris_dvs_exit(void)
184{
185 platform_driver_unregister(&osiris_dvs_driver);
186}
187
188module_init(osiris_dvs_init);
189module_exit(osiris_dvs_exit);
190
191MODULE_DESCRIPTION("Simtec OSIRIS DVS support");
192MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
193MODULE_LICENSE("GPL");
194MODULE_ALIAS("platform:osiris-dvs");
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 2105a41281a4..015dfb2a80da 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-osiris.c 1/* linux/arch/arm/mach-s3c2440/mach-osiris.c
2 * 2 *
3 * Copyright (c) 2005,2008 Simtec Electronics 3 * Copyright (c) 2005-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
@@ -23,6 +23,8 @@
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <linux/i2c/tps65010.h>
27
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 29#include <asm/mach/map.h>
28#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
@@ -148,7 +150,7 @@ static int external_map[] = { 2 };
148static int chip0_map[] = { 0 }; 150static int chip0_map[] = { 0 };
149static int chip1_map[] = { 1 }; 151static int chip1_map[] = { 1 };
150 152
151static struct mtd_partition osiris_default_nand_part[] = { 153static struct mtd_partition __initdata osiris_default_nand_part[] = {
152 [0] = { 154 [0] = {
153 .name = "Boot Agent", 155 .name = "Boot Agent",
154 .size = SZ_16K, 156 .size = SZ_16K,
@@ -171,7 +173,7 @@ static struct mtd_partition osiris_default_nand_part[] = {
171 } 173 }
172}; 174};
173 175
174static struct mtd_partition osiris_default_nand_part_large[] = { 176static struct mtd_partition __initdata osiris_default_nand_part_large[] = {
175 [0] = { 177 [0] = {
176 .name = "Boot Agent", 178 .name = "Boot Agent",
177 .size = SZ_128K, 179 .size = SZ_128K,
@@ -201,7 +203,7 @@ static struct mtd_partition osiris_default_nand_part_large[] = {
201 * socket. 203 * socket.
202*/ 204*/
203 205
204static struct s3c2410_nand_set osiris_nand_sets[] = { 206static struct s3c2410_nand_set __initdata osiris_nand_sets[] = {
205 [1] = { 207 [1] = {
206 .name = "External", 208 .name = "External",
207 .nr_chips = 1, 209 .nr_chips = 1,
@@ -243,7 +245,7 @@ static void osiris_nand_select(struct s3c2410_nand_set *set, int slot)
243 __raw_writeb(tmp, OSIRIS_VA_CTRL0); 245 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
244} 246}
245 247
246static struct s3c2410_platform_nand osiris_nand_info = { 248static struct s3c2410_platform_nand __initdata osiris_nand_info = {
247 .tacls = 25, 249 .tacls = 25,
248 .twrph0 = 60, 250 .twrph0 = 60,
249 .twrph1 = 60, 251 .twrph1 = 60,
@@ -326,12 +328,44 @@ static struct sys_device osiris_pm_sysdev = {
326 .cls = &osiris_pm_sysclass, 328 .cls = &osiris_pm_sysclass,
327}; 329};
328 330
331/* Link for DVS driver to TPS65011 */
332
333static void osiris_tps_release(struct device *dev)
334{
335 /* static device, do not need to release anything */
336}
337
338static struct platform_device osiris_tps_device = {
339 .name = "osiris-dvs",
340 .id = -1,
341 .dev.release = osiris_tps_release,
342};
343
344static int osiris_tps_setup(struct i2c_client *client, void *context)
345{
346 osiris_tps_device.dev.parent = &client->dev;
347 return platform_device_register(&osiris_tps_device);
348}
349
350static int osiris_tps_remove(struct i2c_client *client, void *context)
351{
352 platform_device_unregister(&osiris_tps_device);
353 return 0;
354}
355
356static struct tps65010_board osiris_tps_board = {
357 .base = -1, /* GPIO can go anywhere at the moment */
358 .setup = osiris_tps_setup,
359 .teardown = osiris_tps_remove,
360};
361
329/* I2C devices fitted. */ 362/* I2C devices fitted. */
330 363
331static struct i2c_board_info osiris_i2c_devs[] __initdata = { 364static struct i2c_board_info osiris_i2c_devs[] __initdata = {
332 { 365 {
333 I2C_BOARD_INFO("tps65011", 0x48), 366 I2C_BOARD_INFO("tps65011", 0x48),
334 .irq = IRQ_EINT20, 367 .irq = IRQ_EINT20,
368 .platform_data = &osiris_tps_board,
335 }, 369 },
336}; 370};
337 371
@@ -377,8 +411,6 @@ static void __init osiris_map_io(void)
377 411
378 s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks)); 412 s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
379 413
380 s3c_device_nand.dev.platform_data = &osiris_nand_info;
381
382 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc)); 414 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
383 s3c24xx_init_clocks(0); 415 s3c24xx_init_clocks(0);
384 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs)); 416 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
@@ -408,6 +440,7 @@ static void __init osiris_init(void)
408 sysdev_register(&osiris_pm_sysdev); 440 sysdev_register(&osiris_pm_sysdev);
409 441
410 s3c_i2c0_set_platdata(NULL); 442 s3c_i2c0_set_platdata(NULL);
443 s3c_nand_set_platdata(&osiris_nand_info);
411 444
412 s3c_cpufreq_setboard(&osiris_cpufreq); 445 s3c_cpufreq_setboard(&osiris_cpufreq);
413 446
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index bc8d8d1ebd1a..a952a13afb1f 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-rx3715.c 1/* linux/arch/arm/mach-s3c2440/mach-rx3715.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.handhelds.org/projects/rx3715.html 6 * http://www.handhelds.org/projects/rx3715.html
@@ -149,7 +149,7 @@ static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
149 .gpdup_mask = 0xffffffff, 149 .gpdup_mask = 0xffffffff,
150}; 150};
151 151
152static struct mtd_partition rx3715_nand_part[] = { 152static struct mtd_partition __initdata rx3715_nand_part[] = {
153 [0] = { 153 [0] = {
154 .name = "Whole Flash", 154 .name = "Whole Flash",
155 .offset = 0, 155 .offset = 0,
@@ -158,7 +158,7 @@ static struct mtd_partition rx3715_nand_part[] = {
158 } 158 }
159}; 159};
160 160
161static struct s3c2410_nand_set rx3715_nand_sets[] = { 161static struct s3c2410_nand_set __initdata rx3715_nand_sets[] = {
162 [0] = { 162 [0] = {
163 .name = "Internal", 163 .name = "Internal",
164 .nr_chips = 1, 164 .nr_chips = 1,
@@ -167,7 +167,7 @@ static struct s3c2410_nand_set rx3715_nand_sets[] = {
167 }, 167 },
168}; 168};
169 169
170static struct s3c2410_platform_nand rx3715_nand_info = { 170static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
171 .tacls = 25, 171 .tacls = 25,
172 .twrph0 = 50, 172 .twrph0 = 50,
173 .twrph1 = 15, 173 .twrph1 = 15,
@@ -186,8 +186,6 @@ static struct platform_device *rx3715_devices[] __initdata = {
186 186
187static void __init rx3715_map_io(void) 187static void __init rx3715_map_io(void)
188{ 188{
189 s3c_device_nand.dev.platform_data = &rx3715_nand_info;
190
191 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 189 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
192 s3c24xx_init_clocks(16934000); 190 s3c24xx_init_clocks(16934000);
193 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); 191 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
@@ -205,6 +203,7 @@ static void __init rx3715_init_machine(void)
205#endif 203#endif
206 s3c_pm_init(); 204 s3c_pm_init();
207 205
206 s3c_nand_set_platdata(&rx3715_nand_info);
208 s3c24xx_fb_set_platdata(&rx3715_fb_info); 207 s3c24xx_fb_set_platdata(&rx3715_fb_info);
209 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); 208 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
210} 209}
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index db6eafbd4d90..ec13e748ccc5 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c 1/* linux/arch/arm/mach-s3c2440/mach-smdk2440.c
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.fluff.org/ben/smdk2440/ 6 * http://www.fluff.org/ben/smdk2440/
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 0fb385bd9cd9..f76d6ff4aeb9 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -423,7 +423,7 @@ static struct i2c_board_info gta02_i2c_devs[] __initdata = {
423 }, 423 },
424}; 424};
425 425
426static struct s3c2410_nand_set gta02_nand_sets[] = { 426static struct s3c2410_nand_set __initdata gta02_nand_sets[] = {
427 [0] = { 427 [0] = {
428 /* 428 /*
429 * This name is also hard-coded in the boot loaders, so 429 * This name is also hard-coded in the boot loaders, so
@@ -442,7 +442,7 @@ static struct s3c2410_nand_set gta02_nand_sets[] = {
442 * data sheet (K5D2G13ACM-D075 MCP Memory). 442 * data sheet (K5D2G13ACM-D075 MCP Memory).
443 */ 443 */
444 444
445static struct s3c2410_platform_nand gta02_nand_info = { 445static struct s3c2410_platform_nand __initdata gta02_nand_info = {
446 .tacls = 0, 446 .tacls = 0,
447 .twrph0 = 25, 447 .twrph0 = 25,
448 .twrph1 = 15, 448 .twrph1 = 15,
@@ -621,9 +621,9 @@ static void __init gta02_machine_init(void)
621#endif 621#endif
622 622
623 s3c_device_usb.dev.platform_data = &gta02_usb_info; 623 s3c_device_usb.dev.platform_data = &gta02_usb_info;
624 s3c_device_nand.dev.platform_data = &gta02_nand_info;
625 624
626 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 625 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
626 s3c_nand_set_platdata(&gta02_nand_info);
627 s3c_i2c0_set_platdata(NULL); 627 s3c_i2c0_set_platdata(NULL);
628 628
629 i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); 629 i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
diff --git a/arch/arm/mach-s3c24a0/include/mach/map.h b/arch/arm/mach-s3c24a0/include/mach/map.h
index 79e4d93ea2b6..d88c8b24fe34 100644
--- a/arch/arm/mach-s3c24a0/include/mach/map.h
+++ b/arch/arm/mach-s3c24a0/include/mach/map.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c24a0/include/mach/map.h 1/* linux/arch/arm/mach-s3c24a0/include/mach/map.h
2 * 2 *
3 * Copyright 2003,2007 Simtec Electronics 3 * Copyright 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/mach-s3c24a0/include/mach/regs-clock.h b/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
index af2abd756c30..be0af518b488 100644
--- a/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
+++ b/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s3c24a0/include/mach/regs-clock.h 1/* linux/arch/arm/mach-s3c24a0/include/mach/regs-clock.h
2 * 2 *
3 * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2003-2006 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index fc8b223bad4f..f3b48f841d84 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -64,6 +64,9 @@
64 64
65#define S3C64XX_PA_USBHOST (0x74300000) 65#define S3C64XX_PA_USBHOST (0x74300000)
66 66
67#define S3C64XX_PA_USB_HSPHY (0x7C100000)
68#define S3C64XX_VA_USB_HSPHY S3C_ADDR_CPU(0x00200000)
69
67/* place VICs close together */ 70/* place VICs close together */
68#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 71#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00)
69#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 72#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
@@ -79,5 +82,6 @@
79#define S3C_PA_FB S3C64XX_PA_FB 82#define S3C_PA_FB S3C64XX_PA_FB
80#define S3C_PA_USBHOST S3C64XX_PA_USBHOST 83#define S3C_PA_USBHOST S3C64XX_PA_USBHOST
81#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG 84#define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG
85#define S3C_VA_USB_HSPHY S3C64XX_VA_USB_HSPHY
82 86
83#endif /* __ASM_ARCH_6400_MAP_H */ 87#endif /* __ASM_ARCH_6400_MAP_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-fb.h b/arch/arm/mach-s3c6400/include/mach/regs-fb.h
index 47019795ce06..f56611526c63 100644
--- a/arch/arm/mach-s3c6400/include/mach/regs-fb.h
+++ b/arch/arm/mach-s3c6400/include/mach/regs-fb.h
@@ -1,195 +1,30 @@
1/* arch/arm/mach-s3c6400/include/mach/regs-fb.h 1/*
2 *
3 * Copyright 2008 Openmoko, Inc. 2 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 4 * Copyright 2009 Samsung Electronics Co.
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - new-style framebuffer register definitions
9 * 5 *
10 * This is the register set for the new style framebuffer interface 6 * Pawel Osciak <p.osciak@samsung.com>
11 * found from the S3C2443 onwards and specifically the S3C64XX series 7 * Based on plat-s3c/include/plat/regs-fb.h by Ben Dooks <ben@simtec.co.uk>
12 * S3C6400 and S3C6410.
13 * 8 *
14 * The file contains the cpu specific items which change between whichever 9 * Framebuffer register definitions for Samsung S3C64xx.
15 * architecture is selected. See <plat/regs-fb.h> for the core definitions
16 * that are the same.
17 * 10 *
18 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
21*/ 14*/
22 15
23/* include the core definitions here, in case we really do need to 16#ifndef __ASM_ARCH_MACH_REGS_FB_H
24 * override them at a later date. 17#define __ASM_ARCH_MACH_REGS_FB_H __FILE__
25*/
26
27#include <plat/regs-fb.h>
28
29#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
30#define VIDCON1_FSTATUS_EVEN (1 << 15)
31
32/* Video timing controls */
33#define VIDTCON0 (0x10)
34#define VIDTCON1 (0x14)
35#define VIDTCON2 (0x18)
36
37/* Window position controls */
38
39#define WINCON(_win) (0x20 + ((_win) * 4))
40
41/* OSD1 and OSD4 do not have register D */
42
43#define VIDOSD_A(_win) (0x40 + ((_win) * 16))
44#define VIDOSD_B(_win) (0x44 + ((_win) * 16))
45#define VIDOSD_C(_win) (0x48 + ((_win) * 16))
46#define VIDOSD_D(_win) (0x4C + ((_win) * 16))
47
48/* Video buffer addresses */
49
50#define VIDW_BUF_START(_buff) (0xA0 + ((_buff) * 8))
51#define VIDW_BUF_START1(_buff) (0xA4 + ((_buff) * 8))
52#define VIDW_BUF_END(_buff) (0xD0 + ((_buff) * 8))
53#define VIDW_BUF_END1(_buff) (0xD4 + ((_buff) * 8))
54#define VIDW_BUF_SIZE(_buff) (0x100 + ((_buff) * 4))
55
56#define VIDINTCON0 (0x130)
57
58#define WxKEYCONy(_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4))
59
60/* WINCONx */
61
62#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
63#define WINCONx_CSCWIDTH_SHIFT (26)
64#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
65#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
66
67#define WINCONx_ENLOCAL (1 << 22)
68#define WINCONx_BUFSTATUS (1 << 21)
69#define WINCONx_BUFSEL (1 << 20)
70#define WINCONx_BUFAUTOEN (1 << 19)
71#define WINCONx_YCbCr (1 << 13)
72
73#define WINCON1_LOCALSEL_CAMIF (1 << 23)
74
75#define WINCON2_LOCALSEL_CAMIF (1 << 23)
76#define WINCON2_BLD_PIX (1 << 6)
77
78#define WINCON2_ALPHA_SEL (1 << 1)
79#define WINCON2_BPPMODE_MASK (0xf << 2)
80#define WINCON2_BPPMODE_SHIFT (2)
81#define WINCON2_BPPMODE_1BPP (0x0 << 2)
82#define WINCON2_BPPMODE_2BPP (0x1 << 2)
83#define WINCON2_BPPMODE_4BPP (0x2 << 2)
84#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
85#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
86#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
87#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
88#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
89#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
90#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
91#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
92#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
93#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
94#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
95
96#define WINCON3_BLD_PIX (1 << 6)
97
98#define WINCON3_ALPHA_SEL (1 << 1)
99#define WINCON3_BPPMODE_MASK (0xf << 2)
100#define WINCON3_BPPMODE_SHIFT (2)
101#define WINCON3_BPPMODE_1BPP (0x0 << 2)
102#define WINCON3_BPPMODE_2BPP (0x1 << 2)
103#define WINCON3_BPPMODE_4BPP (0x2 << 2)
104#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
105#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
106#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
107#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
108#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
109#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
110#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
111#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
112#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
113#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
114
115#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
116#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
117#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
118
119#define DITHMODE (0x170)
120#define WINxMAP(_win) (0x180 + ((_win) * 4))
121
122
123#define DITHMODE_R_POS_MASK (0x3 << 5)
124#define DITHMODE_R_POS_SHIFT (5)
125#define DITHMODE_R_POS_8BIT (0x0 << 5)
126#define DITHMODE_R_POS_6BIT (0x1 << 5)
127#define DITHMODE_R_POS_5BIT (0x2 << 5)
128
129#define DITHMODE_G_POS_MASK (0x3 << 3)
130#define DITHMODE_G_POS_SHIFT (3)
131#define DITHMODE_G_POS_8BIT (0x0 << 3)
132#define DITHMODE_G_POS_6BIT (0x1 << 3)
133#define DITHMODE_G_POS_5BIT (0x2 << 3)
134
135#define DITHMODE_B_POS_MASK (0x3 << 1)
136#define DITHMODE_B_POS_SHIFT (1)
137#define DITHMODE_B_POS_8BIT (0x0 << 1)
138#define DITHMODE_B_POS_6BIT (0x1 << 1)
139#define DITHMODE_B_POS_5BIT (0x2 << 1)
140 18
141#define DITHMODE_DITH_EN (1 << 0) 19#include <plat/regs-fb-v4.h>
142
143#define WPALCON (0x1A0)
144
145#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
146#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
147#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
148 20
149/* Palette registers */ 21/* Palette registers */
150
151#define WIN2_PAL(_entry) (0x300 + ((_entry) * 2)) 22#define WIN2_PAL(_entry) (0x300 + ((_entry) * 2))
152#define WIN3_PAL(_entry) (0x320 + ((_entry) * 2)) 23#define WIN3_PAL(_entry) (0x320 + ((_entry) * 2))
153#define WIN4_PAL(_entry) (0x340 + ((_entry) * 2)) 24#define WIN4_PAL(_entry) (0x340 + ((_entry) * 2))
154#define WIN0_PAL(_entry) (0x400 + ((_entry) * 4)) 25#define WIN0_PAL(_entry) (0x400 + ((_entry) * 4))
155#define WIN1_PAL(_entry) (0x800 + ((_entry) * 4)) 26#define WIN1_PAL(_entry) (0x800 + ((_entry) * 4))
156 27
157/* system specific implementation code for palette sizes, and other
158 * information that changes depending on which architecture is being
159 * compiled.
160*/
161
162/* return true if window _win has OSD register D */
163#define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0)
164
165static inline unsigned int s3c_fb_win_pal_size(unsigned int win)
166{
167 if (win < 2)
168 return 256;
169 if (win < 4)
170 return 16;
171 if (win == 4)
172 return 4;
173
174 BUG(); /* shouldn't get here */
175}
176
177static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp)
178{
179 /* all windows can do 1/2 bpp */
180
181 if ((bpp == 25 || bpp == 19) && win == 0)
182 return 0; /* win 0 does not have 19 or 25bpp modes */
183
184 if (bpp == 4 && win == 4)
185 return 0;
186
187 if (bpp == 8 && (win >= 3))
188 return 0; /* win 3/4 cannot do 8bpp in any mode */
189
190 return 1;
191}
192
193static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg) 28static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
194{ 29{
195 switch (window) { 30 switch (window) {
@@ -203,57 +38,4 @@ static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
203 BUG(); 38 BUG();
204} 39}
205 40
206static inline int s3c_fb_pal_is16(unsigned int window) 41#endif /* __ASM_ARCH_MACH_REGS_FB_H */
207{
208 return window > 1;
209}
210
211struct s3c_fb_palette {
212 struct fb_bitfield r;
213 struct fb_bitfield g;
214 struct fb_bitfield b;
215 struct fb_bitfield a;
216};
217
218static inline void s3c_fb_init_palette(unsigned int window,
219 struct s3c_fb_palette *palette)
220{
221 if (window < 2) {
222 /* Windows 0/1 are 8/8/8 or A/8/8/8 */
223 palette->r.offset = 16;
224 palette->r.length = 8;
225 palette->g.offset = 8;
226 palette->g.length = 8;
227 palette->b.offset = 0;
228 palette->b.length = 8;
229 } else {
230 /* currently we assume RGB 5/6/5 */
231 palette->r.offset = 11;
232 palette->r.length = 5;
233 palette->g.offset = 5;
234 palette->g.length = 6;
235 palette->b.offset = 0;
236 palette->b.length = 5;
237 }
238}
239
240/* Notes on per-window bpp settings
241 *
242 * Value Win0 Win1 Win2 Win3 Win 4
243 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
244 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
245 * 0010 4(P) 4(P) 4(P) 4(P) -none-
246 * 0011 8(P) 8(P) -none- -none- -none-
247 * 0100 -none- 8(A232) 8(A232) -none- -none-
248 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
249 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
250 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
251 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
252 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
253 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
254 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
255 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
256 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
257 * 1110 -none- -none- -none- -none- -none-
258 * 1111 -none- -none- -none- -none- -none-
259*/
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c6400/s3c6400.c
index b42bdd0f2138..d876ee503671 100644
--- a/arch/arm/mach-s3c6400/s3c6400.c
+++ b/arch/arm/mach-s3c6400/s3c6400.c
@@ -45,6 +45,7 @@ void __init s3c6400_map_io(void)
45 45
46 s3c6400_default_sdhci0(); 46 s3c6400_default_sdhci0();
47 s3c6400_default_sdhci1(); 47 s3c6400_default_sdhci1();
48 s3c6400_default_sdhci2();
48 49
49 /* the i2c devices are directly compatible with s3c2440 */ 50 /* the i2c devices are directly compatible with s3c2440 */
50 s3c_i2c0_setname("s3c2440-i2c"); 51 s3c_i2c0_setname("s3c2440-i2c");
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c
index 9b67c663d9d8..522c08691952 100644
--- a/arch/arm/mach-s3c6410/cpu.c
+++ b/arch/arm/mach-s3c6410/cpu.c
@@ -58,6 +58,7 @@ void __init s3c6410_map_io(void)
58 /* initialise device information early */ 58 /* initialise device information early */
59 s3c6410_default_sdhci0(); 59 s3c6410_default_sdhci0();
60 s3c6410_default_sdhci1(); 60 s3c6410_default_sdhci1();
61 s3c6410_default_sdhci2();
61 62
62 /* the i2c devices are directly compatible with s3c2440 */ 63 /* the i2c devices are directly compatible with s3c2440 */
63 s3c_i2c0_setname("s3c2440-i2c"); 64 s3c_i2c0_setname("s3c2440-i2c");
diff --git a/arch/arm/mach-s3c6410/mach-hmt.c b/arch/arm/mach-s3c6410/mach-hmt.c
index c5741056193f..cdd4b5378552 100644
--- a/arch/arm/mach-s3c6410/mach-hmt.c
+++ b/arch/arm/mach-s3c6410/mach-hmt.c
@@ -250,7 +250,7 @@ static void __init hmt_machine_init(void)
250{ 250{
251 s3c_i2c0_set_platdata(NULL); 251 s3c_i2c0_set_platdata(NULL);
252 s3c_fb_set_platdata(&hmt_lcd_pdata); 252 s3c_fb_set_platdata(&hmt_lcd_pdata);
253 s3c_device_nand.dev.platform_data = &hmt_nand_info; 253 s3c_nand_set_platdata(&hmt_nand_info);
254 254
255 gpio_request(S3C64XX_GPC(7), "usb power"); 255 gpio_request(S3C64XX_GPC(7), "usb power");
256 gpio_direction_output(S3C64XX_GPC(7), 0); 256 gpio_direction_output(S3C64XX_GPC(7), 0);
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index 9f1a21462620..480d297c1de2 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/smsc911x.h> 27#include <linux/smsc911x.h>
28#include <linux/regulator/fixed.h>
28 29
29#ifdef CONFIG_SMDK6410_WM1190_EV1 30#ifdef CONFIG_SMDK6410_WM1190_EV1
30#include <linux/mfd/wm8350/core.h> 31#include <linux/mfd/wm8350/core.h>
@@ -184,6 +185,43 @@ static struct platform_device smdk6410_smsc911x = {
184 }, 185 },
185}; 186};
186 187
188#ifdef CONFIG_REGULATOR
189static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = {
190 {
191 /* WM8580 */
192 .supply = "PVDD",
193 .dev_name = "0-001b",
194 },
195 {
196 /* WM8580 */
197 .supply = "AVDD",
198 .dev_name = "0-001b",
199 },
200};
201
202static struct regulator_init_data smdk6410_b_pwr_5v_data = {
203 .constraints = {
204 .always_on = 1,
205 },
206 .num_consumer_supplies = ARRAY_SIZE(smdk6410_b_pwr_5v_consumers),
207 .consumer_supplies = smdk6410_b_pwr_5v_consumers,
208};
209
210static struct fixed_voltage_config smdk6410_b_pwr_5v_pdata = {
211 .supply_name = "B_PWR_5V",
212 .microvolts = 5000000,
213 .init_data = &smdk6410_b_pwr_5v_data,
214};
215
216static struct platform_device smdk6410_b_pwr_5v = {
217 .name = "reg-fixed-voltage",
218 .id = -1,
219 .dev = {
220 .platform_data = &smdk6410_b_pwr_5v_pdata,
221 },
222};
223#endif
224
187static struct map_desc smdk6410_iodesc[] = {}; 225static struct map_desc smdk6410_iodesc[] = {};
188 226
189static struct platform_device *smdk6410_devices[] __initdata = { 227static struct platform_device *smdk6410_devices[] __initdata = {
@@ -198,6 +236,10 @@ static struct platform_device *smdk6410_devices[] __initdata = {
198 &s3c_device_fb, 236 &s3c_device_fb,
199 &s3c_device_usb, 237 &s3c_device_usb,
200 &s3c_device_usb_hsotg, 238 &s3c_device_usb_hsotg,
239
240#ifdef CONFIG_REGULATOR
241 &smdk6410_b_pwr_5v,
242#endif
201 &smdk6410_lcd_powerdev, 243 &smdk6410_lcd_powerdev,
202 244
203 &smdk6410_smsc911x, 245 &smdk6410_smsc911x,
@@ -232,6 +274,14 @@ static struct regulator_init_data wm8350_dcdc3_data = {
232}; 274};
233 275
234/* USB, EXT, PCM, ADC/DAC, USB, MMC */ 276/* USB, EXT, PCM, ADC/DAC, USB, MMC */
277static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
278 {
279 /* WM8580 */
280 .supply = "DVDD",
281 .dev_name = "0-001b",
282 },
283};
284
235static struct regulator_init_data wm8350_dcdc4_data = { 285static struct regulator_init_data wm8350_dcdc4_data = {
236 .constraints = { 286 .constraints = {
237 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 287 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV",
@@ -239,6 +289,8 @@ static struct regulator_init_data wm8350_dcdc4_data = {
239 .max_uV = 3000000, 289 .max_uV = 3000000,
240 .always_on = 1, 290 .always_on = 1,
241 }, 291 },
292 .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers),
293 .consumer_supplies = wm8350_dcdc4_consumers,
242}; 294};
243 295
244/* ARM core */ 296/* ARM core */
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b1a4ba504416..0dd2b8c6eabe 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -14,9 +14,23 @@ config CPU_S5PC100
14 help 14 help
15 Enable S5PC100 CPU support 15 Enable S5PC100 CPU support
16 16
17config S5PC100_SETUP_SDHCI
18 bool
19 select S5PC1XX_SETUP_SDHCI_GPIO
20 help
21 Internal helper functions for S5PC100 based SDHCI systems
22
17config MACH_SMDKC100 23config MACH_SMDKC100
18 bool "SMDKC100" 24 bool "SMDKC100"
19 select CPU_S5PC100 25 select CPU_S5PC100
26 select S3C_DEV_FB
27 select S3C_DEV_I2C1
28 select S3C_DEV_HSMMC
29 select S3C_DEV_HSMMC1
30 select S3C_DEV_HSMMC2
31 select S5PC1XX_SETUP_I2C0
20 select S5PC1XX_SETUP_I2C1 32 select S5PC1XX_SETUP_I2C1
33 select S5PC1XX_SETUP_FB_24BPP
34 select S5PC100_SETUP_SDHCI
21 help 35 help
22 Machine support for the Samsung SMDKC100 36 Machine support for the Samsung SMDKC100
diff --git a/arch/arm/mach-s5pc100/Makefile b/arch/arm/mach-s5pc100/Makefile
index afc89b381d7a..809ff10f768f 100644
--- a/arch/arm/mach-s5pc100/Makefile
+++ b/arch/arm/mach-s5pc100/Makefile
@@ -13,5 +13,9 @@ obj- :=
13 13
14obj-$(CONFIG_CPU_S5PC100) += cpu.o 14obj-$(CONFIG_CPU_S5PC100) += cpu.o
15 15
16# Helper and device support
17
18obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
19
16# machine support 20# machine support
17obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o 21obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
diff --git a/arch/arm/mach-s5pc100/cpu.c b/arch/arm/mach-s5pc100/cpu.c
index 0e718890da32..d79e7574a852 100644
--- a/arch/arm/mach-s5pc100/cpu.c
+++ b/arch/arm/mach-s5pc100/cpu.c
@@ -22,6 +22,8 @@
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <asm/proc-fns.h>
26
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 28#include <asm/mach/map.h>
27#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
@@ -32,6 +34,7 @@
32 34
33#include <plat/cpu-freq.h> 35#include <plat/cpu-freq.h>
34#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/regs-power.h>
35 38
36#include <plat/cpu.h> 39#include <plat/cpu.h>
37#include <plat/devs.h> 40#include <plat/devs.h>
@@ -45,6 +48,23 @@
45static struct map_desc s5pc100_iodesc[] __initdata = { 48static struct map_desc s5pc100_iodesc[] __initdata = {
46}; 49};
47 50
51static void s5pc100_idle(void)
52{
53 unsigned long tmp;
54
55 tmp = __raw_readl(S5PC100_PWR_CFG);
56 tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
57 tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
58 tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
59 __raw_writel(tmp, S5PC100_PWR_CFG);
60
61 tmp = __raw_readl(S5PC100_OTHERS);
62 tmp |= S5PC100_PMU_INT_DISABLE;
63 __raw_writel(tmp, S5PC100_OTHERS);
64
65 cpu_do_idle();
66}
67
48/* s5pc100_map_io 68/* s5pc100_map_io
49 * 69 *
50 * register the standard cpu IO areas 70 * register the standard cpu IO areas
@@ -55,6 +75,13 @@ void __init s5pc100_map_io(void)
55 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc)); 75 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
56 76
57 /* initialise device information early */ 77 /* initialise device information early */
78 s5pc100_default_sdhci0();
79 s5pc100_default_sdhci1();
80 s5pc100_default_sdhci2();
81
82 /* the i2c devices are directly compatible with s3c2440 */
83 s3c_i2c0_setname("s3c2440-i2c");
84 s3c_i2c1_setname("s3c2440-i2c");
58} 85}
59 86
60void __init s5pc100_init_clocks(int xtal) 87void __init s5pc100_init_clocks(int xtal)
@@ -93,5 +120,7 @@ int __init s5pc100_init(void)
93{ 120{
94 printk(KERN_DEBUG "S5PC100: Initialising architecture\n"); 121 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
95 122
123 s5pc1xx_idle = s5pc100_idle;
124
96 return sysdev_register(&s5pc100_sysdev); 125 return sysdev_register(&s5pc100_sysdev);
97} 126}
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio.h b/arch/arm/mach-s5pc100/include/mach/gpio.h
index c74fc93d7d15..2c4cbe8ee6b7 100644
--- a/arch/arm/mach-s5pc100/include/mach/gpio.h
+++ b/arch/arm/mach-s5pc100/include/mach/gpio.h
@@ -18,40 +18,45 @@
18#define gpio_to_irq __gpio_to_irq 18#define gpio_to_irq __gpio_to_irq
19 19
20/* GPIO bank sizes */ 20/* GPIO bank sizes */
21#define S5PC1XX_GPIO_A0_NR (8) 21#define S5PC100_GPIO_A0_NR (8)
22#define S5PC1XX_GPIO_A1_NR (5) 22#define S5PC100_GPIO_A1_NR (5)
23#define S5PC1XX_GPIO_B_NR (8) 23#define S5PC100_GPIO_B_NR (8)
24#define S5PC1XX_GPIO_C_NR (5) 24#define S5PC100_GPIO_C_NR (5)
25#define S5PC1XX_GPIO_D_NR (7) 25#define S5PC100_GPIO_D_NR (7)
26#define S5PC1XX_GPIO_E0_NR (8) 26#define S5PC100_GPIO_E0_NR (8)
27#define S5PC1XX_GPIO_E1_NR (6) 27#define S5PC100_GPIO_E1_NR (6)
28#define S5PC1XX_GPIO_F0_NR (8) 28#define S5PC100_GPIO_F0_NR (8)
29#define S5PC1XX_GPIO_F1_NR (8) 29#define S5PC100_GPIO_F1_NR (8)
30#define S5PC1XX_GPIO_F2_NR (8) 30#define S5PC100_GPIO_F2_NR (8)
31#define S5PC1XX_GPIO_F3_NR (4) 31#define S5PC100_GPIO_F3_NR (4)
32#define S5PC1XX_GPIO_G0_NR (8) 32#define S5PC100_GPIO_G0_NR (8)
33#define S5PC1XX_GPIO_G1_NR (3) 33#define S5PC100_GPIO_G1_NR (3)
34#define S5PC1XX_GPIO_G2_NR (7) 34#define S5PC100_GPIO_G2_NR (7)
35#define S5PC1XX_GPIO_G3_NR (7) 35#define S5PC100_GPIO_G3_NR (7)
36#define S5PC1XX_GPIO_H0_NR (8) 36#define S5PC100_GPIO_H0_NR (8)
37#define S5PC1XX_GPIO_H1_NR (8) 37#define S5PC100_GPIO_H1_NR (8)
38#define S5PC1XX_GPIO_H2_NR (8) 38#define S5PC100_GPIO_H2_NR (8)
39#define S5PC1XX_GPIO_H3_NR (8) 39#define S5PC100_GPIO_H3_NR (8)
40#define S5PC1XX_GPIO_I_NR (8) 40#define S5PC100_GPIO_I_NR (8)
41#define S5PC1XX_GPIO_J0_NR (8) 41#define S5PC100_GPIO_J0_NR (8)
42#define S5PC1XX_GPIO_J1_NR (5) 42#define S5PC100_GPIO_J1_NR (5)
43#define S5PC1XX_GPIO_J2_NR (8) 43#define S5PC100_GPIO_J2_NR (8)
44#define S5PC1XX_GPIO_J3_NR (8) 44#define S5PC100_GPIO_J3_NR (8)
45#define S5PC1XX_GPIO_J4_NR (4) 45#define S5PC100_GPIO_J4_NR (4)
46#define S5PC1XX_GPIO_K0_NR (8) 46#define S5PC100_GPIO_K0_NR (8)
47#define S5PC1XX_GPIO_K1_NR (6) 47#define S5PC100_GPIO_K1_NR (6)
48#define S5PC1XX_GPIO_K2_NR (8) 48#define S5PC100_GPIO_K2_NR (8)
49#define S5PC1XX_GPIO_K3_NR (8) 49#define S5PC100_GPIO_K3_NR (8)
50#define S5PC1XX_GPIO_MP00_NR (8) 50#define S5PC100_GPIO_L0_NR (8)
51#define S5PC1XX_GPIO_MP01_NR (8) 51#define S5PC100_GPIO_L1_NR (8)
52#define S5PC1XX_GPIO_MP02_NR (8) 52#define S5PC100_GPIO_L2_NR (8)
53#define S5PC1XX_GPIO_MP03_NR (8) 53#define S5PC100_GPIO_L3_NR (8)
54#define S5PC1XX_GPIO_MP04_NR (5) 54#define S5PC100_GPIO_L4_NR (8)
55#define S5PC100_GPIO_MP00_NR (8)
56#define S5PC100_GPIO_MP01_NR (8)
57#define S5PC100_GPIO_MP02_NR (8)
58#define S5PC100_GPIO_MP03_NR (8)
59#define S5PC100_GPIO_MP04_NR (5)
55 60
56/* GPIO bank numbes */ 61/* GPIO bank numbes */
57 62
@@ -64,83 +69,94 @@
64 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) 69 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
65 70
66enum s3c_gpio_number { 71enum s3c_gpio_number {
67 S5PC1XX_GPIO_A0_START = 0, 72 S5PC100_GPIO_A0_START = 0,
68 S5PC1XX_GPIO_A1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A0), 73 S5PC100_GPIO_A1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_A0),
69 S5PC1XX_GPIO_B_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_A1), 74 S5PC100_GPIO_B_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_A1),
70 S5PC1XX_GPIO_C_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_B), 75 S5PC100_GPIO_C_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_B),
71 S5PC1XX_GPIO_D_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_C), 76 S5PC100_GPIO_D_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_C),
72 S5PC1XX_GPIO_E0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_D), 77 S5PC100_GPIO_E0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_D),
73 S5PC1XX_GPIO_E1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E0), 78 S5PC100_GPIO_E1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_E0),
74 S5PC1XX_GPIO_F0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_E1), 79 S5PC100_GPIO_F0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_E1),
75 S5PC1XX_GPIO_F1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F0), 80 S5PC100_GPIO_F1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F0),
76 S5PC1XX_GPIO_F2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F1), 81 S5PC100_GPIO_F2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F1),
77 S5PC1XX_GPIO_F3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F2), 82 S5PC100_GPIO_F3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F2),
78 S5PC1XX_GPIO_G0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_F3), 83 S5PC100_GPIO_G0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_F3),
79 S5PC1XX_GPIO_G1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G0), 84 S5PC100_GPIO_G1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G0),
80 S5PC1XX_GPIO_G2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G1), 85 S5PC100_GPIO_G2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G1),
81 S5PC1XX_GPIO_G3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G2), 86 S5PC100_GPIO_G3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G2),
82 S5PC1XX_GPIO_H0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_G3), 87 S5PC100_GPIO_H0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_G3),
83 S5PC1XX_GPIO_H1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H0), 88 S5PC100_GPIO_H1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H0),
84 S5PC1XX_GPIO_H2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H1), 89 S5PC100_GPIO_H2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H1),
85 S5PC1XX_GPIO_H3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H2), 90 S5PC100_GPIO_H3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H2),
86 S5PC1XX_GPIO_I_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_H3), 91 S5PC100_GPIO_I_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_H3),
87 S5PC1XX_GPIO_J0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_I), 92 S5PC100_GPIO_J0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_I),
88 S5PC1XX_GPIO_J1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J0), 93 S5PC100_GPIO_J1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J0),
89 S5PC1XX_GPIO_J2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J1), 94 S5PC100_GPIO_J2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J1),
90 S5PC1XX_GPIO_J3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J2), 95 S5PC100_GPIO_J3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J2),
91 S5PC1XX_GPIO_J4_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J3), 96 S5PC100_GPIO_J4_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J3),
92 S5PC1XX_GPIO_K0_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_J4), 97 S5PC100_GPIO_K0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_J4),
93 S5PC1XX_GPIO_K1_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K0), 98 S5PC100_GPIO_K1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K0),
94 S5PC1XX_GPIO_K2_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K1), 99 S5PC100_GPIO_K2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K1),
95 S5PC1XX_GPIO_K3_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K2), 100 S5PC100_GPIO_K3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K2),
96 S5PC1XX_GPIO_MP00_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_K3), 101 S5PC100_GPIO_L0_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_K3),
97 S5PC1XX_GPIO_MP01_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP00), 102 S5PC100_GPIO_L1_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L0),
98 S5PC1XX_GPIO_MP02_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP01), 103 S5PC100_GPIO_L2_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L1),
99 S5PC1XX_GPIO_MP03_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP02), 104 S5PC100_GPIO_L3_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L2),
100 S5PC1XX_GPIO_MP04_START = S5PC1XX_GPIO_NEXT(S5PC1XX_GPIO_MP03), 105 S5PC100_GPIO_L4_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L3),
106 S5PC100_GPIO_MP00_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_L4),
107 S5PC100_GPIO_MP01_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP00),
108 S5PC100_GPIO_MP02_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP01),
109 S5PC100_GPIO_MP03_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP02),
110 S5PC100_GPIO_MP04_START = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP03),
111 S5PC100_GPIO_END = S5PC1XX_GPIO_NEXT(S5PC100_GPIO_MP04),
101}; 112};
102 113
103/* S5PC1XX GPIO number definitions. */ 114/* S5PC100 GPIO number definitions. */
104#define S5PC1XX_GPA0(_nr) (S5PC1XX_GPIO_A0_START + (_nr)) 115#define S5PC100_GPA0(_nr) (S5PC100_GPIO_A0_START + (_nr))
105#define S5PC1XX_GPA1(_nr) (S5PC1XX_GPIO_A1_START + (_nr)) 116#define S5PC100_GPA1(_nr) (S5PC100_GPIO_A1_START + (_nr))
106#define S5PC1XX_GPB(_nr) (S5PC1XX_GPIO_B_START + (_nr)) 117#define S5PC100_GPB(_nr) (S5PC100_GPIO_B_START + (_nr))
107#define S5PC1XX_GPC(_nr) (S5PC1XX_GPIO_C_START + (_nr)) 118#define S5PC100_GPC(_nr) (S5PC100_GPIO_C_START + (_nr))
108#define S5PC1XX_GPD(_nr) (S5PC1XX_GPIO_D_START + (_nr)) 119#define S5PC100_GPD(_nr) (S5PC100_GPIO_D_START + (_nr))
109#define S5PC1XX_GPE0(_nr) (S5PC1XX_GPIO_E0_START + (_nr)) 120#define S5PC100_GPE0(_nr) (S5PC100_GPIO_E0_START + (_nr))
110#define S5PC1XX_GPE1(_nr) (S5PC1XX_GPIO_E1_START + (_nr)) 121#define S5PC100_GPE1(_nr) (S5PC100_GPIO_E1_START + (_nr))
111#define S5PC1XX_GPF0(_nr) (S5PC1XX_GPIO_F0_START + (_nr)) 122#define S5PC100_GPF0(_nr) (S5PC100_GPIO_F0_START + (_nr))
112#define S5PC1XX_GPF1(_nr) (S5PC1XX_GPIO_F1_START + (_nr)) 123#define S5PC100_GPF1(_nr) (S5PC100_GPIO_F1_START + (_nr))
113#define S5PC1XX_GPF2(_nr) (S5PC1XX_GPIO_F2_START + (_nr)) 124#define S5PC100_GPF2(_nr) (S5PC100_GPIO_F2_START + (_nr))
114#define S5PC1XX_GPF3(_nr) (S5PC1XX_GPIO_F3_START + (_nr)) 125#define S5PC100_GPF3(_nr) (S5PC100_GPIO_F3_START + (_nr))
115#define S5PC1XX_GPG0(_nr) (S5PC1XX_GPIO_G0_START + (_nr)) 126#define S5PC100_GPG0(_nr) (S5PC100_GPIO_G0_START + (_nr))
116#define S5PC1XX_GPG1(_nr) (S5PC1XX_GPIO_G1_START + (_nr)) 127#define S5PC100_GPG1(_nr) (S5PC100_GPIO_G1_START + (_nr))
117#define S5PC1XX_GPG2(_nr) (S5PC1XX_GPIO_G2_START + (_nr)) 128#define S5PC100_GPG2(_nr) (S5PC100_GPIO_G2_START + (_nr))
118#define S5PC1XX_GPG3(_nr) (S5PC1XX_GPIO_G3_START + (_nr)) 129#define S5PC100_GPG3(_nr) (S5PC100_GPIO_G3_START + (_nr))
119#define S5PC1XX_GPH0(_nr) (S5PC1XX_GPIO_H0_START + (_nr)) 130#define S5PC100_GPH0(_nr) (S5PC100_GPIO_H0_START + (_nr))
120#define S5PC1XX_GPH1(_nr) (S5PC1XX_GPIO_H1_START + (_nr)) 131#define S5PC100_GPH1(_nr) (S5PC100_GPIO_H1_START + (_nr))
121#define S5PC1XX_GPH2(_nr) (S5PC1XX_GPIO_H2_START + (_nr)) 132#define S5PC100_GPH2(_nr) (S5PC100_GPIO_H2_START + (_nr))
122#define S5PC1XX_GPH3(_nr) (S5PC1XX_GPIO_H3_START + (_nr)) 133#define S5PC100_GPH3(_nr) (S5PC100_GPIO_H3_START + (_nr))
123#define S5PC1XX_GPI(_nr) (S5PC1XX_GPIO_I_START + (_nr)) 134#define S5PC100_GPI(_nr) (S5PC100_GPIO_I_START + (_nr))
124#define S5PC1XX_GPJ0(_nr) (S5PC1XX_GPIO_J0_START + (_nr)) 135#define S5PC100_GPJ0(_nr) (S5PC100_GPIO_J0_START + (_nr))
125#define S5PC1XX_GPJ1(_nr) (S5PC1XX_GPIO_J1_START + (_nr)) 136#define S5PC100_GPJ1(_nr) (S5PC100_GPIO_J1_START + (_nr))
126#define S5PC1XX_GPJ2(_nr) (S5PC1XX_GPIO_J2_START + (_nr)) 137#define S5PC100_GPJ2(_nr) (S5PC100_GPIO_J2_START + (_nr))
127#define S5PC1XX_GPJ3(_nr) (S5PC1XX_GPIO_J3_START + (_nr)) 138#define S5PC100_GPJ3(_nr) (S5PC100_GPIO_J3_START + (_nr))
128#define S5PC1XX_GPJ4(_nr) (S5PC1XX_GPIO_J4_START + (_nr)) 139#define S5PC100_GPJ4(_nr) (S5PC100_GPIO_J4_START + (_nr))
129#define S5PC1XX_GPK0(_nr) (S5PC1XX_GPIO_K0_START + (_nr)) 140#define S5PC100_GPK0(_nr) (S5PC100_GPIO_K0_START + (_nr))
130#define S5PC1XX_GPK1(_nr) (S5PC1XX_GPIO_K1_START + (_nr)) 141#define S5PC100_GPK1(_nr) (S5PC100_GPIO_K1_START + (_nr))
131#define S5PC1XX_GPK2(_nr) (S5PC1XX_GPIO_K2_START + (_nr)) 142#define S5PC100_GPK2(_nr) (S5PC100_GPIO_K2_START + (_nr))
132#define S5PC1XX_GPK3(_nr) (S5PC1XX_GPIO_K3_START + (_nr)) 143#define S5PC100_GPK3(_nr) (S5PC100_GPIO_K3_START + (_nr))
133#define S5PC1XX_MP00(_nr) (S5PC1XX_GPIO_MP00_START + (_nr)) 144#define S5PC100_GPL0(_nr) (S5PC100_GPIO_L0_START + (_nr))
134#define S5PC1XX_MP01(_nr) (S5PC1XX_GPIO_MP01_START + (_nr)) 145#define S5PC100_GPL1(_nr) (S5PC100_GPIO_L1_START + (_nr))
135#define S5PC1XX_MP02(_nr) (S5PC1XX_GPIO_MP02_START + (_nr)) 146#define S5PC100_GPL2(_nr) (S5PC100_GPIO_L2_START + (_nr))
136#define S5PC1XX_MP03(_nr) (S5PC1XX_GPIO_MP03_START + (_nr)) 147#define S5PC100_GPL3(_nr) (S5PC100_GPIO_L3_START + (_nr))
137#define S5PC1XX_MP04(_nr) (S5PC1XX_GPIO_MP04_START + (_nr)) 148#define S5PC100_GPL4(_nr) (S5PC100_GPIO_L4_START + (_nr))
149#define S5PC100_MP00(_nr) (S5PC100_GPIO_MP00_START + (_nr))
150#define S5PC100_MP01(_nr) (S5PC100_GPIO_MP01_START + (_nr))
151#define S5PC100_MP02(_nr) (S5PC100_GPIO_MP02_START + (_nr))
152#define S5PC100_MP03(_nr) (S5PC100_GPIO_MP03_START + (_nr))
153#define S5PC100_MP04(_nr) (S5PC100_GPIO_MP04_START + (_nr))
154#define S5PC100_MP05(_nr) (S5PC100_GPIO_MP05_START + (_nr))
138 155
139/* the end of the S5PC1XX specific gpios */ 156/* It used the end of the S5PC1XX gpios */
140#define S5PC1XX_GPIO_END (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) 157#define S3C_GPIO_END S5PC100_GPIO_END
141#define S3C_GPIO_END S5PC1XX_GPIO_END
142 158
143/* define the number of gpios we need to the one after the MP04() range */ 159/* define the number of gpios we need to the one after the MP04() range */
144#define ARCH_NR_GPIOS (S5PC1XX_MP04(S5PC1XX_GPIO_MP04_NR) + 1) 160#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)
145 161
146#include <asm-generic/gpio.h> 162#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s5pc100/include/mach/irqs.h b/arch/arm/mach-s5pc100/include/mach/irqs.h
index 622720dba289..b53fa48a52c6 100644
--- a/arch/arm/mach-s5pc100/include/mach/irqs.h
+++ b/arch/arm/mach-s5pc100/include/mach/irqs.h
@@ -11,4 +11,9 @@
11 11
12#include <plat/irqs.h> 12#include <plat/irqs.h>
13 13
14/* LCD */
15#define IRQ_LCD_FIFO IRQ_LCD0
16#define IRQ_LCD_VSYNC IRQ_LCD1
17#define IRQ_LCD_SYSTEM IRQ_LCD2
18
14#endif /* __ASM_ARCH_IRQ_H */ 19#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index 9e9f39130b2c..4681ebe8bef6 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -17,6 +17,19 @@
17 17
18#include <plat/map-base.h> 18#include <plat/map-base.h>
19 19
20/*
21 * map-base.h has already defined virtual memory address
22 * S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s)
23 * S3C_VA_SYS S3C_ADDR(0x00100000) system control
24 * S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used)
25 * S3C_VA_TIMER S3C_ADDR(0x00300000) timer block
26 * S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog
27 * S3C_VA_UART S3C_ADDR(0x01000000) UART
28 *
29 * S5PC100 specific virtual memory address can be defined here
30 * S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO
31 *
32 */
20 33
21/* Chip ID */ 34/* Chip ID */
22#define S5PC100_PA_CHIPID (0xE0000000) 35#define S5PC100_PA_CHIPID (0xE0000000)
@@ -24,13 +37,20 @@
24#define S5PC1XX_VA_CHIPID S3C_VA_SYS 37#define S5PC1XX_VA_CHIPID S3C_VA_SYS
25 38
26/* System */ 39/* System */
27#define S5PC100_PA_SYS (0xE0100000) 40#define S5PC100_PA_CLK (0xE0100000)
28#define S5PC100_PA_CLK (S5PC100_PA_SYS + 0x0) 41#define S5PC100_PA_CLK_OTHER (0xE0200000)
29#define S5PC100_PA_PWR (S5PC100_PA_SYS + 0x8000) 42#define S5PC100_PA_PWR (0xE0108000)
30#define S5PC1XX_PA_CLK S5PC100_PA_CLK 43#define S5PC1XX_PA_CLK S5PC100_PA_CLK
31#define S5PC1XX_PA_PWR S5PC100_PA_PWR 44#define S5PC1XX_PA_PWR S5PC100_PA_PWR
45#define S5PC1XX_PA_CLK_OTHER S5PC100_PA_CLK_OTHER
32#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000) 46#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)
33#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000) 47#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)
48#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000)
49
50/* GPIO */
51#define S5PC100_PA_GPIO (0xE0300000)
52#define S5PC1XX_PA_GPIO S5PC100_PA_GPIO
53#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)
34 54
35/* Interrupt */ 55/* Interrupt */
36#define S5PC100_PA_VIC (0xE4000000) 56#define S5PC100_PA_VIC (0xE4000000)
@@ -40,23 +60,64 @@
40#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET)) 60#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))
41#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) 61#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
42 62
63/* DMA */
64#define S5PC100_PA_MDMA (0xE8100000)
65#define S5PC100_PA_PDMA0 (0xE9000000)
66#define S5PC100_PA_PDMA1 (0xE9200000)
67
43/* Timer */ 68/* Timer */
44#define S5PC100_PA_TIMER (0xEA000000) 69#define S5PC100_PA_TIMER (0xEA000000)
45#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER 70#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER
46#define S5PC1XX_VA_TIMER S3C_VA_TIMER 71#define S5PC1XX_VA_TIMER S3C_VA_TIMER
47 72
73/* RTC */
74#define S5PC100_PA_RTC (0xEA300000)
75
48/* UART */ 76/* UART */
49#define S5PC100_PA_UART (0xEC000000) 77#define S5PC100_PA_UART (0xEC000000)
50#define S5PC1XX_PA_UART S5PC100_PA_UART 78#define S5PC1XX_PA_UART S5PC100_PA_UART
51#define S5PC1XX_VA_UART S3C_VA_UART 79#define S5PC1XX_VA_UART S3C_VA_UART
52 80
53/* IIC */ 81/* I2C */
54#define S5PC100_PA_IIC (0xEC100000) 82#define S5PC100_PA_I2C (0xEC100000)
83#define S5PC100_PA_I2C1 (0xEC200000)
84
85/* USB HS OTG */
86#define S5PC100_PA_USB_HSOTG (0xED200000)
87#define S5PC100_PA_USB_HSPHY (0xED300000)
88
89/* SD/MMC */
90#define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
91#define S5PC100_PA_HSMMC0 S5PC100_PA_HSMMC(0)
92#define S5PC100_PA_HSMMC1 S5PC100_PA_HSMMC(1)
93#define S5PC100_PA_HSMMC2 S5PC100_PA_HSMMC(2)
94
95/* LCD */
96#define S5PC100_PA_FB (0xEE000000)
97
98/* Multimedia */
99#define S5PC100_PA_G2D (0xEE800000)
100#define S5PC100_PA_JPEG (0xEE500000)
101#define S5PC100_PA_ROTATOR (0xEE100000)
102#define S5PC100_PA_G3D (0xEF000000)
103
104/* I2S */
105#define S5PC100_PA_I2S0 (0xF2000000)
106#define S5PC100_PA_I2S1 (0xF2100000)
107#define S5PC100_PA_I2S2 (0xF2200000)
108
109/* KEYPAD */
110#define S5PC100_PA_KEYPAD (0xF3100000)
111
112/* ADC & TouchScreen */
113#define S5PC100_PA_TSADC (0xF3000000)
55 114
56/* ETC */ 115/* ETC */
57#define S5PC100_PA_SDRAM (0x20000000) 116#define S5PC100_PA_SDRAM (0x20000000)
117#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM
58 118
59/* compatibility defines. */ 119/* compatibility defines. */
120#define S3C_PA_RTC S5PC100_PA_RTC
60#define S3C_PA_UART S5PC100_PA_UART 121#define S3C_PA_UART S5PC100_PA_UART
61#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0) 122#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0)
62#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400) 123#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400)
@@ -67,9 +128,23 @@
67#define S3C_VA_UART2 (S3C_VA_UART + 0x800) 128#define S3C_VA_UART2 (S3C_VA_UART + 0x800)
68#define S3C_VA_UART3 (S3C_VA_UART + 0xC00) 129#define S3C_VA_UART3 (S3C_VA_UART + 0xC00)
69#define S3C_UART_OFFSET 0x400 130#define S3C_UART_OFFSET 0x400
131#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
132#define S3C_PA_FB S5PC100_PA_FB
133#define S3C_PA_G2D S5PC100_PA_G2D
134#define S3C_PA_G3D S5PC100_PA_G3D
135#define S3C_PA_JPEG S5PC100_PA_JPEG
136#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR
70#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) 137#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0)
71#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 138#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
72#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) 139#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000)
73#define S3C_PA_IIC S5PC100_PA_IIC 140#define S3C_PA_IIC S5PC100_PA_I2C
141#define S3C_PA_IIC1 S5PC100_PA_I2C1
142#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
143#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
144#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0
145#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1
146#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2
147#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
148#define S3C_PA_TSADC S5PC100_PA_TSADC
74 149
75#endif /* __ASM_ARCH_C100_MAP_H */ 150#endif /* __ASM_ARCH_C100_MAP_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-fb.h b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
new file mode 100644
index 000000000000..1732cd28c765
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
@@ -0,0 +1,139 @@
1/* arch/arm/mach-s5pc100/include/mach/regs-fb.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Pawel Osciak <p.osciak@samsung.com>
5 *
6 * Framebuffer register definitions for Samsung S5PC100.
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#ifndef __ASM_ARCH_REGS_FB_H
14#define __ASM_ARCH_REGS_FB_H __FILE__
15
16#include <plat/regs-fb-v4.h>
17
18/* VP1 interface timing control */
19#define VP1CON0 (0x118)
20#define VP1_RATECON_EN (1 << 31)
21#define VP1_CLKRATE_MASK (0xff)
22
23#define VP1CON1 (0x11c)
24#define VP1_VTREGCON_EN (1 << 31)
25#define VP1_VBPD_MASK (0xfff)
26#define VP1_VBPD_SHIFT (16)
27
28
29#define WPALCON_H (0x19c)
30#define WPALCON_L (0x1a0)
31
32/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but
33 * different for WPAL2-4
34 */
35/* In WPALCON_L (aka WPALCON) */
36#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3)
37#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0)
38
39/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H,
40 * e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]).
41 */
42#define WPALCON_L_WxPAL_L_MASK (0x1)
43#define WPALCON_L_W2PAL_L_SHIFT (6)
44#define WPALCON_L_W3PAL_L_SHIFT (7)
45#define WPALCON_L_W4PAL_L_SHIFT (8)
46
47#define WPALCON_L_WxPAL_H_MASK (0x3)
48#define WPALCON_H_W2PAL_H_SHIFT (9)
49#define WPALCON_H_W3PAL_H_SHIFT (13)
50#define WPALCON_H_W4PAL_H_SHIFT (17)
51
52/* Per-window alpha value registers */
53/* For window 0 8-bit alpha values are in VIDW0ALPHAx,
54 * for windows 1-4 alpha values consist of two parts, the 4 low bits are
55 * taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC,
56 * e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0])
57 */
58#define VIDWxALPHA0(_win) (0x200 + (_win * 8))
59#define VIDWxALPHA1(_win) (0x204 + (_win * 8))
60
61/* Only for window 0 in VIDW0ALPHAx. */
62#define VIDW0ALPHAx_R(_x) ((_x) << 16)
63#define VIDW0ALPHAx_R_MASK (0xff << 16)
64#define VIDW0ALPHAx_R_SHIFT (16)
65#define VIDW0ALPHAx_G(_x) ((_x) << 8)
66#define VIDW0ALPHAx_G_MASK (0xff << 8)
67#define VIDW0ALPHAx_G_SHIFT (8)
68#define VIDW0ALPHAx_B(_x) ((_x) << 0)
69#define VIDW0ALPHAx_B_MASK (0xff << 0)
70#define VIDW0ALPHAx_B_SHIFT (0)
71
72/* Low 4 bits of alpha0-1 for windows 1-4 */
73#define VIDW14ALPHAx_R_L(_x) ((_x) << 16)
74#define VIDW14ALPHAx_R_L_MASK (0xf << 16)
75#define VIDW14ALPHAx_R_L_SHIFT (16)
76#define VIDW14ALPHAx_G_L(_x) ((_x) << 8)
77#define VIDW14ALPHAx_G_L_MASK (0xf << 8)
78#define VIDW14ALPHAx_G_L_SHIFT (8)
79#define VIDW14ALPHAx_B_L(_x) ((_x) << 0)
80#define VIDW14ALPHAx_B_L_MASK (0xf << 0)
81#define VIDW14ALPHAx_B_L_SHIFT (0)
82
83
84/* Per-window blending equation control registers */
85#define BLENDEQx(_win) (0x244 + ((_win) * 4))
86#define BLENDEQ1 (0x244)
87#define BLENDEQ2 (0x248)
88#define BLENDEQ3 (0x24c)
89#define BLENDEQ4 (0x250)
90
91#define BLENDEQx_Q_FUNC(_x) ((_x) << 18)
92#define BLENDEQx_Q_FUNC_MASK (0xf << 18)
93#define BLENDEQx_P_FUNC(_x) ((_x) << 12)
94#define BLENDEQx_P_FUNC_MASK (0xf << 12)
95#define BLENDEQx_B_FUNC(_x) ((_x) << 6)
96#define BLENDEQx_B_FUNC_MASK (0xf << 6)
97#define BLENDEQx_A_FUNC(_x) ((_x) << 0)
98#define BLENDEQx_A_FUNC_MASK (0xf << 0)
99
100#define BLENDCON (0x260)
101#define BLENDCON_8BIT_ALPHA (1 << 0)
102
103/* Per-window palette base addresses (start of palette memory).
104 * Each window palette area consists of 256 32-bit entries.
105 * START is the first address (entry 0th), END is the address of 255th entry.
106 */
107#define WIN0_PAL_BASE (0x2400)
108#define WIN0_PAL_END (0x27fc)
109#define WIN1_PAL_BASE (0x2800)
110#define WIN1_PAL_END (0x2bfc)
111#define WIN2_PAL_BASE (0x2c00)
112#define WIN2_PAL_END (0x2ffc)
113#define WIN3_PAL_BASE (0x3000)
114#define WIN3_PAL_END (0x33fc)
115#define WIN4_PAL_BASE (0x3400)
116#define WIN4_PAL_END (0x37fc)
117
118#define WIN0_PAL(_entry) (WIN0_PAL_BASE + ((_entry) * 4))
119#define WIN1_PAL(_entry) (WIN1_PAL_BASE + ((_entry) * 4))
120#define WIN2_PAL(_entry) (WIN2_PAL_BASE + ((_entry) * 4))
121#define WIN3_PAL(_entry) (WIN3_PAL_BASE + ((_entry) * 4))
122#define WIN4_PAL(_entry) (WIN4_PAL_BASE + ((_entry) * 4))
123
124static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg)
125{
126 switch (window) {
127 case 0: return WIN0_PAL(reg);
128 case 1: return WIN1_PAL(reg);
129 case 2: return WIN2_PAL(reg);
130 case 3: return WIN3_PAL(reg);
131 case 4: return WIN4_PAL(reg);
132 }
133
134 BUG();
135}
136
137
138#endif /* __ASM_ARCH_REGS_FB_H */
139
diff --git a/arch/arm/mach-s5pc100/include/mach/system.h b/arch/arm/mach-s5pc100/include/mach/system.h
index e39014375470..f0d31a2a598c 100644
--- a/arch/arm/mach-s5pc100/include/mach/system.h
+++ b/arch/arm/mach-s5pc100/include/mach/system.h
@@ -11,14 +11,21 @@
11#ifndef __ASM_ARCH_SYSTEM_H 11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H __FILE__ 12#define __ASM_ARCH_SYSTEM_H __FILE__
13 13
14#include <linux/io.h>
15#include <mach/map.h>
16#include <plat/regs-clock.h>
17
18void (*s5pc1xx_idle)(void);
19
14static void arch_idle(void) 20static void arch_idle(void)
15{ 21{
16 /* nothing here yet */ 22 if (s5pc1xx_idle)
23 s5pc1xx_idle();
17} 24}
18 25
19static void arch_reset(char mode, const char *cmd) 26static void arch_reset(char mode, const char *cmd)
20{ 27{
21 /* nothing here yet */ 28 __raw_writel(S5PC100_SWRESET_RESETVAL, S5PC100_SWRESET);
29 return;
22} 30}
23
24#endif /* __ASM_ARCH_IRQ_H */ 31#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 214093cd7632..ae3c52cd0ebb 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -27,16 +27,22 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include <mach/map.h> 29#include <mach/map.h>
30#include <mach/regs-fb.h>
31#include <video/platform_lcd.h>
30 32
31#include <asm/irq.h> 33#include <asm/irq.h>
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33 35
34#include <plat/regs-serial.h> 36#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h>
38#include <plat/regs-gpio.h>
35 39
36#include <plat/clock.h> 40#include <plat/clock.h>
37#include <plat/devs.h> 41#include <plat/devs.h>
38#include <plat/cpu.h> 42#include <plat/cpu.h>
39#include <plat/s5pc100.h> 43#include <plat/s5pc100.h>
44#include <plat/fb.h>
45#include <plat/iic.h>
40 46
41#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) 47#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
42#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) 48#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)
@@ -73,9 +79,78 @@ static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
73 }, 79 },
74}; 80};
75 81
82/* I2C0 */
83static struct i2c_board_info i2c_devs0[] __initdata = {
84};
85
86/* I2C1 */
87static struct i2c_board_info i2c_devs1[] __initdata = {
88};
89
90/* LCD power controller */
91static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
92 unsigned int power)
93{
94 /* backlight */
95 gpio_direction_output(S5PC100_GPD(0), power);
96
97 if (power) {
98 /* module reset */
99 gpio_direction_output(S5PC100_GPH0(6), 1);
100 mdelay(100);
101 gpio_direction_output(S5PC100_GPH0(6), 0);
102 mdelay(10);
103 gpio_direction_output(S5PC100_GPH0(6), 1);
104 mdelay(10);
105 }
106}
107
108static struct plat_lcd_data smdkc100_lcd_power_data = {
109 .set_power = smdkc100_lcd_power_set,
110};
111
112static struct platform_device smdkc100_lcd_powerdev = {
113 .name = "platform-lcd",
114 .dev.parent = &s3c_device_fb.dev,
115 .dev.platform_data = &smdkc100_lcd_power_data,
116};
117
118/* Frame Buffer */
119static struct s3c_fb_pd_win smdkc100_fb_win0 = {
120 /* this is to ensure we use win0 */
121 .win_mode = {
122 .refresh = 70,
123 .pixclock = (8+13+3+800)*(7+5+1+480),
124 .left_margin = 8,
125 .right_margin = 13,
126 .upper_margin = 7,
127 .lower_margin = 5,
128 .hsync_len = 3,
129 .vsync_len = 1,
130 .xres = 800,
131 .yres = 480,
132 },
133 .max_bpp = 32,
134 .default_bpp = 16,
135};
136
137static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
138 .win[0] = &smdkc100_fb_win0,
139 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
140 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
141 .setup_gpio = s5pc100_fb_gpio_setup_24bpp,
142};
143
76static struct map_desc smdkc100_iodesc[] = {}; 144static struct map_desc smdkc100_iodesc[] = {};
77 145
78static struct platform_device *smdkc100_devices[] __initdata = { 146static struct platform_device *smdkc100_devices[] __initdata = {
147 &s3c_device_i2c0,
148 &s3c_device_i2c1,
149 &s3c_device_fb,
150 &s3c_device_hsmmc0,
151 &s3c_device_hsmmc1,
152 &s3c_device_hsmmc2,
153 &smdkc100_lcd_powerdev,
79}; 154};
80 155
81static void __init smdkc100_map_io(void) 156static void __init smdkc100_map_io(void)
@@ -87,12 +162,24 @@ static void __init smdkc100_map_io(void)
87 162
88static void __init smdkc100_machine_init(void) 163static void __init smdkc100_machine_init(void)
89{ 164{
165 /* I2C */
166 s3c_i2c0_set_platdata(NULL);
167 s3c_i2c1_set_platdata(NULL);
168 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
169 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
170
171 s3c_fb_set_platdata(&smdkc100_lcd_pdata);
172
173 /* LCD init */
174 gpio_request(S5PC100_GPD(0), "GPD");
175 gpio_request(S5PC100_GPH0(6), "GPH0");
176 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
90 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); 177 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
91} 178}
92 179
93MACHINE_START(SMDKC100, "SMDKC100") 180MACHINE_START(SMDKC100, "SMDKC100")
94 /* Maintainer: Byungho Min <bhmin@samsung.com> */ 181 /* Maintainer: Byungho Min <bhmin@samsung.com> */
95 .phys_io = S5PC1XX_PA_UART & 0xfff00000, 182 .phys_io = S5PC100_PA_UART & 0xfff00000,
96 .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc, 183 .io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc,
97 .boot_params = S5PC100_PA_SDRAM + 0x100, 184 .boot_params = S5PC100_PA_SDRAM + 0x100,
98 185
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
new file mode 100644
index 000000000000..4385986a3da0
--- /dev/null
+++ b/arch/arm/mach-s5pc100/setup-sdhci.c
@@ -0,0 +1,65 @@
1/* linux/arch/arm/mach-s5pc100/setup-sdhci.c
2 *
3 * Copyright 2008 Samsung Electronics
4 *
5 * S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC)
6 *
7 * Based on mach-s3c6410/setup-sdhci.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/interrupt.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19
20#include <linux/mmc/card.h>
21#include <linux/mmc/host.h>
22
23#include <plat/regs-sdhci.h>
24#include <plat/sdhci.h>
25
26/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
27
28char *s5pc100_hsmmc_clksrcs[4] = {
29 [0] = "hsmmc",
30 [1] = "hsmmc",
31 /* [2] = "mmc_bus", not yet succesfuuly used yet */
32 /* [3] = "48m", - note not succesfully used yet */
33};
34
35
36void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
37 void __iomem *r,
38 struct mmc_ios *ios,
39 struct mmc_card *card)
40{
41 u32 ctrl2, ctrl3;
42
43 /* don't need to alter anything acording to card-type */
44
45 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
46
47 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
48 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
49 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
50 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
51 S3C_SDHCI_CTRL2_ENFBCLKRX |
52 S3C_SDHCI_CTRL2_DFCNT_NONE |
53 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
54
55 if (ios->clock < 25 * 1000000)
56 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
57 S3C_SDHCI_CTRL3_FCSEL2 |
58 S3C_SDHCI_CTRL3_FCSEL1 |
59 S3C_SDHCI_CTRL3_FCSEL0);
60 else
61 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
62
63 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
64 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
65}
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 9264d814cd7a..4958ef2c6254 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -388,7 +388,7 @@ config CPU_FEROCEON_OLD_ID
388 388
389# ARMv6 389# ARMv6
390config CPU_V6 390config CPU_V6
391 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 391 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE
392 select CPU_32v6 392 select CPU_32v6
393 select CPU_ABRT_EV6 393 select CPU_ABRT_EV6
394 select CPU_PABRT_V6 394 select CPU_PABRT_V6
@@ -764,6 +764,15 @@ config CACHE_L2X0
764 help 764 help
765 This option enables the L2x0 PrimeCell. 765 This option enables the L2x0 PrimeCell.
766 766
767config CACHE_TAUROS2
768 bool "Enable the Tauros2 L2 cache controller"
769 depends on ARCH_DOVE
770 default y
771 select OUTER_CACHE
772 help
773 This option enables the Tauros2 L2 cache controller (as
774 found on PJ1/PJ4).
775
767config CACHE_XSC3L2 776config CACHE_XSC3L2
768 bool "Enable the L2 cache on XScale3" 777 bool "Enable the L2 cache on XScale3"
769 depends on CPU_XSC3 778 depends on CPU_XSC3
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 055cb2aa8134..06bcf2e73858 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -87,4 +87,4 @@ obj-$(CONFIG_CPU_V7) += proc-v7.o
87obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o 87obj-$(CONFIG_CACHE_FEROCEON_L2) += cache-feroceon-l2.o
88obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 88obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
89obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o 89obj-$(CONFIG_CACHE_XSC3L2) += cache-xsc3l2.o
90 90obj-$(CONFIG_CACHE_TAUROS2) += cache-tauros2.o
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
new file mode 100644
index 000000000000..50868651890f
--- /dev/null
+++ b/arch/arm/mm/cache-tauros2.c
@@ -0,0 +1,263 @@
1/*
2 * arch/arm/mm/cache-tauros2.c - Tauros2 L2 cache controller support
3 *
4 * Copyright (C) 2008 Marvell Semiconductor
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 *
10 * References:
11 * - PJ1 CPU Core Datasheet,
12 * Document ID MV-S104837-01, Rev 0.7, January 24 2008.
13 * - PJ4 CPU Core Datasheet,
14 * Document ID MV-S105190-00, Rev 0.7, March 14 2008.
15 */
16
17#include <linux/init.h>
18#include <asm/cacheflush.h>
19#include <asm/hardware/cache-tauros2.h>
20
21
22/*
23 * When Tauros2 is used on a CPU that supports the v7 hierarchical
24 * cache operations, the cache handling code in proc-v7.S takes care
25 * of everything, including handling DMA coherency.
26 *
27 * So, we only need to register outer cache operations here if we're
28 * being used on a pre-v7 CPU, and we only need to build support for
29 * outer cache operations into the kernel image if the kernel has been
30 * configured to support a pre-v7 CPU.
31 */
32#if __LINUX_ARM_ARCH__ < 7
33/*
34 * Low-level cache maintenance operations.
35 */
36static inline void tauros2_clean_pa(unsigned long addr)
37{
38 __asm__("mcr p15, 1, %0, c7, c11, 3" : : "r" (addr));
39}
40
41static inline void tauros2_clean_inv_pa(unsigned long addr)
42{
43 __asm__("mcr p15, 1, %0, c7, c15, 3" : : "r" (addr));
44}
45
46static inline void tauros2_inv_pa(unsigned long addr)
47{
48 __asm__("mcr p15, 1, %0, c7, c7, 3" : : "r" (addr));
49}
50
51
52/*
53 * Linux primitives.
54 *
55 * Note that the end addresses passed to Linux primitives are
56 * noninclusive.
57 */
58#define CACHE_LINE_SIZE 32
59
60static void tauros2_inv_range(unsigned long start, unsigned long end)
61{
62 /*
63 * Clean and invalidate partial first cache line.
64 */
65 if (start & (CACHE_LINE_SIZE - 1)) {
66 tauros2_clean_inv_pa(start & ~(CACHE_LINE_SIZE - 1));
67 start = (start | (CACHE_LINE_SIZE - 1)) + 1;
68 }
69
70 /*
71 * Clean and invalidate partial last cache line.
72 */
73 if (end & (CACHE_LINE_SIZE - 1)) {
74 tauros2_clean_inv_pa(end & ~(CACHE_LINE_SIZE - 1));
75 end &= ~(CACHE_LINE_SIZE - 1);
76 }
77
78 /*
79 * Invalidate all full cache lines between 'start' and 'end'.
80 */
81 while (start < end) {
82 tauros2_inv_pa(start);
83 start += CACHE_LINE_SIZE;
84 }
85
86 dsb();
87}
88
89static void tauros2_clean_range(unsigned long start, unsigned long end)
90{
91 start &= ~(CACHE_LINE_SIZE - 1);
92 while (start < end) {
93 tauros2_clean_pa(start);
94 start += CACHE_LINE_SIZE;
95 }
96
97 dsb();
98}
99
100static void tauros2_flush_range(unsigned long start, unsigned long end)
101{
102 start &= ~(CACHE_LINE_SIZE - 1);
103 while (start < end) {
104 tauros2_clean_inv_pa(start);
105 start += CACHE_LINE_SIZE;
106 }
107
108 dsb();
109}
110#endif
111
112static inline u32 __init read_extra_features(void)
113{
114 u32 u;
115
116 __asm__("mrc p15, 1, %0, c15, c1, 0" : "=r" (u));
117
118 return u;
119}
120
121static inline void __init write_extra_features(u32 u)
122{
123 __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u));
124}
125
126static void __init disable_l2_prefetch(void)
127{
128 u32 u;
129
130 /*
131 * Read the CPU Extra Features register and verify that the
132 * Disable L2 Prefetch bit is set.
133 */
134 u = read_extra_features();
135 if (!(u & 0x01000000)) {
136 printk(KERN_INFO "Tauros2: Disabling L2 prefetch.\n");
137 write_extra_features(u | 0x01000000);
138 }
139}
140
141static inline int __init cpuid_scheme(void)
142{
143 extern int processor_id;
144
145 return !!((processor_id & 0x000f0000) == 0x000f0000);
146}
147
148static inline u32 __init read_mmfr3(void)
149{
150 u32 mmfr3;
151
152 __asm__("mrc p15, 0, %0, c0, c1, 7\n" : "=r" (mmfr3));
153
154 return mmfr3;
155}
156
157static inline u32 __init read_actlr(void)
158{
159 u32 actlr;
160
161 __asm__("mrc p15, 0, %0, c1, c0, 1\n" : "=r" (actlr));
162
163 return actlr;
164}
165
166static inline void __init write_actlr(u32 actlr)
167{
168 __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr));
169}
170
171void __init tauros2_init(void)
172{
173 extern int processor_id;
174 char *mode;
175
176 disable_l2_prefetch();
177
178#ifdef CONFIG_CPU_32v5
179 if ((processor_id & 0xff0f0000) == 0x56050000) {
180 u32 feat;
181
182 /*
183 * v5 CPUs with Tauros2 have the L2 cache enable bit
184 * located in the CPU Extra Features register.
185 */
186 feat = read_extra_features();
187 if (!(feat & 0x00400000)) {
188 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
189 write_extra_features(feat | 0x00400000);
190 }
191
192 mode = "ARMv5";
193 outer_cache.inv_range = tauros2_inv_range;
194 outer_cache.clean_range = tauros2_clean_range;
195 outer_cache.flush_range = tauros2_flush_range;
196 }
197#endif
198
199#ifdef CONFIG_CPU_32v6
200 /*
201 * Check whether this CPU lacks support for the v7 hierarchical
202 * cache ops. (PJ4 is in its v6 personality mode if the MMFR3
203 * register indicates no support for the v7 hierarchical cache
204 * ops.)
205 */
206 if (cpuid_scheme() && (read_mmfr3() & 0xf) == 0) {
207 /*
208 * When Tauros2 is used in an ARMv6 system, the L2
209 * enable bit is in the ARMv6 ARM-mandated position
210 * (bit [26] of the System Control Register).
211 */
212 if (!(get_cr() & 0x04000000)) {
213 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
214 adjust_cr(0x04000000, 0x04000000);
215 }
216
217 mode = "ARMv6";
218 outer_cache.inv_range = tauros2_inv_range;
219 outer_cache.clean_range = tauros2_clean_range;
220 outer_cache.flush_range = tauros2_flush_range;
221 }
222#endif
223
224#ifdef CONFIG_CPU_32v7
225 /*
226 * Check whether this CPU has support for the v7 hierarchical
227 * cache ops. (PJ4 is in its v7 personality mode if the MMFR3
228 * register indicates support for the v7 hierarchical cache
229 * ops.)
230 *
231 * (Although strictly speaking there may exist CPUs that
232 * implement the v7 cache ops but are only ARMv6 CPUs (due to
233 * not complying with all of the other ARMv7 requirements),
234 * there are no real-life examples of Tauros2 being used on
235 * such CPUs as of yet.)
236 */
237 if (cpuid_scheme() && (read_mmfr3() & 0xf) == 1) {
238 u32 actlr;
239
240 /*
241 * When Tauros2 is used in an ARMv7 system, the L2
242 * enable bit is located in the Auxiliary System Control
243 * Register (which is the only register allowed by the
244 * ARMv7 spec to contain fine-grained cache control bits).
245 */
246 actlr = read_actlr();
247 if (!(actlr & 0x00000002)) {
248 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
249 write_actlr(actlr | 0x00000002);
250 }
251
252 mode = "ARMv7";
253 }
254#endif
255
256 if (mode == NULL) {
257 printk(KERN_CRIT "Tauros2: Unable to detect CPU mode.\n");
258 return;
259 }
260
261 printk(KERN_INFO "Tauros2: L2 cache support initialised "
262 "in %s mode.\n", mode);
263}
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 70f75d2e3ead..5485c821101c 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -130,9 +130,16 @@ ENTRY(cpu_v6_set_pte_ext)
130 130
131 131
132 132
133 133 .type cpu_v6_name, #object
134cpu_v6_name: 134cpu_v6_name:
135 .asciz "ARMv6-compatible processor" 135 .asciz "ARMv6-compatible processor"
136 .size cpu_v6_name, . - cpu_v6_name
137
138 .type cpu_pj4_name, #object
139cpu_pj4_name:
140 .asciz "Marvell PJ4 processor"
141 .size cpu_pj4_name, . - cpu_pj4_name
142
136 .align 143 .align
137 144
138 __INIT 145 __INIT
@@ -241,3 +248,27 @@ __v6_proc_info:
241 .long v6_user_fns 248 .long v6_user_fns
242 .long v6_cache_fns 249 .long v6_cache_fns
243 .size __v6_proc_info, . - __v6_proc_info 250 .size __v6_proc_info, . - __v6_proc_info
251
252 .type __pj4_v6_proc_info, #object
253__pj4_v6_proc_info:
254 .long 0x560f5810
255 .long 0xff0ffff0
256 .long PMD_TYPE_SECT | \
257 PMD_SECT_BUFFERABLE | \
258 PMD_SECT_CACHEABLE | \
259 PMD_SECT_AP_WRITE | \
260 PMD_SECT_AP_READ
261 .long PMD_TYPE_SECT | \
262 PMD_SECT_XN | \
263 PMD_SECT_AP_WRITE | \
264 PMD_SECT_AP_READ
265 b __v6_setup
266 .long cpu_arch_name
267 .long cpu_elf_name
268 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
269 .long cpu_pj4_name
270 .long v6_processor_functions
271 .long v6wbi_tlb_fns
272 .long v6_user_fns
273 .long v6_cache_fns
274 .size __pj4_v6_proc_info, . - __pj4_v6_proc_info
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 2028f3702881..fab134e29826 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -396,7 +396,7 @@ __xsc3_setup:
396 orr r4, r4, #0x18 @ cache the page table in L2 396 orr r4, r4, #0x18 @ cache the page table in L2
397 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer 397 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
398 398
399 mov r0, #0 @ don't allow CP access 399 mov r0, #1 << 6 @ cp6 access for early sched_clock
400 mcr p15, 0, r0, c15, c1, 0 @ write CP access register 400 mcr p15, 0, r0, c15, c1, 0 @ write CP access register
401 401
402 mrc p15, 0, r0, c1, c0, 1 @ get auxiliary control reg 402 mrc p15, 0, r0, c1, c0, 1 @ get auxiliary control reg
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 8da95d57c21f..6c8a02ad98e3 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -19,6 +19,8 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/timex.h> 20#include <linux/timex.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/clocksource.h>
23#include <linux/clockchips.h>
22#include <mach/hardware.h> 24#include <mach/hardware.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/uaccess.h> 26#include <asm/uaccess.h>
@@ -26,45 +28,136 @@
26#include <asm/mach/time.h> 28#include <asm/mach/time.h>
27#include <mach/time.h> 29#include <mach/time.h>
28 30
31/*
32 * IOP clocksource (free-running timer 1).
33 */
34static cycle_t iop_clocksource_read(struct clocksource *unused)
35{
36 return 0xffffffffu - read_tcr1();
37}
38
39static struct clocksource iop_clocksource = {
40 .name = "iop_timer1",
41 .rating = 300,
42 .read = iop_clocksource_read,
43 .mask = CLOCKSOURCE_MASK(32),
44 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
45};
46
47static void __init iop_clocksource_set_hz(struct clocksource *cs, unsigned int hz)
48{
49 u64 temp;
50 u32 shift;
51
52 /* Find shift and mult values for hz. */
53 shift = 32;
54 do {
55 temp = (u64) NSEC_PER_SEC << shift;
56 do_div(temp, hz);
57 if ((temp >> 32) == 0)
58 break;
59 } while (--shift != 0);
60
61 cs->shift = shift;
62 cs->mult = (u32) temp;
63
64 printk(KERN_INFO "clocksource: %s uses shift %u mult %#x\n",
65 cs->name, cs->shift, cs->mult);
66}
67
68/*
69 * IOP sched_clock() implementation via its clocksource.
70 */
71unsigned long long sched_clock(void)
72{
73 cycle_t cyc = iop_clocksource_read(NULL);
74 struct clocksource *cs = &iop_clocksource;
75
76 return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
77}
78
79/*
80 * IOP clockevents (interrupting timer 0).
81 */
82static int iop_set_next_event(unsigned long delta,
83 struct clock_event_device *unused)
84{
85 u32 tmr = IOP_TMR_PRIVILEGED | IOP_TMR_RATIO_1_1;
86
87 BUG_ON(delta == 0);
88 write_tmr0(tmr & ~(IOP_TMR_EN | IOP_TMR_RELOAD));
89 write_tcr0(delta);
90 write_tmr0((tmr & ~IOP_TMR_RELOAD) | IOP_TMR_EN);
91
92 return 0;
93}
94
29static unsigned long ticks_per_jiffy; 95static unsigned long ticks_per_jiffy;
30static unsigned long ticks_per_usec;
31static unsigned long next_jiffy_time;
32 96
33unsigned long iop_gettimeoffset(void) 97static void iop_set_mode(enum clock_event_mode mode,
98 struct clock_event_device *unused)
34{ 99{
35 unsigned long offset, temp; 100 u32 tmr = read_tmr0();
101
102 switch (mode) {
103 case CLOCK_EVT_MODE_PERIODIC:
104 write_tmr0(tmr & ~IOP_TMR_EN);
105 write_tcr0(ticks_per_jiffy - 1);
106 tmr |= (IOP_TMR_RELOAD | IOP_TMR_EN);
107 break;
108 case CLOCK_EVT_MODE_ONESHOT:
109 /* ->set_next_event sets period and enables timer */
110 tmr &= ~(IOP_TMR_RELOAD | IOP_TMR_EN);
111 break;
112 case CLOCK_EVT_MODE_RESUME:
113 tmr |= IOP_TMR_EN;
114 break;
115 case CLOCK_EVT_MODE_SHUTDOWN:
116 case CLOCK_EVT_MODE_UNUSED:
117 default:
118 tmr &= ~IOP_TMR_EN;
119 break;
120 }
36 121
37 /* enable cp6, if necessary, to avoid taking the overhead of an 122 write_tmr0(tmr);
38 * undefined instruction trap 123}
39 */ 124
40 asm volatile ( 125static struct clock_event_device iop_clockevent = {
41 "mrc p15, 0, %0, c15, c1, 0\n\t" 126 .name = "iop_timer0",
42 "tst %0, #(1 << 6)\n\t" 127 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
43 "orreq %0, %0, #(1 << 6)\n\t" 128 .rating = 300,
44 "mcreq p15, 0, %0, c15, c1, 0\n\t" 129 .set_next_event = iop_set_next_event,
45#ifdef CONFIG_CPU_XSCALE 130 .set_mode = iop_set_mode,
46 "mrceq p15, 0, %0, c15, c1, 0\n\t" 131};
47 "moveq %0, %0\n\t" 132
48 "subeq pc, pc, #4\n\t" 133static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned int hz)
49#endif 134{
50 : "=r"(temp) : : "cc"); 135 u64 temp;
51 136 u32 shift;
52 offset = next_jiffy_time - read_tcr1(); 137
53 138 /* Find shift and mult values for hz. */
54 return offset / ticks_per_usec; 139 shift = 32;
140 do {
141 temp = (u64) hz << shift;
142 do_div(temp, NSEC_PER_SEC);
143 if ((temp >> 32) == 0)
144 break;
145 } while (--shift != 0);
146
147 ce->shift = shift;
148 ce->mult = (u32) temp;
149
150 printk(KERN_INFO "clockevent: %s uses shift %u mult %#lx\n",
151 ce->name, ce->shift, ce->mult);
55} 152}
56 153
57static irqreturn_t 154static irqreturn_t
58iop_timer_interrupt(int irq, void *dev_id) 155iop_timer_interrupt(int irq, void *dev_id)
59{ 156{
60 write_tisr(1); 157 struct clock_event_device *evt = dev_id;
61
62 while ((signed long)(next_jiffy_time - read_tcr1())
63 >= ticks_per_jiffy) {
64 timer_tick();
65 next_jiffy_time -= ticks_per_jiffy;
66 }
67 158
159 write_tisr(1);
160 evt->event_handler(evt);
68 return IRQ_HANDLED; 161 return IRQ_HANDLED;
69} 162}
70 163
@@ -72,6 +165,7 @@ static struct irqaction iop_timer_irq = {
72 .name = "IOP Timer Tick", 165 .name = "IOP Timer Tick",
73 .handler = iop_timer_interrupt, 166 .handler = iop_timer_interrupt,
74 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
168 .dev_id = &iop_clockevent,
75}; 169};
76 170
77static unsigned long iop_tick_rate; 171static unsigned long iop_tick_rate;
@@ -86,21 +180,33 @@ void __init iop_init_time(unsigned long tick_rate)
86 u32 timer_ctl; 180 u32 timer_ctl;
87 181
88 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); 182 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
89 ticks_per_usec = tick_rate / 1000000;
90 next_jiffy_time = 0xffffffff;
91 iop_tick_rate = tick_rate; 183 iop_tick_rate = tick_rate;
92 184
93 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED | 185 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED |
94 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1; 186 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1;
95 187
96 /* 188 /*
97 * We use timer 0 for our timer interrupt, and timer 1 as 189 * Set up interrupting clockevent timer 0.
98 * monotonic counter for tracking missed jiffies.
99 */ 190 */
191 write_tmr0(timer_ctl & ~IOP_TMR_EN);
192 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq);
193 iop_clockevent_set_hz(&iop_clockevent, tick_rate);
194 iop_clockevent.max_delta_ns =
195 clockevent_delta2ns(0xfffffffe, &iop_clockevent);
196 iop_clockevent.min_delta_ns =
197 clockevent_delta2ns(0xf, &iop_clockevent);
198 iop_clockevent.cpumask = cpumask_of(0);
199 clockevents_register_device(&iop_clockevent);
100 write_trr0(ticks_per_jiffy - 1); 200 write_trr0(ticks_per_jiffy - 1);
201 write_tcr0(ticks_per_jiffy - 1);
101 write_tmr0(timer_ctl); 202 write_tmr0(timer_ctl);
203
204 /*
205 * Set up free-running clocksource timer 1.
206 */
102 write_trr1(0xffffffff); 207 write_trr1(0xffffffff);
208 write_tcr1(0xffffffff);
103 write_tmr1(timer_ctl); 209 write_tmr1(timer_ctl);
104 210 iop_clocksource_set_hz(&iop_clocksource, tick_rate);
105 setup_irq(IRQ_IOP_TIMER0, &iop_timer_irq); 211 clocksource_register(&iop_clocksource);
106} 212}
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index ca5c7c226341..8b0a1ee039fa 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -69,10 +69,20 @@ config MXC_PWM
69 help 69 help
70 Enable support for the i.MX PWM controller(s). 70 Enable support for the i.MX PWM controller(s).
71 71
72config MXC_ULPI
73 bool
74
72config ARCH_HAS_RNGA 75config ARCH_HAS_RNGA
73 bool 76 bool
74 depends on ARCH_MXC 77 depends on ARCH_MXC
75 78
76config ARCH_MXC_IOMUX_V3 79config ARCH_MXC_IOMUX_V3
77 bool 80 bool
81
82config ARCH_MXC_AUDMUX_V1
83 bool
84
85config ARCH_MXC_AUDMUX_V2
86 bool
87
78endif 88endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index e3212c8ff421..4cbca9da1505 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -9,3 +9,6 @@ obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o
9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o 9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o 10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
11obj-$(CONFIG_MXC_PWM) += pwm.o 11obj-$(CONFIG_MXC_PWM) += pwm.o
12obj-$(CONFIG_MXC_ULPI) += ulpi.o
13obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
14obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
new file mode 100644
index 000000000000..70ab5aff2b9e
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -0,0 +1,53 @@
1/*
2 * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * Initial development of this code was funded by
5 * Phytec Messtechnik GmbH, http://www.phytec.de
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/module.h>
23#include <linux/err.h>
24#include <linux/io.h>
25#include <linux/clk.h>
26#include <mach/audmux.h>
27#include <mach/hardware.h>
28
29static void __iomem *audmux_base;
30
31#define MXC_AUDMUX_V1_PCR(x) ((x) * 4)
32
33int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr)
34{
35 if (!audmux_base) {
36 printk("%s: not configured\n", __func__);
37 return -ENOSYS;
38 }
39
40 writel(pcr, audmux_base + MXC_AUDMUX_V1_PCR(port));
41
42 return 0;
43}
44EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
45
46static int mxc_audmux_v1_init(void)
47{
48 if (cpu_is_mx27() || cpu_is_mx21())
49 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
50 return 0;
51}
52
53postcore_initcall(mxc_audmux_v1_init);
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
new file mode 100644
index 000000000000..6f21096086fd
--- /dev/null
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -0,0 +1,74 @@
1/*
2 * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * Initial development of this code was funded by
5 * Phytec Messtechnik GmbH, http://www.phytec.de
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/module.h>
23#include <linux/err.h>
24#include <linux/io.h>
25#include <linux/clk.h>
26#include <mach/audmux.h>
27#include <mach/hardware.h>
28
29static struct clk *audmux_clk;
30static void __iomem *audmux_base;
31
32#define MXC_AUDMUX_V2_PTCR(x) ((x) * 8)
33#define MXC_AUDMUX_V2_PDCR(x) ((x) * 8 + 4)
34
35int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
36 unsigned int pdcr)
37{
38 if (!audmux_base)
39 return -ENOSYS;
40
41 if (audmux_clk)
42 clk_enable(audmux_clk);
43
44 writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
45 writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
46
47 if (audmux_clk)
48 clk_disable(audmux_clk);
49
50 return 0;
51}
52EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port);
53
54static int mxc_audmux_v2_init(void)
55{
56 int ret;
57
58 if (cpu_is_mx35()) {
59 audmux_clk = clk_get(NULL, "audmux");
60 if (IS_ERR(audmux_clk)) {
61 ret = PTR_ERR(audmux_clk);
62 printk(KERN_ERR "%s: cannot get clock: %d\n", __func__,
63 ret);
64 return ret;
65 }
66 }
67
68 if (cpu_is_mx31() || cpu_is_mx35())
69 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
70
71 return 0;
72}
73
74postcore_initcall(mxc_audmux_v2_init);
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index 77646436c00e..9c1b3f9c4f4d 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -156,7 +156,8 @@ static inline int imx_dma_sg_next(int channel, struct scatterlist *sg)
156 } 156 }
157 157
158 now = min(imxdma->resbytes, sg->length); 158 now = min(imxdma->resbytes, sg->length);
159 imxdma->resbytes -= now; 159 if (imxdma->resbytes != IMX_DMA_LENGTH_LOOP)
160 imxdma->resbytes -= now;
160 161
161 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ) 162 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
162 __raw_writel(sg->dma_address, DMA_BASE + DMA_DAR(channel)); 163 __raw_writel(sg->dma_address, DMA_BASE + DMA_DAR(channel));
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index cfc4a8b43e6a..d65ebe303b9f 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -282,7 +282,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
282 for (j = port[i].virtual_irq_start; 282 for (j = port[i].virtual_irq_start;
283 j < port[i].virtual_irq_start + 32; j++) { 283 j < port[i].virtual_irq_start + 32; j++) {
284 set_irq_chip(j, &gpio_irq_chip); 284 set_irq_chip(j, &gpio_irq_chip);
285 set_irq_handler(j, handle_edge_irq); 285 set_irq_handler(j, handle_level_irq);
286 set_irq_flags(j, IRQF_VALID); 286 set_irq_flags(j, IRQF_VALID);
287 } 287 }
288 288
diff --git a/arch/arm/plat-mxc/include/mach/audmux.h b/arch/arm/plat-mxc/include/mach/audmux.h
new file mode 100644
index 000000000000..5cd6466964af
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/audmux.h
@@ -0,0 +1,52 @@
1#ifndef __MACH_AUDMUX_H
2#define __MACH_AUDMUX_H
3
4#define MX27_AUDMUX_HPCR1_SSI0 0
5#define MX27_AUDMUX_HPCR2_SSI1 1
6#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2
7#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3
8#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4
9#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
10
11#define MX31_AUDMUX_PORT1_SSI0 0
12#define MX31_AUDMUX_PORT2_SSI1 1
13#define MX31_AUDMUX_PORT3_SSI_PINS_3 2
14#define MX31_AUDMUX_PORT4_SSI_PINS_4 3
15#define MX31_AUDMUX_PORT5_SSI_PINS_5 4
16#define MX31_AUDMUX_PORT6_SSI_PINS_6 5
17
18/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
19#define MXC_AUDMUX_V1_PCR_INMMASK(x) ((x) & 0xff)
20#define MXC_AUDMUX_V1_PCR_INMEN (1 << 8)
21#define MXC_AUDMUX_V1_PCR_TXRXEN (1 << 10)
22#define MXC_AUDMUX_V1_PCR_SYN (1 << 12)
23#define MXC_AUDMUX_V1_PCR_RXDSEL(x) (((x) & 0x7) << 13)
24#define MXC_AUDMUX_V1_PCR_RFCSEL(x) (((x) & 0xf) << 20)
25#define MXC_AUDMUX_V1_PCR_RCLKDIR (1 << 24)
26#define MXC_AUDMUX_V1_PCR_RFSDIR (1 << 25)
27#define MXC_AUDMUX_V1_PCR_TFCSEL(x) (((x) & 0xf) << 26)
28#define MXC_AUDMUX_V1_PCR_TCLKDIR (1 << 30)
29#define MXC_AUDMUX_V1_PCR_TFSDIR (1 << 31)
30
31/* Register definitions for the i.MX25/31/35 Digital Audio Multiplexer */
32#define MXC_AUDMUX_V2_PTCR_TFSDIR (1 << 31)
33#define MXC_AUDMUX_V2_PTCR_TFSEL(x) (((x) & 0xf) << 27)
34#define MXC_AUDMUX_V2_PTCR_TCLKDIR (1 << 26)
35#define MXC_AUDMUX_V2_PTCR_TCSEL(x) (((x) & 0xf) << 22)
36#define MXC_AUDMUX_V2_PTCR_RFSDIR (1 << 21)
37#define MXC_AUDMUX_V2_PTCR_RFSEL(x) (((x) & 0xf) << 17)
38#define MXC_AUDMUX_V2_PTCR_RCLKDIR (1 << 16)
39#define MXC_AUDMUX_V2_PTCR_RCSEL(x) (((x) & 0xf) << 12)
40#define MXC_AUDMUX_V2_PTCR_SYN (1 << 11)
41
42#define MXC_AUDMUX_V2_PDCR_RXDSEL(x) (((x) & 0x7) << 13)
43#define MXC_AUDMUX_V2_PDCR_TXRXEN (1 << 12)
44#define MXC_AUDMUX_V2_PDCR_MODE(x) (((x) & 0x3) << 8)
45#define MXC_AUDMUX_V2_PDCR_INMMASK(x) ((x) & 0xff)
46
47int mxc_audmux_v1_configure_port(unsigned int port, unsigned int pcr);
48
49int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
50 unsigned int pdcr);
51
52#endif /* __MACH_AUDMUX_H */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31lite.h b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
index 8e64325d6905..0184b638c268 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31lite.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31lite.h
@@ -1,15 +1,42 @@
1/* 1/*
2 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2009 Daniel Mack <daniel@caiaq.de>
4 *
5 * Based on code for mobots boards,
6 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
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., 51 Franklin Street, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
3 */ 21 */
4 22
23#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__
24#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
25
26#ifndef __ASSEMBLY__
27
28enum mx31lilly_boards {
29 MX31LITE_NOBOARD = 0,
30 MX31LITE_DB = 1,
31};
32
5/* 33/*
6 * This program is free software; you can redistribute it and/or modify 34 * This CPU module needs a baseboard to work. After basic initializing
7 * it under the terms of the GNU General Public License version 2 as 35 * its own devices, it calls baseboard's init function.
8 * published by the Free Software Foundation.
9 */ 36 */
10 37
11#ifndef __ASM_ARCH_MXC_BOARD_MX31LITE_H__ 38extern void mx31lite_db_init(void);
12#define __ASM_ARCH_MXC_BOARD_MX31LITE_H__
13 39
14#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */ 40#endif
15 41
42#endif /* __ASM_ARCH_MXC_BOARD_MX31LITE_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
index b3876cc238ca..07be8ad7ec37 100644
--- a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
+++ b/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
@@ -58,6 +58,14 @@ imx_dma_setup_single(int channel, dma_addr_t dma_address,
58 unsigned int dma_length, unsigned int dev_addr, 58 unsigned int dma_length, unsigned int dev_addr,
59 unsigned int dmamode); 59 unsigned int dmamode);
60 60
61
62/*
63 * Use this flag as the dma_length argument to imx_dma_setup_sg()
64 * to create an endless running dma loop. The end of the scatterlist
65 * must be linked to the beginning for this to work.
66 */
67#define IMX_DMA_LENGTH_LOOP ((unsigned int)-1)
68
61int 69int
62imx_dma_setup_sg(int channel, struct scatterlist *sg, 70imx_dma_setup_sg(int channel, struct scatterlist *sg,
63 unsigned int sgcount, unsigned int dma_length, 71 unsigned int sgcount, unsigned int dma_length,
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index 446f86763816..2f6583e185aa 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -623,6 +623,8 @@ enum iomux_pins {
623#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO) 623#define MX31_PIN_GPIO3_0__GPIO3_0 IOMUX_MODE(MX31_PIN_GPIO3_0, IOMUX_CONFIG_GPIO)
624#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO) 624#define MX31_PIN_GPIO3_1__GPIO3_1 IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)
625#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO) 625#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
626#define MX31_PIN_CSI_D4__GPIO3_4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_GPIO)
627#define MX31_PIN_CSI_D5__GPIO3_5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO)
626#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC) 628#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC)
627#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC) 629#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC)
628#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC) 630#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC)
@@ -642,12 +644,22 @@ enum iomux_pins {
642#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1) 644#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1)
643#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1) 645#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1)
644#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1) 646#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1)
647#define MX31_PIN_SFS6__USBH1_SUSPEND IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_FUNC)
648#define MX31_PIN_NFRE_B__GPIO1_11 IOMUX_MODE(MX31_PIN_NFRE_B, IOMUX_CONFIG_GPIO)
649#define MX31_PIN_NFALE__GPIO1_12 IOMUX_MODE(MX31_PIN_NFALE, IOMUX_CONFIG_GPIO)
645#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC) 650#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC)
646#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC) 651#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC)
652#define MX31_PIN_STXD3__USBH2_DATA2 IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC)
653#define MX31_PIN_SRXD3__USBH2_DATA3 IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC)
654#define MX31_PIN_SCK3__USBH2_DATA4 IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC)
655#define MX31_PIN_SFS3__USBH2_DATA5 IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC)
656#define MX31_PIN_STXD6__USBH2_DATA6 IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC)
657#define MX31_PIN_SRXD6__USBH2_DATA7 IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC)
647#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC) 658#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC)
648#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC) 659#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC)
649#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC) 660#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC)
650#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC) 661#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC)
662#define MX31_PIN_SCK6__GPIO1_25 IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO)
651#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO) 663#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
652#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 664#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
653#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC) 665#define MX31_PIN_I2C_CLK__I2C1_SCL IOMUX_MODE(MX31_PIN_I2C_CLK, IOMUX_CONFIG_FUNC)
@@ -693,7 +705,19 @@ enum iomux_pins {
693#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO) 705#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO)
694#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO) 706#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO)
695#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO) 707#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO)
696 708#define MX31_PIN_GPIO1_3__GPIO1_3 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO)
709#define MX31_PIN_CSPI2_SS1__CSPI3_SS1 IOMUX_MODE(MX31_PIN_CSPI2_SS1, IOMUX_CONFIG_ALT1)
710#define MX31_PIN_RTS1__GPIO2_6 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO)
711#define MX31_PIN_CTS1__GPIO2_7 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO)
712#define MX31_PIN_LCS0__GPIO3_23 IOMUX_MODE(MX31_PIN_LCS0, IOMUX_CONFIG_GPIO)
713#define MX31_PIN_STXD4__STXD4 IOMUX_MODE(MX31_PIN_STXD4, IOMUX_CONFIG_FUNC)
714#define MX31_PIN_SRXD4__SRXD4 IOMUX_MODE(MX31_PIN_SRXD4, IOMUX_CONFIG_FUNC)
715#define MX31_PIN_SCK4__SCK4 IOMUX_MODE(MX31_PIN_SCK4, IOMUX_CONFIG_FUNC)
716#define MX31_PIN_SFS4__SFS4 IOMUX_MODE(MX31_PIN_SFS4, IOMUX_CONFIG_FUNC)
717#define MX31_PIN_STXD5__STXD5 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_FUNC)
718#define MX31_PIN_SRXD5__SRXD5 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_FUNC)
719#define MX31_PIN_SCK5__SCK5 IOMUX_MODE(MX31_PIN_SCK5, IOMUX_CONFIG_FUNC)
720#define MX31_PIN_SFS5__SFS5 IOMUX_MODE(MX31_PIN_SFS5, IOMUX_CONFIG_FUNC)
697 721
698/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 722/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
699 * cspi1_ss1*/ 723 * cspi1_ss1*/
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index a0fa40265468..1deda0184892 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -88,9 +88,7 @@ struct pad_desc {
88#define PAD_CTL_SRE_FAST (1 << 0) 88#define PAD_CTL_SRE_FAST (1 << 0)
89 89
90/* 90/*
91 * setups a single pad: 91 * setups a single pad in the iomuxer
92 * - reserves the pad so that it is not claimed by another driver
93 * - setups the iomux according to the configuration
94 */ 92 */
95int mxc_iomux_v3_setup_pad(struct pad_desc *pad); 93int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
96 94
@@ -101,19 +99,6 @@ int mxc_iomux_v3_setup_pad(struct pad_desc *pad);
101int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count); 99int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count);
102 100
103/* 101/*
104 * releases a single pad:
105 * - make it available for a future use by another driver
106 * - DOES NOT reconfigure the IOMUX in its reset state
107 */
108void mxc_iomux_v3_release_pad(struct pad_desc *pad);
109
110/*
111 * releases multiple pads
112 * convenvient way to call the above function with tables
113 */
114void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count);
115
116/*
117 * Initialise the iomux controller 102 * Initialise the iomux controller
118 */ 103 */
119void mxc_iomux_v3_init(void __iomem *iomux_v3_base); 104void mxc_iomux_v3_init(void __iomem *iomux_v3_base);
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
index 21112c695ec5..bb297d8765a7 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -25,46 +25,191 @@
25#ifndef __ASM_ARCH_MXC_MX21_H__ 25#ifndef __ASM_ARCH_MXC_MX21_H__
26#define __ASM_ARCH_MXC_MX21_H__ 26#define __ASM_ARCH_MXC_MX21_H__
27 27
28#define MX21_AIPI_BASE_ADDR 0x10000000
29#define MX21_AIPI_BASE_ADDR_VIRT 0xf4000000
30#define MX21_AIPI_SIZE SZ_1M
31#define MX21_DMA_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x01000)
32#define MX21_WDOG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x02000)
33#define MX21_GPT1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x03000)
34#define MX21_GPT2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x04000)
35#define MX21_GPT3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x05000)
36#define MX21_PWM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x06000)
37#define MX21_RTC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x07000)
38#define MX21_KPP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x08000)
39#define MX21_OWIRE_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x09000)
40#define MX21_UART1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0a000)
41#define MX21_UART2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0b000)
42#define MX21_UART3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0c000)
43#define MX21_UART4_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0d000)
44#define MX21_CSPI1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0e000)
45#define MX21_CSPI2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x0f000)
46#define MX21_SSI1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x10000)
47#define MX21_SSI2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x11000)
48#define MX21_I2C_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x12000)
49#define MX21_SDHC1_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x13000)
50#define MX21_SDHC2_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x14000)
51#define MX21_GPIO_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x15000)
52#define MX21_AUDMUX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x16000)
53#define MX21_CSPI3_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x17000)
54#define MX21_LCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x21000)
55#define MX21_SLCDC_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x22000)
56#define MX21_USBOTG_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x24000)
57#define MX21_EMMA_PP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x26000)
58#define MX21_EMMA_PRP_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x26400)
59#define MX21_CCM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x27000)
60#define MX21_SYSCTRL_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x27800)
61#define MX21_JAM_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x3e000)
62#define MX21_MAX_BASE_ADDR (MX21_AIPI_BASE_ADDR + 0x3f000)
63
64#define MX21_AVIC_BASE_ADDR 0x10040000
65
66#define MX21_SAHB1_BASE_ADDR 0x80000000
67#define MX21_SAHB1_BASE_ADDR_VIRT 0xf4100000
68#define MX21_SAHB1_SIZE SZ_1M
69#define MX21_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000)
70
28/* Memory regions and CS */ 71/* Memory regions and CS */
29#define SDRAM_BASE_ADDR 0xC0000000 72#define MX21_SDRAM_BASE_ADDR 0xc0000000
30#define CSD1_BASE_ADDR 0xC4000000 73#define MX21_CSD1_BASE_ADDR 0xc4000000
31 74
32#define CS0_BASE_ADDR 0xC8000000 75#define MX21_CS0_BASE_ADDR 0xc8000000
33#define CS1_BASE_ADDR 0xCC000000 76#define MX21_CS1_BASE_ADDR 0xcc000000
34#define CS2_BASE_ADDR 0xD0000000 77#define MX21_CS2_BASE_ADDR 0xd0000000
35#define CS3_BASE_ADDR 0xD1000000 78#define MX21_CS3_BASE_ADDR 0xd1000000
36#define CS4_BASE_ADDR 0xD2000000 79#define MX21_CS4_BASE_ADDR 0xd2000000
37#define CS5_BASE_ADDR 0xDD000000 80#define MX21_PCMCIA_MEM_BASE_ADDR 0xd4000000
38#define PCMCIA_MEM_BASE_ADDR 0xD4000000 81#define MX21_CS5_BASE_ADDR 0xdd000000
39 82
40/* NAND, SDRAM, WEIM etc controllers */ 83/* NAND, SDRAM, WEIM etc controllers */
41#define X_MEMC_BASE_ADDR 0xDF000000 84#define MX21_X_MEMC_BASE_ADDR 0xdf000000
42#define X_MEMC_BASE_ADDR_VIRT 0xF4200000 85#define MX21_X_MEMC_BASE_ADDR_VIRT 0xf4200000
43#define X_MEMC_SIZE SZ_256K 86#define MX21_X_MEMC_SIZE SZ_256K
44 87
45#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) 88#define MX21_SDRAMC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x0000)
46#define EIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 89#define MX21_EIM_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x1000)
47#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 90#define MX21_PCMCIA_CTL_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x2000)
48#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 91#define MX21_NFC_BASE_ADDR (MX21_X_MEMC_BASE_ADDR + 0x3000)
49 92
50#define IRAM_BASE_ADDR 0xFFFFE800 /* internal ram */ 93#define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */
51 94
52/* fixed interrupt numbers */ 95/* fixed interrupt numbers */
53#define MXC_INT_USBCTRL 58 96#define MX21_INT_CSPI3 6
54#define MXC_INT_USBCTRL 58 97#define MX21_INT_GPIO 8
55#define MXC_INT_USBMNP 57 98#define MX21_INT_FIRI 9
56#define MXC_INT_USBFUNC 56 99#define MX21_INT_SDHC2 10
57#define MXC_INT_USBHOST 55 100#define MX21_INT_SDHC1 11
58#define MXC_INT_USBDMA 54 101#define MX21_INT_I2C 12
59#define MXC_INT_USBWKUP 53 102#define MX21_INT_SSI2 13
60#define MXC_INT_EMMADEC 50 103#define MX21_INT_SSI1 14
61#define MXC_INT_EMMAENC 49 104#define MX21_INT_CSPI2 15
62#define MXC_INT_BMI 30 105#define MX21_INT_CSPI1 16
63#define MXC_INT_FIRI 9 106#define MX21_INT_UART4 17
107#define MX21_INT_UART3 18
108#define MX21_INT_UART2 19
109#define MX21_INT_UART1 20
110#define MX21_INT_KPP 21
111#define MX21_INT_RTC 22
112#define MX21_INT_PWM 23
113#define MX21_INT_GPT3 24
114#define MX21_INT_GPT2 25
115#define MX21_INT_GPT1 26
116#define MX21_INT_WDOG 27
117#define MX21_INT_PCMCIA 28
118#define MX21_INT_NANDFC 29
119#define MX21_INT_BMI 30
120#define MX21_INT_CSI 31
121#define MX21_INT_DMACH0 32
122#define MX21_INT_DMACH1 33
123#define MX21_INT_DMACH2 34
124#define MX21_INT_DMACH3 35
125#define MX21_INT_DMACH4 36
126#define MX21_INT_DMACH5 37
127#define MX21_INT_DMACH6 38
128#define MX21_INT_DMACH7 39
129#define MX21_INT_DMACH8 40
130#define MX21_INT_DMACH9 41
131#define MX21_INT_DMACH10 42
132#define MX21_INT_DMACH11 43
133#define MX21_INT_DMACH12 44
134#define MX21_INT_DMACH13 45
135#define MX21_INT_DMACH14 46
136#define MX21_INT_DMACH15 47
137#define MX21_INT_EMMAENC 49
138#define MX21_INT_EMMADEC 50
139#define MX21_INT_EMMAPRP 51
140#define MX21_INT_EMMAPP 52
141#define MX21_INT_USBWKUP 53
142#define MX21_INT_USBDMA 54
143#define MX21_INT_USBHOST 55
144#define MX21_INT_USBFUNC 56
145#define MX21_INT_USBMNP 57
146#define MX21_INT_USBCTRL 58
147#define MX21_INT_SLCDC 60
148#define MX21_INT_LCDC 61
64 149
65/* fixed DMA request numbers */ 150/* fixed DMA request numbers */
66#define DMA_REQ_BMI_RX 29 151#define MX21_DMA_REQ_CSPI3_RX 1
67#define DMA_REQ_BMI_TX 28 152#define MX21_DMA_REQ_CSPI3_TX 2
68#define DMA_REQ_FIRI_RX 4 153#define MX21_DMA_REQ_EXT 3
154#define MX21_DMA_REQ_FIRI_RX 4
155#define MX21_DMA_REQ_SDHC2 6
156#define MX21_DMA_REQ_SDHC1 7
157#define MX21_DMA_REQ_SSI2_RX0 8
158#define MX21_DMA_REQ_SSI2_TX0 9
159#define MX21_DMA_REQ_SSI2_RX1 10
160#define MX21_DMA_REQ_SSI2_TX1 11
161#define MX21_DMA_REQ_SSI1_RX0 12
162#define MX21_DMA_REQ_SSI1_TX0 13
163#define MX21_DMA_REQ_SSI1_RX1 14
164#define MX21_DMA_REQ_SSI1_TX1 15
165#define MX21_DMA_REQ_CSPI2_RX 16
166#define MX21_DMA_REQ_CSPI2_TX 17
167#define MX21_DMA_REQ_CSPI1_RX 18
168#define MX21_DMA_REQ_CSPI1_TX 19
169#define MX21_DMA_REQ_UART4_RX 20
170#define MX21_DMA_REQ_UART4_TX 21
171#define MX21_DMA_REQ_UART3_RX 22
172#define MX21_DMA_REQ_UART3_TX 23
173#define MX21_DMA_REQ_UART2_RX 24
174#define MX21_DMA_REQ_UART2_TX 25
175#define MX21_DMA_REQ_UART1_RX 26
176#define MX21_DMA_REQ_UART1_TX 27
177#define MX21_DMA_REQ_BMI_TX 28
178#define MX21_DMA_REQ_BMI_RX 29
179#define MX21_DMA_REQ_CSI_STAT 30
180#define MX21_DMA_REQ_CSI_RX 31
181
182/* these should go away */
183#define SDRAM_BASE_ADDR MX21_SDRAM_BASE_ADDR
184#define CSD1_BASE_ADDR MX21_CSD1_BASE_ADDR
185#define CS0_BASE_ADDR MX21_CS0_BASE_ADDR
186#define CS1_BASE_ADDR MX21_CS1_BASE_ADDR
187#define CS2_BASE_ADDR MX21_CS2_BASE_ADDR
188#define CS3_BASE_ADDR MX21_CS3_BASE_ADDR
189#define CS4_BASE_ADDR MX21_CS4_BASE_ADDR
190#define PCMCIA_MEM_BASE_ADDR MX21_PCMCIA_MEM_BASE_ADDR
191#define CS5_BASE_ADDR MX21_CS5_BASE_ADDR
192#define X_MEMC_BASE_ADDR MX21_X_MEMC_BASE_ADDR
193#define X_MEMC_BASE_ADDR_VIRT MX21_X_MEMC_BASE_ADDR_VIRT
194#define X_MEMC_SIZE MX21_X_MEMC_SIZE
195#define SDRAMC_BASE_ADDR MX21_SDRAMC_BASE_ADDR
196#define EIM_BASE_ADDR MX21_EIM_BASE_ADDR
197#define PCMCIA_CTL_BASE_ADDR MX21_PCMCIA_CTL_BASE_ADDR
198#define NFC_BASE_ADDR MX21_NFC_BASE_ADDR
199#define IRAM_BASE_ADDR MX21_IRAM_BASE_ADDR
200#define MXC_INT_FIRI MX21_INT_FIRI
201#define MXC_INT_BMI MX21_INT_BMI
202#define MXC_INT_EMMAENC MX21_INT_EMMAENC
203#define MXC_INT_EMMADEC MX21_INT_EMMADEC
204#define MXC_INT_USBWKUP MX21_INT_USBWKUP
205#define MXC_INT_USBDMA MX21_INT_USBDMA
206#define MXC_INT_USBHOST MX21_INT_USBHOST
207#define MXC_INT_USBFUNC MX21_INT_USBFUNC
208#define MXC_INT_USBMNP MX21_INT_USBMNP
209#define MXC_INT_USBCTRL MX21_INT_USBCTRL
210#define MXC_INT_USBCTRL MX21_INT_USBCTRL
211#define DMA_REQ_FIRI_RX MX21_DMA_REQ_FIRI_RX
212#define DMA_REQ_BMI_TX MX21_DMA_REQ_BMI_TX
213#define DMA_REQ_BMI_RX MX21_DMA_REQ_BMI_RX
69 214
70#endif /* __ASM_ARCH_MXC_MX21_H__ */ 215#endif /* __ASM_ARCH_MXC_MX21_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index ec64bd9a8ab1..91e738144804 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -1,14 +1,14 @@
1#ifndef __MACH_MX25_H__ 1#ifndef __MACH_MX25_H__
2#define __MACH_MX25_H__ 2#define __MACH_MX25_H__
3 3
4#define MX25_AIPS1_BASE_ADDR 0x43F00000 4#define MX25_AIPS1_BASE_ADDR 0x43f00000
5#define MX25_AIPS1_BASE_ADDR_VIRT 0xFC000000 5#define MX25_AIPS1_BASE_ADDR_VIRT 0xfc000000
6#define MX25_AIPS1_SIZE SZ_1M 6#define MX25_AIPS1_SIZE SZ_1M
7#define MX25_AIPS2_BASE_ADDR 0x53F00000 7#define MX25_AIPS2_BASE_ADDR 0x53f00000
8#define MX25_AIPS2_BASE_ADDR_VIRT 0xFC200000 8#define MX25_AIPS2_BASE_ADDR_VIRT 0xfc200000
9#define MX25_AIPS2_SIZE SZ_1M 9#define MX25_AIPS2_SIZE SZ_1M
10#define MX25_AVIC_BASE_ADDR 0x68000000 10#define MX25_AVIC_BASE_ADDR 0x68000000
11#define MX25_AVIC_BASE_ADDR_VIRT 0xFC400000 11#define MX25_AVIC_BASE_ADDR_VIRT 0xfc400000
12#define MX25_AVIC_SIZE SZ_1M 12#define MX25_AVIC_SIZE SZ_1M
13 13
14#define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000) 14#define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000)
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index dc3ad9aa952a..e2ae19f51710 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -24,87 +24,198 @@
24#ifndef __ASM_ARCH_MXC_MX27_H__ 24#ifndef __ASM_ARCH_MXC_MX27_H__
25#define __ASM_ARCH_MXC_MX27_H__ 25#define __ASM_ARCH_MXC_MX27_H__
26 26
27/* IRAM */ 27#define MX27_AIPI_BASE_ADDR 0x10000000
28#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ 28#define MX27_AIPI_BASE_ADDR_VIRT 0xf4000000
29 29#define MX27_AIPI_SIZE SZ_1M
30#define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000) 30#define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000)
31#define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000) 31#define MX27_WDOG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x02000)
32#define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000) 32#define MX27_GPT1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x03000)
33#define UART5_BASE_ADDR (AIPI_BASE_ADDR + 0x1B000) 33#define MX27_GPT2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x04000)
34#define UART6_BASE_ADDR (AIPI_BASE_ADDR + 0x1C000) 34#define MX27_GPT3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x05000)
35#define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000) 35#define MX27_PWM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x06000)
36#define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000) 36#define MX27_RTC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x07000)
37#define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000) 37#define MX27_KPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x08000)
38#define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000) 38#define MX27_OWIRE_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x09000)
39#define OTG_BASE_ADDR USBOTG_BASE_ADDR 39#define MX27_UART1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0a000)
40#define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000) 40#define MX27_UART2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0b000)
41#define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000) 41#define MX27_UART3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0c000)
42#define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000) 42#define MX27_UART4_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0d000)
43#define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000) 43#define MX27_CSPI1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0e000)
44#define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000) 44#define MX27_CSPI2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x0f000)
45#define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000) 45#define MX27_SSI1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x10000)
46#define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000) 46#define MX27_SSI2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x11000)
47#define MX27_I2C_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x12000)
48#define MX27_SDHC1_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x13000)
49#define MX27_SDHC2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x14000)
50#define MX27_GPIO_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x15000)
51#define MX27_AUDMUX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x16000)
52#define MX27_CSPI3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x17000)
53#define MX27_MSHC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x18000)
54#define MX27_GPT5_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x19000)
55#define MX27_GPT4_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1a000)
56#define MX27_UART5_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1b000)
57#define MX27_UART6_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1c000)
58#define MX27_I2C2_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1d000)
59#define MX27_SDHC3_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1e000)
60#define MX27_GPT6_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x1f000)
61#define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000)
62#define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000)
63#define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000)
64#define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000)
65#define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR
66#define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000)
67#define MX27_EMMA_PP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000)
68#define MX27_EMMA_PRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400)
69#define MX27_CCM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27000)
70#define MX27_SYSCTRL_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x27800)
71#define MX27_IIM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x28000)
72#define MX27_RTIC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2a000)
73#define MX27_FEC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2b000)
74#define MX27_SCC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x2c000)
75#define MX27_ETB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3b000)
76#define MX27_ETB_RAM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3c000)
77#define MX27_JAM_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3e000)
78#define MX27_MAX_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x3f000)
79
80#define MX27_AVIC_BASE_ADDR 0x10040000
47 81
48/* ROM patch */ 82/* ROM patch */
49#define ROMP_BASE_ADDR 0x10041000 83#define MX27_ROMP_BASE_ADDR 0x10041000
50 84
51#define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000) 85#define MX27_SAHB1_BASE_ADDR 0x80000000
86#define MX27_SAHB1_BASE_ADDR_VIRT 0xf4100000
87#define MX27_SAHB1_SIZE SZ_1M
88#define MX27_CSI_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x0000)
89#define MX27_ATA_BASE_ADDR (MX27_SAHB1_BASE_ADDR + 0x1000)
52 90
53/* Memory regions and CS */ 91/* Memory regions and CS */
54#define SDRAM_BASE_ADDR 0xA0000000 92#define MX27_SDRAM_BASE_ADDR 0xa0000000
55#define CSD1_BASE_ADDR 0xB0000000 93#define MX27_CSD1_BASE_ADDR 0xb0000000
56 94
57#define CS0_BASE_ADDR 0xC0000000 95#define MX27_CS0_BASE_ADDR 0xc0000000
58#define CS1_BASE_ADDR 0xC8000000 96#define MX27_CS1_BASE_ADDR 0xc8000000
59#define CS2_BASE_ADDR 0xD0000000 97#define MX27_CS2_BASE_ADDR 0xd0000000
60#define CS3_BASE_ADDR 0xD2000000 98#define MX27_CS3_BASE_ADDR 0xd2000000
61#define CS4_BASE_ADDR 0xD4000000 99#define MX27_CS4_BASE_ADDR 0xd4000000
62#define CS5_BASE_ADDR 0xD6000000 100#define MX27_CS5_BASE_ADDR 0xd6000000
63#define PCMCIA_MEM_BASE_ADDR 0xDC000000
64 101
65/* NAND, SDRAM, WEIM, M3IF, EMI controllers */ 102/* NAND, SDRAM, WEIM, M3IF, EMI controllers */
66#define X_MEMC_BASE_ADDR 0xD8000000 103#define MX27_X_MEMC_BASE_ADDR 0xd8000000
67#define X_MEMC_BASE_ADDR_VIRT 0xF4200000 104#define MX27_X_MEMC_BASE_ADDR_VIRT 0xf4200000
68#define X_MEMC_SIZE SZ_1M 105#define MX27_X_MEMC_SIZE SZ_1M
106#define MX27_NFC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR)
107#define MX27_SDRAMC_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x1000)
108#define MX27_WEIM_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x2000)
109#define MX27_M3IF_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x3000)
110#define MX27_PCMCIA_CTL_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x4000)
69 111
70#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR) 112#define MX27_PCMCIA_MEM_BASE_ADDR 0xdc000000
71#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 113
72#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 114/* IRAM */
73#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 115#define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */
74#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
75 116
76/* fixed interrupt numbers */ 117/* fixed interrupt numbers */
77#define MXC_INT_CCM 63 118#define MX27_INT_I2C2 1
78#define MXC_INT_IIM 62 119#define MX27_INT_GPT6 2
79#define MXC_INT_SAHARA 59 120#define MX27_INT_GPT5 3
80#define MXC_INT_SCC_SCM 58 121#define MX27_INT_GPT4 4
81#define MXC_INT_SCC_SMN 57 122#define MX27_INT_RTIC 5
82#define MXC_INT_USB3 56 123#define MX27_INT_CSPI3 6
83#define MXC_INT_USB2 55 124#define MX27_INT_SDHC 7
84#define MXC_INT_USB1 54 125#define MX27_INT_GPIO 8
85#define MXC_INT_VPU 53 126#define MX27_INT_SDHC3 9
86#define MXC_INT_FEC 50 127#define MX27_INT_SDHC2 10
87#define MXC_INT_UART5 49 128#define MX27_INT_SDHC1 11
88#define MXC_INT_UART6 48 129#define MX27_INT_I2C 12
89#define MXC_INT_ATA 30 130#define MX27_INT_SSI2 13
90#define MXC_INT_SDHC3 9 131#define MX27_INT_SSI1 14
91#define MXC_INT_SDHC 7 132#define MX27_INT_CSPI2 15
92#define MXC_INT_RTIC 5 133#define MX27_INT_CSPI1 16
93#define MXC_INT_GPT4 4 134#define MX27_INT_UART4 17
94#define MXC_INT_GPT5 3 135#define MX27_INT_UART3 18
95#define MXC_INT_GPT6 2 136#define MX27_INT_UART2 19
96#define MXC_INT_I2C2 1 137#define MX27_INT_UART1 20
138#define MX27_INT_KPP 21
139#define MX27_INT_RTC 22
140#define MX27_INT_PWM 23
141#define MX27_INT_GPT3 24
142#define MX27_INT_GPT2 25
143#define MX27_INT_GPT1 26
144#define MX27_INT_WDOG 27
145#define MX27_INT_PCMCIA 28
146#define MX27_INT_NANDFC 29
147#define MX27_INT_ATA 30
148#define MX27_INT_CSI 31
149#define MX27_INT_DMACH0 32
150#define MX27_INT_DMACH1 33
151#define MX27_INT_DMACH2 34
152#define MX27_INT_DMACH3 35
153#define MX27_INT_DMACH4 36
154#define MX27_INT_DMACH5 37
155#define MX27_INT_DMACH6 38
156#define MX27_INT_DMACH7 39
157#define MX27_INT_DMACH8 40
158#define MX27_INT_DMACH9 41
159#define MX27_INT_DMACH10 42
160#define MX27_INT_DMACH11 43
161#define MX27_INT_DMACH12 44
162#define MX27_INT_DMACH13 45
163#define MX27_INT_DMACH14 46
164#define MX27_INT_DMACH15 47
165#define MX27_INT_UART6 48
166#define MX27_INT_UART5 49
167#define MX27_INT_FEC 50
168#define MX27_INT_EMMAPRP 51
169#define MX27_INT_EMMAPP 52
170#define MX27_INT_VPU 53
171#define MX27_INT_USB1 54
172#define MX27_INT_USB2 55
173#define MX27_INT_USB3 56
174#define MX27_INT_SCC_SMN 57
175#define MX27_INT_SCC_SCM 58
176#define MX27_INT_SAHARA 59
177#define MX27_INT_SLCDC 60
178#define MX27_INT_LCDC 61
179#define MX27_INT_IIM 62
180#define MX27_INT_CCM 63
97 181
98/* fixed DMA request numbers */ 182/* fixed DMA request numbers */
99#define DMA_REQ_NFC 37 183#define MX27_DMA_REQ_CSPI3_RX 1
100#define DMA_REQ_SDHC3 36 184#define MX27_DMA_REQ_CSPI3_TX 2
101#define DMA_REQ_UART6_RX 35 185#define MX27_DMA_REQ_EXT 3
102#define DMA_REQ_UART6_TX 34 186#define MX27_DMA_REQ_MSHC 4
103#define DMA_REQ_UART5_RX 33 187#define MX27_DMA_REQ_SDHC2 6
104#define DMA_REQ_UART5_TX 32 188#define MX27_DMA_REQ_SDHC1 7
105#define DMA_REQ_ATA_RCV 29 189#define MX27_DMA_REQ_SSI2_RX0 8
106#define DMA_REQ_ATA_TX 28 190#define MX27_DMA_REQ_SSI2_TX0 9
107#define DMA_REQ_MSHC 4 191#define MX27_DMA_REQ_SSI2_RX1 10
192#define MX27_DMA_REQ_SSI2_TX1 11
193#define MX27_DMA_REQ_SSI1_RX0 12
194#define MX27_DMA_REQ_SSI1_TX0 13
195#define MX27_DMA_REQ_SSI1_RX1 14
196#define MX27_DMA_REQ_SSI1_TX1 15
197#define MX27_DMA_REQ_CSPI2_RX 16
198#define MX27_DMA_REQ_CSPI2_TX 17
199#define MX27_DMA_REQ_CSPI1_RX 18
200#define MX27_DMA_REQ_CSPI1_TX 19
201#define MX27_DMA_REQ_UART4_RX 20
202#define MX27_DMA_REQ_UART4_TX 21
203#define MX27_DMA_REQ_UART3_RX 22
204#define MX27_DMA_REQ_UART3_TX 23
205#define MX27_DMA_REQ_UART2_RX 24
206#define MX27_DMA_REQ_UART2_TX 25
207#define MX27_DMA_REQ_UART1_RX 26
208#define MX27_DMA_REQ_UART1_TX 27
209#define MX27_DMA_REQ_ATA_TX 28
210#define MX27_DMA_REQ_ATA_RCV 29
211#define MX27_DMA_REQ_CSI_STAT 30
212#define MX27_DMA_REQ_CSI_RX 31
213#define MX27_DMA_REQ_UART5_TX 32
214#define MX27_DMA_REQ_UART5_RX 33
215#define MX27_DMA_REQ_UART6_TX 34
216#define MX27_DMA_REQ_UART6_RX 35
217#define MX27_DMA_REQ_SDHC3 36
218#define MX27_DMA_REQ_NFC 37
108 219
109/* silicon revisions specific to i.MX27 */ 220/* silicon revisions specific to i.MX27 */
110#define CHIP_REV_1_0 0x00 221#define CHIP_REV_1_0 0x00
@@ -114,6 +225,72 @@
114extern int mx27_revision(void); 225extern int mx27_revision(void);
115#endif 226#endif
116 227
117/* Mandatory defines used globally */ 228/* these should go away */
229#define MSHC_BASE_ADDR MX27_MSHC_BASE_ADDR
230#define GPT5_BASE_ADDR MX27_GPT5_BASE_ADDR
231#define GPT4_BASE_ADDR MX27_GPT4_BASE_ADDR
232#define UART5_BASE_ADDR MX27_UART5_BASE_ADDR
233#define UART6_BASE_ADDR MX27_UART6_BASE_ADDR
234#define I2C2_BASE_ADDR MX27_I2C2_BASE_ADDR
235#define SDHC3_BASE_ADDR MX27_SDHC3_BASE_ADDR
236#define GPT6_BASE_ADDR MX27_GPT6_BASE_ADDR
237#define VPU_BASE_ADDR MX27_VPU_BASE_ADDR
238#define OTG_BASE_ADDR MX27_OTG_BASE_ADDR
239#define SAHARA_BASE_ADDR MX27_SAHARA_BASE_ADDR
240#define IIM_BASE_ADDR MX27_IIM_BASE_ADDR
241#define RTIC_BASE_ADDR MX27_RTIC_BASE_ADDR
242#define FEC_BASE_ADDR MX27_FEC_BASE_ADDR
243#define SCC_BASE_ADDR MX27_SCC_BASE_ADDR
244#define ETB_BASE_ADDR MX27_ETB_BASE_ADDR
245#define ETB_RAM_BASE_ADDR MX27_ETB_RAM_BASE_ADDR
246#define ROMP_BASE_ADDR MX27_ROMP_BASE_ADDR
247#define ATA_BASE_ADDR MX27_ATA_BASE_ADDR
248#define SDRAM_BASE_ADDR MX27_SDRAM_BASE_ADDR
249#define CSD1_BASE_ADDR MX27_CSD1_BASE_ADDR
250#define CS0_BASE_ADDR MX27_CS0_BASE_ADDR
251#define CS1_BASE_ADDR MX27_CS1_BASE_ADDR
252#define CS2_BASE_ADDR MX27_CS2_BASE_ADDR
253#define CS3_BASE_ADDR MX27_CS3_BASE_ADDR
254#define CS4_BASE_ADDR MX27_CS4_BASE_ADDR
255#define CS5_BASE_ADDR MX27_CS5_BASE_ADDR
256#define X_MEMC_BASE_ADDR MX27_X_MEMC_BASE_ADDR
257#define X_MEMC_BASE_ADDR_VIRT MX27_X_MEMC_BASE_ADDR_VIRT
258#define X_MEMC_SIZE MX27_X_MEMC_SIZE
259#define NFC_BASE_ADDR MX27_NFC_BASE_ADDR
260#define SDRAMC_BASE_ADDR MX27_SDRAMC_BASE_ADDR
261#define WEIM_BASE_ADDR MX27_WEIM_BASE_ADDR
262#define M3IF_BASE_ADDR MX27_M3IF_BASE_ADDR
263#define PCMCIA_CTL_BASE_ADDR MX27_PCMCIA_CTL_BASE_ADDR
264#define PCMCIA_MEM_BASE_ADDR MX27_PCMCIA_MEM_BASE_ADDR
265#define IRAM_BASE_ADDR MX27_IRAM_BASE_ADDR
266#define MXC_INT_I2C2 MX27_INT_I2C2
267#define MXC_INT_GPT6 MX27_INT_GPT6
268#define MXC_INT_GPT5 MX27_INT_GPT5
269#define MXC_INT_GPT4 MX27_INT_GPT4
270#define MXC_INT_RTIC MX27_INT_RTIC
271#define MXC_INT_SDHC MX27_INT_SDHC
272#define MXC_INT_SDHC3 MX27_INT_SDHC3
273#define MXC_INT_ATA MX27_INT_ATA
274#define MXC_INT_UART6 MX27_INT_UART6
275#define MXC_INT_UART5 MX27_INT_UART5
276#define MXC_INT_FEC MX27_INT_FEC
277#define MXC_INT_VPU MX27_INT_VPU
278#define MXC_INT_USB1 MX27_INT_USB1
279#define MXC_INT_USB2 MX27_INT_USB2
280#define MXC_INT_USB3 MX27_INT_USB3
281#define MXC_INT_SCC_SMN MX27_INT_SCC_SMN
282#define MXC_INT_SCC_SCM MX27_INT_SCC_SCM
283#define MXC_INT_SAHARA MX27_INT_SAHARA
284#define MXC_INT_IIM MX27_INT_IIM
285#define MXC_INT_CCM MX27_INT_CCM
286#define DMA_REQ_MSHC MX27_DMA_REQ_MSHC
287#define DMA_REQ_ATA_TX MX27_DMA_REQ_ATA_TX
288#define DMA_REQ_ATA_RCV MX27_DMA_REQ_ATA_RCV
289#define DMA_REQ_UART5_TX MX27_DMA_REQ_UART5_TX
290#define DMA_REQ_UART5_RX MX27_DMA_REQ_UART5_RX
291#define DMA_REQ_UART6_TX MX27_DMA_REQ_UART6_TX
292#define DMA_REQ_UART6_RX MX27_DMA_REQ_UART6_RX
293#define DMA_REQ_SDHC3 MX27_DMA_REQ_SDHC3
294#define DMA_REQ_NFC MX27_DMA_REQ_NFC
118 295
119#endif /* __ASM_ARCH_MXC_MX27_H__ */ 296#endif /* __ASM_ARCH_MXC_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
index db5d921e0fe6..f2eaf140ed02 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -25,51 +25,49 @@
25 25
26/* The following addresses are common between i.MX21 and i.MX27 */ 26/* The following addresses are common between i.MX21 and i.MX27 */
27 27
28/* Register offests */ 28/* Register offsets */
29#define AIPI_BASE_ADDR 0x10000000 29#define MX2x_AIPI_BASE_ADDR 0x10000000
30#define AIPI_BASE_ADDR_VIRT 0xF4000000 30#define MX2x_AIPI_BASE_ADDR_VIRT 0xf4000000
31#define AIPI_SIZE SZ_1M 31#define MX2x_AIPI_SIZE SZ_1M
32 32#define MX2x_DMA_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x01000)
33#define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000) 33#define MX2x_WDOG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x02000)
34#define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000) 34#define MX2x_GPT1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x03000)
35#define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000) 35#define MX2x_GPT2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x04000)
36#define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000) 36#define MX2x_GPT3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x05000)
37#define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000) 37#define MX2x_PWM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x06000)
38#define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000) 38#define MX2x_RTC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x07000)
39#define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000) 39#define MX2x_KPP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x08000)
40#define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000) 40#define MX2x_OWIRE_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x09000)
41#define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000) 41#define MX2x_UART1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0a000)
42#define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000) 42#define MX2x_UART2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0b000)
43#define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000) 43#define MX2x_UART3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0c000)
44#define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000) 44#define MX2x_UART4_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0d000)
45#define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000) 45#define MX2x_CSPI1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0e000)
46#define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000) 46#define MX2x_CSPI2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x0f000)
47#define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000) 47#define MX2x_SSI1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x10000)
48#define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000) 48#define MX2x_SSI2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x11000)
49#define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000) 49#define MX2x_I2C_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x12000)
50#define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000) 50#define MX2x_SDHC1_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x13000)
51#define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000) 51#define MX2x_SDHC2_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x14000)
52#define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000) 52#define MX2x_GPIO_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x15000)
53#define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000) 53#define MX2x_AUDMUX_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x16000)
54#define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000) 54#define MX2x_CSPI3_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x17000)
55#define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000) 55#define MX2x_LCDC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x21000)
56#define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000) 56#define MX2x_SLCDC_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x22000)
57#define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000) 57#define MX2x_USBOTG_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x24000)
58#define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000) 58#define MX2x_EMMA_PP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x26000)
59#define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000) 59#define MX2x_EMMA_PRP_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x26400)
60#define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400) 60#define MX2x_CCM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x27000)
61#define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000) 61#define MX2x_SYSCTRL_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x27800)
62#define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800) 62#define MX2x_JAM_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x3e000)
63#define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000) 63#define MX2x_MAX_BASE_ADDR (MX2x_AIPI_BASE_ADDR + 0x3f000)
64#define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000) 64
65 65#define MX2x_AVIC_BASE_ADDR 0x10040000
66#define AVIC_BASE_ADDR 0x10040000 66
67 67#define MX2x_SAHB1_BASE_ADDR 0x80000000
68#define SAHB1_BASE_ADDR 0x80000000 68#define MX2x_SAHB1_BASE_ADDR_VIRT 0xf4100000
69#define SAHB1_BASE_ADDR_VIRT 0xF4100000 69#define MX2x_SAHB1_SIZE SZ_1M
70#define SAHB1_SIZE SZ_1M 70#define MX2x_CSI_BASE_ADDR (MX2x_SAHB1_BASE_ADDR + 0x0000)
71
72#define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000)
73 71
74/* 72/*
75 * This macro defines the physical to virtual address mapping for all the 73 * This macro defines the physical to virtual address mapping for all the
@@ -105,78 +103,189 @@
105 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) 103 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
106 104
107/* fixed interrupt numbers */ 105/* fixed interrupt numbers */
108#define MXC_INT_LCDC 61 106#define MX2x_INT_CSPI3 6
109#define MXC_INT_SLCDC 60 107#define MX2x_INT_GPIO 8
110#define MXC_INT_EMMAPP 52 108#define MX2x_INT_SDHC2 10
111#define MXC_INT_EMMAPRP 51 109#define MX2x_INT_SDHC1 11
112#define MXC_INT_DMACH15 47 110#define MX2x_INT_I2C 12
113#define MXC_INT_DMACH14 46 111#define MX2x_INT_SSI2 13
114#define MXC_INT_DMACH13 45 112#define MX2x_INT_SSI1 14
115#define MXC_INT_DMACH12 44 113#define MX2x_INT_CSPI2 15
116#define MXC_INT_DMACH11 43 114#define MX2x_INT_CSPI1 16
117#define MXC_INT_DMACH10 42 115#define MX2x_INT_UART4 17
118#define MXC_INT_DMACH9 41 116#define MX2x_INT_UART3 18
119#define MXC_INT_DMACH8 40 117#define MX2x_INT_UART2 19
120#define MXC_INT_DMACH7 39 118#define MX2x_INT_UART1 20
121#define MXC_INT_DMACH6 38 119#define MX2x_INT_KPP 21
122#define MXC_INT_DMACH5 37 120#define MX2x_INT_RTC 22
123#define MXC_INT_DMACH4 36 121#define MX2x_INT_PWM 23
124#define MXC_INT_DMACH3 35 122#define MX2x_INT_GPT3 24
125#define MXC_INT_DMACH2 34 123#define MX2x_INT_GPT2 25
126#define MXC_INT_DMACH1 33 124#define MX2x_INT_GPT1 26
127#define MXC_INT_DMACH0 32 125#define MX2x_INT_WDOG 27
128#define MXC_INT_CSI 31 126#define MX2x_INT_PCMCIA 28
129#define MXC_INT_NANDFC 29 127#define MX2x_INT_NANDFC 29
130#define MXC_INT_PCMCIA 28 128#define MX2x_INT_CSI 31
131#define MXC_INT_WDOG 27 129#define MX2x_INT_DMACH0 32
132#define MXC_INT_GPT1 26 130#define MX2x_INT_DMACH1 33
133#define MXC_INT_GPT2 25 131#define MX2x_INT_DMACH2 34
134#define MXC_INT_GPT3 24 132#define MX2x_INT_DMACH3 35
135#define MXC_INT_GPT INT_GPT1 133#define MX2x_INT_DMACH4 36
136#define MXC_INT_PWM 23 134#define MX2x_INT_DMACH5 37
137#define MXC_INT_RTC 22 135#define MX2x_INT_DMACH6 38
138#define MXC_INT_KPP 21 136#define MX2x_INT_DMACH7 39
139#define MXC_INT_UART1 20 137#define MX2x_INT_DMACH8 40
140#define MXC_INT_UART2 19 138#define MX2x_INT_DMACH9 41
141#define MXC_INT_UART3 18 139#define MX2x_INT_DMACH10 42
142#define MXC_INT_UART4 17 140#define MX2x_INT_DMACH11 43
143#define MXC_INT_CSPI1 16 141#define MX2x_INT_DMACH12 44
144#define MXC_INT_CSPI2 15 142#define MX2x_INT_DMACH13 45
145#define MXC_INT_SSI1 14 143#define MX2x_INT_DMACH14 46
146#define MXC_INT_SSI2 13 144#define MX2x_INT_DMACH15 47
147#define MXC_INT_I2C 12 145#define MX2x_INT_EMMAPRP 51
148#define MXC_INT_SDHC1 11 146#define MX2x_INT_EMMAPP 52
149#define MXC_INT_SDHC2 10 147#define MX2x_INT_SLCDC 60
150#define MXC_INT_GPIO 8 148#define MX2x_INT_LCDC 61
151#define MXC_INT_CSPI3 6
152 149
153/* fixed DMA request numbers */ 150/* fixed DMA request numbers */
154#define DMA_REQ_CSI_RX 31 151#define MX2x_DMA_REQ_CSPI3_RX 1
155#define DMA_REQ_CSI_STAT 30 152#define MX2x_DMA_REQ_CSPI3_TX 2
156#define DMA_REQ_UART1_TX 27 153#define MX2x_DMA_REQ_EXT 3
157#define DMA_REQ_UART1_RX 26 154#define MX2x_DMA_REQ_SDHC2 6
158#define DMA_REQ_UART2_TX 25 155#define MX2x_DMA_REQ_SDHC1 7
159#define DMA_REQ_UART2_RX 24 156#define MX2x_DMA_REQ_SSI2_RX0 8
160#define DMA_REQ_UART3_TX 23 157#define MX2x_DMA_REQ_SSI2_TX0 9
161#define DMA_REQ_UART3_RX 22 158#define MX2x_DMA_REQ_SSI2_RX1 10
162#define DMA_REQ_UART4_TX 21 159#define MX2x_DMA_REQ_SSI2_TX1 11
163#define DMA_REQ_UART4_RX 20 160#define MX2x_DMA_REQ_SSI1_RX0 12
164#define DMA_REQ_CSPI1_TX 19 161#define MX2x_DMA_REQ_SSI1_TX0 13
165#define DMA_REQ_CSPI1_RX 18 162#define MX2x_DMA_REQ_SSI1_RX1 14
166#define DMA_REQ_CSPI2_TX 17 163#define MX2x_DMA_REQ_SSI1_TX1 15
167#define DMA_REQ_CSPI2_RX 16 164#define MX2x_DMA_REQ_CSPI2_RX 16
168#define DMA_REQ_SSI1_TX1 15 165#define MX2x_DMA_REQ_CSPI2_TX 17
169#define DMA_REQ_SSI1_RX1 14 166#define MX2x_DMA_REQ_CSPI1_RX 18
170#define DMA_REQ_SSI1_TX0 13 167#define MX2x_DMA_REQ_CSPI1_TX 19
171#define DMA_REQ_SSI1_RX0 12 168#define MX2x_DMA_REQ_UART4_RX 20
172#define DMA_REQ_SSI2_TX1 11 169#define MX2x_DMA_REQ_UART4_TX 21
173#define DMA_REQ_SSI2_RX1 10 170#define MX2x_DMA_REQ_UART3_RX 22
174#define DMA_REQ_SSI2_TX0 9 171#define MX2x_DMA_REQ_UART3_TX 23
175#define DMA_REQ_SSI2_RX0 8 172#define MX2x_DMA_REQ_UART2_RX 24
176#define DMA_REQ_SDHC1 7 173#define MX2x_DMA_REQ_UART2_TX 25
177#define DMA_REQ_SDHC2 6 174#define MX2x_DMA_REQ_UART1_RX 26
178#define DMA_REQ_EXT 3 175#define MX2x_DMA_REQ_UART1_TX 27
179#define DMA_REQ_CSPI3_TX 2 176#define MX2x_DMA_REQ_CSI_STAT 30
180#define DMA_REQ_CSPI3_RX 1 177#define MX2x_DMA_REQ_CSI_RX 31
178
179/* these should go away */
180#define AIPI_BASE_ADDR MX2x_AIPI_BASE_ADDR
181#define AIPI_BASE_ADDR_VIRT MX2x_AIPI_BASE_ADDR_VIRT
182#define AIPI_SIZE MX2x_AIPI_SIZE
183#define DMA_BASE_ADDR MX2x_DMA_BASE_ADDR
184#define WDOG_BASE_ADDR MX2x_WDOG_BASE_ADDR
185#define GPT1_BASE_ADDR MX2x_GPT1_BASE_ADDR
186#define GPT2_BASE_ADDR MX2x_GPT2_BASE_ADDR
187#define GPT3_BASE_ADDR MX2x_GPT3_BASE_ADDR
188#define PWM_BASE_ADDR MX2x_PWM_BASE_ADDR
189#define RTC_BASE_ADDR MX2x_RTC_BASE_ADDR
190#define KPP_BASE_ADDR MX2x_KPP_BASE_ADDR
191#define OWIRE_BASE_ADDR MX2x_OWIRE_BASE_ADDR
192#define UART1_BASE_ADDR MX2x_UART1_BASE_ADDR
193#define UART2_BASE_ADDR MX2x_UART2_BASE_ADDR
194#define UART3_BASE_ADDR MX2x_UART3_BASE_ADDR
195#define UART4_BASE_ADDR MX2x_UART4_BASE_ADDR
196#define CSPI1_BASE_ADDR MX2x_CSPI1_BASE_ADDR
197#define CSPI2_BASE_ADDR MX2x_CSPI2_BASE_ADDR
198#define SSI1_BASE_ADDR MX2x_SSI1_BASE_ADDR
199#define SSI2_BASE_ADDR MX2x_SSI2_BASE_ADDR
200#define I2C_BASE_ADDR MX2x_I2C_BASE_ADDR
201#define SDHC1_BASE_ADDR MX2x_SDHC1_BASE_ADDR
202#define SDHC2_BASE_ADDR MX2x_SDHC2_BASE_ADDR
203#define GPIO_BASE_ADDR MX2x_GPIO_BASE_ADDR
204#define AUDMUX_BASE_ADDR MX2x_AUDMUX_BASE_ADDR
205#define CSPI3_BASE_ADDR MX2x_CSPI3_BASE_ADDR
206#define LCDC_BASE_ADDR MX2x_LCDC_BASE_ADDR
207#define SLCDC_BASE_ADDR MX2x_SLCDC_BASE_ADDR
208#define USBOTG_BASE_ADDR MX2x_USBOTG_BASE_ADDR
209#define EMMA_PP_BASE_ADDR MX2x_EMMA_PP_BASE_ADDR
210#define EMMA_PRP_BASE_ADDR MX2x_EMMA_PRP_BASE_ADDR
211#define CCM_BASE_ADDR MX2x_CCM_BASE_ADDR
212#define SYSCTRL_BASE_ADDR MX2x_SYSCTRL_BASE_ADDR
213#define JAM_BASE_ADDR MX2x_JAM_BASE_ADDR
214#define MAX_BASE_ADDR MX2x_MAX_BASE_ADDR
215#define AVIC_BASE_ADDR MX2x_AVIC_BASE_ADDR
216#define SAHB1_BASE_ADDR MX2x_SAHB1_BASE_ADDR
217#define SAHB1_BASE_ADDR_VIRT MX2x_SAHB1_BASE_ADDR_VIRT
218#define SAHB1_SIZE MX2x_SAHB1_SIZE
219#define CSI_BASE_ADDR MX2x_CSI_BASE_ADDR
220#define MXC_INT_CSPI3 MX2x_INT_CSPI3
221#define MXC_INT_GPIO MX2x_INT_GPIO
222#define MXC_INT_SDHC2 MX2x_INT_SDHC2
223#define MXC_INT_SDHC1 MX2x_INT_SDHC1
224#define MXC_INT_I2C MX2x_INT_I2C
225#define MXC_INT_SSI2 MX2x_INT_SSI2
226#define MXC_INT_SSI1 MX2x_INT_SSI1
227#define MXC_INT_CSPI2 MX2x_INT_CSPI2
228#define MXC_INT_CSPI1 MX2x_INT_CSPI1
229#define MXC_INT_UART4 MX2x_INT_UART4
230#define MXC_INT_UART3 MX2x_INT_UART3
231#define MXC_INT_UART2 MX2x_INT_UART2
232#define MXC_INT_UART1 MX2x_INT_UART1
233#define MXC_INT_KPP MX2x_INT_KPP
234#define MXC_INT_RTC MX2x_INT_RTC
235#define MXC_INT_PWM MX2x_INT_PWM
236#define MXC_INT_GPT3 MX2x_INT_GPT3
237#define MXC_INT_GPT2 MX2x_INT_GPT2
238#define MXC_INT_GPT1 MX2x_INT_GPT1
239#define MXC_INT_WDOG MX2x_INT_WDOG
240#define MXC_INT_PCMCIA MX2x_INT_PCMCIA
241#define MXC_INT_NANDFC MX2x_INT_NANDFC
242#define MXC_INT_CSI MX2x_INT_CSI
243#define MXC_INT_DMACH0 MX2x_INT_DMACH0
244#define MXC_INT_DMACH1 MX2x_INT_DMACH1
245#define MXC_INT_DMACH2 MX2x_INT_DMACH2
246#define MXC_INT_DMACH3 MX2x_INT_DMACH3
247#define MXC_INT_DMACH4 MX2x_INT_DMACH4
248#define MXC_INT_DMACH5 MX2x_INT_DMACH5
249#define MXC_INT_DMACH6 MX2x_INT_DMACH6
250#define MXC_INT_DMACH7 MX2x_INT_DMACH7
251#define MXC_INT_DMACH8 MX2x_INT_DMACH8
252#define MXC_INT_DMACH9 MX2x_INT_DMACH9
253#define MXC_INT_DMACH10 MX2x_INT_DMACH10
254#define MXC_INT_DMACH11 MX2x_INT_DMACH11
255#define MXC_INT_DMACH12 MX2x_INT_DMACH12
256#define MXC_INT_DMACH13 MX2x_INT_DMACH13
257#define MXC_INT_DMACH14 MX2x_INT_DMACH14
258#define MXC_INT_DMACH15 MX2x_INT_DMACH15
259#define MXC_INT_EMMAPRP MX2x_INT_EMMAPRP
260#define MXC_INT_EMMAPP MX2x_INT_EMMAPP
261#define MXC_INT_SLCDC MX2x_INT_SLCDC
262#define MXC_INT_LCDC MX2x_INT_LCDC
263#define DMA_REQ_CSPI3_RX MX2x_DMA_REQ_CSPI3_RX
264#define DMA_REQ_CSPI3_TX MX2x_DMA_REQ_CSPI3_TX
265#define DMA_REQ_EXT MX2x_DMA_REQ_EXT
266#define DMA_REQ_SDHC2 MX2x_DMA_REQ_SDHC2
267#define DMA_REQ_SDHC1 MX2x_DMA_REQ_SDHC1
268#define DMA_REQ_SSI2_RX0 MX2x_DMA_REQ_SSI2_RX0
269#define DMA_REQ_SSI2_TX0 MX2x_DMA_REQ_SSI2_TX0
270#define DMA_REQ_SSI2_RX1 MX2x_DMA_REQ_SSI2_RX1
271#define DMA_REQ_SSI2_TX1 MX2x_DMA_REQ_SSI2_TX1
272#define DMA_REQ_SSI1_RX0 MX2x_DMA_REQ_SSI1_RX0
273#define DMA_REQ_SSI1_TX0 MX2x_DMA_REQ_SSI1_TX0
274#define DMA_REQ_SSI1_RX1 MX2x_DMA_REQ_SSI1_RX1
275#define DMA_REQ_SSI1_TX1 MX2x_DMA_REQ_SSI1_TX1
276#define DMA_REQ_CSPI2_RX MX2x_DMA_REQ_CSPI2_RX
277#define DMA_REQ_CSPI2_TX MX2x_DMA_REQ_CSPI2_TX
278#define DMA_REQ_CSPI1_RX MX2x_DMA_REQ_CSPI1_RX
279#define DMA_REQ_CSPI1_TX MX2x_DMA_REQ_CSPI1_TX
280#define DMA_REQ_UART4_RX MX2x_DMA_REQ_UART4_RX
281#define DMA_REQ_UART4_TX MX2x_DMA_REQ_UART4_TX
282#define DMA_REQ_UART3_RX MX2x_DMA_REQ_UART3_RX
283#define DMA_REQ_UART3_TX MX2x_DMA_REQ_UART3_TX
284#define DMA_REQ_UART2_RX MX2x_DMA_REQ_UART2_RX
285#define DMA_REQ_UART2_TX MX2x_DMA_REQ_UART2_TX
286#define DMA_REQ_UART1_RX MX2x_DMA_REQ_UART1_RX
287#define DMA_REQ_UART1_TX MX2x_DMA_REQ_UART1_TX
288#define DMA_REQ_CSI_STAT MX2x_DMA_REQ_CSI_STAT
289#define DMA_REQ_CSI_RX MX2x_DMA_REQ_CSI_RX
181 290
182#endif /* __ASM_ARCH_MXC_MX2x_H__ */ 291#endif /* __ASM_ARCH_MXC_MX2x_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index 14ac0dcc82f4..b8b47d139eb5 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,45 +1,218 @@
1/* 1/*
2 * IRAM 2 * IRAM
3 */ 3 */
4#define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ 4#define MX31_IRAM_BASE_ADDR 0x1ffc0000 /* internal ram */
5#define MX31_IRAM_SIZE SZ_16K 5#define MX31_IRAM_SIZE SZ_16K
6 6
7#define MX31_OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) 7#define MX31_L2CC_BASE_ADDR 0x30000000
8#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) 8#define MX31_L2CC_SIZE SZ_1M
9#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
10#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
11 9
12#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) 10#define MX31_AIPS1_BASE_ADDR 0x43f00000
13#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) 11#define MX31_AIPS1_BASE_ADDR_VIRT 0xfc000000
14#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) 12#define MX31_AIPS1_SIZE SZ_1M
15#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000) 13#define MX31_MAX_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x04000)
14#define MX31_EVTMON_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x08000)
15#define MX31_CLKCTL_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x0c000)
16#define MX31_ETB_SLOT4_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x10000)
17#define MX31_ETB_SLOT5_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x14000)
18#define MX31_ECT_CTIO_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x18000)
19#define MX31_I2C_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x80000)
20#define MX31_I2C3_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x84000)
21#define MX31_OTG_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x88000)
22#define MX31_ATA_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x8c000)
23#define MX31_UART1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x90000)
24#define MX31_UART2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x94000)
25#define MX31_I2C2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x98000)
26#define MX31_OWIRE_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0x9c000)
27#define MX31_SSI1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa0000)
28#define MX31_CSPI1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa4000)
29#define MX31_KPP_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xa8000)
30#define MX31_IOMUXC_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xac000)
31#define MX31_UART4_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb0000)
32#define MX31_UART5_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb4000)
33#define MX31_ECT_IP1_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xb8000)
34#define MX31_ECT_IP2_BASE_ADDR (MX31_AIPS1_BASE_ADDR + 0xbc000)
16 35
17#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) 36#define MX31_SPBA0_BASE_ADDR 0x50000000
18#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) 37#define MX31_SPBA0_BASE_ADDR_VIRT 0xfc100000
19#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000) 38#define MX31_SPBA0_SIZE SZ_1M
20#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000) 39#define MX31_MMC_SDHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x04000)
21#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) 40#define MX31_MMC_SDHC2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x08000)
41#define MX31_UART3_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x0c000)
42#define MX31_CSPI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x10000)
43#define MX31_SSI2_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x14000)
44#define MX31_SIM1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x18000)
45#define MX31_IIM_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x1c000)
46#define MX31_ATA_DMA_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x20000)
47#define MX31_MSHC1_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x24000)
48#define MX31_SPBA_CTRL_BASE_ADDR (MX31_SPBA0_BASE_ADDR + 0x3c000)
22 49
23#define MX31_NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) 50#define MX31_AIPS2_BASE_ADDR 0x53f00000
51#define MX31_AIPS2_BASE_ADDR_VIRT 0xfc200000
52#define MX31_AIPS2_SIZE SZ_1M
53#define MX31_CCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x80000)
54#define MX31_CSPI3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x84000)
55#define MX31_FIRI_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x8c000)
56#define MX31_GPT1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x90000)
57#define MX31_EPIT1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x94000)
58#define MX31_EPIT2_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0x98000)
59#define MX31_GPIO3_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xa4000)
60#define MX31_SCC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xac000)
61#define MX31_SCM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xae000)
62#define MX31_SMN_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xaf000)
63#define MX31_RNGA_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xb0000)
64#define MX31_IPU_CTRL_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc0000)
65#define MX31_AUDMUX_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc4000)
66#define MX31_MPEG4_ENC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xc8000)
67#define MX31_GPIO1_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xcc000)
68#define MX31_GPIO2_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd0000)
69#define MX31_SDMA_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd4000)
70#define MX31_RTC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xd8000)
71#define MX31_WDOG_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xdc000)
72#define MX31_PWM_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xe0000)
73#define MX31_RTIC_BASE_ADDR (MX31_AIPS2_BASE_ADDR + 0xec000)
24 74
25#define MXC_INT_MPEG4_ENCODER 5 75#define MX31_ROMP_BASE_ADDR 0x60000000
26#define MXC_INT_FIRI 7 76#define MX31_ROMP_BASE_ADDR_VIRT 0xfc500000
77#define MX31_ROMP_SIZE SZ_1M
78
79#define MX31_AVIC_BASE_ADDR 0x68000000
80#define MX31_AVIC_BASE_ADDR_VIRT 0xfc400000
81#define MX31_AVIC_SIZE SZ_1M
82
83#define MX31_IPU_MEM_BASE_ADDR 0x70000000
84#define MX31_CSD0_BASE_ADDR 0x80000000
85#define MX31_CSD1_BASE_ADDR 0x90000000
86
87#define MX31_CS0_BASE_ADDR 0xa0000000
88#define MX31_CS1_BASE_ADDR 0xa8000000
89#define MX31_CS2_BASE_ADDR 0xb0000000
90#define MX31_CS3_BASE_ADDR 0xb2000000
91
92#define MX31_CS4_BASE_ADDR 0xb4000000
93#define MX31_CS4_BASE_ADDR_VIRT 0xf4000000
94#define MX31_CS4_SIZE SZ_32M
95
96#define MX31_CS5_BASE_ADDR 0xb6000000
97#define MX31_CS5_BASE_ADDR_VIRT 0xf6000000
98#define MX31_CS5_SIZE SZ_32M
99
100#define MX31_X_MEMC_BASE_ADDR 0xb8000000
101#define MX31_X_MEMC_BASE_ADDR_VIRT 0xfc320000
102#define MX31_X_MEMC_SIZE SZ_64K
103#define MX31_NFC_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x0000)
104#define MX31_ESDCTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x1000)
105#define MX31_WEIM_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x2000)
106#define MX31_M3IF_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x3000)
107#define MX31_EMI_CTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x4000)
108#define MX31_PCMCIA_CTL_BASE_ADDR MX31_EMI_CTL_BASE_ADDR
109
110#define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000
111
112#define MX31_INT_I2C3 3
113#define MX31_INT_I2C2 4
114#define MX31_INT_MPEG4_ENCODER 5
115#define MX31_INT_RTIC 6
116#define MX31_INT_FIRI 7
27#define MX31_INT_MMC_SDHC2 8 117#define MX31_INT_MMC_SDHC2 8
28#define MXC_INT_MMC_SDHC1 9 118#define MX31_INT_MMC_SDHC1 9
119#define MX31_INT_I2C 10
29#define MX31_INT_SSI2 11 120#define MX31_INT_SSI2 11
30#define MX31_INT_SSI1 12 121#define MX31_INT_SSI1 12
31#define MXC_INT_MBX 16 122#define MX31_INT_CSPI2 13
32#define MXC_INT_CSPI3 17 123#define MX31_INT_CSPI1 14
33#define MXC_INT_SIM2 20 124#define MX31_INT_ATA 15
34#define MXC_INT_SIM1 21 125#define MX31_INT_MBX 16
35#define MXC_INT_CCM_DVFS 31 126#define MX31_INT_CSPI3 17
36#define MXC_INT_USB1 35 127#define MX31_INT_UART3 18
37#define MXC_INT_USB2 36 128#define MX31_INT_IIM 19
38#define MXC_INT_USB3 37 129#define MX31_INT_SIM2 20
39#define MXC_INT_USB4 38 130#define MX31_INT_SIM1 21
40#define MXC_INT_MSHC2 40 131#define MX31_INT_RNGA 22
41#define MXC_INT_UART4 46 132#define MX31_INT_EVTMON 23
42#define MXC_INT_UART5 47 133#define MX31_INT_KPP 24
43#define MXC_INT_CCM 53 134#define MX31_INT_RTC 25
44#define MXC_INT_PCMCIA 54 135#define MX31_INT_PWM 26
136#define MX31_INT_EPIT2 27
137#define MX31_INT_EPIT1 28
138#define MX31_INT_GPT 29
139#define MX31_INT_POWER_FAIL 30
140#define MX31_INT_CCM_DVFS 31
141#define MX31_INT_UART2 32
142#define MX31_INT_NANDFC 33
143#define MX31_INT_SDMA 34
144#define MX31_INT_USB1 35
145#define MX31_INT_USB2 36
146#define MX31_INT_USB3 37
147#define MX31_INT_USB4 38
148#define MX31_INT_MSHC1 39
149#define MX31_INT_MSHC2 40
150#define MX31_INT_IPU_ERR 41
151#define MX31_INT_IPU_SYN 42
152#define MX31_INT_UART1 45
153#define MX31_INT_UART4 46
154#define MX31_INT_UART5 47
155#define MX31_INT_ECT 48
156#define MX31_INT_SCC_SCM 49
157#define MX31_INT_SCC_SMN 50
158#define MX31_INT_GPIO2 51
159#define MX31_INT_GPIO1 52
160#define MX31_INT_CCM 53
161#define MX31_INT_PCMCIA 54
162#define MX31_INT_WDOG 55
163#define MX31_INT_GPIO3 56
164#define MX31_INT_EXT_POWER 58
165#define MX31_INT_EXT_TEMPER 59
166#define MX31_INT_EXT_SENSOR60 60
167#define MX31_INT_EXT_SENSOR61 61
168#define MX31_INT_EXT_WDOG 62
169#define MX31_INT_EXT_TV 63
170
171#define MX31_PROD_SIGNATURE 0x1 /* For MX31 */
172
173/* silicon revisions specific to i.MX31 */
174#define MX31_CHIP_REV_1_0 0x10
175#define MX31_CHIP_REV_1_1 0x11
176#define MX31_CHIP_REV_1_2 0x12
177#define MX31_CHIP_REV_1_3 0x13
178#define MX31_CHIP_REV_2_0 0x20
179#define MX31_CHIP_REV_2_1 0x21
180#define MX31_CHIP_REV_2_2 0x22
181#define MX31_CHIP_REV_2_3 0x23
182#define MX31_CHIP_REV_3_0 0x30
183#define MX31_CHIP_REV_3_1 0x31
184#define MX31_CHIP_REV_3_2 0x32
185
186#define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0
187#define MX31_SYSTEM_REV_NUM 3
45 188
189/* these should go away */
190#define ATA_BASE_ADDR MX31_ATA_BASE_ADDR
191#define UART4_BASE_ADDR MX31_UART4_BASE_ADDR
192#define UART5_BASE_ADDR MX31_UART5_BASE_ADDR
193#define MMC_SDHC1_BASE_ADDR MX31_MMC_SDHC1_BASE_ADDR
194#define MMC_SDHC2_BASE_ADDR MX31_MMC_SDHC2_BASE_ADDR
195#define SIM1_BASE_ADDR MX31_SIM1_BASE_ADDR
196#define IIM_BASE_ADDR MX31_IIM_BASE_ADDR
197#define CSPI3_BASE_ADDR MX31_CSPI3_BASE_ADDR
198#define FIRI_BASE_ADDR MX31_FIRI_BASE_ADDR
199#define SCM_BASE_ADDR MX31_SCM_BASE_ADDR
200#define SMN_BASE_ADDR MX31_SMN_BASE_ADDR
201#define MPEG4_ENC_BASE_ADDR MX31_MPEG4_ENC_BASE_ADDR
202#define MXC_INT_MPEG4_ENCODER MX31_INT_MPEG4_ENCODER
203#define MXC_INT_FIRI MX31_INT_FIRI
204#define MXC_INT_MMC_SDHC1 MX31_INT_MMC_SDHC1
205#define MXC_INT_MBX MX31_INT_MBX
206#define MXC_INT_CSPI3 MX31_INT_CSPI3
207#define MXC_INT_SIM2 MX31_INT_SIM2
208#define MXC_INT_SIM1 MX31_INT_SIM1
209#define MXC_INT_CCM_DVFS MX31_INT_CCM_DVFS
210#define MXC_INT_USB1 MX31_INT_USB1
211#define MXC_INT_USB2 MX31_INT_USB2
212#define MXC_INT_USB3 MX31_INT_USB3
213#define MXC_INT_USB4 MX31_INT_USB4
214#define MXC_INT_MSHC2 MX31_INT_MSHC2
215#define MXC_INT_UART4 MX31_INT_UART4
216#define MXC_INT_UART5 MX31_INT_UART5
217#define MXC_INT_CCM MX31_INT_CCM
218#define MXC_INT_PCMCIA MX31_INT_PCMCIA
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index ab4cfec6c8ab..af871bce35b6 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -2,29 +2,196 @@
2 * IRAM 2 * IRAM
3 */ 3 */
4#define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */ 4#define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */
5#define MX35_IRAM_SIZE SZ_128K 5#define MX35_IRAM_SIZE SZ_128K
6 6
7#define MXC_FEC_BASE_ADDR 0x50038000 7#define MX35_L2CC_BASE_ADDR 0x30000000
8#define MX35_OTG_BASE_ADDR 0x53ff4000 8#define MX35_L2CC_SIZE SZ_1M
9#define MX35_NFC_BASE_ADDR 0xBB000000 9
10#define MX35_AIPS1_BASE_ADDR 0x43f00000
11#define MX35_AIPS1_BASE_ADDR_VIRT 0xfc000000
12#define MX35_AIPS1_SIZE SZ_1M
13#define MX35_MAX_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x04000)
14#define MX35_EVTMON_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x08000)
15#define MX35_CLKCTL_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x0c000)
16#define MX35_ETB_SLOT4_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x10000)
17#define MX35_ETB_SLOT5_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x14000)
18#define MX35_ECT_CTIO_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x18000)
19#define MX35_I2C_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x80000)
20#define MX35_I2C3_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x84000)
21#define MX35_UART1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x90000)
22#define MX35_UART2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x94000)
23#define MX35_I2C2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x98000)
24#define MX35_OWIRE_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0x9c000)
25#define MX35_SSI1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa0000)
26#define MX35_CSPI1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa4000)
27#define MX35_KPP_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xa8000)
28#define MX35_IOMUXC_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xac000)
29#define MX35_ECT_IP1_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xb8000)
30#define MX35_ECT_IP2_BASE_ADDR (MX35_AIPS1_BASE_ADDR + 0xbc000)
31
32#define MX35_SPBA0_BASE_ADDR 0x50000000
33#define MX35_SPBA0_BASE_ADDR_VIRT 0xfc100000
34#define MX35_SPBA0_SIZE SZ_1M
35#define MX35_UART3_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x0c000)
36#define MX35_CSPI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x10000)
37#define MX35_SSI2_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x14000)
38#define MX35_ATA_DMA_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x20000)
39#define MX35_MSHC1_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x24000)
40#define MX35_FEC_BASE_ADDR 0x50038000
41#define MX35_SPBA_CTRL_BASE_ADDR (MX35_SPBA0_BASE_ADDR + 0x3c000)
42
43#define MX35_AIPS2_BASE_ADDR 0x53f00000
44#define MX35_AIPS2_BASE_ADDR_VIRT 0xfc200000
45#define MX35_AIPS2_SIZE SZ_1M
46#define MX35_CCM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x80000)
47#define MX35_GPT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x90000)
48#define MX35_EPIT1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x94000)
49#define MX35_EPIT2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0x98000)
50#define MX35_GPIO3_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xa4000)
51#define MX35_SCC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xac000)
52#define MX35_RNGA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xb0000)
53#define MX35_IPU_CTRL_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc0000)
54#define MX35_AUDMUX_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xc4000)
55#define MX35_GPIO1_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xcc000)
56#define MX35_GPIO2_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd0000)
57#define MX35_SDMA_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd4000)
58#define MX35_RTC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xd8000)
59#define MX35_WDOG_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xdc000)
60#define MX35_PWM_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xe0000)
61#define MX35_RTIC_BASE_ADDR (MX35_AIPS2_BASE_ADDR + 0xec000)
62#define MX35_OTG_BASE_ADDR 0x53ff4000
63
64#define MX35_ROMP_BASE_ADDR 0x60000000
65#define MX35_ROMP_BASE_ADDR_VIRT 0xfc500000
66#define MX35_ROMP_SIZE SZ_1M
67
68#define MX35_AVIC_BASE_ADDR 0x68000000
69#define MX35_AVIC_BASE_ADDR_VIRT 0xfc400000
70#define MX35_AVIC_SIZE SZ_1M
71
72/*
73 * Memory regions and CS
74 */
75#define MX35_IPU_MEM_BASE_ADDR 0x70000000
76#define MX35_CSD0_BASE_ADDR 0x80000000
77#define MX35_CSD1_BASE_ADDR 0x90000000
78
79#define MX35_CS0_BASE_ADDR 0xa0000000
80#define MX35_CS1_BASE_ADDR 0xa8000000
81#define MX35_CS2_BASE_ADDR 0xb0000000
82#define MX35_CS3_BASE_ADDR 0xb2000000
83
84#define MX35_CS4_BASE_ADDR 0xb4000000
85#define MX35_CS4_BASE_ADDR_VIRT 0xf4000000
86#define MX35_CS4_SIZE SZ_32M
87
88#define MX35_CS5_BASE_ADDR 0xb6000000
89#define MX35_CS5_BASE_ADDR_VIRT 0xf6000000
90#define MX35_CS5_SIZE SZ_32M
91
92/*
93 * NAND, SDRAM, WEIM, M3IF, EMI controllers
94 */
95#define MX35_X_MEMC_BASE_ADDR 0xb8000000
96#define MX35_X_MEMC_BASE_ADDR_VIRT 0xfc320000
97#define MX35_X_MEMC_SIZE SZ_64K
98#define MX35_ESDCTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x1000)
99#define MX35_WEIM_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x2000)
100#define MX35_M3IF_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x3000)
101#define MX35_EMI_CTL_BASE_ADDR (MX35_X_MEMC_BASE_ADDR + 0x4000)
102#define MX35_PCMCIA_CTL_BASE_ADDR MX35_EMI_CTL_BASE_ADDR
103
104#define MX35_NFC_BASE_ADDR 0xbb000000
105#define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000
10 106
11/* 107/*
12 * Interrupt numbers 108 * Interrupt numbers
13 */ 109 */
14#define MXC_INT_OWIRE 2 110#define MX35_INT_OWIRE 2
111#define MX35_INT_I2C3 3
112#define MX35_INT_I2C2 4
113#define MX35_INT_RTIC 6
15#define MX35_INT_MMC_SDHC1 7 114#define MX35_INT_MMC_SDHC1 7
16#define MXC_INT_MMC_SDHC2 8 115#define MX35_INT_MMC_SDHC2 8
17#define MXC_INT_MMC_SDHC3 9 116#define MX35_INT_MMC_SDHC3 9
117#define MX35_INT_I2C 10
18#define MX35_INT_SSI1 11 118#define MX35_INT_SSI1 11
19#define MX35_INT_SSI2 12 119#define MX35_INT_SSI2 12
20#define MXC_INT_GPU2D 16 120#define MX35_INT_CSPI2 13
21#define MXC_INT_ASRC 17 121#define MX35_INT_CSPI1 14
22#define MXC_INT_USBHS 35 122#define MX35_INT_ATA 15
23#define MXC_INT_USBOTG 37 123#define MX35_INT_GPU2D 16
24#define MXC_INT_ESAI 40 124#define MX35_INT_ASRC 17
25#define MXC_INT_CAN1 43 125#define MX35_INT_UART3 18
26#define MXC_INT_CAN2 44 126#define MX35_INT_IIM 19
27#define MXC_INT_MLB 46 127#define MX35_INT_RNGA 22
28#define MXC_INT_SPDIF 47 128#define MX35_INT_EVTMON 23
29#define MXC_INT_FEC 57 129#define MX35_INT_KPP 24
130#define MX35_INT_RTC 25
131#define MX35_INT_PWM 26
132#define MX35_INT_EPIT2 27
133#define MX35_INT_EPIT1 28
134#define MX35_INT_GPT 29
135#define MX35_INT_POWER_FAIL 30
136#define MX35_INT_UART2 32
137#define MX35_INT_NANDFC 33
138#define MX35_INT_SDMA 34
139#define MX35_INT_USBHS 35
140#define MX35_INT_USBOTG 37
141#define MX35_INT_MSHC1 39
142#define MX35_INT_ESAI 40
143#define MX35_INT_IPU_ERR 41
144#define MX35_INT_IPU_SYN 42
145#define MX35_INT_CAN1 43
146#define MX35_INT_CAN2 44
147#define MX35_INT_UART1 45
148#define MX35_INT_MLB 46
149#define MX35_INT_SPDIF 47
150#define MX35_INT_ECT 48
151#define MX35_INT_SCC_SCM 49
152#define MX35_INT_SCC_SMN 50
153#define MX35_INT_GPIO2 51
154#define MX35_INT_GPIO1 52
155#define MX35_INT_WDOG 55
156#define MX35_INT_GPIO3 56
157#define MX35_INT_FEC 57
158#define MX35_INT_EXT_POWER 58
159#define MX35_INT_EXT_TEMPER 59
160#define MX35_INT_EXT_SENSOR60 60
161#define MX35_INT_EXT_SENSOR61 61
162#define MX35_INT_EXT_WDOG 62
163#define MX35_INT_EXT_TV 63
164
165#define MX35_PROD_SIGNATURE 0x1 /* For MX31 */
166
167/* silicon revisions specific to i.MX31 */
168#define MX35_CHIP_REV_1_0 0x10
169#define MX35_CHIP_REV_1_1 0x11
170#define MX35_CHIP_REV_1_2 0x12
171#define MX35_CHIP_REV_1_3 0x13
172#define MX35_CHIP_REV_2_0 0x20
173#define MX35_CHIP_REV_2_1 0x21
174#define MX35_CHIP_REV_2_2 0x22
175#define MX35_CHIP_REV_2_3 0x23
176#define MX35_CHIP_REV_3_0 0x30
177#define MX35_CHIP_REV_3_1 0x31
178#define MX35_CHIP_REV_3_2 0x32
179
180#define MX35_SYSTEM_REV_MIN MX35_CHIP_REV_1_0
181#define MX35_SYSTEM_REV_NUM 3
30 182
183/* these should go away */
184#define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR
185#define MXC_INT_OWIRE MX35_INT_OWIRE
186#define MXC_INT_MMC_SDHC2 MX35_INT_MMC_SDHC2
187#define MXC_INT_MMC_SDHC3 MX35_INT_MMC_SDHC3
188#define MXC_INT_GPU2D MX35_INT_GPU2D
189#define MXC_INT_ASRC MX35_INT_ASRC
190#define MXC_INT_USBHS MX35_INT_USBHS
191#define MXC_INT_USBOTG MX35_INT_USBOTG
192#define MXC_INT_ESAI MX35_INT_ESAI
193#define MXC_INT_CAN1 MX35_INT_CAN1
194#define MXC_INT_CAN2 MX35_INT_CAN2
195#define MXC_INT_MLB MX35_INT_MLB
196#define MXC_INT_SPDIF MX35_INT_SPDIF
197#define MXC_INT_FEC MX35_INT_FEC
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index 009f4440276b..be69272407ad 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -34,120 +34,117 @@
34 * C0000000 64M PCMCIA/CF 34 * C0000000 64M PCMCIA/CF
35 */ 35 */
36 36
37#define CS0_BASE_ADDR 0xA0000000
38#define CS1_BASE_ADDR 0xA8000000
39#define CS2_BASE_ADDR 0xB0000000
40#define CS3_BASE_ADDR 0xB2000000
41
42#define CS4_BASE_ADDR 0xB4000000
43#define CS4_BASE_ADDR_VIRT 0xF4000000
44#define CS4_SIZE SZ_32M
45
46#define CS5_BASE_ADDR 0xB6000000
47#define CS5_BASE_ADDR_VIRT 0xF6000000
48#define CS5_SIZE SZ_32M
49
50#define PCMCIA_MEM_BASE_ADDR 0xBC000000
51
52/* 37/*
53 * L2CC 38 * L2CC
54 */ 39 */
55#define L2CC_BASE_ADDR 0x30000000 40#define MX3x_L2CC_BASE_ADDR 0x30000000
56#define L2CC_SIZE SZ_1M 41#define MX3x_L2CC_SIZE SZ_1M
57 42
58/* 43/*
59 * AIPS 1 44 * AIPS 1
60 */ 45 */
61#define AIPS1_BASE_ADDR 0x43F00000 46#define MX3x_AIPS1_BASE_ADDR 0x43f00000
62#define AIPS1_BASE_ADDR_VIRT 0xFC000000 47#define MX3x_AIPS1_BASE_ADDR_VIRT 0xfc000000
63#define AIPS1_SIZE SZ_1M 48#define MX3x_AIPS1_SIZE SZ_1M
64 49#define MX3x_MAX_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x04000)
65#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) 50#define MX3x_EVTMON_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x08000)
66#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) 51#define MX3x_CLKCTL_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x0c000)
67#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) 52#define MX3x_ETB_SLOT4_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x10000)
68#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) 53#define MX3x_ETB_SLOT5_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x14000)
69#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) 54#define MX3x_ECT_CTIO_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x18000)
70#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000) 55#define MX3x_I2C_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x80000)
71#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000) 56#define MX3x_I2C3_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x84000)
72#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000) 57#define MX3x_UART1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x90000)
73#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) 58#define MX3x_UART2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x94000)
74#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) 59#define MX3x_I2C2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x98000)
75#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) 60#define MX3x_OWIRE_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0x9c000)
76#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) 61#define MX3x_SSI1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa0000)
77#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) 62#define MX3x_CSPI1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa4000)
78#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) 63#define MX3x_KPP_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xa8000)
79#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) 64#define MX3x_IOMUXC_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xac000)
80#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) 65#define MX3x_ECT_IP1_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xb8000)
81#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) 66#define MX3x_ECT_IP2_BASE_ADDR (MX3x_AIPS1_BASE_ADDR + 0xbc000)
82#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
83 67
84/* 68/*
85 * SPBA global module enabled #0 69 * SPBA global module enabled #0
86 */ 70 */
87#define SPBA0_BASE_ADDR 0x50000000 71#define MX3x_SPBA0_BASE_ADDR 0x50000000
88#define SPBA0_BASE_ADDR_VIRT 0xFC100000 72#define MX3x_SPBA0_BASE_ADDR_VIRT 0xfc100000
89#define SPBA0_SIZE SZ_1M 73#define MX3x_SPBA0_SIZE SZ_1M
90 74#define MX3x_UART3_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x0c000)
91#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) 75#define MX3x_CSPI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x10000)
92#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) 76#define MX3x_SSI2_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x14000)
93#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) 77#define MX3x_ATA_DMA_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x20000)
94#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) 78#define MX3x_MSHC1_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x24000)
95#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) 79#define MX3x_SPBA_CTRL_BASE_ADDR (MX3x_SPBA0_BASE_ADDR + 0x3c000)
96#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
97 80
98/* 81/*
99 * AIPS 2 82 * AIPS 2
100 */ 83 */
101#define AIPS2_BASE_ADDR 0x53F00000 84#define MX3x_AIPS2_BASE_ADDR 0x53f00000
102#define AIPS2_BASE_ADDR_VIRT 0xFC200000 85#define MX3x_AIPS2_BASE_ADDR_VIRT 0xfc200000
103#define AIPS2_SIZE SZ_1M 86#define MX3x_AIPS2_SIZE SZ_1M
104#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) 87#define MX3x_CCM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x80000)
105#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) 88#define MX3x_GPT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x90000)
106#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) 89#define MX3x_EPIT1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x94000)
107#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) 90#define MX3x_EPIT2_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0x98000)
108#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) 91#define MX3x_GPIO3_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xa4000)
109#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) 92#define MX3x_SCC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xac000)
110#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) 93#define MX3x_RNGA_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xb0000)
111#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) 94#define MX3x_IPU_CTRL_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xc0000)
112#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000) 95#define MX3x_AUDMUX_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xc4000)
113#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) 96#define MX3x_GPIO1_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xcc000)
114#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) 97#define MX3x_GPIO2_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd0000)
115#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) 98#define MX3x_SDMA_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd4000)
116#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000) 99#define MX3x_RTC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xd8000)
117#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) 100#define MX3x_WDOG_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xdc000)
118#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) 101#define MX3x_PWM_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xe0000)
119#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000) 102#define MX3x_RTIC_BASE_ADDR (MX3x_AIPS2_BASE_ADDR + 0xec000)
120 103
121/* 104/*
122 * ROMP and AVIC 105 * ROMP and AVIC
123 */ 106 */
124#define ROMP_BASE_ADDR 0x60000000 107#define MX3x_ROMP_BASE_ADDR 0x60000000
125#define ROMP_BASE_ADDR_VIRT 0xFC500000 108#define MX3x_ROMP_BASE_ADDR_VIRT 0xfc500000
126#define ROMP_SIZE SZ_1M 109#define MX3x_ROMP_SIZE SZ_1M
127 110
128#define AVIC_BASE_ADDR 0x68000000 111#define MX3x_AVIC_BASE_ADDR 0x68000000
129#define AVIC_BASE_ADDR_VIRT 0xFC400000 112#define MX3x_AVIC_BASE_ADDR_VIRT 0xfc400000
130#define AVIC_SIZE SZ_1M 113#define MX3x_AVIC_SIZE SZ_1M
131 114
132/* 115/*
133 * NAND, SDRAM, WEIM, M3IF, EMI controllers 116 * Memory regions and CS
134 */ 117 */
135#define X_MEMC_BASE_ADDR 0xB8000000 118#define MX3x_IPU_MEM_BASE_ADDR 0x70000000
136#define X_MEMC_BASE_ADDR_VIRT 0xFC320000 119#define MX3x_CSD0_BASE_ADDR 0x80000000
137#define X_MEMC_SIZE SZ_64K 120#define MX3x_CSD1_BASE_ADDR 0x90000000
138 121
139#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) 122#define MX3x_CS0_BASE_ADDR 0xa0000000
140#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) 123#define MX3x_CS1_BASE_ADDR 0xa8000000
141#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) 124#define MX3x_CS2_BASE_ADDR 0xb0000000
142#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) 125#define MX3x_CS3_BASE_ADDR 0xb2000000
143#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR 126
127#define MX3x_CS4_BASE_ADDR 0xb4000000
128#define MX3x_CS4_BASE_ADDR_VIRT 0xf4000000
129#define MX3x_CS4_SIZE SZ_32M
130
131#define MX3x_CS5_BASE_ADDR 0xb6000000
132#define MX3x_CS5_BASE_ADDR_VIRT 0xf6000000
133#define MX3x_CS5_SIZE SZ_32M
144 134
145/* 135/*
146 * Memory regions and CS 136 * NAND, SDRAM, WEIM, M3IF, EMI controllers
147 */ 137 */
148#define IPU_MEM_BASE_ADDR 0x70000000 138#define MX3x_X_MEMC_BASE_ADDR 0xb8000000
149#define CSD0_BASE_ADDR 0x80000000 139#define MX3x_X_MEMC_BASE_ADDR_VIRT 0xfc320000
150#define CSD1_BASE_ADDR 0x90000000 140#define MX3x_X_MEMC_SIZE SZ_64K
141#define MX3x_ESDCTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x1000)
142#define MX3x_WEIM_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x2000)
143#define MX3x_M3IF_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x3000)
144#define MX3x_EMI_CTL_BASE_ADDR (MX3x_X_MEMC_BASE_ADDR + 0x4000)
145#define MX3x_PCMCIA_CTL_BASE_ADDR MX3x_EMI_CTL_BASE_ADDR
146
147#define MX3x_PCMCIA_MEM_BASE_ADDR 0xbc000000
151 148
152/*! 149/*!
153 * This macro defines the physical to virtual address mapping for all the 150 * This macro defines the physical to virtual address mapping for all the
@@ -202,74 +199,207 @@
202/* 199/*
203 * Interrupt numbers 200 * Interrupt numbers
204 */ 201 */
205#define MXC_INT_I2C3 3 202#define MX3x_INT_I2C3 3
206#define MXC_INT_I2C2 4 203#define MX3x_INT_I2C2 4
207#define MXC_INT_RTIC 6 204#define MX3x_INT_RTIC 6
208#define MXC_INT_I2C 10 205#define MX3x_INT_I2C 10
209#define MXC_INT_CSPI2 13 206#define MX3x_INT_CSPI2 13
210#define MXC_INT_CSPI1 14 207#define MX3x_INT_CSPI1 14
211#define MXC_INT_ATA 15 208#define MX3x_INT_ATA 15
212#define MXC_INT_UART3 18 209#define MX3x_INT_UART3 18
213#define MXC_INT_IIM 19 210#define MX3x_INT_IIM 19
214#define MXC_INT_RNGA 22 211#define MX3x_INT_RNGA 22
215#define MXC_INT_EVTMON 23 212#define MX3x_INT_EVTMON 23
216#define MXC_INT_KPP 24 213#define MX3x_INT_KPP 24
217#define MXC_INT_RTC 25 214#define MX3x_INT_RTC 25
218#define MXC_INT_PWM 26 215#define MX3x_INT_PWM 26
219#define MXC_INT_EPIT2 27 216#define MX3x_INT_EPIT2 27
220#define MXC_INT_EPIT1 28 217#define MX3x_INT_EPIT1 28
221#define MXC_INT_GPT 29 218#define MX3x_INT_GPT 29
222#define MXC_INT_POWER_FAIL 30 219#define MX3x_INT_POWER_FAIL 30
223#define MXC_INT_UART2 32 220#define MX3x_INT_UART2 32
224#define MXC_INT_NANDFC 33 221#define MX3x_INT_NANDFC 33
225#define MXC_INT_SDMA 34 222#define MX3x_INT_SDMA 34
226#define MXC_INT_MSHC1 39 223#define MX3x_INT_MSHC1 39
227#define MXC_INT_IPU_ERR 41 224#define MX3x_INT_IPU_ERR 41
228#define MXC_INT_IPU_SYN 42 225#define MX3x_INT_IPU_SYN 42
229#define MXC_INT_UART1 45 226#define MX3x_INT_UART1 45
230#define MXC_INT_ECT 48 227#define MX3x_INT_ECT 48
231#define MXC_INT_SCC_SCM 49 228#define MX3x_INT_SCC_SCM 49
232#define MXC_INT_SCC_SMN 50 229#define MX3x_INT_SCC_SMN 50
233#define MXC_INT_GPIO2 51 230#define MX3x_INT_GPIO2 51
234#define MXC_INT_GPIO1 52 231#define MX3x_INT_GPIO1 52
235#define MXC_INT_WDOG 55 232#define MX3x_INT_WDOG 55
236#define MXC_INT_GPIO3 56 233#define MX3x_INT_GPIO3 56
237#define MXC_INT_EXT_POWER 58 234#define MX3x_INT_EXT_POWER 58
238#define MXC_INT_EXT_TEMPER 59 235#define MX3x_INT_EXT_TEMPER 59
239#define MXC_INT_EXT_SENSOR60 60 236#define MX3x_INT_EXT_SENSOR60 60
240#define MXC_INT_EXT_SENSOR61 61 237#define MX3x_INT_EXT_SENSOR61 61
241#define MXC_INT_EXT_WDOG 62 238#define MX3x_INT_EXT_WDOG 62
242#define MXC_INT_EXT_TV 63 239#define MX3x_INT_EXT_TV 63
243 240
244#define PROD_SIGNATURE 0x1 /* For MX31 */ 241#define MX3x_PROD_SIGNATURE 0x1 /* For MX31 */
245 242
246/* silicon revisions specific to i.MX31 */ 243/* silicon revisions specific to i.MX31 */
247#define CHIP_REV_1_0 0x10 244#define MX3x_CHIP_REV_1_0 0x10
248#define CHIP_REV_1_1 0x11 245#define MX3x_CHIP_REV_1_1 0x11
249#define CHIP_REV_1_2 0x12 246#define MX3x_CHIP_REV_1_2 0x12
250#define CHIP_REV_1_3 0x13 247#define MX3x_CHIP_REV_1_3 0x13
251#define CHIP_REV_2_0 0x20 248#define MX3x_CHIP_REV_2_0 0x20
252#define CHIP_REV_2_1 0x21 249#define MX3x_CHIP_REV_2_1 0x21
253#define CHIP_REV_2_2 0x22 250#define MX3x_CHIP_REV_2_2 0x22
254#define CHIP_REV_2_3 0x23 251#define MX3x_CHIP_REV_2_3 0x23
255#define CHIP_REV_3_0 0x30 252#define MX3x_CHIP_REV_3_0 0x30
256#define CHIP_REV_3_1 0x31 253#define MX3x_CHIP_REV_3_1 0x31
257#define CHIP_REV_3_2 0x32 254#define MX3x_CHIP_REV_3_2 0x32
258 255
259#define SYSTEM_REV_MIN CHIP_REV_1_0 256#define MX3x_SYSTEM_REV_MIN MX3x_CHIP_REV_1_0
260#define SYSTEM_REV_NUM 3 257#define MX3x_SYSTEM_REV_NUM 3
261 258
262/* Mandatory defines used globally */ 259/* Mandatory defines used globally */
263 260
264#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) 261#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
265 262
266extern unsigned int system_rev; 263extern unsigned int mx31_cpu_rev;
264extern void mx31_read_cpu_rev(void);
267 265
268static inline int mx31_revision(void) 266static inline int mx31_revision(void)
269{ 267{
270 return system_rev; 268 return mx31_cpu_rev;
271} 269}
272#endif 270#endif
273 271
274#endif /* __ASM_ARCH_MXC_MX31_H__ */ 272/* these should go away */
273#define L2CC_BASE_ADDR MX3x_L2CC_BASE_ADDR
274#define L2CC_SIZE MX3x_L2CC_SIZE
275#define AIPS1_BASE_ADDR MX3x_AIPS1_BASE_ADDR
276#define AIPS1_BASE_ADDR_VIRT MX3x_AIPS1_BASE_ADDR_VIRT
277#define AIPS1_SIZE MX3x_AIPS1_SIZE
278#define MAX_BASE_ADDR MX3x_MAX_BASE_ADDR
279#define EVTMON_BASE_ADDR MX3x_EVTMON_BASE_ADDR
280#define CLKCTL_BASE_ADDR MX3x_CLKCTL_BASE_ADDR
281#define ETB_SLOT4_BASE_ADDR MX3x_ETB_SLOT4_BASE_ADDR
282#define ETB_SLOT5_BASE_ADDR MX3x_ETB_SLOT5_BASE_ADDR
283#define ECT_CTIO_BASE_ADDR MX3x_ECT_CTIO_BASE_ADDR
284#define I2C_BASE_ADDR MX3x_I2C_BASE_ADDR
285#define I2C3_BASE_ADDR MX3x_I2C3_BASE_ADDR
286#define UART1_BASE_ADDR MX3x_UART1_BASE_ADDR
287#define UART2_BASE_ADDR MX3x_UART2_BASE_ADDR
288#define I2C2_BASE_ADDR MX3x_I2C2_BASE_ADDR
289#define OWIRE_BASE_ADDR MX3x_OWIRE_BASE_ADDR
290#define SSI1_BASE_ADDR MX3x_SSI1_BASE_ADDR
291#define CSPI1_BASE_ADDR MX3x_CSPI1_BASE_ADDR
292#define KPP_BASE_ADDR MX3x_KPP_BASE_ADDR
293#define IOMUXC_BASE_ADDR MX3x_IOMUXC_BASE_ADDR
294#define ECT_IP1_BASE_ADDR MX3x_ECT_IP1_BASE_ADDR
295#define ECT_IP2_BASE_ADDR MX3x_ECT_IP2_BASE_ADDR
296#define SPBA0_BASE_ADDR MX3x_SPBA0_BASE_ADDR
297#define SPBA0_BASE_ADDR_VIRT MX3x_SPBA0_BASE_ADDR_VIRT
298#define SPBA0_SIZE MX3x_SPBA0_SIZE
299#define UART3_BASE_ADDR MX3x_UART3_BASE_ADDR
300#define CSPI2_BASE_ADDR MX3x_CSPI2_BASE_ADDR
301#define SSI2_BASE_ADDR MX3x_SSI2_BASE_ADDR
302#define ATA_DMA_BASE_ADDR MX3x_ATA_DMA_BASE_ADDR
303#define MSHC1_BASE_ADDR MX3x_MSHC1_BASE_ADDR
304#define SPBA_CTRL_BASE_ADDR MX3x_SPBA_CTRL_BASE_ADDR
305#define AIPS2_BASE_ADDR MX3x_AIPS2_BASE_ADDR
306#define AIPS2_BASE_ADDR_VIRT MX3x_AIPS2_BASE_ADDR_VIRT
307#define AIPS2_SIZE MX3x_AIPS2_SIZE
308#define CCM_BASE_ADDR MX3x_CCM_BASE_ADDR
309#define GPT1_BASE_ADDR MX3x_GPT1_BASE_ADDR
310#define EPIT1_BASE_ADDR MX3x_EPIT1_BASE_ADDR
311#define EPIT2_BASE_ADDR MX3x_EPIT2_BASE_ADDR
312#define GPIO3_BASE_ADDR MX3x_GPIO3_BASE_ADDR
313#define SCC_BASE_ADDR MX3x_SCC_BASE_ADDR
314#define RNGA_BASE_ADDR MX3x_RNGA_BASE_ADDR
315#define IPU_CTRL_BASE_ADDR MX3x_IPU_CTRL_BASE_ADDR
316#define AUDMUX_BASE_ADDR MX3x_AUDMUX_BASE_ADDR
317#define GPIO1_BASE_ADDR MX3x_GPIO1_BASE_ADDR
318#define GPIO2_BASE_ADDR MX3x_GPIO2_BASE_ADDR
319#define SDMA_BASE_ADDR MX3x_SDMA_BASE_ADDR
320#define RTC_BASE_ADDR MX3x_RTC_BASE_ADDR
321#define WDOG_BASE_ADDR MX3x_WDOG_BASE_ADDR
322#define PWM_BASE_ADDR MX3x_PWM_BASE_ADDR
323#define RTIC_BASE_ADDR MX3x_RTIC_BASE_ADDR
324#define ROMP_BASE_ADDR MX3x_ROMP_BASE_ADDR
325#define ROMP_BASE_ADDR_VIRT MX3x_ROMP_BASE_ADDR_VIRT
326#define ROMP_SIZE MX3x_ROMP_SIZE
327#define AVIC_BASE_ADDR MX3x_AVIC_BASE_ADDR
328#define AVIC_BASE_ADDR_VIRT MX3x_AVIC_BASE_ADDR_VIRT
329#define AVIC_SIZE MX3x_AVIC_SIZE
330#define IPU_MEM_BASE_ADDR MX3x_IPU_MEM_BASE_ADDR
331#define CSD0_BASE_ADDR MX3x_CSD0_BASE_ADDR
332#define CSD1_BASE_ADDR MX3x_CSD1_BASE_ADDR
333#define CS0_BASE_ADDR MX3x_CS0_BASE_ADDR
334#define CS1_BASE_ADDR MX3x_CS1_BASE_ADDR
335#define CS2_BASE_ADDR MX3x_CS2_BASE_ADDR
336#define CS3_BASE_ADDR MX3x_CS3_BASE_ADDR
337#define CS4_BASE_ADDR MX3x_CS4_BASE_ADDR
338#define CS4_BASE_ADDR_VIRT MX3x_CS4_BASE_ADDR_VIRT
339#define CS4_SIZE MX3x_CS4_SIZE
340#define CS5_BASE_ADDR MX3x_CS5_BASE_ADDR
341#define CS5_BASE_ADDR_VIRT MX3x_CS5_BASE_ADDR_VIRT
342#define CS5_SIZE MX3x_CS5_SIZE
343#define X_MEMC_BASE_ADDR MX3x_X_MEMC_BASE_ADDR
344#define X_MEMC_BASE_ADDR_VIRT MX3x_X_MEMC_BASE_ADDR_VIRT
345#define X_MEMC_SIZE MX3x_X_MEMC_SIZE
346#define ESDCTL_BASE_ADDR MX3x_ESDCTL_BASE_ADDR
347#define WEIM_BASE_ADDR MX3x_WEIM_BASE_ADDR
348#define M3IF_BASE_ADDR MX3x_M3IF_BASE_ADDR
349#define EMI_CTL_BASE_ADDR MX3x_EMI_CTL_BASE_ADDR
350#define PCMCIA_CTL_BASE_ADDR MX3x_PCMCIA_CTL_BASE_ADDR
351#define PCMCIA_MEM_BASE_ADDR MX3x_PCMCIA_MEM_BASE_ADDR
352#define MXC_INT_I2C3 MX3x_INT_I2C3
353#define MXC_INT_I2C2 MX3x_INT_I2C2
354#define MXC_INT_RTIC MX3x_INT_RTIC
355#define MXC_INT_I2C MX3x_INT_I2C
356#define MXC_INT_CSPI2 MX3x_INT_CSPI2
357#define MXC_INT_CSPI1 MX3x_INT_CSPI1
358#define MXC_INT_ATA MX3x_INT_ATA
359#define MXC_INT_UART3 MX3x_INT_UART3
360#define MXC_INT_IIM MX3x_INT_IIM
361#define MXC_INT_RNGA MX3x_INT_RNGA
362#define MXC_INT_EVTMON MX3x_INT_EVTMON
363#define MXC_INT_KPP MX3x_INT_KPP
364#define MXC_INT_RTC MX3x_INT_RTC
365#define MXC_INT_PWM MX3x_INT_PWM
366#define MXC_INT_EPIT2 MX3x_INT_EPIT2
367#define MXC_INT_EPIT1 MX3x_INT_EPIT1
368#define MXC_INT_GPT MX3x_INT_GPT
369#define MXC_INT_POWER_FAIL MX3x_INT_POWER_FAIL
370#define MXC_INT_UART2 MX3x_INT_UART2
371#define MXC_INT_NANDFC MX3x_INT_NANDFC
372#define MXC_INT_SDMA MX3x_INT_SDMA
373#define MXC_INT_MSHC1 MX3x_INT_MSHC1
374#define MXC_INT_IPU_ERR MX3x_INT_IPU_ERR
375#define MXC_INT_IPU_SYN MX3x_INT_IPU_SYN
376#define MXC_INT_UART1 MX3x_INT_UART1
377#define MXC_INT_ECT MX3x_INT_ECT
378#define MXC_INT_SCC_SCM MX3x_INT_SCC_SCM
379#define MXC_INT_SCC_SMN MX3x_INT_SCC_SMN
380#define MXC_INT_GPIO2 MX3x_INT_GPIO2
381#define MXC_INT_GPIO1 MX3x_INT_GPIO1
382#define MXC_INT_WDOG MX3x_INT_WDOG
383#define MXC_INT_GPIO3 MX3x_INT_GPIO3
384#define MXC_INT_EXT_POWER MX3x_INT_EXT_POWER
385#define MXC_INT_EXT_TEMPER MX3x_INT_EXT_TEMPER
386#define MXC_INT_EXT_SENSOR60 MX3x_INT_EXT_SENSOR60
387#define MXC_INT_EXT_SENSOR61 MX3x_INT_EXT_SENSOR61
388#define MXC_INT_EXT_WDOG MX3x_INT_EXT_WDOG
389#define MXC_INT_EXT_TV MX3x_INT_EXT_TV
390#define PROD_SIGNATURE MX3x_PROD_SIGNATURE
391#define CHIP_REV_1_0 MX3x_CHIP_REV_1_0
392#define CHIP_REV_1_1 MX3x_CHIP_REV_1_1
393#define CHIP_REV_1_2 MX3x_CHIP_REV_1_2
394#define CHIP_REV_1_3 MX3x_CHIP_REV_1_3
395#define CHIP_REV_2_0 MX3x_CHIP_REV_2_0
396#define CHIP_REV_2_1 MX3x_CHIP_REV_2_1
397#define CHIP_REV_2_2 MX3x_CHIP_REV_2_2
398#define CHIP_REV_2_3 MX3x_CHIP_REV_2_3
399#define CHIP_REV_3_0 MX3x_CHIP_REV_3_0
400#define CHIP_REV_3_1 MX3x_CHIP_REV_3_1
401#define CHIP_REV_3_2 MX3x_CHIP_REV_3_2
402#define SYSTEM_REV_MIN MX3x_SYSTEM_REV_MIN
403#define SYSTEM_REV_NUM MX3x_SYSTEM_REV_NUM
275 404
405#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h
new file mode 100644
index 000000000000..96b6ab4c40c3
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/ulpi.h
@@ -0,0 +1,7 @@
1#ifndef __MACH_ULPI_H
2#define __MACH_ULPI_H
3
4extern struct otg_io_access_ops mxc_ulpi_access_ops;
5
6#endif /* __MACH_ULPI_H */
7
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 082a3908256b..a41bf57fb3de 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -83,6 +83,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
83 case MACH_TYPE_MX27ADS: 83 case MACH_TYPE_MX27ADS:
84 case MACH_TYPE_PCM038: 84 case MACH_TYPE_PCM038:
85 case MACH_TYPE_MX21ADS: 85 case MACH_TYPE_MX21ADS:
86 case MACH_TYPE_PCA100:
86 uart_base = MX2X_UART1_BASE_ADDR; 87 uart_base = MX2X_UART1_BASE_ADDR;
87 break; 88 break;
88 case MACH_TYPE_MX31LITE: 89 case MACH_TYPE_MX31LITE:
@@ -94,6 +95,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
94 case MACH_TYPE_MX31ADS: 95 case MACH_TYPE_MX31ADS:
95 case MACH_TYPE_MX35_3DS: 96 case MACH_TYPE_MX35_3DS:
96 case MACH_TYPE_PCM043: 97 case MACH_TYPE_PCM043:
98 case MACH_TYPE_LILLY1131:
97 uart_base = MX3X_UART1_BASE_ADDR; 99 uart_base = MX3X_UART1_BASE_ADDR;
98 break; 100 break;
99 case MACH_TYPE_MAGX_ZN5: 101 case MACH_TYPE_MAGX_ZN5:
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
index 851ca99bf1b1..b318c6a222d5 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -31,19 +31,11 @@
31 31
32static void __iomem *base; 32static void __iomem *base;
33 33
34static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG];
35
36/* 34/*
37 * setups a single pin: 35 * setups a single pad in the iomuxer
38 * - reserves the pin so that it is not claimed by another driver
39 * - setups the iomux according to the configuration
40 */ 36 */
41int mxc_iomux_v3_setup_pad(struct pad_desc *pad) 37int mxc_iomux_v3_setup_pad(struct pad_desc *pad)
42{ 38{
43 unsigned int pad_ofs = pad->pad_ctrl_ofs;
44
45 if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map))
46 return -EBUSY;
47 if (pad->mux_ctrl_ofs) 39 if (pad->mux_ctrl_ofs)
48 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs); 40 __raw_writel(pad->mux_mode, base + pad->mux_ctrl_ofs);
49 41
@@ -66,37 +58,13 @@ int mxc_iomux_v3_setup_multiple_pads(struct pad_desc *pad_list, unsigned count)
66 for (i = 0; i < count; i++) { 58 for (i = 0; i < count; i++) {
67 ret = mxc_iomux_v3_setup_pad(p); 59 ret = mxc_iomux_v3_setup_pad(p);
68 if (ret) 60 if (ret)
69 goto setup_error; 61 return ret;
70 p++; 62 p++;
71 } 63 }
72 return 0; 64 return 0;
73
74setup_error:
75 mxc_iomux_v3_release_multiple_pads(pad_list, i);
76 return ret;
77} 65}
78EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads); 66EXPORT_SYMBOL(mxc_iomux_v3_setup_multiple_pads);
79 67
80void mxc_iomux_v3_release_pad(struct pad_desc *pad)
81{
82 unsigned int pad_ofs = pad->pad_ctrl_ofs;
83
84 clear_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map);
85}
86EXPORT_SYMBOL(mxc_iomux_v3_release_pad);
87
88void mxc_iomux_v3_release_multiple_pads(struct pad_desc *pad_list, int count)
89{
90 struct pad_desc *p = pad_list;
91 int i;
92
93 for (i = 0; i < count; i++) {
94 mxc_iomux_v3_release_pad(p);
95 p++;
96 }
97}
98EXPORT_SYMBOL(mxc_iomux_v3_release_multiple_pads);
99
100void mxc_iomux_v3_init(void __iomem *iomux_v3_base) 68void mxc_iomux_v3_init(void __iomem *iomux_v3_base)
101{ 69{
102 base = iomux_v3_base; 70 base = iomux_v3_base;
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c
new file mode 100644
index 000000000000..582c6dfaba4a
--- /dev/null
+++ b/arch/arm/plat-mxc/ulpi.c
@@ -0,0 +1,113 @@
1/*
2 * Copyright 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
3 * Copyright 2009 Daniel Mack <daniel@caiaq.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/io.h>
23#include <linux/delay.h>
24#include <linux/usb/otg.h>
25
26#include <mach/ulpi.h>
27
28/* ULPIVIEW register bits */
29#define ULPIVW_WU (1 << 31) /* Wakeup */
30#define ULPIVW_RUN (1 << 30) /* read/write run */
31#define ULPIVW_WRITE (1 << 29) /* 0 = read 1 = write */
32#define ULPIVW_SS (1 << 27) /* SyncState */
33#define ULPIVW_PORT_MASK 0x07 /* Port field */
34#define ULPIVW_PORT_SHIFT 24
35#define ULPIVW_ADDR_MASK 0xff /* data address field */
36#define ULPIVW_ADDR_SHIFT 16
37#define ULPIVW_RDATA_MASK 0xff /* read data field */
38#define ULPIVW_RDATA_SHIFT 8
39#define ULPIVW_WDATA_MASK 0xff /* write data field */
40#define ULPIVW_WDATA_SHIFT 0
41
42static int ulpi_poll(void __iomem *view, u32 bit)
43{
44 int timeout = 10000;
45
46 while (timeout--) {
47 u32 data = __raw_readl(view);
48
49 if (!(data & bit))
50 return 0;
51
52 cpu_relax();
53 };
54
55 printk(KERN_WARNING "timeout polling for ULPI device\n");
56
57 return -ETIMEDOUT;
58}
59
60static int ulpi_read(struct otg_transceiver *otg, u32 reg)
61{
62 int ret;
63 void __iomem *view = otg->io_priv;
64
65 /* make sure interface is running */
66 if (!(__raw_readl(view) & ULPIVW_SS)) {
67 __raw_writel(ULPIVW_WU, view);
68
69 /* wait for wakeup */
70 ret = ulpi_poll(view, ULPIVW_WU);
71 if (ret)
72 return ret;
73 }
74
75 /* read the register */
76 __raw_writel((ULPIVW_RUN | (reg << ULPIVW_ADDR_SHIFT)), view);
77
78 /* wait for completion */
79 ret = ulpi_poll(view, ULPIVW_RUN);
80 if (ret)
81 return ret;
82
83 return (__raw_readl(view) >> ULPIVW_RDATA_SHIFT) & ULPIVW_RDATA_MASK;
84}
85
86static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
87{
88 int ret;
89 void __iomem *view = otg->io_priv;
90
91 /* make sure the interface is running */
92 if (!(__raw_readl(view) & ULPIVW_SS)) {
93 __raw_writel(ULPIVW_WU, view);
94 /* wait for wakeup */
95 ret = ulpi_poll(view, ULPIVW_WU);
96 if (ret)
97 return ret;
98 }
99
100 __raw_writel((ULPIVW_RUN | ULPIVW_WRITE |
101 (reg << ULPIVW_ADDR_SHIFT) |
102 ((val & ULPIVW_WDATA_MASK) << ULPIVW_WDATA_SHIFT)), view);
103
104 /* wait for completion */
105 return ulpi_poll(view, ULPIVW_RUN);
106}
107
108struct otg_io_access_ops mxc_ulpi_access_ops = {
109 .read = ulpi_read,
110 .write = ulpi_write,
111};
112EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops);
113
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
index 8931c5f0e46b..e139a72c2149 100644
--- a/arch/arm/plat-s3c/Kconfig
+++ b/arch/arm/plat-s3c/Kconfig
@@ -159,6 +159,12 @@ config S3C_GPIO_CFG_S3C64XX
159 Internal configuration to enable S3C64XX style GPIO configuration 159 Internal configuration to enable S3C64XX style GPIO configuration
160 functions. 160 functions.
161 161
162config S5P_GPIO_CFG_S5PC1XX
163 bool
164 help
165 Internal configuration to enable S5PC1XX style GPIO configuration
166 functions.
167
162# DMA 168# DMA
163 169
164config S3C_DMA 170config S3C_DMA
@@ -178,6 +184,11 @@ config S3C_DEV_HSMMC1
178 help 184 help
179 Compile in platform device definitions for HSMMC channel 1 185 Compile in platform device definitions for HSMMC channel 1
180 186
187config S3C_DEV_HSMMC2
188 bool
189 help
190 Compile in platform device definitions for HSMMC channel 2
191
181config S3C_DEV_I2C1 192config S3C_DEV_I2C1
182 bool 193 bool
183 help 194 help
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 3c09109e9e84..50444da98425 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_HAVE_PWM) += pwm.o
36 36
37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o 38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
39obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
39obj-y += dev-i2c0.o 40obj-y += dev-i2c0.o
40obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 41obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
41obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 42obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-s3c/clock.c
index 4d01ef1a25dd..619cfa82dcab 100644
--- a/arch/arm/plat-s3c/clock.c
+++ b/arch/arm/plat-s3c/clock.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/clock.c 1/* linux/arch/arm/plat-s3c24xx/clock.c
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C24XX Core clock control support 6 * S3C24XX Core clock control support
@@ -337,7 +337,7 @@ int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
337 337
338int __init s3c24xx_register_baseclocks(unsigned long xtal) 338int __init s3c24xx_register_baseclocks(unsigned long xtal)
339{ 339{
340 printk(KERN_INFO "S3C24XX Clocks, (c) 2004 Simtec Electronics\n"); 340 printk(KERN_INFO "S3C24XX Clocks, Copyright 2004 Simtec Electronics\n");
341 341
342 clk_xtal.rate = xtal; 342 clk_xtal.rate = xtal;
343 343
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-s3c/dev-hsmmc2.c
new file mode 100644
index 000000000000..824580bc0e06
--- /dev/null
+++ b/arch/arm/plat-s3c/dev-hsmmc2.c
@@ -0,0 +1,69 @@
1/* linux/arch/arm/plat-s3c/dev-hsmmc2.c
2 *
3 * Copyright (c) 2009 Samsung Electronics
4 * Copyright (c) 2009 Maurus Cuelenaere
5 *
6 * Based on arch/arm/plat-s3c/dev-hsmmc1.c
7 * original file Copyright (c) 2008 Simtec Electronics
8 *
9 * S3C series device definition for hsmmc device 2
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14*/
15
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18#include <linux/mmc/host.h>
19
20#include <mach/map.h>
21#include <plat/sdhci.h>
22#include <plat/devs.h>
23
24#define S3C_SZ_HSMMC (0x1000)
25
26static struct resource s3c_hsmmc2_resource[] = {
27 [0] = {
28 .start = S3C_PA_HSMMC2,
29 .end = S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = IRQ_HSMMC2,
34 .end = IRQ_HSMMC2,
35 .flags = IORESOURCE_IRQ,
36 }
37};
38
39static u64 s3c_device_hsmmc2_dmamask = 0xffffffffUL;
40
41struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45};
46
47struct platform_device s3c_device_hsmmc2 = {
48 .name = "s3c-sdhci",
49 .id = 2,
50 .num_resources = ARRAY_SIZE(s3c_hsmmc2_resource),
51 .resource = s3c_hsmmc2_resource,
52 .dev = {
53 .dma_mask = &s3c_device_hsmmc2_dmamask,
54 .coherent_dma_mask = 0xffffffffUL,
55 .platform_data = &s3c_hsmmc2_def_platdata,
56 },
57};
58
59void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;
62
63 set->max_width = pd->max_width;
64
65 if (pd->cfg_gpio)
66 set->cfg_gpio = pd->cfg_gpio;
67 if (pd->cfg_card)
68 set->cfg_card = pd->cfg_card;
69}
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c
index 428372868fbb..4c761529b949 100644
--- a/arch/arm/plat-s3c/dev-i2c0.c
+++ b/arch/arm/plat-s3c/dev-i2c0.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dev-i2c0.c 1/* linux/arch/arm/plat-s3c/dev-i2c0.c
2 * 2 *
3 * Copyright 2008,2009 Simtec Electronics 3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-s3c/dev-i2c1.c
index 8349c462788c..d44f79110506 100644
--- a/arch/arm/plat-s3c/dev-i2c1.c
+++ b/arch/arm/plat-s3c/dev-i2c1.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dev-i2c1.c 1/* linux/arch/arm/plat-s3c/dev-i2c1.c
2 * 2 *
3 * Copyright 2008,2009 Simtec Electronics 3 * Copyright 2008-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-s3c/dev-nand.c
index 4e5323732434..e771e77dcd54 100644
--- a/arch/arm/plat-s3c/dev-nand.c
+++ b/arch/arm/plat-s3c/dev-nand.c
@@ -9,8 +9,12 @@
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11 11
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h>
14
12#include <mach/map.h> 15#include <mach/map.h>
13#include <plat/devs.h> 16#include <plat/devs.h>
17#include <plat/nand.h>
14 18
15static struct resource s3c_nand_resource[] = { 19static struct resource s3c_nand_resource[] = {
16 [0] = { 20 [0] = {
@@ -28,3 +32,96 @@ struct platform_device s3c_device_nand = {
28}; 32};
29 33
30EXPORT_SYMBOL(s3c_device_nand); 34EXPORT_SYMBOL(s3c_device_nand);
35
36/**
37 * s3c_nand_copy_set() - copy nand set data
38 * @set: The new structure, directly copied from the old.
39 *
40 * Copy all the fields from the NAND set field from what is probably __initdata
41 * to new kernel memory. The code returns 0 if the copy happened correctly or
42 * an error code for the calling function to display.
43 *
44 * Note, we currently do not try and look to see if we've already copied the
45 * data in a previous set.
46 */
47static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
48{
49 void *ptr;
50 int size;
51
52 size = sizeof(struct mtd_partition) * set->nr_partitions;
53 if (size) {
54 ptr = kmemdup(set->partitions, size, GFP_KERNEL);
55 set->partitions = ptr;
56
57 if (!ptr)
58 return -ENOMEM;
59 }
60
61 size = sizeof(int) * set->nr_chips;
62 if (size) {
63 ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
64 set->nr_map = ptr;
65
66 if (!ptr)
67 return -ENOMEM;
68 }
69
70 if (set->ecc_layout) {
71 ptr = kmemdup(set->ecc_layout,
72 sizeof(struct nand_ecclayout), GFP_KERNEL);
73 set->ecc_layout = ptr;
74
75 if (!ptr)
76 return -ENOMEM;
77 }
78
79 return 0;
80}
81
82void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
83{
84 struct s3c2410_platform_nand *npd;
85 int size;
86 int ret;
87
88 /* note, if we get a failure in allocation, we simply drop out of the
89 * function. If there is so little memory available at initialisation
90 * time then there is little chance the system is going to run.
91 */
92
93 npd = kmemdup(nand, sizeof(struct s3c2410_platform_nand), GFP_KERNEL);
94 if (!npd) {
95 printk(KERN_ERR "%s: failed copying platform data\n", __func__);
96 return;
97 }
98
99 /* now see if we need to copy any of the nand set data */
100
101 size = sizeof(struct s3c2410_nand_set) * npd->nr_sets;
102 if (size) {
103 struct s3c2410_nand_set *from = npd->sets;
104 struct s3c2410_nand_set *to;
105 int i;
106
107 to = kmemdup(from, size, GFP_KERNEL);
108 npd->sets = to; /* set, even if we failed */
109
110 if (!to) {
111 printk(KERN_ERR "%s: no memory for sets\n", __func__);
112 return;
113 }
114
115 for (i = 0; i < npd->nr_sets; i++) {
116 ret = s3c_nand_copy_set(to);
117 if (!ret) {
118 printk(KERN_ERR "%s: failed to copy set %d\n",
119 __func__, i);
120 return;
121 }
122 to++;
123 }
124 }
125}
126
127EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
diff --git a/arch/arm/plat-s3c/dma.c b/arch/arm/plat-s3c/dma.c
index c9db75c06af5..a995850cd9d5 100644
--- a/arch/arm/plat-s3c/dma.c
+++ b/arch/arm/plat-s3c/dma.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c/dma.c 1/* linux/arch/arm/plat-s3c/dma.c
2 * 2 *
3 * Copyright (c) 2003-2005,2006,2009 Simtec Electronics 3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c/include/plat/audio-simtec.h b/arch/arm/plat-s3c/include/plat/audio-simtec.h
index 0f440b9168db..53a93656d5db 100644
--- a/arch/arm/plat-s3c/include/plat/audio-simtec.h
+++ b/arch/arm/plat-s3c/include/plat/audio-simtec.h
@@ -33,5 +33,5 @@ struct s3c24xx_audio_simtec_pdata {
33 void (*startup)(void); 33 void (*startup)(void);
34}; 34};
35 35
36extern int simtec_audio_add(const char *codec_name, 36extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
37 struct s3c24xx_audio_simtec_pdata *pdata); 37 struct s3c24xx_audio_simtec_pdata *pdata);
diff --git a/arch/arm/plat-s3c/include/plat/cpu-freq.h b/arch/arm/plat-s3c/include/plat/cpu-freq.h
index 7b982b7f28cd..94eb06a2ea5c 100644
--- a/arch/arm/plat-s3c/include/plat/cpu-freq.h
+++ b/arch/arm/plat-s3c/include/plat/cpu-freq.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-s3c/include/plat/cpu-freq.h
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h
index fbc3d498e02e..d1131ca11e97 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-s3c/include/plat/cpu.h
@@ -12,6 +12,9 @@
12 12
13/* todo - fix when rmk changes iodescs to use `void __iomem *` */ 13/* todo - fix when rmk changes iodescs to use `void __iomem *` */
14 14
15#ifndef __SAMSUNG_PLAT_CPU_H
16#define __SAMSUNG_PLAT_CPU_H
17
15#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } 18#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
16 19
17#ifndef MHZ 20#ifndef MHZ
@@ -73,3 +76,6 @@ extern struct sysdev_class s3c2443_sysclass;
73extern struct sysdev_class s3c6410_sysclass; 76extern struct sysdev_class s3c6410_sysclass;
74extern struct sysdev_class s3c64xx_sysclass; 77extern struct sysdev_class s3c64xx_sysclass;
75 78
79extern void (*s5pc1xx_idle)(void);
80
81#endif
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-s3c/include/plat/dma.h
index 34dba98f08e1..e429d10be3ad 100644
--- a/arch/arm/plat-s3c/include/plat/dma.h
+++ b/arch/arm/plat-s3c/include/plat/dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/dma.h 1/* arch/arm/plat-s3c/include/plat/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C DMA support 6 * Samsung S3C DMA support
diff --git a/arch/arm/plat-s3c/include/plat/fb.h b/arch/arm/plat-s3c/include/plat/fb.h
index 214ff561b0dd..f8db87930f8b 100644
--- a/arch/arm/plat-s3c/include/plat/fb.h
+++ b/arch/arm/plat-s3c/include/plat/fb.h
@@ -70,4 +70,11 @@ extern void s3c_fb_set_platdata(struct s3c_fb_platdata *pd);
70 */ 70 */
71extern void s3c64xx_fb_gpio_setup_24bpp(void); 71extern void s3c64xx_fb_gpio_setup_24bpp(void);
72 72
73/**
74 * s5pc100_fb_gpio_setup_24bpp() - S5PC100 setup function for 24bpp LCD
75 *
76 * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
77 */
78extern void s5pc100_fb_gpio_setup_24bpp(void);
79
73#endif /* __PLAT_S3C_FB_H */ 80#endif /* __PLAT_S3C_FB_H */
diff --git a/arch/arm/plat-s3c/include/plat/iic.h b/arch/arm/plat-s3c/include/plat/iic.h
index 67450f115748..3083df00dee6 100644
--- a/arch/arm/plat-s3c/include/plat/iic.h
+++ b/arch/arm/plat-s3c/include/plat/iic.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/iic.h 1/* arch/arm/plat-s3c/include/plat/iic.h
2 * 2 *
3 * Copyright 2004,2009 Simtec Electronics 3 * Copyright 2004-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C - I2C Controller platform_device info 6 * S3C - I2C Controller platform_device info
diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-s3c/include/plat/nand.h
index 18f958801e64..065985978413 100644
--- a/arch/arm/plat-s3c/include/plat/nand.h
+++ b/arch/arm/plat-s3c/include/plat/nand.h
@@ -55,3 +55,11 @@ struct s3c2410_platform_nand {
55 int chip); 55 int chip);
56}; 56};
57 57
58/**
59 * s3c_nand_set_platdata() - register NAND platform data.
60 * @nand: The NAND platform data to register with s3c_device_nand.
61 *
62 * This function copies the given NAND platform data, @nand and registers
63 * it with the s3c_device_nand. This allows @nand to be __initdata.
64*/
65extern void s3c_nand_set_platdata(struct s3c2410_platform_nand *nand);
diff --git a/arch/arm/plat-s3c/include/plat/regs-fb-v4.h b/arch/arm/plat-s3c/include/plat/regs-fb-v4.h
new file mode 100644
index 000000000000..a60ed0d06c94
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/regs-fb-v4.h
@@ -0,0 +1,235 @@
1/* arch/arm/plat-s3c/include/plat/regs-fb-v4.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - new-style framebuffer register definitions
9 *
10 * This is the register set for the new style framebuffer interface
11 * found from the S3C2443 onwards and specifically the S3C64XX series
12 * S3C6400 and S3C6410.
13 *
14 * The file contains the cpu specific items which change between whichever
15 * architecture is selected. See <plat/regs-fb.h> for the core definitions
16 * that are the same.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License version 2 as
20 * published by the Free Software Foundation.
21*/
22
23/* include the core definitions here, in case we really do need to
24 * override them at a later date.
25*/
26
27#include <plat/regs-fb.h>
28
29#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
30#define VIDCON1_FSTATUS_EVEN (1 << 15)
31
32/* Video timing controls */
33#define VIDTCON0 (0x10)
34#define VIDTCON1 (0x14)
35#define VIDTCON2 (0x18)
36
37/* Window position controls */
38
39#define WINCON(_win) (0x20 + ((_win) * 4))
40
41/* OSD1 and OSD4 do not have register D */
42
43#define VIDOSD_A(_win) (0x40 + ((_win) * 16))
44#define VIDOSD_B(_win) (0x44 + ((_win) * 16))
45#define VIDOSD_C(_win) (0x48 + ((_win) * 16))
46#define VIDOSD_D(_win) (0x4C + ((_win) * 16))
47
48
49#define VIDINTCON0 (0x130)
50
51#define WxKEYCONy(_win, _con) ((0x140 + ((_win) * 8)) + ((_con) * 4))
52
53/* WINCONx */
54
55#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
56#define WINCONx_CSCWIDTH_SHIFT (26)
57#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
58#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
59
60#define WINCONx_ENLOCAL (1 << 22)
61#define WINCONx_BUFSTATUS (1 << 21)
62#define WINCONx_BUFSEL (1 << 20)
63#define WINCONx_BUFAUTOEN (1 << 19)
64#define WINCONx_YCbCr (1 << 13)
65
66#define WINCON1_LOCALSEL_CAMIF (1 << 23)
67
68#define WINCON2_LOCALSEL_CAMIF (1 << 23)
69#define WINCON2_BLD_PIX (1 << 6)
70
71#define WINCON2_ALPHA_SEL (1 << 1)
72#define WINCON2_BPPMODE_MASK (0xf << 2)
73#define WINCON2_BPPMODE_SHIFT (2)
74#define WINCON2_BPPMODE_1BPP (0x0 << 2)
75#define WINCON2_BPPMODE_2BPP (0x1 << 2)
76#define WINCON2_BPPMODE_4BPP (0x2 << 2)
77#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
78#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
79#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
80#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
81#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
82#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
83#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
84#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
85#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
86#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
87#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
88
89#define WINCON3_BLD_PIX (1 << 6)
90
91#define WINCON3_ALPHA_SEL (1 << 1)
92#define WINCON3_BPPMODE_MASK (0xf << 2)
93#define WINCON3_BPPMODE_SHIFT (2)
94#define WINCON3_BPPMODE_1BPP (0x0 << 2)
95#define WINCON3_BPPMODE_2BPP (0x1 << 2)
96#define WINCON3_BPPMODE_4BPP (0x2 << 2)
97#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
98#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
99#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
100#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
101#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
102#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
103#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
104#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
105#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
106#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
107
108#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
109#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
110#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
111
112#define DITHMODE (0x170)
113#define WINxMAP(_win) (0x180 + ((_win) * 4))
114
115
116#define DITHMODE_R_POS_MASK (0x3 << 5)
117#define DITHMODE_R_POS_SHIFT (5)
118#define DITHMODE_R_POS_8BIT (0x0 << 5)
119#define DITHMODE_R_POS_6BIT (0x1 << 5)
120#define DITHMODE_R_POS_5BIT (0x2 << 5)
121
122#define DITHMODE_G_POS_MASK (0x3 << 3)
123#define DITHMODE_G_POS_SHIFT (3)
124#define DITHMODE_G_POS_8BIT (0x0 << 3)
125#define DITHMODE_G_POS_6BIT (0x1 << 3)
126#define DITHMODE_G_POS_5BIT (0x2 << 3)
127
128#define DITHMODE_B_POS_MASK (0x3 << 1)
129#define DITHMODE_B_POS_SHIFT (1)
130#define DITHMODE_B_POS_8BIT (0x0 << 1)
131#define DITHMODE_B_POS_6BIT (0x1 << 1)
132#define DITHMODE_B_POS_5BIT (0x2 << 1)
133
134#define DITHMODE_DITH_EN (1 << 0)
135
136#define WPALCON (0x1A0)
137
138/* Palette control */
139/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
140 * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
141#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
142#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
143#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
144
145
146/* system specific implementation code for palette sizes, and other
147 * information that changes depending on which architecture is being
148 * compiled.
149*/
150
151/* return true if window _win has OSD register D */
152#define s3c_fb_has_osd_d(_win) ((_win) != 4 && (_win) != 0)
153
154static inline unsigned int s3c_fb_win_pal_size(unsigned int win)
155{
156 if (win < 2)
157 return 256;
158 if (win < 4)
159 return 16;
160 if (win == 4)
161 return 4;
162
163 BUG(); /* shouldn't get here */
164}
165
166static inline int s3c_fb_validate_win_bpp(unsigned int win, unsigned int bpp)
167{
168 /* all windows can do 1/2 bpp */
169
170 if ((bpp == 25 || bpp == 19) && win == 0)
171 return 0; /* win 0 does not have 19 or 25bpp modes */
172
173 if (bpp == 4 && win == 4)
174 return 0;
175
176 if (bpp == 8 && (win >= 3))
177 return 0; /* win 3/4 cannot do 8bpp in any mode */
178
179 return 1;
180}
181
182static inline int s3c_fb_pal_is16(unsigned int window)
183{
184 return window > 1;
185}
186
187struct s3c_fb_palette {
188 struct fb_bitfield r;
189 struct fb_bitfield g;
190 struct fb_bitfield b;
191 struct fb_bitfield a;
192};
193
194static inline void s3c_fb_init_palette(unsigned int window,
195 struct s3c_fb_palette *palette)
196{
197 if (window < 2) {
198 /* Windows 0/1 are 8/8/8 or A/8/8/8 */
199 palette->r.offset = 16;
200 palette->r.length = 8;
201 palette->g.offset = 8;
202 palette->g.length = 8;
203 palette->b.offset = 0;
204 palette->b.length = 8;
205 } else {
206 /* currently we assume RGB 5/6/5 */
207 palette->r.offset = 11;
208 palette->r.length = 5;
209 palette->g.offset = 5;
210 palette->g.length = 6;
211 palette->b.offset = 0;
212 palette->b.length = 5;
213 }
214}
215
216/* Notes on per-window bpp settings
217 *
218 * Value Win0 Win1 Win2 Win3 Win 4
219 * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
220 * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
221 * 0010 4(P) 4(P) 4(P) 4(P) -none-
222 * 0011 8(P) 8(P) -none- -none- -none-
223 * 0100 -none- 8(A232) 8(A232) -none- -none-
224 * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
225 * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
226 * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
227 * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
228 * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
229 * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
230 * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
231 * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
232 * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
233 * 1110 -none- -none- -none- -none- -none-
234 * 1111 -none- -none- -none- -none- -none-
235*/
diff --git a/arch/arm/plat-s3c/include/plat/regs-nand.h b/arch/arm/plat-s3c/include/plat/regs-nand.h
index b2caa4bca270..238efea7b9e4 100644
--- a/arch/arm/plat-s3c/include/plat/regs-nand.h
+++ b/arch/arm/plat-s3c/include/plat/regs-nand.h
@@ -1,7 +1,7 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-nand.h 1/* arch/arm/mach-s3c2410/include/mach/regs-nand.h
2 * 2 *
3 * Copyright (c) 2004,2005 Simtec Electronics <linux@simtec.co.uk> 3 * Copyright (c) 2004-2005 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h b/arch/arm/plat-s3c/include/plat/regs-serial.h
index 66af75a5cdd1..85d8904e7f24 100644
--- a/arch/arm/plat-s3c/include/plat/regs-serial.h
+++ b/arch/arm/plat-s3c/include/plat/regs-serial.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 7 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
8 * 8 *
9 * Additional defines, (c) 2003 Simtec Electronics (linux@simtec.co.uk) 9 * Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk)
10 * 10 *
11 * Adapted from: 11 * Adapted from:
12 * 12 *
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-s3c/include/plat/sdhci.h
index f615308ccdfb..53198673b6bd 100644
--- a/arch/arm/plat-s3c/include/plat/sdhci.h
+++ b/arch/arm/plat-s3c/include/plat/sdhci.h
@@ -57,6 +57,7 @@ struct s3c_sdhci_platdata {
57 */ 57 */
58extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd); 58extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
59extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd); 59extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
60extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
60 61
61/* Default platform data, exported so that per-cpu initialisation can 62/* Default platform data, exported so that per-cpu initialisation can
62 * set the correct one when there are more than one cpu type selected. 63 * set the correct one when there are more than one cpu type selected.
@@ -64,11 +65,16 @@ extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
64 65
65extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata; 66extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
66extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; 67extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
68extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
67 69
68/* Helper function availablity */ 70/* Helper function availablity */
69 71
70extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 72extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
71extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 73extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
74extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
75extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
76extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
77extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
72 78
73/* S3C6400 SDHCI setup */ 79/* S3C6400 SDHCI setup */
74 80
@@ -103,6 +109,17 @@ static inline void s3c6400_default_sdhci1(void)
103static inline void s3c6400_default_sdhci1(void) { } 109static inline void s3c6400_default_sdhci1(void) { }
104#endif /* CONFIG_S3C_DEV_HSMMC1 */ 110#endif /* CONFIG_S3C_DEV_HSMMC1 */
105 111
112#ifdef CONFIG_S3C_DEV_HSMMC2
113static inline void s3c6400_default_sdhci2(void)
114{
115 s3c_hsmmc2_def_platdata.clocks = s3c6400_hsmmc_clksrcs;
116 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
117 s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
118}
119#else
120static inline void s3c6400_default_sdhci2(void) { }
121#endif /* CONFIG_S3C_DEV_HSMMC2 */
122
106#else 123#else
107static inline void s3c6400_default_sdhci0(void) { } 124static inline void s3c6400_default_sdhci0(void) { }
108static inline void s3c6400_default_sdhci1(void) { } 125static inline void s3c6400_default_sdhci1(void) { }
@@ -140,9 +157,70 @@ static inline void s3c6410_default_sdhci1(void)
140static inline void s3c6410_default_sdhci1(void) { } 157static inline void s3c6410_default_sdhci1(void) { }
141#endif /* CONFIG_S3C_DEV_HSMMC1 */ 158#endif /* CONFIG_S3C_DEV_HSMMC1 */
142 159
160#ifdef CONFIG_S3C_DEV_HSMMC2
161static inline void s3c6410_default_sdhci2(void)
162{
163 s3c_hsmmc2_def_platdata.clocks = s3c6410_hsmmc_clksrcs;
164 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
165 s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card;
166}
167#else
168static inline void s3c6410_default_sdhci2(void) { }
169#endif /* CONFIG_S3C_DEV_HSMMC2 */
170
143#else 171#else
144static inline void s3c6410_default_sdhci0(void) { } 172static inline void s3c6410_default_sdhci0(void) { }
145static inline void s3c6410_default_sdhci1(void) { } 173static inline void s3c6410_default_sdhci1(void) { }
146#endif /* CONFIG_S3C6410_SETUP_SDHCI */ 174#endif /* CONFIG_S3C6410_SETUP_SDHCI */
147 175
176/* S5PC100 SDHCI setup */
177
178#ifdef CONFIG_S5PC100_SETUP_SDHCI
179extern char *s5pc100_hsmmc_clksrcs[4];
180
181extern void s5pc100_setup_sdhci0_cfg_card(struct platform_device *dev,
182 void __iomem *r,
183 struct mmc_ios *ios,
184 struct mmc_card *card);
185
186#ifdef CONFIG_S3C_DEV_HSMMC
187static inline void s5pc100_default_sdhci0(void)
188{
189 s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
190 s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
191 s3c_hsmmc0_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
192}
193#else
194static inline void s5pc100_default_sdhci0(void) { }
195#endif /* CONFIG_S3C_DEV_HSMMC */
196
197#ifdef CONFIG_S3C_DEV_HSMMC1
198static inline void s5pc100_default_sdhci1(void)
199{
200 s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
201 s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
202 s3c_hsmmc1_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
203}
204#else
205static inline void s5pc100_default_sdhci1(void) { }
206#endif /* CONFIG_S3C_DEV_HSMMC1 */
207
208#ifdef CONFIG_S3C_DEV_HSMMC2
209static inline void s5pc100_default_sdhci2(void)
210{
211 s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
212 s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
213 s3c_hsmmc2_def_platdata.cfg_card = s5pc100_setup_sdhci0_cfg_card;
214}
215#else
216static inline void s5pc100_default_sdhci2(void) { }
217#endif /* CONFIG_S3C_DEV_HSMMC1 */
218
219
220#else
221static inline void s5pc100_default_sdhci0(void) { }
222static inline void s5pc100_default_sdhci1(void) { }
223static inline void s5pc100_default_sdhci2(void) { }
224#endif /* CONFIG_S5PC100_SETUP_SDHCI */
225
148#endif /* __PLAT_S3C_SDHCI_H */ 226#endif /* __PLAT_S3C_SDHCI_H */
diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-s3c/pm-check.c
index 39f2555564da..8eb1f439861c 100644
--- a/arch/arm/plat-s3c/pm-check.c
+++ b/arch/arm/plat-s3c/pm-check.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/plat-s3c/pm-check.c 1/* linux/arch/arm/plat-s3c/pm-check.c
2 * originally in linux/arch/arm/plat-s3c24xx/pm.c 2 * originally in linux/arch/arm/plat-s3c24xx/pm.c
3 * 3 *
4 * Copyright (c) 2004,2006,2008 Simtec Electronics 4 * Copyright (c) 2004-2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk 5 * http://armlinux.simtec.co.uk
6 * Ben Dooks <ben@simtec.co.uk> 6 * Ben Dooks <ben@simtec.co.uk>
7 * 7 *
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
index 8d97db2c7a0d..767470601e5c 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-s3c/pm.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/plat-s3c/pm.c 1/* linux/arch/arm/plat-s3c/pm.c
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2004,2006,2008 Simtec Electronics 4 * Copyright 2004-2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 9c7aca489643..20fbf936bb93 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -178,4 +178,11 @@ config MACH_SMDK
178 help 178 help
179 Common machine code for SMDK2410 and SMDK2440 179 Common machine code for SMDK2410 and SMDK2440
180 180
181config S3C24XX_SIMTEC_AUDIO
182 bool
183 depends on (ARCH_BAST || MACH_VR1000 || MACH_OSIRIS || MACH_ANUBIS)
184 default y
185 help
186 Add audio devices for common Simtec S3C24XX boards
187
181endif 188endif
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 7780d2dd833a..5dee8c12e8b4 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -55,3 +55,4 @@ obj-$(CONFIG_S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10) += spi-bus1-gpd8_9_10.o
55# machine common support 55# machine common support
56 56
57obj-$(CONFIG_MACH_SMDK) += common-smdk.o 57obj-$(CONFIG_MACH_SMDK) += common-smdk.o
58obj-$(CONFIG_S3C24XX_SIMTEC_AUDIO) += simtec-audio.o
diff --git a/arch/arm/plat-s3c24xx/clock-dclk.c b/arch/arm/plat-s3c24xx/clock-dclk.c
index 0afb217a775e..ac061a1bcb37 100644
--- a/arch/arm/plat-s3c24xx/clock-dclk.c
+++ b/arch/arm/plat-s3c24xx/clock-dclk.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/clock-dclk.c 1/* linux/arch/arm/plat-s3c24xx/clock-dclk.c
2 * 2 *
3 * Copyright (c) 2004,2008 Simtec Electronics 3 * Copyright (c) 2004-2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index aa119863c5ce..9e0e20ad2e46 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -198,7 +198,7 @@ void __init smdk_machine_init(void)
198 if (machine_is_smdk2443()) 198 if (machine_is_smdk2443())
199 smdk_nand_info.twrph0 = 50; 199 smdk_nand_info.twrph0 = 50;
200 200
201 s3c_device_nand.dev.platform_data = &smdk_nand_info; 201 s3c_nand_set_platdata(&smdk_nand_info);
202 202
203 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); 203 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
204 204
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index 4f1b789a1173..2d42efb9f4e9 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c 1/* linux/arch/arm/plat-s3c24xx/cpu-freq.c
2 * 2 *
3 * Copyright (c) 2006,2007,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index f046f8c51084..f65192d5b1d7 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/dma.c 1/* linux/arch/arm/plat-s3c24xx/dma.c
2 * 2 *
3 * Copyright (c) 2003-2005,2006 Simtec Electronics 3 * Copyright 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 DMA core 6 * S3C2410 DMA core
@@ -1310,7 +1310,7 @@ int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq,
1310 int channel; 1310 int channel;
1311 int ret; 1311 int ret;
1312 1312
1313 printk("S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics\n"); 1313 printk("S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics\n");
1314 1314
1315 dma_channels = channels; 1315 dma_channels = channels;
1316 1316
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
index c776120b99e6..33d421d78bad 100644
--- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-s3c/include/plat/cpu-freq.h
2 * 2 *
3 * Copyright (c) 2006,2007,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h
index c2cef6139683..36aaa10fad06 100644
--- a/arch/arm/plat-s3c24xx/include/plat/mci.h
+++ b/arch/arm/plat-s3c24xx/include/plat/mci.h
@@ -1,6 +1,31 @@
1#ifndef _ARCH_MCI_H 1#ifndef _ARCH_MCI_H
2#define _ARCH_MCI_H 2#define _ARCH_MCI_H
3 3
4/**
5 * struct s3c24xx_mci_pdata - sd/mmc controller platform data
6 * @no_wprotect: Set this to indicate there is no write-protect switch.
7 * @no_detect: Set this if there is no detect switch.
8 * @wprotect_invert: Invert the default sense of the write protect switch.
9 * @detect_invert: Invert the default sense of the write protect switch.
10 * @use_dma: Set to allow the use of DMA.
11 * @gpio_detect: GPIO number for the card detect line.
12 * @gpio_wprotect: GPIO number for the write protect line.
13 * @ocr_avail: The mask of the available power states, non-zero to use.
14 * @set_power: Callback to control the power mode.
15 *
16 * The @gpio_detect is used for card detection when @no_wprotect is unset,
17 * and the default sense is that 0 returned from gpio_get_value() means
18 * that a card is inserted. If @detect_invert is set, then the value from
19 * gpio_get_value() is inverted, which makes 1 mean card inserted.
20 *
21 * The driver will use @gpio_wprotect to signal whether the card is write
22 * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
23 * means the card is read/write, and 1 means read-only. The @wprotect_invert
24 * will invert the value returned from gpio_get_value().
25 *
26 * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
27 * to a non-zero value, otherwise the default of 3.2-3.4V is used.
28 */
4struct s3c24xx_mci_pdata { 29struct s3c24xx_mci_pdata {
5 unsigned int no_wprotect : 1; 30 unsigned int no_wprotect : 1;
6 unsigned int no_detect : 1; 31 unsigned int no_detect : 1;
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
index 3bc0a216df97..1b0f4c36d384 100644
--- a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
+++ b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h
@@ -1,6 +1,6 @@
1/* arch/arm/mach-s3c2410/include/mach/dma.h 1/* arch/arm/mach-s3c2410/include/mach/dma.h
2 * 2 *
3 * Copyright (C) 2003,2004,2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C24XX DMA support 6 * Samsung S3C24XX DMA support
diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c
index b7acf1a8ecd2..ea8dea3339a4 100644
--- a/arch/arm/plat-s3c24xx/irq-pm.c
+++ b/arch/arm/plat-s3c24xx/irq-pm.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/irq-om.c 1/* linux/arch/arm/plat-s3c24xx/irq-om.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/ 5 * http://armlinux.simtec.co.uk/
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index d02f5f02045e..ef0f521437d7 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/irq.c 1/* linux/arch/arm/plat-s3c24xx/irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index da0d3217d3e3..663b280d65da 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/pm-simtec.c 1/* linux/arch/arm/plat-s3c24xx/pm-simtec.c
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
@@ -35,7 +35,7 @@
35 35
36#include <plat/pm.h> 36#include <plat/pm.h>
37 37
38#define COPYRIGHT ", (c) 2005 Simtec Electronics" 38#define COPYRIGHT ", Copyright 2005 Simtec Electronics"
39 39
40/* pm_simtec_init 40/* pm_simtec_init
41 * 41 *
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index 56e5253ca02c..3620dd299095 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/pm.c 1/* linux/arch/arm/plat-s3c24xx/pm.c
2 * 2 *
3 * Copyright (c) 2004,2006 Simtec Electronics 3 * Copyright (c) 2004-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C24XX Power Manager (Suspend-To-RAM) support 6 * S3C24XX Power Manager (Suspend-To-RAM) support
diff --git a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
index d0a3a145cd4d..963fb0b4379e 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c 1/* linux/arch/arm/plat-s3c24xx/s3c2410-iotiming.c
2 * 2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
index fd45e47facbc..24993dce10b5 100644
--- a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c 1/* linux/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
2 * 2 *
3 * Copyright (c) 2006,2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
index ae2e6c604f27..976002fb1b8f 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
+++ b/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c 1/* linux/arch/arm/plat-s3c24xx/s3c2440-cpufreq.c
2 * 2 *
3 * Copyright (c) 2006,2008,2009 Simtec Electronics 3 * Copyright (c) 2006-2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@simtec.co.uk> 6 * Vincent Sanders <vince@simtec.co.uk>
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
index ff9443b233aa..49f65032f2c0 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
+++ b/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
@@ -1,6 +1,6 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c 1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
2 * 2 *
3 * Copyright (c) 2006,2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * Vincent Sanders <vince@arm.linux.org.uk> 6 * Vincent Sanders <vince@arm.linux.org.uk>
diff --git a/arch/arm/plat-s3c24xx/s3c244x-clock.c b/arch/arm/plat-s3c24xx/s3c244x-clock.c
index dde41f171aff..79371091aa38 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c244x-clock.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c24xx-clock.c 1/* linux/arch/arm/plat-s3c24xx/s3c24xx-clock.c
2 * 2 *
3 * Copyright (c) 2004-2005,2008 Simtec Electronics 3 * Copyright (c) 2004-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
diff --git a/arch/arm/plat-s3c24xx/s3c244x-irq.c b/arch/arm/plat-s3c24xx/s3c244x-irq.c
index 0902afd227ca..a75c0c2431ea 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-irq.c
+++ b/arch/arm/plat-s3c24xx/s3c244x-irq.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c 1/* linux/arch/arm/plat-s3c24xx/s3c244x-irq.c
2 * 2 *
3 * Copyright (c) 2003,2004 Simtec Electronics 3 * Copyright (c) 2003-2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
diff --git a/arch/arm/plat-s3c24xx/simtec-audio.c b/arch/arm/plat-s3c24xx/simtec-audio.c
new file mode 100644
index 000000000000..6bc832e0d8ea
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/simtec-audio.c
@@ -0,0 +1,77 @@
1/* linux/arch/arm/plat-s3c24xx/simtec-audio.c
2 *
3 * Copyright (c) 2009 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Audio setup for various Simtec S3C24XX implementations
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/interrupt.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/io.h>
19
20#include <mach/bast-map.h>
21#include <mach/bast-irq.h>
22#include <mach/bast-cpld.h>
23
24#include <mach/hardware.h>
25#include <mach/regs-gpio.h>
26
27#include <plat/audio-simtec.h>
28#include <plat/devs.h>
29
30/* platform ops for audio */
31
32static void simtec_audio_startup_lrroute(void)
33{
34 unsigned int tmp;
35 unsigned long flags;
36
37 local_irq_save(flags);
38
39 tmp = __raw_readb(BAST_VA_CTRL1);
40 tmp &= ~BAST_CPLD_CTRL1_LRMASK;
41 tmp |= BAST_CPLD_CTRL1_LRCDAC;
42 __raw_writeb(tmp, BAST_VA_CTRL1);
43
44 local_irq_restore(flags);
45}
46
47static struct s3c24xx_audio_simtec_pdata simtec_audio_platdata;
48static char our_name[32];
49
50static struct platform_device simtec_audio_dev = {
51 .name = our_name,
52 .id = -1,
53 .dev = {
54 .parent = &s3c_device_iis.dev,
55 .platform_data = &simtec_audio_platdata,
56 },
57};
58
59int __init simtec_audio_add(const char *name, bool has_lr_routing,
60 struct s3c24xx_audio_simtec_pdata *spd)
61{
62 if (!name)
63 name = "tlv320aic23";
64
65 snprintf(our_name, sizeof(our_name)-1, "s3c24xx-simtec-%s", name);
66
67 /* copy platform data so the source can be __initdata */
68 if (spd)
69 simtec_audio_platdata = *spd;
70
71 if (has_lr_routing)
72 simtec_audio_platdata.startup = simtec_audio_startup_lrroute;
73
74 platform_device_register(&s3c_device_iis);
75 platform_device_register(&simtec_audio_dev);
76 return 0;
77}
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/plat-s3c64xx/cpu.c
index b1fdd83940a6..49796d2db86d 100644
--- a/arch/arm/plat-s3c64xx/cpu.c
+++ b/arch/arm/plat-s3c64xx/cpu.c
@@ -107,6 +107,11 @@ static struct map_desc s3c_iodesc[] __initdata = {
107 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG), 107 .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG),
108 .length = SZ_4K, 108 .length = SZ_4K,
109 .type = MT_DEVICE, 109 .type = MT_DEVICE,
110 }, {
111 .virtual = (unsigned long)S3C_VA_USB_HSPHY,
112 .pfn = __phys_to_pfn(S3C64XX_PA_USB_HSPHY),
113 .length = SZ_1K,
114 .type = MT_DEVICE,
110 }, 115 },
111}; 116};
112 117
diff --git a/arch/arm/plat-s3c64xx/cpufreq.c b/arch/arm/plat-s3c64xx/cpufreq.c
index e6e0843215df..74c0e8347de5 100644
--- a/arch/arm/plat-s3c64xx/cpufreq.c
+++ b/arch/arm/plat-s3c64xx/cpufreq.c
@@ -19,6 +19,7 @@
19 19
20static struct clk *armclk; 20static struct clk *armclk;
21static struct regulator *vddarm; 21static struct regulator *vddarm;
22static unsigned long regulator_latency;
22 23
23#ifdef CONFIG_CPU_S3C6410 24#ifdef CONFIG_CPU_S3C6410
24struct s3c64xx_dvfs { 25struct s3c64xx_dvfs {
@@ -27,11 +28,10 @@ struct s3c64xx_dvfs {
27}; 28};
28 29
29static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = { 30static struct s3c64xx_dvfs s3c64xx_dvfs_table[] = {
30 [0] = { 1000000, 1000000 }, 31 [0] = { 1000000, 1150000 },
31 [1] = { 1000000, 1050000 }, 32 [1] = { 1050000, 1150000 },
32 [2] = { 1050000, 1100000 }, 33 [2] = { 1100000, 1150000 },
33 [3] = { 1050000, 1150000 }, 34 [3] = { 1200000, 1350000 },
34 [4] = { 1250000, 1350000 },
35}; 35};
36 36
37static struct cpufreq_frequency_table s3c64xx_freq_table[] = { 37static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
@@ -41,9 +41,9 @@ static struct cpufreq_frequency_table s3c64xx_freq_table[] = {
41 { 1, 266000 }, 41 { 1, 266000 },
42 { 2, 333000 }, 42 { 2, 333000 },
43 { 2, 400000 }, 43 { 2, 400000 },
44 { 3, 532000 }, 44 { 2, 532000 },
45 { 3, 533000 }, 45 { 2, 533000 },
46 { 4, 667000 }, 46 { 3, 667000 },
47 { 0, CPUFREQ_TABLE_END }, 47 { 0, CPUFREQ_TABLE_END },
48}; 48};
49#endif 49#endif
@@ -141,7 +141,7 @@ err:
141} 141}
142 142
143#ifdef CONFIG_REGULATOR 143#ifdef CONFIG_REGULATOR
144static void __init s3c64xx_cpufreq_constrain_voltages(void) 144static void __init s3c64xx_cpufreq_config_regulator(void)
145{ 145{
146 int count, v, i, found; 146 int count, v, i, found;
147 struct cpufreq_frequency_table *freq; 147 struct cpufreq_frequency_table *freq;
@@ -150,11 +150,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)
150 count = regulator_count_voltages(vddarm); 150 count = regulator_count_voltages(vddarm);
151 if (count < 0) { 151 if (count < 0) {
152 pr_err("cpufreq: Unable to check supported voltages\n"); 152 pr_err("cpufreq: Unable to check supported voltages\n");
153 return;
154 } 153 }
155 154
156 freq = s3c64xx_freq_table; 155 freq = s3c64xx_freq_table;
157 while (freq->frequency != CPUFREQ_TABLE_END) { 156 while (count > 0 && freq->frequency != CPUFREQ_TABLE_END) {
158 if (freq->frequency == CPUFREQ_ENTRY_INVALID) 157 if (freq->frequency == CPUFREQ_ENTRY_INVALID)
159 continue; 158 continue;
160 159
@@ -175,6 +174,10 @@ static void __init s3c64xx_cpufreq_constrain_voltages(void)
175 174
176 freq++; 175 freq++;
177 } 176 }
177
178 /* Guess based on having to do an I2C/SPI write; in future we
179 * will be able to query the regulator performance here. */
180 regulator_latency = 1 * 1000 * 1000;
178} 181}
179#endif 182#endif
180 183
@@ -206,7 +209,7 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
206 pr_err("cpufreq: Only frequency scaling available\n"); 209 pr_err("cpufreq: Only frequency scaling available\n");
207 vddarm = NULL; 210 vddarm = NULL;
208 } else { 211 } else {
209 s3c64xx_cpufreq_constrain_voltages(); 212 s3c64xx_cpufreq_config_regulator();
210 } 213 }
211#endif 214#endif
212 215
@@ -217,8 +220,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
217 /* Check for frequencies we can generate */ 220 /* Check for frequencies we can generate */
218 r = clk_round_rate(armclk, freq->frequency * 1000); 221 r = clk_round_rate(armclk, freq->frequency * 1000);
219 r /= 1000; 222 r /= 1000;
220 if (r != freq->frequency) 223 if (r != freq->frequency) {
224 pr_debug("cpufreq: %dkHz unsupported by clock\n",
225 freq->frequency);
221 freq->frequency = CPUFREQ_ENTRY_INVALID; 226 freq->frequency = CPUFREQ_ENTRY_INVALID;
227 }
222 228
223 /* If we have no regulator then assume startup 229 /* If we have no regulator then assume startup
224 * frequency is the maximum we can support. */ 230 * frequency is the maximum we can support. */
@@ -230,9 +236,11 @@ static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
230 236
231 policy->cur = clk_get_rate(armclk) / 1000; 237 policy->cur = clk_get_rate(armclk) / 1000;
232 238
233 /* Pick a conservative guess in ns: we'll need ~1 I2C/SPI 239 /* Datasheet says PLL stabalisation time (if we were to use
234 * write plus clock reprogramming. */ 240 * the PLLs, which we don't currently) is ~300us worst case,
235 policy->cpuinfo.transition_latency = 2 * 1000 * 1000; 241 * but add some fudge.
242 */
243 policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency;
236 244
237 ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table); 245 ret = cpufreq_frequency_table_cpuinfo(policy, s3c64xx_freq_table);
238 if (ret != 0) { 246 if (ret != 0) {
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/plat-s3c64xx/gpiolib.c
index 92859290ea33..778560457277 100644
--- a/arch/arm/plat-s3c64xx/gpiolib.c
+++ b/arch/arm/plat-s3c64xx/gpiolib.c
@@ -213,6 +213,11 @@ static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = {
213 .get_pull = s3c_gpio_getpull_updown, 213 .get_pull = s3c_gpio_getpull_updown,
214}; 214};
215 215
216int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin)
217{
218 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO;
219}
220
216static struct s3c_gpio_chip gpio_4bit[] = { 221static struct s3c_gpio_chip gpio_4bit[] = {
217 { 222 {
218 .base = S3C64XX_GPA_BASE, 223 .base = S3C64XX_GPA_BASE,
@@ -269,10 +274,16 @@ static struct s3c_gpio_chip gpio_4bit[] = {
269 .base = S3C64XX_GPM(0), 274 .base = S3C64XX_GPM(0),
270 .ngpio = S3C64XX_GPIO_M_NR, 275 .ngpio = S3C64XX_GPIO_M_NR,
271 .label = "GPM", 276 .label = "GPM",
277 .to_irq = s3c64xx_gpio2int_gpm,
272 }, 278 },
273 }, 279 },
274}; 280};
275 281
282int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin)
283{
284 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO;
285}
286
276static struct s3c_gpio_chip gpio_4bit2[] = { 287static struct s3c_gpio_chip gpio_4bit2[] = {
277 { 288 {
278 .base = S3C64XX_GPH_BASE + 0x4, 289 .base = S3C64XX_GPH_BASE + 0x4,
@@ -297,6 +308,7 @@ static struct s3c_gpio_chip gpio_4bit2[] = {
297 .base = S3C64XX_GPL(0), 308 .base = S3C64XX_GPL(0),
298 .ngpio = S3C64XX_GPIO_L_NR, 309 .ngpio = S3C64XX_GPIO_L_NR,
299 .label = "GPL", 310 .label = "GPL",
311 .to_irq = s3c64xx_gpio2int_gpl,
300 }, 312 },
301 }, 313 },
302}; 314};
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h b/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
index c47daf7e2723..e22b49f4f982 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
+++ b/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
@@ -36,18 +36,18 @@
36 36
37#define S3C64XX_GPC4_SPI_MISO1 (0x02 << 16) 37#define S3C64XX_GPC4_SPI_MISO1 (0x02 << 16)
38#define S3C64XX_GPC4_MMC2_CMD (0x03 << 16) 38#define S3C64XX_GPC4_MMC2_CMD (0x03 << 16)
39#define S3C64XX_GPC4_I2S0_V40_DO (0x05 << 16) 39#define S3C64XX_GPC4_I2S_V40_DO0 (0x05 << 16)
40#define S3C64XX_GPC4_EINT_G2_4 (0x07 << 16) 40#define S3C64XX_GPC4_EINT_G2_4 (0x07 << 16)
41 41
42#define S3C64XX_GPC5_SPI_CLK1 (0x02 << 20) 42#define S3C64XX_GPC5_SPI_CLK1 (0x02 << 20)
43#define S3C64XX_GPC5_MMC2_CLK (0x03 << 20) 43#define S3C64XX_GPC5_MMC2_CLK (0x03 << 20)
44#define S3C64XX_GPC5_I2S1_V40_DO (0x05 << 20) 44#define S3C64XX_GPC5_I2S_V40_DO1 (0x05 << 20)
45#define S3C64XX_GPC5_EINT_G2_5 (0x07 << 20) 45#define S3C64XX_GPC5_EINT_G2_5 (0x07 << 20)
46 46
47#define S3C64XX_GPC6_SPI_MOSI1 (0x02 << 24) 47#define S3C64XX_GPC6_SPI_MOSI1 (0x02 << 24)
48#define S3C64XX_GPC6_EINT_G2_6 (0x07 << 24) 48#define S3C64XX_GPC6_EINT_G2_6 (0x07 << 24)
49 49
50#define S3C64XX_GPC7_SPI_nCS1 (0x02 << 28) 50#define S3C64XX_GPC7_SPI_nCS1 (0x02 << 28)
51#define S3C64XX_GPC7_I2S2_V40_DO (0x05 << 28) 51#define S3C64XX_GPC7_I2S_V40_DO2 (0x05 << 28)
52#define S3C64XX_GPC7_EINT_G2_7 (0x07 << 28) 52#define S3C64XX_GPC7_EINT_G2_7 (0x07 << 28)
53 53
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c
index f81b7b818ba0..ebdf183a0911 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/plat-s3c64xx/irq-eint.c
@@ -65,7 +65,7 @@ static void s3c_irq_eint_maskack(unsigned int irq)
65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) 65static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
66{ 66{
67 int offs = eint_offset(irq); 67 int offs = eint_offset(irq);
68 int pin; 68 int pin, pin_val;
69 int shift; 69 int shift;
70 u32 ctrl, mask; 70 u32 ctrl, mask;
71 u32 newvalue = 0; 71 u32 newvalue = 0;
@@ -109,7 +109,10 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
109 return -1; 109 return -1;
110 } 110 }
111 111
112 shift = (offs / 2) * 4; 112 if (offs <= 15)
113 shift = (offs / 2) * 4;
114 else
115 shift = ((offs - 16) / 2) * 4;
113 mask = 0x7 << shift; 116 mask = 0x7 << shift;
114 117
115 ctrl = __raw_readl(reg); 118 ctrl = __raw_readl(reg);
@@ -119,12 +122,18 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
119 122
120 /* set the GPIO pin appropriately */ 123 /* set the GPIO pin appropriately */
121 124
122 if (offs < 23) 125 if (offs < 16) {
123 pin = S3C64XX_GPN(offs); 126 pin = S3C64XX_GPN(offs);
124 else 127 pin_val = S3C_GPIO_SFN(2);
128 } else if (offs < 23) {
129 pin = S3C64XX_GPL(offs + 8 - 16);
130 pin_val = S3C_GPIO_SFN(3);
131 } else {
125 pin = S3C64XX_GPM(offs - 23); 132 pin = S3C64XX_GPM(offs - 23);
133 pin_val = S3C_GPIO_SFN(3);
134 }
126 135
127 s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2)); 136 s3c_gpio_cfgpin(pin, pin_val);
128 137
129 return 0; 138 return 0;
130} 139}
diff --git a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
index 5417123b0ac1..a58c0cc7ba5e 100644
--- a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
@@ -53,3 +53,23 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
53 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 53 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
54 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); 54 s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
55} 55}
56
57void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
58{
59 unsigned int gpio;
60 unsigned int end;
61
62 end = S3C64XX_GPH(6 + width);
63
64 /* Set all the necessary GPH pins to special-function 1 */
65 for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) {
66 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
67 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
68 }
69
70 /* Set all the necessary GPC pins to special-function 1 */
71 for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) {
72 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
73 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
74 }
75}
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index a8a711c3c064..1608e62b0c9d 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -15,6 +15,9 @@ config PLAT_S5PC1XX
15 select ARCH_REQUIRE_GPIOLIB 15 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK 16 select S3C_GPIO_TRACK
17 select S3C_GPIO_PULL_UPDOWN 17 select S3C_GPIO_PULL_UPDOWN
18 select S3C_GPIO_CFG_S3C24XX
19 select S3C_GPIO_CFG_S3C64XX
20 select S5P_GPIO_CFG_S5PC1XX
18 help 21 help
19 Base platform code for any Samsung S5PC1XX device 22 Base platform code for any Samsung S5PC1XX device
20 23
@@ -34,7 +37,12 @@ config CPU_S5PC100_CLOCK
34 37
35# platform specific device setup 38# platform specific device setup
36 39
37config S5PC100_SETUP_I2C0 40config S5PC1XX_SETUP_FB_24BPP
41 bool
42 help
43 Common setup code for S5PC1XX with an 24bpp RGB display helper.
44
45config S5PC1XX_SETUP_I2C0
38 bool 46 bool
39 default y 47 default y
40 help 48 help
@@ -43,8 +51,14 @@ config S5PC100_SETUP_I2C0
43 Note, currently since i2c0 is always compiled, this setup helper 51 Note, currently since i2c0 is always compiled, this setup helper
44 is always compiled with it. 52 is always compiled with it.
45 53
46config S5PC100_SETUP_I2C1 54config S5PC1XX_SETUP_I2C1
47 bool 55 bool
48 help 56 help
49 Common setup code for i2c bus 1. 57 Common setup code for i2c bus 1.
58
59config S5PC1XX_SETUP_SDHCI_GPIO
60 bool
61 help
62 Common setup code for SDHCI gpio.
63
50endif 64endif
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index f1ecb2c37ee2..278f26806089 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -13,7 +13,9 @@ obj- :=
13 13
14obj-y += dev-uart.o 14obj-y += dev-uart.o
15obj-y += cpu.o 15obj-y += cpu.o
16obj-y += irq.o 16obj-y += irq.o irq-gpio.o irq-eint.o
17obj-y += clock.o
18obj-y += gpiolib.o
17 19
18# CPU support 20# CPU support
19 21
@@ -22,5 +24,8 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o
22 24
23# Device setup 25# Device setup
24 26
25obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o 27obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o
26obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o 28obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
29obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o
30obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o
31obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/plat-s5pc1xx/clock.c b/arch/arm/plat-s5pc1xx/clock.c
new file mode 100644
index 000000000000..26c21d849790
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/clock.c
@@ -0,0 +1,728 @@
1/* linux/arch/arm/plat-s5pc1xx/clock.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 *
5 * S5PC1XX Base clock support
6 *
7 * Based on plat-s3c64xx/clock.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/init.h>
15#include <linux/module.h>
16#include <linux/interrupt.h>
17#include <linux/ioport.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22#include <mach/map.h>
23
24#include <plat/regs-clock.h>
25#include <plat/devs.h>
26#include <plat/clock.h>
27
28struct clk clk_27m = {
29 .name = "clk_27m",
30 .id = -1,
31 .rate = 27000000,
32};
33
34static int clk_48m_ctrl(struct clk *clk, int enable)
35{
36 unsigned long flags;
37 u32 val;
38
39 /* can't rely on clock lock, this register has other usages */
40 local_irq_save(flags);
41
42 val = __raw_readl(S5PC100_CLKSRC1);
43 if (enable)
44 val |= S5PC100_CLKSRC1_CLK48M_MASK;
45 else
46 val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
47
48 __raw_writel(val, S5PC100_CLKSRC1);
49 local_irq_restore(flags);
50
51 return 0;
52}
53
54struct clk clk_48m = {
55 .name = "clk_48m",
56 .id = -1,
57 .rate = 48000000,
58 .enable = clk_48m_ctrl,
59};
60
61struct clk clk_54m = {
62 .name = "clk_54m",
63 .id = -1,
64 .rate = 54000000,
65};
66
67static int clk_default_setrate(struct clk *clk, unsigned long rate)
68{
69 clk->rate = rate;
70 return 0;
71}
72
73static int clk_dummy_enable(struct clk *clk, int enable)
74{
75 return 0;
76}
77
78struct clk clk_hd0 = {
79 .name = "hclkd0",
80 .id = -1,
81 .rate = 0,
82 .parent = NULL,
83 .ctrlbit = 0,
84 .set_rate = clk_default_setrate,
85 .enable = clk_dummy_enable,
86};
87
88struct clk clk_pd0 = {
89 .name = "pclkd0",
90 .id = -1,
91 .rate = 0,
92 .parent = NULL,
93 .ctrlbit = 0,
94 .set_rate = clk_default_setrate,
95 .enable = clk_dummy_enable,
96};
97
98static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable)
99{
100 unsigned int ctrlbit = clk->ctrlbit;
101 u32 con;
102
103 con = __raw_readl(reg);
104 if (enable)
105 con |= ctrlbit;
106 else
107 con &= ~ctrlbit;
108 __raw_writel(con, reg);
109
110 return 0;
111}
112
113static int s5pc100_clk_d00_ctrl(struct clk *clk, int enable)
114{
115 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable);
116}
117
118static int s5pc100_clk_d01_ctrl(struct clk *clk, int enable)
119{
120 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
121}
122
123static int s5pc100_clk_d02_ctrl(struct clk *clk, int enable)
124{
125 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
126}
127
128static int s5pc100_clk_d10_ctrl(struct clk *clk, int enable)
129{
130 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable);
131}
132
133static int s5pc100_clk_d11_ctrl(struct clk *clk, int enable)
134{
135 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
136}
137
138static int s5pc100_clk_d12_ctrl(struct clk *clk, int enable)
139{
140 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable);
141}
142
143static int s5pc100_clk_d13_ctrl(struct clk *clk, int enable)
144{
145 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable);
146}
147
148static int s5pc100_clk_d14_ctrl(struct clk *clk, int enable)
149{
150 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
151}
152
153static int s5pc100_clk_d15_ctrl(struct clk *clk, int enable)
154{
155 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
156}
157
158static int s5pc100_clk_d20_ctrl(struct clk *clk, int enable)
159{
160 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable);
161}
162
163int s5pc100_sclk0_ctrl(struct clk *clk, int enable)
164{
165 return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable);
166}
167
168int s5pc100_sclk1_ctrl(struct clk *clk, int enable)
169{
170 return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable);
171}
172
173static struct clk s5pc100_init_clocks_disable[] = {
174 {
175 .name = "dsi",
176 .id = -1,
177 .parent = &clk_p,
178 .enable = s5pc100_clk_d11_ctrl,
179 .ctrlbit = S5PC100_CLKGATE_D11_DSI,
180 }, {
181 .name = "csi",
182 .id = -1,
183 .parent = &clk_h,
184 .enable = s5pc100_clk_d11_ctrl,
185 .ctrlbit = S5PC100_CLKGATE_D11_CSI,
186 }, {
187 .name = "ccan",
188 .id = 0,
189 .parent = &clk_p,
190 .enable = s5pc100_clk_d14_ctrl,
191 .ctrlbit = S5PC100_CLKGATE_D14_CCAN0,
192 }, {
193 .name = "ccan",
194 .id = 1,
195 .parent = &clk_p,
196 .enable = s5pc100_clk_d14_ctrl,
197 .ctrlbit = S5PC100_CLKGATE_D14_CCAN1,
198 }, {
199 .name = "keypad",
200 .id = -1,
201 .parent = &clk_p,
202 .enable = s5pc100_clk_d15_ctrl,
203 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
204 }, {
205 .name = "hclkd2",
206 .id = -1,
207 .parent = NULL,
208 .enable = s5pc100_clk_d20_ctrl,
209 .ctrlbit = S5PC100_CLKGATE_D20_HCLKD2,
210 }, {
211 .name = "iis-d2",
212 .id = -1,
213 .parent = NULL,
214 .enable = s5pc100_clk_d20_ctrl,
215 .ctrlbit = S5PC100_CLKGATE_D20_I2SD2,
216 },
217};
218
219static struct clk s5pc100_init_clocks[] = {
220 /* System1 (D0_0) devices */
221 {
222 .name = "intc",
223 .id = -1,
224 .parent = &clk_hd0,
225 .enable = s5pc100_clk_d00_ctrl,
226 .ctrlbit = S5PC100_CLKGATE_D00_INTC,
227 }, {
228 .name = "tzic",
229 .id = -1,
230 .parent = &clk_hd0,
231 .enable = s5pc100_clk_d00_ctrl,
232 .ctrlbit = S5PC100_CLKGATE_D00_TZIC,
233 }, {
234 .name = "cf-ata",
235 .id = -1,
236 .parent = &clk_hd0,
237 .enable = s5pc100_clk_d00_ctrl,
238 .ctrlbit = S5PC100_CLKGATE_D00_CFCON,
239 }, {
240 .name = "mdma",
241 .id = -1,
242 .parent = &clk_hd0,
243 .enable = s5pc100_clk_d00_ctrl,
244 .ctrlbit = S5PC100_CLKGATE_D00_MDMA,
245 }, {
246 .name = "g2d",
247 .id = -1,
248 .parent = &clk_hd0,
249 .enable = s5pc100_clk_d00_ctrl,
250 .ctrlbit = S5PC100_CLKGATE_D00_G2D,
251 }, {
252 .name = "secss",
253 .id = -1,
254 .parent = &clk_hd0,
255 .enable = s5pc100_clk_d00_ctrl,
256 .ctrlbit = S5PC100_CLKGATE_D00_SECSS,
257 }, {
258 .name = "cssys",
259 .id = -1,
260 .parent = &clk_hd0,
261 .enable = s5pc100_clk_d00_ctrl,
262 .ctrlbit = S5PC100_CLKGATE_D00_CSSYS,
263 },
264
265 /* Memory (D0_1) devices */
266 {
267 .name = "dmc",
268 .id = -1,
269 .parent = &clk_hd0,
270 .enable = s5pc100_clk_d01_ctrl,
271 .ctrlbit = S5PC100_CLKGATE_D01_DMC,
272 }, {
273 .name = "sromc",
274 .id = -1,
275 .parent = &clk_hd0,
276 .enable = s5pc100_clk_d01_ctrl,
277 .ctrlbit = S5PC100_CLKGATE_D01_SROMC,
278 }, {
279 .name = "onenand",
280 .id = -1,
281 .parent = &clk_hd0,
282 .enable = s5pc100_clk_d01_ctrl,
283 .ctrlbit = S5PC100_CLKGATE_D01_ONENAND,
284 }, {
285 .name = "nand",
286 .id = -1,
287 .parent = &clk_hd0,
288 .enable = s5pc100_clk_d01_ctrl,
289 .ctrlbit = S5PC100_CLKGATE_D01_NFCON,
290 }, {
291 .name = "intmem",
292 .id = -1,
293 .parent = &clk_hd0,
294 .enable = s5pc100_clk_d01_ctrl,
295 .ctrlbit = S5PC100_CLKGATE_D01_INTMEM,
296 }, {
297 .name = "ebi",
298 .id = -1,
299 .parent = &clk_hd0,
300 .enable = s5pc100_clk_d01_ctrl,
301 .ctrlbit = S5PC100_CLKGATE_D01_EBI,
302 },
303
304 /* System2 (D0_2) devices */
305 {
306 .name = "seckey",
307 .id = -1,
308 .parent = &clk_pd0,
309 .enable = s5pc100_clk_d02_ctrl,
310 .ctrlbit = S5PC100_CLKGATE_D02_SECKEY,
311 }, {
312 .name = "sdm",
313 .id = -1,
314 .parent = &clk_hd0,
315 .enable = s5pc100_clk_d02_ctrl,
316 .ctrlbit = S5PC100_CLKGATE_D02_SDM,
317 },
318
319 /* File (D1_0) devices */
320 {
321 .name = "pdma",
322 .id = 0,
323 .parent = &clk_h,
324 .enable = s5pc100_clk_d10_ctrl,
325 .ctrlbit = S5PC100_CLKGATE_D10_PDMA0,
326 }, {
327 .name = "pdma",
328 .id = 1,
329 .parent = &clk_h,
330 .enable = s5pc100_clk_d10_ctrl,
331 .ctrlbit = S5PC100_CLKGATE_D10_PDMA1,
332 }, {
333 .name = "usb-host",
334 .id = -1,
335 .parent = &clk_h,
336 .enable = s5pc100_clk_d10_ctrl,
337 .ctrlbit = S5PC100_CLKGATE_D10_USBHOST,
338 }, {
339 .name = "otg",
340 .id = -1,
341 .parent = &clk_h,
342 .enable = s5pc100_clk_d10_ctrl,
343 .ctrlbit = S5PC100_CLKGATE_D10_USBOTG,
344 }, {
345 .name = "modem",
346 .id = -1,
347 .parent = &clk_h,
348 .enable = s5pc100_clk_d10_ctrl,
349 .ctrlbit = S5PC100_CLKGATE_D10_MODEMIF,
350 }, {
351 .name = "hsmmc",
352 .id = 0,
353 .parent = &clk_48m,
354 .enable = s5pc100_clk_d10_ctrl,
355 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC0,
356 }, {
357 .name = "hsmmc",
358 .id = 1,
359 .parent = &clk_48m,
360 .enable = s5pc100_clk_d10_ctrl,
361 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC1,
362 }, {
363 .name = "hsmmc",
364 .id = 2,
365 .parent = &clk_48m,
366 .enable = s5pc100_clk_d10_ctrl,
367 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC2,
368 },
369
370 /* Multimedia1 (D1_1) devices */
371 {
372 .name = "lcd",
373 .id = -1,
374 .parent = &clk_p,
375 .enable = s5pc100_clk_d11_ctrl,
376 .ctrlbit = S5PC100_CLKGATE_D11_LCD,
377 }, {
378 .name = "rotator",
379 .id = -1,
380 .parent = &clk_p,
381 .enable = s5pc100_clk_d11_ctrl,
382 .ctrlbit = S5PC100_CLKGATE_D11_ROTATOR,
383 }, {
384 .name = "fimc",
385 .id = -1,
386 .parent = &clk_p,
387 .enable = s5pc100_clk_d11_ctrl,
388 .ctrlbit = S5PC100_CLKGATE_D11_FIMC0,
389 }, {
390 .name = "fimc",
391 .id = -1,
392 .parent = &clk_p,
393 .enable = s5pc100_clk_d11_ctrl,
394 .ctrlbit = S5PC100_CLKGATE_D11_FIMC1,
395 }, {
396 .name = "fimc",
397 .id = -1,
398 .parent = &clk_p,
399 .enable = s5pc100_clk_d11_ctrl,
400 .ctrlbit = S5PC100_CLKGATE_D11_FIMC2,
401 }, {
402 .name = "jpeg",
403 .id = -1,
404 .parent = &clk_p,
405 .enable = s5pc100_clk_d11_ctrl,
406 .ctrlbit = S5PC100_CLKGATE_D11_JPEG,
407 }, {
408 .name = "g3d",
409 .id = -1,
410 .parent = &clk_p,
411 .enable = s5pc100_clk_d11_ctrl,
412 .ctrlbit = S5PC100_CLKGATE_D11_G3D,
413 },
414
415 /* Multimedia2 (D1_2) devices */
416 {
417 .name = "tv",
418 .id = -1,
419 .parent = &clk_p,
420 .enable = s5pc100_clk_d12_ctrl,
421 .ctrlbit = S5PC100_CLKGATE_D12_TV,
422 }, {
423 .name = "vp",
424 .id = -1,
425 .parent = &clk_p,
426 .enable = s5pc100_clk_d12_ctrl,
427 .ctrlbit = S5PC100_CLKGATE_D12_VP,
428 }, {
429 .name = "mixer",
430 .id = -1,
431 .parent = &clk_p,
432 .enable = s5pc100_clk_d12_ctrl,
433 .ctrlbit = S5PC100_CLKGATE_D12_MIXER,
434 }, {
435 .name = "hdmi",
436 .id = -1,
437 .parent = &clk_p,
438 .enable = s5pc100_clk_d12_ctrl,
439 .ctrlbit = S5PC100_CLKGATE_D12_HDMI,
440 }, {
441 .name = "mfc",
442 .id = -1,
443 .parent = &clk_p,
444 .enable = s5pc100_clk_d12_ctrl,
445 .ctrlbit = S5PC100_CLKGATE_D12_MFC,
446 },
447
448 /* System (D1_3) devices */
449 {
450 .name = "chipid",
451 .id = -1,
452 .parent = &clk_p,
453 .enable = s5pc100_clk_d13_ctrl,
454 .ctrlbit = S5PC100_CLKGATE_D13_CHIPID,
455 }, {
456 .name = "gpio",
457 .id = -1,
458 .parent = &clk_p,
459 .enable = s5pc100_clk_d13_ctrl,
460 .ctrlbit = S5PC100_CLKGATE_D13_GPIO,
461 }, {
462 .name = "apc",
463 .id = -1,
464 .parent = &clk_p,
465 .enable = s5pc100_clk_d13_ctrl,
466 .ctrlbit = S5PC100_CLKGATE_D13_APC,
467 }, {
468 .name = "iec",
469 .id = -1,
470 .parent = &clk_p,
471 .enable = s5pc100_clk_d13_ctrl,
472 .ctrlbit = S5PC100_CLKGATE_D13_IEC,
473 }, {
474 .name = "timers",
475 .id = -1,
476 .parent = &clk_p,
477 .enable = s5pc100_clk_d13_ctrl,
478 .ctrlbit = S5PC100_CLKGATE_D13_PWM,
479 }, {
480 .name = "systimer",
481 .id = -1,
482 .parent = &clk_p,
483 .enable = s5pc100_clk_d13_ctrl,
484 .ctrlbit = S5PC100_CLKGATE_D13_SYSTIMER,
485 }, {
486 .name = "watchdog",
487 .id = -1,
488 .parent = &clk_p,
489 .enable = s5pc100_clk_d13_ctrl,
490 .ctrlbit = S5PC100_CLKGATE_D13_WDT,
491 }, {
492 .name = "rtc",
493 .id = -1,
494 .parent = &clk_p,
495 .enable = s5pc100_clk_d13_ctrl,
496 .ctrlbit = S5PC100_CLKGATE_D13_RTC,
497 },
498
499 /* Connectivity (D1_4) devices */
500 {
501 .name = "uart",
502 .id = 0,
503 .parent = &clk_p,
504 .enable = s5pc100_clk_d14_ctrl,
505 .ctrlbit = S5PC100_CLKGATE_D14_UART0,
506 }, {
507 .name = "uart",
508 .id = 1,
509 .parent = &clk_p,
510 .enable = s5pc100_clk_d14_ctrl,
511 .ctrlbit = S5PC100_CLKGATE_D14_UART1,
512 }, {
513 .name = "uart",
514 .id = 2,
515 .parent = &clk_p,
516 .enable = s5pc100_clk_d14_ctrl,
517 .ctrlbit = S5PC100_CLKGATE_D14_UART2,
518 }, {
519 .name = "uart",
520 .id = 3,
521 .parent = &clk_p,
522 .enable = s5pc100_clk_d14_ctrl,
523 .ctrlbit = S5PC100_CLKGATE_D14_UART3,
524 }, {
525 .name = "i2c",
526 .id = -1,
527 .parent = &clk_p,
528 .enable = s5pc100_clk_d14_ctrl,
529 .ctrlbit = S5PC100_CLKGATE_D14_IIC,
530 }, {
531 .name = "hdmi-i2c",
532 .id = -1,
533 .parent = &clk_p,
534 .enable = s5pc100_clk_d14_ctrl,
535 .ctrlbit = S5PC100_CLKGATE_D14_HDMI_IIC,
536 }, {
537 .name = "spi",
538 .id = 0,
539 .parent = &clk_p,
540 .enable = s5pc100_clk_d14_ctrl,
541 .ctrlbit = S5PC100_CLKGATE_D14_SPI0,
542 }, {
543 .name = "spi",
544 .id = 1,
545 .parent = &clk_p,
546 .enable = s5pc100_clk_d14_ctrl,
547 .ctrlbit = S5PC100_CLKGATE_D14_SPI1,
548 }, {
549 .name = "spi",
550 .id = 2,
551 .parent = &clk_p,
552 .enable = s5pc100_clk_d14_ctrl,
553 .ctrlbit = S5PC100_CLKGATE_D14_SPI2,
554 }, {
555 .name = "irda",
556 .id = -1,
557 .parent = &clk_p,
558 .enable = s5pc100_clk_d14_ctrl,
559 .ctrlbit = S5PC100_CLKGATE_D14_IRDA,
560 }, {
561 .name = "hsitx",
562 .id = -1,
563 .parent = &clk_p,
564 .enable = s5pc100_clk_d14_ctrl,
565 .ctrlbit = S5PC100_CLKGATE_D14_HSITX,
566 }, {
567 .name = "hsirx",
568 .id = -1,
569 .parent = &clk_p,
570 .enable = s5pc100_clk_d14_ctrl,
571 .ctrlbit = S5PC100_CLKGATE_D14_HSIRX,
572 },
573
574 /* Audio (D1_5) devices */
575 {
576 .name = "iis",
577 .id = 0,
578 .parent = &clk_p,
579 .enable = s5pc100_clk_d15_ctrl,
580 .ctrlbit = S5PC100_CLKGATE_D15_IIS0,
581 }, {
582 .name = "iis",
583 .id = 1,
584 .parent = &clk_p,
585 .enable = s5pc100_clk_d15_ctrl,
586 .ctrlbit = S5PC100_CLKGATE_D15_IIS1,
587 }, {
588 .name = "iis",
589 .id = 2,
590 .parent = &clk_p,
591 .enable = s5pc100_clk_d15_ctrl,
592 .ctrlbit = S5PC100_CLKGATE_D15_IIS2,
593 }, {
594 .name = "ac97",
595 .id = -1,
596 .parent = &clk_p,
597 .enable = s5pc100_clk_d15_ctrl,
598 .ctrlbit = S5PC100_CLKGATE_D15_AC97,
599 }, {
600 .name = "pcm",
601 .id = 0,
602 .parent = &clk_p,
603 .enable = s5pc100_clk_d15_ctrl,
604 .ctrlbit = S5PC100_CLKGATE_D15_PCM0,
605 }, {
606 .name = "pcm",
607 .id = 1,
608 .parent = &clk_p,
609 .enable = s5pc100_clk_d15_ctrl,
610 .ctrlbit = S5PC100_CLKGATE_D15_PCM1,
611 }, {
612 .name = "spdif",
613 .id = -1,
614 .parent = &clk_p,
615 .enable = s5pc100_clk_d15_ctrl,
616 .ctrlbit = S5PC100_CLKGATE_D15_SPDIF,
617 }, {
618 .name = "adc",
619 .id = -1,
620 .parent = &clk_p,
621 .enable = s5pc100_clk_d15_ctrl,
622 .ctrlbit = S5PC100_CLKGATE_D15_TSADC,
623 }, {
624 .name = "cg",
625 .id = -1,
626 .parent = &clk_p,
627 .enable = s5pc100_clk_d15_ctrl,
628 .ctrlbit = S5PC100_CLKGATE_D15_CG,
629 },
630
631 /* Audio (D2_0) devices: all disabled */
632
633 /* Special Clocks 0 */
634 {
635 .name = "sclk_hpm",
636 .id = -1,
637 .parent = NULL,
638 .enable = s5pc100_sclk0_ctrl,
639 .ctrlbit = S5PC100_CLKGATE_SCLK0_HPM,
640 }, {
641 .name = "sclk_onenand",
642 .id = -1,
643 .parent = NULL,
644 .enable = s5pc100_sclk0_ctrl,
645 .ctrlbit = S5PC100_CLKGATE_SCLK0_ONENAND,
646 }, {
647 .name = "spi_48",
648 .id = 0,
649 .parent = &clk_48m,
650 .enable = s5pc100_sclk0_ctrl,
651 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0_48,
652 }, {
653 .name = "spi_48",
654 .id = 1,
655 .parent = &clk_48m,
656 .enable = s5pc100_sclk0_ctrl,
657 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1_48,
658 }, {
659 .name = "spi_48",
660 .id = 2,
661 .parent = &clk_48m,
662 .enable = s5pc100_sclk0_ctrl,
663 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2_48,
664 }, {
665 .name = "mmc_48",
666 .id = 0,
667 .parent = &clk_48m,
668 .enable = s5pc100_sclk0_ctrl,
669 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0_48,
670 }, {
671 .name = "mmc_48",
672 .id = 1,
673 .parent = &clk_48m,
674 .enable = s5pc100_sclk0_ctrl,
675 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1_48,
676 }, {
677 .name = "mmc_48",
678 .id = 2,
679 .parent = &clk_48m,
680 .enable = s5pc100_sclk0_ctrl,
681 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2_48,
682 },
683 /* Special Clocks 1 */
684};
685
686static struct clk *clks[] __initdata = {
687 &clk_ext,
688 &clk_epll,
689 &clk_27m,
690 &clk_48m,
691 &clk_54m,
692};
693
694void __init s5pc1xx_register_clocks(void)
695{
696 struct clk *clkp;
697 int ret;
698 int ptr;
699 int size;
700
701 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
702
703 clkp = s5pc100_init_clocks;
704 size = ARRAY_SIZE(s5pc100_init_clocks);
705
706 for (ptr = 0; ptr < size; ptr++, clkp++) {
707 ret = s3c24xx_register_clock(clkp);
708 if (ret < 0) {
709 printk(KERN_ERR "Failed to register clock %s (%d)\n",
710 clkp->name, ret);
711 }
712 }
713
714 clkp = s5pc100_init_clocks_disable;
715 size = ARRAY_SIZE(s5pc100_init_clocks_disable);
716
717 for (ptr = 0; ptr < size; ptr++, clkp++) {
718 ret = s3c24xx_register_clock(clkp);
719 if (ret < 0) {
720 printk(KERN_ERR "Failed to register clock %s (%d)\n",
721 clkp->name, ret);
722 }
723
724 (clkp->enable)(clkp, 0);
725 }
726
727 s3c_pwmclk_init();
728}
diff --git a/arch/arm/plat-s5pc1xx/cpu.c b/arch/arm/plat-s5pc1xx/cpu.c
index 715a7330794d..02baeaa2a121 100644
--- a/arch/arm/plat-s5pc1xx/cpu.c
+++ b/arch/arm/plat-s5pc1xx/cpu.c
@@ -55,6 +55,16 @@ static struct cpu_table cpu_ids[] __initdata = {
55 55
56static struct map_desc s5pc1xx_iodesc[] __initdata = { 56static struct map_desc s5pc1xx_iodesc[] __initdata = {
57 { 57 {
58 .virtual = (unsigned long)S5PC1XX_VA_CLK_OTHER,
59 .pfn = __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
60 .length = SZ_4K,
61 .type = MT_DEVICE,
62 }, {
63 .virtual = (unsigned long)S5PC1XX_VA_GPIO,
64 .pfn = __phys_to_pfn(S5PC100_PA_GPIO),
65 .length = SZ_4K,
66 .type = MT_DEVICE,
67 }, {
58 .virtual = (unsigned long)S5PC1XX_VA_CHIPID, 68 .virtual = (unsigned long)S5PC1XX_VA_CHIPID,
59 .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID), 69 .pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID),
60 .length = SZ_16, 70 .length = SZ_16,
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c b/arch/arm/plat-s5pc1xx/gpio-config.c
new file mode 100644
index 000000000000..bba675df9c75
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/gpio-config.c
@@ -0,0 +1,62 @@
1/* linux/arch/arm/plat-s5pc1xx/gpio-config.c
2 *
3 * Copyright 2009 Samsung Electronics
4 *
5 * S5PC1XX GPIO Configuration.
6 *
7 * Based on plat-s3c64xx/gpio-config.c
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/module.h>
16#include <linux/gpio.h>
17#include <linux/io.h>
18
19#include <mach/gpio-core.h>
20#include <plat/gpio-cfg-s5pc1xx.h>
21
22s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off)
23{
24 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
25 void __iomem *reg;
26 int shift = off * 2;
27 u32 drvstr;
28
29 if (!chip)
30 return -EINVAL;
31
32 reg = chip->base + 0x0C;
33
34 drvstr = __raw_readl(reg);
35 drvstr = 0xffff & (0x3 << shift);
36 drvstr = drvstr >> shift;
37
38 return (__force s5p_gpio_drvstr_t)drvstr;
39}
40EXPORT_SYMBOL(s5p_gpio_get_drvstr);
41
42int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
43 s5p_gpio_drvstr_t drvstr)
44{
45 struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
46 void __iomem *reg;
47 int shift = off * 2;
48 u32 tmp;
49
50 if (!chip)
51 return -EINVAL;
52
53 reg = chip->base + 0x0C;
54
55 tmp = __raw_readl(reg);
56 tmp |= drvstr << shift;
57
58 __raw_writel(tmp, reg);
59
60 return 0;
61}
62EXPORT_SYMBOL(s5p_gpio_set_drvstr);
diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/plat-s5pc1xx/gpiolib.c
new file mode 100644
index 000000000000..facb410e7a71
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/gpiolib.c
@@ -0,0 +1,503 @@
1/*
2 * arch/arm/plat-s5pc1xx/gpiolib.c
3 *
4 * Copyright 2009 Samsung Electronics Co
5 * Kyungmin Park <kyungmin.park@samsung.com>
6 *
7 * S5PC1XX - GPIOlib support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/kernel.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18
19#include <mach/map.h>
20#include <mach/gpio-core.h>
21
22#include <plat/gpio-cfg.h>
23#include <plat/gpio-cfg-helpers.h>
24#include <plat/regs-gpio.h>
25
26/* S5PC100 GPIO bank summary:
27 *
28 * Bank GPIOs Style INT Type
29 * A0 8 4Bit GPIO_INT0
30 * A1 5 4Bit GPIO_INT1
31 * B 8 4Bit GPIO_INT2
32 * C 5 4Bit GPIO_INT3
33 * D 7 4Bit GPIO_INT4
34 * E0 8 4Bit GPIO_INT5
35 * E1 6 4Bit GPIO_INT6
36 * F0 8 4Bit GPIO_INT7
37 * F1 8 4Bit GPIO_INT8
38 * F2 8 4Bit GPIO_INT9
39 * F3 4 4Bit GPIO_INT10
40 * G0 8 4Bit GPIO_INT11
41 * G1 3 4Bit GPIO_INT12
42 * G2 7 4Bit GPIO_INT13
43 * G3 7 4Bit GPIO_INT14
44 * H0 8 4Bit WKUP_INT
45 * H1 8 4Bit WKUP_INT
46 * H2 8 4Bit WKUP_INT
47 * H3 8 4Bit WKUP_INT
48 * I 8 4Bit GPIO_INT15
49 * J0 8 4Bit GPIO_INT16
50 * J1 5 4Bit GPIO_INT17
51 * J2 8 4Bit GPIO_INT18
52 * J3 8 4Bit GPIO_INT19
53 * J4 4 4Bit GPIO_INT20
54 * K0 8 4Bit None
55 * K1 6 4Bit None
56 * K2 8 4Bit None
57 * K3 8 4Bit None
58 * L0 8 4Bit None
59 * L1 8 4Bit None
60 * L2 8 4Bit None
61 * L3 8 4Bit None
62 */
63
64#define OFF_GPCON (0x00)
65#define OFF_GPDAT (0x04)
66
67#define con_4bit_shift(__off) ((__off) * 4)
68
69#if 1
70#define gpio_dbg(x...) do { } while (0)
71#else
72#define gpio_dbg(x...) printk(KERN_DEBUG x)
73#endif
74
75/* The s5pc1xx_gpiolib routines are to control the gpio banks where
76 * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
77 * following example:
78 *
79 * base + 0x00: Control register, 4 bits per gpio
80 * gpio n: 4 bits starting at (4*n)
81 * 0000 = input, 0001 = output, others mean special-function
82 * base + 0x04: Data register, 1 bit per gpio
83 * bit n: data bit n
84 *
85 * Note, since the data register is one bit per gpio and is at base + 0x4
86 * we can use s3c_gpiolib_get and s3c_gpiolib_set to change the state of
87 * the output.
88 */
89
90static int s5pc1xx_gpiolib_input(struct gpio_chip *chip, unsigned offset)
91{
92 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
93 void __iomem *base = ourchip->base;
94 unsigned long con;
95
96 con = __raw_readl(base + OFF_GPCON);
97 con &= ~(0xf << con_4bit_shift(offset));
98 __raw_writel(con, base + OFF_GPCON);
99
100 gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con);
101
102 return 0;
103}
104
105static int s5pc1xx_gpiolib_output(struct gpio_chip *chip,
106 unsigned offset, int value)
107{
108 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
109 void __iomem *base = ourchip->base;
110 unsigned long con;
111 unsigned long dat;
112
113 con = __raw_readl(base + OFF_GPCON);
114 con &= ~(0xf << con_4bit_shift(offset));
115 con |= 0x1 << con_4bit_shift(offset);
116
117 dat = __raw_readl(base + OFF_GPDAT);
118 if (value)
119 dat |= 1 << offset;
120 else
121 dat &= ~(1 << offset);
122
123 __raw_writel(dat, base + OFF_GPDAT);
124 __raw_writel(con, base + OFF_GPCON);
125 __raw_writel(dat, base + OFF_GPDAT);
126
127 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
128
129 return 0;
130}
131
132static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
133{
134 return S3C_IRQ_GPIO(chip->base + offset);
135}
136
137static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
138{
139 int base;
140
141 base = chip->base - S5PC100_GPH0(0);
142 if (base == 0)
143 return IRQ_EINT(offset);
144 base = chip->base - S5PC100_GPH1(0);
145 if (base == 0)
146 return IRQ_EINT(8 + offset);
147 base = chip->base - S5PC100_GPH2(0);
148 if (base == 0)
149 return IRQ_EINT(16 + offset);
150 base = chip->base - S5PC100_GPH3(0);
151 if (base == 0)
152 return IRQ_EINT(24 + offset);
153 return -EINVAL;
154}
155
156static struct s3c_gpio_cfg gpio_cfg = {
157 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
158 .set_pull = s3c_gpio_setpull_updown,
159 .get_pull = s3c_gpio_getpull_updown,
160};
161
162static struct s3c_gpio_cfg gpio_cfg_eint = {
163 .cfg_eint = 0xf,
164 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
165 .set_pull = s3c_gpio_setpull_updown,
166 .get_pull = s3c_gpio_getpull_updown,
167};
168
169static struct s3c_gpio_cfg gpio_cfg_noint = {
170 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
171 .set_pull = s3c_gpio_setpull_updown,
172 .get_pull = s3c_gpio_getpull_updown,
173};
174
175static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
176 {
177 .base = S5PC100_GPA0_BASE,
178 .config = &gpio_cfg,
179 .chip = {
180 .base = S5PC100_GPA0(0),
181 .ngpio = S5PC100_GPIO_A0_NR,
182 .label = "GPA0",
183 },
184 }, {
185 .base = S5PC100_GPA1_BASE,
186 .config = &gpio_cfg,
187 .chip = {
188 .base = S5PC100_GPA1(0),
189 .ngpio = S5PC100_GPIO_A1_NR,
190 .label = "GPA1",
191 },
192 }, {
193 .base = S5PC100_GPB_BASE,
194 .config = &gpio_cfg,
195 .chip = {
196 .base = S5PC100_GPB(0),
197 .ngpio = S5PC100_GPIO_B_NR,
198 .label = "GPB",
199 },
200 }, {
201 .base = S5PC100_GPC_BASE,
202 .config = &gpio_cfg,
203 .chip = {
204 .base = S5PC100_GPC(0),
205 .ngpio = S5PC100_GPIO_C_NR,
206 .label = "GPC",
207 },
208 }, {
209 .base = S5PC100_GPD_BASE,
210 .config = &gpio_cfg,
211 .chip = {
212 .base = S5PC100_GPD(0),
213 .ngpio = S5PC100_GPIO_D_NR,
214 .label = "GPD",
215 },
216 }, {
217 .base = S5PC100_GPE0_BASE,
218 .config = &gpio_cfg,
219 .chip = {
220 .base = S5PC100_GPE0(0),
221 .ngpio = S5PC100_GPIO_E0_NR,
222 .label = "GPE0",
223 },
224 }, {
225 .base = S5PC100_GPE1_BASE,
226 .config = &gpio_cfg,
227 .chip = {
228 .base = S5PC100_GPE1(0),
229 .ngpio = S5PC100_GPIO_E1_NR,
230 .label = "GPE1",
231 },
232 }, {
233 .base = S5PC100_GPF0_BASE,
234 .config = &gpio_cfg,
235 .chip = {
236 .base = S5PC100_GPF0(0),
237 .ngpio = S5PC100_GPIO_F0_NR,
238 .label = "GPF0",
239 },
240 }, {
241 .base = S5PC100_GPF1_BASE,
242 .config = &gpio_cfg,
243 .chip = {
244 .base = S5PC100_GPF1(0),
245 .ngpio = S5PC100_GPIO_F1_NR,
246 .label = "GPF1",
247 },
248 }, {
249 .base = S5PC100_GPF2_BASE,
250 .config = &gpio_cfg,
251 .chip = {
252 .base = S5PC100_GPF2(0),
253 .ngpio = S5PC100_GPIO_F2_NR,
254 .label = "GPF2",
255 },
256 }, {
257 .base = S5PC100_GPF3_BASE,
258 .config = &gpio_cfg,
259 .chip = {
260 .base = S5PC100_GPF3(0),
261 .ngpio = S5PC100_GPIO_F3_NR,
262 .label = "GPF3",
263 },
264 }, {
265 .base = S5PC100_GPG0_BASE,
266 .config = &gpio_cfg,
267 .chip = {
268 .base = S5PC100_GPG0(0),
269 .ngpio = S5PC100_GPIO_G0_NR,
270 .label = "GPG0",
271 },
272 }, {
273 .base = S5PC100_GPG1_BASE,
274 .config = &gpio_cfg,
275 .chip = {
276 .base = S5PC100_GPG1(0),
277 .ngpio = S5PC100_GPIO_G1_NR,
278 .label = "GPG1",
279 },
280 }, {
281 .base = S5PC100_GPG2_BASE,
282 .config = &gpio_cfg,
283 .chip = {
284 .base = S5PC100_GPG2(0),
285 .ngpio = S5PC100_GPIO_G2_NR,
286 .label = "GPG2",
287 },
288 }, {
289 .base = S5PC100_GPG3_BASE,
290 .config = &gpio_cfg,
291 .chip = {
292 .base = S5PC100_GPG3(0),
293 .ngpio = S5PC100_GPIO_G3_NR,
294 .label = "GPG3",
295 },
296 }, {
297 .base = S5PC100_GPH0_BASE,
298 .config = &gpio_cfg_eint,
299 .chip = {
300 .base = S5PC100_GPH0(0),
301 .ngpio = S5PC100_GPIO_H0_NR,
302 .label = "GPH0",
303 },
304 }, {
305 .base = S5PC100_GPH1_BASE,
306 .config = &gpio_cfg_eint,
307 .chip = {
308 .base = S5PC100_GPH1(0),
309 .ngpio = S5PC100_GPIO_H1_NR,
310 .label = "GPH1",
311 },
312 }, {
313 .base = S5PC100_GPH2_BASE,
314 .config = &gpio_cfg_eint,
315 .chip = {
316 .base = S5PC100_GPH2(0),
317 .ngpio = S5PC100_GPIO_H2_NR,
318 .label = "GPH2",
319 },
320 }, {
321 .base = S5PC100_GPH3_BASE,
322 .config = &gpio_cfg_eint,
323 .chip = {
324 .base = S5PC100_GPH3(0),
325 .ngpio = S5PC100_GPIO_H3_NR,
326 .label = "GPH3",
327 },
328 }, {
329 .base = S5PC100_GPI_BASE,
330 .config = &gpio_cfg,
331 .chip = {
332 .base = S5PC100_GPI(0),
333 .ngpio = S5PC100_GPIO_I_NR,
334 .label = "GPI",
335 },
336 }, {
337 .base = S5PC100_GPJ0_BASE,
338 .config = &gpio_cfg,
339 .chip = {
340 .base = S5PC100_GPJ0(0),
341 .ngpio = S5PC100_GPIO_J0_NR,
342 .label = "GPJ0",
343 },
344 }, {
345 .base = S5PC100_GPJ1_BASE,
346 .config = &gpio_cfg,
347 .chip = {
348 .base = S5PC100_GPJ1(0),
349 .ngpio = S5PC100_GPIO_J1_NR,
350 .label = "GPJ1",
351 },
352 }, {
353 .base = S5PC100_GPJ2_BASE,
354 .config = &gpio_cfg,
355 .chip = {
356 .base = S5PC100_GPJ2(0),
357 .ngpio = S5PC100_GPIO_J2_NR,
358 .label = "GPJ2",
359 },
360 }, {
361 .base = S5PC100_GPJ3_BASE,
362 .config = &gpio_cfg,
363 .chip = {
364 .base = S5PC100_GPJ3(0),
365 .ngpio = S5PC100_GPIO_J3_NR,
366 .label = "GPJ3",
367 },
368 }, {
369 .base = S5PC100_GPJ4_BASE,
370 .config = &gpio_cfg,
371 .chip = {
372 .base = S5PC100_GPJ4(0),
373 .ngpio = S5PC100_GPIO_J4_NR,
374 .label = "GPJ4",
375 },
376 }, {
377 .base = S5PC100_GPK0_BASE,
378 .config = &gpio_cfg_noint,
379 .chip = {
380 .base = S5PC100_GPK0(0),
381 .ngpio = S5PC100_GPIO_K0_NR,
382 .label = "GPK0",
383 },
384 }, {
385 .base = S5PC100_GPK1_BASE,
386 .config = &gpio_cfg_noint,
387 .chip = {
388 .base = S5PC100_GPK1(0),
389 .ngpio = S5PC100_GPIO_K1_NR,
390 .label = "GPK1",
391 },
392 }, {
393 .base = S5PC100_GPK2_BASE,
394 .config = &gpio_cfg_noint,
395 .chip = {
396 .base = S5PC100_GPK2(0),
397 .ngpio = S5PC100_GPIO_K2_NR,
398 .label = "GPK2",
399 },
400 }, {
401 .base = S5PC100_GPK3_BASE,
402 .config = &gpio_cfg_noint,
403 .chip = {
404 .base = S5PC100_GPK3(0),
405 .ngpio = S5PC100_GPIO_K3_NR,
406 .label = "GPK3",
407 },
408 }, {
409 .base = S5PC100_GPL0_BASE,
410 .config = &gpio_cfg_noint,
411 .chip = {
412 .base = S5PC100_GPL0(0),
413 .ngpio = S5PC100_GPIO_L0_NR,
414 .label = "GPL0",
415 },
416 }, {
417 .base = S5PC100_GPL1_BASE,
418 .config = &gpio_cfg_noint,
419 .chip = {
420 .base = S5PC100_GPL1(0),
421 .ngpio = S5PC100_GPIO_L1_NR,
422 .label = "GPL1",
423 },
424 }, {
425 .base = S5PC100_GPL2_BASE,
426 .config = &gpio_cfg_noint,
427 .chip = {
428 .base = S5PC100_GPL2(0),
429 .ngpio = S5PC100_GPIO_L2_NR,
430 .label = "GPL2",
431 },
432 }, {
433 .base = S5PC100_GPL3_BASE,
434 .config = &gpio_cfg_noint,
435 .chip = {
436 .base = S5PC100_GPL3(0),
437 .ngpio = S5PC100_GPIO_L3_NR,
438 .label = "GPL3",
439 },
440 }, {
441 .base = S5PC100_GPL4_BASE,
442 .config = &gpio_cfg_noint,
443 .chip = {
444 .base = S5PC100_GPL4(0),
445 .ngpio = S5PC100_GPIO_L4_NR,
446 .label = "GPL4",
447 },
448 },
449};
450
451/* FIXME move from irq-gpio.c */
452extern struct irq_chip s5pc1xx_gpioint;
453extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
454
455static __init void s5pc1xx_gpiolib_link(struct s3c_gpio_chip *chip)
456{
457 chip->chip.direction_input = s5pc1xx_gpiolib_input;
458 chip->chip.direction_output = s5pc1xx_gpiolib_output;
459 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
460
461 /* Interrupt */
462 if (chip->config == &gpio_cfg) {
463 int i, irq;
464
465 chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
466
467 for (i = 0; i < chip->chip.ngpio; i++) {
468 irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
469 set_irq_chip(irq, &s5pc1xx_gpioint);
470 set_irq_data(irq, &chip->chip);
471 set_irq_handler(irq, handle_level_irq);
472 set_irq_flags(irq, IRQF_VALID);
473 }
474 } else if (chip->config == &gpio_cfg_eint)
475 chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
476}
477
478static __init void s5pc1xx_gpiolib_add(struct s3c_gpio_chip *chips,
479 int nr_chips,
480 void (*fn)(struct s3c_gpio_chip *))
481{
482 for (; nr_chips > 0; nr_chips--, chips++) {
483 if (fn)
484 (fn)(chips);
485 s3c_gpiolib_add(chips);
486 }
487}
488
489static __init int s5pc1xx_gpiolib_init(void)
490{
491 struct s3c_gpio_chip *chips;
492 int nr_chips;
493
494 chips = s5pc100_gpio_chips;
495 nr_chips = ARRAY_SIZE(s5pc100_gpio_chips);
496
497 s5pc1xx_gpiolib_add(chips, nr_chips, s5pc1xx_gpiolib_link);
498 /* Interrupt */
499 set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
500
501 return 0;
502}
503core_initcall(s5pc1xx_gpiolib_init);
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
new file mode 100644
index 000000000000..72ad59f61efc
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
@@ -0,0 +1,32 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h
2 *
3 * Copyright 2009 Samsung Electronic
4 *
5 * S5PC1XX Platform - GPIO pin configuration
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
12/* This file contains the necessary definitions to get the basic gpio
13 * pin configuration done such as setting a pin to input or output or
14 * changing the pull-{up,down} configurations.
15 */
16
17#ifndef __GPIO_CFG_S5PC1XX_H
18#define __GPIO_CFG_S5PC1XX_H __FILE__
19
20typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
21
22#define S5P_GPIO_DRVSTR_LV1 0x00
23#define S5P_GPIO_DRVSTR_LV2 0x01
24#define S5P_GPIO_DRVSTR_LV3 0x10
25#define S5P_GPIO_DRVSTR_LV4 0x11
26
27extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off);
28
29extern int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
30 s5p_gpio_drvstr_t drvstr);
31
32#endif /* __GPIO_CFG_S5PC1XX_H */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h
new file mode 100644
index 000000000000..33ad267e8477
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/gpio-ext.h
@@ -0,0 +1,44 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-eint.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 *
5 * External Interrupt (GPH0 ~ GPH3) control register definitions
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
12#define S5PC1XX_WKUP_INT_CON0_7 (S5PC1XX_EINT_BASE + 0x0)
13#define S5PC1XX_WKUP_INT_CON8_15 (S5PC1XX_EINT_BASE + 0x4)
14#define S5PC1XX_WKUP_INT_CON16_23 (S5PC1XX_EINT_BASE + 0x8)
15#define S5PC1XX_WKUP_INT_CON24_31 (S5PC1XX_EINT_BASE + 0xC)
16#define S5PC1XX_WKUP_INT_CON(x) (S5PC1XX_WKUP_INT_CON0_7 + (x * 0x4))
17
18#define S5PC1XX_WKUP_INT_FLTCON0_3 (S5PC1XX_EINT_BASE + 0x80)
19#define S5PC1XX_WKUP_INT_FLTCON4_7 (S5PC1XX_EINT_BASE + 0x84)
20#define S5PC1XX_WKUP_INT_FLTCON8_11 (S5PC1XX_EINT_BASE + 0x88)
21#define S5PC1XX_WKUP_INT_FLTCON12_15 (S5PC1XX_EINT_BASE + 0x8C)
22#define S5PC1XX_WKUP_INT_FLTCON16_19 (S5PC1XX_EINT_BASE + 0x90)
23#define S5PC1XX_WKUP_INT_FLTCON20_23 (S5PC1XX_EINT_BASE + 0x94)
24#define S5PC1XX_WKUP_INT_FLTCON24_27 (S5PC1XX_EINT_BASE + 0x98)
25#define S5PC1XX_WKUP_INT_FLTCON28_31 (S5PC1XX_EINT_BASE + 0x9C)
26#define S5PC1XX_WKUP_INT_FLTCON(x) (S5PC1XX_WKUP_INT_FLTCON0_3 + (x * 0x4))
27
28#define S5PC1XX_WKUP_INT_MASK0_7 (S5PC1XX_EINT_BASE + 0x100)
29#define S5PC1XX_WKUP_INT_MASK8_15 (S5PC1XX_EINT_BASE + 0x104)
30#define S5PC1XX_WKUP_INT_MASK16_23 (S5PC1XX_EINT_BASE + 0x108)
31#define S5PC1XX_WKUP_INT_MASK24_31 (S5PC1XX_EINT_BASE + 0x10C)
32#define S5PC1XX_WKUP_INT_MASK(x) (S5PC1XX_WKUP_INT_MASK0_7 + (x * 0x4))
33
34#define S5PC1XX_WKUP_INT_PEND0_7 (S5PC1XX_EINT_BASE + 0x140)
35#define S5PC1XX_WKUP_INT_PEND8_15 (S5PC1XX_EINT_BASE + 0x144)
36#define S5PC1XX_WKUP_INT_PEND16_23 (S5PC1XX_EINT_BASE + 0x148)
37#define S5PC1XX_WKUP_INT_PEND24_31 (S5PC1XX_EINT_BASE + 0x14C)
38#define S5PC1XX_WKUP_INT_PEND(x) (S5PC1XX_WKUP_INT_PEND0_7 + (x * 0x4))
39
40#define S5PC1XX_WKUP_INT_LOWLEV (0x00)
41#define S5PC1XX_WKUP_INT_HILEV (0x01)
42#define S5PC1XX_WKUP_INT_FALLEDGE (0x02)
43#define S5PC1XX_WKUP_INT_RISEEDGE (0x03)
44#define S5PC1XX_WKUP_INT_BOTHEDGE (0x04)
diff --git a/arch/arm/plat-s5pc1xx/include/plat/irqs.h b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
index f07d8c3b25d6..ef8736366f0d 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/irqs.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
@@ -171,12 +171,21 @@
171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30) 171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)
172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31) 172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31)
173 173
174/* External interrupt */
174#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1) 175#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1)
175 176
176#define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) 177#define S3C_EINT(x) (S3C_IRQ_EINT_BASE + (x - 16))
177#define IRQ_EINT(x) S3C_EINT(x) 178#define IRQ_EINT(x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x))
179#define IRQ_EINT_BIT(x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0))
178 180
179#define NR_IRQS (IRQ_EINT(31)+1) 181/* GPIO interrupt */
182#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1)
183#define S3C_IRQ_GPIO(x) (S3C_IRQ_GPIO_BASE + (x))
184
185/*
186 * Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs
187 */
188#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)
180 189
181#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */ 190#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */
182 191
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
index 75c8390cb827..c5cc86e92d65 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
@@ -13,68 +13,69 @@
13#ifndef __PLAT_REGS_CLOCK_H 13#ifndef __PLAT_REGS_CLOCK_H
14#define __PLAT_REGS_CLOCK_H __FILE__ 14#define __PLAT_REGS_CLOCK_H __FILE__
15 15
16#define S5PC1XX_CLKREG(x) (S5PC1XX_VA_CLK + (x)) 16#define S5PC100_CLKREG(x) (S5PC1XX_VA_CLK + (x))
17 17#define S5PC100_CLKREG_OTHER(x) (S5PC1XX_VA_CLK_OTHER + (x))
18#define S5PC1XX_APLL_LOCK S5PC1XX_CLKREG(0x00) 18
19#define S5PC1XX_MPLL_LOCK S5PC1XX_CLKREG(0x04) 19/* s5pc100 register for clock */
20#define S5PC1XX_EPLL_LOCK S5PC1XX_CLKREG(0x08) 20#define S5PC100_APLL_LOCK S5PC100_CLKREG(0x00)
21#define S5PC100_HPLL_LOCK S5PC1XX_CLKREG(0x0C) 21#define S5PC100_MPLL_LOCK S5PC100_CLKREG(0x04)
22 22#define S5PC100_EPLL_LOCK S5PC100_CLKREG(0x08)
23#define S5PC1XX_APLL_CON S5PC1XX_CLKREG(0x100) 23#define S5PC100_HPLL_LOCK S5PC100_CLKREG(0x0C)
24#define S5PC1XX_MPLL_CON S5PC1XX_CLKREG(0x104) 24
25#define S5PC1XX_EPLL_CON S5PC1XX_CLKREG(0x108) 25#define S5PC100_APLL_CON S5PC100_CLKREG(0x100)
26#define S5PC100_HPLL_CON S5PC1XX_CLKREG(0x10C) 26#define S5PC100_MPLL_CON S5PC100_CLKREG(0x104)
27 27#define S5PC100_EPLL_CON S5PC100_CLKREG(0x108)
28#define S5PC1XX_CLK_SRC0 S5PC1XX_CLKREG(0x200) 28#define S5PC100_HPLL_CON S5PC100_CLKREG(0x10C)
29#define S5PC1XX_CLK_SRC1 S5PC1XX_CLKREG(0x204) 29
30#define S5PC1XX_CLK_SRC2 S5PC1XX_CLKREG(0x208) 30#define S5PC100_CLKSRC0 S5PC100_CLKREG(0x200)
31#define S5PC1XX_CLK_SRC3 S5PC1XX_CLKREG(0x20C) 31#define S5PC100_CLKSRC1 S5PC100_CLKREG(0x204)
32 32#define S5PC100_CLKSRC2 S5PC100_CLKREG(0x208)
33#define S5PC1XX_CLK_DIV0 S5PC1XX_CLKREG(0x300) 33#define S5PC100_CLKSRC3 S5PC100_CLKREG(0x20C)
34#define S5PC1XX_CLK_DIV1 S5PC1XX_CLKREG(0x304) 34
35#define S5PC1XX_CLK_DIV2 S5PC1XX_CLKREG(0x308) 35#define S5PC100_CLKDIV0 S5PC100_CLKREG(0x300)
36#define S5PC1XX_CLK_DIV3 S5PC1XX_CLKREG(0x30C) 36#define S5PC100_CLKDIV1 S5PC100_CLKREG(0x304)
37#define S5PC1XX_CLK_DIV4 S5PC1XX_CLKREG(0x310) 37#define S5PC100_CLKDIV2 S5PC100_CLKREG(0x308)
38 38#define S5PC100_CLKDIV3 S5PC100_CLKREG(0x30C)
39#define S5PC100_CLK_OUT S5PC1XX_CLKREG(0x400) 39#define S5PC100_CLKDIV4 S5PC100_CLKREG(0x310)
40 40
41#define S5PC100_CLKGATE_D00 S5PC1XX_CLKREG(0x500) 41#define S5PC100_CLK_OUT S5PC100_CLKREG(0x400)
42#define S5PC100_CLKGATE_D01 S5PC1XX_CLKREG(0x504) 42
43#define S5PC100_CLKGATE_D02 S5PC1XX_CLKREG(0x508) 43#define S5PC100_CLKGATE_D00 S5PC100_CLKREG(0x500)
44 44#define S5PC100_CLKGATE_D01 S5PC100_CLKREG(0x504)
45#define S5PC100_CLKGATE_D10 S5PC1XX_CLKREG(0x520) 45#define S5PC100_CLKGATE_D02 S5PC100_CLKREG(0x508)
46#define S5PC100_CLKGATE_D11 S5PC1XX_CLKREG(0x524) 46
47#define S5PC100_CLKGATE_D12 S5PC1XX_CLKREG(0x528) 47#define S5PC100_CLKGATE_D10 S5PC100_CLKREG(0x520)
48#define S5PC100_CLKGATE_D13 S5PC1XX_CLKREG(0x52C) 48#define S5PC100_CLKGATE_D11 S5PC100_CLKREG(0x524)
49#define S5PC100_CLKGATE_D14 S5PC1XX_CLKREG(0x530) 49#define S5PC100_CLKGATE_D12 S5PC100_CLKREG(0x528)
50#define S5PC100_CLKGATE_D15 S5PC1XX_CLKREG(0x534) 50#define S5PC100_CLKGATE_D13 S5PC100_CLKREG(0x52C)
51 51#define S5PC100_CLKGATE_D14 S5PC100_CLKREG(0x530)
52#define S5PC100_CLKGATE_D20 S5PC1XX_CLKREG(0x540) 52#define S5PC100_CLKGATE_D15 S5PC100_CLKREG(0x534)
53 53
54#define S5PC100_SCLKGATE0 S5PC1XX_CLKREG(0x560) 54#define S5PC100_CLKGATE_D20 S5PC100_CLKREG(0x540)
55#define S5PC100_SCLKGATE1 S5PC1XX_CLKREG(0x564) 55
56 56#define S5PC100_SCLKGATE0 S5PC100_CLKREG(0x560)
57#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) 57#define S5PC100_SCLKGATE1 S5PC100_CLKREG(0x564)
58 58
59#define S5PC1XX_EPLL_EN (1<<31) 59/* EPLL_CON */
60#define S5PC1XX_EPLL_MASK 0xffffffff 60#define S5PC100_EPLL_EN (1<<31)
61#define S5PC1XX_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s))) 61#define S5PC100_EPLL_MASK 0xffffffff
62#define S5PC100_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
62 63
63/* CLKSRC0 */ 64/* CLKSRC0 */
64#define S5PC1XX_CLKSRC0_APLL_MASK (0x1<<0) 65#define S5PC100_CLKSRC0_APLL_MASK (0x1<<0)
65#define S5PC1XX_CLKSRC0_APLL_SHIFT (0) 66#define S5PC100_CLKSRC0_APLL_SHIFT (0)
66#define S5PC1XX_CLKSRC0_MPLL_MASK (0x1<<4) 67#define S5PC100_CLKSRC0_MPLL_MASK (0x1<<4)
67#define S5PC1XX_CLKSRC0_MPLL_SHIFT (4) 68#define S5PC100_CLKSRC0_MPLL_SHIFT (4)
68#define S5PC1XX_CLKSRC0_EPLL_MASK (0x1<<8) 69#define S5PC100_CLKSRC0_EPLL_MASK (0x1<<8)
69#define S5PC1XX_CLKSRC0_EPLL_SHIFT (8) 70#define S5PC100_CLKSRC0_EPLL_SHIFT (8)
70#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12) 71#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12)
71#define S5PC100_CLKSRC0_HPLL_SHIFT (12) 72#define S5PC100_CLKSRC0_HPLL_SHIFT (12)
72#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16) 73#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16)
73#define S5PC100_CLKSRC0_AMMUX_SHIFT (16) 74#define S5PC100_CLKSRC0_AMMUX_SHIFT (16)
74#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20) 75#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20)
75#define S5PC100_CLKSRC0_HREF_SHIFT (20) 76#define S5PC100_CLKSRC0_HREF_SHIFT (20)
76#define S5PC1XX_CLKSRC0_ONENAND_MASK (0x1<<24) 77#define S5PC100_CLKSRC0_ONENAND_MASK (0x1<<24)
77#define S5PC1XX_CLKSRC0_ONENAND_SHIFT (24) 78#define S5PC100_CLKSRC0_ONENAND_SHIFT (24)
78 79
79 80
80/* CLKSRC1 */ 81/* CLKSRC1 */
@@ -127,10 +128,9 @@
127#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24) 128#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24)
128#define S5PC100_CLKSRC3_SPDIF_SHIFT (24) 129#define S5PC100_CLKSRC3_SPDIF_SHIFT (24)
129 130
130
131/* CLKDIV0 */ 131/* CLKDIV0 */
132#define S5PC1XX_CLKDIV0_APLL_MASK (0x1<<0) 132#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0)
133#define S5PC1XX_CLKDIV0_APLL_SHIFT (0) 133#define S5PC100_CLKDIV0_APLL_SHIFT (0)
134#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4) 134#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4)
135#define S5PC100_CLKDIV0_ARM_SHIFT (4) 135#define S5PC100_CLKDIV0_ARM_SHIFT (4)
136#define S5PC100_CLKDIV0_D0_MASK (0x7<<8) 136#define S5PC100_CLKDIV0_D0_MASK (0x7<<8)
@@ -141,8 +141,8 @@
141#define S5PC100_CLKDIV0_SECSS_SHIFT (16) 141#define S5PC100_CLKDIV0_SECSS_SHIFT (16)
142 142
143/* CLKDIV1 */ 143/* CLKDIV1 */
144#define S5PC100_CLKDIV1_AM_MASK (0x7<<0) 144#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0)
145#define S5PC100_CLKDIV1_AM_SHIFT (0) 145#define S5PC100_CLKDIV1_APLL2_SHIFT (0)
146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4) 146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)
147#define S5PC100_CLKDIV1_MPLL_SHIFT (4) 147#define S5PC100_CLKDIV1_MPLL_SHIFT (4)
148#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8) 148#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8)
@@ -202,7 +202,6 @@
202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20) 202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20)
203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20) 203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20)
204 204
205
206/* HCLKD0/PCLKD0 Clock Gate 0 Registers */ 205/* HCLKD0/PCLKD0 Clock Gate 0 Registers */
207#define S5PC100_CLKGATE_D00_INTC (1<<0) 206#define S5PC100_CLKGATE_D00_INTC (1<<0)
208#define S5PC100_CLKGATE_D00_TZIC (1<<1) 207#define S5PC100_CLKGATE_D00_TZIC (1<<1)
@@ -295,8 +294,8 @@
295#define S5PC100_CLKGATE_D20_I2SD2 (1<<1) 294#define S5PC100_CLKGATE_D20_I2SD2 (1<<1)
296 295
297/* Special Clock Gate 0 Registers */ 296/* Special Clock Gate 0 Registers */
298#define S5PC1XX_CLKGATE_SCLK0_HPM (1<<0) 297#define S5PC100_CLKGATE_SCLK0_HPM (1<<0)
299#define S5PC1XX_CLKGATE_SCLK0_PWI (1<<1) 298#define S5PC100_CLKGATE_SCLK0_PWI (1<<1)
300#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2) 299#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2)
301#define S5PC100_CLKGATE_SCLK0_UART (1<<3) 300#define S5PC100_CLKGATE_SCLK0_UART (1<<3)
302#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4) 301#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4)
@@ -329,89 +328,28 @@
329#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11) 328#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11)
330#define S5PC100_CLKGATE_SCLK1_CAM (1<<12) 329#define S5PC100_CLKGATE_SCLK1_CAM (1<<12)
331 330
332/* register for power management */ 331#define S5PC100_SWRESET S5PC100_CLKREG_OTHER(0x000)
333#define S5PC100_PWR_CFG S5PC1XX_CLKREG(0x8000) 332#define S5PC100_OND_SWRESET S5PC100_CLKREG_OTHER(0x008)
334#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_CLKREG(0x8004) 333#define S5PC100_GEN_CTRL S5PC100_CLKREG_OTHER(0x100)
335#define S5PC100_NORMAL_CFG S5PC1XX_CLKREG(0x8010) 334#define S5PC100_GEN_STATUS S5PC100_CLKREG_OTHER(0x104)
336#define S5PC100_STOP_CFG S5PC1XX_CLKREG(0x8014) 335#define S5PC100_MEM_SYS_CFG S5PC100_CLKREG_OTHER(0x200)
337#define S5PC100_SLEEP_CFG S5PC1XX_CLKREG(0x8018) 336#define S5PC100_CAM_MUX_SEL S5PC100_CLKREG_OTHER(0x300)
338#define S5PC100_STOP_MEM_CFG S5PC1XX_CLKREG(0x801C) 337#define S5PC100_MIXER_OUT_SEL S5PC100_CLKREG_OTHER(0x304)
339#define S5PC100_OSC_FREQ S5PC1XX_CLKREG(0x8100) 338#define S5PC100_LPMP_MODE_SEL S5PC100_CLKREG_OTHER(0x308)
340#define S5PC100_OSC_STABLE S5PC1XX_CLKREG(0x8104) 339#define S5PC100_MIPI_PHY_CON0 S5PC100_CLKREG_OTHER(0x400)
341#define S5PC100_PWR_STABLE S5PC1XX_CLKREG(0x8108) 340#define S5PC100_MIPI_PHY_CON1 S5PC100_CLKREG_OTHER(0x414)
342#define S5PC100_MTC_STABLE S5PC1XX_CLKREG(0x8110) 341#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420)
343#define S5PC100_CLAMP_STABLE S5PC1XX_CLKREG(0x8114) 342
344#define S5PC100_OTHERS S5PC1XX_CLKREG(0x8200) 343#define S5PC100_SWRESET_RESETVAL 0xc100
345#define S5PC100_RST_STAT S5PC1XX_CLKREG(0x8300)
346#define S5PC100_WAKEUP_STAT S5PC1XX_CLKREG(0x8304)
347#define S5PC100_BLK_PWR_STAT S5PC1XX_CLKREG(0x8308)
348#define S5PC100_INFORM0 S5PC1XX_CLKREG(0x8400)
349#define S5PC100_INFORM1 S5PC1XX_CLKREG(0x8404)
350#define S5PC100_INFORM2 S5PC1XX_CLKREG(0x8408)
351#define S5PC100_INFORM3 S5PC1XX_CLKREG(0x840C)
352#define S5PC100_INFORM4 S5PC1XX_CLKREG(0x8410)
353#define S5PC100_INFORM5 S5PC1XX_CLKREG(0x8414)
354#define S5PC100_INFORM6 S5PC1XX_CLKREG(0x8418)
355#define S5PC100_INFORM7 S5PC1XX_CLKREG(0x841C)
356#define S5PC100_DCGIDX_MAP0 S5PC1XX_CLKREG(0x8500)
357#define S5PC100_DCGIDX_MAP1 S5PC1XX_CLKREG(0x8504)
358#define S5PC100_DCGIDX_MAP2 S5PC1XX_CLKREG(0x8508)
359#define S5PC100_DCGPERF_MAP0 S5PC1XX_CLKREG(0x850C)
360#define S5PC100_DCGPERF_MAP1 S5PC1XX_CLKREG(0x8510)
361#define S5PC100_DVCIDX_MAP S5PC1XX_CLKREG(0x8514)
362#define S5PC100_FREQ_CPU S5PC1XX_CLKREG(0x8518)
363#define S5PC100_FREQ_DPM S5PC1XX_CLKREG(0x851C)
364#define S5PC100_DVSEMCLK_EN S5PC1XX_CLKREG(0x8520)
365#define S5PC100_APLL_CON_L8 S5PC1XX_CLKREG(0x8600)
366#define S5PC100_APLL_CON_L7 S5PC1XX_CLKREG(0x8604)
367#define S5PC100_APLL_CON_L6 S5PC1XX_CLKREG(0x8608)
368#define S5PC100_APLL_CON_L5 S5PC1XX_CLKREG(0x860C)
369#define S5PC100_APLL_CON_L4 S5PC1XX_CLKREG(0x8610)
370#define S5PC100_APLL_CON_L3 S5PC1XX_CLKREG(0x8614)
371#define S5PC100_APLL_CON_L2 S5PC1XX_CLKREG(0x8618)
372#define S5PC100_APLL_CON_L1 S5PC1XX_CLKREG(0x861C)
373#define S5PC100_IEM_CONTROL S5PC1XX_CLKREG(0x8620)
374#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_CLKREG(0x8700)
375#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_CLKREG(0x8704)
376#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_CLKREG(0x8708)
377#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_CLKREG(0x870C)
378#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_CLKREG(0x8710)
379#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_CLKREG(0x8714)
380#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_CLKREG(0x8718)
381#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_CLKREG(0x871C)
382#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_CLKREG(0x8724)
383
384#define S5PC100_SWRESET S5PC1XX_CLKREG(0x100000)
385#define S5PC100_OND_SWRESET S5PC1XX_CLKREG(0x100008)
386#define S5PC100_GEN_CTRL S5PC1XX_CLKREG(0x100100)
387#define S5PC100_GEN_STATUS S5PC1XX_CLKREG(0x100104)
388#define S5PC100_MEM_SYS_CFG S5PC1XX_CLKREG(0x100200)
389#define S5PC100_CAM_MUX_SEL S5PC1XX_CLKREG(0x100300)
390#define S5PC100_MIXER_OUT_SEL S5PC1XX_CLKREG(0x100304)
391#define S5PC100_LPMP_MODE_SEL S5PC1XX_CLKREG(0x100308)
392#define S5PC100_MIPI_PHY_CON0 S5PC1XX_CLKREG(0x100400)
393#define S5PC100_MIPI_PHY_CON1 S5PC1XX_CLKREG(0x100414)
394#define S5PC100_HDMI_PHY_CON0 S5PC1XX_CLKREG(0x100420)
395
396#define S5PC100_CFG_WFI_CLEAN (~(3<<5))
397#define S5PC100_CFG_WFI_IDLE (1<<5)
398#define S5PC100_CFG_WFI_STOP (2<<5)
399#define S5PC100_CFG_WFI_SLEEP (3<<5)
400
401#define S5PC100_OTHER_SYS_INT 24 344#define S5PC100_OTHER_SYS_INT 24
402#define S5PC100_OTHER_STA_TYPE 23 345#define S5PC100_OTHER_STA_TYPE 23
403#define STA_TYPE_EXPON 0 346#define STA_TYPE_EXPON 0
404#define STA_TYPE_SFR 1 347#define STA_TYPE_SFR 1
405 348
406#define S5PC100_PWR_STA_EXP_SCALE 0
407#define S5PC100_PWR_STA_CNT 4
408
409#define S5PC100_PWR_STABLE_COUNT 85500
410
411#define S5PC100_SLEEP_CFG_OSC_EN 0 349#define S5PC100_SLEEP_CFG_OSC_EN 0
412 350
413/* OTHERS Resgister */ 351/* OTHERS Resgister */
414#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16) 352#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16)
415#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28) 353#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28)
416 354
417/* MIPI D-PHY Control Register 0 */ 355/* MIPI D-PHY Control Register 0 */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h b/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
new file mode 100644
index 000000000000..43c7bc8bf784
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
@@ -0,0 +1,70 @@
1/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC1XX - GPIO register definitions
7 */
8
9#ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H
10#define __ASM_PLAT_S5PC1XX_REGS_GPIO_H __FILE__
11
12#include <mach/map.h>
13
14/* S5PC100 */
15#define S5PC100_GPIO_BASE S5PC1XX_VA_GPIO
16#define S5PC100_GPA0_BASE (S5PC100_GPIO_BASE + 0x0000)
17#define S5PC100_GPA1_BASE (S5PC100_GPIO_BASE + 0x0020)
18#define S5PC100_GPB_BASE (S5PC100_GPIO_BASE + 0x0040)
19#define S5PC100_GPC_BASE (S5PC100_GPIO_BASE + 0x0060)
20#define S5PC100_GPD_BASE (S5PC100_GPIO_BASE + 0x0080)
21#define S5PC100_GPE0_BASE (S5PC100_GPIO_BASE + 0x00A0)
22#define S5PC100_GPE1_BASE (S5PC100_GPIO_BASE + 0x00C0)
23#define S5PC100_GPF0_BASE (S5PC100_GPIO_BASE + 0x00E0)
24#define S5PC100_GPF1_BASE (S5PC100_GPIO_BASE + 0x0100)
25#define S5PC100_GPF2_BASE (S5PC100_GPIO_BASE + 0x0120)
26#define S5PC100_GPF3_BASE (S5PC100_GPIO_BASE + 0x0140)
27#define S5PC100_GPG0_BASE (S5PC100_GPIO_BASE + 0x0160)
28#define S5PC100_GPG1_BASE (S5PC100_GPIO_BASE + 0x0180)
29#define S5PC100_GPG2_BASE (S5PC100_GPIO_BASE + 0x01A0)
30#define S5PC100_GPG3_BASE (S5PC100_GPIO_BASE + 0x01C0)
31#define S5PC100_GPH0_BASE (S5PC100_GPIO_BASE + 0x0C00)
32#define S5PC100_GPH1_BASE (S5PC100_GPIO_BASE + 0x0C20)
33#define S5PC100_GPH2_BASE (S5PC100_GPIO_BASE + 0x0C40)
34#define S5PC100_GPH3_BASE (S5PC100_GPIO_BASE + 0x0C60)
35#define S5PC100_GPI_BASE (S5PC100_GPIO_BASE + 0x01E0)
36#define S5PC100_GPJ0_BASE (S5PC100_GPIO_BASE + 0x0200)
37#define S5PC100_GPJ1_BASE (S5PC100_GPIO_BASE + 0x0220)
38#define S5PC100_GPJ2_BASE (S5PC100_GPIO_BASE + 0x0240)
39#define S5PC100_GPJ3_BASE (S5PC100_GPIO_BASE + 0x0260)
40#define S5PC100_GPJ4_BASE (S5PC100_GPIO_BASE + 0x0280)
41#define S5PC100_GPK0_BASE (S5PC100_GPIO_BASE + 0x02A0)
42#define S5PC100_GPK1_BASE (S5PC100_GPIO_BASE + 0x02C0)
43#define S5PC100_GPK2_BASE (S5PC100_GPIO_BASE + 0x02E0)
44#define S5PC100_GPK3_BASE (S5PC100_GPIO_BASE + 0x0300)
45#define S5PC100_GPL0_BASE (S5PC100_GPIO_BASE + 0x0320)
46#define S5PC100_GPL1_BASE (S5PC100_GPIO_BASE + 0x0340)
47#define S5PC100_GPL2_BASE (S5PC100_GPIO_BASE + 0x0360)
48#define S5PC100_GPL3_BASE (S5PC100_GPIO_BASE + 0x0380)
49#define S5PC100_GPL4_BASE (S5PC100_GPIO_BASE + 0x03A0)
50#define S5PC100_EINT_BASE (S5PC100_GPIO_BASE + 0x0E00)
51
52#define S5PC100_UHOST (S5PC100_GPIO_BASE + 0x0B68)
53#define S5PC100_PDNEN (S5PC100_GPIO_BASE + 0x0F80)
54
55/* PDNEN */
56#define S5PC100_PDNEN_CFG_PDNEN (1 << 1)
57#define S5PC100_PDNEN_CFG_AUTO (0 << 1)
58#define S5PC100_PDNEN_POWERDOWN (1 << 0)
59#define S5PC100_PDNEN_NORMAL (0 << 0)
60
61/* Common part */
62/* External interrupt base is same at both s5pc100 and s5pc110 */
63#define S5PC1XX_EINT_BASE (S5PC100_EINT_BASE)
64
65#define S5PC100_GPx_INPUT(__gpio) (0x0 << ((__gpio) * 4))
66#define S5PC100_GPx_OUTPUT(__gpio) (0x1 << ((__gpio) * 4))
67#define S5PC100_GPx_CONMASK(__gpio) (0xf << ((__gpio) * 4))
68
69#endif /* __ASM_PLAT_S5PC1XX_REGS_GPIO_H */
70
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-power.h b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
new file mode 100644
index 000000000000..02ffa491b53a
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-power.h
@@ -0,0 +1,84 @@
1/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Jongse Won <jongse.won@samsung.com>
5 *
6 * S5PC1XX clock register definitions
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#ifndef __ASM_ARM_REGS_PWR
14#define __ASM_ARM_REGS_PWR __FILE__
15
16#define S5PC1XX_PWRREG(x) (S5PC1XX_VA_PWR + (x))
17
18/* s5pc100 (0xE0108000) register for power management */
19#define S5PC100_PWR_CFG S5PC1XX_PWRREG(0x0)
20#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_PWRREG(0x4)
21#define S5PC100_NORMAL_CFG S5PC1XX_PWRREG(0x10)
22#define S5PC100_STOP_CFG S5PC1XX_PWRREG(0x14)
23#define S5PC100_SLEEP_CFG S5PC1XX_PWRREG(0x18)
24#define S5PC100_STOP_MEM_CFG S5PC1XX_PWRREG(0x1C)
25#define S5PC100_OSC_FREQ S5PC1XX_PWRREG(0x100)
26#define S5PC100_OSC_STABLE S5PC1XX_PWRREG(0x104)
27#define S5PC100_PWR_STABLE S5PC1XX_PWRREG(0x108)
28#define S5PC100_MTC_STABLE S5PC1XX_PWRREG(0x110)
29#define S5PC100_CLAMP_STABLE S5PC1XX_PWRREG(0x114)
30#define S5PC100_OTHERS S5PC1XX_PWRREG(0x200)
31#define S5PC100_RST_STAT S5PC1XX_PWRREG(0x300)
32#define S5PC100_WAKEUP_STAT S5PC1XX_PWRREG(0x304)
33#define S5PC100_BLK_PWR_STAT S5PC1XX_PWRREG(0x308)
34#define S5PC100_INFORM0 S5PC1XX_PWRREG(0x400)
35#define S5PC100_INFORM1 S5PC1XX_PWRREG(0x404)
36#define S5PC100_INFORM2 S5PC1XX_PWRREG(0x408)
37#define S5PC100_INFORM3 S5PC1XX_PWRREG(0x40C)
38#define S5PC100_INFORM4 S5PC1XX_PWRREG(0x410)
39#define S5PC100_INFORM5 S5PC1XX_PWRREG(0x414)
40#define S5PC100_INFORM6 S5PC1XX_PWRREG(0x418)
41#define S5PC100_INFORM7 S5PC1XX_PWRREG(0x41C)
42#define S5PC100_DCGIDX_MAP0 S5PC1XX_PWRREG(0x500)
43#define S5PC100_DCGIDX_MAP1 S5PC1XX_PWRREG(0x504)
44#define S5PC100_DCGIDX_MAP2 S5PC1XX_PWRREG(0x508)
45#define S5PC100_DCGPERF_MAP0 S5PC1XX_PWRREG(0x50C)
46#define S5PC100_DCGPERF_MAP1 S5PC1XX_PWRREG(0x510)
47#define S5PC100_DVCIDX_MAP S5PC1XX_PWRREG(0x514)
48#define S5PC100_FREQ_CPU S5PC1XX_PWRREG(0x518)
49#define S5PC100_FREQ_DPM S5PC1XX_PWRREG(0x51C)
50#define S5PC100_DVSEMCLK_EN S5PC1XX_PWRREG(0x520)
51#define S5PC100_APLL_CON_L8 S5PC1XX_PWRREG(0x600)
52#define S5PC100_APLL_CON_L7 S5PC1XX_PWRREG(0x604)
53#define S5PC100_APLL_CON_L6 S5PC1XX_PWRREG(0x608)
54#define S5PC100_APLL_CON_L5 S5PC1XX_PWRREG(0x60C)
55#define S5PC100_APLL_CON_L4 S5PC1XX_PWRREG(0x610)
56#define S5PC100_APLL_CON_L3 S5PC1XX_PWRREG(0x614)
57#define S5PC100_APLL_CON_L2 S5PC1XX_PWRREG(0x618)
58#define S5PC100_APLL_CON_L1 S5PC1XX_PWRREG(0x61C)
59#define S5PC100_IEM_CONTROL S5PC1XX_PWRREG(0x620)
60#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_PWRREG(0x700)
61#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_PWRREG(0x704)
62#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_PWRREG(0x708)
63#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_PWRREG(0x70C)
64#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_PWRREG(0x710)
65#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_PWRREG(0x714)
66#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_PWRREG(0x718)
67#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_PWRREG(0x71C)
68#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_PWRREG(0x724)
69
70/* PWR_CFG */
71#define S5PC100_PWRCFG_CFG_DEEP_IDLE (1 << 31)
72#define S5PC100_PWRCFG_CFG_WFI_MASK (3 << 5)
73#define S5PC100_PWRCFG_CFG_WFI_IDLE (0 << 5)
74#define S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE (1 << 5)
75#define S5PC100_PWRCFG_CFG_WFI_STOP (2 << 5)
76#define S5PC100_PWRCFG_CFG_WFI_SLEEP (3 << 5)
77
78/* SLEEP_CFG */
79#define S5PC100_SLEEP_OSC_EN_SLEEP (1 << 0)
80
81/* OTHERS */
82#define S5PC100_PMU_INT_DISABLE (1 << 24)
83
84#endif /* __ASM_ARM_REGS_PWR */
diff --git a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
index 45e275131665..2531f34a56f3 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
@@ -35,10 +35,9 @@ extern struct clk clk_hpll;
35extern struct clk clk_hd0; 35extern struct clk clk_hd0;
36extern struct clk clk_pd0; 36extern struct clk clk_pd0;
37extern struct clk clk_54m; 37extern struct clk clk_54m;
38extern struct clk clk_dout_mpll2;
39extern void s5pc1xx_register_clocks(void); 38extern void s5pc1xx_register_clocks(void);
40extern int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable); 39extern int s5pc100_sclk0_ctrl(struct clk *clk, int enable);
41extern int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable); 40extern int s5pc100_sclk1_ctrl(struct clk *clk, int enable);
42 41
43/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */ 42/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */
44extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[]; 43extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];
diff --git a/arch/arm/plat-s5pc1xx/irq-eint.c b/arch/arm/plat-s5pc1xx/irq-eint.c
new file mode 100644
index 000000000000..373122f57d56
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/irq-eint.c
@@ -0,0 +1,281 @@
1/*
2 * linux/arch/arm/plat-s5pc1xx/irq-eint.c
3 *
4 * Copyright 2009 Samsung Electronics Co.
5 * Byungho Min <bhmin@samsung.com>
6 * Kyungin Park <kyungmin.park@samsung.com>
7 *
8 * Based on plat-s3c64xx/irq-eint.c
9 *
10 * S5PC1XX - Interrupt handling for IRQ_EINT(x)
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/interrupt.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21#include <linux/sysdev.h>
22#include <linux/pm.h>
23#include <linux/gpio.h>
24
25#include <asm/hardware/vic.h>
26
27#include <mach/map.h>
28
29#include <plat/gpio-cfg.h>
30#include <plat/gpio-ext.h>
31#include <plat/pm.h>
32#include <plat/regs-gpio.h>
33#include <plat/regs-irqtype.h>
34
35/*
36 * bank is a group of external interrupt
37 * bank0 means EINT0 ... EINT7
38 * bank1 means EINT8 ... EINT15
39 * bank2 means EINT16 ... EINT23
40 * bank3 means EINT24 ... EINT31
41 */
42
43static inline int s3c_get_eint(unsigned int irq)
44{
45 int real;
46
47 if (irq < IRQ_EINT16_31)
48 real = (irq - IRQ_EINT0);
49 else
50 real = (irq - S3C_IRQ_EINT_BASE) + IRQ_EINT16_31 - IRQ_EINT0;
51
52 return real;
53}
54
55static inline int s3c_get_bank(unsigned int irq)
56{
57 return s3c_get_eint(irq) >> 3;
58}
59
60static inline int s3c_eint_to_bit(unsigned int irq)
61{
62 int real, bit;
63
64 real = s3c_get_eint(irq);
65 bit = 1 << (real & (8 - 1));
66
67 return bit;
68}
69
70static inline void s3c_irq_eint_mask(unsigned int irq)
71{
72 u32 mask;
73 u32 bank = s3c_get_bank(irq);
74
75 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
76 mask |= s3c_eint_to_bit(irq);
77 __raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
78}
79
80static void s3c_irq_eint_unmask(unsigned int irq)
81{
82 u32 mask;
83 u32 bank = s3c_get_bank(irq);
84
85 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
86 mask &= ~(s3c_eint_to_bit(irq));
87 __raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
88}
89
90static inline void s3c_irq_eint_ack(unsigned int irq)
91{
92 u32 bank = s3c_get_bank(irq);
93
94 __raw_writel(s3c_eint_to_bit(irq), S5PC1XX_WKUP_INT_PEND(bank));
95}
96
97static void s3c_irq_eint_maskack(unsigned int irq)
98{
99 /* compiler should in-line these */
100 s3c_irq_eint_mask(irq);
101 s3c_irq_eint_ack(irq);
102}
103
104static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
105{
106 u32 bank = s3c_get_bank(irq);
107 int real = s3c_get_eint(irq);
108 int gpio, shift, sfn;
109 u32 ctrl, con = 0;
110
111 switch (type) {
112 case IRQ_TYPE_NONE:
113 printk(KERN_WARNING "No edge setting!\n");
114 break;
115
116 case IRQ_TYPE_EDGE_RISING:
117 con = S5PC1XX_WKUP_INT_RISEEDGE;
118 break;
119
120 case IRQ_TYPE_EDGE_FALLING:
121 con = S5PC1XX_WKUP_INT_FALLEDGE;
122 break;
123
124 case IRQ_TYPE_EDGE_BOTH:
125 con = S5PC1XX_WKUP_INT_BOTHEDGE;
126 break;
127
128 case IRQ_TYPE_LEVEL_LOW:
129 con = S5PC1XX_WKUP_INT_LOWLEV;
130 break;
131
132 case IRQ_TYPE_LEVEL_HIGH:
133 con = S5PC1XX_WKUP_INT_HILEV;
134 break;
135
136 default:
137 printk(KERN_ERR "No such irq type %d", type);
138 return -EINVAL;
139 }
140
141 gpio = real & (8 - 1);
142 shift = gpio << 2;
143
144 ctrl = __raw_readl(S5PC1XX_WKUP_INT_CON(bank));
145 ctrl &= ~(0x7 << shift);
146 ctrl |= con << shift;
147 __raw_writel(ctrl, S5PC1XX_WKUP_INT_CON(bank));
148
149 switch (real) {
150 case 0 ... 7:
151 gpio = S5PC100_GPH0(gpio);
152 break;
153 case 8 ... 15:
154 gpio = S5PC100_GPH1(gpio);
155 break;
156 case 16 ... 23:
157 gpio = S5PC100_GPH2(gpio);
158 break;
159 case 24 ... 31:
160 gpio = S5PC100_GPH3(gpio);
161 break;
162 default:
163 return -EINVAL;
164 }
165
166 sfn = S3C_GPIO_SFN(0x2);
167 s3c_gpio_cfgpin(gpio, sfn);
168
169 return 0;
170}
171
172static struct irq_chip s3c_irq_eint = {
173 .name = "EINT",
174 .mask = s3c_irq_eint_mask,
175 .unmask = s3c_irq_eint_unmask,
176 .mask_ack = s3c_irq_eint_maskack,
177 .ack = s3c_irq_eint_ack,
178 .set_type = s3c_irq_eint_set_type,
179 .set_wake = s3c_irqext_wake,
180};
181
182/* s3c_irq_demux_eint
183 *
184 * This function demuxes the IRQ from external interrupts,
185 * from IRQ_EINT(16) to IRQ_EINT(31). It is designed to be inlined into
186 * the specific handlers s3c_irq_demux_eintX_Y.
187 */
188static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
189{
190 u32 status = __raw_readl(S5PC1XX_WKUP_INT_PEND((start >> 3)));
191 u32 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK((start >> 3)));
192 unsigned int irq;
193
194 status &= ~mask;
195 status &= (1 << (end - start + 1)) - 1;
196
197 for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
198 if (status & 1)
199 generic_handle_irq(irq);
200
201 status >>= 1;
202 }
203}
204
205static void s3c_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
206{
207 s3c_irq_demux_eint(16, 23);
208 s3c_irq_demux_eint(24, 31);
209}
210
211/*
212 * Handle EINT0 ... EINT15 at VIC directly
213 */
214static void s3c_irq_vic_eint_mask(unsigned int irq)
215{
216 void __iomem *base = get_irq_chip_data(irq);
217 unsigned int real;
218
219 s3c_irq_eint_mask(irq);
220 real = s3c_get_eint(irq);
221 writel(1 << real, base + VIC_INT_ENABLE_CLEAR);
222}
223
224static void s3c_irq_vic_eint_unmask(unsigned int irq)
225{
226 void __iomem *base = get_irq_chip_data(irq);
227 unsigned int real;
228
229 s3c_irq_eint_unmask(irq);
230 real = s3c_get_eint(irq);
231 writel(1 << real, base + VIC_INT_ENABLE);
232}
233
234static inline void s3c_irq_vic_eint_ack(unsigned int irq)
235{
236 u32 bit;
237 u32 bank = s3c_get_bank(irq);
238
239 bit = s3c_eint_to_bit(irq);
240 __raw_writel(bit, S5PC1XX_WKUP_INT_PEND(bank));
241}
242
243static void s3c_irq_vic_eint_maskack(unsigned int irq)
244{
245 /* compiler should in-line these */
246 s3c_irq_vic_eint_mask(irq);
247 s3c_irq_vic_eint_ack(irq);
248}
249
250static struct irq_chip s3c_irq_vic_eint = {
251 .name = "EINT",
252 .mask = s3c_irq_vic_eint_mask,
253 .unmask = s3c_irq_vic_eint_unmask,
254 .mask_ack = s3c_irq_vic_eint_maskack,
255 .ack = s3c_irq_vic_eint_ack,
256 .set_type = s3c_irq_eint_set_type,
257 .set_wake = s3c_irqext_wake,
258};
259
260static int __init s5pc1xx_init_irq_eint(void)
261{
262 int irq;
263
264 for (irq = IRQ_EINT0; irq <= IRQ_EINT15; irq++) {
265 set_irq_chip(irq, &s3c_irq_vic_eint);
266 set_irq_handler(irq, handle_level_irq);
267 set_irq_flags(irq, IRQF_VALID);
268 }
269
270 for (irq = IRQ_EINT(16); irq <= IRQ_EINT(31); irq++) {
271 set_irq_chip(irq, &s3c_irq_eint);
272 set_irq_handler(irq, handle_level_irq);
273 set_irq_flags(irq, IRQF_VALID);
274 }
275
276 set_irq_chained_handler(IRQ_EINT16_31, s3c_irq_demux_eint16_31);
277
278 return 0;
279}
280
281arch_initcall(s5pc1xx_init_irq_eint);
diff --git a/arch/arm/plat-s5pc1xx/irq-gpio.c b/arch/arm/plat-s5pc1xx/irq-gpio.c
new file mode 100644
index 000000000000..fecca7a679b0
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/irq-gpio.c
@@ -0,0 +1,266 @@
1/*
2 * arch/arm/plat-s5pc1xx/irq-gpio.c
3 *
4 * Copyright (C) 2009 Samsung Electronics
5 *
6 * S5PC1XX - Interrupt handling for IRQ_GPIO${group}(x)
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#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18
19#include <mach/map.h>
20#include <plat/gpio-cfg.h>
21
22#define S5PC1XX_GPIOREG(x) (S5PC1XX_VA_GPIO + (x))
23
24#define CON_OFFSET 0x700
25#define MASK_OFFSET 0x900
26#define PEND_OFFSET 0xA00
27#define CON_OFFSET_2 0xE00
28#define MASK_OFFSET_2 0xF00
29#define PEND_OFFSET_2 0xF40
30
31#define GPIOINT_LEVEL_LOW 0x0
32#define GPIOINT_LEVEL_HIGH 0x1
33#define GPIOINT_EDGE_FALLING 0x2
34#define GPIOINT_EDGE_RISING 0x3
35#define GPIOINT_EDGE_BOTH 0x4
36
37static int group_to_con_offset(int group)
38{
39 return group << 2;
40}
41
42static int group_to_mask_offset(int group)
43{
44 return group << 2;
45}
46
47static int group_to_pend_offset(int group)
48{
49 return group << 2;
50}
51
52static int s5pc1xx_get_start(unsigned int group)
53{
54 switch (group) {
55 case 0: return S5PC100_GPIO_A0_START;
56 case 1: return S5PC100_GPIO_A1_START;
57 case 2: return S5PC100_GPIO_B_START;
58 case 3: return S5PC100_GPIO_C_START;
59 case 4: return S5PC100_GPIO_D_START;
60 case 5: return S5PC100_GPIO_E0_START;
61 case 6: return S5PC100_GPIO_E1_START;
62 case 7: return S5PC100_GPIO_F0_START;
63 case 8: return S5PC100_GPIO_F1_START;
64 case 9: return S5PC100_GPIO_F2_START;
65 case 10: return S5PC100_GPIO_F3_START;
66 case 11: return S5PC100_GPIO_G0_START;
67 case 12: return S5PC100_GPIO_G1_START;
68 case 13: return S5PC100_GPIO_G2_START;
69 case 14: return S5PC100_GPIO_G3_START;
70 case 15: return S5PC100_GPIO_I_START;
71 case 16: return S5PC100_GPIO_J0_START;
72 case 17: return S5PC100_GPIO_J1_START;
73 case 18: return S5PC100_GPIO_J2_START;
74 case 19: return S5PC100_GPIO_J3_START;
75 case 20: return S5PC100_GPIO_J4_START;
76 default:
77 BUG();
78 }
79
80 return -EINVAL;
81}
82
83static int s5pc1xx_get_group(unsigned int irq)
84{
85 irq -= S3C_IRQ_GPIO(0);
86
87 switch (irq) {
88 case S5PC100_GPIO_A0_START ... S5PC100_GPIO_A1_START - 1:
89 return 0;
90 case S5PC100_GPIO_A1_START ... S5PC100_GPIO_B_START - 1:
91 return 1;
92 case S5PC100_GPIO_B_START ... S5PC100_GPIO_C_START - 1:
93 return 2;
94 case S5PC100_GPIO_C_START ... S5PC100_GPIO_D_START - 1:
95 return 3;
96 case S5PC100_GPIO_D_START ... S5PC100_GPIO_E0_START - 1:
97 return 4;
98 case S5PC100_GPIO_E0_START ... S5PC100_GPIO_E1_START - 1:
99 return 5;
100 case S5PC100_GPIO_E1_START ... S5PC100_GPIO_F0_START - 1:
101 return 6;
102 case S5PC100_GPIO_F0_START ... S5PC100_GPIO_F1_START - 1:
103 return 7;
104 case S5PC100_GPIO_F1_START ... S5PC100_GPIO_F2_START - 1:
105 return 8;
106 case S5PC100_GPIO_F2_START ... S5PC100_GPIO_F3_START - 1:
107 return 9;
108 case S5PC100_GPIO_F3_START ... S5PC100_GPIO_G0_START - 1:
109 return 10;
110 case S5PC100_GPIO_G0_START ... S5PC100_GPIO_G1_START - 1:
111 return 11;
112 case S5PC100_GPIO_G1_START ... S5PC100_GPIO_G2_START - 1:
113 return 12;
114 case S5PC100_GPIO_G2_START ... S5PC100_GPIO_G3_START - 1:
115 return 13;
116 case S5PC100_GPIO_G3_START ... S5PC100_GPIO_H0_START - 1:
117 return 14;
118 case S5PC100_GPIO_I_START ... S5PC100_GPIO_J0_START - 1:
119 return 15;
120 case S5PC100_GPIO_J0_START ... S5PC100_GPIO_J1_START - 1:
121 return 16;
122 case S5PC100_GPIO_J1_START ... S5PC100_GPIO_J2_START - 1:
123 return 17;
124 case S5PC100_GPIO_J2_START ... S5PC100_GPIO_J3_START - 1:
125 return 18;
126 case S5PC100_GPIO_J3_START ... S5PC100_GPIO_J4_START - 1:
127 return 19;
128 case S5PC100_GPIO_J4_START ... S5PC100_GPIO_K0_START - 1:
129 return 20;
130 default:
131 BUG();
132 }
133
134 return -EINVAL;
135}
136
137static int s5pc1xx_get_offset(unsigned int irq)
138{
139 struct gpio_chip *chip = get_irq_data(irq);
140 return irq - S3C_IRQ_GPIO(chip->base);
141}
142
143static void s5pc1xx_gpioint_ack(unsigned int irq)
144{
145 int group, offset, pend_offset;
146 unsigned int value;
147
148 group = s5pc1xx_get_group(irq);
149 offset = s5pc1xx_get_offset(irq);
150 pend_offset = group_to_pend_offset(group);
151
152 value = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
153 value |= 1 << offset;
154 __raw_writel(value, S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
155}
156
157static void s5pc1xx_gpioint_mask(unsigned int irq)
158{
159 int group, offset, mask_offset;
160 unsigned int value;
161
162 group = s5pc1xx_get_group(irq);
163 offset = s5pc1xx_get_offset(irq);
164 mask_offset = group_to_mask_offset(group);
165
166 value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
167 value |= 1 << offset;
168 __raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
169}
170
171static void s5pc1xx_gpioint_unmask(unsigned int irq)
172{
173 int group, offset, mask_offset;
174 unsigned int value;
175
176 group = s5pc1xx_get_group(irq);
177 offset = s5pc1xx_get_offset(irq);
178 mask_offset = group_to_mask_offset(group);
179
180 value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
181 value &= ~(1 << offset);
182 __raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
183}
184
185static void s5pc1xx_gpioint_mask_ack(unsigned int irq)
186{
187 s5pc1xx_gpioint_mask(irq);
188 s5pc1xx_gpioint_ack(irq);
189}
190
191static int s5pc1xx_gpioint_set_type(unsigned int irq, unsigned int type)
192{
193 int group, offset, con_offset;
194 unsigned int value;
195
196 group = s5pc1xx_get_group(irq);
197 offset = s5pc1xx_get_offset(irq);
198 con_offset = group_to_con_offset(group);
199
200 switch (type) {
201 case IRQ_TYPE_NONE:
202 printk(KERN_WARNING "No irq type\n");
203 return -EINVAL;
204 case IRQ_TYPE_EDGE_RISING:
205 type = GPIOINT_EDGE_RISING;
206 break;
207 case IRQ_TYPE_EDGE_FALLING:
208 type = GPIOINT_EDGE_FALLING;
209 break;
210 case IRQ_TYPE_EDGE_BOTH:
211 type = GPIOINT_EDGE_BOTH;
212 break;
213 case IRQ_TYPE_LEVEL_HIGH:
214 type = GPIOINT_LEVEL_HIGH;
215 break;
216 case IRQ_TYPE_LEVEL_LOW:
217 type = GPIOINT_LEVEL_LOW;
218 break;
219 default:
220 BUG();
221 }
222
223
224 value = __raw_readl(S5PC1XX_GPIOREG(CON_OFFSET) + con_offset);
225 value &= ~(0xf << (offset * 0x4));
226 value |= (type << (offset * 0x4));
227 __raw_writel(value, S5PC1XX_GPIOREG(CON_OFFSET) + con_offset);
228
229 return 0;
230}
231
232struct irq_chip s5pc1xx_gpioint = {
233 .name = "GPIO",
234 .ack = s5pc1xx_gpioint_ack,
235 .mask = s5pc1xx_gpioint_mask,
236 .mask_ack = s5pc1xx_gpioint_mask_ack,
237 .unmask = s5pc1xx_gpioint_unmask,
238 .set_type = s5pc1xx_gpioint_set_type,
239};
240
241void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc)
242{
243 int group, offset, pend_offset, mask_offset;
244 int real_irq, group_end;
245 unsigned int pend, mask;
246
247 group_end = 21;
248
249 for (group = 0; group < group_end; group++) {
250 pend_offset = group_to_pend_offset(group);
251 pend = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset);
252 if (!pend)
253 continue;
254
255 mask_offset = group_to_mask_offset(group);
256 mask = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset);
257 pend &= ~mask;
258
259 for (offset = 0; offset < 8; offset++) {
260 if (pend & (1 << offset)) {
261 real_irq = s5pc1xx_get_start(group) + offset;
262 generic_handle_irq(S3C_IRQ_GPIO(real_irq));
263 }
264 }
265 }
266}
diff --git a/arch/arm/plat-s5pc1xx/irq.c b/arch/arm/plat-s5pc1xx/irq.c
index 80d6dd942cb8..e44fd04ef333 100644
--- a/arch/arm/plat-s5pc1xx/irq.c
+++ b/arch/arm/plat-s5pc1xx/irq.c
@@ -79,7 +79,7 @@ static void s3c_irq_timer_ack(unsigned int irq)
79{ 79{
80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
81 81
82 reg &= 0x1f; 82 reg &= 0x1f; /* mask out pending interrupts */
83 reg |= (1 << 5) << (irq - IRQ_TIMER0); 83 reg |= (1 << 5) << (irq - IRQ_TIMER0);
84 __raw_writel(reg, S3C64XX_TINT_CSTAT); 84 __raw_writel(reg, S3C64XX_TINT_CSTAT);
85} 85}
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-clock.c b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
index 6b24035172fa..b436d44510c8 100644
--- a/arch/arm/plat-s5pc1xx/s5pc100-clock.c
+++ b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
@@ -49,6 +49,7 @@ static struct clk clk_ext_xtal_mux = {
49#define clk_fin_hpll clk_ext_xtal_mux 49#define clk_fin_hpll clk_ext_xtal_mux
50 50
51#define clk_fout_mpll clk_mpll 51#define clk_fout_mpll clk_mpll
52#define clk_vclk_54m clk_54m
52 53
53struct clk_sources { 54struct clk_sources {
54 unsigned int nr_sources; 55 unsigned int nr_sources;
@@ -67,746 +68,327 @@ struct clksrc_clk {
67 void __iomem *reg_source; 68 void __iomem *reg_source;
68}; 69};
69 70
70static int clk_default_setrate(struct clk *clk, unsigned long rate) 71/* APLL */
71{ 72static struct clk clk_fout_apll = {
72 clk->rate = rate; 73 .name = "fout_apll",
73 return 1;
74}
75
76struct clk clk_27m = {
77 .name = "clk_27m",
78 .id = -1, 74 .id = -1,
79 .rate = 27000000, 75 .rate = 27000000,
80}; 76};
81 77
82static int clk_48m_ctrl(struct clk *clk, int enable) 78static struct clk *clk_src_apll_list[] = {
83{ 79 [0] = &clk_fin_apll,
84 unsigned long flags; 80 [1] = &clk_fout_apll,
85 u32 val; 81};
82
83static struct clk_sources clk_src_apll = {
84 .sources = clk_src_apll_list,
85 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
86};
86 87
87 /* can't rely on clock lock, this register has other usages */ 88static struct clksrc_clk clk_mout_apll = {
88 local_irq_save(flags); 89 .clk = {
90 .name = "mout_apll",
91 .id = -1,
92 },
93 .shift = S5PC100_CLKSRC0_APLL_SHIFT,
94 .mask = S5PC100_CLKSRC0_APLL_MASK,
95 .sources = &clk_src_apll,
96 .reg_source = S5PC100_CLKSRC0,
97};
89 98
90 val = __raw_readl(S5PC1XX_CLK_SRC1); 99static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
91 if (enable) 100{
92 val |= S5PC100_CLKSRC1_CLK48M_MASK; 101 unsigned long rate = clk_get_rate(clk->parent);
93 else 102 unsigned int ratio;
94 val &= ~S5PC100_CLKSRC1_CLK48M_MASK;
95 103
96 __raw_writel(val, S5PC1XX_CLK_SRC1); 104 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_APLL_MASK;
97 local_irq_restore(flags); 105 ratio >>= S5PC100_CLKDIV0_APLL_SHIFT;
98 106
99 return 0; 107 return rate / (ratio + 1);
100} 108}
101 109
102struct clk clk_48m = { 110static struct clk clk_dout_apll = {
103 .name = "clk_48m", 111 .name = "dout_apll",
104 .id = -1, 112 .id = -1,
105 .rate = 48000000, 113 .parent = &clk_mout_apll.clk,
106 .enable = clk_48m_ctrl, 114 .get_rate = s5pc100_clk_dout_apll_get_rate,
107}; 115};
108 116
109struct clk clk_54m = { 117static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
110 .name = "clk_54m", 118{
111 .id = -1, 119 unsigned long rate = clk_get_rate(clk->parent);
112 .rate = 54000000, 120 unsigned int ratio;
113};
114
115struct clk clk_hpll = {
116 .name = "hpll",
117 .id = -1,
118};
119 121
120struct clk clk_hd0 = { 122 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_ARM_MASK;
121 .name = "hclkd0", 123 ratio >>= S5PC100_CLKDIV0_ARM_SHIFT;
122 .id = -1,
123 .rate = 0,
124 .parent = NULL,
125 .ctrlbit = 0,
126 .set_rate = clk_default_setrate,
127};
128 124
129struct clk clk_pd0 = { 125 return rate / (ratio + 1);
130 .name = "pclkd0", 126}
131 .id = -1,
132 .rate = 0,
133 .parent = NULL,
134 .ctrlbit = 0,
135 .set_rate = clk_default_setrate,
136};
137 127
138static int s5pc1xx_clk_gate(void __iomem *reg, 128static unsigned long s5pc100_clk_arm_round_rate(struct clk *clk,
139 struct clk *clk, 129 unsigned long rate)
140 int enable)
141{ 130{
142 unsigned int ctrlbit = clk->ctrlbit; 131 unsigned long parent = clk_get_rate(clk->parent);
143 u32 con; 132 u32 div;
144 133
145 con = __raw_readl(reg); 134 if (parent < rate)
135 return rate;
146 136
147 if (enable) 137 div = (parent / rate) - 1;
148 con |= ctrlbit; 138 if (div > S5PC100_CLKDIV0_ARM_MASK)
149 else 139 div = S5PC100_CLKDIV0_ARM_MASK;
150 con &= ~ctrlbit;
151 140
152 __raw_writel(con, reg); 141 return parent / (div + 1);
153 return 0;
154} 142}
155 143
156static int s5pc1xx_clk_d00_ctrl(struct clk *clk, int enable) 144static int s5pc100_clk_arm_set_rate(struct clk *clk, unsigned long rate)
157{ 145{
158 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D00, clk, enable); 146 unsigned long parent = clk_get_rate(clk->parent);
159} 147 u32 div;
148 u32 val;
160 149
161static int s5pc1xx_clk_d01_ctrl(struct clk *clk, int enable) 150 if (rate < parent / (S5PC100_CLKDIV0_ARM_MASK + 1))
162{ 151 return -EINVAL;
163 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D01, clk, enable);
164}
165 152
166static int s5pc1xx_clk_d02_ctrl(struct clk *clk, int enable) 153 rate = clk_round_rate(clk, rate);
167{ 154 div = clk_get_rate(clk->parent) / rate;
168 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D02, clk, enable);
169}
170 155
171static int s5pc1xx_clk_d10_ctrl(struct clk *clk, int enable) 156 val = __raw_readl(S5PC100_CLKDIV0);
172{ 157 val &= S5PC100_CLKDIV0_ARM_MASK;
173 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D10, clk, enable); 158 val |= (div - 1);
174} 159 __raw_writel(val, S5PC100_CLKDIV0);
175 160
176static int s5pc1xx_clk_d11_ctrl(struct clk *clk, int enable) 161 return 0;
177{
178 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D11, clk, enable);
179} 162}
180 163
181static int s5pc1xx_clk_d12_ctrl(struct clk *clk, int enable) 164static struct clk clk_arm = {
182{ 165 .name = "armclk",
183 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D12, clk, enable); 166 .id = -1,
184} 167 .parent = &clk_dout_apll,
168 .get_rate = s5pc100_clk_arm_get_rate,
169 .set_rate = s5pc100_clk_arm_set_rate,
170 .round_rate = s5pc100_clk_arm_round_rate,
171};
185 172
186static int s5pc1xx_clk_d13_ctrl(struct clk *clk, int enable) 173static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
187{ 174{
188 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D13, clk, enable); 175 unsigned long rate = clk_get_rate(clk->parent);
189} 176 unsigned int ratio;
190 177
191static int s5pc1xx_clk_d14_ctrl(struct clk *clk, int enable) 178 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_D0_MASK;
192{ 179 ratio >>= S5PC100_CLKDIV0_D0_SHIFT;
193 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D14, clk, enable);
194}
195 180
196static int s5pc1xx_clk_d15_ctrl(struct clk *clk, int enable) 181 return rate / (ratio + 1);
197{
198 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D15, clk, enable);
199} 182}
200 183
201static int s5pc1xx_clk_d20_ctrl(struct clk *clk, int enable) 184static struct clk clk_dout_d0_bus = {
202{ 185 .name = "dout_d0_bus",
203 return s5pc1xx_clk_gate(S5PC100_CLKGATE_D20, clk, enable); 186 .id = -1,
204} 187 .parent = &clk_arm,
188 .get_rate = s5pc100_clk_dout_d0_bus_get_rate,
189};
205 190
206int s5pc1xx_sclk0_ctrl(struct clk *clk, int enable) 191static unsigned long s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk)
207{ 192{
208 return s5pc1xx_clk_gate(S5PC100_SCLKGATE0, clk, enable); 193 unsigned long rate = clk_get_rate(clk->parent);
194 unsigned int ratio;
195
196 ratio = __raw_readl(S5PC100_CLKDIV0) & S5PC100_CLKDIV0_PCLKD0_MASK;
197 ratio >>= S5PC100_CLKDIV0_PCLKD0_SHIFT;
198
199 return rate / (ratio + 1);
209} 200}
210 201
211int s5pc1xx_sclk1_ctrl(struct clk *clk, int enable) 202static struct clk clk_dout_pclkd0 = {
203 .name = "dout_pclkd0",
204 .id = -1,
205 .parent = &clk_dout_d0_bus,
206 .get_rate = s5pc100_clk_dout_pclkd0_get_rate,
207};
208
209static unsigned long s5pc100_clk_dout_apll2_get_rate(struct clk *clk)
212{ 210{
213 return s5pc1xx_clk_gate(S5PC100_SCLKGATE1, clk, enable); 211 unsigned long rate = clk_get_rate(clk->parent);
212 unsigned int ratio;
213
214 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_APLL2_MASK;
215 ratio >>= S5PC100_CLKDIV1_APLL2_SHIFT;
216
217 return rate / (ratio + 1);
214} 218}
215 219
216static struct clk init_clocks_disable[] = { 220static struct clk clk_dout_apll2 = {
217 { 221 .name = "dout_apll2",
218 .name = "dsi", 222 .id = -1,
219 .id = -1, 223 .parent = &clk_mout_apll.clk,
220 .parent = &clk_p, 224 .get_rate = s5pc100_clk_dout_apll2_get_rate,
221 .enable = s5pc1xx_clk_d11_ctrl,
222 .ctrlbit = S5PC100_CLKGATE_D11_DSI,
223 }, {
224 .name = "csi",
225 .id = -1,
226 .parent = &clk_h,
227 .enable = s5pc1xx_clk_d11_ctrl,
228 .ctrlbit = S5PC100_CLKGATE_D11_CSI,
229 }, {
230 .name = "ccan0",
231 .id = 0,
232 .parent = &clk_p,
233 .enable = s5pc1xx_clk_d14_ctrl,
234 .ctrlbit = S5PC100_CLKGATE_D14_CCAN0,
235 }, {
236 .name = "ccan1",
237 .id = 1,
238 .parent = &clk_p,
239 .enable = s5pc1xx_clk_d14_ctrl,
240 .ctrlbit = S5PC100_CLKGATE_D14_CCAN1,
241 }, {
242 .name = "keypad",
243 .id = -1,
244 .parent = &clk_p,
245 .enable = s5pc1xx_clk_d15_ctrl,
246 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
247 }, {
248 .name = "hclkd2",
249 .id = -1,
250 .parent = NULL,
251 .enable = s5pc1xx_clk_d20_ctrl,
252 .ctrlbit = S5PC100_CLKGATE_D20_HCLKD2,
253 }, {
254 .name = "iis-d2",
255 .id = -1,
256 .parent = NULL,
257 .enable = s5pc1xx_clk_d20_ctrl,
258 .ctrlbit = S5PC100_CLKGATE_D20_I2SD2,
259 }, {
260 .name = "otg",
261 .id = -1,
262 .parent = &clk_h,
263 .enable = s5pc1xx_clk_d10_ctrl,
264 .ctrlbit = S5PC100_CLKGATE_D10_USBOTG,
265 },
266}; 225};
267 226
268static struct clk init_clocks[] = { 227/* MPLL */
269 /* System1 (D0_0) devices */ 228static struct clk *clk_src_mpll_list[] = {
270 { 229 [0] = &clk_fin_mpll,
271 .name = "intc", 230 [1] = &clk_fout_mpll,
272 .id = -1, 231};
273 .parent = &clk_hd0,
274 .enable = s5pc1xx_clk_d00_ctrl,
275 .ctrlbit = S5PC100_CLKGATE_D00_INTC,
276 }, {
277 .name = "tzic",
278 .id = -1,
279 .parent = &clk_hd0,
280 .enable = s5pc1xx_clk_d00_ctrl,
281 .ctrlbit = S5PC100_CLKGATE_D00_TZIC,
282 }, {
283 .name = "cf-ata",
284 .id = -1,
285 .parent = &clk_hd0,
286 .enable = s5pc1xx_clk_d00_ctrl,
287 .ctrlbit = S5PC100_CLKGATE_D00_CFCON,
288 }, {
289 .name = "mdma",
290 .id = -1,
291 .parent = &clk_hd0,
292 .enable = s5pc1xx_clk_d00_ctrl,
293 .ctrlbit = S5PC100_CLKGATE_D00_MDMA,
294 }, {
295 .name = "g2d",
296 .id = -1,
297 .parent = &clk_hd0,
298 .enable = s5pc1xx_clk_d00_ctrl,
299 .ctrlbit = S5PC100_CLKGATE_D00_G2D,
300 }, {
301 .name = "secss",
302 .id = -1,
303 .parent = &clk_hd0,
304 .enable = s5pc1xx_clk_d00_ctrl,
305 .ctrlbit = S5PC100_CLKGATE_D00_SECSS,
306 }, {
307 .name = "cssys",
308 .id = -1,
309 .parent = &clk_hd0,
310 .enable = s5pc1xx_clk_d00_ctrl,
311 .ctrlbit = S5PC100_CLKGATE_D00_CSSYS,
312 },
313 232
314 /* Memory (D0_1) devices */ 233static struct clk_sources clk_src_mpll = {
315 { 234 .sources = clk_src_mpll_list,
316 .name = "dmc", 235 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
317 .id = -1, 236};
318 .parent = &clk_hd0,
319 .enable = s5pc1xx_clk_d01_ctrl,
320 .ctrlbit = S5PC100_CLKGATE_D01_DMC,
321 }, {
322 .name = "sromc",
323 .id = -1,
324 .parent = &clk_hd0,
325 .enable = s5pc1xx_clk_d01_ctrl,
326 .ctrlbit = S5PC100_CLKGATE_D01_SROMC,
327 }, {
328 .name = "onenand",
329 .id = -1,
330 .parent = &clk_hd0,
331 .enable = s5pc1xx_clk_d01_ctrl,
332 .ctrlbit = S5PC100_CLKGATE_D01_ONENAND,
333 }, {
334 .name = "nand",
335 .id = -1,
336 .parent = &clk_hd0,
337 .enable = s5pc1xx_clk_d01_ctrl,
338 .ctrlbit = S5PC100_CLKGATE_D01_NFCON,
339 }, {
340 .name = "intmem",
341 .id = -1,
342 .parent = &clk_hd0,
343 .enable = s5pc1xx_clk_d01_ctrl,
344 .ctrlbit = S5PC100_CLKGATE_D01_INTMEM,
345 }, {
346 .name = "ebi",
347 .id = -1,
348 .parent = &clk_hd0,
349 .enable = s5pc1xx_clk_d01_ctrl,
350 .ctrlbit = S5PC100_CLKGATE_D01_EBI,
351 },
352 237
353 /* System2 (D0_2) devices */ 238static struct clksrc_clk clk_mout_mpll = {
354 { 239 .clk = {
355 .name = "seckey", 240 .name = "mout_mpll",
356 .id = -1,
357 .parent = &clk_pd0,
358 .enable = s5pc1xx_clk_d02_ctrl,
359 .ctrlbit = S5PC100_CLKGATE_D02_SECKEY,
360 }, {
361 .name = "sdm",
362 .id = -1, 241 .id = -1,
363 .parent = &clk_hd0,
364 .enable = s5pc1xx_clk_d02_ctrl,
365 .ctrlbit = S5PC100_CLKGATE_D02_SDM,
366 }, 242 },
243 .shift = S5PC100_CLKSRC0_MPLL_SHIFT,
244 .mask = S5PC100_CLKSRC0_MPLL_MASK,
245 .sources = &clk_src_mpll,
246 .reg_source = S5PC100_CLKSRC0,
247};
367 248
368 /* File (D1_0) devices */ 249static struct clk *clkset_am_list[] = {
369 { 250 [0] = &clk_mout_mpll.clk,
370 .name = "pdma0", 251 [1] = &clk_dout_apll2,
371 .id = -1, 252};
372 .parent = &clk_h,
373 .enable = s5pc1xx_clk_d10_ctrl,
374 .ctrlbit = S5PC100_CLKGATE_D10_PDMA0,
375 }, {
376 .name = "pdma1",
377 .id = -1,
378 .parent = &clk_h,
379 .enable = s5pc1xx_clk_d10_ctrl,
380 .ctrlbit = S5PC100_CLKGATE_D10_PDMA1,
381 }, {
382 .name = "usb-host",
383 .id = -1,
384 .parent = &clk_h,
385 .enable = s5pc1xx_clk_d10_ctrl,
386 .ctrlbit = S5PC100_CLKGATE_D10_USBHOST,
387 }, {
388 .name = "modem",
389 .id = -1,
390 .parent = &clk_h,
391 .enable = s5pc1xx_clk_d10_ctrl,
392 .ctrlbit = S5PC100_CLKGATE_D10_MODEMIF,
393 }, {
394 .name = "hsmmc",
395 .id = 0,
396 .parent = &clk_h,
397 .enable = s5pc1xx_clk_d10_ctrl,
398 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC0,
399 }, {
400 .name = "hsmmc",
401 .id = 1,
402 .parent = &clk_h,
403 .enable = s5pc1xx_clk_d10_ctrl,
404 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC1,
405 }, {
406 .name = "hsmmc",
407 .id = 2,
408 .parent = &clk_h,
409 .enable = s5pc1xx_clk_d10_ctrl,
410 .ctrlbit = S5PC100_CLKGATE_D10_HSMMC2,
411 },
412 253
413 /* Multimedia1 (D1_1) devices */ 254static struct clk_sources clk_src_am = {
414 { 255 .sources = clkset_am_list,
415 .name = "lcd", 256 .nr_sources = ARRAY_SIZE(clkset_am_list),
416 .id = -1, 257};
417 .parent = &clk_h,
418 .enable = s5pc1xx_clk_d11_ctrl,
419 .ctrlbit = S5PC100_CLKGATE_D11_LCD,
420 }, {
421 .name = "rotator",
422 .id = -1,
423 .parent = &clk_h,
424 .enable = s5pc1xx_clk_d11_ctrl,
425 .ctrlbit = S5PC100_CLKGATE_D11_ROTATOR,
426 }, {
427 .name = "fimc",
428 .id = 0,
429 .parent = &clk_h,
430 .enable = s5pc1xx_clk_d11_ctrl,
431 .ctrlbit = S5PC100_CLKGATE_D11_FIMC0,
432 }, {
433 .name = "fimc",
434 .id = 1,
435 .parent = &clk_h,
436 .enable = s5pc1xx_clk_d11_ctrl,
437 .ctrlbit = S5PC100_CLKGATE_D11_FIMC1,
438 }, {
439 .name = "fimc",
440 .id = 2,
441 .parent = &clk_h,
442 .enable = s5pc1xx_clk_d11_ctrl,
443 .ctrlbit = S5PC100_CLKGATE_D11_FIMC2,
444 }, {
445 .name = "jpeg",
446 .id = -1,
447 .parent = &clk_h,
448 .enable = s5pc1xx_clk_d11_ctrl,
449 .ctrlbit = S5PC100_CLKGATE_D11_JPEG,
450 }, {
451 .name = "g3d",
452 .id = -1,
453 .parent = &clk_h,
454 .enable = s5pc1xx_clk_d11_ctrl,
455 .ctrlbit = S5PC100_CLKGATE_D11_G3D,
456 },
457 258
458 /* Multimedia2 (D1_2) devices */ 259static struct clksrc_clk clk_mout_am = {
459 { 260 .clk = {
460 .name = "tv", 261 .name = "mout_am",
461 .id = -1,
462 .parent = &clk_h,
463 .enable = s5pc1xx_clk_d12_ctrl,
464 .ctrlbit = S5PC100_CLKGATE_D12_TV,
465 }, {
466 .name = "vp",
467 .id = -1,
468 .parent = &clk_h,
469 .enable = s5pc1xx_clk_d12_ctrl,
470 .ctrlbit = S5PC100_CLKGATE_D12_VP,
471 }, {
472 .name = "mixer",
473 .id = -1,
474 .parent = &clk_h,
475 .enable = s5pc1xx_clk_d12_ctrl,
476 .ctrlbit = S5PC100_CLKGATE_D12_MIXER,
477 }, {
478 .name = "hdmi",
479 .id = -1,
480 .parent = &clk_h,
481 .enable = s5pc1xx_clk_d12_ctrl,
482 .ctrlbit = S5PC100_CLKGATE_D12_HDMI,
483 }, {
484 .name = "mfc",
485 .id = -1, 262 .id = -1,
486 .parent = &clk_h,
487 .enable = s5pc1xx_clk_d12_ctrl,
488 .ctrlbit = S5PC100_CLKGATE_D12_MFC,
489 }, 263 },
264 .shift = S5PC100_CLKSRC0_AMMUX_SHIFT,
265 .mask = S5PC100_CLKSRC0_AMMUX_MASK,
266 .sources = &clk_src_am,
267 .reg_source = S5PC100_CLKSRC0,
268};
490 269
491 /* System (D1_3) devices */ 270static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
492 { 271{
493 .name = "chipid", 272 unsigned long rate = clk_get_rate(clk->parent);
494 .id = -1, 273 unsigned int ratio;
495 .parent = &clk_p,
496 .enable = s5pc1xx_clk_d13_ctrl,
497 .ctrlbit = S5PC100_CLKGATE_D13_CHIPID,
498 }, {
499 .name = "gpio",
500 .id = -1,
501 .parent = &clk_p,
502 .enable = s5pc1xx_clk_d13_ctrl,
503 .ctrlbit = S5PC100_CLKGATE_D13_GPIO,
504 }, {
505 .name = "apc",
506 .id = -1,
507 .parent = &clk_p,
508 .enable = s5pc1xx_clk_d13_ctrl,
509 .ctrlbit = S5PC100_CLKGATE_D13_APC,
510 }, {
511 .name = "iec",
512 .id = -1,
513 .parent = &clk_p,
514 .enable = s5pc1xx_clk_d13_ctrl,
515 .ctrlbit = S5PC100_CLKGATE_D13_IEC,
516 }, {
517 .name = "timers",
518 .id = -1,
519 .parent = &clk_p,
520 .enable = s5pc1xx_clk_d13_ctrl,
521 .ctrlbit = S5PC100_CLKGATE_D13_PWM,
522 }, {
523 .name = "systimer",
524 .id = -1,
525 .parent = &clk_p,
526 .enable = s5pc1xx_clk_d13_ctrl,
527 .ctrlbit = S5PC100_CLKGATE_D13_SYSTIMER,
528 }, {
529 .name = "watchdog",
530 .id = -1,
531 .parent = &clk_p,
532 .enable = s5pc1xx_clk_d13_ctrl,
533 .ctrlbit = S5PC100_CLKGATE_D13_WDT,
534 }, {
535 .name = "rtc",
536 .id = -1,
537 .parent = &clk_p,
538 .enable = s5pc1xx_clk_d13_ctrl,
539 .ctrlbit = S5PC100_CLKGATE_D13_RTC,
540 },
541 274
542 /* Connectivity (D1_4) devices */ 275 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
543 {
544 .name = "uart",
545 .id = 0,
546 .parent = &clk_p,
547 .enable = s5pc1xx_clk_d14_ctrl,
548 .ctrlbit = S5PC100_CLKGATE_D14_UART0,
549 }, {
550 .name = "uart",
551 .id = 1,
552 .parent = &clk_p,
553 .enable = s5pc1xx_clk_d14_ctrl,
554 .ctrlbit = S5PC100_CLKGATE_D14_UART1,
555 }, {
556 .name = "uart",
557 .id = 2,
558 .parent = &clk_p,
559 .enable = s5pc1xx_clk_d14_ctrl,
560 .ctrlbit = S5PC100_CLKGATE_D14_UART2,
561 }, {
562 .name = "uart",
563 .id = 3,
564 .parent = &clk_p,
565 .enable = s5pc1xx_clk_d14_ctrl,
566 .ctrlbit = S5PC100_CLKGATE_D14_UART3,
567 }, {
568 .name = "i2c",
569 .id = -1,
570 .parent = &clk_p,
571 .enable = s5pc1xx_clk_d14_ctrl,
572 .ctrlbit = S5PC100_CLKGATE_D14_IIC,
573 }, {
574 .name = "hdmi-i2c",
575 .id = -1,
576 .parent = &clk_p,
577 .enable = s5pc1xx_clk_d14_ctrl,
578 .ctrlbit = S5PC100_CLKGATE_D14_HDMI_IIC,
579 }, {
580 .name = "spi",
581 .id = 0,
582 .parent = &clk_p,
583 .enable = s5pc1xx_clk_d14_ctrl,
584 .ctrlbit = S5PC100_CLKGATE_D14_SPI0,
585 }, {
586 .name = "spi",
587 .id = 1,
588 .parent = &clk_p,
589 .enable = s5pc1xx_clk_d14_ctrl,
590 .ctrlbit = S5PC100_CLKGATE_D14_SPI1,
591 }, {
592 .name = "spi",
593 .id = 2,
594 .parent = &clk_p,
595 .enable = s5pc1xx_clk_d14_ctrl,
596 .ctrlbit = S5PC100_CLKGATE_D14_SPI2,
597 }, {
598 .name = "irda",
599 .id = -1,
600 .parent = &clk_p,
601 .enable = s5pc1xx_clk_d14_ctrl,
602 .ctrlbit = S5PC100_CLKGATE_D14_IRDA,
603 }, {
604 .name = "hsitx",
605 .id = -1,
606 .parent = &clk_p,
607 .enable = s5pc1xx_clk_d14_ctrl,
608 .ctrlbit = S5PC100_CLKGATE_D14_HSITX,
609 }, {
610 .name = "hsirx",
611 .id = -1,
612 .parent = &clk_p,
613 .enable = s5pc1xx_clk_d14_ctrl,
614 .ctrlbit = S5PC100_CLKGATE_D14_HSIRX,
615 },
616 276
617 /* Audio (D1_5) devices */ 277 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_D1_MASK;
618 { 278 ratio >>= S5PC100_CLKDIV1_D1_SHIFT;
619 .name = "iis",
620 .id = 0,
621 .parent = &clk_p,
622 .enable = s5pc1xx_clk_d15_ctrl,
623 .ctrlbit = S5PC100_CLKGATE_D15_IIS0,
624 }, {
625 .name = "iis",
626 .id = 1,
627 .parent = &clk_p,
628 .enable = s5pc1xx_clk_d15_ctrl,
629 .ctrlbit = S5PC100_CLKGATE_D15_IIS1,
630 }, {
631 .name = "iis",
632 .id = 2,
633 .parent = &clk_p,
634 .enable = s5pc1xx_clk_d15_ctrl,
635 .ctrlbit = S5PC100_CLKGATE_D15_IIS2,
636 }, {
637 .name = "ac97",
638 .id = -1,
639 .parent = &clk_p,
640 .enable = s5pc1xx_clk_d15_ctrl,
641 .ctrlbit = S5PC100_CLKGATE_D15_AC97,
642 }, {
643 .name = "pcm",
644 .id = 0,
645 .parent = &clk_p,
646 .enable = s5pc1xx_clk_d15_ctrl,
647 .ctrlbit = S5PC100_CLKGATE_D15_PCM0,
648 }, {
649 .name = "pcm",
650 .id = 1,
651 .parent = &clk_p,
652 .enable = s5pc1xx_clk_d15_ctrl,
653 .ctrlbit = S5PC100_CLKGATE_D15_PCM1,
654 }, {
655 .name = "spdif",
656 .id = -1,
657 .parent = &clk_p,
658 .enable = s5pc1xx_clk_d15_ctrl,
659 .ctrlbit = S5PC100_CLKGATE_D15_SPDIF,
660 }, {
661 .name = "adc",
662 .id = -1,
663 .parent = &clk_p,
664 .enable = s5pc1xx_clk_d15_ctrl,
665 .ctrlbit = S5PC100_CLKGATE_D15_TSADC,
666 }, {
667 .name = "keyif",
668 .id = -1,
669 .parent = &clk_p,
670 .enable = s5pc1xx_clk_d15_ctrl,
671 .ctrlbit = S5PC100_CLKGATE_D15_KEYIF,
672 }, {
673 .name = "cg",
674 .id = -1,
675 .parent = &clk_p,
676 .enable = s5pc1xx_clk_d15_ctrl,
677 .ctrlbit = S5PC100_CLKGATE_D15_CG,
678 },
679 279
680 /* Audio (D2_0) devices: all disabled */ 280 return rate / (ratio + 1);
281}
681 282
682 /* Special Clocks 1 */ 283static struct clk clk_dout_d1_bus = {
683 { 284 .name = "dout_d1_bus",
684 .name = "sclk_hpm", 285 .id = -1,
685 .id = -1, 286 .parent = &clk_mout_am.clk,
686 .parent = NULL, 287 .get_rate = s5pc100_clk_dout_d1_bus_get_rate,
687 .enable = s5pc1xx_sclk0_ctrl, 288};
688 .ctrlbit = S5PC1XX_CLKGATE_SCLK0_HPM,
689 }, {
690 .name = "sclk_onenand",
691 .id = -1,
692 .parent = NULL,
693 .enable = s5pc1xx_sclk0_ctrl,
694 .ctrlbit = S5PC100_CLKGATE_SCLK0_ONENAND,
695 }, {
696 .name = "sclk_spi_48",
697 .id = 0,
698 .parent = &clk_48m,
699 .enable = s5pc1xx_sclk0_ctrl,
700 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0_48,
701 }, {
702 .name = "sclk_spi_48",
703 .id = 1,
704 .parent = &clk_48m,
705 .enable = s5pc1xx_sclk0_ctrl,
706 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1_48,
707 }, {
708 .name = "sclk_spi_48",
709 .id = 2,
710 .parent = &clk_48m,
711 .enable = s5pc1xx_sclk0_ctrl,
712 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2_48,
713 }, {
714 .name = "sclk_mmc_48",
715 .id = 0,
716 .parent = &clk_48m,
717 .enable = s5pc1xx_sclk0_ctrl,
718 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0_48,
719 }, {
720 .name = "sclk_mmc_48",
721 .id = 1,
722 .parent = &clk_48m,
723 .enable = s5pc1xx_sclk0_ctrl,
724 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1_48,
725 }, {
726 .name = "sclk_mmc_48",
727 .id = 2,
728 .parent = &clk_48m,
729 .enable = s5pc1xx_sclk0_ctrl,
730 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2_48,
731 },
732 289
733 /* Special Clocks 2 */ 290static struct clk *clkset_onenand_list[] = {
734 { 291 [0] = &clk_dout_d0_bus,
735 .name = "sclk_tv_54", 292 [1] = &clk_dout_d1_bus,
736 .id = -1, 293};
737 .parent = &clk_54m, 294
738 .enable = s5pc1xx_sclk1_ctrl, 295static struct clk_sources clk_src_onenand = {
739 .ctrlbit = S5PC100_CLKGATE_SCLK1_TV54, 296 .sources = clkset_onenand_list,
740 }, { 297 .nr_sources = ARRAY_SIZE(clkset_onenand_list),
741 .name = "sclk_vdac_54", 298};
742 .id = -1, 299
743 .parent = &clk_54m, 300static struct clksrc_clk clk_mout_onenand = {
744 .enable = s5pc1xx_sclk1_ctrl, 301 .clk = {
745 .ctrlbit = S5PC100_CLKGATE_SCLK1_VDAC54, 302 .name = "mout_onenand",
746 }, {
747 .name = "sclk_spdif",
748 .id = -1, 303 .id = -1,
749 .parent = NULL,
750 .enable = s5pc1xx_sclk1_ctrl,
751 .ctrlbit = S5PC100_CLKGATE_SCLK1_SPDIF,
752 }, 304 },
305 .shift = S5PC100_CLKSRC0_ONENAND_SHIFT,
306 .mask = S5PC100_CLKSRC0_ONENAND_MASK,
307 .sources = &clk_src_onenand,
308 .reg_source = S5PC100_CLKSRC0,
753}; 309};
754 310
755void __init s5pc1xx_register_clocks(void) 311static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
756{ 312{
757 struct clk *clkp; 313 unsigned long rate = clk_get_rate(clk->parent);
758 int ret; 314 unsigned int ratio;
759 int ptr;
760 315
761 clkp = init_clocks; 316 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
762 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
763 ret = s3c24xx_register_clock(clkp);
764 if (ret < 0) {
765 printk(KERN_ERR "Failed to register clock %s (%d)\n",
766 clkp->name, ret);
767 }
768 }
769 317
770 clkp = init_clocks_disable; 318 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_PCLKD1_MASK;
771 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 319 ratio >>= S5PC100_CLKDIV1_PCLKD1_SHIFT;
772 320
773 ret = s3c24xx_register_clock(clkp); 321 return rate / (ratio + 1);
774 if (ret < 0) { 322}
775 printk(KERN_ERR "Failed to register clock %s (%d)\n",
776 clkp->name, ret);
777 }
778 323
779 (clkp->enable)(clkp, 0); 324static struct clk clk_dout_pclkd1 = {
780 } 325 .name = "dout_pclkd1",
326 .id = -1,
327 .parent = &clk_dout_d1_bus,
328 .get_rate = s5pc100_clk_dout_pclkd1_get_rate,
329};
330
331static unsigned long s5pc100_clk_dout_mpll2_get_rate(struct clk *clk)
332{
333 unsigned long rate = clk_get_rate(clk->parent);
334 unsigned int ratio;
335
336 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
337
338 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
339 ratio >>= S5PC100_CLKDIV1_MPLL2_SHIFT;
781 340
782 s3c_pwmclk_init(); 341 return rate / (ratio + 1);
783} 342}
784static struct clk clk_fout_apll = { 343
785 .name = "fout_apll", 344static struct clk clk_dout_mpll2 = {
345 .name = "dout_mpll2",
786 .id = -1, 346 .id = -1,
347 .parent = &clk_mout_am.clk,
348 .get_rate = s5pc100_clk_dout_mpll2_get_rate,
787}; 349};
788 350
789static struct clk *clk_src_apll_list[] = { 351static unsigned long s5pc100_clk_dout_cam_get_rate(struct clk *clk)
790 [0] = &clk_fin_apll, 352{
791 [1] = &clk_fout_apll, 353 unsigned long rate = clk_get_rate(clk->parent);
792}; 354 unsigned int ratio;
793 355
794static struct clk_sources clk_src_apll = { 356 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
795 .sources = clk_src_apll_list, 357
796 .nr_sources = ARRAY_SIZE(clk_src_apll_list), 358 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_CAM_MASK;
359 ratio >>= S5PC100_CLKDIV1_CAM_SHIFT;
360
361 return rate / (ratio + 1);
362}
363
364static struct clk clk_dout_cam = {
365 .name = "dout_cam",
366 .id = -1,
367 .parent = &clk_dout_mpll2,
368 .get_rate = s5pc100_clk_dout_cam_get_rate,
797}; 369};
798 370
799static struct clksrc_clk clk_mout_apll = { 371static unsigned long s5pc100_clk_dout_mpll_get_rate(struct clk *clk)
800 .clk = { 372{
801 .name = "mout_apll", 373 unsigned long rate = clk_get_rate(clk->parent);
802 .id = -1, 374 unsigned int ratio;
803 }, 375
804 .shift = S5PC1XX_CLKSRC0_APLL_SHIFT, 376 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
805 .mask = S5PC1XX_CLKSRC0_APLL_MASK, 377
806 .sources = &clk_src_apll, 378 ratio = __raw_readl(S5PC100_CLKDIV1) & S5PC100_CLKDIV1_MPLL_MASK;
807 .reg_source = S5PC1XX_CLK_SRC0, 379 ratio >>= S5PC100_CLKDIV1_MPLL_SHIFT;
380
381 return rate / (ratio + 1);
382}
383
384static struct clk clk_dout_mpll = {
385 .name = "dout_mpll",
386 .id = -1,
387 .parent = &clk_mout_am.clk,
388 .get_rate = s5pc100_clk_dout_mpll_get_rate,
808}; 389};
809 390
391/* EPLL */
810static struct clk clk_fout_epll = { 392static struct clk clk_fout_epll = {
811 .name = "fout_epll", 393 .name = "fout_epll",
812 .id = -1, 394 .id = -1,
@@ -827,91 +409,57 @@ static struct clksrc_clk clk_mout_epll = {
827 .name = "mout_epll", 409 .name = "mout_epll",
828 .id = -1, 410 .id = -1,
829 }, 411 },
830 .shift = S5PC1XX_CLKSRC0_EPLL_SHIFT, 412 .shift = S5PC100_CLKSRC0_EPLL_SHIFT,
831 .mask = S5PC1XX_CLKSRC0_EPLL_MASK, 413 .mask = S5PC100_CLKSRC0_EPLL_MASK,
832 .sources = &clk_src_epll, 414 .sources = &clk_src_epll,
833 .reg_source = S5PC1XX_CLK_SRC0, 415 .reg_source = S5PC100_CLKSRC0,
834}; 416};
835 417
836static struct clk *clk_src_mpll_list[] = { 418/* HPLL */
837 [0] = &clk_fin_mpll, 419static struct clk clk_fout_hpll = {
838 [1] = &clk_fout_mpll, 420 .name = "fout_hpll",
839};
840
841static struct clk_sources clk_src_mpll = {
842 .sources = clk_src_mpll_list,
843 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
844};
845
846static struct clksrc_clk clk_mout_mpll = {
847 .clk = {
848 .name = "mout_mpll",
849 .id = -1,
850 },
851 .shift = S5PC1XX_CLKSRC0_MPLL_SHIFT,
852 .mask = S5PC1XX_CLKSRC0_MPLL_MASK,
853 .sources = &clk_src_mpll,
854 .reg_source = S5PC1XX_CLK_SRC0,
855};
856
857static unsigned long s5pc1xx_clk_doutmpll_get_rate(struct clk *clk)
858{
859 unsigned long rate = clk_get_rate(clk->parent);
860 unsigned long clkdiv;
861
862 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
863
864 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL_MASK;
865 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL_SHIFT) + 1;
866
867 return rate;
868}
869
870static struct clk clk_dout_mpll = {
871 .name = "dout_mpll",
872 .id = -1, 421 .id = -1,
873 .parent = &clk_mout_mpll.clk,
874 .get_rate = s5pc1xx_clk_doutmpll_get_rate,
875}; 422};
876 423
877static unsigned long s5pc1xx_clk_doutmpll2_get_rate(struct clk *clk) 424static struct clk *clk_src_hpll_list[] = {
878{ 425 [0] = &clk_27m,
879 unsigned long rate = clk_get_rate(clk->parent); 426 [1] = &clk_fout_hpll,
880 unsigned long clkdiv;
881
882 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
883
884 clkdiv = __raw_readl(S5PC1XX_CLK_DIV1) & S5PC100_CLKDIV1_MPLL2_MASK;
885 rate /= (clkdiv >> S5PC100_CLKDIV1_MPLL2_SHIFT) + 1;
886
887 return rate;
888}
889
890struct clk clk_dout_mpll2 = {
891 .name = "dout_mpll2",
892 .id = -1,
893 .parent = &clk_mout_mpll.clk,
894 .get_rate = s5pc1xx_clk_doutmpll2_get_rate,
895}; 427};
896 428
897static struct clk *clkset_uart_list[] = { 429static struct clk_sources clk_src_hpll = {
898 &clk_mout_epll.clk, 430 .sources = clk_src_hpll_list,
899 &clk_dout_mpll, 431 .nr_sources = ARRAY_SIZE(clk_src_hpll_list),
900 NULL,
901 NULL
902}; 432};
903 433
904static struct clk_sources clkset_uart = { 434static struct clksrc_clk clk_mout_hpll = {
905 .sources = clkset_uart_list, 435 .clk = {
906 .nr_sources = ARRAY_SIZE(clkset_uart_list), 436 .name = "mout_hpll",
437 .id = -1,
438 },
439 .shift = S5PC100_CLKSRC0_HPLL_SHIFT,
440 .mask = S5PC100_CLKSRC0_HPLL_MASK,
441 .sources = &clk_src_hpll,
442 .reg_source = S5PC100_CLKSRC0,
907}; 443};
908 444
445/* Peripherals */
446/*
447 * The peripheral clocks are all controlled via clocksource followed
448 * by an optional divider and gate stage. We currently roll this into
449 * one clock which hides the intermediate clock from the mux.
450 *
451 * Note, the JPEG clock can only be an even divider...
452 *
453 * The scaler and LCD clocks depend on the S5PC100 version, and also
454 * have a common parent divisor so are not included here.
455 */
456
909static inline struct clksrc_clk *to_clksrc(struct clk *clk) 457static inline struct clksrc_clk *to_clksrc(struct clk *clk)
910{ 458{
911 return container_of(clk, struct clksrc_clk, clk); 459 return container_of(clk, struct clksrc_clk, clk);
912} 460}
913 461
914static unsigned long s5pc1xx_getrate_clksrc(struct clk *clk) 462static unsigned long s5pc100_getrate_clksrc(struct clk *clk)
915{ 463{
916 struct clksrc_clk *sclk = to_clksrc(clk); 464 struct clksrc_clk *sclk = to_clksrc(clk);
917 unsigned long rate = clk_get_rate(clk->parent); 465 unsigned long rate = clk_get_rate(clk->parent);
@@ -925,7 +473,7 @@ static unsigned long s5pc1xx_getrate_clksrc(struct clk *clk)
925 return rate; 473 return rate;
926} 474}
927 475
928static int s5pc1xx_setrate_clksrc(struct clk *clk, unsigned long rate) 476static int s5pc100_setrate_clksrc(struct clk *clk, unsigned long rate)
929{ 477{
930 struct clksrc_clk *sclk = to_clksrc(clk); 478 struct clksrc_clk *sclk = to_clksrc(clk);
931 void __iomem *reg = sclk->reg_divider; 479 void __iomem *reg = sclk->reg_divider;
@@ -938,14 +486,14 @@ static int s5pc1xx_setrate_clksrc(struct clk *clk, unsigned long rate)
938 return -EINVAL; 486 return -EINVAL;
939 487
940 val = __raw_readl(reg); 488 val = __raw_readl(reg);
941 val &= ~(0xf << sclk->shift); 489 val &= ~(0xf << sclk->divider_shift);
942 val |= (div - 1) << sclk->shift; 490 val |= (div - 1) << sclk->divider_shift;
943 __raw_writel(val, reg); 491 __raw_writel(val, reg);
944 492
945 return 0; 493 return 0;
946} 494}
947 495
948static int s5pc1xx_setparent_clksrc(struct clk *clk, struct clk *parent) 496static int s5pc100_setparent_clksrc(struct clk *clk, struct clk *parent)
949{ 497{
950 struct clksrc_clk *sclk = to_clksrc(clk); 498 struct clksrc_clk *sclk = to_clksrc(clk);
951 struct clk_sources *srcs = sclk->sources; 499 struct clk_sources *srcs = sclk->sources;
@@ -970,7 +518,7 @@ static int s5pc1xx_setparent_clksrc(struct clk *clk, struct clk *parent)
970 return -EINVAL; 518 return -EINVAL;
971} 519}
972 520
973static unsigned long s5pc1xx_roundrate_clksrc(struct clk *clk, 521static unsigned long s5pc100_roundrate_clksrc(struct clk *clk,
974 unsigned long rate) 522 unsigned long rate)
975{ 523{
976 unsigned long parent_rate = clk_get_rate(clk->parent); 524 unsigned long parent_rate = clk_get_rate(clk->parent);
@@ -992,35 +540,466 @@ static unsigned long s5pc1xx_roundrate_clksrc(struct clk *clk,
992 return rate; 540 return rate;
993} 541}
994 542
543static struct clk *clkset_spi_list[] = {
544 &clk_mout_epll.clk,
545 &clk_dout_mpll2,
546 &clk_fin_epll,
547 &clk_mout_hpll.clk,
548};
549
550static struct clk_sources clkset_spi = {
551 .sources = clkset_spi_list,
552 .nr_sources = ARRAY_SIZE(clkset_spi_list),
553};
554
555static struct clksrc_clk clk_spi0 = {
556 .clk = {
557 .name = "spi_bus",
558 .id = 0,
559 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0,
560 .enable = s5pc100_sclk0_ctrl,
561 .set_parent = s5pc100_setparent_clksrc,
562 .get_rate = s5pc100_getrate_clksrc,
563 .set_rate = s5pc100_setrate_clksrc,
564 .round_rate = s5pc100_roundrate_clksrc,
565 },
566 .shift = S5PC100_CLKSRC1_SPI0_SHIFT,
567 .mask = S5PC100_CLKSRC1_SPI0_MASK,
568 .sources = &clkset_spi,
569 .divider_shift = S5PC100_CLKDIV2_SPI0_SHIFT,
570 .reg_divider = S5PC100_CLKDIV2,
571 .reg_source = S5PC100_CLKSRC1,
572};
573
574static struct clksrc_clk clk_spi1 = {
575 .clk = {
576 .name = "spi_bus",
577 .id = 1,
578 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1,
579 .enable = s5pc100_sclk0_ctrl,
580 .set_parent = s5pc100_setparent_clksrc,
581 .get_rate = s5pc100_getrate_clksrc,
582 .set_rate = s5pc100_setrate_clksrc,
583 .round_rate = s5pc100_roundrate_clksrc,
584 },
585 .shift = S5PC100_CLKSRC1_SPI1_SHIFT,
586 .mask = S5PC100_CLKSRC1_SPI1_MASK,
587 .sources = &clkset_spi,
588 .divider_shift = S5PC100_CLKDIV2_SPI1_SHIFT,
589 .reg_divider = S5PC100_CLKDIV2,
590 .reg_source = S5PC100_CLKSRC1,
591};
592
593static struct clksrc_clk clk_spi2 = {
594 .clk = {
595 .name = "spi_bus",
596 .id = 2,
597 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2,
598 .enable = s5pc100_sclk0_ctrl,
599 .set_parent = s5pc100_setparent_clksrc,
600 .get_rate = s5pc100_getrate_clksrc,
601 .set_rate = s5pc100_setrate_clksrc,
602 .round_rate = s5pc100_roundrate_clksrc,
603 },
604 .shift = S5PC100_CLKSRC1_SPI2_SHIFT,
605 .mask = S5PC100_CLKSRC1_SPI2_MASK,
606 .sources = &clkset_spi,
607 .divider_shift = S5PC100_CLKDIV2_SPI2_SHIFT,
608 .reg_divider = S5PC100_CLKDIV2,
609 .reg_source = S5PC100_CLKSRC1,
610};
611
612static struct clk *clkset_uart_list[] = {
613 &clk_mout_epll.clk,
614 &clk_dout_mpll,
615};
616
617static struct clk_sources clkset_uart = {
618 .sources = clkset_uart_list,
619 .nr_sources = ARRAY_SIZE(clkset_uart_list),
620};
621
995static struct clksrc_clk clk_uart_uclk1 = { 622static struct clksrc_clk clk_uart_uclk1 = {
996 .clk = { 623 .clk = {
997 .name = "uclk1", 624 .name = "uclk1",
998 .id = -1, 625 .id = -1,
999 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART, 626 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART,
1000 .enable = s5pc1xx_sclk0_ctrl, 627 .enable = s5pc100_sclk0_ctrl,
1001 .set_parent = s5pc1xx_setparent_clksrc, 628 .set_parent = s5pc100_setparent_clksrc,
1002 .get_rate = s5pc1xx_getrate_clksrc, 629 .get_rate = s5pc100_getrate_clksrc,
1003 .set_rate = s5pc1xx_setrate_clksrc, 630 .set_rate = s5pc100_setrate_clksrc,
1004 .round_rate = s5pc1xx_roundrate_clksrc, 631 .round_rate = s5pc100_roundrate_clksrc,
1005 }, 632 },
1006 .shift = S5PC100_CLKSRC1_UART_SHIFT, 633 .shift = S5PC100_CLKSRC1_UART_SHIFT,
1007 .mask = S5PC100_CLKSRC1_UART_MASK, 634 .mask = S5PC100_CLKSRC1_UART_MASK,
1008 .sources = &clkset_uart, 635 .sources = &clkset_uart,
1009 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT, 636 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT,
1010 .reg_divider = S5PC1XX_CLK_DIV2, 637 .reg_divider = S5PC100_CLKDIV2,
1011 .reg_source = S5PC1XX_CLK_SRC1, 638 .reg_source = S5PC100_CLKSRC1,
639};
640
641static struct clk clk_iis_cd0 = {
642 .name = "iis_cdclk0",
643 .id = -1,
644};
645
646static struct clk clk_iis_cd1 = {
647 .name = "iis_cdclk1",
648 .id = -1,
649};
650
651static struct clk clk_iis_cd2 = {
652 .name = "iis_cdclk2",
653 .id = -1,
654};
655
656static struct clk clk_pcm_cd0 = {
657 .name = "pcm_cdclk0",
658 .id = -1,
659};
660
661static struct clk clk_pcm_cd1 = {
662 .name = "pcm_cdclk1",
663 .id = -1,
664};
665
666static struct clk *clkset_audio0_list[] = {
667 &clk_mout_epll.clk,
668 &clk_dout_mpll,
669 &clk_fin_epll,
670 &clk_iis_cd0,
671 &clk_pcm_cd0,
672 &clk_mout_hpll.clk,
673};
674
675static struct clk_sources clkset_audio0 = {
676 .sources = clkset_audio0_list,
677 .nr_sources = ARRAY_SIZE(clkset_audio0_list),
678};
679
680static struct clksrc_clk clk_audio0 = {
681 .clk = {
682 .name = "audio-bus",
683 .id = 0,
684 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO0,
685 .enable = s5pc100_sclk1_ctrl,
686 .set_parent = s5pc100_setparent_clksrc,
687 .get_rate = s5pc100_getrate_clksrc,
688 .set_rate = s5pc100_setrate_clksrc,
689 .round_rate = s5pc100_roundrate_clksrc,
690 },
691 .shift = S5PC100_CLKSRC3_AUDIO0_SHIFT,
692 .mask = S5PC100_CLKSRC3_AUDIO0_MASK,
693 .sources = &clkset_audio0,
694 .divider_shift = S5PC100_CLKDIV4_AUDIO0_SHIFT,
695 .reg_divider = S5PC100_CLKDIV4,
696 .reg_source = S5PC100_CLKSRC3,
697};
698
699static struct clk *clkset_audio1_list[] = {
700 &clk_mout_epll.clk,
701 &clk_dout_mpll,
702 &clk_fin_epll,
703 &clk_iis_cd1,
704 &clk_pcm_cd1,
705 &clk_mout_hpll.clk,
706};
707
708static struct clk_sources clkset_audio1 = {
709 .sources = clkset_audio1_list,
710 .nr_sources = ARRAY_SIZE(clkset_audio1_list),
711};
712
713static struct clksrc_clk clk_audio1 = {
714 .clk = {
715 .name = "audio-bus",
716 .id = 1,
717 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO1,
718 .enable = s5pc100_sclk1_ctrl,
719 .set_parent = s5pc100_setparent_clksrc,
720 .get_rate = s5pc100_getrate_clksrc,
721 .set_rate = s5pc100_setrate_clksrc,
722 .round_rate = s5pc100_roundrate_clksrc,
723 },
724 .shift = S5PC100_CLKSRC3_AUDIO1_SHIFT,
725 .mask = S5PC100_CLKSRC3_AUDIO1_MASK,
726 .sources = &clkset_audio1,
727 .divider_shift = S5PC100_CLKDIV4_AUDIO1_SHIFT,
728 .reg_divider = S5PC100_CLKDIV4,
729 .reg_source = S5PC100_CLKSRC3,
730};
731
732static struct clk *clkset_audio2_list[] = {
733 &clk_mout_epll.clk,
734 &clk_dout_mpll,
735 &clk_fin_epll,
736 &clk_iis_cd2,
737 &clk_mout_hpll.clk,
738};
739
740static struct clk_sources clkset_audio2 = {
741 .sources = clkset_audio2_list,
742 .nr_sources = ARRAY_SIZE(clkset_audio2_list),
743};
744
745static struct clksrc_clk clk_audio2 = {
746 .clk = {
747 .name = "audio-bus",
748 .id = 2,
749 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO2,
750 .enable = s5pc100_sclk1_ctrl,
751 .set_parent = s5pc100_setparent_clksrc,
752 .get_rate = s5pc100_getrate_clksrc,
753 .set_rate = s5pc100_setrate_clksrc,
754 .round_rate = s5pc100_roundrate_clksrc,
755 },
756 .shift = S5PC100_CLKSRC3_AUDIO2_SHIFT,
757 .mask = S5PC100_CLKSRC3_AUDIO2_MASK,
758 .sources = &clkset_audio2,
759 .divider_shift = S5PC100_CLKDIV4_AUDIO2_SHIFT,
760 .reg_divider = S5PC100_CLKDIV4,
761 .reg_source = S5PC100_CLKSRC3,
762};
763
764static struct clk *clkset_spdif_list[] = {
765 &clk_audio0.clk,
766 &clk_audio1.clk,
767 &clk_audio2.clk,
768};
769
770static struct clk_sources clkset_spdif = {
771 .sources = clkset_spdif_list,
772 .nr_sources = ARRAY_SIZE(clkset_spdif_list),
773};
774
775static struct clksrc_clk clk_spdif = {
776 .clk = {
777 .name = "spdif",
778 .id = -1,
779 },
780 .shift = S5PC100_CLKSRC3_SPDIF_SHIFT,
781 .mask = S5PC100_CLKSRC3_SPDIF_MASK,
782 .sources = &clkset_spdif,
783 .reg_source = S5PC100_CLKSRC3,
784};
785
786static struct clk *clkset_lcd_fimc_list[] = {
787 &clk_mout_epll.clk,
788 &clk_dout_mpll,
789 &clk_mout_hpll.clk,
790 &clk_vclk_54m,
791};
792
793static struct clk_sources clkset_lcd_fimc = {
794 .sources = clkset_lcd_fimc_list,
795 .nr_sources = ARRAY_SIZE(clkset_lcd_fimc_list),
796};
797
798static struct clksrc_clk clk_lcd = {
799 .clk = {
800 .name = "lcd",
801 .id = -1,
802 .ctrlbit = S5PC100_CLKGATE_SCLK1_LCD,
803 .enable = s5pc100_sclk1_ctrl,
804 .set_parent = s5pc100_setparent_clksrc,
805 .get_rate = s5pc100_getrate_clksrc,
806 .set_rate = s5pc100_setrate_clksrc,
807 .round_rate = s5pc100_roundrate_clksrc,
808 },
809 .shift = S5PC100_CLKSRC2_LCD_SHIFT,
810 .mask = S5PC100_CLKSRC2_LCD_MASK,
811 .sources = &clkset_lcd_fimc,
812 .divider_shift = S5PC100_CLKDIV3_LCD_SHIFT,
813 .reg_divider = S5PC100_CLKDIV3,
814 .reg_source = S5PC100_CLKSRC2,
815};
816
817static struct clksrc_clk clk_fimc0 = {
818 .clk = {
819 .name = "fimc",
820 .id = 0,
821 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC0,
822 .enable = s5pc100_sclk1_ctrl,
823 .set_parent = s5pc100_setparent_clksrc,
824 .get_rate = s5pc100_getrate_clksrc,
825 .set_rate = s5pc100_setrate_clksrc,
826 .round_rate = s5pc100_roundrate_clksrc,
827 },
828 .shift = S5PC100_CLKSRC2_FIMC0_SHIFT,
829 .mask = S5PC100_CLKSRC2_FIMC0_MASK,
830 .sources = &clkset_lcd_fimc,
831 .divider_shift = S5PC100_CLKDIV3_FIMC0_SHIFT,
832 .reg_divider = S5PC100_CLKDIV3,
833 .reg_source = S5PC100_CLKSRC2,
834};
835
836static struct clksrc_clk clk_fimc1 = {
837 .clk = {
838 .name = "fimc",
839 .id = 1,
840 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC1,
841 .enable = s5pc100_sclk1_ctrl,
842 .set_parent = s5pc100_setparent_clksrc,
843 .get_rate = s5pc100_getrate_clksrc,
844 .set_rate = s5pc100_setrate_clksrc,
845 .round_rate = s5pc100_roundrate_clksrc,
846 },
847 .shift = S5PC100_CLKSRC2_FIMC1_SHIFT,
848 .mask = S5PC100_CLKSRC2_FIMC1_MASK,
849 .sources = &clkset_lcd_fimc,
850 .divider_shift = S5PC100_CLKDIV3_FIMC1_SHIFT,
851 .reg_divider = S5PC100_CLKDIV3,
852 .reg_source = S5PC100_CLKSRC2,
853};
854
855static struct clksrc_clk clk_fimc2 = {
856 .clk = {
857 .name = "fimc",
858 .id = 2,
859 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC2,
860 .enable = s5pc100_sclk1_ctrl,
861 .set_parent = s5pc100_setparent_clksrc,
862 .get_rate = s5pc100_getrate_clksrc,
863 .set_rate = s5pc100_setrate_clksrc,
864 .round_rate = s5pc100_roundrate_clksrc,
865 },
866 .shift = S5PC100_CLKSRC2_FIMC2_SHIFT,
867 .mask = S5PC100_CLKSRC2_FIMC2_MASK,
868 .sources = &clkset_lcd_fimc,
869 .divider_shift = S5PC100_CLKDIV3_FIMC2_SHIFT,
870 .reg_divider = S5PC100_CLKDIV3,
871 .reg_source = S5PC100_CLKSRC2,
872};
873
874static struct clk *clkset_mmc_list[] = {
875 &clk_mout_epll.clk,
876 &clk_dout_mpll,
877 &clk_fin_epll,
878 &clk_mout_hpll.clk ,
879};
880
881static struct clk_sources clkset_mmc = {
882 .sources = clkset_mmc_list,
883 .nr_sources = ARRAY_SIZE(clkset_mmc_list),
884};
885
886static struct clksrc_clk clk_mmc0 = {
887 .clk = {
888 .name = "mmc_bus",
889 .id = 0,
890 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0,
891 .enable = s5pc100_sclk0_ctrl,
892 .set_parent = s5pc100_setparent_clksrc,
893 .get_rate = s5pc100_getrate_clksrc,
894 .set_rate = s5pc100_setrate_clksrc,
895 .round_rate = s5pc100_roundrate_clksrc,
896 },
897 .shift = S5PC100_CLKSRC2_MMC0_SHIFT,
898 .mask = S5PC100_CLKSRC2_MMC0_MASK,
899 .sources = &clkset_mmc,
900 .divider_shift = S5PC100_CLKDIV3_MMC0_SHIFT,
901 .reg_divider = S5PC100_CLKDIV3,
902 .reg_source = S5PC100_CLKSRC2,
903};
904
905static struct clksrc_clk clk_mmc1 = {
906 .clk = {
907 .name = "mmc_bus",
908 .id = 1,
909 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1,
910 .enable = s5pc100_sclk0_ctrl,
911 .set_parent = s5pc100_setparent_clksrc,
912 .get_rate = s5pc100_getrate_clksrc,
913 .set_rate = s5pc100_setrate_clksrc,
914 .round_rate = s5pc100_roundrate_clksrc,
915 },
916 .shift = S5PC100_CLKSRC2_MMC1_SHIFT,
917 .mask = S5PC100_CLKSRC2_MMC1_MASK,
918 .sources = &clkset_mmc,
919 .divider_shift = S5PC100_CLKDIV3_MMC1_SHIFT,
920 .reg_divider = S5PC100_CLKDIV3,
921 .reg_source = S5PC100_CLKSRC2,
922};
923
924static struct clksrc_clk clk_mmc2 = {
925 .clk = {
926 .name = "mmc_bus",
927 .id = 2,
928 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2,
929 .enable = s5pc100_sclk0_ctrl,
930 .set_parent = s5pc100_setparent_clksrc,
931 .get_rate = s5pc100_getrate_clksrc,
932 .set_rate = s5pc100_setrate_clksrc,
933 .round_rate = s5pc100_roundrate_clksrc,
934 },
935 .shift = S5PC100_CLKSRC2_MMC2_SHIFT,
936 .mask = S5PC100_CLKSRC2_MMC2_MASK,
937 .sources = &clkset_mmc,
938 .divider_shift = S5PC100_CLKDIV3_MMC2_SHIFT,
939 .reg_divider = S5PC100_CLKDIV3,
940 .reg_source = S5PC100_CLKSRC2,
941};
942
943
944static struct clk *clkset_usbhost_list[] = {
945 &clk_mout_epll.clk,
946 &clk_dout_mpll,
947 &clk_mout_hpll.clk,
948 &clk_48m,
949};
950
951static struct clk_sources clkset_usbhost = {
952 .sources = clkset_usbhost_list,
953 .nr_sources = ARRAY_SIZE(clkset_usbhost_list),
954};
955
956static struct clksrc_clk clk_usbhost = {
957 .clk = {
958 .name = "usbhost",
959 .id = -1,
960 .ctrlbit = S5PC100_CLKGATE_SCLK0_USBHOST,
961 .enable = s5pc100_sclk0_ctrl,
962 .set_parent = s5pc100_setparent_clksrc,
963 .get_rate = s5pc100_getrate_clksrc,
964 .set_rate = s5pc100_setrate_clksrc,
965 .round_rate = s5pc100_roundrate_clksrc,
966 },
967 .shift = S5PC100_CLKSRC1_UHOST_SHIFT,
968 .mask = S5PC100_CLKSRC1_UHOST_MASK,
969 .sources = &clkset_usbhost,
970 .divider_shift = S5PC100_CLKDIV2_UHOST_SHIFT,
971 .reg_divider = S5PC100_CLKDIV2,
972 .reg_source = S5PC100_CLKSRC1,
1012}; 973};
1013 974
1014/* Clock initialisation code */ 975/* Clock initialisation code */
1015 976
1016static struct clksrc_clk *init_parents[] = { 977static struct clksrc_clk *init_parents[] = {
1017 &clk_mout_apll, 978 &clk_mout_apll,
1018 &clk_mout_epll,
1019 &clk_mout_mpll, 979 &clk_mout_mpll,
980 &clk_mout_am,
981 &clk_mout_onenand,
982 &clk_mout_epll,
983 &clk_mout_hpll,
984 &clk_spi0,
985 &clk_spi1,
986 &clk_spi2,
1020 &clk_uart_uclk1, 987 &clk_uart_uclk1,
988 &clk_audio0,
989 &clk_audio1,
990 &clk_audio2,
991 &clk_spdif,
992 &clk_lcd,
993 &clk_fimc0,
994 &clk_fimc1,
995 &clk_fimc2,
996 &clk_mmc0,
997 &clk_mmc1,
998 &clk_mmc2,
999 &clk_usbhost,
1021}; 1000};
1022 1001
1023static void __init_or_cpufreq s5pc1xx_set_clksrc(struct clksrc_clk *clk) 1002static void __init_or_cpufreq s5pc100_set_clksrc(struct clksrc_clk *clk)
1024{ 1003{
1025 struct clk_sources *srcs = clk->sources; 1004 struct clk_sources *srcs = clk->sources;
1026 u32 clksrc = __raw_readl(clk->reg_source); 1005 u32 clksrc = __raw_readl(clk->reg_source);
@@ -1036,9 +1015,9 @@ static void __init_or_cpufreq s5pc1xx_set_clksrc(struct clksrc_clk *clk)
1036 1015
1037 clk->clk.parent = srcs->sources[clksrc]; 1016 clk->clk.parent = srcs->sources[clksrc];
1038 1017
1039 printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n", 1018 printk(KERN_INFO "%s: source is %s (%d), rate is %ld.%03ld MHz\n",
1040 clk->clk.name, clk->clk.parent->name, clksrc, 1019 clk->clk.name, clk->clk.parent->name, clksrc,
1041 clk_get_rate(&clk->clk)); 1020 print_mhz(clk_get_rate(&clk->clk)));
1042} 1021}
1043 1022
1044#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 1023#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
@@ -1052,20 +1031,16 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
1052 unsigned long hclk; 1031 unsigned long hclk;
1053 unsigned long pclkd0; 1032 unsigned long pclkd0;
1054 unsigned long pclk; 1033 unsigned long pclk;
1055 unsigned long apll; 1034 unsigned long apll, mpll, epll, hpll;
1056 unsigned long mpll;
1057 unsigned long hpll;
1058 unsigned long epll;
1059 unsigned int ptr; 1035 unsigned int ptr;
1060 u32 clkdiv0, clkdiv1; 1036 u32 clkdiv0, clkdiv1;
1061 1037
1062 printk(KERN_DEBUG "%s: registering clocks\n", __func__); 1038 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
1063 1039
1064 clkdiv0 = __raw_readl(S5PC1XX_CLK_DIV0); 1040 clkdiv0 = __raw_readl(S5PC100_CLKDIV0);
1065 clkdiv1 = __raw_readl(S5PC1XX_CLK_DIV1); 1041 clkdiv1 = __raw_readl(S5PC100_CLKDIV1);
1066 1042
1067 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", 1043 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n", __func__, clkdiv0, clkdiv1);
1068 __func__, clkdiv0, clkdiv1);
1069 1044
1070 xtal_clk = clk_get(NULL, "xtal"); 1045 xtal_clk = clk_get(NULL, "xtal");
1071 BUG_ON(IS_ERR(xtal_clk)); 1046 BUG_ON(IS_ERR(xtal_clk));
@@ -1075,48 +1050,81 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
1075 1050
1076 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); 1051 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
1077 1052
1078 apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_APLL_CON)); 1053 apll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_APLL_CON));
1079 mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_MPLL_CON)); 1054 mpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_MPLL_CON));
1080 epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC1XX_EPLL_CON)); 1055 epll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_EPLL_CON));
1081 hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON)); 1056 hpll = s5pc1xx_get_pll(xtal, __raw_readl(S5PC100_HPLL_CON));
1082 1057
1083 printk(KERN_INFO "S5PC100: PLL settings, A=%ld, M=%ld, E=%ld, H=%ld\n", 1058 printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz"
1084 apll, mpll, epll, hpll); 1059 ", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
1060 print_mhz(apll), print_mhz(mpll),
1061 print_mhz(epll), print_mhz(hpll));
1085 1062
1086 armclk = apll / GET_DIV(clkdiv0, S5PC1XX_CLKDIV0_APLL); 1063 armclk = apll / GET_DIV(clkdiv0, S5PC100_CLKDIV0_APLL);
1087 armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM); 1064 armclk = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_ARM);
1088 hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0); 1065 hclkd0 = armclk / GET_DIV(clkdiv0, S5PC100_CLKDIV0_D0);
1089 pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0); 1066 pclkd0 = hclkd0 / GET_DIV(clkdiv0, S5PC100_CLKDIV0_PCLKD0);
1090 hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1); 1067 hclk = mpll / GET_DIV(clkdiv1, S5PC100_CLKDIV1_D1);
1091 pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1); 1068 pclk = hclk / GET_DIV(clkdiv1, S5PC100_CLKDIV1_PCLKD1);
1092 1069
1093 printk(KERN_INFO "S5PC100: ARMCLK=%ld, HCLKD0=%ld, PCLKD0=%ld, HCLK=%ld, PCLK=%ld\n", 1070 printk(KERN_INFO "S5PC100: ARMCLK=%ld.%03ld MHz, HCLKD0=%ld.%03ld MHz,"
1094 armclk, hclkd0, pclkd0, hclk, pclk); 1071 " PCLKD0=%ld.%03ld MHz\n, HCLK=%ld.%03ld MHz,"
1072 " PCLK=%ld.%03ld MHz\n",
1073 print_mhz(armclk), print_mhz(hclkd0),
1074 print_mhz(pclkd0), print_mhz(hclk), print_mhz(pclk));
1095 1075
1096 clk_fout_apll.rate = apll; 1076 clk_fout_apll.rate = apll;
1097 clk_fout_mpll.rate = mpll; 1077 clk_fout_mpll.rate = mpll;
1098 clk_fout_epll.rate = epll; 1078 clk_fout_epll.rate = epll;
1099 clk_fout_apll.rate = apll; 1079 clk_fout_hpll.rate = hpll;
1100 1080
1101 clk_h.rate = hclk; 1081 clk_h.rate = hclk;
1102 clk_p.rate = pclk; 1082 clk_p.rate = pclk;
1083 clk_f.rate = armclk;
1103 1084
1104 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) 1085 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
1105 s5pc1xx_set_clksrc(init_parents[ptr]); 1086 s5pc100_set_clksrc(init_parents[ptr]);
1106} 1087}
1107 1088
1108static struct clk *clks[] __initdata = { 1089static struct clk *clks[] __initdata = {
1109 &clk_ext_xtal_mux, 1090 &clk_ext_xtal_mux,
1110 &clk_mout_epll.clk, 1091 &clk_mout_apll.clk,
1111 &clk_fout_epll, 1092 &clk_dout_apll,
1093 &clk_dout_d0_bus,
1094 &clk_dout_pclkd0,
1095 &clk_dout_apll2,
1112 &clk_mout_mpll.clk, 1096 &clk_mout_mpll.clk,
1097 &clk_mout_am.clk,
1098 &clk_dout_d1_bus,
1099 &clk_mout_onenand.clk,
1100 &clk_dout_pclkd1,
1101 &clk_dout_mpll2,
1102 &clk_dout_cam,
1113 &clk_dout_mpll, 1103 &clk_dout_mpll,
1104 &clk_mout_epll.clk,
1105 &clk_fout_epll,
1106 &clk_iis_cd0,
1107 &clk_iis_cd1,
1108 &clk_iis_cd2,
1109 &clk_pcm_cd0,
1110 &clk_pcm_cd1,
1111 &clk_spi0.clk,
1112 &clk_spi1.clk,
1113 &clk_spi2.clk,
1114 &clk_uart_uclk1.clk, 1114 &clk_uart_uclk1.clk,
1115 &clk_ext, 1115 &clk_audio0.clk,
1116 &clk_epll, 1116 &clk_audio1.clk,
1117 &clk_27m, 1117 &clk_audio2.clk,
1118 &clk_48m, 1118 &clk_spdif.clk,
1119 &clk_54m, 1119 &clk_lcd.clk,
1120 &clk_fimc0.clk,
1121 &clk_fimc1.clk,
1122 &clk_fimc2.clk,
1123 &clk_mmc0.clk,
1124 &clk_mmc1.clk,
1125 &clk_mmc2.clk,
1126 &clk_usbhost.clk,
1127 &clk_arm,
1120}; 1128};
1121 1129
1122void __init s5pc100_register_clocks(void) 1130void __init s5pc100_register_clocks(void)
@@ -1133,7 +1141,4 @@ void __init s5pc100_register_clocks(void)
1133 clkp->name, ret); 1141 clkp->name, ret);
1134 } 1142 }
1135 } 1143 }
1136
1137 clk_mpll.parent = &clk_mout_mpll.clk;
1138 clk_epll.parent = &clk_mout_epll.clk;
1139} 1144}
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
new file mode 100644
index 000000000000..1a63768a9a2e
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
@@ -0,0 +1,49 @@
1/*
2 * linux/arch/arm/plat-s5pc100/setup-fb-24bpp.c
3 *
4 * Copyright 2009 Samsung Electronics
5 *
6 * Base S5PC1XX setup information for 24bpp LCD framebuffer
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#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/fb.h>
16#include <linux/gpio.h>
17
18#include <mach/regs-fb.h>
19#include <mach/map.h>
20#include <plat/fb.h>
21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-s5pc1xx.h>
23
24#define DISR_OFFSET 0x7008
25
26void s5pc100_fb_gpio_setup_24bpp(void)
27{
28 unsigned int gpio = 0;
29
30 for (gpio = S5PC100_GPF0(0); gpio <= S5PC100_GPF0(7); gpio++) {
31 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
32 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
33 }
34
35 for (gpio = S5PC100_GPF1(0); gpio <= S5PC100_GPF1(7); gpio++) {
36 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
37 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
38 }
39
40 for (gpio = S5PC100_GPF2(0); gpio <= S5PC100_GPF2(7); gpio++) {
41 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
42 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
43 }
44
45 for (gpio = S5PC100_GPF3(0); gpio <= S5PC100_GPF3(3); gpio++) {
46 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
47 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
48 }
49}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c0.c b/arch/arm/plat-s5pc1xx/setup-i2c0.c
index 3d00c025fffb..5e4a7c3a231e 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c0.c
+++ b/arch/arm/plat-s5pc1xx/setup-i2c0.c
@@ -17,9 +17,14 @@
17 17
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h>
20#include <plat/iic.h> 21#include <plat/iic.h>
22#include <plat/gpio-cfg.h>
21 23
22void s3c_i2c0_cfg_gpio(struct platform_device *dev) 24void s3c_i2c0_cfg_gpio(struct platform_device *dev)
23{ 25{
24 /* Pin configuration would be needed */ 26 s3c_gpio_cfgpin(S5PC100_GPD(3), S3C_GPIO_SFN(2));
27 s3c_gpio_setpull(S5PC100_GPD(3), S3C_GPIO_PULL_UP);
28 s3c_gpio_cfgpin(S5PC100_GPD(4), S3C_GPIO_SFN(2));
29 s3c_gpio_setpull(S5PC100_GPD(4), S3C_GPIO_PULL_UP);
25} 30}
diff --git a/arch/arm/plat-s5pc1xx/setup-i2c1.c b/arch/arm/plat-s5pc1xx/setup-i2c1.c
index c8f3ca42f51d..a0a8b4ae6ad8 100644
--- a/arch/arm/plat-s5pc1xx/setup-i2c1.c
+++ b/arch/arm/plat-s5pc1xx/setup-i2c1.c
@@ -17,9 +17,14 @@
17 17
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <linux/gpio.h>
20#include <plat/iic.h> 21#include <plat/iic.h>
22#include <plat/gpio-cfg.h>
21 23
22void s3c_i2c1_cfg_gpio(struct platform_device *dev) 24void s3c_i2c1_cfg_gpio(struct platform_device *dev)
23{ 25{
24 /* Pin configuration would be needed */ 26 s3c_gpio_cfgpin(S5PC100_GPD(5), S3C_GPIO_SFN(2));
27 s3c_gpio_setpull(S5PC100_GPD(5), S3C_GPIO_PULL_UP);
28 s3c_gpio_cfgpin(S5PC100_GPD(6), S3C_GPIO_SFN(2));
29 s3c_gpio_setpull(S5PC100_GPD(6), S3C_GPIO_PULL_UP);
25} 30}
diff --git a/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c b/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
new file mode 100644
index 000000000000..185c8941e644
--- /dev/null
+++ b/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
@@ -0,0 +1,86 @@
1/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c
2 *
3 * Copyright 2009 Samsung Eletronics
4 *
5 * S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
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
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18#include <linux/mmc/host.h>
19#include <linux/mmc/card.h>
20
21#include <plat/gpio-cfg.h>
22#include <plat/regs-sdhci.h>
23
24void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
25{
26 unsigned int gpio;
27 unsigned int end;
28 unsigned int num;
29
30 num = width;
31 /* In case of 8 width, we should decrease the 2 */
32 if (width == 8)
33 num = width - 2;
34
35 end = S5PC100_GPG0(2 + num);
36
37 /* Set all the necessary GPG0/GPG1 pins to special-function 0 */
38 for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {
39 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
40 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
41 }
42
43 if (width == 8) {
44 for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) {
45 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
46 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
47 }
48 }
49
50 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
51 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
52}
53
54void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
55{
56 unsigned int gpio;
57 unsigned int end;
58
59 end = S5PC100_GPG2(2 + width);
60
61 /* Set all the necessary GPG2 pins to special-function 2 */
62 for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) {
63 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
64 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
65 }
66
67 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
68 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
69}
70
71void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
72{
73 unsigned int gpio;
74 unsigned int end;
75
76 end = S5PC100_GPG3(2 + width);
77
78 /* Set all the necessary GPG3 pins to special-function 2 */
79 for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) {
80 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
81 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
82 }
83
84 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
85 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
86}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
new file mode 100644
index 000000000000..486a0d6301e7
--- /dev/null
+++ b/arch/arm/plat-samsung/Kconfig
@@ -0,0 +1,17 @@
1# arch/arm/plat-samsung/Kconfig
2#
3# Copyright 2009 Simtec Electronics
4#
5# Licensed under GPLv2
6
7config PLAT_SAMSUNG
8 bool
9 depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX
10 default y
11 help
12 Base platform code for all Samsung SoC based systems
13
14if PLAT_SAMSUNG
15
16
17endif
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
new file mode 100644
index 000000000000..4478b9f7dc34
--- /dev/null
+++ b/arch/arm/plat-samsung/Makefile
@@ -0,0 +1,11 @@
1# arch/arm/plat-s3c64xx/Makefile
2#
3# Copyright 2009 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n := dummy.o
10obj- :=
11
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 35e3bd9858df..d856354f4272 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -92,6 +92,7 @@ config PLATFORM_AT32AP
92 select PERFORMANCE_COUNTERS 92 select PERFORMANCE_COUNTERS
93 select ARCH_REQUIRE_GPIOLIB 93 select ARCH_REQUIRE_GPIOLIB
94 select GENERIC_ALLOCATOR 94 select GENERIC_ALLOCATOR
95 select HAVE_FB_ATMEL
95 96
96# 97#
97# CPU types 98# CPU types
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 6ff6c20f1e78..1fca59077949 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -19,7 +19,9 @@
19#include <linux/completion.h> 19#include <linux/completion.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/i2c-pnx.h> 21#include <linux/i2c-pnx.h>
22#include <linux/io.h>
22#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/i2c.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/uaccess.h> 26#include <asm/uaccess.h>
25 27
@@ -54,6 +56,9 @@ static inline void i2c_pnx_arm_timer(struct i2c_adapter *adap)
54 struct timer_list *timer = &data->mif.timer; 56 struct timer_list *timer = &data->mif.timer;
55 int expires = I2C_PNX_TIMEOUT / (1000 / HZ); 57 int expires = I2C_PNX_TIMEOUT / (1000 / HZ);
56 58
59 if (expires <= 1)
60 expires = 2;
61
57 del_timer_sync(timer); 62 del_timer_sync(timer);
58 63
59 dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n", 64 dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n",
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 3c20dae43ce2..e11e1cda4ba2 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -780,7 +780,7 @@ config RTC_DRV_TX4939
780 780
781config RTC_DRV_MV 781config RTC_DRV_MV
782 tristate "Marvell SoC RTC" 782 tristate "Marvell SoC RTC"
783 depends on ARCH_KIRKWOOD 783 depends on ARCH_KIRKWOOD || ARCH_DOVE
784 help 784 help
785 If you say yes here you will get support for the in-chip RTC 785 If you say yes here you will get support for the in-chip RTC
786 that can be found in some of Marvell's SoC devices, such as 786 that can be found in some of Marvell's SoC devices, such as
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index c99f0821cae3..73f089d3efd6 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Driver for Samsung S3C2410 SoC onboard UARTs. 3 * Driver for Samsung S3C2410 SoC onboard UARTs.
4 * 4 *
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/serial/s3c2412.c b/drivers/serial/s3c2412.c
index 6e057d8809d3..ce75e28e36ef 100644
--- a/drivers/serial/s3c2412.c
+++ b/drivers/serial/s3c2412.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs. 3 * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs.
4 * 4 *
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/serial/s3c2440.c b/drivers/serial/s3c2440.c
index 69ff5d340f04..094cc3904b13 100644
--- a/drivers/serial/s3c2440.c
+++ b/drivers/serial/s3c2440.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs. 3 * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs.
4 * 4 *
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/serial/s3c24a0.c b/drivers/serial/s3c24a0.c
index 26c49e18bdd1..fad6083ca427 100644
--- a/drivers/serial/s3c24a0.c
+++ b/drivers/serial/s3c24a0.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * Author: Sandeep Patil <sandeep.patil@azingo.com> 7 * Author: Sandeep Patil <sandeep.patil@azingo.com>
8 * 8 *
9 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 9 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
10 * http://armlinux.simtec.co.uk/ 10 * http://armlinux.simtec.co.uk/
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 1523e8d9ae77..52e3df113ec0 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Driver core for Samsung SoC onboard UARTs. 3 * Driver core for Samsung SoC onboard UARTs.
4 * 4 *
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
index d3fe315969f6..1fb22343df42 100644
--- a/drivers/serial/samsung.h
+++ b/drivers/serial/samsung.h
@@ -2,7 +2,7 @@
2 * 2 *
3 * Driver for Samsung SoC onboard UARTs. 3 * Driver for Samsung SoC onboard UARTs.
4 * 4 *
5 * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics 5 * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 188e1ba3b69f..6b89eb55ed32 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -5,6 +5,9 @@
5menu "Graphics support" 5menu "Graphics support"
6 depends on HAS_IOMEM 6 depends on HAS_IOMEM
7 7
8config HAVE_FB_ATMEL
9 bool
10
8source "drivers/char/agp/Kconfig" 11source "drivers/char/agp/Kconfig"
9 12
10source "drivers/gpu/vga/Kconfig" 13source "drivers/gpu/vga/Kconfig"
@@ -937,7 +940,7 @@ config FB_S1D13XXX
937 940
938config FB_ATMEL 941config FB_ATMEL
939 tristate "AT91/AT32 LCD Controller support" 942 tristate "AT91/AT32 LCD Controller support"
940 depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32) 943 depends on FB && HAVE_FB_ATMEL
941 select FB_CFB_FILLRECT 944 select FB_CFB_FILLRECT
942 select FB_CFB_COPYAREA 945 select FB_CFB_COPYAREA
943 select FB_CFB_IMAGEBLIT 946 select FB_CFB_IMAGEBLIT
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index f24d04132eda..4d227b152001 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -317,7 +317,7 @@ static int __devexit pnx4008_wdt_remove(struct platform_device *pdev)
317 317
318static struct platform_driver platform_wdt_driver = { 318static struct platform_driver platform_wdt_driver = {
319 .driver = { 319 .driver = {
320 .name = "watchdog", 320 .name = "pnx4008-watchdog",
321 .owner = THIS_MODULE, 321 .owner = THIS_MODULE,
322 }, 322 },
323 .probe = pnx4008_wdt_probe, 323 .probe = pnx4008_wdt_probe,
@@ -352,4 +352,4 @@ MODULE_PARM_DESC(nowayout,
352 352
353MODULE_LICENSE("GPL"); 353MODULE_LICENSE("GPL");
354MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 354MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
355MODULE_ALIAS("platform:watchdog"); 355MODULE_ALIAS("platform:pnx4008-watchdog");
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 89fc8ee1f5a5..de059f490586 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1712,7 +1712,8 @@ int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,
1712 struct super_block *sb = inode->i_sb; 1712 struct super_block *sb = inode->i_sb;
1713 1713
1714 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) || 1714 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) ||
1715 !(OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL)) 1715 !(OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL) ||
1716 OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
1716 return 0; 1717 return 0;
1717 1718
1718 cpos = pos >> OCFS2_SB(sb)->s_clustersize_bits; 1719 cpos = pos >> OCFS2_SB(sb)->s_clustersize_bits;
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index eae404602424..d963d8638709 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -35,12 +35,7 @@
35#include <linux/kref.h> 35#include <linux/kref.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/lockdep.h> 37#include <linux/lockdep.h>
38#ifndef CONFIG_OCFS2_COMPAT_JBD 38#include <linux/jbd2.h>
39# include <linux/jbd2.h>
40#else
41# include <linux/jbd.h>
42# include "ocfs2_jbd_compat.h"
43#endif
44 39
45/* For union ocfs2_dlm_lksb */ 40/* For union ocfs2_dlm_lksb */
46#include "stackglue.h" 41#include "stackglue.h"
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 60287fc56bcb..3a0df7a1b810 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3743,6 +3743,9 @@ static int ocfs2_attach_refcount_tree(struct inode *inode,
3743 goto out; 3743 goto out;
3744 } 3744 }
3745 3745
3746 if (oi->ip_dyn_features & OCFS2_INLINE_DATA_FL)
3747 goto attach_xattr;
3748
3746 ocfs2_init_dinode_extent_tree(&di_et, INODE_CACHE(inode), di_bh); 3749 ocfs2_init_dinode_extent_tree(&di_et, INODE_CACHE(inode), di_bh);
3747 3750
3748 size = i_size_read(inode); 3751 size = i_size_read(inode);
@@ -3769,6 +3772,7 @@ static int ocfs2_attach_refcount_tree(struct inode *inode,
3769 cpos += num_clusters; 3772 cpos += num_clusters;
3770 } 3773 }
3771 3774
3775attach_xattr:
3772 if (oi->ip_dyn_features & OCFS2_HAS_XATTR_FL) { 3776 if (oi->ip_dyn_features & OCFS2_HAS_XATTR_FL) {
3773 ret = ocfs2_xattr_attach_refcount_tree(inode, di_bh, 3777 ret = ocfs2_xattr_attach_refcount_tree(inode, di_bh,
3774 &ref_tree->rf_ci, 3778 &ref_tree->rf_ci,
@@ -3858,6 +3862,49 @@ out:
3858 return ret; 3862 return ret;
3859} 3863}
3860 3864
3865static int ocfs2_duplicate_inline_data(struct inode *s_inode,
3866 struct buffer_head *s_bh,
3867 struct inode *t_inode,
3868 struct buffer_head *t_bh)
3869{
3870 int ret;
3871 handle_t *handle;
3872 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb);
3873 struct ocfs2_dinode *s_di = (struct ocfs2_dinode *)s_bh->b_data;
3874 struct ocfs2_dinode *t_di = (struct ocfs2_dinode *)t_bh->b_data;
3875
3876 BUG_ON(!(OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
3877
3878 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
3879 if (IS_ERR(handle)) {
3880 ret = PTR_ERR(handle);
3881 mlog_errno(ret);
3882 goto out;
3883 }
3884
3885 ret = ocfs2_journal_access_di(handle, INODE_CACHE(t_inode), t_bh,
3886 OCFS2_JOURNAL_ACCESS_WRITE);
3887 if (ret) {
3888 mlog_errno(ret);
3889 goto out_commit;
3890 }
3891
3892 t_di->id2.i_data.id_count = s_di->id2.i_data.id_count;
3893 memcpy(t_di->id2.i_data.id_data, s_di->id2.i_data.id_data,
3894 le16_to_cpu(s_di->id2.i_data.id_count));
3895 spin_lock(&OCFS2_I(t_inode)->ip_lock);
3896 OCFS2_I(t_inode)->ip_dyn_features |= OCFS2_INLINE_DATA_FL;
3897 t_di->i_dyn_features = cpu_to_le16(OCFS2_I(t_inode)->ip_dyn_features);
3898 spin_unlock(&OCFS2_I(t_inode)->ip_lock);
3899
3900 ocfs2_journal_dirty(handle, t_bh);
3901
3902out_commit:
3903 ocfs2_commit_trans(osb, handle);
3904out:
3905 return ret;
3906}
3907
3861static int ocfs2_duplicate_extent_list(struct inode *s_inode, 3908static int ocfs2_duplicate_extent_list(struct inode *s_inode,
3862 struct inode *t_inode, 3909 struct inode *t_inode,
3863 struct buffer_head *t_bh, 3910 struct buffer_head *t_bh,
@@ -3997,6 +4044,14 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
3997 goto out; 4044 goto out;
3998 } 4045 }
3999 4046
4047 if (OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
4048 ret = ocfs2_duplicate_inline_data(s_inode, s_bh,
4049 t_inode, t_bh);
4050 if (ret)
4051 mlog_errno(ret);
4052 goto out;
4053 }
4054
4000 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc), 4055 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc),
4001 1, &ref_tree, &ref_root_bh); 4056 1, &ref_tree, &ref_root_bh);
4002 if (ret) { 4057 if (ret) {
@@ -4013,10 +4068,6 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
4013 goto out_unlock_refcount; 4068 goto out_unlock_refcount;
4014 } 4069 }
4015 4070
4016 ret = ocfs2_complete_reflink(s_inode, s_bh, t_inode, t_bh, preserve);
4017 if (ret)
4018 mlog_errno(ret);
4019
4020out_unlock_refcount: 4071out_unlock_refcount:
4021 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); 4072 ocfs2_unlock_refcount_tree(osb, ref_tree, 1);
4022 brelse(ref_root_bh); 4073 brelse(ref_root_bh);
@@ -4068,9 +4119,17 @@ static int __ocfs2_reflink(struct dentry *old_dentry,
4068 ret = ocfs2_reflink_xattrs(inode, old_bh, 4119 ret = ocfs2_reflink_xattrs(inode, old_bh,
4069 new_inode, new_bh, 4120 new_inode, new_bh,
4070 preserve); 4121 preserve);
4071 if (ret) 4122 if (ret) {
4072 mlog_errno(ret); 4123 mlog_errno(ret);
4124 goto inode_unlock;
4125 }
4073 } 4126 }
4127
4128 ret = ocfs2_complete_reflink(inode, old_bh,
4129 new_inode, new_bh, preserve);
4130 if (ret)
4131 mlog_errno(ret);
4132
4074inode_unlock: 4133inode_unlock:
4075 ocfs2_inode_unlock(new_inode, 1); 4134 ocfs2_inode_unlock(new_inode, 1);
4076 brelse(new_bh); 4135 brelse(new_bh);
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c0e48aeebb1c..14f47d2bfe02 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -773,18 +773,20 @@ static int ocfs2_sb_probe(struct super_block *sb,
773 if (tmpstat < 0) { 773 if (tmpstat < 0) {
774 status = tmpstat; 774 status = tmpstat;
775 mlog_errno(status); 775 mlog_errno(status);
776 goto bail; 776 break;
777 } 777 }
778 di = (struct ocfs2_dinode *) (*bh)->b_data; 778 di = (struct ocfs2_dinode *) (*bh)->b_data;
779 memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats)); 779 memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats));
780 spin_lock_init(&stats->b_lock); 780 spin_lock_init(&stats->b_lock);
781 status = ocfs2_verify_volume(di, *bh, blksize, stats); 781 tmpstat = ocfs2_verify_volume(di, *bh, blksize, stats);
782 if (status >= 0) 782 if (tmpstat < 0) {
783 goto bail; 783 brelse(*bh);
784 brelse(*bh); 784 *bh = NULL;
785 *bh = NULL; 785 }
786 if (status != -EAGAIN) 786 if (tmpstat != -EAGAIN) {
787 status = tmpstat;
787 break; 788 break;
789 }
788 } 790 }
789 791
790bail: 792bail:
@@ -1645,6 +1647,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
1645 buf->f_bavail = buf->f_bfree; 1647 buf->f_bavail = buf->f_bfree;
1646 buf->f_files = numbits; 1648 buf->f_files = numbits;
1647 buf->f_ffree = freebits; 1649 buf->f_ffree = freebits;
1650 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1651 & 0xFFFFFFFFUL;
1652 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1653 OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
1648 1654
1649 brelse(bh); 1655 brelse(bh);
1650 1656
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index b6284f235d2f..c61369342a27 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -53,11 +53,6 @@
53#include <linux/highmem.h> 53#include <linux/highmem.h>
54#include <linux/buffer_head.h> 54#include <linux/buffer_head.h>
55#include <linux/rbtree.h> 55#include <linux/rbtree.h>
56#ifndef CONFIG_OCFS2_COMPAT_JBD
57# include <linux/jbd2.h>
58#else
59# include <linux/jbd.h>
60#endif
61 56
62#define MLOG_MASK_PREFIX ML_UPTODATE 57#define MLOG_MASK_PREFIX ML_UPTODATE
63 58
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index f13255e06406..9eb07bbc6522 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -21,7 +21,7 @@ struct i2c_pnx_mif {
21 int mode; /* Interface mode */ 21 int mode; /* Interface mode */
22 struct completion complete; /* I/O completion */ 22 struct completion complete; /* I/O completion */
23 struct timer_list timer; /* Timeout */ 23 struct timer_list timer; /* Timeout */
24 char * buf; /* Data buffer */ 24 u8 * buf; /* Data buffer */
25 int len; /* Length of data buffer */ 25 int len; /* Length of data buffer */
26}; 26};
27 27