aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/arm/Kconfig9
-rw-r--r--arch/arm/Kconfig.debug18
-rw-r--r--arch/arm/Makefile3
-rw-r--r--arch/arm/boot/Makefile8
-rw-r--r--arch/arm/boot/compressed/Makefile2
-rw-r--r--arch/arm/boot/compressed/head.S2
-rw-r--r--arch/arm/configs/s3c2410_defconfig10
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c10
-rw-r--r--arch/arm/mach-iop32x/Kconfig7
-rw-r--r--arch/arm/mach-iop32x/Makefile1
-rw-r--r--arch/arm/mach-iop32x/em7210.c215
-rw-r--r--arch/arm/mach-iop32x/irq.c3
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/mach-ks8695/irq.c1
-rw-r--r--arch/arm/mach-mx3/Kconfig12
-rw-r--r--arch/arm/mach-mx3/Makefile8
-rw-r--r--arch/arm/mach-mx3/Makefile.boot3
-rw-r--r--arch/arm/mach-mx3/mm.c64
-rw-r--r--arch/arm/mach-mx3/mx31ads.c142
-rw-r--r--arch/arm/mach-mx3/time.c152
-rw-r--r--arch/arm/mach-ns9xxx/Makefile1
-rw-r--r--arch/arm/mach-ns9xxx/board-a9m9750dev.c7
-rw-r--r--arch/arm/mach-ns9xxx/generic.c2
-rw-r--r--arch/arm/mach-ns9xxx/irq.c11
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360js.c2
-rw-r--r--arch/arm/mach-rpc/riscpc.c2
-rw-r--r--arch/arm/mach-s3c2410/Kconfig1
-rw-r--r--arch/arm/mach-s3c2410/clock.c2
-rw-r--r--arch/arm/mach-s3c2410/dma.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c4
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c6
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c3
-rw-r--r--arch/arm/mach-s3c2410/sleep.S2
-rw-r--r--arch/arm/mach-s3c2412/Kconfig1
-rw-r--r--arch/arm/mach-s3c2412/clock.c2
-rw-r--r--arch/arm/mach-s3c2412/dma.c8
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c4
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c5
-rw-r--r--arch/arm/mach-s3c2440/Kconfig1
-rw-r--r--arch/arm/mach-s3c2440/dma.c8
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c2442/Kconfig1
-rw-r--r--arch/arm/mach-s3c2443/Kconfig1
-rw-r--r--arch/arm/mach-s3c2443/dma.c8
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c2
-rw-r--r--arch/arm/mach-sa1100/Kconfig13
-rw-r--r--arch/arm/mach-sa1100/Makefile2
-rw-r--r--arch/arm/mach-sa1100/jornada720_ssp.c201
-rw-r--r--arch/arm/mach-sa1100/neponset.c2
-rw-r--r--arch/arm/mm/Kconfig18
-rw-r--r--arch/arm/mm/cache-l2x0.c6
-rw-r--r--arch/arm/mm/mmu.c14
-rw-r--r--arch/arm/mm/proc-syms.c2
-rw-r--r--arch/arm/mm/proc-v7.S33
-rw-r--r--arch/arm/plat-iop/time.c8
-rw-r--r--arch/arm/plat-mxc/Kconfig20
-rw-r--r--arch/arm/plat-mxc/Makefile10
-rw-r--r--arch/arm/plat-mxc/irq.c83
-rw-r--r--arch/arm/plat-s3c/Kconfig104
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig60
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c2
-rw-r--r--arch/arm/plat-s3c24xx/devs.c6
-rw-r--r--arch/arm/plat-s3c24xx/pm.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x.c3
-rw-r--r--arch/arm/plat-s3c24xx/sleep.S2
-rw-r--r--arch/arm/plat-s3c24xx/time.c2
-rw-r--r--arch/arm/vfp/vfphw.S12
-rw-r--r--arch/arm/vfp/vfpmodule.c12
-rw-r--r--drivers/char/watchdog/Kconfig16
-rw-r--r--drivers/char/watchdog/Makefile1
-rw-r--r--drivers/char/watchdog/iop_wdt.c262
-rw-r--r--drivers/net/arm/ether1.c3
-rw-r--r--drivers/net/arm/ether3.c3
-rw-r--r--drivers/net/arm/etherh.c1
-rw-r--r--drivers/scsi/arm/cumana_1.c207
-rw-r--r--drivers/scsi/arm/ecoscsi.c152
-rw-r--r--drivers/scsi/arm/oak.c74
-rw-r--r--drivers/serial/imx.c2
-rw-r--r--drivers/serial/s3c2410.c2
-rw-r--r--include/asm-arm/arch-at91/at91_mci.h3
-rw-r--r--include/asm-arm/arch-iop13xx/iop13xx.h43
-rw-r--r--include/asm-arm/arch-iop13xx/system.h34
-rw-r--r--include/asm-arm/arch-iop13xx/uncompress.h3
-rw-r--r--include/asm-arm/arch-iop32x/uncompress.h2
-rw-r--r--include/asm-arm/arch-mxc/board-mx31ads.h142
-rw-r--r--include/asm-arm/arch-mxc/common.h20
-rw-r--r--include/asm-arm/arch-mxc/dma.h21
-rw-r--r--include/asm-arm/arch-mxc/entry-macro.S39
-rw-r--r--include/asm-arm/arch-mxc/hardware.h52
-rw-r--r--include/asm-arm/arch-mxc/io.h33
-rw-r--r--include/asm-arm/arch-mxc/irqs.h38
-rw-r--r--include/asm-arm/arch-mxc/memory.h36
-rw-r--r--include/asm-arm/arch-mxc/mx31.h335
-rw-r--r--include/asm-arm/arch-mxc/mxc.h149
-rw-r--r--include/asm-arm/arch-mxc/system.h50
-rw-r--r--include/asm-arm/arch-mxc/timex.h25
-rw-r--r--include/asm-arm/arch-mxc/uncompress.h79
-rw-r--r--include/asm-arm/arch-mxc/vmalloc.h36
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-bbu.h28
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-mem.h6
-rw-r--r--include/asm-arm/arch-ns9xxx/regs-sys.h2
-rw-r--r--include/asm-arm/arch-s3c2400/map.h66
-rw-r--r--include/asm-arm/arch-s3c2400/memory.h23
-rw-r--r--include/asm-arm/arch-s3c2410/debug-macro.S84
-rw-r--r--include/asm-arm/arch-s3c2410/map.h85
-rw-r--r--include/asm-arm/arch-s3c2410/memory.h13
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h2
-rw-r--r--include/asm-arm/arch-s3c2410/system.h2
-rw-r--r--include/asm-arm/arch-s3c2410/uncompress.h145
-rw-r--r--include/asm-arm/arch-sa1100/jornada720.h27
-rw-r--r--include/asm-arm/elf.h3
-rw-r--r--include/asm-arm/floppy.h18
-rw-r--r--include/asm-arm/hardware/iop3xx.h33
-rw-r--r--include/asm-arm/pgtable-nommu.h3
-rw-r--r--include/asm-arm/plat-s3c/debug-macro.S75
-rw-r--r--include/asm-arm/plat-s3c/iic.h (renamed from include/asm-arm/arch-s3c2410/iic.h)0
-rw-r--r--include/asm-arm/plat-s3c/map.h40
-rw-r--r--include/asm-arm/plat-s3c/nand.h (renamed from include/asm-arm/arch-s3c2410/nand.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-ac97.h (renamed from include/asm-arm/arch-s3c2410/regs-ac97.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-adc.h (renamed from include/asm-arm/arch-s3c2410/regs-adc.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-iic.h (renamed from include/asm-arm/arch-s3c2410/regs-iic.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-nand.h (renamed from include/asm-arm/arch-s3c2410/regs-nand.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-rtc.h (renamed from include/asm-arm/arch-s3c2410/regs-rtc.h)0
-rw-r--r--include/asm-arm/plat-s3c/regs-serial.h (renamed from include/asm-arm/arch-s3c2410/regs-serial.h)8
-rw-r--r--include/asm-arm/plat-s3c/regs-timer.h (renamed from include/asm-arm/arch-s3c2410/regs-timer.h)16
-rw-r--r--include/asm-arm/plat-s3c/regs-watchdog.h (renamed from include/asm-arm/arch-s3c2410/regs-watchdog.h)8
-rw-r--r--include/asm-arm/plat-s3c/uncompress.h155
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-iis.h (renamed from include/asm-arm/arch-s3c2410/regs-iis.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-spi.h (renamed from include/asm-arm/arch-s3c2410/regs-spi.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/regs-udc.h (renamed from include/asm-arm/arch-s3c2410/regs-udc.h)0
-rw-r--r--include/asm-arm/plat-s3c24xx/udc.h (renamed from include/asm-arm/arch-s3c2410/udc.h)0
-rw-r--r--include/asm-arm/thread_info.h1
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-arm/vfp.h4
147 files changed, 3346 insertions, 788 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index fbe0dca1c0ed..57c07c20af40 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -457,7 +457,7 @@ S: Maintained
457 457
458ARM/HP JORNADA 7XX MACHINE SUPPORT 458ARM/HP JORNADA 7XX MACHINE SUPPORT
459P: Kristoffer Ericson 459P: Kristoffer Ericson
460M: kristoffer_e1@hotmail.com 460M: kristoffer.ericson@gmail.com
461W: www.jlime.com 461W: www.jlime.com
462S: Maintained 462S: Maintained
463 463
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a44c6da9bf83..85016313bd11 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -324,6 +324,12 @@ config ARCH_NS9XXX
324 324
325 <http://www.digi.com/products/microprocessors/index.jsp> 325 <http://www.digi.com/products/microprocessors/index.jsp>
326 326
327config ARCH_MXC
328 bool "Freescale MXC/iMX-based"
329 select ARCH_MTD_XIP
330 help
331 Support for Freescale MXC/iMX-based family of processors
332
327config ARCH_PNX4008 333config ARCH_PNX4008
328 bool "Philips Nexperia PNX4008 Mobile" 334 bool "Philips Nexperia PNX4008 Mobile"
329 help 335 help
@@ -432,6 +438,7 @@ source "arch/arm/mach-omap1/Kconfig"
432source "arch/arm/mach-omap2/Kconfig" 438source "arch/arm/mach-omap2/Kconfig"
433 439
434source "arch/arm/plat-s3c24xx/Kconfig" 440source "arch/arm/plat-s3c24xx/Kconfig"
441source "arch/arm/plat-s3c/Kconfig"
435 442
436if ARCH_S3C2410 443if ARCH_S3C2410
437source "arch/arm/mach-s3c2400/Kconfig" 444source "arch/arm/mach-s3c2400/Kconfig"
@@ -456,6 +463,8 @@ source "arch/arm/mach-realview/Kconfig"
456 463
457source "arch/arm/mach-at91/Kconfig" 464source "arch/arm/mach-at91/Kconfig"
458 465
466source "arch/arm/plat-mxc/Kconfig"
467
459source "arch/arm/mach-netx/Kconfig" 468source "arch/arm/mach-netx/Kconfig"
460 469
461source "arch/arm/mach-ns9xxx/Kconfig" 470source "arch/arm/mach-ns9xxx/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 40c5eb1f55c7..18101f5f5f24 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -82,24 +82,24 @@ config DEBUG_CLPS711X_UART2
82 output to the second serial port on these devices. Saying N will 82 output to the second serial port on these devices. Saying N will
83 cause the debug messages to appear on the first serial port. 83 cause the debug messages to appear on the first serial port.
84 84
85config DEBUG_S3C2410_PORT 85config DEBUG_S3C_PORT
86 depends on DEBUG_LL && ARCH_S3C2410 86 depends on DEBUG_LL && PLAT_S3C
87 bool "Kernel low-level debugging messages via S3C2410 UART" 87 bool "Kernel low-level debugging messages via S3C UART"
88 help 88 help
89 Say Y here if you want debug print routines to go to one of the 89 Say Y here if you want debug print routines to go to one of the
90 S3C2410 internal UARTs. The chosen UART must have been configured 90 S3C internal UARTs. The chosen UART must have been configured
91 before it is used. 91 before it is used.
92 92
93config DEBUG_S3C2410_UART 93config DEBUG_S3C_UART
94 depends on ARCH_S3C2410 94 depends on PLAT_S3C
95 int "S3C2410 UART to use for low-level debug" 95 int "S3C UART to use for low-level debug"
96 default "0" 96 default "0"
97 help 97 help
98 Choice for UART for kernel low-level using S3C2410 UARTS, 98 Choice for UART for kernel low-level using S3C UARTS,
99 should be between zero and two. The port must have been 99 should be between zero and two. The port must have been
100 initialised by the boot-loader before use. 100 initialised by the boot-loader before use.
101 101
102 The uncompressor code port configuration is now handled 102 The uncompressor code port configuration is now handled
103 by CONFIG_S3C2410_LOWLEVEL_UART_PORT. 103 by CONFIG_S3C_LOWLEVEL_UART_PORT.
104 104
105endmenu 105endmenu
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index cbd5010d3bc3..fa4ea9ff0797 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -137,6 +137,8 @@ endif
137 textofs-$(CONFIG_ARCH_NS9XXX) := 0x00108000 137 textofs-$(CONFIG_ARCH_NS9XXX) := 0x00108000
138 machine-$(CONFIG_ARCH_DAVINCI) := davinci 138 machine-$(CONFIG_ARCH_DAVINCI) := davinci
139 machine-$(CONFIG_ARCH_KS8695) := ks8695 139 machine-$(CONFIG_ARCH_KS8695) := ks8695
140 incdir-$(CONFIG_ARCH_MXC) := mxc
141 machine-$(CONFIG_ARCH_MX3) := mx3
140 142
141ifeq ($(CONFIG_ARCH_EBSA110),y) 143ifeq ($(CONFIG_ARCH_EBSA110),y)
142# This is what happens if you forget the IOCS16 line. 144# This is what happens if you forget the IOCS16 line.
@@ -183,6 +185,7 @@ core-$(CONFIG_VFP) += arch/arm/vfp/
183core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/ 185core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/
184core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/ 186core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/
185core-$(CONFIG_PLAT_S3C24XX) += arch/arm/plat-s3c24xx/ 187core-$(CONFIG_PLAT_S3C24XX) += arch/arm/plat-s3c24xx/
188core-$(CONFIG_ARCH_MXC) += arch/arm/plat-mxc/
186 189
187drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ 190drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
188drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/ 191drivers-$(CONFIG_ARCH_CLPS7500) += drivers/acorn/char/
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index ec9c400c7f82..25f12303b106 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -91,4 +91,12 @@ zinstall: $(obj)/zImage
91 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 91 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
92 $(obj)/zImage System.map "$(INSTALL_PATH)" 92 $(obj)/zImage System.map "$(INSTALL_PATH)"
93 93
94zi:
95 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
96 $(obj)/zImage System.map "$(INSTALL_PATH)"
97
98i:
99 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
100 $(obj)/Image System.map "$(INSTALL_PATH)"
101
94subdir- := bootp compressed 102subdir- := bootp compressed
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index a1f1691b67fe..6b8cbd69f249 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -73,7 +73,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
73 73
74targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ 74targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
75 head.o misc.o $(OBJS) 75 head.o misc.o $(OBJS)
76EXTRA_CFLAGS := -fpic 76EXTRA_CFLAGS := -fpic -fno-builtin
77EXTRA_AFLAGS := 77EXTRA_AFLAGS :=
78 78
79# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via 79# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index d7fb5ee1637e..b9b03eda70e5 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -55,7 +55,7 @@
55#elif defined(CONFIG_ARCH_S3C2410) 55#elif defined(CONFIG_ARCH_S3C2410)
56 .macro loadsp, rb 56 .macro loadsp, rb
57 mov \rb, #0x50000000 57 mov \rb, #0x50000000
58 add \rb, \rb, #0x4000 * CONFIG_S3C2410_LOWLEVEL_UART_PORT 58 add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
59 .endm 59 .endm
60#else 60#else
61 .macro loadsp, rb 61 .macro loadsp, rb
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 1d5150e4d6b3..f8a1645b3d4a 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -138,11 +138,11 @@ CONFIG_ARCH_S3C2410=y
138CONFIG_PLAT_S3C24XX=y 138CONFIG_PLAT_S3C24XX=y
139CONFIG_CPU_S3C244X=y 139CONFIG_CPU_S3C244X=y
140CONFIG_PM_SIMTEC=y 140CONFIG_PM_SIMTEC=y
141# CONFIG_S3C2410_BOOT_WATCHDOG is not set 141# CONFIG_S3C_BOOT_WATCHDOG is not set
142# CONFIG_S3C2410_BOOT_ERROR_RESET is not set 142# CONFIG_S3C_BOOT_ERROR_RESET is not set
143# CONFIG_S3C2410_PM_DEBUG is not set 143# CONFIG_S3C2410_PM_DEBUG is not set
144# CONFIG_S3C2410_PM_CHECK is not set 144# CONFIG_S3C2410_PM_CHECK is not set
145CONFIG_S3C2410_LOWLEVEL_UART_PORT=0 145CONFIG_S3C_LOWLEVEL_UART_PORT=0
146CONFIG_S3C2410_DMA=y 146CONFIG_S3C2410_DMA=y
147# CONFIG_S3C2410_DMA_DEBUG is not set 147# CONFIG_S3C2410_DMA_DEBUG is not set
148CONFIG_MACH_SMDK=y 148CONFIG_MACH_SMDK=y
@@ -1392,8 +1392,8 @@ CONFIG_DEBUG_USER=y
1392# CONFIG_DEBUG_ERRORS is not set 1392# CONFIG_DEBUG_ERRORS is not set
1393CONFIG_DEBUG_LL=y 1393CONFIG_DEBUG_LL=y
1394# CONFIG_DEBUG_ICEDCC is not set 1394# CONFIG_DEBUG_ICEDCC is not set
1395CONFIG_DEBUG_S3C2410_PORT=y 1395CONFIG_DEBUG_S3C_PORT=y
1396CONFIG_DEBUG_S3C2410_UART=0 1396CONFIG_DEBUG_S3C_UART=0
1397 1397
1398# 1398#
1399# Security options 1399# Security options
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 70599bcf451c..0417c165d50d 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -477,7 +477,7 @@ void __init at91_add_device_i2c(void) {}
477 * SPI 477 * SPI
478 * -------------------------------------------------------------------- */ 478 * -------------------------------------------------------------------- */
479 479
480#if defined(CONFIG_SPI_AT91) || defined(CONFIG_SPI_AT91_MODULE) || defined(CONFIG_AT91_SPI) || defined(CONFIG_AT91_SPI_MODULE) 480#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
481static u64 spi_dmamask = 0xffffffffUL; 481static u64 spi_dmamask = 0xffffffffUL;
482 482
483static struct resource spi_resources[] = { 483static struct resource spi_resources[] = {
@@ -494,7 +494,7 @@ static struct resource spi_resources[] = {
494}; 494};
495 495
496static struct platform_device at91rm9200_spi_device = { 496static struct platform_device at91rm9200_spi_device = {
497 .name = "at91_spi", 497 .name = "atmel_spi",
498 .id = 0, 498 .id = 0,
499 .dev = { 499 .dev = {
500 .dma_mask = &spi_dmamask, 500 .dma_mask = &spi_dmamask,
@@ -522,18 +522,14 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
522 else 522 else
523 cs_pin = spi_standard_cs[devices[i].chip_select]; 523 cs_pin = spi_standard_cs[devices[i].chip_select];
524 524
525#ifdef CONFIG_SPI_AT91_MANUAL_CS 525 /* enable chip-select pin */
526 at91_set_gpio_output(cs_pin, 1); 526 at91_set_gpio_output(cs_pin, 1);
527#else
528 at91_set_A_periph(cs_pin, 0);
529#endif
530 527
531 /* pass chip-select pin to driver */ 528 /* pass chip-select pin to driver */
532 devices[i].controller_data = (void *) cs_pin; 529 devices[i].controller_data = (void *) cs_pin;
533 } 530 }
534 531
535 spi_register_board_info(devices, nr_devices); 532 spi_register_board_info(devices, nr_devices);
536 at91_clock_associate("spi_clk", &at91rm9200_spi_device.dev, "spi");
537 platform_device_register(&at91rm9200_spi_device); 533 platform_device_register(&at91rm9200_spi_device);
538} 534}
539#else 535#else
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig
index 9bb02b6d7ae1..dbe07c9472ed 100644
--- a/arch/arm/mach-iop32x/Kconfig
+++ b/arch/arm/mach-iop32x/Kconfig
@@ -42,6 +42,13 @@ config IOP3XX_ATU
42 Say N if the IOP is an add in card, the host system owns the PCI 42 Say N if the IOP is an add in card, the host system owns the PCI
43 bus in this case. 43 bus in this case.
44 44
45config MACH_EM7210
46 bool "Enable support for the Lanner EM7210"
47 help
48 Say Y here if you want to run your kernel on the Lanner EM7210
49 board. Say also Y here if you have a SS4000e Baxter Creek NAS
50 appliance."
51
45endmenu 52endmenu
46 53
47endif 54endif
diff --git a/arch/arm/mach-iop32x/Makefile b/arch/arm/mach-iop32x/Makefile
index 7b05b37e1f94..cfdf8a137c2b 100644
--- a/arch/arm/mach-iop32x/Makefile
+++ b/arch/arm/mach-iop32x/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_MACH_GLANTANK) += glantank.o
11obj-$(CONFIG_ARCH_IQ80321) += iq80321.o 11obj-$(CONFIG_ARCH_IQ80321) += iq80321.o
12obj-$(CONFIG_ARCH_IQ31244) += iq31244.o 12obj-$(CONFIG_ARCH_IQ31244) += iq31244.o
13obj-$(CONFIG_MACH_N2100) += n2100.o 13obj-$(CONFIG_MACH_N2100) += n2100.o
14obj-$(CONFIG_MACH_EM7210) += em7210.o
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
new file mode 100644
index 000000000000..c947152f9a3c
--- /dev/null
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -0,0 +1,215 @@
1/*
2 * arch/arm/mach-iop32x/em7210.c
3 *
4 * Board support code for the Lanner EM7210 platforms.
5 *
6 * Based on arch/arm/mach-iop32x/iq31244.c file.
7 *
8 * Copyright (C) 2007 Arnaud Patard <arnaud.patard@rtp-net.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 */
15
16#include <linux/mm.h>
17#include <linux/init.h>
18#include <linux/kernel.h>
19#include <linux/pci.h>
20#include <linux/pm.h>
21#include <linux/serial_core.h>
22#include <linux/serial_8250.h>
23#include <linux/mtd/physmap.h>
24#include <linux/platform_device.h>
25#include <linux/i2c.h>
26#include <asm/hardware.h>
27#include <linux/io.h>
28#include <linux/irq.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31#include <asm/mach/pci.h>
32#include <asm/mach/time.h>
33#include <asm/mach-types.h>
34#include <asm/arch/time.h>
35
36static void __init em7210_timer_init(void)
37{
38 /* http://www.kwaak.net/fotos/fotos-nas/slide_24.html */
39 /* 33.333 MHz crystal. */
40 iop_init_time(200000000);
41}
42
43static struct sys_timer em7210_timer = {
44 .init = em7210_timer_init,
45 .offset = iop_gettimeoffset,
46};
47
48/*
49 * EM7210 RTC
50 */
51static struct i2c_board_info __initdata em7210_i2c_devices[] = {
52 {
53 I2C_BOARD_INFO("rtc-rs5c372", 0x32),
54 .type = "rs5c372a",
55 },
56};
57
58/*
59 * EM7210 I/O
60 */
61static struct map_desc em7210_io_desc[] __initdata = {
62 { /* on-board devices */
63 .virtual = IQ31244_UART,
64 .pfn = __phys_to_pfn(IQ31244_UART),
65 .length = 0x00100000,
66 .type = MT_DEVICE,
67 },
68};
69
70void __init em7210_map_io(void)
71{
72 iop3xx_map_io();
73 iotable_init(em7210_io_desc, ARRAY_SIZE(em7210_io_desc));
74}
75
76
77/*
78 * EM7210 PCI
79 */
80#define INTA IRQ_IOP32X_XINT0
81#define INTB IRQ_IOP32X_XINT1
82#define INTC IRQ_IOP32X_XINT2
83#define INTD IRQ_IOP32X_XINT3
84
85static int __init
86em7210_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
87{
88 static int pci_irq_table[][4] = {
89 /*
90 * PCI IDSEL/INTPIN->INTLINE
91 * A B C D
92 */
93 {INTB, INTB, INTB, INTB}, /* console / uart */
94 {INTA, INTA, INTA, INTA}, /* 1st 82541 */
95 {INTD, INTD, INTD, INTD}, /* 2nd 82541 */
96 {INTC, INTC, INTC, INTC}, /* GD31244 */
97 {INTD, INTA, INTA, INTA}, /* mini-PCI */
98 {INTD, INTC, INTA, INTA}, /* NEC USB */
99 };
100
101 if (pin < 1 || pin > 4)
102 return -1;
103
104 return pci_irq_table[slot % 6][pin - 1];
105}
106
107static struct hw_pci em7210_pci __initdata = {
108 .swizzle = pci_std_swizzle,
109 .nr_controllers = 1,
110 .setup = iop3xx_pci_setup,
111 .preinit = iop3xx_pci_preinit,
112 .scan = iop3xx_pci_scan_bus,
113 .map_irq = em7210_pci_map_irq,
114};
115
116static int __init em7210_pci_init(void)
117{
118 if (machine_is_em7210())
119 pci_common_init(&em7210_pci);
120
121 return 0;
122}
123
124subsys_initcall(em7210_pci_init);
125
126
127/*
128 * EM7210 Flash
129 */
130static struct physmap_flash_data em7210_flash_data = {
131 .width = 2,
132};
133
134static struct resource em7210_flash_resource = {
135 .start = 0xf0000000,
136 .end = 0xf1ffffff,
137 .flags = IORESOURCE_MEM,
138};
139
140static struct platform_device em7210_flash_device = {
141 .name = "physmap-flash",
142 .id = 0,
143 .dev = {
144 .platform_data = &em7210_flash_data,
145 },
146 .num_resources = 1,
147 .resource = &em7210_flash_resource,
148};
149
150
151/*
152 * EM7210 UART
153 * The physical address of the serial port is 0xfe800000,
154 * so it can be used for physical and virtual address.
155 */
156static struct plat_serial8250_port em7210_serial_port[] = {
157 {
158 .mapbase = IQ31244_UART,
159 .membase = (char *)IQ31244_UART,
160 .irq = IRQ_IOP32X_XINT1,
161 .flags = UPF_SKIP_TEST,
162 .iotype = UPIO_MEM,
163 .regshift = 0,
164 .uartclk = 1843200,
165 },
166 { },
167};
168
169static struct resource em7210_uart_resource = {
170 .start = IQ31244_UART,
171 .end = IQ31244_UART + 7,
172 .flags = IORESOURCE_MEM,
173};
174
175static struct platform_device em7210_serial_device = {
176 .name = "serial8250",
177 .id = PLAT8250_DEV_PLATFORM,
178 .dev = {
179 .platform_data = em7210_serial_port,
180 },
181 .num_resources = 1,
182 .resource = &em7210_uart_resource,
183};
184
185void em7210_power_off(void)
186{
187 *IOP3XX_GPOE &= 0xfe;
188 *IOP3XX_GPOD |= 0x01;
189}
190
191static void __init em7210_init_machine(void)
192{
193 platform_device_register(&em7210_serial_device);
194 platform_device_register(&iop3xx_i2c0_device);
195 platform_device_register(&iop3xx_i2c1_device);
196 platform_device_register(&em7210_flash_device);
197 platform_device_register(&iop3xx_dma_0_channel);
198 platform_device_register(&iop3xx_dma_1_channel);
199
200 i2c_register_board_info(0, em7210_i2c_devices,
201 ARRAY_SIZE(em7210_i2c_devices));
202
203
204 pm_power_off = em7210_power_off;
205}
206
207MACHINE_START(EM7210, "Lanner EM7210")
208 .phys_io = IQ31244_UART,
209 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
210 .boot_params = 0xa0000100,
211 .map_io = em7210_map_io,
212 .init_irq = iop32x_init_irq,
213 .timer = &em7210_timer,
214 .init_machine = em7210_init_machine,
215MACHINE_END
diff --git a/arch/arm/mach-iop32x/irq.c b/arch/arm/mach-iop32x/irq.c
index c971171c2905..55cf0162e8c1 100644
--- a/arch/arm/mach-iop32x/irq.c
+++ b/arch/arm/mach-iop32x/irq.c
@@ -63,7 +63,8 @@ void __init iop32x_init_irq(void)
63 if (machine_is_glantank() || 63 if (machine_is_glantank() ||
64 machine_is_iq80321() || 64 machine_is_iq80321() ||
65 machine_is_iq31244() || 65 machine_is_iq31244() ||
66 machine_is_n2100()) 66 machine_is_n2100() ||
67 machine_is_em7210())
67 *IOP3XX_PCIIRSR = 0x0f; 68 *IOP3XX_PCIIRSR = 0x0f;
68 69
69 for (i = 0; i < NR_IRQS; i++) { 70 for (i = 0; i < NR_IRQS; i++) {
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 8112f726ffa0..4c54a86eda3a 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -188,7 +188,7 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
188 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 188 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
189 189
190 /* Configure the line as an input */ 190 /* Configure the line as an input */
191 gpio_line_config(line, IXP4XX_GPIO_IN); 191 gpio_line_config(irq2gpio[irq], IXP4XX_GPIO_IN);
192 192
193 return 0; 193 return 0;
194} 194}
diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
index 2407bba00547..4c3ab43e1046 100644
--- a/arch/arm/mach-ks8695/irq.c
+++ b/arch/arm/mach-ks8695/irq.c
@@ -23,7 +23,6 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/ptrace.h>
27#include <linux/sysdev.h> 26#include <linux/sysdev.h>
28 27
29#include <asm/hardware.h> 28#include <asm/hardware.h>
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
new file mode 100644
index 000000000000..5fe8606cac08
--- /dev/null
+++ b/arch/arm/mach-mx3/Kconfig
@@ -0,0 +1,12 @@
1menu "MX3 Options"
2 depends on ARCH_MX3
3
4config MACH_MX31ADS
5 bool "Support MX31ADS platforms"
6 default y
7 help
8 Include support for MX31ADS platform. This includes specific
9 configurations for the board and its peripherals.
10
11endmenu
12
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
new file mode 100644
index 000000000000..cbec997f332a
--- /dev/null
+++ b/arch/arm/mach-mx3/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := mm.o time.o
8obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
diff --git a/arch/arm/mach-mx3/Makefile.boot b/arch/arm/mach-mx3/Makefile.boot
new file mode 100644
index 000000000000..e1dd366f836b
--- /dev/null
+++ b/arch/arm/mach-mx3/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x80008000
2params_phys-y := 0x80000100
3initrd_phys-y := 0x80800000
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
new file mode 100644
index 000000000000..41dad485ded9
--- /dev/null
+++ b/arch/arm/mach-mx3/mm.c
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 1999,2000 Arm Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
5 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6 * - add MX31 specific 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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#include <linux/mm.h>
24#include <linux/init.h>
25#include <asm/hardware.h>
26#include <asm/pgtable.h>
27#include <asm/mach/map.h>
28#include <asm/arch/common.h>
29
30/*!
31 * @file mm.c
32 *
33 * @brief This file creates static virtual to physical mappings, common to all MX3 boards.
34 *
35 * @ingroup Memory
36 */
37
38/*!
39 * This table defines static virtual address mappings for I/O regions.
40 * These are the mappings common across all MX3 boards.
41 */
42static struct map_desc mxc_io_desc[] __initdata = {
43 {
44 .virtual = X_MEMC_BASE_ADDR_VIRT,
45 .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR),
46 .length = X_MEMC_SIZE,
47 .type = MT_DEVICE
48 }, {
49 .virtual = AVIC_BASE_ADDR_VIRT,
50 .pfn = __phys_to_pfn(AVIC_BASE_ADDR),
51 .length = AVIC_SIZE,
52 .type = MT_NONSHARED_DEVICE
53 },
54};
55
56/*!
57 * This function initializes the memory map. It is called during the
58 * system startup to create static physical to virtual memory mappings
59 * for the IO modules.
60 */
61void __init mxc_map_io(void)
62{
63 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
64}
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
new file mode 100644
index 000000000000..7e89bdc23a9f
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31ads.c
@@ -0,0 +1,142 @@
1/*
2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/clk.h>
24#include <linux/serial_8250.h>
25
26#include <asm/hardware.h>
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/memory.h>
30#include <asm/mach/map.h>
31#include <asm/arch/common.h>
32
33/*!
34 * @file mx31ads.c
35 *
36 * @brief This file contains the board-specific initialization routines.
37 *
38 * @ingroup System
39 */
40
41#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
42/*!
43 * The serial port definition structure.
44 */
45static struct plat_serial8250_port serial_platform_data[] = {
46 {
47 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTA),
48 .mapbase = (unsigned long)(CS4_BASE_ADDR + PBC_SC16C652_UARTA),
49 .irq = EXPIO_INT_XUART_INTA,
50 .uartclk = 14745600,
51 .regshift = 0,
52 .iotype = UPIO_MEM,
53 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ,
54 }, {
55 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTB),
56 .mapbase = (unsigned long)(CS4_BASE_ADDR + PBC_SC16C652_UARTB),
57 .irq = EXPIO_INT_XUART_INTB,
58 .uartclk = 14745600,
59 .regshift = 0,
60 .iotype = UPIO_MEM,
61 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ,
62 },
63 {},
64};
65
66static struct platform_device serial_device = {
67 .name = "serial8250",
68 .id = 0,
69 .dev = {
70 .platform_data = serial_platform_data,
71 },
72};
73
74static int __init mxc_init_extuart(void)
75{
76 return platform_device_register(&serial_device);
77}
78#else
79static inline int mxc_init_extuart(void)
80{
81 return 0;
82}
83#endif
84
85/*!
86 * This structure defines static mappings for the i.MX31ADS board.
87 */
88static struct map_desc mx31ads_io_desc[] __initdata = {
89 {
90 .virtual = AIPS1_BASE_ADDR_VIRT,
91 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
92 .length = AIPS1_SIZE,
93 .type = MT_NONSHARED_DEVICE
94 }, {
95 .virtual = SPBA0_BASE_ADDR_VIRT,
96 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
97 .length = SPBA0_SIZE,
98 .type = MT_NONSHARED_DEVICE
99 }, {
100 .virtual = AIPS2_BASE_ADDR_VIRT,
101 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
102 .length = AIPS2_SIZE,
103 .type = MT_NONSHARED_DEVICE
104 }, {
105 .virtual = CS4_BASE_ADDR_VIRT,
106 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
107 .length = CS4_SIZE / 2,
108 .type = MT_DEVICE
109 },
110};
111
112/*!
113 * Set up static virtual mappings.
114 */
115void __init mx31ads_map_io(void)
116{
117 mxc_map_io();
118 iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
119}
120
121/*!
122 * Board specific initialization.
123 */
124static void __init mxc_board_init(void)
125{
126 mxc_init_extuart();
127}
128
129/*
130 * The following uses standard kernel macros defined in arch.h in order to
131 * initialize __mach_desc_MX31ADS data structure.
132 */
133MACHINE_START(MX31ADS, "Freescale MX31ADS")
134 /* Maintainer: Freescale Semiconductor, Inc. */
135 .phys_io = AIPS1_BASE_ADDR,
136 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
137 .boot_params = PHYS_OFFSET + 0x100,
138 .map_io = mx31ads_map_io,
139 .init_irq = mxc_init_irq,
140 .init_machine = mxc_board_init,
141 .timer = &mxc_timer,
142MACHINE_END
diff --git a/arch/arm/mach-mx3/time.c b/arch/arm/mach-mx3/time.c
new file mode 100644
index 000000000000..e81fb5c5d7c3
--- /dev/null
+++ b/arch/arm/mach-mx3/time.c
@@ -0,0 +1,152 @@
1/*
2 * System Timer Interrupt reconfigured to run in free-run mode.
3 * Author: Vitaly Wool
4 * Copyright 2004 MontaVista Software Inc.
5 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14/*!
15 * @file time.c
16 * @brief This file contains OS tick and wdog timer implementations.
17 *
18 * This file contains OS tick and wdog timer implementations.
19 *
20 * @ingroup Timers
21 */
22
23#include <linux/module.h>
24#include <linux/init.h>
25#include <linux/interrupt.h>
26#include <linux/irq.h>
27#include <asm/hardware.h>
28#include <asm/mach/time.h>
29#include <asm/io.h>
30#include <asm/arch/common.h>
31
32/*!
33 * This is the timer interrupt service routine to do required tasks.
34 * It also services the WDOG timer at the frequency of twice per WDOG
35 * timeout value. For example, if the WDOG's timeout value is 4 (2
36 * seconds since the WDOG runs at 0.5Hz), it will be serviced once
37 * every 2/2=1 second.
38 *
39 * @param irq GPT interrupt source number (not used)
40 * @param dev_id this parameter is not used
41 * @return always returns \b IRQ_HANDLED as defined in
42 * include/linux/interrupt.h.
43 */
44static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
45{
46 unsigned int next_match;
47
48 write_seqlock(&xtime_lock);
49
50 if (__raw_readl(MXC_GPT_GPTSR) & GPTSR_OF1) {
51 do {
52 timer_tick();
53 next_match = __raw_readl(MXC_GPT_GPTOCR1) + LATCH;
54 __raw_writel(GPTSR_OF1, MXC_GPT_GPTSR);
55 __raw_writel(next_match, MXC_GPT_GPTOCR1);
56 } while ((signed long)(next_match -
57 __raw_readl(MXC_GPT_GPTCNT)) <= 0);
58 }
59
60 write_sequnlock(&xtime_lock);
61
62 return IRQ_HANDLED;
63}
64
65/*!
66 * This function is used to obtain the number of microseconds since the last
67 * timer interrupt. Note that interrupts is disabled by do_gettimeofday().
68 *
69 * @return the number of microseconds since the last timer interrupt.
70 */
71static unsigned long mxc_gettimeoffset(void)
72{
73 unsigned long ticks_to_match, elapsed, usec, tick_usec, i;
74
75 /* Get ticks before next timer match */
76 ticks_to_match =
77 __raw_readl(MXC_GPT_GPTOCR1) - __raw_readl(MXC_GPT_GPTCNT);
78
79 /* We need elapsed ticks since last match */
80 elapsed = LATCH - ticks_to_match;
81
82 /* Now convert them to usec */
83 /* Insure no overflow when calculating the usec below */
84 for (i = 1, tick_usec = tick_nsec / 1000;; i *= 2) {
85 tick_usec /= i;
86 if ((0xFFFFFFFF / tick_usec) > elapsed)
87 break;
88 }
89 usec = (unsigned long)(elapsed * tick_usec) / (LATCH / i);
90
91 return usec;
92}
93
94/*!
95 * The OS tick timer interrupt structure.
96 */
97static struct irqaction timer_irq = {
98 .name = "MXC Timer Tick",
99 .flags = IRQF_DISABLED | IRQF_TIMER,
100 .handler = mxc_timer_interrupt
101};
102
103/*!
104 * This function is used to initialize the GPT to produce an interrupt
105 * based on HZ. It is called by start_kernel() during system startup.
106 */
107void __init mxc_init_time(void)
108{
109 u32 reg, v;
110 reg = __raw_readl(MXC_GPT_GPTCR);
111 reg &= ~GPTCR_ENABLE;
112 __raw_writel(reg, MXC_GPT_GPTCR);
113 reg |= GPTCR_SWR;
114 __raw_writel(reg, MXC_GPT_GPTCR);
115
116 while ((__raw_readl(MXC_GPT_GPTCR) & GPTCR_SWR) != 0)
117 cpu_relax();
118
119 reg = GPTCR_FRR | GPTCR_CLKSRC_HIGHFREQ;
120 __raw_writel(reg, MXC_GPT_GPTCR);
121
122 /* TODO: get timer rate from clk driver */
123 v = 66500000;
124
125 __raw_writel((v / CLOCK_TICK_RATE) - 1, MXC_GPT_GPTPR);
126
127 if ((v % CLOCK_TICK_RATE) != 0) {
128 pr_info("\nWARNING: Can't generate CLOCK_TICK_RATE at %d Hz\n",
129 CLOCK_TICK_RATE);
130 }
131 pr_info("Actual CLOCK_TICK_RATE is %d Hz\n",
132 v / ((__raw_readl(MXC_GPT_GPTPR) & 0xFFF) + 1));
133
134 reg = __raw_readl(MXC_GPT_GPTCNT);
135 reg += LATCH;
136 __raw_writel(reg, MXC_GPT_GPTOCR1);
137
138 setup_irq(MXC_INT_GPT, &timer_irq);
139
140 reg = __raw_readl(MXC_GPT_GPTCR);
141 reg =
142 GPTCR_FRR | GPTCR_CLKSRC_HIGHFREQ | GPTCR_STOPEN | GPTCR_DOZEN |
143 GPTCR_WAITEN | GPTCR_ENMOD | GPTCR_ENABLE;
144 __raw_writel(reg, MXC_GPT_GPTCR);
145
146 __raw_writel(GPTIR_OF1IE, MXC_GPT_GPTIR);
147}
148
149struct sys_timer mxc_timer = {
150 .init = mxc_init_time,
151 .offset = mxc_gettimeoffset,
152};
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
index 53213a69f601..4476411b8140 100644
--- a/arch/arm/mach-ns9xxx/Makefile
+++ b/arch/arm/mach-ns9xxx/Makefile
@@ -1,6 +1,7 @@
1obj-y := irq.o time.o generic.o 1obj-y := irq.o time.o generic.o
2 2
3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o 3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
4obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o
4 5
5obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o 6obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
6obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o 7obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.c b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
index 25289884a607..925048e7adfe 100644
--- a/arch/arm/mach-ns9xxx/board-a9m9750dev.c
+++ b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
@@ -77,7 +77,7 @@ static void a9m9750dev_fpga_demux_handler(unsigned int irq,
77 77
78 desc = irq_desc + FPGA_IRQ(irqno); 78 desc = irq_desc + FPGA_IRQ(irqno);
79 79
80 desc_handle_irq(irqno, desc); 80 desc_handle_irq(FPGA_IRQ(irqno), desc);
81 } 81 }
82} 82}
83 83
@@ -91,7 +91,7 @@ void __init board_a9m9750dev_init_irq(void)
91 * use GPIO 11, because GPIO 32 is used for the LCD 91 * use GPIO 11, because GPIO 32 is used for the LCD
92 */ 92 */
93 /* XXX: proper GPIO handling */ 93 /* XXX: proper GPIO handling */
94 BBU_GC(2) &= ~0x2000; 94 BBU_GCONFb1(1) &= ~0x2000;
95 95
96 for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) { 96 for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) {
97 set_irq_chip(i, &a9m9750dev_fpga_chip); 97 set_irq_chip(i, &a9m9750dev_fpga_chip);
@@ -178,7 +178,7 @@ void __init board_a9m9750dev_init_machine(void)
178 178
179 /* setup static CS0: memory configuration */ 179 /* setup static CS0: memory configuration */
180 reg = MEM_SMC(0); 180 reg = MEM_SMC(0);
181 REGSET(reg, MEM_SMC, WSMC, OFF); 181 REGSET(reg, MEM_SMC, PSMC, OFF);
182 REGSET(reg, MEM_SMC, BSMC, OFF); 182 REGSET(reg, MEM_SMC, BSMC, OFF);
183 REGSET(reg, MEM_SMC, EW, OFF); 183 REGSET(reg, MEM_SMC, EW, OFF);
184 REGSET(reg, MEM_SMC, PB, 1); 184 REGSET(reg, MEM_SMC, PB, 1);
@@ -196,4 +196,3 @@ void __init board_a9m9750dev_init_machine(void)
196 platform_add_devices(board_a9m9750dev_devices, 196 platform_add_devices(board_a9m9750dev_devices,
197 ARRAY_SIZE(board_a9m9750dev_devices)); 197 ARRAY_SIZE(board_a9m9750dev_devices));
198} 198}
199
diff --git a/arch/arm/mach-ns9xxx/generic.c b/arch/arm/mach-ns9xxx/generic.c
index 83e2b6532b22..d742c921e34d 100644
--- a/arch/arm/mach-ns9xxx/generic.c
+++ b/arch/arm/mach-ns9xxx/generic.c
@@ -18,6 +18,8 @@
18#include <asm/arch-ns9xxx/regs-mem.h> 18#include <asm/arch-ns9xxx/regs-mem.h>
19#include <asm/arch-ns9xxx/board.h> 19#include <asm/arch-ns9xxx/board.h>
20 20
21#include "generic.h"
22
21static struct map_desc standard_io_desc[] __initdata = { 23static struct map_desc standard_io_desc[] __initdata = {
22 { /* BBus */ 24 { /* BBus */
23 .virtual = io_p2v(0x90000000), 25 .virtual = io_p2v(0x90000000),
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
index 83d92724a971..b8c7b00522e6 100644
--- a/arch/arm/mach-ns9xxx/irq.c
+++ b/arch/arm/mach-ns9xxx/irq.c
@@ -21,6 +21,15 @@ static void ns9xxx_ack_irq_timer(unsigned int irq)
21{ 21{
22 u32 tc = SYS_TC(irq - IRQ_TIMER0); 22 u32 tc = SYS_TC(irq - IRQ_TIMER0);
23 23
24 /*
25 * If the timer is programmed to halt on terminal count, the
26 * timer must be disabled before clearing the interrupt.
27 */
28 if (REGGET(tc, SYS_TCx, REN) == 0) {
29 REGSET(tc, SYS_TCx, TEN, DIS);
30 SYS_TC(irq - IRQ_TIMER0) = tc;
31 }
32
24 REGSET(tc, SYS_TCx, INTC, SET); 33 REGSET(tc, SYS_TCx, INTC, SET);
25 SYS_TC(irq - IRQ_TIMER0) = tc; 34 SYS_TC(irq - IRQ_TIMER0) = tc;
26 35
@@ -28,7 +37,7 @@ static void ns9xxx_ack_irq_timer(unsigned int irq)
28 SYS_TC(irq - IRQ_TIMER0) = tc; 37 SYS_TC(irq - IRQ_TIMER0) = tc;
29} 38}
30 39
31void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = { 40static void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = {
32 [IRQ_TIMER0] = ns9xxx_ack_irq_timer, 41 [IRQ_TIMER0] = ns9xxx_ack_irq_timer,
33 [IRQ_TIMER1] = ns9xxx_ack_irq_timer, 42 [IRQ_TIMER1] = ns9xxx_ack_irq_timer,
34 [IRQ_TIMER2] = ns9xxx_ack_irq_timer, 43 [IRQ_TIMER2] = ns9xxx_ack_irq_timer,
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
index d09d5fa5620a..85c8b41105c9 100644
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
@@ -20,7 +20,7 @@ static void __init mach_cc9p9360js_init_machine(void)
20 board_jscc9p9360_init_machine(); 20 board_jscc9p9360_init_machine();
21} 21}
22 22
23MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard") 23MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard")
24 .map_io = ns9xxx_map_io, 24 .map_io = ns9xxx_map_io,
25 .init_irq = ns9xxx_init_irq, 25 .init_irq = ns9xxx_init_irq,
26 .init_machine = mach_cc9p9360js_init_machine, 26 .init_machine = mach_cc9p9360js_init_machine,
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 570cf937e73b..a454451c97c3 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -87,7 +87,7 @@ static void __init rpc_map_io(void)
87 /* 87 /*
88 * Turn off floppy. 88 * Turn off floppy.
89 */ 89 */
90 outb(0xc, 0x3f2); 90 writeb(0xc, PCIO_BASE + (0x3f2 << 2));
91 91
92 /* 92 /*
93 * RiscPC can't handle half-word loads and stores 93 * RiscPC can't handle half-word loads and stores
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index d4b013b283c3..e2079cf9266f 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -9,6 +9,7 @@ config CPU_S3C2410
9 depends on ARCH_S3C2410 9 depends on ARCH_S3C2410
10 select S3C2410_CLOCK 10 select S3C2410_CLOCK
11 select S3C2410_GPIO 11 select S3C2410_GPIO
12 select CPU_LLSERIAL_S3C2410
12 select S3C2410_PM if PM 13 select S3C2410_PM if PM
13 help 14 help
14 Support for S3C2410 and S3C2410A family from the S3C24XX line 15 Support for S3C2410 and S3C2410A family from the S3C24XX line
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index 5b4831c4c1d8..cab9d6265e9e 100644
--- a/arch/arm/mach-s3c2410/clock.c
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -37,7 +37,7 @@
37#include <asm/hardware.h> 37#include <asm/hardware.h>
38#include <asm/io.h> 38#include <asm/io.h>
39 39
40#include <asm/arch/regs-serial.h> 40#include <asm/plat-s3c/regs-serial.h>
41#include <asm/arch/regs-clock.h> 41#include <asm/arch/regs-clock.h>
42#include <asm/arch/regs-gpio.h> 42#include <asm/arch/regs-gpio.h>
43 43
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index 67d1ad363973..80d83739ab9f 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -23,14 +23,14 @@
23#include <asm/plat-s3c24xx/cpu.h> 23#include <asm/plat-s3c24xx/cpu.h>
24#include <asm/plat-s3c24xx/dma.h> 24#include <asm/plat-s3c24xx/dma.h>
25 25
26#include <asm/arch/regs-serial.h> 26#include <asm/plat-s3c/regs-serial.h>
27#include <asm/arch/regs-gpio.h> 27#include <asm/arch/regs-gpio.h>
28#include <asm/arch/regs-ac97.h> 28#include <asm/plat-s3c/regs-ac97.h>
29#include <asm/arch/regs-mem.h> 29#include <asm/arch/regs-mem.h>
30#include <asm/arch/regs-lcd.h> 30#include <asm/arch/regs-lcd.h>
31#include <asm/arch/regs-sdi.h> 31#include <asm/arch/regs-sdi.h>
32#include <asm/arch/regs-iis.h> 32#include <asm/plat-s3c24xx/regs-iis.h>
33#include <asm/arch/regs-spi.h> 33#include <asm/plat-s3c24xx/regs-spi.h>
34 34
35static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = { 35static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = {
36 [DMACH_XD0] = { 36 [DMACH_XD0] = {
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 435adcce6482..43bb5e106302 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -48,7 +48,7 @@
48#include <asm/mach-types.h> 48#include <asm/mach-types.h>
49#include <asm/arch/fb.h> 49#include <asm/arch/fb.h>
50 50
51#include <asm/arch/regs-serial.h> 51#include <asm/plat-s3c/regs-serial.h>
52#include <asm/arch/regs-lcd.h> 52#include <asm/arch/regs-lcd.h>
53#include <asm/arch/regs-gpio.h> 53#include <asm/arch/regs-gpio.h>
54 54
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 8b52ea95d4f6..bc926992b4e4 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -36,13 +36,13 @@
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37 37
38//#include <asm/debug-ll.h> 38//#include <asm/debug-ll.h>
39#include <asm/arch/regs-serial.h> 39#include <asm/plat-s3c/regs-serial.h>
40#include <asm/arch/regs-gpio.h> 40#include <asm/arch/regs-gpio.h>
41#include <asm/arch/regs-mem.h> 41#include <asm/arch/regs-mem.h>
42#include <asm/arch/regs-lcd.h> 42#include <asm/arch/regs-lcd.h>
43 43
44#include <asm/arch/nand.h> 44#include <asm/plat-s3c/nand.h>
45#include <asm/arch/iic.h> 45#include <asm/plat-s3c/iic.h>
46#include <asm/arch/fb.h> 46#include <asm/arch/fb.h>
47 47
48#include <linux/mtd/mtd.h> 48#include <linux/mtd/mtd.h>
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 5c9bcea74767..9a172b4ad720 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -30,7 +30,7 @@
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32 32
33#include <asm/arch/regs-serial.h> 33#include <asm/plat-s3c/regs-serial.h>
34#include <asm/arch/regs-lcd.h> 34#include <asm/arch/regs-lcd.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-clock.h> 36#include <asm/arch/regs-clock.h>
@@ -38,7 +38,7 @@
38#include <asm/arch/h1940.h> 38#include <asm/arch/h1940.h>
39#include <asm/arch/h1940-latch.h> 39#include <asm/arch/h1940-latch.h>
40#include <asm/arch/fb.h> 40#include <asm/arch/fb.h>
41#include <asm/arch/udc.h> 41#include <asm/plat-s3c24xx/udc.h>
42 42
43#include <asm/plat-s3c24xx/clock.h> 43#include <asm/plat-s3c24xx/clock.h>
44#include <asm/plat-s3c24xx/devs.h> 44#include <asm/plat-s3c24xx/devs.h>
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 412e50c3d28a..621f548da610 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -33,9 +33,9 @@
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35 35
36#include <asm/arch/regs-serial.h> 36#include <asm/plat-s3c/regs-serial.h>
37#include <asm/arch/regs-gpio.h> 37#include <asm/arch/regs-gpio.h>
38#include <asm/arch/iic.h> 38#include <asm/plat-s3c/iic.h>
39 39
40#include <asm/plat-s3c24xx/s3c2410.h> 40#include <asm/plat-s3c24xx/s3c2410.h>
41#include <asm/plat-s3c24xx/clock.h> 41#include <asm/plat-s3c24xx/clock.h>
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index 1f899fa588df..717af40e4477 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -29,7 +29,7 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31 31
32#include <asm/arch/regs-serial.h> 32#include <asm/plat-s3c/regs-serial.h>
33#include <asm/arch/regs-gpio.h> 33#include <asm/arch/regs-gpio.h>
34 34
35#include <asm/plat-s3c24xx/s3c2410.h> 35#include <asm/plat-s3c24xx/s3c2410.h>
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index d86e6f18bac9..e670b1e1631b 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -49,10 +49,10 @@
49 49
50#include <asm/arch/regs-gpio.h> 50#include <asm/arch/regs-gpio.h>
51#include <asm/arch/leds-gpio.h> 51#include <asm/arch/leds-gpio.h>
52#include <asm/arch/regs-serial.h> 52#include <asm/plat-s3c/regs-serial.h>
53#include <asm/arch/fb.h> 53#include <asm/arch/fb.h>
54#include <asm/arch/nand.h> 54#include <asm/plat-s3c/nand.h>
55#include <asm/arch/udc.h> 55#include <asm/plat-s3c24xx/udc.h>
56#include <asm/arch/spi.h> 56#include <asm/arch/spi.h>
57#include <asm/arch/spi-gpio.h> 57#include <asm/arch/spi-gpio.h>
58 58
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 5852d300d52f..226550504c85 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -47,7 +47,7 @@
47#include <asm/irq.h> 47#include <asm/irq.h>
48#include <asm/mach-types.h> 48#include <asm/mach-types.h>
49 49
50#include <asm/arch/regs-serial.h> 50#include <asm/plat-s3c/regs-serial.h>
51 51
52#include <asm/plat-s3c24xx/devs.h> 52#include <asm/plat-s3c24xx/devs.h>
53#include <asm/plat-s3c24xx/cpu.h> 53#include <asm/plat-s3c24xx/cpu.h>
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 7b624bb00490..9f43f3f124f5 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -39,7 +39,7 @@
39#include <asm/irq.h> 39#include <asm/irq.h>
40#include <asm/mach-types.h> 40#include <asm/mach-types.h>
41 41
42#include <asm/arch/regs-serial.h> 42#include <asm/plat-s3c/regs-serial.h>
43#include <asm/arch/regs-gpio.h> 43#include <asm/arch/regs-gpio.h>
44#include <asm/arch/leds-gpio.h> 44#include <asm/arch/leds-gpio.h>
45 45
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index 1a86a9803753..e580303cb0ab 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -29,7 +29,7 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30 30
31#include <asm/arch/regs-clock.h> 31#include <asm/arch/regs-clock.h>
32#include <asm/arch/regs-serial.h> 32#include <asm/plat-s3c/regs-serial.h>
33 33
34#include <asm/plat-s3c24xx/s3c2410.h> 34#include <asm/plat-s3c24xx/s3c2410.h>
35#include <asm/plat-s3c24xx/cpu.h> 35#include <asm/plat-s3c24xx/cpu.h>
@@ -40,7 +40,6 @@
40 40
41static struct map_desc s3c2410_iodesc[] __initdata = { 41static struct map_desc s3c2410_iodesc[] __initdata = {
42 IODESC_ENT(CLKPWR), 42 IODESC_ENT(CLKPWR),
43 IODESC_ENT(LCD),
44 IODESC_ENT(TIMER), 43 IODESC_ENT(TIMER),
45 IODESC_ENT(WATCHDOG), 44 IODESC_ENT(WATCHDOG),
46}; 45};
diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S
index d1eeed2ad47c..8a9c5a2bb252 100644
--- a/arch/arm/mach-s3c2410/sleep.S
+++ b/arch/arm/mach-s3c2410/sleep.S
@@ -32,7 +32,7 @@
32#include <asm/arch/regs-gpio.h> 32#include <asm/arch/regs-gpio.h>
33#include <asm/arch/regs-clock.h> 33#include <asm/arch/regs-clock.h>
34#include <asm/arch/regs-mem.h> 34#include <asm/arch/regs-mem.h>
35#include <asm/arch/regs-serial.h> 35#include <asm/plat-s3c/regs-serial.h>
36 36
37 /* s3c2410_cpu_suspend 37 /* s3c2410_cpu_suspend
38 * 38 *
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index d5be5d053264..8e8fe48ea47f 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -7,6 +7,7 @@
7config CPU_S3C2412 7config CPU_S3C2412
8 bool 8 bool
9 depends on ARCH_S3C2410 9 depends on ARCH_S3C2410
10 select CPU_LLSERIAL_S3C2440
10 select S3C2412_PM if PM 11 select S3C2412_PM if PM
11 select S3C2412_DMA if S3C2410_DMA 12 select S3C2412_DMA if S3C2410_DMA
12 help 13 help
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
index 6a8e4448770b..8543dd6df391 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c2412/clock.c
@@ -37,7 +37,7 @@
37#include <asm/hardware.h> 37#include <asm/hardware.h>
38#include <asm/io.h> 38#include <asm/io.h>
39 39
40#include <asm/arch/regs-serial.h> 40#include <asm/plat-s3c/regs-serial.h>
41#include <asm/arch/regs-clock.h> 41#include <asm/arch/regs-clock.h>
42#include <asm/arch/regs-gpio.h> 42#include <asm/arch/regs-gpio.h>
43 43
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index 668cccefe7b0..4b9425c1bf72 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -24,14 +24,14 @@
24#include <asm/plat-s3c24xx/dma.h> 24#include <asm/plat-s3c24xx/dma.h>
25#include <asm/plat-s3c24xx/cpu.h> 25#include <asm/plat-s3c24xx/cpu.h>
26 26
27#include <asm/arch/regs-serial.h> 27#include <asm/plat-s3c/regs-serial.h>
28#include <asm/arch/regs-gpio.h> 28#include <asm/arch/regs-gpio.h>
29#include <asm/arch/regs-ac97.h> 29#include <asm/plat-s3c/regs-ac97.h>
30#include <asm/arch/regs-mem.h> 30#include <asm/arch/regs-mem.h>
31#include <asm/arch/regs-lcd.h> 31#include <asm/arch/regs-lcd.h>
32#include <asm/arch/regs-sdi.h> 32#include <asm/arch/regs-sdi.h>
33#include <asm/arch/regs-iis.h> 33#include <asm/plat-s3c24xx/regs-iis.h>
34#include <asm/arch/regs-spi.h> 34#include <asm/plat-s3c24xx/regs-spi.h>
35 35
36#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID } 36#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID }
37 37
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index 063af09f899d..b126a530daa6 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -32,12 +32,12 @@
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34//#include <asm/debug-ll.h> 34//#include <asm/debug-ll.h>
35#include <asm/arch/regs-serial.h> 35#include <asm/plat-s3c/regs-serial.h>
36#include <asm/arch/regs-gpio.h> 36#include <asm/arch/regs-gpio.h>
37#include <asm/arch/regs-lcd.h> 37#include <asm/arch/regs-lcd.h>
38 38
39#include <asm/arch/idle.h> 39#include <asm/arch/idle.h>
40#include <asm/arch/udc.h> 40#include <asm/plat-s3c24xx/udc.h>
41#include <asm/arch/fb.h> 41#include <asm/arch/fb.h>
42 42
43#include <asm/plat-s3c24xx/s3c2410.h> 43#include <asm/plat-s3c24xx/s3c2410.h>
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index f2fbd65956ac..32982547cd63 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -33,14 +33,14 @@
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <asm/mach-types.h> 34#include <asm/mach-types.h>
35 35
36#include <asm/arch/regs-serial.h> 36#include <asm/plat-s3c/regs-serial.h>
37#include <asm/arch/regs-gpio.h> 37#include <asm/arch/regs-gpio.h>
38#include <asm/arch/regs-lcd.h> 38#include <asm/arch/regs-lcd.h>
39 39
40#include <asm/arch/idle.h> 40#include <asm/arch/idle.h>
41#include <asm/arch/fb.h> 41#include <asm/arch/fb.h>
42 42
43#include <asm/arch/nand.h> 43#include <asm/plat-s3c/nand.h>
44 44
45#include <asm/plat-s3c24xx/s3c2410.h> 45#include <asm/plat-s3c24xx/s3c2410.h>
46#include <asm/plat-s3c24xx/s3c2412.h> 46#include <asm/plat-s3c24xx/s3c2412.h>
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 782b5814ced2..e0ccb404623f 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -34,12 +34,12 @@
34#include <asm/arch/idle.h> 34#include <asm/arch/idle.h>
35 35
36#include <asm/arch/regs-clock.h> 36#include <asm/arch/regs-clock.h>
37#include <asm/arch/regs-serial.h> 37#include <asm/plat-s3c/regs-serial.h>
38#include <asm/arch/regs-power.h> 38#include <asm/arch/regs-power.h>
39#include <asm/arch/regs-gpio.h> 39#include <asm/arch/regs-gpio.h>
40#include <asm/arch/regs-gpioj.h> 40#include <asm/arch/regs-gpioj.h>
41#include <asm/arch/regs-dsc.h> 41#include <asm/arch/regs-dsc.h>
42#include <asm/arch/regs-spi.h> 42#include <asm/plat-s3c24xx/regs-spi.h>
43#include <asm/arch/regs-s3c2412.h> 43#include <asm/arch/regs-s3c2412.h>
44 44
45#include <asm/plat-s3c24xx/s3c2412.h> 45#include <asm/plat-s3c24xx/s3c2412.h>
@@ -63,7 +63,6 @@ static inline void s3c2412_init_gpio2(void)
63 63
64static struct map_desc s3c2412_iodesc[] __initdata = { 64static struct map_desc s3c2412_iodesc[] __initdata = {
65 IODESC_ENT(CLKPWR), 65 IODESC_ENT(CLKPWR),
66 IODESC_ENT(LCD),
67 IODESC_ENT(TIMER), 66 IODESC_ENT(TIMER),
68 IODESC_ENT(WATCHDOG), 67 IODESC_ENT(WATCHDOG),
69}; 68};
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index e3bfda098c0f..f1915bd61d15 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -12,6 +12,7 @@ config CPU_S3C2440
12 select S3C2410_GPIO 12 select S3C2410_GPIO
13 select S3C2440_DMA if S3C2410_DMA 13 select S3C2440_DMA if S3C2410_DMA
14 select CPU_S3C244X 14 select CPU_S3C244X
15 select CPU_LLSERIAL_S3C2440
15 help 16 help
16 Support for S3C2440 Samsung Mobile CPU based systems. 17 Support for S3C2440 Samsung Mobile CPU based systems.
17 18
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index cd035a3ec878..f509f062e749 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -23,14 +23,14 @@
23#include <asm/plat-s3c24xx/dma.h> 23#include <asm/plat-s3c24xx/dma.h>
24#include <asm/plat-s3c24xx/cpu.h> 24#include <asm/plat-s3c24xx/cpu.h>
25 25
26#include <asm/arch/regs-serial.h> 26#include <asm/plat-s3c/regs-serial.h>
27#include <asm/arch/regs-gpio.h> 27#include <asm/arch/regs-gpio.h>
28#include <asm/arch/regs-ac97.h> 28#include <asm/plat-s3c/regs-ac97.h>
29#include <asm/arch/regs-mem.h> 29#include <asm/arch/regs-mem.h>
30#include <asm/arch/regs-lcd.h> 30#include <asm/arch/regs-lcd.h>
31#include <asm/arch/regs-sdi.h> 31#include <asm/arch/regs-sdi.h>
32#include <asm/arch/regs-iis.h> 32#include <asm/plat-s3c24xx/regs-iis.h>
33#include <asm/arch/regs-spi.h> 33#include <asm/plat-s3c24xx/regs-spi.h>
34 34
35static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = { 35static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = {
36 [DMACH_XD0] = { 36 [DMACH_XD0] = {
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 29c163d300d4..3d3dfa95db8e 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -34,11 +34,11 @@
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36 36
37#include <asm/arch/regs-serial.h> 37#include <asm/plat-s3c/regs-serial.h>
38#include <asm/arch/regs-gpio.h> 38#include <asm/arch/regs-gpio.h>
39#include <asm/arch/regs-mem.h> 39#include <asm/arch/regs-mem.h>
40#include <asm/arch/regs-lcd.h> 40#include <asm/arch/regs-lcd.h>
41#include <asm/arch/nand.h> 41#include <asm/plat-s3c/nand.h>
42 42
43#include <linux/mtd/mtd.h> 43#include <linux/mtd/mtd.h>
44#include <linux/mtd/nand.h> 44#include <linux/mtd/nand.h>
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index 5e61f2166c76..afe0d7b7e389 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -36,7 +36,7 @@
36 36
37//#include <asm/debug-ll.h> 37//#include <asm/debug-ll.h>
38#include <asm/arch/regs-gpio.h> 38#include <asm/arch/regs-gpio.h>
39#include <asm/arch/regs-serial.h> 39#include <asm/plat-s3c/regs-serial.h>
40 40
41#include <asm/plat-s3c24xx/s3c2410.h> 41#include <asm/plat-s3c24xx/s3c2410.h>
42#include <asm/plat-s3c24xx/s3c2440.h> 42#include <asm/plat-s3c24xx/s3c2440.h>
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 89f4c9c5777b..0ba7e9060c7b 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -31,11 +31,11 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34#include <asm/arch/regs-serial.h> 34#include <asm/plat-s3c/regs-serial.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-mem.h> 36#include <asm/arch/regs-mem.h>
37#include <asm/arch/regs-lcd.h> 37#include <asm/arch/regs-lcd.h>
38#include <asm/arch/nand.h> 38#include <asm/plat-s3c/nand.h>
39 39
40#include <linux/mtd/mtd.h> 40#include <linux/mtd/mtd.h>
41#include <linux/mtd/nand.h> 41#include <linux/mtd/nand.h>
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index 866ff71c01dd..b59e6d39f2f2 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -38,12 +38,12 @@
38#include <asm/irq.h> 38#include <asm/irq.h>
39#include <asm/mach-types.h> 39#include <asm/mach-types.h>
40 40
41#include <asm/arch/regs-serial.h> 41#include <asm/plat-s3c/regs-serial.h>
42#include <asm/arch/regs-gpio.h> 42#include <asm/arch/regs-gpio.h>
43#include <asm/arch/regs-lcd.h> 43#include <asm/arch/regs-lcd.h>
44 44
45#include <asm/arch/h1940.h> 45#include <asm/arch/h1940.h>
46#include <asm/arch/nand.h> 46#include <asm/plat-s3c/nand.h>
47#include <asm/arch/fb.h> 47#include <asm/arch/fb.h>
48 48
49#include <asm/plat-s3c24xx/clock.h> 49#include <asm/plat-s3c24xx/clock.h>
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index e167254e232e..670115b8a12e 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -31,7 +31,7 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34#include <asm/arch/regs-serial.h> 34#include <asm/plat-s3c/regs-serial.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-lcd.h> 36#include <asm/arch/regs-lcd.h>
37 37
diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig
index bf8d87abfab3..88d5fd34fe3b 100644
--- a/arch/arm/mach-s3c2442/Kconfig
+++ b/arch/arm/mach-s3c2442/Kconfig
@@ -11,6 +11,7 @@ config CPU_S3C2442
11 select S3C2410_GPIO 11 select S3C2410_GPIO
12 select S3C2410_PM if PM 12 select S3C2410_PM if PM
13 select CPU_S3C244X 13 select CPU_S3C244X
14 select CPU_LLSERIAL_S3C2440
14 help 15 help
15 Support for S3C2442 Samsung Mobile CPU based systems. 16 Support for S3C2442 Samsung Mobile CPU based systems.
16 17
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index c649bb2e7ce8..14252f573754 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -8,6 +8,7 @@ config CPU_S3C2443
8 bool 8 bool
9 depends on ARCH_S3C2410 9 depends on ARCH_S3C2410
10 select S3C2443_DMA if S3C2410_DMA 10 select S3C2443_DMA if S3C2410_DMA
11 select CPU_LLSERIAL_S3C2440
11 help 12 help
12 Support for the S3C2443 SoC from the S3C24XX line 13 Support for the S3C2443 SoC from the S3C24XX line
13 14
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index f70e8ccffc3d..fc3ede82af8f 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -24,14 +24,14 @@
24#include <asm/plat-s3c24xx/dma.h> 24#include <asm/plat-s3c24xx/dma.h>
25#include <asm/plat-s3c24xx/cpu.h> 25#include <asm/plat-s3c24xx/cpu.h>
26 26
27#include <asm/arch/regs-serial.h> 27#include <asm/plat-s3c/regs-serial.h>
28#include <asm/arch/regs-gpio.h> 28#include <asm/arch/regs-gpio.h>
29#include <asm/arch/regs-ac97.h> 29#include <asm/plat-s3c/regs-ac97.h>
30#include <asm/arch/regs-mem.h> 30#include <asm/arch/regs-mem.h>
31#include <asm/arch/regs-lcd.h> 31#include <asm/arch/regs-lcd.h>
32#include <asm/arch/regs-sdi.h> 32#include <asm/arch/regs-sdi.h>
33#include <asm/arch/regs-iis.h> 33#include <asm/plat-s3c24xx/regs-iis.h>
34#include <asm/arch/regs-spi.h> 34#include <asm/plat-s3c24xx/regs-spi.h>
35 35
36#define MAP(x) { \ 36#define MAP(x) { \
37 [0] = (x) | DMA_CH_VALID, \ 37 [0] = (x) | DMA_CH_VALID, \
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index b1eb709ee65a..8cd93130ef36 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -31,7 +31,7 @@
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33 33
34#include <asm/arch/regs-serial.h> 34#include <asm/plat-s3c/regs-serial.h>
35#include <asm/arch/regs-gpio.h> 35#include <asm/arch/regs-gpio.h>
36#include <asm/arch/regs-lcd.h> 36#include <asm/arch/regs-lcd.h>
37 37
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index cd67ab1b217b..f99d9013905f 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -101,6 +101,16 @@ config SA1100_JORNADA720
101 handheld computer. See <http://www.hp.com/jornada/products/720> 101 handheld computer. See <http://www.hp.com/jornada/products/720>
102 for details. 102 for details.
103 103
104config SA1100_JORNADA720_SSP
105 bool "HP Jornada 720 Extended SSP driver"
106 select SA1100_SSP
107 depends on SA1100_JORNADA720
108 help
109 Say Y here if you have a HP Jornada 7xx handheld computer and you
110 want to access devices connected to the MCU. Those include the
111 keyboard, touchscreen, backlight and battery. This driver also activates
112 the generic SSP which it extends.
113
104config SA1100_HACKKIT 114config SA1100_HACKKIT
105 bool "HackKit Core CPU Board" 115 bool "HackKit Core CPU Board"
106 help 116 help
@@ -145,8 +155,7 @@ config SA1100_SSP
145 help 155 help
146 Say Y here to enable support for the generic PIO SSP driver. 156 Say Y here to enable support for the generic PIO SSP driver.
147 This isn't for audio support, but for attached sensors and 157 This isn't for audio support, but for attached sensors and
148 other devices, eg for BadgePAD 4 sensor support, or Jornada 158 other devices, eg for BadgePAD 4 sensor support.
149 720 touchscreen support.
150 159
151config H3600_SLEEVE 160config H3600_SLEEVE
152 tristate "Compaq iPAQ Handheld sleeve support" 161 tristate "Compaq iPAQ Handheld sleeve support"
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index e27f15042a22..7a61e8d33ab7 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -31,6 +31,7 @@ obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o
31led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o 31led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o
32 32
33obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o 33obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o
34obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o
34 35
35obj-$(CONFIG_SA1100_LART) += lart.o 36obj-$(CONFIG_SA1100_LART) += lart.o
36led-$(CONFIG_SA1100_LART) += leds-lart.o 37led-$(CONFIG_SA1100_LART) += leds-lart.o
@@ -51,3 +52,4 @@ obj-$(CONFIG_LEDS) += $(led-y)
51# Miscelaneous functions 52# Miscelaneous functions
52obj-$(CONFIG_PM) += pm.o sleep.o 53obj-$(CONFIG_PM) += pm.o sleep.o
53obj-$(CONFIG_SA1100_SSP) += ssp.o 54obj-$(CONFIG_SA1100_SSP) += ssp.o
55
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
new file mode 100644
index 000000000000..0a45e1ac8ad6
--- /dev/null
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -0,0 +1,201 @@
1/**
2 * arch/arm/mac-sa1100/jornada720_ssp.c
3 *
4 * Copyright (C) 2006/2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
5 * Copyright (C) 2006 Filip Zyzniewski <filip.zyzniewski@tefnet.pl>
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 * SSP driver for the HP Jornada 710/720/728
12 */
13
14#include <linux/delay.h>
15#include <linux/errno.h>
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/platform_device.h>
20#include <linux/sched.h>
21#include <linux/slab.h>
22
23#include <asm/hardware.h>
24#include <asm/hardware/ssp.h>
25#include <asm/arch/jornada720.h>
26
27static DEFINE_SPINLOCK(jornada_ssp_lock);
28static unsigned long jornada_ssp_flags;
29
30/**
31 * jornada_ssp_reverse - reverses input byte
32 *
33 * we need to reverse all data we recieve from the mcu due to its physical location
34 * returns : 01110111 -> 11101110
35 */
36u8 inline jornada_ssp_reverse(u8 byte)
37{
38 return
39 ((0x80 & byte) >> 7) |
40 ((0x40 & byte) >> 5) |
41 ((0x20 & byte) >> 3) |
42 ((0x10 & byte) >> 1) |
43 ((0x08 & byte) << 1) |
44 ((0x04 & byte) << 3) |
45 ((0x02 & byte) << 5) |
46 ((0x01 & byte) << 7);
47};
48EXPORT_SYMBOL(jornada_ssp_reverse);
49
50/**
51 * jornada_ssp_byte - waits for ready ssp bus and sends byte
52 *
53 * waits for fifo buffer to clear and then transmits, if it doesn't then we will
54 * timeout after <timeout> rounds. Needs mcu running before its called.
55 *
56 * returns : %mcu output on success
57 * : %-ETIMEOUT on timeout
58 */
59int jornada_ssp_byte(u8 byte)
60{
61 int timeout = 400000;
62 u16 ret;
63
64 while ((GPLR & GPIO_GPIO10)) {
65 if (!--timeout) {
66 printk(KERN_WARNING "SSP: timeout while waiting for transmit\n");
67 return -ETIMEDOUT;
68 }
69 cpu_relax();
70 }
71
72 ret = jornada_ssp_reverse(byte) << 8;
73
74 ssp_write_word(ret);
75 ssp_read_word(&ret);
76
77 return jornada_ssp_reverse(ret);
78};
79EXPORT_SYMBOL(jornada_ssp_byte);
80
81/**
82 * jornada_ssp_inout - decide if input is command or trading byte
83 *
84 * returns : (jornada_ssp_byte(byte)) on success
85 * : %-ETIMEOUT on timeout failure
86 */
87int jornada_ssp_inout(u8 byte)
88{
89 int ret, i;
90
91 /* true means command byte */
92 if (byte != TXDUMMY) {
93 ret = jornada_ssp_byte(byte);
94 /* Proper return to commands is TxDummy */
95 if (ret != TXDUMMY) {
96 for (i = 0; i < 256; i++)/* flushing bus */
97 if (jornada_ssp_byte(TXDUMMY) == -1)
98 break;
99 return -ETIMEDOUT;
100 }
101 } else /* Exchange TxDummy for data */
102 ret = jornada_ssp_byte(TXDUMMY);
103
104 return ret;
105};
106EXPORT_SYMBOL(jornada_ssp_inout);
107
108/**
109 * jornada_ssp_start - enable mcu
110 *
111 */
112int jornada_ssp_start()
113{
114 spin_lock_irqsave(&jornada_ssp_lock, jornada_ssp_flags);
115 GPCR = GPIO_GPIO25;
116 udelay(50);
117 return 0;
118};
119EXPORT_SYMBOL(jornada_ssp_start);
120
121/**
122 * jornada_ssp_end - disable mcu and turn off lock
123 *
124 */
125int jornada_ssp_end()
126{
127 GPSR = GPIO_GPIO25;
128 spin_unlock_irqrestore(&jornada_ssp_lock, jornada_ssp_flags);
129 return 0;
130};
131EXPORT_SYMBOL(jornada_ssp_end);
132
133static int __init jornada_ssp_probe(struct platform_device *dev)
134{
135 int ret;
136
137 GPSR = GPIO_GPIO25;
138
139 ret = ssp_init();
140
141 /* worked fine, lets not bother with anything else */
142 if (!ret) {
143 printk(KERN_INFO "SSP: device initialized with irq\n");
144 return ret;
145 }
146
147 printk(KERN_WARNING "SSP: initialization failed, trying non-irq solution \n");
148
149 /* init of Serial 4 port */
150 Ser4MCCR0 = 0;
151 Ser4SSCR0 = 0x0387;
152 Ser4SSCR1 = 0x18;
153
154 /* clear out any left over data */
155 ssp_flush();
156
157 /* enable MCU */
158 jornada_ssp_start();
159
160 /* see if return value makes sense */
161 ret = jornada_ssp_inout(GETBRIGHTNESS);
162
163 /* seems like it worked, just feed it with TxDummy to get rid of data */
164 if (ret == TxDummy)
165 jornada_ssp_inout(TXDUMMY);
166
167 jornada_ssp_end();
168
169 /* failed, lets just kill everything */
170 if (ret == -ETIMEDOUT) {
171 printk(KERN_WARNING "SSP: attempts failed, bailing\n");
172 ssp_exit();
173 return -ENODEV;
174 }
175
176 /* all fine */
177 printk(KERN_INFO "SSP: device initialized\n");
178 return 0;
179};
180
181static int jornada_ssp_remove(struct platform_device *dev)
182{
183 /* Note that this doesnt actually remove the driver, since theres nothing to remove
184 * It just makes sure everything is turned off */
185 GPSR = GPIO_GPIO25;
186 ssp_exit();
187 return 0;
188};
189
190struct platform_driver jornadassp_driver = {
191 .probe = jornada_ssp_probe,
192 .remove = jornada_ssp_remove,
193 .driver = {
194 .name = "jornada_ssp",
195 },
196};
197
198static int __init jornada_ssp_init(void)
199{
200 return platform_driver_register(&jornadassp_driver);
201}
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 3a0a1ee2542d..9f1ed1509301 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -292,6 +292,8 @@ static struct platform_device *devices[] __initdata = {
292 &smc91x_device, 292 &smc91x_device,
293}; 293};
294 294
295extern void sa1110_mb_disable(void);
296
295static int __init neponset_init(void) 297static int __init neponset_init(void)
296{ 298{
297 platform_driver_register(&neponset_device_driver); 299 platform_driver_register(&neponset_device_driver);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index e7904bc92c73..12161ae445da 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -345,13 +345,14 @@ config CPU_XSC3
345# ARMv6 345# ARMv6
346config CPU_V6 346config CPU_V6
347 bool "Support ARM V6 processor" 347 bool "Support ARM V6 processor"
348 depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 348 depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3
349 default y if ARCH_MX3
349 select CPU_32v6 350 select CPU_32v6
350 select CPU_ABRT_EV6 351 select CPU_ABRT_EV6
351 select CPU_CACHE_V6 352 select CPU_CACHE_V6
352 select CPU_CACHE_VIPT 353 select CPU_CACHE_VIPT
353 select CPU_CP15_MMU 354 select CPU_CP15_MMU
354 select CPU_HAS_ASID 355 select CPU_HAS_ASID if MMU
355 select CPU_COPY_V6 if MMU 356 select CPU_COPY_V6 if MMU
356 select CPU_TLB_V6 if MMU 357 select CPU_TLB_V6 if MMU
357 358
@@ -359,7 +360,7 @@ config CPU_V6
359config CPU_32v6K 360config CPU_32v6K
360 bool "Support ARM V6K processor extensions" if !SMP 361 bool "Support ARM V6K processor extensions" if !SMP
361 depends on CPU_V6 362 depends on CPU_V6
362 default y if SMP 363 default y if SMP && !ARCH_MX3
363 help 364 help
364 Say Y here if your ARMv6 processor supports the 'K' extension. 365 Say Y here if your ARMv6 processor supports the 'K' extension.
365 This enables the kernel to use some instructions not present 366 This enables the kernel to use some instructions not present
@@ -377,7 +378,7 @@ config CPU_V7
377 select CPU_CACHE_V7 378 select CPU_CACHE_V7
378 select CPU_CACHE_VIPT 379 select CPU_CACHE_VIPT
379 select CPU_CP15_MMU 380 select CPU_CP15_MMU
380 select CPU_HAS_ASID 381 select CPU_HAS_ASID if MMU
381 select CPU_COPY_V6 if MMU 382 select CPU_COPY_V6 if MMU
382 select CPU_TLB_V7 if MMU 383 select CPU_TLB_V7 if MMU
383 384
@@ -405,6 +406,7 @@ config CPU_32v5
405 406
406config CPU_32v6 407config CPU_32v6
407 bool 408 bool
409 select TLS_REG_EMUL if !CPU_32v6K && !MMU
408 410
409config CPU_32v7 411config CPU_32v7
410 bool 412 bool
@@ -598,7 +600,7 @@ config CPU_DCACHE_SIZE
598 600
599config CPU_DCACHE_WRITETHROUGH 601config CPU_DCACHE_WRITETHROUGH
600 bool "Force write through D-cache" 602 bool "Force write through D-cache"
601 depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_V6) && !CPU_DCACHE_DISABLE 603 depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020) && !CPU_DCACHE_DISABLE
602 default y if CPU_ARM925T 604 default y if CPU_ARM925T
603 help 605 help
604 Say Y here to use the data cache in writethrough mode. Unless you 606 Say Y here to use the data cache in writethrough mode. Unless you
@@ -611,12 +613,6 @@ config CPU_CACHE_ROUND_ROBIN
611 Say Y here to use the predictable round-robin cache replacement 613 Say Y here to use the predictable round-robin cache replacement
612 policy. Unless you specifically require this or are unsure, say N. 614 policy. Unless you specifically require this or are unsure, say N.
613 615
614config CPU_L2CACHE_DISABLE
615 bool "Disable level 2 cache"
616 depends on CPU_V7
617 help
618 Say Y here to disable the level 2 cache. If unsure, say N.
619
620config CPU_BPREDICT_DISABLE 616config CPU_BPREDICT_DISABLE
621 bool "Disable branch prediction" 617 bool "Disable branch prediction"
622 depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 || CPU_V7 618 depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 || CPU_V7
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 08a36f1b35d2..b4e9b734e0bd 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -17,6 +17,7 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/spinlock.h>
20 21
21#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
22#include <asm/io.h> 23#include <asm/io.h>
@@ -25,14 +26,19 @@
25#define CACHE_LINE_SIZE 32 26#define CACHE_LINE_SIZE 32
26 27
27static void __iomem *l2x0_base; 28static void __iomem *l2x0_base;
29static DEFINE_SPINLOCK(l2x0_lock);
28 30
29static inline void sync_writel(unsigned long val, unsigned long reg, 31static inline void sync_writel(unsigned long val, unsigned long reg,
30 unsigned long complete_mask) 32 unsigned long complete_mask)
31{ 33{
34 unsigned long flags;
35
36 spin_lock_irqsave(&l2x0_lock, flags);
32 writel(val, l2x0_base + reg); 37 writel(val, l2x0_base + reg);
33 /* wait for the operation to complete */ 38 /* wait for the operation to complete */
34 while (readl(l2x0_base + reg) & complete_mask) 39 while (readl(l2x0_base + reg) & complete_mask)
35 ; 40 ;
41 spin_unlock_irqrestore(&l2x0_lock, flags);
36} 42}
37 43
38static inline void cache_sync(void) 44static inline void cache_sync(void)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 3b5e47dc0c97..e5d61ee3d4a1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -114,6 +114,10 @@ static void __init early_cachepolicy(char **p)
114 } 114 }
115 if (i == ARRAY_SIZE(cache_policies)) 115 if (i == ARRAY_SIZE(cache_policies))
116 printk(KERN_ERR "ERROR: unknown or unsupported cache policy\n"); 116 printk(KERN_ERR "ERROR: unknown or unsupported cache policy\n");
117 if (cpu_architecture() >= CPU_ARCH_ARMv6) {
118 printk(KERN_WARNING "Only cachepolicy=writeback supported on ARMv6 and later\n");
119 cachepolicy = CPOLICY_WRITEBACK;
120 }
117 flush_cache_all(); 121 flush_cache_all();
118 set_cr(cr_alignment); 122 set_cr(cr_alignment);
119} 123}
@@ -252,13 +256,15 @@ static void __init build_mem_type_table(void)
252 int cpu_arch = cpu_architecture(); 256 int cpu_arch = cpu_architecture();
253 int i; 257 int i;
254 258
259 if (cpu_arch < CPU_ARCH_ARMv6) {
255#if defined(CONFIG_CPU_DCACHE_DISABLE) 260#if defined(CONFIG_CPU_DCACHE_DISABLE)
256 if (cachepolicy > CPOLICY_BUFFERED) 261 if (cachepolicy > CPOLICY_BUFFERED)
257 cachepolicy = CPOLICY_BUFFERED; 262 cachepolicy = CPOLICY_BUFFERED;
258#elif defined(CONFIG_CPU_DCACHE_WRITETHROUGH) 263#elif defined(CONFIG_CPU_DCACHE_WRITETHROUGH)
259 if (cachepolicy > CPOLICY_WRITETHROUGH) 264 if (cachepolicy > CPOLICY_WRITETHROUGH)
260 cachepolicy = CPOLICY_WRITETHROUGH; 265 cachepolicy = CPOLICY_WRITETHROUGH;
261#endif 266#endif
267 }
262 if (cpu_arch < CPU_ARCH_ARMv5) { 268 if (cpu_arch < CPU_ARCH_ARMv5) {
263 if (cachepolicy >= CPOLICY_WRITEALLOC) 269 if (cachepolicy >= CPOLICY_WRITEALLOC)
264 cachepolicy = CPOLICY_WRITEBACK; 270 cachepolicy = CPOLICY_WRITEBACK;
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index 9f396b4fa0b7..2b5ba396e3a6 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -31,12 +31,14 @@ EXPORT_SYMBOL(__cpuc_coherent_kern_range);
31EXPORT_SYMBOL(cpu_cache); 31EXPORT_SYMBOL(cpu_cache);
32#endif 32#endif
33 33
34#ifdef CONFIG_MMU
34#ifndef MULTI_USER 35#ifndef MULTI_USER
35EXPORT_SYMBOL(__cpu_clear_user_page); 36EXPORT_SYMBOL(__cpu_clear_user_page);
36EXPORT_SYMBOL(__cpu_copy_user_page); 37EXPORT_SYMBOL(__cpu_copy_user_page);
37#else 38#else
38EXPORT_SYMBOL(cpu_user); 39EXPORT_SYMBOL(cpu_user);
39#endif 40#endif
41#endif
40 42
41/* 43/*
42 * No module should need to touch the TLB (and currently 44 * No module should need to touch the TLB (and currently
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 718f4782ee8b..e0acc5ae6f6f 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -77,6 +77,7 @@ ENTRY(cpu_v7_dcache_clean_area)
77 * - we are not using split page tables 77 * - we are not using split page tables
78 */ 78 */
79ENTRY(cpu_v7_switch_mm) 79ENTRY(cpu_v7_switch_mm)
80#ifdef CONFIG_MMU
80 mov r2, #0 81 mov r2, #0
81 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 82 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
82 orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB 83 orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB
@@ -86,6 +87,7 @@ ENTRY(cpu_v7_switch_mm)
86 isb 87 isb
87 mcr p15, 0, r1, c13, c0, 1 @ set context ID 88 mcr p15, 0, r1, c13, c0, 1 @ set context ID
88 isb 89 isb
90#endif
89 mov pc, lr 91 mov pc, lr
90 92
91/* 93/*
@@ -109,6 +111,7 @@ ENTRY(cpu_v7_switch_mm)
109 * 1111 0 1 1 r/w r/w 111 * 1111 0 1 1 r/w r/w
110 */ 112 */
111ENTRY(cpu_v7_set_pte_ext) 113ENTRY(cpu_v7_set_pte_ext)
114#ifdef CONFIG_MMU
112 str r1, [r0], #-2048 @ linux version 115 str r1, [r0], #-2048 @ linux version
113 116
114 bic r3, r1, #0x000003f0 117 bic r3, r1, #0x000003f0
@@ -136,6 +139,7 @@ ENTRY(cpu_v7_set_pte_ext)
136 139
137 str r3, [r0] 140 str r3, [r0]
138 mcr p15, 0, r0, c7, c10, 1 @ flush_pte 141 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
142#endif
139 mov pc, lr 143 mov pc, lr
140 144
141cpu_v7_name: 145cpu_v7_name:
@@ -169,6 +173,7 @@ __v7_setup:
169 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate 173 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
170#endif 174#endif
171 dsb 175 dsb
176#ifdef CONFIG_MMU
172 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs 177 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
173 mcr p15, 0, r10, c2, c0, 2 @ TTB control register 178 mcr p15, 0, r10, c2, c0, 2 @ TTB control register
174 orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB 179 orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB
@@ -176,21 +181,12 @@ __v7_setup:
176 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 181 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
177 mov r10, #0x1f @ domains 0, 1 = manager 182 mov r10, #0x1f @ domains 0, 1 = manager
178 mcr p15, 0, r10, c3, c0, 0 @ load domain access register 183 mcr p15, 0, r10, c3, c0, 0 @ load domain access register
179#ifndef CONFIG_CPU_L2CACHE_DISABLE
180 @ L2 cache configuration in the L2 aux control register
181 mrc p15, 1, r10, c9, c0, 2
182 bic r10, r10, #(1 << 16) @ L2 outer cache
183 mcr p15, 1, r10, c9, c0, 2
184 @ L2 cache is enabled in the aux control register
185 mrc p15, 0, r10, c1, c0, 1
186 orr r10, r10, #2
187 mcr p15, 0, r10, c1, c0, 1
188#endif 184#endif
189 mrc p15, 0, r0, c1, c0, 0 @ read control register 185 adr r5, v7_crval
190 ldr r10, cr1_clear @ get mask for bits to clear 186 ldmia r5, {r5, r6}
191 bic r0, r0, r10 @ clear bits them 187 mrc p15, 0, r0, c1, c0, 0 @ read control register
192 ldr r10, cr1_set @ get mask for bits to set 188 bic r0, r0, r5 @ clear bits them
193 orr r0, r0, r10 @ set them 189 orr r0, r0, r6 @ set them
194 mov pc, lr @ return to head.S:__ret 190 mov pc, lr @ return to head.S:__ret
195 191
196 /* 192 /*
@@ -199,12 +195,9 @@ __v7_setup:
199 * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced 195 * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced
200 * 0 110 0011 1.00 .111 1101 < we want 196 * 0 110 0011 1.00 .111 1101 < we want
201 */ 197 */
202 .type cr1_clear, #object 198 .type v7_crval, #object
203 .type cr1_set, #object 199v7_crval:
204cr1_clear: 200 crval clear=0x0120c302, mmuset=0x00c0387d, ucset=0x00c0187c
205 .word 0x0120c302
206cr1_set:
207 .word 0x00c0387d
208 201
209__v7_setup_stack: 202__v7_setup_stack:
210 .space 4 * 11 @ 11 registers 203 .space 4 * 11 @ 11 registers
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 100d57ad98ed..ba3d21d8fba3 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -78,6 +78,13 @@ static struct irqaction iop_timer_irq = {
78 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 78 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
79}; 79};
80 80
81static unsigned long iop_tick_rate;
82unsigned long get_iop_tick_rate(void)
83{
84 return iop_tick_rate;
85}
86EXPORT_SYMBOL(get_iop_tick_rate);
87
81void __init iop_init_time(unsigned long tick_rate) 88void __init iop_init_time(unsigned long tick_rate)
82{ 89{
83 u32 timer_ctl; 90 u32 timer_ctl;
@@ -85,6 +92,7 @@ void __init iop_init_time(unsigned long tick_rate)
85 ticks_per_jiffy = (tick_rate + HZ/2) / HZ; 92 ticks_per_jiffy = (tick_rate + HZ/2) / HZ;
86 ticks_per_usec = tick_rate / 1000000; 93 ticks_per_usec = tick_rate / 1000000;
87 next_jiffy_time = 0xffffffff; 94 next_jiffy_time = 0xffffffff;
95 iop_tick_rate = tick_rate;
88 96
89 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED | 97 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED |
90 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1; 98 IOP_TMR_RELOAD | IOP_TMR_RATIO_1_1;
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
new file mode 100644
index 000000000000..03a65c0dfb60
--- /dev/null
+++ b/arch/arm/plat-mxc/Kconfig
@@ -0,0 +1,20 @@
1if ARCH_MXC
2
3menu "Freescale MXC Implementations"
4
5choice
6 prompt "MXC/iMX System Type"
7 default 0
8
9config ARCH_MX3
10 bool "MX3-based"
11 help
12 This enables support for systems based on the Freescale i.MX3 family
13
14endchoice
15
16source "arch/arm/mach-mx3/Kconfig"
17
18endmenu
19
20endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
new file mode 100644
index 000000000000..66ad9c2b6d64
--- /dev/null
+++ b/arch/arm/plat-mxc/Makefile
@@ -0,0 +1,10 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support
6obj-y := irq.o
7
8obj-m :=
9obj-n :=
10obj- :=
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
new file mode 100644
index 000000000000..87d253bc3d3c
--- /dev/null
+++ b/arch/arm/plat-mxc/irq.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/module.h>
12#include <linux/moduleparam.h>
13#include <linux/init.h>
14#include <linux/device.h>
15#include <linux/errno.h>
16#include <asm/hardware.h>
17#include <asm/io.h>
18#include <asm/irq.h>
19#include <asm/mach/irq.h>
20#include <asm/arch/common.h>
21
22/*!
23 * Disable interrupt number "irq" in the AVIC
24 *
25 * @param irq interrupt source number
26 */
27static void mxc_mask_irq(unsigned int irq)
28{
29 __raw_writel(irq, AVIC_INTDISNUM);
30}
31
32/*!
33 * Enable interrupt number "irq" in the AVIC
34 *
35 * @param irq interrupt source number
36 */
37static void mxc_unmask_irq(unsigned int irq)
38{
39 __raw_writel(irq, AVIC_INTENNUM);
40}
41
42static struct irq_chip mxc_avic_chip = {
43 .mask_ack = mxc_mask_irq,
44 .mask = mxc_mask_irq,
45 .unmask = mxc_unmask_irq,
46};
47
48/*!
49 * This function initializes the AVIC hardware and disables all the
50 * interrupts. It registers the interrupt enable and disable functions
51 * to the kernel for each interrupt source.
52 */
53void __init mxc_init_irq(void)
54{
55 int i;
56 u32 reg;
57
58 /* put the AVIC into the reset value with
59 * all interrupts disabled
60 */
61 __raw_writel(0, AVIC_INTCNTL);
62 __raw_writel(0x1f, AVIC_NIMASK);
63
64 /* disable all interrupts */
65 __raw_writel(0, AVIC_INTENABLEH);
66 __raw_writel(0, AVIC_INTENABLEL);
67
68 /* all IRQ no FIQ */
69 __raw_writel(0, AVIC_INTTYPEH);
70 __raw_writel(0, AVIC_INTTYPEL);
71 for (i = 0; i < MXC_MAX_INT_LINES; i++) {
72 set_irq_chip(i, &mxc_avic_chip);
73 set_irq_handler(i, handle_level_irq);
74 set_irq_flags(i, IRQF_VALID);
75 }
76
77 /* Set WDOG2's interrupt the highest priority level (bit 28-31) */
78 reg = __raw_readl(AVIC_NIPRIORITY6);
79 reg |= (0xF << 28);
80 __raw_writel(reg, AVIC_NIPRIORITY6);
81
82 printk(KERN_INFO "MXC IRQ initialized\n");
83}
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
new file mode 100644
index 000000000000..31656c33e05e
--- /dev/null
+++ b/arch/arm/plat-s3c/Kconfig
@@ -0,0 +1,104 @@
1# arch/arm/plat-s3c/Kconfig
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7config PLAT_S3C
8 bool
9 depends on ARCH_S3C2410
10 default y if ARCH_S3C2410
11 select NO_IOPORT
12 help
13 Base platform code for any Samsung S3C device
14
15# low-level serial option nodes
16
17config CPU_LLSERIAL_S3C2410_ONLY
18 bool
19 depends on ARCH_S3C2410
20 default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
21
22config CPU_LLSERIAL_S3C2440_ONLY
23 bool
24 depends on ARCH_S3C2410
25 default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
26
27config CPU_LLSERIAL_S3C2410
28 bool
29 depends on ARCH_S3C2410
30 help
31 Selected if there is an S3C2410 (or register compatible) serial
32 low-level implementation needed
33
34config CPU_LLSERIAL_S3C2440
35 bool
36 depends on ARCH_S3C2410
37 help
38 Selected if there is an S3C2440 (or register compatible) serial
39 low-level implementation needed
40
41# boot configurations
42
43comment "Boot options"
44
45config S3C_BOOT_WATCHDOG
46 bool "S3C Initialisation watchdog"
47 depends on PLAT_S3C && S3C2410_WATCHDOG
48 help
49 Say y to enable the watchdog during the kernel decompression
50 stage. If the kernel fails to uncompress, then the watchdog
51 will trigger a reset and the system should restart.
52
53config S3C_BOOT_ERROR_RESET
54 bool "S3C Reboot on decompression error"
55 depends on PLAT_S3C
56 help
57 Say y here to use the watchdog to reset the system if the
58 kernel decompressor detects an error during decompression.
59
60comment "Power management"
61
62config S3C2410_PM_DEBUG
63 bool "S3C2410 PM Suspend debug"
64 depends on PLAT_S3C && PM
65 help
66 Say Y here if you want verbose debugging from the PM Suspend and
67 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
68 for more information.
69
70config S3C2410_PM_CHECK
71 bool "S3C2410 PM Suspend Memory CRC"
72 depends on PLAT_S3C && PM && CRC32
73 help
74 Enable the PM code's memory area checksum over sleep. This option
75 will generate CRCs of all blocks of memory, and store them before
76 going to sleep. The blocks are then checked on resume for any
77 errors.
78
79 Note, this can take several seconds depending on memory size
80 and CPU speed.
81
82 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
83
84config S3C2410_PM_CHECK_CHUNKSIZE
85 int "S3C2410 PM Suspend CRC Chunksize (KiB)"
86 depends on PLAT_S3C && PM && S3C2410_PM_CHECK
87 default 64
88 help
89 Set the chunksize in Kilobytes of the CRC for checking memory
90 corruption over suspend and resume. A smaller value will mean that
91 the CRC data block will take more memory, but wil identify any
92 faults with better precision.
93
94 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
95
96config S3C_LOWLEVEL_UART_PORT
97 int "S3C UART to use for low-level messages"
98 depends on PLAT_S3C
99 default 0
100 help
101 Choice of which UART port to use for the low-level messages,
102 such as the `Uncompressing...` at start time. The value of
103 this configuration should be between zero and two. The port
104 must have been initialised by the boot-loader before use.
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index b972f36d547c..b66fb3c4e228 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -10,7 +10,7 @@ config PLAT_S3C24XX
10 default y if ARCH_S3C2410 10 default y if ARCH_S3C2410
11 select NO_IOPORT 11 select NO_IOPORT
12 help 12 help
13 Base platform code for any Samsung S3C device 13 Base platform code for any Samsung S3C24XX device
14 14
15if PLAT_S3C24XX 15if PLAT_S3C24XX
16 16
@@ -26,64 +26,6 @@ config PM_SIMTEC
26 Common power management code for systems that are 26 Common power management code for systems that are
27 compatible with the Simtec style of power management 27 compatible with the Simtec style of power management
28 28
29config S3C2410_BOOT_WATCHDOG
30 bool "S3C2410 Initialisation watchdog"
31 depends on ARCH_S3C2410 && S3C2410_WATCHDOG
32 help
33 Say y to enable the watchdog during the kernel decompression
34 stage. If the kernel fails to uncompress, then the watchdog
35 will trigger a reset and the system should restart.
36
37config S3C2410_BOOT_ERROR_RESET
38 bool "S3C2410 Reboot on decompression error"
39 depends on ARCH_S3C2410
40 help
41 Say y here to use the watchdog to reset the system if the
42 kernel decompressor detects an error during decompression.
43
44config S3C2410_PM_DEBUG
45 bool "S3C2410 PM Suspend debug"
46 depends on ARCH_S3C2410 && PM
47 help
48 Say Y here if you want verbose debugging from the PM Suspend and
49 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
50 for more information.
51
52config S3C2410_PM_CHECK
53 bool "S3C2410 PM Suspend Memory CRC"
54 depends on ARCH_S3C2410 && PM && CRC32
55 help
56 Enable the PM code's memory area checksum over sleep. This option
57 will generate CRCs of all blocks of memory, and store them before
58 going to sleep. The blocks are then checked on resume for any
59 errors.
60
61 Note, this can take several seconds depending on memory size
62 and CPU speed.
63
64 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
65
66config S3C2410_PM_CHECK_CHUNKSIZE
67 int "S3C2410 PM Suspend CRC Chunksize (KiB)"
68 depends on ARCH_S3C2410 && PM && S3C2410_PM_CHECK
69 default 64
70 help
71 Set the chunksize in Kilobytes of the CRC for checking memory
72 corruption over suspend and resume. A smaller value will mean that
73 the CRC data block will take more memory, but wil identify any
74 faults with better precision.
75
76 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
77
78config S3C2410_LOWLEVEL_UART_PORT
79 int "S3C2410 UART to use for low-level messages"
80 default 0
81 help
82 Choice of which UART port to use for the low-level messages,
83 such as the `Uncompressing...` at start time. The value of
84 this configuration should be between zero and two. The port
85 must have been initialised by the boot-loader before use.
86
87config S3C2410_DMA 29config S3C2410_DMA
88 bool "S3C2410 DMA support" 30 bool "S3C2410 DMA support"
89 depends on ARCH_S3C2410 31 depends on ARCH_S3C2410
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index 7ed19b23ce56..398c7ac25296 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -38,7 +38,7 @@
38#include <asm/arch/regs-gpio.h> 38#include <asm/arch/regs-gpio.h>
39#include <asm/arch/leds-gpio.h> 39#include <asm/arch/leds-gpio.h>
40 40
41#include <asm/arch/nand.h> 41#include <asm/plat-s3c/nand.h>
42 42
43#include <asm/plat-s3c24xx/common-smdk.h> 43#include <asm/plat-s3c24xx/common-smdk.h>
44#include <asm/plat-s3c24xx/devs.h> 44#include <asm/plat-s3c24xx/devs.h>
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 8ce4904d3131..f513ab083b8f 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -38,7 +38,7 @@
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39 39
40#include <asm/arch/regs-gpio.h> 40#include <asm/arch/regs-gpio.h>
41#include <asm/arch/regs-serial.h> 41#include <asm/plat-s3c/regs-serial.h>
42 42
43#include <asm/plat-s3c24xx/cpu.h> 43#include <asm/plat-s3c24xx/cpu.h>
44#include <asm/plat-s3c24xx/devs.h> 44#include <asm/plat-s3c24xx/devs.h>
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 5875da0ae0eb..e546e933b3f7 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -28,12 +28,12 @@
28#include <asm/io.h> 28#include <asm/io.h>
29#include <asm/irq.h> 29#include <asm/irq.h>
30 30
31#include <asm/arch/regs-serial.h> 31#include <asm/plat-s3c/regs-serial.h>
32#include <asm/arch/udc.h> 32#include <asm/plat-s3c24xx/udc.h>
33 33
34#include <asm/plat-s3c24xx/devs.h> 34#include <asm/plat-s3c24xx/devs.h>
35#include <asm/plat-s3c24xx/cpu.h> 35#include <asm/plat-s3c24xx/cpu.h>
36#include <asm/arch/regs-spi.h> 36#include <asm/plat-s3c24xx/regs-spi.h>
37 37
38/* Serial port registrations */ 38/* Serial port registrations */
39 39
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index 5692eccdf4d1..eab1850616d8 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -40,7 +40,7 @@
40#include <asm/hardware.h> 40#include <asm/hardware.h>
41#include <asm/io.h> 41#include <asm/io.h>
42 42
43#include <asm/arch/regs-serial.h> 43#include <asm/plat-s3c/regs-serial.h>
44#include <asm/arch/regs-clock.h> 44#include <asm/arch/regs-clock.h>
45#include <asm/arch/regs-gpio.h> 45#include <asm/arch/regs-gpio.h>
46#include <asm/arch/regs-mem.h> 46#include <asm/arch/regs-mem.h>
diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/plat-s3c24xx/s3c244x.c
index 767f2e9a3a55..3444b13afac5 100644
--- a/arch/arm/plat-s3c24xx/s3c244x.c
+++ b/arch/arm/plat-s3c24xx/s3c244x.c
@@ -30,7 +30,7 @@
30#include <asm/irq.h> 30#include <asm/irq.h>
31 31
32#include <asm/arch/regs-clock.h> 32#include <asm/arch/regs-clock.h>
33#include <asm/arch/regs-serial.h> 33#include <asm/plat-s3c/regs-serial.h>
34#include <asm/arch/regs-gpio.h> 34#include <asm/arch/regs-gpio.h>
35#include <asm/arch/regs-gpioj.h> 35#include <asm/arch/regs-gpioj.h>
36#include <asm/arch/regs-dsc.h> 36#include <asm/arch/regs-dsc.h>
@@ -47,7 +47,6 @@ static struct map_desc s3c244x_iodesc[] __initdata = {
47 IODESC_ENT(CLKPWR), 47 IODESC_ENT(CLKPWR),
48 IODESC_ENT(TIMER), 48 IODESC_ENT(TIMER),
49 IODESC_ENT(WATCHDOG), 49 IODESC_ENT(WATCHDOG),
50 IODESC_ENT(LCD),
51}; 50};
52 51
53/* uart initialisation */ 52/* uart initialisation */
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
index 7b7ae790b00d..d47113bbc34c 100644
--- a/arch/arm/plat-s3c24xx/sleep.S
+++ b/arch/arm/plat-s3c24xx/sleep.S
@@ -32,7 +32,7 @@
32#include <asm/arch/regs-gpio.h> 32#include <asm/arch/regs-gpio.h>
33#include <asm/arch/regs-clock.h> 33#include <asm/arch/regs-clock.h>
34#include <asm/arch/regs-mem.h> 34#include <asm/arch/regs-mem.h>
35#include <asm/arch/regs-serial.h> 35#include <asm/plat-s3c/regs-serial.h>
36 36
37/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not 37/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
38 * reset the UART configuration, only enable if you really need this! 38 * reset the UART configuration, only enable if you really need this!
diff --git a/arch/arm/plat-s3c24xx/time.c b/arch/arm/plat-s3c24xx/time.c
index b7667375bcec..2ec1daaa0e53 100644
--- a/arch/arm/plat-s3c24xx/time.c
+++ b/arch/arm/plat-s3c24xx/time.c
@@ -33,7 +33,7 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/arch/map.h> 35#include <asm/arch/map.h>
36#include <asm/arch/regs-timer.h> 36#include <asm/plat-s3c/regs-timer.h>
37#include <asm/arch/regs-irq.h> 37#include <asm/arch/regs-irq.h>
38#include <asm/mach/time.h> 38#include <asm/mach/time.h>
39 39
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index d4b7b229631d..0ac022f800a1 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -74,14 +74,14 @@ vfp_support_entry:
74 74
75 VFPFMRX r1, FPEXC @ Is the VFP enabled? 75 VFPFMRX r1, FPEXC @ Is the VFP enabled?
76 DBGSTR1 "fpexc %08x", r1 76 DBGSTR1 "fpexc %08x", r1
77 tst r1, #FPEXC_ENABLE 77 tst r1, #FPEXC_EN
78 bne look_for_VFP_exceptions @ VFP is already enabled 78 bne look_for_VFP_exceptions @ VFP is already enabled
79 79
80 DBGSTR1 "enable %x", r10 80 DBGSTR1 "enable %x", r10
81 ldr r3, last_VFP_context_address 81 ldr r3, last_VFP_context_address
82 orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set 82 orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set
83 ldr r4, [r3, r11, lsl #2] @ last_VFP_context pointer 83 ldr r4, [r3, r11, lsl #2] @ last_VFP_context pointer
84 bic r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled 84 bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled
85 cmp r4, r10 85 cmp r4, r10
86 beq check_for_exception @ we are returning to the same 86 beq check_for_exception @ we are returning to the same
87 @ process, so the registers are 87 @ process, so the registers are
@@ -124,7 +124,7 @@ no_old_VFP_process:
124 VFPFMXR FPSCR, r5 @ restore status 124 VFPFMXR FPSCR, r5 @ restore status
125 125
126check_for_exception: 126check_for_exception:
127 tst r1, #FPEXC_EXCEPTION 127 tst r1, #FPEXC_EX
128 bne process_exception @ might as well handle the pending 128 bne process_exception @ might as well handle the pending
129 @ exception before retrying branch 129 @ exception before retrying branch
130 @ out before setting an FPEXC that 130 @ out before setting an FPEXC that
@@ -136,10 +136,10 @@ check_for_exception:
136 136
137 137
138look_for_VFP_exceptions: 138look_for_VFP_exceptions:
139 tst r1, #FPEXC_EXCEPTION 139 tst r1, #FPEXC_EX
140 bne process_exception 140 bne process_exception
141 VFPFMRX r5, FPSCR 141 VFPFMRX r5, FPSCR
142 tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION ! 142 tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EX !
143 bne process_exception 143 bne process_exception
144 144
145 @ Fall into hand on to next handler - appropriate coproc instr 145 @ Fall into hand on to next handler - appropriate coproc instr
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 1106b5f9cf19..04ddab2bd876 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -53,7 +53,7 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
53 * case the thread migrates to a different CPU. The 53 * case the thread migrates to a different CPU. The
54 * restoring is done lazily. 54 * restoring is done lazily.
55 */ 55 */
56 if ((fpexc & FPEXC_ENABLE) && last_VFP_context[cpu]) { 56 if ((fpexc & FPEXC_EN) && last_VFP_context[cpu]) {
57 vfp_save_state(last_VFP_context[cpu], fpexc); 57 vfp_save_state(last_VFP_context[cpu], fpexc);
58 last_VFP_context[cpu]->hard.cpu = cpu; 58 last_VFP_context[cpu]->hard.cpu = cpu;
59 } 59 }
@@ -70,7 +70,7 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
70 * Always disable VFP so we can lazily save/restore the 70 * Always disable VFP so we can lazily save/restore the
71 * old state. 71 * old state.
72 */ 72 */
73 fmxr(FPEXC, fpexc & ~FPEXC_ENABLE); 73 fmxr(FPEXC, fpexc & ~FPEXC_EN);
74 return NOTIFY_DONE; 74 return NOTIFY_DONE;
75 } 75 }
76 76
@@ -81,13 +81,13 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
81 */ 81 */
82 memset(vfp, 0, sizeof(union vfp_state)); 82 memset(vfp, 0, sizeof(union vfp_state));
83 83
84 vfp->hard.fpexc = FPEXC_ENABLE; 84 vfp->hard.fpexc = FPEXC_EN;
85 vfp->hard.fpscr = FPSCR_ROUND_NEAREST; 85 vfp->hard.fpscr = FPSCR_ROUND_NEAREST;
86 86
87 /* 87 /*
88 * Disable VFP to ensure we initialise it first. 88 * Disable VFP to ensure we initialise it first.
89 */ 89 */
90 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); 90 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
91 } 91 }
92 92
93 /* flush and release case: Per-thread VFP cleanup. */ 93 /* flush and release case: Per-thread VFP cleanup. */
@@ -229,7 +229,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
229 /* 229 /*
230 * Enable access to the VFP so we can handle the bounce. 230 * Enable access to the VFP so we can handle the bounce.
231 */ 231 */
232 fmxr(FPEXC, fpexc & ~(FPEXC_EXCEPTION|FPEXC_INV|FPEXC_UFC|FPEXC_IOC)); 232 fmxr(FPEXC, fpexc & ~(FPEXC_EX|FPEXC_INV|FPEXC_UFC|FPEXC_IOC));
233 233
234 orig_fpscr = fpscr = fmrx(FPSCR); 234 orig_fpscr = fpscr = fmrx(FPSCR);
235 235
@@ -248,7 +248,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
248 /* 248 /*
249 * Modify fpscr to indicate the number of iterations remaining 249 * Modify fpscr to indicate the number of iterations remaining
250 */ 250 */
251 if (fpexc & FPEXC_EXCEPTION) { 251 if (fpexc & FPEXC_EX) {
252 u32 len; 252 u32 len;
253 253
254 len = fpexc + (1 << FPEXC_LENGTH_BIT); 254 len = fpexc + (1 << FPEXC_LENGTH_BIT);
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index 2f48ba329961..a4d81cda479e 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -187,6 +187,22 @@ config PNX4008_WATCHDOG
187 187
188 Say N if you are unsure. 188 Say N if you are unsure.
189 189
190config IOP_WATCHDOG
191 tristate "IOP Watchdog"
192 depends on WATCHDOG && PLAT_IOP
193 select WATCHDOG_NOWAYOUT if (ARCH_IOP32X || ARCH_IOP33X)
194 help
195 Say Y here if to include support for the watchdog timer
196 in the Intel IOP3XX & IOP13XX I/O Processors. This driver can
197 be built as a module by choosing M. The module will
198 be called iop_wdt.
199
200 Note: The IOP13XX watchdog does an Internal Bus Reset which will
201 affect both cores and the peripherals of the IOP. The ATU-X
202 and/or ATUe configuration registers will remain intact, but if
203 operating as an Root Complex and/or Central Resource, the PCI-X
204 and/or PCIe busses will also be reset. THIS IS A VERY BIG HAMMER.
205
190# AVR32 Architecture 206# AVR32 Architecture
191 207
192config AT32AP700X_WDT 208config AT32AP700X_WDT
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index 3907ec04a4e5..bdb9d5e3bb41 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
35obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o 35obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
36obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o 36obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
37obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o 37obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o
38obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
38 39
39# AVR32 Architecture 40# AVR32 Architecture
40obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o 41obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
diff --git a/drivers/char/watchdog/iop_wdt.c b/drivers/char/watchdog/iop_wdt.c
new file mode 100644
index 000000000000..bbbd91af754d
--- /dev/null
+++ b/drivers/char/watchdog/iop_wdt.c
@@ -0,0 +1,262 @@
1/*
2 * drivers/char/watchdog/iop_wdt.c
3 *
4 * WDT driver for Intel I/O Processors
5 * Copyright (C) 2005, Intel Corporation.
6 *
7 * Based on ixp4xx driver, Copyright 2004 (c) MontaVista, Software, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms and conditions of the GNU General Public License,
11 * version 2, as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along with
19 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 * Place - Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * Curt E Bruns <curt.e.bruns@intel.com>
23 * Peter Milne <peter.milne@d-tacq.com>
24 * Dan Williams <dan.j.williams@intel.com>
25 */
26
27#include <linux/module.h>
28#include <linux/kernel.h>
29#include <linux/fs.h>
30#include <linux/init.h>
31#include <linux/device.h>
32#include <linux/miscdevice.h>
33#include <linux/watchdog.h>
34#include <linux/uaccess.h>
35#include <asm/hardware.h>
36
37static int nowayout = WATCHDOG_NOWAYOUT;
38static unsigned long wdt_status;
39static unsigned long boot_status;
40
41#define WDT_IN_USE 0
42#define WDT_OK_TO_CLOSE 1
43#define WDT_ENABLED 2
44
45static unsigned long iop_watchdog_timeout(void)
46{
47 return (0xffffffffUL / get_iop_tick_rate());
48}
49
50/**
51 * wdt_supports_disable - determine if we are accessing a iop13xx watchdog
52 * or iop3xx by whether it has a disable command
53 */
54static int wdt_supports_disable(void)
55{
56 int can_disable;
57
58 if (IOP_WDTCR_EN_ARM != IOP_WDTCR_DIS_ARM)
59 can_disable = 1;
60 else
61 can_disable = 0;
62
63 return can_disable;
64}
65
66static void wdt_enable(void)
67{
68 /* Arm and enable the Timer to starting counting down from 0xFFFF.FFFF
69 * Takes approx. 10.7s to timeout
70 */
71 write_wdtcr(IOP_WDTCR_EN_ARM);
72 write_wdtcr(IOP_WDTCR_EN);
73}
74
75/* returns 0 if the timer was successfully disabled */
76static int wdt_disable(void)
77{
78 /* Stop Counting */
79 if (wdt_supports_disable()) {
80 write_wdtcr(IOP_WDTCR_DIS_ARM);
81 write_wdtcr(IOP_WDTCR_DIS);
82 clear_bit(WDT_ENABLED, &wdt_status);
83 printk(KERN_INFO "WATCHDOG: Disabled\n");
84 return 0;
85 } else
86 return 1;
87}
88
89static int iop_wdt_open(struct inode *inode, struct file *file)
90{
91 if (test_and_set_bit(WDT_IN_USE, &wdt_status))
92 return -EBUSY;
93
94 clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
95
96 wdt_enable();
97
98 set_bit(WDT_ENABLED, &wdt_status);
99
100 return nonseekable_open(inode, file);
101}
102
103static ssize_t
104iop_wdt_write(struct file *file, const char *data, size_t len,
105 loff_t *ppos)
106{
107 if (len) {
108 if (!nowayout) {
109 size_t i;
110
111 clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
112
113 for (i = 0; i != len; i++) {
114 char c;
115
116 if (get_user(c, data + i))
117 return -EFAULT;
118 if (c == 'V')
119 set_bit(WDT_OK_TO_CLOSE, &wdt_status);
120 }
121 }
122 wdt_enable();
123 }
124
125 return len;
126}
127
128static struct watchdog_info ident = {
129 .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
130 .identity = "iop watchdog",
131};
132
133static int
134iop_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
135 unsigned long arg)
136{
137 int options;
138 int ret = -ENOTTY;
139
140 switch (cmd) {
141 case WDIOC_GETSUPPORT:
142 if (copy_to_user
143 ((struct watchdog_info *)arg, &ident, sizeof ident))
144 ret = -EFAULT;
145 else
146 ret = 0;
147 break;
148
149 case WDIOC_GETSTATUS:
150 ret = put_user(0, (int *)arg);
151 break;
152
153 case WDIOC_GETBOOTSTATUS:
154 ret = put_user(boot_status, (int *)arg);
155 break;
156
157 case WDIOC_GETTIMEOUT:
158 ret = put_user(iop_watchdog_timeout(), (int *)arg);
159 break;
160
161 case WDIOC_KEEPALIVE:
162 wdt_enable();
163 ret = 0;
164 break;
165
166 case WDIOC_SETOPTIONS:
167 if (get_user(options, (int *)arg))
168 return -EFAULT;
169
170 if (options & WDIOS_DISABLECARD) {
171 if (!nowayout) {
172 if (wdt_disable() == 0) {
173 set_bit(WDT_OK_TO_CLOSE, &wdt_status);
174 ret = 0;
175 } else
176 ret = -ENXIO;
177 } else
178 ret = 0;
179 }
180
181 if (options & WDIOS_ENABLECARD) {
182 wdt_enable();
183 ret = 0;
184 }
185 break;
186 }
187
188 return ret;
189}
190
191static int iop_wdt_release(struct inode *inode, struct file *file)
192{
193 int state = 1;
194 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status))
195 if (test_bit(WDT_ENABLED, &wdt_status))
196 state = wdt_disable();
197
198 /* if the timer is not disbaled reload and notify that we are still
199 * going down
200 */
201 if (state != 0) {
202 wdt_enable();
203 printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - "
204 "reset in %lu seconds\n", iop_watchdog_timeout());
205 }
206
207 clear_bit(WDT_IN_USE, &wdt_status);
208 clear_bit(WDT_OK_TO_CLOSE, &wdt_status);
209
210 return 0;
211}
212
213static const struct file_operations iop_wdt_fops = {
214 .owner = THIS_MODULE,
215 .llseek = no_llseek,
216 .write = iop_wdt_write,
217 .ioctl = iop_wdt_ioctl,
218 .open = iop_wdt_open,
219 .release = iop_wdt_release,
220};
221
222static struct miscdevice iop_wdt_miscdev = {
223 .minor = WATCHDOG_MINOR,
224 .name = "watchdog",
225 .fops = &iop_wdt_fops,
226};
227
228static int __init iop_wdt_init(void)
229{
230 int ret;
231
232 ret = misc_register(&iop_wdt_miscdev);
233 if (ret == 0)
234 printk("iop watchdog timer: timeout %lu sec\n",
235 iop_watchdog_timeout());
236
237 /* check if the reset was caused by the watchdog timer */
238 boot_status = (read_rcsr() & IOP_RCSR_WDT) ? WDIOF_CARDRESET : 0;
239
240 /* Configure Watchdog Timeout to cause an Internal Bus (IB) Reset
241 * NOTE: An IB Reset will Reset both cores in the IOP342
242 */
243 write_wdtsr(IOP13XX_WDTCR_IB_RESET);
244
245 return ret;
246}
247
248static void __exit iop_wdt_exit(void)
249{
250 misc_deregister(&iop_wdt_miscdev);
251}
252
253module_init(iop_wdt_init);
254module_exit(iop_wdt_exit);
255
256module_param(nowayout, int, 0);
257MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
258
259MODULE_AUTHOR("Curt E Bruns <curt.e.bruns@intel.com>");
260MODULE_DESCRIPTION("iop watchdog timer driver");
261MODULE_LICENSE("GPL");
262MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c
index f21148e7b579..80f33b6d5713 100644
--- a/drivers/net/arm/ether1.c
+++ b/drivers/net/arm/ether1.c
@@ -36,7 +36,6 @@
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/fcntl.h> 37#include <linux/fcntl.h>
38#include <linux/interrupt.h> 38#include <linux/interrupt.h>
39#include <linux/ptrace.h>
40#include <linux/ioport.h> 39#include <linux/ioport.h>
41#include <linux/in.h> 40#include <linux/in.h>
42#include <linux/slab.h> 41#include <linux/slab.h>
@@ -75,7 +74,7 @@ static void ether1_timeout(struct net_device *dev);
75 74
76/* ------------------------------------------------------------------------- */ 75/* ------------------------------------------------------------------------- */
77 76
78static char version[] __initdata = "ether1 ethernet driver (c) 2000 Russell King v1.07\n"; 77static char version[] __devinitdata = "ether1 ethernet driver (c) 2000 Russell King v1.07\n";
79 78
80#define BUS_16 16 79#define BUS_16 16
81#define BUS_8 8 80#define BUS_8 8
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c
index a7cac695a9bd..3805506a3ab8 100644
--- a/drivers/net/arm/ether3.c
+++ b/drivers/net/arm/ether3.c
@@ -51,7 +51,6 @@
51#include <linux/types.h> 51#include <linux/types.h>
52#include <linux/fcntl.h> 52#include <linux/fcntl.h>
53#include <linux/interrupt.h> 53#include <linux/interrupt.h>
54#include <linux/ptrace.h>
55#include <linux/ioport.h> 54#include <linux/ioport.h>
56#include <linux/in.h> 55#include <linux/in.h>
57#include <linux/slab.h> 56#include <linux/slab.h>
@@ -69,7 +68,7 @@
69#include <asm/ecard.h> 68#include <asm/ecard.h>
70#include <asm/io.h> 69#include <asm/io.h>
71 70
72static char version[] __initdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n"; 71static char version[] __devinitdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n";
73 72
74#include "ether3.h" 73#include "ether3.h"
75 74
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 769ba69451f4..0d37d9d1fd78 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -31,7 +31,6 @@
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/fcntl.h> 32#include <linux/fcntl.h>
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/ptrace.h>
35#include <linux/ioport.h> 34#include <linux/ioport.h>
36#include <linux/in.h> 35#include <linux/in.h>
37#include <linux/slab.h> 36#include <linux/slab.h>
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index cf9a21cea6d9..49d838e90a24 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -24,7 +24,7 @@
24 24
25#define CUMANASCSI_PUBLIC_RELEASE 1 25#define CUMANASCSI_PUBLIC_RELEASE 1
26 26
27#define NCR5380_implementation_fields int port, ctrl 27#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
28#define NCR5380_local_declare() struct Scsi_Host *_instance 28#define NCR5380_local_declare() struct Scsi_Host *_instance
29#define NCR5380_setup(instance) _instance = instance 29#define NCR5380_setup(instance) _instance = instance
30#define NCR5380_read(reg) cumanascsi_read(_instance, reg) 30#define NCR5380_read(reg) cumanascsi_read(_instance, reg)
@@ -33,6 +33,11 @@
33#define NCR5380_queue_command cumanascsi_queue_command 33#define NCR5380_queue_command cumanascsi_queue_command
34#define NCR5380_proc_info cumanascsi_proc_info 34#define NCR5380_proc_info cumanascsi_proc_info
35 35
36#define NCR5380_implementation_fields \
37 unsigned ctrl; \
38 void __iomem *base; \
39 void __iomem *dma
40
36#define BOARD_NORMAL 0 41#define BOARD_NORMAL 0
37#define BOARD_NCR53C400 1 42#define BOARD_NCR53C400 1
38 43
@@ -47,192 +52,162 @@ const char *cumanascsi_info(struct Scsi_Host *spnt)
47 return ""; 52 return "";
48} 53}
49 54
50#ifdef NOT_EFFICIENT 55#define CTRL 0x16fc
51#define CTRL(p,v) outb(*ctrl = (v), (p) - 577) 56#define STAT 0x2004
52#define STAT(p) inb((p)+1) 57#define L(v) (((v)<<16)|((v) & 0x0000ffff))
53#define IN(p) inb((p)) 58#define H(v) (((v)>>16)|((v) & 0xffff0000))
54#define OUT(v,p) outb((v), (p))
55#else
56#define CTRL(p,v) (p[-2308] = (*ctrl = (v)))
57#define STAT(p) (p[4])
58#define IN(p) (*(p))
59#define IN2(p) ((unsigned short)(*(volatile unsigned long *)(p)))
60#define OUT(v,p) (*(p) = (v))
61#define OUT2(v,p) (*((volatile unsigned long *)(p)) = (v))
62#endif
63#define L(v) (((v)<<16)|((v) & 0x0000ffff))
64#define H(v) (((v)>>16)|((v) & 0xffff0000))
65 59
66static inline int 60static inline int
67NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, int len) 61NCR5380_pwrite(struct Scsi_Host *host, unsigned char *addr, int len)
68{ 62{
69 int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
70 int oldctrl = *ctrl;
71 unsigned long *laddr; 63 unsigned long *laddr;
72#ifdef NOT_EFFICIENT 64 void __iomem *dma = priv(host)->dma + 0x2000;
73 int iobase = instance->io_port;
74 int dma_io = iobase & ~(0x3C0000>>2);
75#else
76 volatile unsigned char *iobase = (unsigned char *)ioaddr(instance->io_port);
77 volatile unsigned char *dma_io = (unsigned char *)((int)iobase & ~0x3C0000);
78#endif
79 65
80 if(!len) return 0; 66 if(!len) return 0;
81 67
82 CTRL(iobase, 0x02); 68 writeb(0x02, priv(host)->base + CTRL);
83 laddr = (unsigned long *)addr; 69 laddr = (unsigned long *)addr;
84 while(len >= 32) 70 while(len >= 32)
85 { 71 {
86 int status; 72 unsigned int status;
87 unsigned long v; 73 unsigned long v;
88 status = STAT(iobase); 74 status = readb(priv(host)->base + STAT);
89 if(status & 0x80) 75 if(status & 0x80)
90 goto end; 76 goto end;
91 if(!(status & 0x40)) 77 if(!(status & 0x40))
92 continue; 78 continue;
93 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 79 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
94 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 80 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
95 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 81 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
96 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 82 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
97 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 83 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
98 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 84 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
99 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 85 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
100 v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); 86 v=*laddr++; writew(L(v), dma); writew(H(v), dma);
101 len -= 32; 87 len -= 32;
102 if(len == 0) 88 if(len == 0)
103 break; 89 break;
104 } 90 }
105 91
106 addr = (unsigned char *)laddr; 92 addr = (unsigned char *)laddr;
107 CTRL(iobase, 0x12); 93 writeb(0x12, priv(host)->base + CTRL);
94
108 while(len > 0) 95 while(len > 0)
109 { 96 {
110 int status; 97 unsigned int status;
111 status = STAT(iobase); 98 status = readb(priv(host)->base + STAT);
112 if(status & 0x80) 99 if(status & 0x80)
113 goto end; 100 goto end;
114 if(status & 0x40) 101 if(status & 0x40)
115 { 102 {
116 OUT(*addr++, dma_io); 103 writeb(*addr++, dma);
117 if(--len == 0) 104 if(--len == 0)
118 break; 105 break;
119 } 106 }
120 107
121 status = STAT(iobase); 108 status = readb(priv(host)->base + STAT);
122 if(status & 0x80) 109 if(status & 0x80)
123 goto end; 110 goto end;
124 if(status & 0x40) 111 if(status & 0x40)
125 { 112 {
126 OUT(*addr++, dma_io); 113 writeb(*addr++, dma);
127 if(--len == 0) 114 if(--len == 0)
128 break; 115 break;
129 } 116 }
130 } 117 }
131end: 118end:
132 CTRL(iobase, oldctrl|0x40); 119 writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL);
133 return len; 120 return len;
134} 121}
135 122
136static inline int 123static inline int
137NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr, int len) 124NCR5380_pread(struct Scsi_Host *host, unsigned char *addr, int len)
138{ 125{
139 int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
140 int oldctrl = *ctrl;
141 unsigned long *laddr; 126 unsigned long *laddr;
142#ifdef NOT_EFFICIENT 127 void __iomem *dma = priv(host)->dma + 0x2000;
143 int iobase = instance->io_port;
144 int dma_io = iobase & ~(0x3C0000>>2);
145#else
146 volatile unsigned char *iobase = (unsigned char *)ioaddr(instance->io_port);
147 volatile unsigned char *dma_io = (unsigned char *)((int)iobase & ~0x3C0000);
148#endif
149 128
150 if(!len) return 0; 129 if(!len) return 0;
151 130
152 CTRL(iobase, 0x00); 131 writeb(0x00, priv(host)->base + CTRL);
153 laddr = (unsigned long *)addr; 132 laddr = (unsigned long *)addr;
154 while(len >= 32) 133 while(len >= 32)
155 { 134 {
156 int status; 135 unsigned int status;
157 status = STAT(iobase); 136 status = readb(priv(host)->base + STAT);
158 if(status & 0x80) 137 if(status & 0x80)
159 goto end; 138 goto end;
160 if(!(status & 0x40)) 139 if(!(status & 0x40))
161 continue; 140 continue;
162 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 141 *laddr++ = readw(dma) | (readw(dma) << 16);
163 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 142 *laddr++ = readw(dma) | (readw(dma) << 16);
164 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 143 *laddr++ = readw(dma) | (readw(dma) << 16);
165 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 144 *laddr++ = readw(dma) | (readw(dma) << 16);
166 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 145 *laddr++ = readw(dma) | (readw(dma) << 16);
167 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 146 *laddr++ = readw(dma) | (readw(dma) << 16);
168 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 147 *laddr++ = readw(dma) | (readw(dma) << 16);
169 *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); 148 *laddr++ = readw(dma) | (readw(dma) << 16);
170 len -= 32; 149 len -= 32;
171 if(len == 0) 150 if(len == 0)
172 break; 151 break;
173 } 152 }
174 153
175 addr = (unsigned char *)laddr; 154 addr = (unsigned char *)laddr;
176 CTRL(iobase, 0x10); 155 writeb(0x10, priv(host)->base + CTRL);
156
177 while(len > 0) 157 while(len > 0)
178 { 158 {
179 int status; 159 unsigned int status;
180 status = STAT(iobase); 160 status = readb(priv(host)->base + STAT);
181 if(status & 0x80) 161 if(status & 0x80)
182 goto end; 162 goto end;
183 if(status & 0x40) 163 if(status & 0x40)
184 { 164 {
185 *addr++ = IN(dma_io); 165 *addr++ = readb(dma);
186 if(--len == 0) 166 if(--len == 0)
187 break; 167 break;
188 } 168 }
189 169
190 status = STAT(iobase); 170 status = readb(priv(host)->base + STAT);
191 if(status & 0x80) 171 if(status & 0x80)
192 goto end; 172 goto end;
193 if(status & 0x40) 173 if(status & 0x40)
194 { 174 {
195 *addr++ = IN(dma_io); 175 *addr++ = readb(dma);
196 if(--len == 0) 176 if(--len == 0)
197 break; 177 break;
198 } 178 }
199 } 179 }
200end: 180end:
201 CTRL(iobase, oldctrl|0x40); 181 writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL);
202 return len; 182 return len;
203} 183}
204 184
205#undef STAT 185static unsigned char cumanascsi_read(struct Scsi_Host *host, unsigned int reg)
206#undef CTRL 186{
207#undef IN 187 void __iomem *base = priv(host)->base;
208#undef OUT 188 unsigned char val;
209 189
210#define CTRL(p,v) outb(*ctrl = (v), (p) - 577) 190 writeb(0, base + CTRL);
211 191
212static char cumanascsi_read(struct Scsi_Host *instance, int reg) 192 val = readb(base + 0x2100 + (reg << 2));
213{
214 unsigned int iobase = instance->io_port;
215 int i;
216 int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
217 193
218 CTRL(iobase, 0); 194 priv(host)->ctrl = 0x40;
219 i = inb(iobase + 64 + reg); 195 writeb(0x40, base + CTRL);
220 CTRL(iobase, 0x40);
221 196
222 return i; 197 return val;
223} 198}
224 199
225static void cumanascsi_write(struct Scsi_Host *instance, int reg, int value) 200static void cumanascsi_write(struct Scsi_Host *host, unsigned int reg, unsigned int value)
226{ 201{
227 int iobase = instance->io_port; 202 void __iomem *base = priv(host)->base;
228 int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
229 203
230 CTRL(iobase, 0); 204 writeb(0, base + CTRL);
231 outb(value, iobase + 64 + reg);
232 CTRL(iobase, 0x40);
233}
234 205
235#undef CTRL 206 writeb(value, base + 0x2100 + (reg << 2));
207
208 priv(host)->ctrl = 0x40;
209 writeb(0x40, base + CTRL);
210}
236 211
237#include "../NCR5380.c" 212#include "../NCR5380.c"
238 213
@@ -256,32 +231,46 @@ static int __devinit
256cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id) 231cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id)
257{ 232{
258 struct Scsi_Host *host; 233 struct Scsi_Host *host;
259 int ret = -ENOMEM; 234 int ret;
260 235
261 host = scsi_host_alloc(&cumanascsi_template, sizeof(struct NCR5380_hostdata)); 236 ret = ecard_request_resources(ec);
262 if (!host) 237 if (ret)
263 goto out; 238 goto out;
264 239
265 host->io_port = ecard_address(ec, ECARD_IOC, ECARD_SLOW) + 0x800; 240 host = scsi_host_alloc(&cumanascsi_template, sizeof(struct NCR5380_hostdata));
241 if (!host) {
242 ret = -ENOMEM;
243 goto out_release;
244 }
245
246 priv(host)->base = ioremap(ecard_resource_start(ec, ECARD_RES_IOCSLOW),
247 ecard_resource_len(ec, ECARD_RES_IOCSLOW));
248 priv(host)->dma = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC),
249 ecard_resource_len(ec, ECARD_RES_MEMC));
250 if (!priv(host)->base || !priv(host)->dma) {
251 ret = -ENOMEM;
252 goto out_unmap;
253 }
254
266 host->irq = ec->irq; 255 host->irq = ec->irq;
267 256
268 NCR5380_init(host, 0); 257 NCR5380_init(host, 0);
269 258
259 priv(host)->ctrl = 0;
260 writeb(0, priv(host)->base + CTRL);
261
270 host->n_io_port = 255; 262 host->n_io_port = 255;
271 if (!(request_region(host->io_port, host->n_io_port, "CumanaSCSI-1"))) { 263 if (!(request_region(host->io_port, host->n_io_port, "CumanaSCSI-1"))) {
272 ret = -EBUSY; 264 ret = -EBUSY;
273 goto out_free; 265 goto out_unmap;
274 } 266 }
275 267
276 ((struct NCR5380_hostdata *)host->hostdata)->ctrl = 0;
277 outb(0x00, host->io_port - 577);
278
279 ret = request_irq(host->irq, cumanascsi_intr, IRQF_DISABLED, 268 ret = request_irq(host->irq, cumanascsi_intr, IRQF_DISABLED,
280 "CumanaSCSI-1", host); 269 "CumanaSCSI-1", host);
281 if (ret) { 270 if (ret) {
282 printk("scsi%d: IRQ%d not free: %d\n", 271 printk("scsi%d: IRQ%d not free: %d\n",
283 host->host_no, host->irq, ret); 272 host->host_no, host->irq, ret);
284 goto out_release; 273 goto out_unmap;
285 } 274 }
286 275
287 printk("scsi%d: at port 0x%08lx irq %d", 276 printk("scsi%d: at port 0x%08lx irq %d",
@@ -301,10 +290,12 @@ cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id)
301 290
302 out_free_irq: 291 out_free_irq:
303 free_irq(host->irq, host); 292 free_irq(host->irq, host);
304 out_release: 293 out_unmap:
305 release_region(host->io_port, host->n_io_port); 294 iounmap(priv(host)->base);
306 out_free: 295 iounmap(priv(host)->dma);
307 scsi_host_put(host); 296 scsi_host_put(host);
297 out_release:
298 ecard_release_resources(ec);
308 out: 299 out:
309 return ret; 300 return ret;
310} 301}
@@ -318,8 +309,10 @@ static void __devexit cumanascsi1_remove(struct expansion_card *ec)
318 scsi_remove_host(host); 309 scsi_remove_host(host);
319 free_irq(host->irq, host); 310 free_irq(host->irq, host);
320 NCR5380_exit(host); 311 NCR5380_exit(host);
321 release_region(host->io_port, host->n_io_port); 312 iounmap(priv(host)->base);
313 iounmap(priv(host)->dma);
322 scsi_host_put(host); 314 scsi_host_put(host);
315 ecard_release_resources(ec);
323} 316}
324 317
325static const struct ecard_id cumanascsi1_cids[] = { 318static const struct ecard_id cumanascsi1_cids[] = {
diff --git a/drivers/scsi/arm/ecoscsi.c b/drivers/scsi/arm/ecoscsi.c
index 378e7af0c5d6..5265a9884338 100644
--- a/drivers/scsi/arm/ecoscsi.c
+++ b/drivers/scsi/arm/ecoscsi.c
@@ -34,35 +34,25 @@
34#include "../scsi.h" 34#include "../scsi.h"
35#include <scsi/scsi_host.h> 35#include <scsi/scsi_host.h>
36 36
37#define NCR5380_implementation_fields int port, ctrl 37#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
38#define NCR5380_local_declare() struct Scsi_Host *_instance
39#define NCR5380_setup(instance) _instance = instance
40 38
41#define NCR5380_read(reg) ecoscsi_read(_instance, reg) 39#define NCR5380_local_declare() void __iomem *_base
42#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value) 40#define NCR5380_setup(host) _base = priv(host)->base
41
42#define NCR5380_read(reg) ({ writeb(reg | 8, _base); readb(_base + 4); })
43#define NCR5380_write(reg, value) ({ writeb(reg | 8, _base); writeb(value, _base + 4); })
43 44
44#define NCR5380_intr ecoscsi_intr 45#define NCR5380_intr ecoscsi_intr
45#define NCR5380_queue_command ecoscsi_queue_command 46#define NCR5380_queue_command ecoscsi_queue_command
46#define NCR5380_proc_info ecoscsi_proc_info 47#define NCR5380_proc_info ecoscsi_proc_info
47 48
49#define NCR5380_implementation_fields \
50 void __iomem *base
51
48#include "../NCR5380.h" 52#include "../NCR5380.h"
49 53
50#define ECOSCSI_PUBLIC_RELEASE 1 54#define ECOSCSI_PUBLIC_RELEASE 1
51 55
52static char ecoscsi_read(struct Scsi_Host *instance, int reg)
53{
54 int iobase = instance->io_port;
55 outb(reg | 8, iobase);
56 return inb(iobase + 1);
57}
58
59static void ecoscsi_write(struct Scsi_Host *instance, int reg, int value)
60{
61 int iobase = instance->io_port;
62 outb(reg | 8, iobase);
63 outb(value, iobase + 1);
64}
65
66/* 56/*
67 * Function : ecoscsi_setup(char *str, int *ints) 57 * Function : ecoscsi_setup(char *str, int *ints)
68 * 58 *
@@ -82,73 +72,6 @@ const char * ecoscsi_info (struct Scsi_Host *spnt)
82 return ""; 72 return "";
83} 73}
84 74
85#if 0
86#define STAT(p) inw(p + 144)
87
88static inline int NCR5380_pwrite(struct Scsi_Host *host, unsigned char *addr,
89 int len)
90{
91 int iobase = host->io_port;
92printk("writing %p len %d\n",addr, len);
93 if(!len) return -1;
94
95 while(1)
96 {
97 int status;
98 while(((status = STAT(iobase)) & 0x100)==0);
99 }
100}
101
102static inline int NCR5380_pread(struct Scsi_Host *host, unsigned char *addr,
103 int len)
104{
105 int iobase = host->io_port;
106 int iobase2= host->io_port + 0x100;
107 unsigned char *start = addr;
108 int s;
109printk("reading %p len %d\n",addr, len);
110 outb(inb(iobase + 128), iobase + 135);
111 while(len > 0)
112 {
113 int status,b,i, timeout;
114 timeout = 0x07FFFFFF;
115 while(((status = STAT(iobase)) & 0x100)==0)
116 {
117 timeout--;
118 if(status & 0x200 || !timeout)
119 {
120 printk("status = %p\n",status);
121 outb(0, iobase + 135);
122 return 1;
123 }
124 }
125 if(len >= 128)
126 {
127 for(i=0; i<64; i++)
128 {
129 b = inw(iobase + 136);
130 *addr++ = b;
131 *addr++ = b>>8;
132 }
133 len -= 128;
134 }
135 else
136 {
137 b = inw(iobase + 136);
138 *addr ++ = b;
139 len -= 1;
140 if(len)
141 *addr ++ = b>>8;
142 len -= 1;
143 }
144 }
145 outb(0, iobase + 135);
146 printk("first bytes = %02X %02X %02X %20X %02X %02X %02X\n",*start, start[1], start[2], start[3], start[4], start[5], start[6]);
147 return 1;
148}
149#endif
150#undef STAT
151
152#define BOARD_NORMAL 0 75#define BOARD_NORMAL 0
153#define BOARD_NCR53C400 1 76#define BOARD_NCR53C400 1
154 77
@@ -173,25 +96,36 @@ static struct Scsi_Host *host;
173 96
174static int __init ecoscsi_init(void) 97static int __init ecoscsi_init(void)
175{ 98{
99 void __iomem *_base;
100 int ret;
176 101
177 host = scsi_host_alloc(tpnt, sizeof(struct NCR5380_hostdata)); 102 if (!request_mem_region(0x33a0000, 4096, "ecoscsi")) {
178 if (!host) 103 ret = -EBUSY;
179 return 0; 104 goto out;
105 }
180 106
181 host->io_port = 0x80ce8000; 107 _base = ioremap(0x33a0000, 4096);
182 host->n_io_port = 144; 108 if (!_base) {
183 host->irq = IRQ_NONE; 109 ret = -ENOMEM;
110 goto out_release;
111 }
184 112
185 if (!(request_region(host->io_port, host->n_io_port, "ecoscsi")) ) 113 NCR5380_write(MODE_REG, 0x20); /* Is it really SCSI? */
186 goto unregister_scsi; 114 if (NCR5380_read(MODE_REG) != 0x20) /* Write to a reg. */
115 goto out_unmap;
187 116
188 ecoscsi_write(host, MODE_REG, 0x20); /* Is it really SCSI? */ 117 NCR5380_write(MODE_REG, 0x00); /* it back. */
189 if (ecoscsi_read(host, MODE_REG) != 0x20) /* Write to a reg. */ 118 if (NCR5380_read(MODE_REG) != 0x00)
190 goto release_reg; 119 goto out_unmap;
191 120
192 ecoscsi_write(host, MODE_REG, 0x00 ); /* it back. */ 121 host = scsi_host_alloc(tpnt, sizeof(struct NCR5380_hostdata));
193 if (ecoscsi_read(host, MODE_REG) != 0x00) 122 if (!host) {
194 goto release_reg; 123 ret = -ENOMEM;
124 goto out_unmap;
125 }
126
127 priv(host)->base = _base;
128 host->irq = IRQ_NONE;
195 129
196 NCR5380_init(host, 0); 130 NCR5380_init(host, 0);
197 131
@@ -206,24 +140,20 @@ static int __init ecoscsi_init(void)
206 scsi_scan_host(host); 140 scsi_scan_host(host);
207 return 0; 141 return 0;
208 142
209release_reg: 143 out_unmap:
210 release_region(host->io_port, host->n_io_port); 144 iounmap(_base);
211unregister_scsi: 145 out_release:
212 scsi_host_put(host); 146 release_mem_region(0x33a0000, 4096);
213 return -ENODEV; 147 out:
148 return ret;
214} 149}
215 150
216static void __exit ecoscsi_exit(void) 151static void __exit ecoscsi_exit(void)
217{ 152{
218 scsi_remove_host(host); 153 scsi_remove_host(host);
219
220 if (shpnt->irq != IRQ_NONE)
221 free_irq(shpnt->irq, NULL);
222 NCR5380_exit(host); 154 NCR5380_exit(host);
223 if (shpnt->io_port)
224 release_region(shpnt->io_port, shpnt->n_io_port);
225
226 scsi_host_put(host); 155 scsi_host_put(host);
156 release_mem_region(0x33a0000, 4096);
227 return 0; 157 return 0;
228} 158}
229 159
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index c21b8392c928..849cdf89f7bb 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -23,15 +23,18 @@
23 23
24#define OAKSCSI_PUBLIC_RELEASE 1 24#define OAKSCSI_PUBLIC_RELEASE 1
25 25
26#define NCR5380_read(reg) oakscsi_read(_instance, reg) 26#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
27#define NCR5380_write(reg, value) oakscsi_write(_instance, reg, value) 27#define NCR5380_local_declare() void __iomem *_base
28#define NCR5380_setup(host) _base = priv(host)->base
29
30#define NCR5380_read(reg) readb(_base + ((reg) << 2))
31#define NCR5380_write(reg, value) writeb(value, _base + ((reg) << 2))
28#define NCR5380_intr oakscsi_intr 32#define NCR5380_intr oakscsi_intr
29#define NCR5380_queue_command oakscsi_queue_command 33#define NCR5380_queue_command oakscsi_queue_command
30#define NCR5380_proc_info oakscsi_proc_info 34#define NCR5380_proc_info oakscsi_proc_info
31 35
32#define NCR5380_implementation_fields int port, ctrl 36#define NCR5380_implementation_fields \
33#define NCR5380_local_declare() struct Scsi_Host *_instance 37 void __iomem *base
34#define NCR5380_setup(instance) _instance = instance
35 38
36#define BOARD_NORMAL 0 39#define BOARD_NORMAL 0
37#define BOARD_NCR53C400 1 40#define BOARD_NCR53C400 1
@@ -39,60 +42,62 @@
39#include "../NCR5380.h" 42#include "../NCR5380.h"
40 43
41#undef START_DMA_INITIATOR_RECEIVE_REG 44#undef START_DMA_INITIATOR_RECEIVE_REG
42#define START_DMA_INITIATOR_RECEIVE_REG (7 + 128) 45#define START_DMA_INITIATOR_RECEIVE_REG (128 + 7)
43 46
44const char * oakscsi_info (struct Scsi_Host *spnt) 47const char * oakscsi_info (struct Scsi_Host *spnt)
45{ 48{
46 return ""; 49 return "";
47} 50}
48 51
49#define STAT(p) inw(p + 144) 52#define STAT ((128 + 16) << 2)
50extern void inswb(int from, void *to, int len); 53#define DATA ((128 + 8) << 2)
51 54
52static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, 55static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr,
53 int len) 56 int len)
54{ 57{
55 int iobase = instance->io_port; 58 void __iomem *base = priv(instance)->base;
59
56printk("writing %p len %d\n",addr, len); 60printk("writing %p len %d\n",addr, len);
57 if(!len) return -1; 61 if(!len) return -1;
58 62
59 while(1) 63 while(1)
60 { 64 {
61 int status; 65 int status;
62 while(((status = STAT(iobase)) & 0x100)==0); 66 while (((status = readw(base + STAT)) & 0x100)==0);
63 } 67 }
64} 68}
65 69
66static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr, 70static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr,
67 int len) 71 int len)
68{ 72{
69 int iobase = instance->io_port; 73 void __iomem *base = priv(instance)->base;
70printk("reading %p len %d\n", addr, len); 74printk("reading %p len %d\n", addr, len);
71 while(len > 0) 75 while(len > 0)
72 { 76 {
73 int status, timeout; 77 unsigned int status, timeout;
74 unsigned long b; 78 unsigned long b;
75 79
76 timeout = 0x01FFFFFF; 80 timeout = 0x01FFFFFF;
77 81
78 while(((status = STAT(iobase)) & 0x100)==0) 82 while (((status = readw(base + STAT)) & 0x100)==0)
79 { 83 {
80 timeout--; 84 timeout--;
81 if(status & 0x200 || !timeout) 85 if(status & 0x200 || !timeout)
82 { 86 {
83 printk("status = %08X\n",status); 87 printk("status = %08X\n", status);
84 return 1; 88 return 1;
85 } 89 }
86 } 90 }
91
87 if(len >= 128) 92 if(len >= 128)
88 { 93 {
89 inswb(iobase + 136, addr, 128); 94 readsw(base + DATA, addr, 128);
90 addr += 128; 95 addr += 128;
91 len -= 128; 96 len -= 128;
92 } 97 }
93 else 98 else
94 { 99 {
95 b = (unsigned long) inw(iobase + 136); 100 b = (unsigned long) readw(base + DATA);
96 *addr ++ = b; 101 *addr ++ = b;
97 len -= 1; 102 len -= 1;
98 if(len) 103 if(len)
@@ -103,10 +108,8 @@ printk("reading %p len %d\n", addr, len);
103 return 0; 108 return 0;
104} 109}
105 110
106#define oakscsi_read(instance,reg) (inb((instance)->io_port + (reg)))
107#define oakscsi_write(instance,reg,val) (outb((val), (instance)->io_port + (reg)))
108
109#undef STAT 111#undef STAT
112#undef DATA
110 113
111#include "../NCR5380.c" 114#include "../NCR5380.c"
112 115
@@ -132,18 +135,26 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
132 struct Scsi_Host *host; 135 struct Scsi_Host *host;
133 int ret = -ENOMEM; 136 int ret = -ENOMEM;
134 137
135 host = scsi_host_alloc(&oakscsi_template, sizeof(struct NCR5380_hostdata)); 138 ret = ecard_request_resources(ec);
136 if (!host) 139 if (ret)
137 goto out; 140 goto out;
138 141
139 host->io_port = ecard_address(ec, ECARD_MEMC, 0); 142 host = scsi_host_alloc(&oakscsi_template, sizeof(struct NCR5380_hostdata));
143 if (!host) {
144 ret = -ENOMEM;
145 goto release;
146 }
147
148 priv(host)->base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC),
149 ecard_resource_len(ec, ECARD_RES_MEMC));
150 if (!priv(host)->base) {
151 ret = -ENOMEM;
152 goto unreg;
153 }
154
140 host->irq = IRQ_NONE; 155 host->irq = IRQ_NONE;
141 host->n_io_port = 255; 156 host->n_io_port = 255;
142 157
143 ret = -EBUSY;
144 if (!request_region (host->io_port, host->n_io_port, "Oak SCSI"))
145 goto unreg;
146
147 NCR5380_init(host, 0); 158 NCR5380_init(host, 0);
148 159
149 printk("scsi%d: at port 0x%08lx irqs disabled", 160 printk("scsi%d: at port 0x%08lx irqs disabled",
@@ -156,15 +167,17 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
156 167
157 ret = scsi_add_host(host, &ec->dev); 168 ret = scsi_add_host(host, &ec->dev);
158 if (ret) 169 if (ret)
159 goto out_release; 170 goto out_unmap;
160 171
161 scsi_scan_host(host); 172 scsi_scan_host(host);
162 goto out; 173 goto out;
163 174
164 out_release: 175 out_unmap:
165 release_region(host->io_port, host->n_io_port); 176 iounmap(priv(host)->base);
166 unreg: 177 unreg:
167 scsi_host_put(host); 178 scsi_host_put(host);
179 release:
180 ecard_release_resources(ec);
168 out: 181 out:
169 return ret; 182 return ret;
170} 183}
@@ -177,8 +190,9 @@ static void __devexit oakscsi_remove(struct expansion_card *ec)
177 scsi_remove_host(host); 190 scsi_remove_host(host);
178 191
179 NCR5380_exit(host); 192 NCR5380_exit(host);
180 release_region(host->io_port, host->n_io_port); 193 iounmap(priv(host)->base);
181 scsi_host_put(host); 194 scsi_host_put(host);
195 ecard_release_resources(ec);
182} 196}
183 197
184static const struct ecard_id oakscsi_cids[] = { 198static const struct ecard_id oakscsi_cids[] = {
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index e42faa4e4282..dc1967176fe2 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -1114,8 +1114,8 @@ static int __init imx_serial_init(void)
1114 1114
1115static void __exit imx_serial_exit(void) 1115static void __exit imx_serial_exit(void)
1116{ 1116{
1117 uart_unregister_driver(&imx_reg);
1118 platform_driver_unregister(&serial_imx_driver); 1117 platform_driver_unregister(&serial_imx_driver);
1118 uart_unregister_driver(&imx_reg);
1119} 1119}
1120 1120
1121module_init(imx_serial_init); 1121module_init(imx_serial_init);
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 10bc0209cd66..3f26c4b2f322 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -78,7 +78,7 @@
78 78
79#include <asm/hardware.h> 79#include <asm/hardware.h>
80 80
81#include <asm/arch/regs-serial.h> 81#include <asm/plat-s3c/regs-serial.h>
82#include <asm/arch/regs-gpio.h> 82#include <asm/arch/regs-gpio.h>
83 83
84/* structures */ 84/* structures */
diff --git a/include/asm-arm/arch-at91/at91_mci.h b/include/asm-arm/arch-at91/at91_mci.h
index 40a9876b661a..c2e11cc374ba 100644
--- a/include/asm-arm/arch-at91/at91_mci.h
+++ b/include/asm-arm/arch-at91/at91_mci.h
@@ -26,6 +26,9 @@
26#define AT91_MCI_MR 0x04 /* Mode Register */ 26#define AT91_MCI_MR 0x04 /* Mode Register */
27#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */ 27#define AT91_MCI_CLKDIV (0xff << 0) /* Clock Divider */
28#define AT91_MCI_PWSDIV (7 << 8) /* Power Saving Divider */ 28#define AT91_MCI_PWSDIV (7 << 8) /* Power Saving Divider */
29#define AT91_MCI_RDPROOF (1 << 11) /* Read Proof Enable [SAM926[03] only] */
30#define AT91_MCI_WRPROOF (1 << 12) /* Write Proof Enable [SAM926[03] only] */
31#define AT91_MCI_PDCFBYTE (1 << 13) /* PDC Force Byte Transfer [SAM926[03] only] */
29#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */ 32#define AT91_MCI_PDCPADV (1 << 14) /* PDC Padding Value */
30#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */ 33#define AT91_MCI_PDCMODE (1 << 15) /* PDC-orientated Mode */
31#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */ 34#define AT91_MCI_BLKLEN (0xfff << 18) /* Data Block Length */
diff --git a/include/asm-arm/arch-iop13xx/iop13xx.h b/include/asm-arm/arch-iop13xx/iop13xx.h
index d4e4f828577c..52b7fab7ef60 100644
--- a/include/asm-arm/arch-iop13xx/iop13xx.h
+++ b/include/asm-arm/arch-iop13xx/iop13xx.h
@@ -19,6 +19,39 @@ static inline int iop13xx_cpu_id(void)
19 return id; 19 return id;
20} 20}
21 21
22/* WDTCR CP6 R7 Page 9 */
23static inline u32 read_wdtcr(void)
24{
25 u32 val;
26 asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
27 return val;
28}
29static inline void write_wdtcr(u32 val)
30{
31 asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
32}
33
34/* WDTSR CP6 R8 Page 9 */
35static inline u32 read_wdtsr(void)
36{
37 u32 val;
38 asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
39 return val;
40}
41static inline void write_wdtsr(u32 val)
42{
43 asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
44}
45
46/* RCSR - Reset Cause Status Register */
47static inline u32 read_rcsr(void)
48{
49 u32 val;
50 asm volatile("mrc p6, 0, %0, c0, c1, 0":"=r" (val));
51 return val;
52}
53
54extern unsigned long get_iop_tick_rate(void);
22#endif 55#endif
23 56
24/* 57/*
@@ -480,4 +513,14 @@ static inline int iop13xx_cpu_id(void)
480#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14) 513#define IOP13XX_PBI_LR1 IOP13XX_PBI_OFFSET(0x14)
481 514
482#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180) 515#define IOP13XX_PROCESSOR_FREQ IOP13XX_REG_ADDR32(0x2180)
516
517/* Watchdog timer definitions */
518#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
519#define IOP_WDTCR_EN 0xe1e1e1e1
520#define IOP_WDTCR_DIS_ARM 0x1f1f1f1f
521#define IOP_WDTCR_DIS 0xf1f1f1f1
522#define IOP_RCSR_WDT (1 << 5) /* reset caused by watchdog timer */
523#define IOP13XX_WDTSR_WRITE_EN (1 << 31) /* used to speed up reset requests */
524#define IOP13XX_WDTCR_IB_RESET (1 << 0)
525
483#endif /* _IOP13XX_HW_H_ */ 526#endif /* _IOP13XX_HW_H_ */
diff --git a/include/asm-arm/arch-iop13xx/system.h b/include/asm-arm/arch-iop13xx/system.h
index 127827058e1f..8575af8db78c 100644
--- a/include/asm-arm/arch-iop13xx/system.h
+++ b/include/asm-arm/arch-iop13xx/system.h
@@ -13,43 +13,13 @@ static inline void arch_idle(void)
13 cpu_do_idle(); 13 cpu_do_idle();
14} 14}
15 15
16/* WDTCR CP6 R7 Page 9 */
17static inline u32 read_wdtcr(void)
18{
19 u32 val;
20 asm volatile("mrc p6, 0, %0, c7, c9, 0":"=r" (val));
21 return val;
22}
23static inline void write_wdtcr(u32 val)
24{
25 asm volatile("mcr p6, 0, %0, c7, c9, 0"::"r" (val));
26}
27
28/* WDTSR CP6 R8 Page 9 */
29static inline u32 read_wdtsr(void)
30{
31 u32 val;
32 asm volatile("mrc p6, 0, %0, c8, c9, 0":"=r" (val));
33 return val;
34}
35static inline void write_wdtsr(u32 val)
36{
37 asm volatile("mcr p6, 0, %0, c8, c9, 0"::"r" (val));
38}
39
40#define IOP13XX_WDTCR_EN_ARM 0x1e1e1e1e
41#define IOP13XX_WDTCR_EN 0xe1e1e1e1
42#define IOP13XX_WDTCR_DIS_ARM 0x1f1f1f1f
43#define IOP13XX_WDTCR_DIS 0xf1f1f1f1
44#define IOP13XX_WDTSR_WRITE_EN (1 << 31)
45#define IOP13XX_WDTCR_IB_RESET (1 << 0)
46static inline void arch_reset(char mode) 16static inline void arch_reset(char mode)
47{ 17{
48 /* 18 /*
49 * Reset the internal bus (warning both cores are reset) 19 * Reset the internal bus (warning both cores are reset)
50 */ 20 */
51 write_wdtcr(IOP13XX_WDTCR_EN_ARM); 21 write_wdtcr(IOP_WDTCR_EN_ARM);
52 write_wdtcr(IOP13XX_WDTCR_EN); 22 write_wdtcr(IOP_WDTCR_EN);
53 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET); 23 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
54 write_wdtcr(0x1000); 24 write_wdtcr(0x1000);
55 25
diff --git a/include/asm-arm/arch-iop13xx/uncompress.h b/include/asm-arm/arch-iop13xx/uncompress.h
index b9525d59b7ad..dd9c2934190e 100644
--- a/include/asm-arm/arch-iop13xx/uncompress.h
+++ b/include/asm-arm/arch-iop13xx/uncompress.h
@@ -1,7 +1,6 @@
1#include <asm/types.h> 1#include <asm/types.h>
2#include <linux/serial_reg.h> 2#include <linux/serial_reg.h>
3#include <asm/hardware.h> 3#include <asm/hardware.h>
4#include <asm/processor.h>
5 4
6#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS) 5#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS)
7#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE) 6#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
@@ -9,7 +8,7 @@
9static inline void putc(char c) 8static inline void putc(char c)
10{ 9{
11 while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE) 10 while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE)
12 cpu_relax(); 11 barrier();
13 UART_BASE[UART_TX] = c; 12 UART_BASE[UART_TX] = c;
14} 13}
15 14
diff --git a/include/asm-arm/arch-iop32x/uncompress.h b/include/asm-arm/arch-iop32x/uncompress.h
index e64f52bf2bce..070f15818fe7 100644
--- a/include/asm-arm/arch-iop32x/uncompress.h
+++ b/include/asm-arm/arch-iop32x/uncompress.h
@@ -26,7 +26,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
26{ 26{
27 if (machine_is_iq80321()) 27 if (machine_is_iq80321())
28 uart_base = (volatile u8 *)IQ80321_UART; 28 uart_base = (volatile u8 *)IQ80321_UART;
29 else if (machine_is_iq31244()) 29 else if (machine_is_iq31244() || machine_is_em7210())
30 uart_base = (volatile u8 *)IQ31244_UART; 30 uart_base = (volatile u8 *)IQ31244_UART;
31 else 31 else
32 uart_base = (volatile u8 *)0xfe800000; 32 uart_base = (volatile u8 *)0xfe800000;
diff --git a/include/asm-arm/arch-mxc/board-mx31ads.h b/include/asm-arm/arch-mxc/board-mx31ads.h
new file mode 100644
index 000000000000..be29b83ad4ae
--- /dev/null
+++ b/include/asm-arm/arch-mxc/board-mx31ads.h
@@ -0,0 +1,142 @@
1/*
2 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
13
14/*!
15 * @name PBC Controller parameters
16 */
17/*! @{ */
18/*!
19 * Base address of PBC controller
20 */
21#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
22/* Offsets for the PBC Controller register */
23/*!
24 * PBC Board status register offset
25 */
26#define PBC_BSTAT 0x000002
27/*!
28 * PBC Board control register 1 set address.
29 */
30#define PBC_BCTRL1_SET 0x000004
31/*!
32 * PBC Board control register 1 clear address.
33 */
34#define PBC_BCTRL1_CLEAR 0x000006
35/*!
36 * PBC Board control register 2 set address.
37 */
38#define PBC_BCTRL2_SET 0x000008
39/*!
40 * PBC Board control register 2 clear address.
41 */
42#define PBC_BCTRL2_CLEAR 0x00000A
43/*!
44 * PBC Board control register 3 set address.
45 */
46#define PBC_BCTRL3_SET 0x00000C
47/*!
48 * PBC Board control register 3 clear address.
49 */
50#define PBC_BCTRL3_CLEAR 0x00000E
51/*!
52 * PBC Board control register 4 set address.
53 */
54#define PBC_BCTRL4_SET 0x000010
55/*!
56 * PBC Board control register 4 clear address.
57 */
58#define PBC_BCTRL4_CLEAR 0x000012
59/*!
60 * PBC Board status register 1.
61 */
62#define PBC_BSTAT1 0x000014
63/*!
64 * PBC Board interrupt status register.
65 */
66#define PBC_INTSTATUS 0x000016
67/*!
68 * PBC Board interrupt current status register.
69 */
70#define PBC_INTCURR_STATUS 0x000018
71/*!
72 * PBC Interrupt mask register set address.
73 */
74#define PBC_INTMASK_SET 0x00001A
75/*!
76 * PBC Interrupt mask register clear address.
77 */
78#define PBC_INTMASK_CLEAR 0x00001C
79
80/*!
81 * External UART A.
82 */
83#define PBC_SC16C652_UARTA 0x010000
84/*!
85 * External UART B.
86 */
87#define PBC_SC16C652_UARTB 0x010010
88/*!
89 * Ethernet Controller IO base address.
90 */
91#define PBC_CS8900A_IOBASE 0x020000
92/*!
93 * Ethernet Controller Memory base address.
94 */
95#define PBC_CS8900A_MEMBASE 0x021000
96/*!
97 * Ethernet Controller DMA base address.
98 */
99#define PBC_CS8900A_DMABASE 0x022000
100/*!
101 * External chip select 0.
102 */
103#define PBC_XCS0 0x040000
104/*!
105 * LCD Display enable.
106 */
107#define PBC_LCD_EN_B 0x060000
108/*!
109 * Code test debug enable.
110 */
111#define PBC_CODE_B 0x070000
112/*!
113 * PSRAM memory select.
114 */
115#define PBC_PSRAM_B 0x5000000
116
117#define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS)
118#define PBC_INTCURR_STATUS_REG (PBC_INTCURR_STATUS + PBC_BASE_ADDRESS)
119#define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS)
120#define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS)
121#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4)
122
123#define EXPIO_INT_LOW_BAT (MXC_EXP_IO_BASE + 0)
124#define EXPIO_INT_PB_IRQ (MXC_EXP_IO_BASE + 1)
125#define EXPIO_INT_OTG_FS_OVR (MXC_EXP_IO_BASE + 2)
126#define EXPIO_INT_FSH_OVR (MXC_EXP_IO_BASE + 3)
127#define EXPIO_INT_RES4 (MXC_EXP_IO_BASE + 4)
128#define EXPIO_INT_RES5 (MXC_EXP_IO_BASE + 5)
129#define EXPIO_INT_RES6 (MXC_EXP_IO_BASE + 6)
130#define EXPIO_INT_RES7 (MXC_EXP_IO_BASE + 7)
131#define EXPIO_INT_ENET_INT (MXC_EXP_IO_BASE + 8)
132#define EXPIO_INT_OTG_FS_INT (MXC_EXP_IO_BASE + 9)
133#define EXPIO_INT_XUART_INTA (MXC_EXP_IO_BASE + 10)
134#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11)
135#define EXPIO_INT_SYNTH_IRQ (MXC_EXP_IO_BASE + 12)
136#define EXPIO_INT_CE_INT1 (MXC_EXP_IO_BASE + 13)
137#define EXPIO_INT_CE_INT2 (MXC_EXP_IO_BASE + 14)
138#define EXPIO_INT_RES15 (MXC_EXP_IO_BASE + 15)
139
140#define MXC_MAX_EXP_IO_LINES 16
141
142#endif /* __ASM_ARCH_MXC_BOARD_MX31ADS_H__ */
diff --git a/include/asm-arm/arch-mxc/common.h b/include/asm-arm/arch-mxc/common.h
new file mode 100644
index 000000000000..23b4350edbd6
--- /dev/null
+++ b/include/asm-arm/arch-mxc/common.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_COMMON_H__
12#define __ASM_ARCH_MXC_COMMON_H__
13
14struct sys_timer;
15
16extern void mxc_map_io(void);
17extern void mxc_init_irq(void);
18extern struct sys_timer mxc_timer;
19
20#endif
diff --git a/include/asm-arm/arch-mxc/dma.h b/include/asm-arm/arch-mxc/dma.h
new file mode 100644
index 000000000000..65e639d51d2b
--- /dev/null
+++ b/include/asm-arm/arch-mxc/dma.h
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_DMA_H__
12#define __ASM_ARCH_MXC_DMA_H__
13
14/*!
15 * @file dma.h
16 * @brief This file contains Unified DMA API for all MXC platforms.
17 * The API is platform independent.
18 *
19 * @ingroup SDMA
20 */
21#endif
diff --git a/include/asm-arm/arch-mxc/entry-macro.S b/include/asm-arm/arch-mxc/entry-macro.S
new file mode 100644
index 000000000000..b542433afb1b
--- /dev/null
+++ b/include/asm-arm/arch-mxc/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 */
5
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 macro disables fast irq (not implemented)
13 .macro disable_fiq
14 .endm
15
16 .macro get_irqnr_preamble, base, tmp
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2
20 .endm
21
22 @ this macro checks which interrupt occured
23 @ and returns its number in irqnr
24 @ and returns if an interrupt occured in irqstat
25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
26 ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
27 @ Load offset & priority of the highest priority
28 @ interrupt pending from AVIC_NIVECSR
29 ldr \irqstat, [\base, #0x40]
30 @ Shift to get the decoded IRQ number, using ASR so
31 @ 'no interrupt pending' becomes 0xffffffff
32 mov \irqnr, \irqstat, asr #16
33 @ set zero flag if IRQ + 1 == 0
34 adds \tmp, \irqnr, #1
35 .endm
36
37 @ irq priority table (not used)
38 .macro irq_prio_table
39 .endm
diff --git a/include/asm-arm/arch-mxc/hardware.h b/include/asm-arm/arch-mxc/hardware.h
new file mode 100644
index 000000000000..3c09b92fef0d
--- /dev/null
+++ b/include/asm-arm/arch-mxc/hardware.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*!
12 * @file hardware.h
13 * @brief This file contains the hardware definitions of the board.
14 *
15 * @ingroup System
16 */
17#ifndef __ASM_ARCH_MXC_HARDWARE_H__
18#define __ASM_ARCH_MXC_HARDWARE_H__
19
20#include <asm/sizes.h>
21
22#include <asm/arch/mx31.h>
23
24#include <asm/arch/mxc.h>
25
26#define MXC_MAX_GPIO_LINES (GPIO_NUM_PIN * GPIO_PORT_NUM)
27
28/*
29 * ---------------------------------------------------------------------------
30 * Board specific defines
31 * ---------------------------------------------------------------------------
32 */
33#define MXC_EXP_IO_BASE (MXC_GPIO_INT_BASE + MXC_MAX_GPIO_LINES)
34
35#include <asm/arch/board-mx31ads.h>
36
37#ifndef MXC_MAX_EXP_IO_LINES
38#define MXC_MAX_EXP_IO_LINES 0
39#endif
40
41#define MXC_MAX_VIRTUAL_INTS 16
42#define MXC_VIRTUAL_INTS_BASE (MXC_EXP_IO_BASE + MXC_MAX_EXP_IO_LINES)
43#define MXC_SDIO1_CARD_IRQ MXC_VIRTUAL_INTS_BASE
44#define MXC_SDIO2_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 1)
45#define MXC_SDIO3_CARD_IRQ (MXC_VIRTUAL_INTS_BASE + 2)
46
47#define MXC_MAX_INTS (MXC_MAX_INT_LINES + \
48 MXC_MAX_GPIO_LINES + \
49 MXC_MAX_EXP_IO_LINES + \
50 MXC_MAX_VIRTUAL_INTS)
51
52#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
diff --git a/include/asm-arm/arch-mxc/io.h b/include/asm-arm/arch-mxc/io.h
new file mode 100644
index 000000000000..cf6c83a4b9f7
--- /dev/null
+++ b/include/asm-arm/arch-mxc/io.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11/*!
12 * @file io.h
13 * @brief This file contains some memory mapping macros.
14 * @note There is no real ISA or PCI buses. But have to define these macros
15 * for some drivers to compile.
16 *
17 * @ingroup System
18 */
19
20#ifndef __ASM_ARCH_MXC_IO_H__
21#define __ASM_ARCH_MXC_IO_H__
22
23/*! Allow IO space to be anywhere in the memory */
24#define IO_SPACE_LIMIT 0xffffffff
25
26/*!
27 * io address mapping macro
28 */
29#define __io(a) ((void __iomem *)(a))
30
31#define __mem_pci(a) (a)
32
33#endif
diff --git a/include/asm-arm/arch-mxc/irqs.h b/include/asm-arm/arch-mxc/irqs.h
new file mode 100644
index 000000000000..e4686c6bc4bf
--- /dev/null
+++ b/include/asm-arm/arch-mxc/irqs.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_IRQS_H__
12#define __ASM_ARCH_MXC_IRQS_H__
13
14#include <asm/hardware.h>
15
16/*!
17 * @file irqs.h
18 * @brief This file defines the number of normal interrupts and fast interrupts
19 *
20 * @ingroup Interrupt
21 */
22
23#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)
24
25#define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_GPIO_INT_BASE)
26#define MXC_GPIO_TO_IRQ(x) (MXC_GPIO_INT_BASE + x)
27
28/*!
29 * Number of normal interrupts
30 */
31#define NR_IRQS MXC_MAX_INTS
32
33/*!
34 * Number of fast interrupts
35 */
36#define NR_FIQS MXC_MAX_INTS
37
38#endif /* __ASM_ARCH_MXC_IRQS_H__ */
diff --git a/include/asm-arm/arch-mxc/memory.h b/include/asm-arm/arch-mxc/memory.h
new file mode 100644
index 000000000000..c89aac83a407
--- /dev/null
+++ b/include/asm-arm/arch-mxc/memory.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_MEMORY_H__
12#define __ASM_ARCH_MXC_MEMORY_H__
13
14#include <asm/hardware.h>
15
16/*!
17 * @file memory.h
18 * @brief This file contains macros needed by the Linux kernel and drivers.
19 *
20 * @ingroup Memory
21 */
22
23/*!
24 * Virtual view <-> DMA view memory address translations
25 * This macro is used to translate the virtual address to an address
26 * suitable to be passed to set_dma_addr()
27 */
28#define __virt_to_bus(a) __virt_to_phys(a)
29
30/*!
31 * Used to convert an address for DMA operations to an address that the
32 * kernel can use.
33 */
34#define __bus_to_virt(a) __phys_to_virt(a)
35
36#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/include/asm-arm/arch-mxc/mx31.h b/include/asm-arm/arch-mxc/mx31.h
new file mode 100644
index 000000000000..85c49c9e5d15
--- /dev/null
+++ b/include/asm-arm/arch-mxc/mx31.h
@@ -0,0 +1,335 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*!
19 * defines the hardware clock tick rate
20 */
21#define CLOCK_TICK_RATE 16625000
22
23/*
24 * MX31 memory map:
25 *
26 * Virt Phys Size What
27 * ---------------------------------------------------------------------------
28 * F8000000 1FFC0000 16K IRAM
29 * F9000000 30000000 256M L2CC
30 * FC000000 43F00000 1M AIPS 1
31 * FC100000 50000000 1M SPBA
32 * FC200000 53F00000 1M AIPS 2
33 * FC500000 60000000 128M ROMPATCH
34 * FC400000 68000000 128M AVIC
35 * 70000000 256M IPU (MAX M2)
36 * 80000000 256M CSD0 SDRAM/DDR
37 * 90000000 256M CSD1 SDRAM/DDR
38 * A0000000 128M CS0 Flash
39 * A8000000 128M CS1 Flash
40 * B0000000 32M CS2
41 * B2000000 32M CS3
42 * F4000000 B4000000 32M CS4
43 * B6000000 32M CS5
44 * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
45 * C0000000 64M PCMCIA/CF
46 */
47
48#define CS0_BASE_ADDR 0xA0000000
49#define CS1_BASE_ADDR 0xA8000000
50#define CS2_BASE_ADDR 0xB0000000
51#define CS3_BASE_ADDR 0xB2000000
52
53#define CS4_BASE_ADDR 0xB4000000
54#define CS4_BASE_ADDR_VIRT 0xF4000000
55#define CS4_SIZE SZ_32M
56
57#define CS5_BASE_ADDR 0xB6000000
58#define PCMCIA_MEM_BASE_ADDR 0xBC000000
59
60/*
61 * IRAM
62 */
63#define IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */
64#define IRAM_BASE_ADDR_VIRT 0xF8000000
65#define IRAM_SIZE SZ_16K
66
67/*
68 * L2CC
69 */
70#define L2CC_BASE_ADDR 0x30000000
71#define L2CC_BASE_ADDR_VIRT 0xF9000000
72#define L2CC_SIZE SZ_1M
73
74/*
75 * AIPS 1
76 */
77#define AIPS1_BASE_ADDR 0x43F00000
78#define AIPS1_BASE_ADDR_VIRT 0xFC000000
79#define AIPS1_SIZE SZ_1M
80
81#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
82#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
83#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
84#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
85#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
86#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
87#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
88#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
89#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
90#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
91#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
92#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
93#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
94#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
95#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
96#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
97#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
98#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
99#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
100#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
101#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
102#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
103
104/*
105 * SPBA global module enabled #0
106 */
107#define SPBA0_BASE_ADDR 0x50000000
108#define SPBA0_BASE_ADDR_VIRT 0xFC100000
109#define SPBA0_SIZE SZ_1M
110
111#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
112#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
113#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
114#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
115#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
116#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000)
117#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000)
118#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
119#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
120#define MSHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
121#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
122
123/*
124 * AIPS 2
125 */
126#define AIPS2_BASE_ADDR 0x53F00000
127#define AIPS2_BASE_ADDR_VIRT 0xFC200000
128#define AIPS2_SIZE SZ_1M
129#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
130#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
131#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000)
132#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
133#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
134#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
135#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
136#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
137#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000)
138#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000)
139#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
140#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
141#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
142#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
143#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
144#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
145#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
146#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
147#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
148#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
149#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
150
151/*
152 * ROMP and AVIC
153 */
154#define ROMP_BASE_ADDR 0x60000000
155#define ROMP_BASE_ADDR_VIRT 0xFC500000
156#define ROMP_SIZE SZ_1M
157
158#define AVIC_BASE_ADDR 0x68000000
159#define AVIC_BASE_ADDR_VIRT 0xFC400000
160#define AVIC_SIZE SZ_1M
161
162/*
163 * NAND, SDRAM, WEIM, M3IF, EMI controllers
164 */
165#define X_MEMC_BASE_ADDR 0xB8000000
166#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
167#define X_MEMC_SIZE SZ_64K
168
169#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000)
170#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
171#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
172#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
173#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
174#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
175
176/*
177 * Memory regions and CS
178 */
179#define IPU_MEM_BASE_ADDR 0x70000000
180#define CSD0_BASE_ADDR 0x80000000
181#define CSD1_BASE_ADDR 0x90000000
182#define CS0_BASE_ADDR 0xA0000000
183#define CS1_BASE_ADDR 0xA8000000
184#define CS2_BASE_ADDR 0xB0000000
185#define CS3_BASE_ADDR 0xB2000000
186
187#define CS4_BASE_ADDR 0xB4000000
188#define CS4_BASE_ADDR_VIRT 0xF4000000
189#define CS4_SIZE SZ_32M
190
191#define CS5_BASE_ADDR 0xB6000000
192#define PCMCIA_MEM_BASE_ADDR 0xBC000000
193
194/*!
195 * This macro defines the physical to virtual address mapping for all the
196 * peripheral modules. It is used by passing in the physical address as x
197 * and returning the virtual address. If the physical address is not mapped,
198 * it returns 0xDEADBEEF
199 */
200#define IO_ADDRESS(x) \
201 (((x >= IRAM_BASE_ADDR) && (x < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x):\
202 ((x >= L2CC_BASE_ADDR) && (x < (L2CC_BASE_ADDR + L2CC_SIZE))) ? L2CC_IO_ADDRESS(x):\
203 ((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
204 ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
205 ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
206 ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
207 ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
208 ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
209 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
210 0xDEADBEEF)
211
212/*
213 * define the address mapping macros: in physical address order
214 */
215
216#define IRAM_IO_ADDRESS(x) \
217 (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT)
218
219#define L2CC_IO_ADDRESS(x) \
220 (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
221
222#define AIPS1_IO_ADDRESS(x) \
223 (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
224
225#define SPBA0_IO_ADDRESS(x) \
226 (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
227
228#define AIPS2_IO_ADDRESS(x) \
229 (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
230
231#define ROMP_IO_ADDRESS(x) \
232 (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
233
234#define AVIC_IO_ADDRESS(x) \
235 (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
236
237#define CS4_IO_ADDRESS(x) \
238 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
239
240#define X_MEMC_IO_ADDRESS(x) \
241 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
242
243#define PCMCIA_IO_ADDRESS(x) \
244 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
245
246/* Start of physical RAM - On many MX31 platforms, this is the first SDRAM bank (CSD0) */
247#define PHYS_OFFSET CSD0_BASE_ADDR
248
249/*
250 * Interrupt numbers
251 */
252#define MXC_INT_PEN_ADS7843 0
253#define MXC_INT_RESV1 1
254#define MXC_INT_CS8900A 2
255#define MXC_INT_I2C3 3
256#define MXC_INT_I2C2 4
257#define MXC_INT_MPEG4_ENCODER 5
258#define MXC_INT_RTIC 6
259#define MXC_INT_FIRI 7
260#define MXC_INT_MMC_SDHC2 8
261#define MXC_INT_MMC_SDHC1 9
262#define MXC_INT_I2C 10
263#define MXC_INT_SSI2 11
264#define MXC_INT_SSI1 12
265#define MXC_INT_CSPI2 13
266#define MXC_INT_CSPI1 14
267#define MXC_INT_ATA 15
268#define MXC_INT_MBX 16
269#define MXC_INT_CSPI3 17
270#define MXC_INT_UART3 18
271#define MXC_INT_IIM 19
272#define MXC_INT_SIM2 20
273#define MXC_INT_SIM1 21
274#define MXC_INT_RNGA 22
275#define MXC_INT_EVTMON 23
276#define MXC_INT_KPP 24
277#define MXC_INT_RTC 25
278#define MXC_INT_PWM 26
279#define MXC_INT_EPIT2 27
280#define MXC_INT_EPIT1 28
281#define MXC_INT_GPT 29
282#define MXC_INT_RESV30 30
283#define MXC_INT_RESV31 31
284#define MXC_INT_UART2 32
285#define MXC_INT_NANDFC 33
286#define MXC_INT_SDMA 34
287#define MXC_INT_USB1 35
288#define MXC_INT_USB2 36
289#define MXC_INT_USB3 37
290#define MXC_INT_USB4 38
291#define MXC_INT_MSHC1 39
292#define MXC_INT_MSHC2 40
293#define MXC_INT_IPU_ERR 41
294#define MXC_INT_IPU_SYN 42
295#define MXC_INT_RESV43 43
296#define MXC_INT_RESV44 44
297#define MXC_INT_UART1 45
298#define MXC_INT_UART4 46
299#define MXC_INT_UART5 47
300#define MXC_INT_ECT 48
301#define MXC_INT_SCC_SCM 49
302#define MXC_INT_SCC_SMN 50
303#define MXC_INT_GPIO2 51
304#define MXC_INT_GPIO1 52
305#define MXC_INT_CCM 53
306#define MXC_INT_PCMCIA 54
307#define MXC_INT_WDOG 55
308#define MXC_INT_GPIO3 56
309#define MXC_INT_RESV57 57
310#define MXC_INT_EXT_POWER 58
311#define MXC_INT_EXT_TEMPER 59
312#define MXC_INT_EXT_SENSOR60 60
313#define MXC_INT_EXT_SENSOR61 61
314#define MXC_INT_EXT_WDOG 62
315#define MXC_INT_EXT_TV 63
316
317#define MXC_MAX_INT_LINES 64
318
319#define MXC_GPIO_INT_BASE MXC_MAX_INT_LINES
320
321/*!
322 * Number of GPIO port as defined in the IC Spec
323 */
324#define GPIO_PORT_NUM 3
325/*!
326 * Number of GPIO pins per port
327 */
328#define GPIO_NUM_PIN 32
329
330#define PROD_SIGNATURE 0x1 /* For MX31 */
331
332#define SYSTEM_REV_MIN CHIP_REV_1_0
333#define SYSTEM_REV_NUM 3
334
335#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/include/asm-arm/arch-mxc/mxc.h b/include/asm-arm/arch-mxc/mxc.h
new file mode 100644
index 000000000000..0837f1f9ca31
--- /dev/null
+++ b/include/asm-arm/arch-mxc/mxc.h
@@ -0,0 +1,149 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
5/*
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MXC_H__
12#define __ASM_ARCH_MXC_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*
19 *****************************************
20 * GPT Register definitions *
21 *****************************************
22 */
23#define MXC_GPT_GPTCR IO_ADDRESS(GPT1_BASE_ADDR + 0x00)
24#define MXC_GPT_GPTPR IO_ADDRESS(GPT1_BASE_ADDR + 0x04)
25#define MXC_GPT_GPTSR IO_ADDRESS(GPT1_BASE_ADDR + 0x08)
26#define MXC_GPT_GPTIR IO_ADDRESS(GPT1_BASE_ADDR + 0x0C)
27#define MXC_GPT_GPTOCR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x10)
28#define MXC_GPT_GPTOCR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x14)
29#define MXC_GPT_GPTOCR3 IO_ADDRESS(GPT1_BASE_ADDR + 0x18)
30#define MXC_GPT_GPTICR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x1C)
31#define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
32#define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
33
34/*!
35 * GPT Control register bit definitions
36 */
37#define GPTCR_FO3 (1 << 31)
38#define GPTCR_FO2 (1 << 30)
39#define GPTCR_FO1 (1 << 29)
40
41#define GPTCR_OM3_SHIFT 26
42#define GPTCR_OM3_MASK (7 << GPTCR_OM3_SHIFT)
43#define GPTCR_OM3_DISCONNECTED (0 << GPTCR_OM3_SHIFT)
44#define GPTCR_OM3_TOGGLE (1 << GPTCR_OM3_SHIFT)
45#define GPTCR_OM3_CLEAR (2 << GPTCR_OM3_SHIFT)
46#define GPTCR_OM3_SET (3 << GPTCR_OM3_SHIFT)
47#define GPTCR_OM3_GENERATE_LOW (7 << GPTCR_OM3_SHIFT)
48
49#define GPTCR_OM2_SHIFT 23
50#define GPTCR_OM2_MASK (7 << GPTCR_OM2_SHIFT)
51#define GPTCR_OM2_DISCONNECTED (0 << GPTCR_OM2_SHIFT)
52#define GPTCR_OM2_TOGGLE (1 << GPTCR_OM2_SHIFT)
53#define GPTCR_OM2_CLEAR (2 << GPTCR_OM2_SHIFT)
54#define GPTCR_OM2_SET (3 << GPTCR_OM2_SHIFT)
55#define GPTCR_OM2_GENERATE_LOW (7 << GPTCR_OM2_SHIFT)
56
57#define GPTCR_OM1_SHIFT 20
58#define GPTCR_OM1_MASK (7 << GPTCR_OM1_SHIFT)
59#define GPTCR_OM1_DISCONNECTED (0 << GPTCR_OM1_SHIFT)
60#define GPTCR_OM1_TOGGLE (1 << GPTCR_OM1_SHIFT)
61#define GPTCR_OM1_CLEAR (2 << GPTCR_OM1_SHIFT)
62#define GPTCR_OM1_SET (3 << GPTCR_OM1_SHIFT)
63#define GPTCR_OM1_GENERATE_LOW (7 << GPTCR_OM1_SHIFT)
64
65#define GPTCR_IM2_SHIFT 18
66#define GPTCR_IM2_MASK (3 << GPTCR_IM2_SHIFT)
67#define GPTCR_IM2_CAPTURE_DISABLE (0 << GPTCR_IM2_SHIFT)
68#define GPTCR_IM2_CAPTURE_RISING (1 << GPTCR_IM2_SHIFT)
69#define GPTCR_IM2_CAPTURE_FALLING (2 << GPTCR_IM2_SHIFT)
70#define GPTCR_IM2_CAPTURE_BOTH (3 << GPTCR_IM2_SHIFT)
71
72#define GPTCR_IM1_SHIFT 16
73#define GPTCR_IM1_MASK (3 << GPTCR_IM1_SHIFT)
74#define GPTCR_IM1_CAPTURE_DISABLE (0 << GPTCR_IM1_SHIFT)
75#define GPTCR_IM1_CAPTURE_RISING (1 << GPTCR_IM1_SHIFT)
76#define GPTCR_IM1_CAPTURE_FALLING (2 << GPTCR_IM1_SHIFT)
77#define GPTCR_IM1_CAPTURE_BOTH (3 << GPTCR_IM1_SHIFT)
78
79#define GPTCR_SWR (1 << 15)
80#define GPTCR_FRR (1 << 9)
81
82#define GPTCR_CLKSRC_SHIFT 6
83#define GPTCR_CLKSRC_MASK (7 << GPTCR_CLKSRC_SHIFT)
84#define GPTCR_CLKSRC_NOCLOCK (0 << GPTCR_CLKSRC_SHIFT)
85#define GPTCR_CLKSRC_HIGHFREQ (2 << GPTCR_CLKSRC_SHIFT)
86#define GPTCR_CLKSRC_CLKIN (3 << GPTCR_CLKSRC_SHIFT)
87#define GPTCR_CLKSRC_CLK32K (7 << GPTCR_CLKSRC_SHIFT)
88
89#define GPTCR_STOPEN (1 << 5)
90#define GPTCR_DOZEN (1 << 4)
91#define GPTCR_WAITEN (1 << 3)
92#define GPTCR_DBGEN (1 << 2)
93
94#define GPTCR_ENMOD (1 << 1)
95#define GPTCR_ENABLE (1 << 0)
96
97#define GPTSR_OF1 (1 << 0)
98#define GPTSR_OF2 (1 << 1)
99#define GPTSR_OF3 (1 << 2)
100#define GPTSR_IF1 (1 << 3)
101#define GPTSR_IF2 (1 << 4)
102#define GPTSR_ROV (1 << 5)
103
104#define GPTIR_OF1IE GPTSR_OF1
105#define GPTIR_OF2IE GPTSR_OF2
106#define GPTIR_OF3IE GPTSR_OF3
107#define GPTIR_IF1IE GPTSR_IF1
108#define GPTIR_IF2IE GPTSR_IF2
109#define GPTIR_ROVIE GPTSR_ROV
110
111/*
112 *****************************************
113 * AVIC Registers *
114 *****************************************
115 */
116#define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
117#define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
118#define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */
119#define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */
120#define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */
121#define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */
122#define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */
123#define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */
124#define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */
125#define AVIC_NIPRIORITY7 (AVIC_BASE + 0x20) /* norm int priority lvl7 */
126#define AVIC_NIPRIORITY6 (AVIC_BASE + 0x24) /* norm int priority lvl6 */
127#define AVIC_NIPRIORITY5 (AVIC_BASE + 0x28) /* norm int priority lvl5 */
128#define AVIC_NIPRIORITY4 (AVIC_BASE + 0x2C) /* norm int priority lvl4 */
129#define AVIC_NIPRIORITY3 (AVIC_BASE + 0x30) /* norm int priority lvl3 */
130#define AVIC_NIPRIORITY2 (AVIC_BASE + 0x34) /* norm int priority lvl2 */
131#define AVIC_NIPRIORITY1 (AVIC_BASE + 0x38) /* norm int priority lvl1 */
132#define AVIC_NIPRIORITY0 (AVIC_BASE + 0x3C) /* norm int priority lvl0 */
133#define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */
134#define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */
135#define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */
136#define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */
137#define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */
138#define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */
139#define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */
140#define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */
141#define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */
142#define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */
143
144#define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
145#define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
146#define IIM_PROD_REV_SH 3
147#define IIM_PROD_REV_LEN 5
148
149#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/include/asm-arm/arch-mxc/system.h b/include/asm-arm/arch-mxc/system.h
new file mode 100644
index 000000000000..109956b41aca
--- /dev/null
+++ b/include/asm-arm/arch-mxc/system.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __ASM_ARCH_MXC_SYSTEM_H__
22#define __ASM_ARCH_MXC_SYSTEM_H__
23
24/*!
25 * @file system.h
26 * @brief This file contains idle and reset functions.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * This function puts the CPU into idle mode. It is called by default_idle()
33 * in process.c file.
34 */
35static inline void arch_idle(void)
36{
37 cpu_do_idle();
38}
39
40/*
41 * This function resets the system. It is called by machine_restart().
42 *
43 * @param mode indicates different kinds of resets
44 */
45static inline void arch_reset(char mode)
46{
47 cpu_reset(0);
48}
49
50#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/include/asm-arm/arch-mxc/timex.h b/include/asm-arm/arch-mxc/timex.h
new file mode 100644
index 000000000000..59019fa58f82
--- /dev/null
+++ b/include/asm-arm/arch-mxc/timex.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_MXC_TIMEX_H__
21#define __ASM_ARCH_MXC_TIMEX_H__
22
23#include <asm/hardware.h> /* for CLOCK_TICK_RATE */
24
25#endif /* __ASM_ARCH_MXC_TIMEX_H__ */
diff --git a/include/asm-arm/arch-mxc/uncompress.h b/include/asm-arm/arch-mxc/uncompress.h
new file mode 100644
index 000000000000..ec5787d0e78c
--- /dev/null
+++ b/include/asm-arm/arch-mxc/uncompress.h
@@ -0,0 +1,79 @@
1/*
2 * include/asm-arm/arch-mxc/uncompress.h
3 *
4 *
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) Shane Nay (shane@minirl.com)
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#ifndef __ASM_ARCH_MXC_UNCOMPRESS_H__
24#define __ASM_ARCH_MXC_UNCOMPRESS_H__
25
26#define __MXC_BOOT_UNCOMPRESS
27
28#include <asm/hardware.h>
29#include <asm/processor.h>
30
31#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
32
33#define USR2 0x98
34#define USR2_TXFE (1<<14)
35#define TXR 0x40
36#define UCR1 0x80
37#define UCR1_UARTEN 1
38
39/*
40 * The following code assumes the serial port has already been
41 * initialized by the bootloader. We search for the first enabled
42 * port in the most probable order. If you didn't setup a port in
43 * your bootloader then nothing will appear (which might be desired).
44 *
45 * This does not append a newline
46 */
47
48static void putc(int ch)
49{
50 static unsigned long serial_port = 0;
51
52 if (unlikely(serial_port == 0)) {
53 do {
54 serial_port = UART1_BASE_ADDR;
55 if (UART(UCR1) & UCR1_UARTEN)
56 break;
57 serial_port = UART2_BASE_ADDR;
58 if (UART(UCR1) & UCR1_UARTEN)
59 break;
60 return;
61 } while (0);
62 }
63
64 while (!(UART(USR2) & USR2_TXFE))
65 cpu_relax();
66
67 UART(TXR) = ch;
68}
69
70#define flush() do { } while (0)
71
72/*
73 * nothing to do
74 */
75#define arch_decomp_setup()
76
77#define arch_decomp_wdog()
78
79#endif /* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/include/asm-arm/arch-mxc/vmalloc.h b/include/asm-arm/arch-mxc/vmalloc.h
new file mode 100644
index 000000000000..83a73da895eb
--- /dev/null
+++ b/include/asm-arm/arch-mxc/vmalloc.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2000 Russell King.
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_ARCH_MXC_VMALLOC_H__
21#define __ASM_ARCH_MXC_VMALLOC_H__
22
23/*!
24 * @file vmalloc.h
25 *
26 * @brief This file contains platform specific macros for vmalloc.
27 *
28 * @ingroup System
29 */
30
31/*!
32 * vmalloc ending address
33 */
34#define VMALLOC_END 0xF4000000
35
36#endif /* __ASM_ARCH_MXC_VMALLOC_H__ */
diff --git a/include/asm-arm/arch-ns9xxx/regs-bbu.h b/include/asm-arm/arch-ns9xxx/regs-bbu.h
index e26269546240..7ee194dc6354 100644
--- a/include/asm-arm/arch-ns9xxx/regs-bbu.h
+++ b/include/asm-arm/arch-ns9xxx/regs-bbu.h
@@ -15,7 +15,31 @@
15 15
16/* BBus Utility */ 16/* BBus Utility */
17 17
18/* GPIO Configuration Register */ 18/* GPIO Configuration Registers block 1 */
19#define BBU_GC(x) __REG2(0x9060000c, (x)) 19/* NOTE: the HRM starts counting at 1 for the GPIO registers, here the start is
20 * at 0 for each block. That is, BBU_GCONFb1(0) is GPIO Configuration Register
21 * #1, BBU_GCONFb2(0) is GPIO Configuration Register #8. */
22#define BBU_GCONFb1(x) __REG2(0x90600010, (x))
23#define BBU_GCONFb2(x) __REG2(0x90600100, (x))
24
25#define BBU_GCONFx_DIR(m) __REGBIT(3 + (((m) & 7) << 2))
26#define BBU_GCONFx_DIR_INPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 0)
27#define BBU_GCONFx_DIR_OUTPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 1)
28#define BBU_GCONFx_INV(m) __REGBIT(2 + (((m) & 7) << 2))
29#define BBU_GCONFx_INV_NO(m) __REGVAL(BBU_GCONFx_INV(m), 0)
30#define BBU_GCONFx_INV_YES(m) __REGVAL(BBU_GCONFx_INV(m), 1)
31#define BBU_GCONFx_FUNC(m) __REGBITS(1 + (((m) & 7) << 2), ((m) & 7) << 2)
32#define BBU_GCONFx_FUNC_0(m) __REGVAL(BBU_GCONFx_FUNC(m), 0)
33#define BBU_GCONFx_FUNC_1(m) __REGVAL(BBU_GCONFx_FUNC(m), 1)
34#define BBU_GCONFx_FUNC_2(m) __REGVAL(BBU_GCONFx_FUNC(m), 2)
35#define BBU_GCONFx_FUNC_3(m) __REGVAL(BBU_GCONFx_FUNC(m), 3)
36
37#define BBU_GCTRL1 __REG(0x90600030)
38#define BBU_GCTRL2 __REG(0x90600034)
39#define BBU_GCTRL3 __REG(0x90600120)
40
41#define BBU_GSTAT1 __REG(0x90600040)
42#define BBU_GSTAT2 __REG(0x90600044)
43#define BBU_GSTAT3 __REG(0x90600130)
20 44
21#endif /* ifndef __ASM_ARCH_REGSBBU_H */ 45#endif /* ifndef __ASM_ARCH_REGSBBU_H */
diff --git a/include/asm-arm/arch-ns9xxx/regs-mem.h b/include/asm-arm/arch-ns9xxx/regs-mem.h
index 8ed8448767b9..fb455a0ed845 100644
--- a/include/asm-arm/arch-ns9xxx/regs-mem.h
+++ b/include/asm-arm/arch-ns9xxx/regs-mem.h
@@ -79,9 +79,9 @@
79#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3) 79#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3)
80 80
81/* Static Memory Configuration Register x: Write protect */ 81/* Static Memory Configuration Register x: Write protect */
82#define MEM_SMC_WSMC __REGBIT(20) 82#define MEM_SMC_PSMC __REGBIT(20)
83#define MEM_SMC_WSMC_OFF __REGVAL(MEM_SMC_WSMC, 0) 83#define MEM_SMC_PSMC_OFF __REGVAL(MEM_SMC_PSMC, 0)
84#define MEM_SMC_WSMC_ON __REGVAL(MEM_SMC_WSMC, 1) 84#define MEM_SMC_PSMC_ON __REGVAL(MEM_SMC_PSMC, 1)
85 85
86/* Static Memory Configuration Register x: Buffer enable */ 86/* Static Memory Configuration Register x: Buffer enable */
87#define MEM_SMC_BSMC __REGBIT(19) 87#define MEM_SMC_BSMC __REGBIT(19)
diff --git a/include/asm-arm/arch-ns9xxx/regs-sys.h b/include/asm-arm/arch-ns9xxx/regs-sys.h
index a42546aeb92a..749262f86204 100644
--- a/include/asm-arm/arch-ns9xxx/regs-sys.h
+++ b/include/asm-arm/arch-ns9xxx/regs-sys.h
@@ -64,7 +64,7 @@
64 64
65/* Timer x Control register: Timer enable */ 65/* Timer x Control register: Timer enable */
66#define SYS_TCx_TEN __REGBIT(15) 66#define SYS_TCx_TEN __REGBIT(15)
67#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 1) 67#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 0)
68#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1) 68#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1)
69 69
70/* Timer x Control register: CPU debug mode */ 70/* Timer x Control register: CPU debug mode */
diff --git a/include/asm-arm/arch-s3c2400/map.h b/include/asm-arm/arch-s3c2400/map.h
new file mode 100644
index 000000000000..1184d907b31e
--- /dev/null
+++ b/include/asm-arm/arch-s3c2400/map.h
@@ -0,0 +1,66 @@
1/* linux/include/asm-arm/arch-s3c2400/map.h
2 *
3 * Copyright 2003,2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Copyright 2003, Lucas Correia Villa Real
8 *
9 * S3C2400 - Memory map definitions
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#define S3C2400_PA_MEMCTRL (0x14000000)
17#define S3C2400_PA_USBHOST (0x14200000)
18#define S3C2400_PA_IRQ (0x14400000)
19#define S3C2400_PA_DMA (0x14600000)
20#define S3C2400_PA_CLKPWR (0x14800000)
21#define S3C2400_PA_LCD (0x14A00000)
22#define S3C2400_PA_UART (0x15000000)
23#define S3C2400_PA_TIMER (0x15100000)
24#define S3C2400_PA_USBDEV (0x15200140)
25#define S3C2400_PA_WATCHDOG (0x15300000)
26#define S3C2400_PA_IIC (0x15400000)
27#define S3C2400_PA_IIS (0x15508000)
28#define S3C2400_PA_GPIO (0x15600000)
29#define S3C2400_PA_RTC (0x15700040)
30#define S3C2400_PA_ADC (0x15800000)
31#define S3C2400_PA_SPI (0x15900000)
32
33#define S3C2400_PA_MMC (0x15A00000)
34#define S3C2400_SZ_MMC SZ_1M
35
36/* physical addresses of all the chip-select areas */
37
38#define S3C2400_CS0 (0x00000000)
39#define S3C2400_CS1 (0x02000000)
40#define S3C2400_CS2 (0x04000000)
41#define S3C2400_CS3 (0x06000000)
42#define S3C2400_CS4 (0x08000000)
43#define S3C2400_CS5 (0x0A000000)
44#define S3C2400_CS6 (0x0C000000)
45#define S3C2400_CS7 (0x0E000000)
46
47#define S3C2400_SDRAM_PA (S3C2400_CS6)
48
49/* Use a single interface for common resources between S3C24XX cpus */
50
51#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
52#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
53#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
54#define S3C24XX_PA_DMA S3C2400_PA_DMA
55#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
56#define S3C24XX_PA_LCD S3C2400_PA_LCD
57#define S3C24XX_PA_UART S3C2400_PA_UART
58#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
59#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
60#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
61#define S3C24XX_PA_IIC S3C2400_PA_IIC
62#define S3C24XX_PA_IIS S3C2400_PA_IIS
63#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
64#define S3C24XX_PA_RTC S3C2400_PA_RTC
65#define S3C24XX_PA_ADC S3C2400_PA_ADC
66#define S3C24XX_PA_SPI S3C2400_PA_SPI
diff --git a/include/asm-arm/arch-s3c2400/memory.h b/include/asm-arm/arch-s3c2400/memory.h
new file mode 100644
index 000000000000..fb0381dde704
--- /dev/null
+++ b/include/asm-arm/arch-s3c2400/memory.h
@@ -0,0 +1,23 @@
1/* linux/include/asm-arm/arch-s3c2400/memory.h
2 * from linux/include/asm-arm/arch-rpc/memory.h
3 *
4 * Copyright 2007 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * Copyright (C) 1996,1997,1998 Russell King.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_MEMORY_H
16#define __ASM_ARCH_MEMORY_H
17
18#define PHYS_OFFSET UL(0x0C000000)
19
20#define __virt_to_bus(x) __virt_to_phys(x)
21#define __bus_to_virt(x) __phys_to_virt(x)
22
23#endif
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S
index 93064860e0e5..9c8cd9abb82b 100644
--- a/include/asm-arm/arch-s3c2410/debug-macro.S
+++ b/include/asm-arm/arch-s3c2410/debug-macro.S
@@ -13,32 +13,23 @@
13*/ 13*/
14 14
15#include <asm/arch/map.h> 15#include <asm/arch/map.h>
16#include <asm/arch/regs-serial.h>
17#include <asm/arch/regs-gpio.h> 16#include <asm/arch/regs-gpio.h>
17#include <asm/plat-s3c/regs-serial.h>
18 18
19#define S3C2410_UART1_OFF (0x4000) 19#define S3C2410_UART1_OFF (0x4000)
20#define SHIFT_2440TXF (14-9) 20#define SHIFT_2440TXF (14-9)
21 21
22 .macro addruart, rx 22 .macro addruart, rx
23 mrc p15, 0, \rx, c1, c0 23 mrc p15, 0, \rx, c1, c0
24 tst \rx, #1 24 tst \rx, #1
25 ldreq \rx, = S3C24XX_PA_UART 25 ldreq \rx, = S3C24XX_PA_UART
26 ldrne \rx, = S3C24XX_VA_UART 26 ldrne \rx, = S3C24XX_VA_UART
27#if CONFIG_DEBUG_S3C2410_UART != 0 27#if CONFIG_DEBUG_S3C_UART != 0
28 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) 28 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART)
29#endif 29#endif
30 .endm 30 .endm
31 31
32 .macro senduart,rd,rx 32 .macro fifo_full_s3c24xx rd, rx
33 strb \rd, [\rx, # S3C2410_UTXH ]
34 .endm
35
36 .macro busyuart, rd, rx
37 ldr \rd, [ \rx, # S3C2410_UFCON ]
38 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
39 beq 1001f @
40 @ FIFO enabled...
411003:
42 @ check for arm920 vs arm926. currently assume all arm926 33 @ check for arm920 vs arm926. currently assume all arm926
43 @ devices have an 64 byte FIFO identical to the s3c2440 34 @ devices have an 64 byte FIFO identical to the s3c2440
44 mrc p15, 0, \rd, c0, c0 35 mrc p15, 0, \rd, c0, c0
@@ -57,25 +48,22 @@
57 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 48 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
58 moveq \rd, \rd, lsr #SHIFT_2440TXF 49 moveq \rd, \rd, lsr #SHIFT_2440TXF
59 tst \rd, #S3C2410_UFSTAT_TXFULL 50 tst \rd, #S3C2410_UFSTAT_TXFULL
60 bne 1003b 51 .endm
61 b 1002f
62
631001:
64 @ busy waiting for non fifo
65 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
66 tst \rd, #S3C2410_UTRSTAT_TXFE
67 beq 1001b
68 52
691002: @ exit busyuart 53 .macro fifo_full_s3c2410 rd, rx
70 .endm 54 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
55 tst \rd, #S3C2410_UFSTAT_TXFULL
56 .endm
71 57
72 .macro waituart,rd,rx 58/* fifo level reading */
73 59
74 ldr \rd, [ \rx, # S3C2410_UFCON ] 60 .macro fifo_level_s3c24xx rd, rx
75 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? 61 @ check for arm920 vs arm926. currently assume all arm926
76 beq 1001f @ 62 @ devices have an 64 byte FIFO identical to the s3c2440
77 @ FIFO enabled... 63 mrc p15, 0, \rd, c0, c0
781003: 64 and \rd, \rd, #0xff0
65 teq \rd, #0x260
66 beq 10000f
79 mrc p15, 0, \rd, c1, c0 67 mrc p15, 0, \rd, c1, c0
80 tst \rd, #1 68 tst \rd, #1
81 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) 69 addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART)
@@ -85,18 +73,32 @@
85 and \rd, \rd, #0x00ff0000 73 and \rd, \rd, #0x00ff0000
86 teq \rd, #0x00440000 @ is it 2440? 74 teq \rd, #0x00440000 @ is it 2440?
87 75
7610000:
88 ldr \rd, [ \rx, # S3C2410_UFSTAT ] 77 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
89 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK 78 andne \rd, \rd, #S3C2410_UFSTAT_TXMASK
90 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK 79 andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK
91 teq \rd, #0 80 .endm
92 bne 1003b 81
93 b 1002f 82 .macro fifo_level_s3c2410 rd, rx
83 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
84 and \rd, \rd, #S3C2410_UFSTAT_TXMASK
85 .endm
86
87/* Select the correct implementation depending on the configuration. The
88 * S3C2440 will get selected by default, as these are the most widely
89 * used variants of these
90*/
91
92#if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY)
93#define fifo_full fifo_full_s3c2410
94#define fifo_level fifo_level_s3c2410
95#warning 2410only
96#elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY)
97#define fifo_full fifo_full_s3c24xx
98#define fifo_level fifo_level_s3c24xx
99#warning generic
100#endif
94 101
951001: 102/* include the reset of the code which will do the work */
96 @ idle waiting for non fifo
97 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
98 tst \rd, #S3C2410_UTRSTAT_TXFE
99 beq 1001b
100 103
1011002: @ exit busyuart 104#include <asm/plat-s3c/debug-macro.S>
102 .endm
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h
index 19e77f038042..b33ed3b05ef5 100644
--- a/include/asm-arm/arch-s3c2410/map.h
+++ b/include/asm-arm/arch-s3c2410/map.h
@@ -13,58 +13,36 @@
13#ifndef __ASM_ARCH_MAP_H 13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H 14#define __ASM_ARCH_MAP_H
15 15
16/* we have a bit of a tight squeeze to fit all our registers from 16#include <asm/plat-s3c/map.h>
17 * 0xF00000000 upwards, since we use all of the nGCS space in some
18 * capacity, and also need to fit the S3C2410 registers in as well...
19 *
20 * we try to ensure stuff like the IRQ registers are available for
21 * an single MOVS instruction (ie, only 8 bits of set data)
22 *
23 * Note, we are trying to remove some of these from the implementation
24 * as they are only useful to certain drivers...
25 */
26
27#ifndef __ASSEMBLY__
28#define S3C2410_ADDR(x) ((void __iomem __force *)0xF0000000 + (x))
29#else
30#define S3C2410_ADDR(x) (0xF0000000 + (x))
31#endif
32 17
33#define S3C2400_ADDR(x) S3C2410_ADDR(x) 18#define S3C2410_ADDR(x) S3C_ADDR(x)
34 19
35/* interrupt controller is the first thing we put in, to make 20/* interrupt controller is the first thing we put in, to make
36 * the assembly code for the irq detection easier 21 * the assembly code for the irq detection easier
37 */ 22 */
38#define S3C24XX_VA_IRQ S3C2410_ADDR(0x00000000) 23#define S3C24XX_VA_IRQ S3C_VA_IRQ
39#define S3C2400_PA_IRQ (0x14400000)
40#define S3C2410_PA_IRQ (0x4A000000) 24#define S3C2410_PA_IRQ (0x4A000000)
41#define S3C24XX_SZ_IRQ SZ_1M 25#define S3C24XX_SZ_IRQ SZ_1M
42 26
43/* memory controller registers */ 27/* memory controller registers */
44#define S3C24XX_VA_MEMCTRL S3C2410_ADDR(0x00100000) 28#define S3C24XX_VA_MEMCTRL S3C_VA_MEM
45#define S3C2400_PA_MEMCTRL (0x14000000)
46#define S3C2410_PA_MEMCTRL (0x48000000) 29#define S3C2410_PA_MEMCTRL (0x48000000)
47#define S3C24XX_SZ_MEMCTRL SZ_1M 30#define S3C24XX_SZ_MEMCTRL SZ_1M
48 31
49/* USB host controller */ 32/* USB host controller */
50#define S3C2400_PA_USBHOST (0x14200000)
51#define S3C2410_PA_USBHOST (0x49000000) 33#define S3C2410_PA_USBHOST (0x49000000)
52#define S3C24XX_SZ_USBHOST SZ_1M 34#define S3C24XX_SZ_USBHOST SZ_1M
53 35
54/* DMA controller */ 36/* DMA controller */
55#define S3C2400_PA_DMA (0x14600000)
56#define S3C2410_PA_DMA (0x4B000000) 37#define S3C2410_PA_DMA (0x4B000000)
57#define S3C24XX_SZ_DMA SZ_1M 38#define S3C24XX_SZ_DMA SZ_1M
58 39
59/* Clock and Power management */ 40/* Clock and Power management */
60#define S3C24XX_VA_CLKPWR S3C2410_ADDR(0x00200000) 41#define S3C24XX_VA_CLKPWR S3C_VA_SYS
61#define S3C2400_PA_CLKPWR (0x14800000)
62#define S3C2410_PA_CLKPWR (0x4C000000) 42#define S3C2410_PA_CLKPWR (0x4C000000)
63#define S3C24XX_SZ_CLKPWR SZ_1M 43#define S3C24XX_SZ_CLKPWR SZ_1M
64 44
65/* LCD controller */ 45/* LCD controller */
66#define S3C24XX_VA_LCD S3C2410_ADDR(0x00300000)
67#define S3C2400_PA_LCD (0x14A00000)
68#define S3C2410_PA_LCD (0x4D000000) 46#define S3C2410_PA_LCD (0x4D000000)
69#define S3C24XX_SZ_LCD SZ_1M 47#define S3C24XX_SZ_LCD SZ_1M
70 48
@@ -72,41 +50,30 @@
72#define S3C2410_PA_NAND (0x4E000000) 50#define S3C2410_PA_NAND (0x4E000000)
73#define S3C24XX_SZ_NAND SZ_1M 51#define S3C24XX_SZ_NAND SZ_1M
74 52
75/* MMC controller - available on the S3C2400 */
76#define S3C2400_PA_MMC (0x15A00000)
77#define S3C2400_SZ_MMC SZ_1M
78
79/* UARTs */ 53/* UARTs */
80#define S3C24XX_VA_UART S3C2410_ADDR(0x00400000) 54#define S3C24XX_VA_UART S3C_VA_UART
81#define S3C2400_PA_UART (0x15000000)
82#define S3C2410_PA_UART (0x50000000) 55#define S3C2410_PA_UART (0x50000000)
83#define S3C24XX_SZ_UART SZ_1M 56#define S3C24XX_SZ_UART SZ_1M
84 57
85/* Timers */ 58/* Timers */
86#define S3C24XX_VA_TIMER S3C2410_ADDR(0x00500000) 59#define S3C24XX_VA_TIMER S3C_VA_TIMER
87#define S3C2400_PA_TIMER (0x15100000)
88#define S3C2410_PA_TIMER (0x51000000) 60#define S3C2410_PA_TIMER (0x51000000)
89#define S3C24XX_SZ_TIMER SZ_1M 61#define S3C24XX_SZ_TIMER SZ_1M
90 62
91/* USB Device port */ 63/* USB Device port */
92#define S3C24XX_VA_USBDEV S3C2410_ADDR(0x00600000)
93#define S3C2400_PA_USBDEV (0x15200140)
94#define S3C2410_PA_USBDEV (0x52000000) 64#define S3C2410_PA_USBDEV (0x52000000)
95#define S3C24XX_SZ_USBDEV SZ_1M 65#define S3C24XX_SZ_USBDEV SZ_1M
96 66
97/* Watchdog */ 67/* Watchdog */
98#define S3C24XX_VA_WATCHDOG S3C2410_ADDR(0x00700000) 68#define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG
99#define S3C2400_PA_WATCHDOG (0x15300000)
100#define S3C2410_PA_WATCHDOG (0x53000000) 69#define S3C2410_PA_WATCHDOG (0x53000000)
101#define S3C24XX_SZ_WATCHDOG SZ_1M 70#define S3C24XX_SZ_WATCHDOG SZ_1M
102 71
103/* IIC hardware controller */ 72/* IIC hardware controller */
104#define S3C2400_PA_IIC (0x15400000)
105#define S3C2410_PA_IIC (0x54000000) 73#define S3C2410_PA_IIC (0x54000000)
106#define S3C24XX_SZ_IIC SZ_1M 74#define S3C24XX_SZ_IIC SZ_1M
107 75
108/* IIS controller */ 76/* IIS controller */
109#define S3C2400_PA_IIS (0x15508000)
110#define S3C2410_PA_IIS (0x55000000) 77#define S3C2410_PA_IIS (0x55000000)
111#define S3C24XX_SZ_IIS SZ_1M 78#define S3C24XX_SZ_IIS SZ_1M
112 79
@@ -116,27 +83,23 @@
116 * it is the same distance apart from the UART in the 83 * it is the same distance apart from the UART in the
117 * phsyical address space, as the initial mapping for the IO 84 * phsyical address space, as the initial mapping for the IO
118 * is done as a 1:1 maping. This puts it (currently) at 85 * is done as a 1:1 maping. This puts it (currently) at
119 * 0xF6800000, which is not in the way of any current mapping 86 * 0xFA800000, which is not in the way of any current mapping
120 * by the base system. 87 * by the base system.
121*/ 88*/
122 89
123#define S3C2400_PA_GPIO (0x15600000)
124#define S3C2410_PA_GPIO (0x56000000) 90#define S3C2410_PA_GPIO (0x56000000)
125#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART) 91#define S3C24XX_VA_GPIO ((S3C2410_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)
126#define S3C24XX_SZ_GPIO SZ_1M 92#define S3C24XX_SZ_GPIO SZ_1M
127 93
128/* RTC */ 94/* RTC */
129#define S3C2400_PA_RTC (0x15700040)
130#define S3C2410_PA_RTC (0x57000000) 95#define S3C2410_PA_RTC (0x57000000)
131#define S3C24XX_SZ_RTC SZ_1M 96#define S3C24XX_SZ_RTC SZ_1M
132 97
133/* ADC */ 98/* ADC */
134#define S3C2400_PA_ADC (0x15800000)
135#define S3C2410_PA_ADC (0x58000000) 99#define S3C2410_PA_ADC (0x58000000)
136#define S3C24XX_SZ_ADC SZ_1M 100#define S3C24XX_SZ_ADC SZ_1M
137 101
138/* SPI */ 102/* SPI */
139#define S3C2400_PA_SPI (0x15900000)
140#define S3C2410_PA_SPI (0x59000000) 103#define S3C2410_PA_SPI (0x59000000)
141#define S3C24XX_SZ_SPI SZ_1M 104#define S3C24XX_SZ_SPI SZ_1M
142 105
@@ -177,37 +140,8 @@
177 140
178#define S3C2410_SDRAM_PA (S3C2410_CS6) 141#define S3C2410_SDRAM_PA (S3C2410_CS6)
179 142
180#define S3C2400_CS0 (0x00000000)
181#define S3C2400_CS1 (0x02000000)
182#define S3C2400_CS2 (0x04000000)
183#define S3C2400_CS3 (0x06000000)
184#define S3C2400_CS4 (0x08000000)
185#define S3C2400_CS5 (0x0A000000)
186#define S3C2400_CS6 (0x0C000000)
187#define S3C2400_CS7 (0x0E000000)
188
189#define S3C2400_SDRAM_PA (S3C2400_CS6)
190
191/* Use a single interface for common resources between S3C24XX cpus */ 143/* Use a single interface for common resources between S3C24XX cpus */
192 144
193#ifdef CONFIG_CPU_S3C2400
194#define S3C24XX_PA_IRQ S3C2400_PA_IRQ
195#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL
196#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST
197#define S3C24XX_PA_DMA S3C2400_PA_DMA
198#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR
199#define S3C24XX_PA_LCD S3C2400_PA_LCD
200#define S3C24XX_PA_UART S3C2400_PA_UART
201#define S3C24XX_PA_TIMER S3C2400_PA_TIMER
202#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV
203#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG
204#define S3C24XX_PA_IIC S3C2400_PA_IIC
205#define S3C24XX_PA_IIS S3C2400_PA_IIS
206#define S3C24XX_PA_GPIO S3C2400_PA_GPIO
207#define S3C24XX_PA_RTC S3C2400_PA_RTC
208#define S3C24XX_PA_ADC S3C2400_PA_ADC
209#define S3C24XX_PA_SPI S3C2400_PA_SPI
210#else
211#define S3C24XX_PA_IRQ S3C2410_PA_IRQ 145#define S3C24XX_PA_IRQ S3C2410_PA_IRQ
212#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL 146#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL
213#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST 147#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST
@@ -224,7 +158,6 @@
224#define S3C24XX_PA_RTC S3C2410_PA_RTC 158#define S3C24XX_PA_RTC S3C2410_PA_RTC
225#define S3C24XX_PA_ADC S3C2410_PA_ADC 159#define S3C24XX_PA_ADC S3C2410_PA_ADC
226#define S3C24XX_PA_SPI S3C2410_PA_SPI 160#define S3C24XX_PA_SPI S3C2410_PA_SPI
227#endif
228 161
229/* deal with the registers that move under the 2412/2413 */ 162/* deal with the registers that move under the 2412/2413 */
230 163
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h
index 4be6a74c4303..533e2436e707 100644
--- a/include/asm-arm/arch-s3c2410/memory.h
+++ b/include/asm-arm/arch-s3c2410/memory.h
@@ -11,20 +11,7 @@
11#ifndef __ASM_ARCH_MEMORY_H 11#ifndef __ASM_ARCH_MEMORY_H
12#define __ASM_ARCH_MEMORY_H 12#define __ASM_ARCH_MEMORY_H
13 13
14/*
15 * DRAM starts at 0x30000000 for S3C2410/S3C2440
16 * and at 0x0C000000 for S3C2400
17 */
18#ifdef CONFIG_CPU_S3C2400
19#define PHYS_OFFSET UL(0x0C000000)
20#else
21#define PHYS_OFFSET UL(0x30000000) 14#define PHYS_OFFSET UL(0x30000000)
22#endif
23
24/*
25 * These are exactly the same on the S3C2410 as the
26 * physical memory view.
27*/
28 15
29#define __virt_to_bus(x) __virt_to_phys(x) 16#define __virt_to_bus(x) __virt_to_phys(x)
30#define __bus_to_virt(x) __phys_to_virt(x) 17#define __bus_to_virt(x) __phys_to_virt(x)
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index b7faeb04c0ff..76fe5f693426 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -12,7 +12,7 @@
12#ifndef ___ASM_ARCH_REGS_LCD_H 12#ifndef ___ASM_ARCH_REGS_LCD_H
13#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $" 13#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
14 14
15#define S3C2410_LCDREG(x) ((x) + S3C24XX_VA_LCD) 15#define S3C2410_LCDREG(x) (x)
16 16
17/* LCD control registers */ 17/* LCD control registers */
18#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00) 18#define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
diff --git a/include/asm-arm/arch-s3c2410/system.h b/include/asm-arm/arch-s3c2410/system.h
index 1c74ef17da33..63891786dfa0 100644
--- a/include/asm-arm/arch-s3c2410/system.h
+++ b/include/asm-arm/arch-s3c2410/system.h
@@ -17,7 +17,7 @@
17#include <asm/arch/idle.h> 17#include <asm/arch/idle.h>
18#include <asm/arch/reset.h> 18#include <asm/arch/reset.h>
19 19
20#include <asm/arch/regs-watchdog.h> 20#include <asm/plat-s3c/regs-watchdog.h>
21#include <asm/arch/regs-clock.h> 21#include <asm/arch/regs-clock.h>
22 22
23void (*s3c24xx_idle)(void); 23void (*s3c24xx_idle)(void);
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h
index dcb2cef38f50..48a5731ee988 100644
--- a/include/asm-arm/arch-s3c2410/uncompress.h
+++ b/include/asm-arm/arch-s3c2410/uncompress.h
@@ -1,6 +1,7 @@
1/* linux/include/asm-arm/arch-s3c2410/uncompress.h 1/* linux/include/asm-arm/arch-s3c2410/uncompress.h
2 * 2 *
3 * Copyright (c) 2003 Simtec Electronics 3 * Copyright (c) 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
4 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
5 * 6 *
6 * S3C2410 - uncompress code 7 * S3C2410 - uncompress code
@@ -13,153 +14,39 @@
13#ifndef __ASM_ARCH_UNCOMPRESS_H 14#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H 15#define __ASM_ARCH_UNCOMPRESS_H
15 16
16typedef unsigned int upf_t; /* cannot include linux/serial_core.h */ 17#include <asm/arch/regs-gpio.h>
17
18/* defines for UART registers */
19#include "asm/arch/regs-serial.h"
20#include "asm/arch/regs-gpio.h"
21#include "asm/arch/regs-watchdog.h"
22
23#include <asm/arch/map.h> 18#include <asm/arch/map.h>
24 19
25/* working in physical space... */ 20/* working in physical space... */
26#undef S3C2410_GPIOREG 21#undef S3C2410_GPIOREG
27#undef S3C2410_WDOGREG
28
29#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) 22#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
30#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
31 23
32/* how many bytes we allow into the FIFO at a time in FIFO mode */ 24#include <asm/plat-s3c/uncompress.h>
33#define FIFO_MAX (14)
34 25
35#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) 26static inline int is_arm926(void)
36
37static __inline__ void
38uart_wr(unsigned int reg, unsigned int val)
39{ 27{
40 volatile unsigned int *ptr; 28 unsigned int cpuid;
41
42 ptr = (volatile unsigned int *)(reg + uart_base);
43 *ptr = val;
44}
45 29
46static __inline__ unsigned int 30 asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
47uart_rd(unsigned int reg)
48{
49 volatile unsigned int *ptr;
50 31
51 ptr = (volatile unsigned int *)(reg + uart_base); 32 return ((cpuid & 0xff0) == 0x260);
52 return *ptr;
53} 33}
54 34
55 35static void arch_detect_cpu(void)
56/* we can deal with the case the UARTs are being run
57 * in FIFO mode, so that we don't hold up our execution
58 * waiting for tx to happen...
59*/
60
61static void putc(int ch)
62{ 36{
63 int cpuid = S3C2410_GSTATUS1_2410; 37 unsigned int cpuid;
64 38
65#ifndef CONFIG_CPU_S3C2400
66 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1); 39 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
67 cpuid &= S3C2410_GSTATUS1_IDMASK; 40 cpuid &= S3C2410_GSTATUS1_IDMASK;
68#endif
69
70 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
71 int level;
72
73 while (1) {
74 level = uart_rd(S3C2410_UFSTAT);
75
76 if (cpuid == S3C2410_GSTATUS1_2440 ||
77 cpuid == S3C2410_GSTATUS1_2442) {
78 level &= S3C2440_UFSTAT_TXMASK;
79 level >>= S3C2440_UFSTAT_TXSHIFT;
80 } else {
81 level &= S3C2410_UFSTAT_TXMASK;
82 level >>= S3C2410_UFSTAT_TXSHIFT;
83 }
84
85 if (level < FIFO_MAX)
86 break;
87 }
88 41
42 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
43 cpuid == S3C2410_GSTATUS1_2442) {
44 fifo_mask = S3C2440_UFSTAT_TXMASK;
45 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
89 } else { 46 } else {
90 /* not using fifos */ 47 fifo_mask = S3C2410_UFSTAT_TXMASK;
91 48 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
92 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
93 barrier();
94 } 49 }
95
96 /* write byte to transmission register */
97 uart_wr(S3C2410_UTXH, ch);
98} 50}
99 51
100static inline void flush(void)
101{
102}
103
104#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
105
106/* CONFIG_S3C2410_BOOT_WATCHDOG
107 *
108 * Simple boot-time watchdog setup, to reboot the system if there is
109 * any problem with the boot process
110*/
111
112#ifdef CONFIG_S3C2410_BOOT_WATCHDOG
113
114#define WDOG_COUNT (0xff00)
115
116static inline void arch_decomp_wdog(void)
117{
118 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
119}
120
121static void arch_decomp_wdog_start(void)
122{
123 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
124 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
125 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
126}
127
128#else
129#define arch_decomp_wdog_start()
130#define arch_decomp_wdog()
131#endif
132
133#ifdef CONFIG_S3C2410_BOOT_ERROR_RESET
134
135static void arch_decomp_error(const char *x)
136{
137 putstr("\n\n");
138 putstr(x);
139 putstr("\n\n -- System resetting\n");
140
141 __raw_writel(0x4000, S3C2410_WTDAT);
142 __raw_writel(0x4000, S3C2410_WTCNT);
143 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
144
145 while(1);
146}
147
148#define arch_error arch_decomp_error
149#endif
150
151static void error(char *err);
152
153static void
154arch_decomp_setup(void)
155{
156 /* we may need to setup the uart(s) here if we are not running
157 * on an BAST... the BAST will have left the uarts configured
158 * after calling linux.
159 */
160
161 arch_decomp_wdog_start();
162}
163
164
165#endif /* __ASM_ARCH_UNCOMPRESS_H */ 52#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-sa1100/jornada720.h b/include/asm-arm/arch-sa1100/jornada720.h
new file mode 100644
index 000000000000..45d2bb59f9d0
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/jornada720.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-arm/arch-sa1100/jornada720.h
3 *
4 * This file contains SSP/MCU communication definitions for HP Jornada 710/720/728
5 *
6 * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
7 * Copyright (C) 2000 John Ankcorn <jca@lcs.mit.edu>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15 /* HP Jornada 7xx microprocessor commands */
16#define GETBATTERYDATA 0xc0
17#define GETSCANKEYCODE 0x90
18#define GETTOUCHSAMPLES 0xa0
19#define GETCONTRAST 0xD0
20#define SETCONTRAST 0xD1
21#define GETBRIGHTNESS 0xD2
22#define SETBRIGHTNESS 0xD3
23#define CONTRASTOFF 0xD8
24#define BRIGHTNESSOFF 0xD9
25#define PWMOFF 0xDF
26#define TXDUMMY 0x11
27#define ERRORCODE 0x00
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h
index d7a777f05088..ec1c685562ce 100644
--- a/include/asm-arm/elf.h
+++ b/include/asm-arm/elf.h
@@ -1,13 +1,14 @@
1#ifndef __ASMARM_ELF_H 1#ifndef __ASMARM_ELF_H
2#define __ASMARM_ELF_H 2#define __ASMARM_ELF_H
3 3
4#include <asm/hwcap.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5/* 7/*
6 * ELF register definitions.. 8 * ELF register definitions..
7 */ 9 */
8#include <asm/ptrace.h> 10#include <asm/ptrace.h>
9#include <asm/user.h> 11#include <asm/user.h>
10#include <asm/hwcap.h>
11 12
12typedef unsigned long elf_greg_t; 13typedef unsigned long elf_greg_t;
13typedef unsigned long elf_freg_t[3]; 14typedef unsigned long elf_freg_t[3];
diff --git a/include/asm-arm/floppy.h b/include/asm-arm/floppy.h
index 54b5ae44ed94..d595c15166a4 100644
--- a/include/asm-arm/floppy.h
+++ b/include/asm-arm/floppy.h
@@ -30,15 +30,21 @@
30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) 30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) 31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
32 32
33static inline int fd_dma_setup(void *data, unsigned int length,
34 unsigned int mode, unsigned long addr)
35{
36 set_dma_mode(DMA_FLOPPY, mode);
37 __set_dma_addr(DMA_FLOPPY, data);
38 set_dma_count(DMA_FLOPPY, length);
39 virtual_dma_port = addr;
40 enable_dma(DMA_FLOPPY);
41 return 0;
42}
43#define fd_dma_setup fd_dma_setup
44
33#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy") 45#define fd_request_dma() request_dma(DMA_FLOPPY,"floppy")
34#define fd_free_dma() free_dma(DMA_FLOPPY) 46#define fd_free_dma() free_dma(DMA_FLOPPY)
35#define fd_disable_dma() disable_dma(DMA_FLOPPY) 47#define fd_disable_dma() disable_dma(DMA_FLOPPY)
36#define fd_enable_dma() enable_dma(DMA_FLOPPY)
37#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY)
38#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode))
39#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr)))
40#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len))
41#define fd_cacheflush(addr,sz)
42 48
43/* need to clean up dma.h */ 49/* need to clean up dma.h */
44#define DMA_FLOPPYDISK DMA_FLOPPY 50#define DMA_FLOPPYDISK DMA_FLOPPY
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
index 81ca5d3e2bff..fb90b421f31c 100644
--- a/include/asm-arm/hardware/iop3xx.h
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -194,6 +194,13 @@ extern int init_atu;
194#define IOP_TMR_PRIVILEGED 0x08 194#define IOP_TMR_PRIVILEGED 0x08
195#define IOP_TMR_RATIO_1_1 0x00 195#define IOP_TMR_RATIO_1_1 0x00
196 196
197/* Watchdog timer definitions */
198#define IOP_WDTCR_EN_ARM 0x1e1e1e1e
199#define IOP_WDTCR_EN 0xe1e1e1e1
200/* iop3xx does not support stopping the watchdog, so we just re-arm */
201#define IOP_WDTCR_DIS_ARM (IOP_WDTCR_EN_ARM)
202#define IOP_WDTCR_DIS (IOP_WDTCR_EN)
203
197/* Application accelerator unit */ 204/* Application accelerator unit */
198#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800) 205#define IOP3XX_AAU_PHYS_BASE (IOP3XX_PERIPHERAL_PHYS_BASE + 0x800)
199#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7) 206#define IOP3XX_AAU_UPPER_PA (IOP3XX_AAU_PHYS_BASE + 0xa7)
@@ -274,6 +281,32 @@ static inline void write_tisr(u32 val)
274 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val)); 281 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (val));
275} 282}
276 283
284static inline u32 read_wdtcr(void)
285{
286 u32 val;
287 asm volatile("mrc p6, 0, %0, c7, c1, 0":"=r" (val));
288 return val;
289}
290static inline void write_wdtcr(u32 val)
291{
292 asm volatile("mcr p6, 0, %0, c7, c1, 0"::"r" (val));
293}
294
295extern unsigned long get_iop_tick_rate(void);
296
297/* only iop13xx has these registers, we define these to present a
298 * common register interface for the iop_wdt driver.
299 */
300#define IOP_RCSR_WDT (0)
301static inline u32 read_rcsr(void)
302{
303 return 0;
304}
305static inline void write_wdtsr(u32 val)
306{
307 do { } while (0);
308}
309
277extern struct platform_device iop3xx_dma_0_channel; 310extern struct platform_device iop3xx_dma_0_channel;
278extern struct platform_device iop3xx_dma_1_channel; 311extern struct platform_device iop3xx_dma_1_channel;
279extern struct platform_device iop3xx_aau_channel; 312extern struct platform_device iop3xx_aau_channel;
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
index 0c8be19fd66b..b186bc820e30 100644
--- a/include/asm-arm/pgtable-nommu.h
+++ b/include/asm-arm/pgtable-nommu.h
@@ -102,7 +102,8 @@ extern int is_in_rom(unsigned long);
102#define v4_tlb_fns (0) 102#define v4_tlb_fns (0)
103#define v4wb_tlb_fns (0) 103#define v4wb_tlb_fns (0)
104#define v4wbi_tlb_fns (0) 104#define v4wbi_tlb_fns (0)
105#define v6_tlb_fns (0) 105#define v6wbi_tlb_fns (0)
106#define v7wbi_tlb_fns (0)
106 107
107#define v3_user_fns (0) 108#define v3_user_fns (0)
108#define v4_user_fns (0) 109#define v4_user_fns (0)
diff --git a/include/asm-arm/plat-s3c/debug-macro.S b/include/asm-arm/plat-s3c/debug-macro.S
new file mode 100644
index 000000000000..84c40b847da8
--- /dev/null
+++ b/include/asm-arm/plat-s3c/debug-macro.S
@@ -0,0 +1,75 @@
1/* linux/include/asm-arm/plat-s3c/debug-macro.S
2 *
3 * Copyright 2005, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
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 <asm/plat-s3c/regs-serial.h>
13
14/* The S3C2440 implementations are used by default as they are the
15 * most widely re-used */
16
17 .macro fifo_level_s3c2440 rd, rx
18 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
19 and \rd, \rd, #S3C2440_UFSTAT_TXMASK
20 .endm
21
22#ifndef fifo_level
23#define fifo_level fifo_level_s3c2410
24#endif
25
26 .macro fifo_full_s3c2440 rd, rx
27 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
28 tst \rd, #S3C2440_UFSTAT_TXFULL
29 .endm
30
31#ifndef fifo_full
32#define fifo_full fifo_full_s3c2440
33#endif
34
35 .macro senduart,rd,rx
36 strb \rd, [\rx, # S3C2410_UTXH ]
37 .endm
38
39 .macro busyuart, rd, rx
40 ldr \rd, [ \rx, # S3C2410_UFCON ]
41 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
42 beq 1001f @
43 @ FIFO enabled...
441003:
45 fifo_full \rd, \rx
46 bne 1003b
47 b 1002f
48
491001:
50 @ busy waiting for non fifo
51 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
52 tst \rd, #S3C2410_UTRSTAT_TXFE
53 beq 1001b
54
551002: @ exit busyuart
56 .endm
57
58 .macro waituart,rd,rx
59 ldr \rd, [ \rx, # S3C2410_UFCON ]
60 tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
61 beq 1001f @
62 @ FIFO enabled...
631003:
64 fifo_level \rd, \rx
65 teq \rd, #0
66 bne 1003b
67 b 1002f
681001:
69 @ idle waiting for non fifo
70 ldr \rd, [ \rx, # S3C2410_UTRSTAT ]
71 tst \rd, #S3C2410_UTRSTAT_TXFE
72 beq 1001b
73
741002: @ exit busyuart
75 .endm
diff --git a/include/asm-arm/arch-s3c2410/iic.h b/include/asm-arm/plat-s3c/iic.h
index 71211c8b5384..71211c8b5384 100644
--- a/include/asm-arm/arch-s3c2410/iic.h
+++ b/include/asm-arm/plat-s3c/iic.h
diff --git a/include/asm-arm/plat-s3c/map.h b/include/asm-arm/plat-s3c/map.h
new file mode 100644
index 000000000000..95a82b0e84a1
--- /dev/null
+++ b/include/asm-arm/plat-s3c/map.h
@@ -0,0 +1,40 @@
1/* linux/include/asm-arm/plat-s3c/map.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - Memory map definitions (virtual addresses)
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#ifndef __ASM_PLAT_MAP_H
15#define __ASM_PLAT_MAP_H __FILE__
16
17/* Fit all our registers in at 0xF4000000 upwards, trying to use as
18 * little of the VA space as possible so vmalloc and friends have a
19 * better chance of getting memory.
20 *
21 * we try to ensure stuff like the IRQ registers are available for
22 * an single MOVS instruction (ie, only 8 bits of set data)
23 */
24
25#define S3C_ADDR_BASE (0xF4000000)
26
27#ifndef __ASSEMBLY__
28#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
29#else
30#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))
31#endif
32
33#define S3C_VA_IRQ S3C_ADDR(0x000000000) /* irq controller(s) */
34#define S3C_VA_SYS S3C_ADDR(0x001000000) /* system control */
35#define S3C_VA_MEM S3C_ADDR(0x002000000) /* system control */
36#define S3C_VA_TIMER S3C_ADDR(0x003000000) /* timer block */
37#define S3C_VA_WATCHDOG S3C_ADDR(0x004000000) /* watchdog */
38#define S3C_VA_UART S3C_ADDR(0x010000000) /* UART */
39
40#endif /* __ASM_PLAT_MAP_H */
diff --git a/include/asm-arm/arch-s3c2410/nand.h b/include/asm-arm/plat-s3c/nand.h
index 8816f7f9cee1..8816f7f9cee1 100644
--- a/include/asm-arm/arch-s3c2410/nand.h
+++ b/include/asm-arm/plat-s3c/nand.h
diff --git a/include/asm-arm/arch-s3c2410/regs-ac97.h b/include/asm-arm/plat-s3c/regs-ac97.h
index b004dee6bcaf..b004dee6bcaf 100644
--- a/include/asm-arm/arch-s3c2410/regs-ac97.h
+++ b/include/asm-arm/plat-s3c/regs-ac97.h
diff --git a/include/asm-arm/arch-s3c2410/regs-adc.h b/include/asm-arm/plat-s3c/regs-adc.h
index c7f231963e76..c7f231963e76 100644
--- a/include/asm-arm/arch-s3c2410/regs-adc.h
+++ b/include/asm-arm/plat-s3c/regs-adc.h
diff --git a/include/asm-arm/arch-s3c2410/regs-iic.h b/include/asm-arm/plat-s3c/regs-iic.h
index 2ae29522f253..2ae29522f253 100644
--- a/include/asm-arm/arch-s3c2410/regs-iic.h
+++ b/include/asm-arm/plat-s3c/regs-iic.h
diff --git a/include/asm-arm/arch-s3c2410/regs-nand.h b/include/asm-arm/plat-s3c/regs-nand.h
index b824d371ae0b..b824d371ae0b 100644
--- a/include/asm-arm/arch-s3c2410/regs-nand.h
+++ b/include/asm-arm/plat-s3c/regs-nand.h
diff --git a/include/asm-arm/arch-s3c2410/regs-rtc.h b/include/asm-arm/plat-s3c/regs-rtc.h
index 93b03c49710a..93b03c49710a 100644
--- a/include/asm-arm/arch-s3c2410/regs-rtc.h
+++ b/include/asm-arm/plat-s3c/regs-rtc.h
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/plat-s3c/regs-serial.h
index 8946702a87f5..923e114db663 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/plat-s3c/regs-serial.h
@@ -32,10 +32,10 @@
32#ifndef __ASM_ARM_REGS_SERIAL_H 32#ifndef __ASM_ARM_REGS_SERIAL_H
33#define __ASM_ARM_REGS_SERIAL_H 33#define __ASM_ARM_REGS_SERIAL_H
34 34
35#define S3C24XX_VA_UART0 (S3C24XX_VA_UART) 35#define S3C24XX_VA_UART0 (S3C_VA_UART)
36#define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) 36#define S3C24XX_VA_UART1 (S3C_VA_UART + 0x4000 )
37#define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) 37#define S3C24XX_VA_UART2 (S3C_VA_UART + 0x8000 )
38#define S3C24XX_VA_UART3 (S3C24XX_VA_UART + 0xC000 ) 38#define S3C24XX_VA_UART3 (S3C_VA_UART + 0xC000 )
39 39
40#define S3C2410_PA_UART0 (S3C24XX_PA_UART) 40#define S3C2410_PA_UART0 (S3C24XX_PA_UART)
41#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) 41#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 )
diff --git a/include/asm-arm/arch-s3c2410/regs-timer.h b/include/asm-arm/plat-s3c/regs-timer.h
index 6f8fe432fe3a..8b0d594397b1 100644
--- a/include/asm-arm/arch-s3c2410/regs-timer.h
+++ b/include/asm-arm/plat-s3c/regs-timer.h
@@ -14,12 +14,12 @@
14#ifndef __ASM_ARCH_REGS_TIMER_H 14#ifndef __ASM_ARCH_REGS_TIMER_H
15#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $" 15#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
16 16
17#define S3C2410_TIMERREG(x) (S3C24XX_VA_TIMER + (x)) 17#define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
18#define S3C2410_TIMERREG2(tmr,reg) S3C2410_TIMERREG((reg)+0x0c+((tmr)*0x0c)) 18#define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
19 19
20#define S3C2410_TCFG0 S3C2410_TIMERREG(0x00) 20#define S3C2410_TCFG0 S3C_TIMERREG(0x00)
21#define S3C2410_TCFG1 S3C2410_TIMERREG(0x04) 21#define S3C2410_TCFG1 S3C_TIMERREG(0x04)
22#define S3C2410_TCON S3C2410_TIMERREG(0x08) 22#define S3C2410_TCON S3C_TIMERREG(0x08)
23 23
24#define S3C2410_TCFG_PRESCALER0_MASK (255<<0) 24#define S3C2410_TCFG_PRESCALER0_MASK (255<<0)
25#define S3C2410_TCFG_PRESCALER1_MASK (255<<8) 25#define S3C2410_TCFG_PRESCALER1_MASK (255<<8)
@@ -71,9 +71,9 @@
71 71
72/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */ 72/* WARNING - timer 4 has no buffer reg, and it's observation is at +4 */
73 73
74#define S3C2410_TCNTB(tmr) S3C2410_TIMERREG2(tmr, 0x00) 74#define S3C2410_TCNTB(tmr) S3C_TIMERREG2(tmr, 0x00)
75#define S3C2410_TCMPB(tmr) S3C2410_TIMERREG2(tmr, 0x04) 75#define S3C2410_TCMPB(tmr) S3C_TIMERREG2(tmr, 0x04)
76#define S3C2410_TCNTO(tmr) S3C2410_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08)) 76#define S3C2410_TCNTO(tmr) S3C_TIMERREG2(tmr, (((tmr) == 4) ? 0x04 : 0x08))
77 77
78#define S3C2410_TCON_T4RELOAD (1<<22) 78#define S3C2410_TCON_T4RELOAD (1<<22)
79#define S3C2410_TCON_T4MANUALUPD (1<<21) 79#define S3C2410_TCON_T4MANUALUPD (1<<21)
diff --git a/include/asm-arm/arch-s3c2410/regs-watchdog.h b/include/asm-arm/plat-s3c/regs-watchdog.h
index a9c5d491bdb6..56c4193b7a46 100644
--- a/include/asm-arm/arch-s3c2410/regs-watchdog.h
+++ b/include/asm-arm/plat-s3c/regs-watchdog.h
@@ -14,11 +14,11 @@
14#ifndef __ASM_ARCH_REGS_WATCHDOG_H 14#ifndef __ASM_ARCH_REGS_WATCHDOG_H
15#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $" 15#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $"
16 16
17#define S3C2410_WDOGREG(x) ((x) + S3C24XX_VA_WATCHDOG) 17#define S3C_WDOGREG(x) ((x) + S3C_VA_WATCHDOG)
18 18
19#define S3C2410_WTCON S3C2410_WDOGREG(0x00) 19#define S3C2410_WTCON S3C_WDOGREG(0x00)
20#define S3C2410_WTDAT S3C2410_WDOGREG(0x04) 20#define S3C2410_WTDAT S3C_WDOGREG(0x04)
21#define S3C2410_WTCNT S3C2410_WDOGREG(0x08) 21#define S3C2410_WTCNT S3C_WDOGREG(0x08)
22 22
23/* the watchdog can either generate a reset pulse, or an 23/* the watchdog can either generate a reset pulse, or an
24 * interrupt. 24 * interrupt.
diff --git a/include/asm-arm/plat-s3c/uncompress.h b/include/asm-arm/plat-s3c/uncompress.h
new file mode 100644
index 000000000000..b5e6208175d1
--- /dev/null
+++ b/include/asm-arm/plat-s3c/uncompress.h
@@ -0,0 +1,155 @@
1/* linux/include/asm-arm/plat-s3c/uncompress.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - uncompress code
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#ifndef __ASM_PLAT_UNCOMPRESS_H
15#define __ASM_PLAT_UNCOMPRESS_H
16
17typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
18
19/* uart setup */
20
21static unsigned int fifo_mask;
22static unsigned int fifo_max;
23
24/* forward declerations */
25
26static void arch_detect_cpu(void);
27
28/* defines for UART registers */
29
30#include "asm/plat-s3c/regs-serial.h"
31#include "asm/plat-s3c/regs-watchdog.h"
32
33/* working in physical space... */
34#undef S3C2410_WDOGREG
35#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
36
37/* how many bytes we allow into the FIFO at a time in FIFO mode */
38#define FIFO_MAX (14)
39
40#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C_LOWLEVEL_UART_PORT)
41
42static __inline__ void
43uart_wr(unsigned int reg, unsigned int val)
44{
45 volatile unsigned int *ptr;
46
47 ptr = (volatile unsigned int *)(reg + uart_base);
48 *ptr = val;
49}
50
51static __inline__ unsigned int
52uart_rd(unsigned int reg)
53{
54 volatile unsigned int *ptr;
55
56 ptr = (volatile unsigned int *)(reg + uart_base);
57 return *ptr;
58}
59
60/* we can deal with the case the UARTs are being run
61 * in FIFO mode, so that we don't hold up our execution
62 * waiting for tx to happen...
63*/
64
65static void putc(int ch)
66{
67 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
68 int level;
69
70 while (1) {
71 level = uart_rd(S3C2410_UFSTAT);
72 level &= fifo_mask;
73
74 if (level < fifo_max)
75 break;
76 }
77
78 } else {
79 /* not using fifos */
80
81 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
82 barrier();
83 }
84
85 /* write byte to transmission register */
86 uart_wr(S3C2410_UTXH, ch);
87}
88
89static inline void flush(void)
90{
91}
92
93#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0)
94
95/* CONFIG_S3C_BOOT_WATCHDOG
96 *
97 * Simple boot-time watchdog setup, to reboot the system if there is
98 * any problem with the boot process
99*/
100
101#ifdef CONFIG_S3C_BOOT_WATCHDOG
102
103#define WDOG_COUNT (0xff00)
104
105static inline void arch_decomp_wdog(void)
106{
107 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
108}
109
110static void arch_decomp_wdog_start(void)
111{
112 __raw_writel(WDOG_COUNT, S3C2410_WTDAT);
113 __raw_writel(WDOG_COUNT, S3C2410_WTCNT);
114 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
115}
116
117#else
118#define arch_decomp_wdog_start()
119#define arch_decomp_wdog()
120#endif
121
122#ifdef CONFIG_S3C_BOOT_ERROR_RESET
123
124static void arch_decomp_error(const char *x)
125{
126 putstr("\n\n");
127 putstr(x);
128 putstr("\n\n -- System resetting\n");
129
130 __raw_writel(0x4000, S3C2410_WTDAT);
131 __raw_writel(0x4000, S3C2410_WTCNT);
132 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
133
134 while(1);
135}
136
137#define arch_error arch_decomp_error
138#endif
139
140static void error(char *err);
141
142static void
143arch_decomp_setup(void)
144{
145 /* we may need to setup the uart(s) here if we are not running
146 * on an BAST... the BAST will have left the uarts configured
147 * after calling linux.
148 */
149
150 arch_detect_cpu();
151 arch_decomp_wdog_start();
152}
153
154
155#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/plat-s3c24xx/regs-iis.h
index eaf77916a602..eaf77916a602 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/plat-s3c24xx/regs-iis.h
diff --git a/include/asm-arm/arch-s3c2410/regs-spi.h b/include/asm-arm/plat-s3c24xx/regs-spi.h
index 4a499a138256..4a499a138256 100644
--- a/include/asm-arm/arch-s3c2410/regs-spi.h
+++ b/include/asm-arm/plat-s3c24xx/regs-spi.h
diff --git a/include/asm-arm/arch-s3c2410/regs-udc.h b/include/asm-arm/plat-s3c24xx/regs-udc.h
index e1e9805d2d9a..e1e9805d2d9a 100644
--- a/include/asm-arm/arch-s3c2410/regs-udc.h
+++ b/include/asm-arm/plat-s3c24xx/regs-udc.h
diff --git a/include/asm-arm/arch-s3c2410/udc.h b/include/asm-arm/plat-s3c24xx/udc.h
index b8aa6cb69b58..b8aa6cb69b58 100644
--- a/include/asm-arm/arch-s3c2410/udc.h
+++ b/include/asm-arm/plat-s3c24xx/udc.h
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index eae85b09db2e..69c65d56a6ac 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -24,7 +24,6 @@
24struct task_struct; 24struct task_struct;
25struct exec_domain; 25struct exec_domain;
26 26
27#include <asm/ptrace.h>
28#include <asm/types.h> 27#include <asm/types.h>
29#include <asm/domain.h> 28#include <asm/domain.h>
30 29
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index bfdbebebdc1b..d327b25c986c 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -441,7 +441,6 @@
441/* 441/*
442 * Unimplemented (or alternatively implemented) syscalls 442 * Unimplemented (or alternatively implemented) syscalls
443 */ 443 */
444#define __IGNORE_sync_file_range 1
445#define __IGNORE_fadvise64_64 1 444#define __IGNORE_fadvise64_64 1
446 445
447#endif /* __KERNEL__ */ 446#endif /* __KERNEL__ */
diff --git a/include/asm-arm/vfp.h b/include/asm-arm/vfp.h
index 14c5e0946c47..bd6be9d7f772 100644
--- a/include/asm-arm/vfp.h
+++ b/include/asm-arm/vfp.h
@@ -26,8 +26,8 @@
26#define FPSID_REV_MASK (0xF << FPSID_REV_BIT) 26#define FPSID_REV_MASK (0xF << FPSID_REV_BIT)
27 27
28/* FPEXC bits */ 28/* FPEXC bits */
29#define FPEXC_EXCEPTION (1<<31) 29#define FPEXC_EX (1 << 31)
30#define FPEXC_ENABLE (1<<30) 30#define FPEXC_EN (1 << 30)
31 31
32/* FPSCR bits */ 32/* FPSCR bits */
33#define FPSCR_DEFAULT_NAN (1<<25) 33#define FPSCR_DEFAULT_NAN (1<<25)