From ab0b4df537fe34b7c0c8ca2678426900ea57a482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 17 Jul 2007 22:33:18 +0100 Subject: [PATCH] --- yaml --- r: 62655 b: refs/heads/master c: 3f20246bb67594acae5a82a8b859f21579b0ff07 h: refs/heads/master i: 62653: 23b1dc2a5a9c71b8b7dea4a519413c76a22b5f7d 62651: bb2666350ab58ef12911c335c101a6c90cbce5b6 62647: 7930dd3d7bb3f263a32a262df3fcedc85b0c4265 62639: d018e8277710849edb7bb63210bd7cbcf4b2f1b2 62623: ee98a83ee8070b844a2ae5e01808b66dce240e1d 62591: 8e466cf41769959b7b835966fed27524dd58ed63 v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 2 +- trunk/arch/arm/boot/Makefile | 8 - trunk/arch/arm/boot/compressed/Makefile | 2 +- trunk/arch/arm/mach-ns9xxx/Makefile | 1 + trunk/arch/arm/mach-ns9xxx/mach-cc9p9360js.c | 2 +- trunk/arch/arm/mach-rpc/riscpc.c | 2 +- trunk/arch/arm/mach-sa1100/Kconfig | 13 +- trunk/arch/arm/mach-sa1100/Makefile | 2 - trunk/arch/arm/mach-sa1100/jornada720_ssp.c | 201 ----------------- trunk/arch/arm/mach-sa1100/neponset.c | 2 - trunk/arch/arm/mm/Kconfig | 13 +- trunk/arch/arm/mm/cache-l2x0.c | 6 - trunk/arch/arm/mm/mmu.c | 14 +- trunk/arch/arm/mm/proc-syms.c | 2 - trunk/arch/arm/mm/proc-v7.S | 33 +-- trunk/arch/arm/vfp/vfphw.S | 12 +- trunk/arch/arm/vfp/vfpmodule.c | 12 +- trunk/drivers/net/arm/ether1.c | 3 +- trunk/drivers/net/arm/ether3.c | 3 +- trunk/drivers/net/arm/etherh.c | 1 + trunk/drivers/scsi/arm/cumana_1.c | 207 +++++++++--------- trunk/drivers/scsi/arm/ecoscsi.c | 152 +++++++++---- trunk/drivers/scsi/arm/oak.c | 74 +++---- .../include/asm-arm/arch-sa1100/jornada720.h | 27 --- trunk/include/asm-arm/elf.h | 3 +- trunk/include/asm-arm/floppy.h | 18 +- trunk/include/asm-arm/pgtable-nommu.h | 3 +- trunk/include/asm-arm/thread_info.h | 1 + trunk/include/asm-arm/unistd.h | 1 + trunk/include/asm-arm/vfp.h | 4 +- 31 files changed, 318 insertions(+), 508 deletions(-) delete mode 100644 trunk/arch/arm/mach-sa1100/jornada720_ssp.c delete mode 100644 trunk/include/asm-arm/arch-sa1100/jornada720.h diff --git a/[refs] b/[refs] index e6204de521a4..21bf68587af6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 11179d8ca28d669e3d4cc7573a5f5fdda3e6f02d +refs/heads/master: 3f20246bb67594acae5a82a8b859f21579b0ff07 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 57c07c20af40..fbe0dca1c0ed 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -457,7 +457,7 @@ S: Maintained ARM/HP JORNADA 7XX MACHINE SUPPORT P: Kristoffer Ericson -M: kristoffer.ericson@gmail.com +M: kristoffer_e1@hotmail.com W: www.jlime.com S: Maintained diff --git a/trunk/arch/arm/boot/Makefile b/trunk/arch/arm/boot/Makefile index 25f12303b106..ec9c400c7f82 100644 --- a/trunk/arch/arm/boot/Makefile +++ b/trunk/arch/arm/boot/Makefile @@ -91,12 +91,4 @@ zinstall: $(obj)/zImage $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ $(obj)/zImage System.map "$(INSTALL_PATH)" -zi: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ - $(obj)/zImage System.map "$(INSTALL_PATH)" - -i: - $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ - $(obj)/Image System.map "$(INSTALL_PATH)" - subdir- := bootp compressed diff --git a/trunk/arch/arm/boot/compressed/Makefile b/trunk/arch/arm/boot/compressed/Makefile index 6b8cbd69f249..a1f1691b67fe 100644 --- a/trunk/arch/arm/boot/compressed/Makefile +++ b/trunk/arch/arm/boot/compressed/Makefile @@ -73,7 +73,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ head.o misc.o $(OBJS) -EXTRA_CFLAGS := -fpic -fno-builtin +EXTRA_CFLAGS := -fpic EXTRA_AFLAGS := # Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via diff --git a/trunk/arch/arm/mach-ns9xxx/Makefile b/trunk/arch/arm/mach-ns9xxx/Makefile index 53213a69f601..4476411b8140 100644 --- a/trunk/arch/arm/mach-ns9xxx/Makefile +++ b/trunk/arch/arm/mach-ns9xxx/Makefile @@ -1,6 +1,7 @@ obj-y := irq.o time.o generic.o obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o +obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o diff --git a/trunk/arch/arm/mach-ns9xxx/mach-cc9p9360js.c b/trunk/arch/arm/mach-ns9xxx/mach-cc9p9360js.c index d09d5fa5620a..85c8b41105c9 100644 --- a/trunk/arch/arm/mach-ns9xxx/mach-cc9p9360js.c +++ b/trunk/arch/arm/mach-ns9xxx/mach-cc9p9360js.c @@ -20,7 +20,7 @@ static void __init mach_cc9p9360js_init_machine(void) board_jscc9p9360_init_machine(); } -MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard") +MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard") .map_io = ns9xxx_map_io, .init_irq = ns9xxx_init_irq, .init_machine = mach_cc9p9360js_init_machine, diff --git a/trunk/arch/arm/mach-rpc/riscpc.c b/trunk/arch/arm/mach-rpc/riscpc.c index a454451c97c3..570cf937e73b 100644 --- a/trunk/arch/arm/mach-rpc/riscpc.c +++ b/trunk/arch/arm/mach-rpc/riscpc.c @@ -87,7 +87,7 @@ static void __init rpc_map_io(void) /* * Turn off floppy. */ - writeb(0xc, PCIO_BASE + (0x3f2 << 2)); + outb(0xc, 0x3f2); /* * RiscPC can't handle half-word loads and stores diff --git a/trunk/arch/arm/mach-sa1100/Kconfig b/trunk/arch/arm/mach-sa1100/Kconfig index f99d9013905f..cd67ab1b217b 100644 --- a/trunk/arch/arm/mach-sa1100/Kconfig +++ b/trunk/arch/arm/mach-sa1100/Kconfig @@ -101,16 +101,6 @@ config SA1100_JORNADA720 handheld computer. See for details. -config SA1100_JORNADA720_SSP - bool "HP Jornada 720 Extended SSP driver" - select SA1100_SSP - depends on SA1100_JORNADA720 - help - Say Y here if you have a HP Jornada 7xx handheld computer and you - want to access devices connected to the MCU. Those include the - keyboard, touchscreen, backlight and battery. This driver also activates - the generic SSP which it extends. - config SA1100_HACKKIT bool "HackKit Core CPU Board" help @@ -155,7 +145,8 @@ config SA1100_SSP help Say Y here to enable support for the generic PIO SSP driver. This isn't for audio support, but for attached sensors and - other devices, eg for BadgePAD 4 sensor support. + other devices, eg for BadgePAD 4 sensor support, or Jornada + 720 touchscreen support. config H3600_SLEEVE tristate "Compaq iPAQ Handheld sleeve support" diff --git a/trunk/arch/arm/mach-sa1100/Makefile b/trunk/arch/arm/mach-sa1100/Makefile index 7a61e8d33ab7..e27f15042a22 100644 --- a/trunk/arch/arm/mach-sa1100/Makefile +++ b/trunk/arch/arm/mach-sa1100/Makefile @@ -31,7 +31,6 @@ obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o obj-$(CONFIG_SA1100_JORNADA720) += jornada720.o -obj-$(CONFIG_SA1100_JORNADA720_SSP) += jornada720_ssp.o obj-$(CONFIG_SA1100_LART) += lart.o led-$(CONFIG_SA1100_LART) += leds-lart.o @@ -52,4 +51,3 @@ obj-$(CONFIG_LEDS) += $(led-y) # Miscelaneous functions obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_SA1100_SSP) += ssp.o - diff --git a/trunk/arch/arm/mach-sa1100/jornada720_ssp.c b/trunk/arch/arm/mach-sa1100/jornada720_ssp.c deleted file mode 100644 index 0a45e1ac8ad6..000000000000 --- a/trunk/arch/arm/mach-sa1100/jornada720_ssp.c +++ /dev/null @@ -1,201 +0,0 @@ -/** - * arch/arm/mac-sa1100/jornada720_ssp.c - * - * Copyright (C) 2006/2007 Kristoffer Ericson - * Copyright (C) 2006 Filip Zyzniewski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * SSP driver for the HP Jornada 710/720/728 - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -static DEFINE_SPINLOCK(jornada_ssp_lock); -static unsigned long jornada_ssp_flags; - -/** - * jornada_ssp_reverse - reverses input byte - * - * we need to reverse all data we recieve from the mcu due to its physical location - * returns : 01110111 -> 11101110 - */ -u8 inline jornada_ssp_reverse(u8 byte) -{ - return - ((0x80 & byte) >> 7) | - ((0x40 & byte) >> 5) | - ((0x20 & byte) >> 3) | - ((0x10 & byte) >> 1) | - ((0x08 & byte) << 1) | - ((0x04 & byte) << 3) | - ((0x02 & byte) << 5) | - ((0x01 & byte) << 7); -}; -EXPORT_SYMBOL(jornada_ssp_reverse); - -/** - * jornada_ssp_byte - waits for ready ssp bus and sends byte - * - * waits for fifo buffer to clear and then transmits, if it doesn't then we will - * timeout after rounds. Needs mcu running before its called. - * - * returns : %mcu output on success - * : %-ETIMEOUT on timeout - */ -int jornada_ssp_byte(u8 byte) -{ - int timeout = 400000; - u16 ret; - - while ((GPLR & GPIO_GPIO10)) { - if (!--timeout) { - printk(KERN_WARNING "SSP: timeout while waiting for transmit\n"); - return -ETIMEDOUT; - } - cpu_relax(); - } - - ret = jornada_ssp_reverse(byte) << 8; - - ssp_write_word(ret); - ssp_read_word(&ret); - - return jornada_ssp_reverse(ret); -}; -EXPORT_SYMBOL(jornada_ssp_byte); - -/** - * jornada_ssp_inout - decide if input is command or trading byte - * - * returns : (jornada_ssp_byte(byte)) on success - * : %-ETIMEOUT on timeout failure - */ -int jornada_ssp_inout(u8 byte) -{ - int ret, i; - - /* true means command byte */ - if (byte != TXDUMMY) { - ret = jornada_ssp_byte(byte); - /* Proper return to commands is TxDummy */ - if (ret != TXDUMMY) { - for (i = 0; i < 256; i++)/* flushing bus */ - if (jornada_ssp_byte(TXDUMMY) == -1) - break; - return -ETIMEDOUT; - } - } else /* Exchange TxDummy for data */ - ret = jornada_ssp_byte(TXDUMMY); - - return ret; -}; -EXPORT_SYMBOL(jornada_ssp_inout); - -/** - * jornada_ssp_start - enable mcu - * - */ -int jornada_ssp_start() -{ - spin_lock_irqsave(&jornada_ssp_lock, jornada_ssp_flags); - GPCR = GPIO_GPIO25; - udelay(50); - return 0; -}; -EXPORT_SYMBOL(jornada_ssp_start); - -/** - * jornada_ssp_end - disable mcu and turn off lock - * - */ -int jornada_ssp_end() -{ - GPSR = GPIO_GPIO25; - spin_unlock_irqrestore(&jornada_ssp_lock, jornada_ssp_flags); - return 0; -}; -EXPORT_SYMBOL(jornada_ssp_end); - -static int __init jornada_ssp_probe(struct platform_device *dev) -{ - int ret; - - GPSR = GPIO_GPIO25; - - ret = ssp_init(); - - /* worked fine, lets not bother with anything else */ - if (!ret) { - printk(KERN_INFO "SSP: device initialized with irq\n"); - return ret; - } - - printk(KERN_WARNING "SSP: initialization failed, trying non-irq solution \n"); - - /* init of Serial 4 port */ - Ser4MCCR0 = 0; - Ser4SSCR0 = 0x0387; - Ser4SSCR1 = 0x18; - - /* clear out any left over data */ - ssp_flush(); - - /* enable MCU */ - jornada_ssp_start(); - - /* see if return value makes sense */ - ret = jornada_ssp_inout(GETBRIGHTNESS); - - /* seems like it worked, just feed it with TxDummy to get rid of data */ - if (ret == TxDummy) - jornada_ssp_inout(TXDUMMY); - - jornada_ssp_end(); - - /* failed, lets just kill everything */ - if (ret == -ETIMEDOUT) { - printk(KERN_WARNING "SSP: attempts failed, bailing\n"); - ssp_exit(); - return -ENODEV; - } - - /* all fine */ - printk(KERN_INFO "SSP: device initialized\n"); - return 0; -}; - -static int jornada_ssp_remove(struct platform_device *dev) -{ - /* Note that this doesnt actually remove the driver, since theres nothing to remove - * It just makes sure everything is turned off */ - GPSR = GPIO_GPIO25; - ssp_exit(); - return 0; -}; - -struct platform_driver jornadassp_driver = { - .probe = jornada_ssp_probe, - .remove = jornada_ssp_remove, - .driver = { - .name = "jornada_ssp", - }, -}; - -static int __init jornada_ssp_init(void) -{ - return platform_driver_register(&jornadassp_driver); -} diff --git a/trunk/arch/arm/mach-sa1100/neponset.c b/trunk/arch/arm/mach-sa1100/neponset.c index 9f1ed1509301..3a0a1ee2542d 100644 --- a/trunk/arch/arm/mach-sa1100/neponset.c +++ b/trunk/arch/arm/mach-sa1100/neponset.c @@ -292,8 +292,6 @@ static struct platform_device *devices[] __initdata = { &smc91x_device, }; -extern void sa1110_mb_disable(void); - static int __init neponset_init(void) { platform_driver_register(&neponset_device_driver); diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig index 76a3ba668e2e..e7904bc92c73 100644 --- a/trunk/arch/arm/mm/Kconfig +++ b/trunk/arch/arm/mm/Kconfig @@ -351,7 +351,7 @@ config CPU_V6 select CPU_CACHE_V6 select CPU_CACHE_VIPT select CPU_CP15_MMU - select CPU_HAS_ASID if MMU + select CPU_HAS_ASID select CPU_COPY_V6 if MMU select CPU_TLB_V6 if MMU @@ -377,7 +377,7 @@ config CPU_V7 select CPU_CACHE_V7 select CPU_CACHE_VIPT select CPU_CP15_MMU - select CPU_HAS_ASID if MMU + select CPU_HAS_ASID select CPU_COPY_V6 if MMU select CPU_TLB_V7 if MMU @@ -405,7 +405,6 @@ config CPU_32v5 config CPU_32v6 bool - select TLS_REG_EMUL if !CPU_32v6K && !MMU config CPU_32v7 bool @@ -599,7 +598,7 @@ config CPU_DCACHE_SIZE config CPU_DCACHE_WRITETHROUGH bool "Force write through D-cache" - depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020) && !CPU_DCACHE_DISABLE + depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_V6) && !CPU_DCACHE_DISABLE default y if CPU_ARM925T help Say Y here to use the data cache in writethrough mode. Unless you @@ -612,6 +611,12 @@ config CPU_CACHE_ROUND_ROBIN Say Y here to use the predictable round-robin cache replacement policy. Unless you specifically require this or are unsure, say N. +config CPU_L2CACHE_DISABLE + bool "Disable level 2 cache" + depends on CPU_V7 + help + Say Y here to disable the level 2 cache. If unsure, say N. + config CPU_BPREDICT_DISABLE bool "Disable branch prediction" depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 || CPU_V7 diff --git a/trunk/arch/arm/mm/cache-l2x0.c b/trunk/arch/arm/mm/cache-l2x0.c index b4e9b734e0bd..08a36f1b35d2 100644 --- a/trunk/arch/arm/mm/cache-l2x0.c +++ b/trunk/arch/arm/mm/cache-l2x0.c @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include #include #include @@ -26,19 +25,14 @@ #define CACHE_LINE_SIZE 32 static void __iomem *l2x0_base; -static DEFINE_SPINLOCK(l2x0_lock); static inline void sync_writel(unsigned long val, unsigned long reg, unsigned long complete_mask) { - unsigned long flags; - - spin_lock_irqsave(&l2x0_lock, flags); writel(val, l2x0_base + reg); /* wait for the operation to complete */ while (readl(l2x0_base + reg) & complete_mask) ; - spin_unlock_irqrestore(&l2x0_lock, flags); } static inline void cache_sync(void) diff --git a/trunk/arch/arm/mm/mmu.c b/trunk/arch/arm/mm/mmu.c index e5d61ee3d4a1..3b5e47dc0c97 100644 --- a/trunk/arch/arm/mm/mmu.c +++ b/trunk/arch/arm/mm/mmu.c @@ -114,10 +114,6 @@ static void __init early_cachepolicy(char **p) } if (i == ARRAY_SIZE(cache_policies)) printk(KERN_ERR "ERROR: unknown or unsupported cache policy\n"); - if (cpu_architecture() >= CPU_ARCH_ARMv6) { - printk(KERN_WARNING "Only cachepolicy=writeback supported on ARMv6 and later\n"); - cachepolicy = CPOLICY_WRITEBACK; - } flush_cache_all(); set_cr(cr_alignment); } @@ -256,15 +252,13 @@ static void __init build_mem_type_table(void) int cpu_arch = cpu_architecture(); int i; - if (cpu_arch < CPU_ARCH_ARMv6) { #if defined(CONFIG_CPU_DCACHE_DISABLE) - if (cachepolicy > CPOLICY_BUFFERED) - cachepolicy = CPOLICY_BUFFERED; + if (cachepolicy > CPOLICY_BUFFERED) + cachepolicy = CPOLICY_BUFFERED; #elif defined(CONFIG_CPU_DCACHE_WRITETHROUGH) - if (cachepolicy > CPOLICY_WRITETHROUGH) - cachepolicy = CPOLICY_WRITETHROUGH; + if (cachepolicy > CPOLICY_WRITETHROUGH) + cachepolicy = CPOLICY_WRITETHROUGH; #endif - } if (cpu_arch < CPU_ARCH_ARMv5) { if (cachepolicy >= CPOLICY_WRITEALLOC) cachepolicy = CPOLICY_WRITEBACK; diff --git a/trunk/arch/arm/mm/proc-syms.c b/trunk/arch/arm/mm/proc-syms.c index 2b5ba396e3a6..9f396b4fa0b7 100644 --- a/trunk/arch/arm/mm/proc-syms.c +++ b/trunk/arch/arm/mm/proc-syms.c @@ -31,14 +31,12 @@ EXPORT_SYMBOL(__cpuc_coherent_kern_range); EXPORT_SYMBOL(cpu_cache); #endif -#ifdef CONFIG_MMU #ifndef MULTI_USER EXPORT_SYMBOL(__cpu_clear_user_page); EXPORT_SYMBOL(__cpu_copy_user_page); #else EXPORT_SYMBOL(cpu_user); #endif -#endif /* * No module should need to touch the TLB (and currently diff --git a/trunk/arch/arm/mm/proc-v7.S b/trunk/arch/arm/mm/proc-v7.S index e0acc5ae6f6f..718f4782ee8b 100644 --- a/trunk/arch/arm/mm/proc-v7.S +++ b/trunk/arch/arm/mm/proc-v7.S @@ -77,7 +77,6 @@ ENTRY(cpu_v7_dcache_clean_area) * - we are not using split page tables */ ENTRY(cpu_v7_switch_mm) -#ifdef CONFIG_MMU mov r2, #0 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB @@ -87,7 +86,6 @@ ENTRY(cpu_v7_switch_mm) isb mcr p15, 0, r1, c13, c0, 1 @ set context ID isb -#endif mov pc, lr /* @@ -111,7 +109,6 @@ ENTRY(cpu_v7_switch_mm) * 1111 0 1 1 r/w r/w */ ENTRY(cpu_v7_set_pte_ext) -#ifdef CONFIG_MMU str r1, [r0], #-2048 @ linux version bic r3, r1, #0x000003f0 @@ -139,7 +136,6 @@ ENTRY(cpu_v7_set_pte_ext) str r3, [r0] mcr p15, 0, r0, c7, c10, 1 @ flush_pte -#endif mov pc, lr cpu_v7_name: @@ -173,7 +169,6 @@ __v7_setup: mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate #endif dsb -#ifdef CONFIG_MMU mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs mcr p15, 0, r10, c2, c0, 2 @ TTB control register orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB @@ -181,12 +176,21 @@ __v7_setup: mcr p15, 0, r4, c2, c0, 1 @ load TTB1 mov r10, #0x1f @ domains 0, 1 = manager mcr p15, 0, r10, c3, c0, 0 @ load domain access register +#ifndef CONFIG_CPU_L2CACHE_DISABLE + @ L2 cache configuration in the L2 aux control register + mrc p15, 1, r10, c9, c0, 2 + bic r10, r10, #(1 << 16) @ L2 outer cache + mcr p15, 1, r10, c9, c0, 2 + @ L2 cache is enabled in the aux control register + mrc p15, 0, r10, c1, c0, 1 + orr r10, r10, #2 + mcr p15, 0, r10, c1, c0, 1 #endif - adr r5, v7_crval - ldmia r5, {r5, r6} - mrc p15, 0, r0, c1, c0, 0 @ read control register - bic r0, r0, r5 @ clear bits them - orr r0, r0, r6 @ set them + mrc p15, 0, r0, c1, c0, 0 @ read control register + ldr r10, cr1_clear @ get mask for bits to clear + bic r0, r0, r10 @ clear bits them + ldr r10, cr1_set @ get mask for bits to set + orr r0, r0, r10 @ set them mov pc, lr @ return to head.S:__ret /* @@ -195,9 +199,12 @@ __v7_setup: * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced * 0 110 0011 1.00 .111 1101 < we want */ - .type v7_crval, #object -v7_crval: - crval clear=0x0120c302, mmuset=0x00c0387d, ucset=0x00c0187c + .type cr1_clear, #object + .type cr1_set, #object +cr1_clear: + .word 0x0120c302 +cr1_set: + .word 0x00c0387d __v7_setup_stack: .space 4 * 11 @ 11 registers diff --git a/trunk/arch/arm/vfp/vfphw.S b/trunk/arch/arm/vfp/vfphw.S index 0ac022f800a1..d4b7b229631d 100644 --- a/trunk/arch/arm/vfp/vfphw.S +++ b/trunk/arch/arm/vfp/vfphw.S @@ -74,14 +74,14 @@ vfp_support_entry: VFPFMRX r1, FPEXC @ Is the VFP enabled? DBGSTR1 "fpexc %08x", r1 - tst r1, #FPEXC_EN + tst r1, #FPEXC_ENABLE bne look_for_VFP_exceptions @ VFP is already enabled DBGSTR1 "enable %x", r10 ldr r3, last_VFP_context_address - orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set + orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set ldr r4, [r3, r11, lsl #2] @ last_VFP_context pointer - bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled + bic r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled cmp r4, r10 beq check_for_exception @ we are returning to the same @ process, so the registers are @@ -124,7 +124,7 @@ no_old_VFP_process: VFPFMXR FPSCR, r5 @ restore status check_for_exception: - tst r1, #FPEXC_EX + tst r1, #FPEXC_EXCEPTION bne process_exception @ might as well handle the pending @ exception before retrying branch @ out before setting an FPEXC that @@ -136,10 +136,10 @@ check_for_exception: look_for_VFP_exceptions: - tst r1, #FPEXC_EX + tst r1, #FPEXC_EXCEPTION bne process_exception VFPFMRX r5, FPSCR - tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EX ! + tst r5, #FPSCR_IXE @ IXE doesn't set FPEXC_EXCEPTION ! bne process_exception @ Fall into hand on to next handler - appropriate coproc instr diff --git a/trunk/arch/arm/vfp/vfpmodule.c b/trunk/arch/arm/vfp/vfpmodule.c index 04ddab2bd876..1106b5f9cf19 100644 --- a/trunk/arch/arm/vfp/vfpmodule.c +++ b/trunk/arch/arm/vfp/vfpmodule.c @@ -53,7 +53,7 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) * case the thread migrates to a different CPU. The * restoring is done lazily. */ - if ((fpexc & FPEXC_EN) && last_VFP_context[cpu]) { + if ((fpexc & FPEXC_ENABLE) && last_VFP_context[cpu]) { vfp_save_state(last_VFP_context[cpu], fpexc); last_VFP_context[cpu]->hard.cpu = cpu; } @@ -70,7 +70,7 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) * Always disable VFP so we can lazily save/restore the * old state. */ - fmxr(FPEXC, fpexc & ~FPEXC_EN); + fmxr(FPEXC, fpexc & ~FPEXC_ENABLE); return NOTIFY_DONE; } @@ -81,13 +81,13 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) */ memset(vfp, 0, sizeof(union vfp_state)); - vfp->hard.fpexc = FPEXC_EN; + vfp->hard.fpexc = FPEXC_ENABLE; vfp->hard.fpscr = FPSCR_ROUND_NEAREST; /* * Disable VFP to ensure we initialise it first. */ - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); + fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); } /* flush and release case: Per-thread VFP cleanup. */ @@ -229,7 +229,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) /* * Enable access to the VFP so we can handle the bounce. */ - fmxr(FPEXC, fpexc & ~(FPEXC_EX|FPEXC_INV|FPEXC_UFC|FPEXC_IOC)); + fmxr(FPEXC, fpexc & ~(FPEXC_EXCEPTION|FPEXC_INV|FPEXC_UFC|FPEXC_IOC)); orig_fpscr = fpscr = fmrx(FPSCR); @@ -248,7 +248,7 @@ void VFP9_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) /* * Modify fpscr to indicate the number of iterations remaining */ - if (fpexc & FPEXC_EX) { + if (fpexc & FPEXC_EXCEPTION) { u32 len; len = fpexc + (1 << FPEXC_LENGTH_BIT); diff --git a/trunk/drivers/net/arm/ether1.c b/trunk/drivers/net/arm/ether1.c index 80f33b6d5713..f21148e7b579 100644 --- a/trunk/drivers/net/arm/ether1.c +++ b/trunk/drivers/net/arm/ether1.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -74,7 +75,7 @@ static void ether1_timeout(struct net_device *dev); /* ------------------------------------------------------------------------- */ -static char version[] __devinitdata = "ether1 ethernet driver (c) 2000 Russell King v1.07\n"; +static char version[] __initdata = "ether1 ethernet driver (c) 2000 Russell King v1.07\n"; #define BUS_16 16 #define BUS_8 8 diff --git a/trunk/drivers/net/arm/ether3.c b/trunk/drivers/net/arm/ether3.c index 3805506a3ab8..a7cac695a9bd 100644 --- a/trunk/drivers/net/arm/ether3.c +++ b/trunk/drivers/net/arm/ether3.c @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -68,7 +69,7 @@ #include #include -static char version[] __devinitdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n"; +static char version[] __initdata = "ether3 ethernet driver (c) 1995-2000 R.M.King v1.17\n"; #include "ether3.h" diff --git a/trunk/drivers/net/arm/etherh.c b/trunk/drivers/net/arm/etherh.c index 0d37d9d1fd78..769ba69451f4 100644 --- a/trunk/drivers/net/arm/etherh.c +++ b/trunk/drivers/net/arm/etherh.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/scsi/arm/cumana_1.c b/trunk/drivers/scsi/arm/cumana_1.c index 49d838e90a24..cf9a21cea6d9 100644 --- a/trunk/drivers/scsi/arm/cumana_1.c +++ b/trunk/drivers/scsi/arm/cumana_1.c @@ -24,7 +24,7 @@ #define CUMANASCSI_PUBLIC_RELEASE 1 -#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) +#define NCR5380_implementation_fields int port, ctrl #define NCR5380_local_declare() struct Scsi_Host *_instance #define NCR5380_setup(instance) _instance = instance #define NCR5380_read(reg) cumanascsi_read(_instance, reg) @@ -33,11 +33,6 @@ #define NCR5380_queue_command cumanascsi_queue_command #define NCR5380_proc_info cumanascsi_proc_info -#define NCR5380_implementation_fields \ - unsigned ctrl; \ - void __iomem *base; \ - void __iomem *dma - #define BOARD_NORMAL 0 #define BOARD_NCR53C400 1 @@ -52,163 +47,193 @@ const char *cumanascsi_info(struct Scsi_Host *spnt) return ""; } -#define CTRL 0x16fc -#define STAT 0x2004 -#define L(v) (((v)<<16)|((v) & 0x0000ffff)) -#define H(v) (((v)>>16)|((v) & 0xffff0000)) +#ifdef NOT_EFFICIENT +#define CTRL(p,v) outb(*ctrl = (v), (p) - 577) +#define STAT(p) inb((p)+1) +#define IN(p) inb((p)) +#define OUT(v,p) outb((v), (p)) +#else +#define CTRL(p,v) (p[-2308] = (*ctrl = (v))) +#define STAT(p) (p[4]) +#define IN(p) (*(p)) +#define IN2(p) ((unsigned short)(*(volatile unsigned long *)(p))) +#define OUT(v,p) (*(p) = (v)) +#define OUT2(v,p) (*((volatile unsigned long *)(p)) = (v)) +#endif +#define L(v) (((v)<<16)|((v) & 0x0000ffff)) +#define H(v) (((v)>>16)|((v) & 0xffff0000)) static inline int -NCR5380_pwrite(struct Scsi_Host *host, unsigned char *addr, int len) +NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, int len) { + int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl; + int oldctrl = *ctrl; unsigned long *laddr; - void __iomem *dma = priv(host)->dma + 0x2000; +#ifdef NOT_EFFICIENT + int iobase = instance->io_port; + int dma_io = iobase & ~(0x3C0000>>2); +#else + volatile unsigned char *iobase = (unsigned char *)ioaddr(instance->io_port); + volatile unsigned char *dma_io = (unsigned char *)((int)iobase & ~0x3C0000); +#endif if(!len) return 0; - writeb(0x02, priv(host)->base + CTRL); + CTRL(iobase, 0x02); laddr = (unsigned long *)addr; while(len >= 32) { - unsigned int status; + int status; unsigned long v; - status = readb(priv(host)->base + STAT); + status = STAT(iobase); if(status & 0x80) goto end; if(!(status & 0x40)) continue; - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); - v=*laddr++; writew(L(v), dma); writew(H(v), dma); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); + v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io); len -= 32; if(len == 0) break; } addr = (unsigned char *)laddr; - writeb(0x12, priv(host)->base + CTRL); - + CTRL(iobase, 0x12); while(len > 0) { - unsigned int status; - status = readb(priv(host)->base + STAT); + int status; + status = STAT(iobase); if(status & 0x80) goto end; if(status & 0x40) { - writeb(*addr++, dma); + OUT(*addr++, dma_io); if(--len == 0) break; } - status = readb(priv(host)->base + STAT); + status = STAT(iobase); if(status & 0x80) goto end; if(status & 0x40) { - writeb(*addr++, dma); + OUT(*addr++, dma_io); if(--len == 0) break; } } end: - writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); + CTRL(iobase, oldctrl|0x40); return len; } static inline int -NCR5380_pread(struct Scsi_Host *host, unsigned char *addr, int len) +NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr, int len) { + int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl; + int oldctrl = *ctrl; unsigned long *laddr; - void __iomem *dma = priv(host)->dma + 0x2000; +#ifdef NOT_EFFICIENT + int iobase = instance->io_port; + int dma_io = iobase & ~(0x3C0000>>2); +#else + volatile unsigned char *iobase = (unsigned char *)ioaddr(instance->io_port); + volatile unsigned char *dma_io = (unsigned char *)((int)iobase & ~0x3C0000); +#endif if(!len) return 0; - writeb(0x00, priv(host)->base + CTRL); + CTRL(iobase, 0x00); laddr = (unsigned long *)addr; while(len >= 32) { - unsigned int status; - status = readb(priv(host)->base + STAT); + int status; + status = STAT(iobase); if(status & 0x80) goto end; if(!(status & 0x40)) continue; - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); - *laddr++ = readw(dma) | (readw(dma) << 16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); + *laddr++ = IN2(dma_io)|(IN2(dma_io)<<16); len -= 32; if(len == 0) break; } addr = (unsigned char *)laddr; - writeb(0x10, priv(host)->base + CTRL); - + CTRL(iobase, 0x10); while(len > 0) { - unsigned int status; - status = readb(priv(host)->base + STAT); + int status; + status = STAT(iobase); if(status & 0x80) goto end; if(status & 0x40) { - *addr++ = readb(dma); + *addr++ = IN(dma_io); if(--len == 0) break; } - status = readb(priv(host)->base + STAT); + status = STAT(iobase); if(status & 0x80) goto end; if(status & 0x40) { - *addr++ = readb(dma); + *addr++ = IN(dma_io); if(--len == 0) break; } } end: - writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); + CTRL(iobase, oldctrl|0x40); return len; } -static unsigned char cumanascsi_read(struct Scsi_Host *host, unsigned int reg) -{ - void __iomem *base = priv(host)->base; - unsigned char val; +#undef STAT +#undef CTRL +#undef IN +#undef OUT - writeb(0, base + CTRL); +#define CTRL(p,v) outb(*ctrl = (v), (p) - 577) - val = readb(base + 0x2100 + (reg << 2)); +static char cumanascsi_read(struct Scsi_Host *instance, int reg) +{ + unsigned int iobase = instance->io_port; + int i; + int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl; - priv(host)->ctrl = 0x40; - writeb(0x40, base + CTRL); + CTRL(iobase, 0); + i = inb(iobase + 64 + reg); + CTRL(iobase, 0x40); - return val; + return i; } -static void cumanascsi_write(struct Scsi_Host *host, unsigned int reg, unsigned int value) +static void cumanascsi_write(struct Scsi_Host *instance, int reg, int value) { - void __iomem *base = priv(host)->base; - - writeb(0, base + CTRL); + int iobase = instance->io_port; + int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl; - writeb(value, base + 0x2100 + (reg << 2)); - - priv(host)->ctrl = 0x40; - writeb(0x40, base + CTRL); + CTRL(iobase, 0); + outb(value, iobase + 64 + reg); + CTRL(iobase, 0x40); } +#undef CTRL + #include "../NCR5380.c" static struct scsi_host_template cumanascsi_template = { @@ -231,46 +256,32 @@ static int __devinit cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id) { struct Scsi_Host *host; - int ret; - - ret = ecard_request_resources(ec); - if (ret) - goto out; + int ret = -ENOMEM; host = scsi_host_alloc(&cumanascsi_template, sizeof(struct NCR5380_hostdata)); - if (!host) { - ret = -ENOMEM; - goto out_release; - } - - priv(host)->base = ioremap(ecard_resource_start(ec, ECARD_RES_IOCSLOW), - ecard_resource_len(ec, ECARD_RES_IOCSLOW)); - priv(host)->dma = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), - ecard_resource_len(ec, ECARD_RES_MEMC)); - if (!priv(host)->base || !priv(host)->dma) { - ret = -ENOMEM; - goto out_unmap; - } + if (!host) + goto out; + host->io_port = ecard_address(ec, ECARD_IOC, ECARD_SLOW) + 0x800; host->irq = ec->irq; NCR5380_init(host, 0); - priv(host)->ctrl = 0; - writeb(0, priv(host)->base + CTRL); - host->n_io_port = 255; if (!(request_region(host->io_port, host->n_io_port, "CumanaSCSI-1"))) { ret = -EBUSY; - goto out_unmap; + goto out_free; } + ((struct NCR5380_hostdata *)host->hostdata)->ctrl = 0; + outb(0x00, host->io_port - 577); + ret = request_irq(host->irq, cumanascsi_intr, IRQF_DISABLED, "CumanaSCSI-1", host); if (ret) { printk("scsi%d: IRQ%d not free: %d\n", host->host_no, host->irq, ret); - goto out_unmap; + goto out_release; } printk("scsi%d: at port 0x%08lx irq %d", @@ -290,12 +301,10 @@ cumanascsi1_probe(struct expansion_card *ec, const struct ecard_id *id) out_free_irq: free_irq(host->irq, host); - out_unmap: - iounmap(priv(host)->base); - iounmap(priv(host)->dma); - scsi_host_put(host); out_release: - ecard_release_resources(ec); + release_region(host->io_port, host->n_io_port); + out_free: + scsi_host_put(host); out: return ret; } @@ -309,10 +318,8 @@ static void __devexit cumanascsi1_remove(struct expansion_card *ec) scsi_remove_host(host); free_irq(host->irq, host); NCR5380_exit(host); - iounmap(priv(host)->base); - iounmap(priv(host)->dma); + release_region(host->io_port, host->n_io_port); scsi_host_put(host); - ecard_release_resources(ec); } static const struct ecard_id cumanascsi1_cids[] = { diff --git a/trunk/drivers/scsi/arm/ecoscsi.c b/trunk/drivers/scsi/arm/ecoscsi.c index 5265a9884338..378e7af0c5d6 100644 --- a/trunk/drivers/scsi/arm/ecoscsi.c +++ b/trunk/drivers/scsi/arm/ecoscsi.c @@ -34,25 +34,35 @@ #include "../scsi.h" #include -#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) +#define NCR5380_implementation_fields int port, ctrl +#define NCR5380_local_declare() struct Scsi_Host *_instance +#define NCR5380_setup(instance) _instance = instance -#define NCR5380_local_declare() void __iomem *_base -#define NCR5380_setup(host) _base = priv(host)->base - -#define NCR5380_read(reg) ({ writeb(reg | 8, _base); readb(_base + 4); }) -#define NCR5380_write(reg, value) ({ writeb(reg | 8, _base); writeb(value, _base + 4); }) +#define NCR5380_read(reg) ecoscsi_read(_instance, reg) +#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value) #define NCR5380_intr ecoscsi_intr #define NCR5380_queue_command ecoscsi_queue_command #define NCR5380_proc_info ecoscsi_proc_info -#define NCR5380_implementation_fields \ - void __iomem *base - #include "../NCR5380.h" #define ECOSCSI_PUBLIC_RELEASE 1 +static char ecoscsi_read(struct Scsi_Host *instance, int reg) +{ + int iobase = instance->io_port; + outb(reg | 8, iobase); + return inb(iobase + 1); +} + +static void ecoscsi_write(struct Scsi_Host *instance, int reg, int value) +{ + int iobase = instance->io_port; + outb(reg | 8, iobase); + outb(value, iobase + 1); +} + /* * Function : ecoscsi_setup(char *str, int *ints) * @@ -72,6 +82,73 @@ const char * ecoscsi_info (struct Scsi_Host *spnt) return ""; } +#if 0 +#define STAT(p) inw(p + 144) + +static inline int NCR5380_pwrite(struct Scsi_Host *host, unsigned char *addr, + int len) +{ + int iobase = host->io_port; +printk("writing %p len %d\n",addr, len); + if(!len) return -1; + + while(1) + { + int status; + while(((status = STAT(iobase)) & 0x100)==0); + } +} + +static inline int NCR5380_pread(struct Scsi_Host *host, unsigned char *addr, + int len) +{ + int iobase = host->io_port; + int iobase2= host->io_port + 0x100; + unsigned char *start = addr; + int s; +printk("reading %p len %d\n",addr, len); + outb(inb(iobase + 128), iobase + 135); + while(len > 0) + { + int status,b,i, timeout; + timeout = 0x07FFFFFF; + while(((status = STAT(iobase)) & 0x100)==0) + { + timeout--; + if(status & 0x200 || !timeout) + { + printk("status = %p\n",status); + outb(0, iobase + 135); + return 1; + } + } + if(len >= 128) + { + for(i=0; i<64; i++) + { + b = inw(iobase + 136); + *addr++ = b; + *addr++ = b>>8; + } + len -= 128; + } + else + { + b = inw(iobase + 136); + *addr ++ = b; + len -= 1; + if(len) + *addr ++ = b>>8; + len -= 1; + } + } + outb(0, iobase + 135); + printk("first bytes = %02X %02X %02X %20X %02X %02X %02X\n",*start, start[1], start[2], start[3], start[4], start[5], start[6]); + return 1; +} +#endif +#undef STAT + #define BOARD_NORMAL 0 #define BOARD_NCR53C400 1 @@ -96,36 +173,25 @@ static struct Scsi_Host *host; static int __init ecoscsi_init(void) { - void __iomem *_base; - int ret; - if (!request_mem_region(0x33a0000, 4096, "ecoscsi")) { - ret = -EBUSY; - goto out; - } + host = scsi_host_alloc(tpnt, sizeof(struct NCR5380_hostdata)); + if (!host) + return 0; - _base = ioremap(0x33a0000, 4096); - if (!_base) { - ret = -ENOMEM; - goto out_release; - } + host->io_port = 0x80ce8000; + host->n_io_port = 144; + host->irq = IRQ_NONE; - NCR5380_write(MODE_REG, 0x20); /* Is it really SCSI? */ - if (NCR5380_read(MODE_REG) != 0x20) /* Write to a reg. */ - goto out_unmap; + if (!(request_region(host->io_port, host->n_io_port, "ecoscsi")) ) + goto unregister_scsi; - NCR5380_write(MODE_REG, 0x00); /* it back. */ - if (NCR5380_read(MODE_REG) != 0x00) - goto out_unmap; + ecoscsi_write(host, MODE_REG, 0x20); /* Is it really SCSI? */ + if (ecoscsi_read(host, MODE_REG) != 0x20) /* Write to a reg. */ + goto release_reg; - host = scsi_host_alloc(tpnt, sizeof(struct NCR5380_hostdata)); - if (!host) { - ret = -ENOMEM; - goto out_unmap; - } - - priv(host)->base = _base; - host->irq = IRQ_NONE; + ecoscsi_write(host, MODE_REG, 0x00 ); /* it back. */ + if (ecoscsi_read(host, MODE_REG) != 0x00) + goto release_reg; NCR5380_init(host, 0); @@ -140,20 +206,24 @@ static int __init ecoscsi_init(void) scsi_scan_host(host); return 0; - out_unmap: - iounmap(_base); - out_release: - release_mem_region(0x33a0000, 4096); - out: - return ret; +release_reg: + release_region(host->io_port, host->n_io_port); +unregister_scsi: + scsi_host_put(host); + return -ENODEV; } static void __exit ecoscsi_exit(void) { scsi_remove_host(host); + + if (shpnt->irq != IRQ_NONE) + free_irq(shpnt->irq, NULL); NCR5380_exit(host); + if (shpnt->io_port) + release_region(shpnt->io_port, shpnt->n_io_port); + scsi_host_put(host); - release_mem_region(0x33a0000, 4096); return 0; } diff --git a/trunk/drivers/scsi/arm/oak.c b/trunk/drivers/scsi/arm/oak.c index 849cdf89f7bb..c21b8392c928 100644 --- a/trunk/drivers/scsi/arm/oak.c +++ b/trunk/drivers/scsi/arm/oak.c @@ -23,18 +23,15 @@ #define OAKSCSI_PUBLIC_RELEASE 1 -#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) -#define NCR5380_local_declare() void __iomem *_base -#define NCR5380_setup(host) _base = priv(host)->base - -#define NCR5380_read(reg) readb(_base + ((reg) << 2)) -#define NCR5380_write(reg, value) writeb(value, _base + ((reg) << 2)) +#define NCR5380_read(reg) oakscsi_read(_instance, reg) +#define NCR5380_write(reg, value) oakscsi_write(_instance, reg, value) #define NCR5380_intr oakscsi_intr #define NCR5380_queue_command oakscsi_queue_command #define NCR5380_proc_info oakscsi_proc_info -#define NCR5380_implementation_fields \ - void __iomem *base +#define NCR5380_implementation_fields int port, ctrl +#define NCR5380_local_declare() struct Scsi_Host *_instance +#define NCR5380_setup(instance) _instance = instance #define BOARD_NORMAL 0 #define BOARD_NCR53C400 1 @@ -42,62 +39,60 @@ #include "../NCR5380.h" #undef START_DMA_INITIATOR_RECEIVE_REG -#define START_DMA_INITIATOR_RECEIVE_REG (128 + 7) +#define START_DMA_INITIATOR_RECEIVE_REG (7 + 128) const char * oakscsi_info (struct Scsi_Host *spnt) { return ""; } -#define STAT ((128 + 16) << 2) -#define DATA ((128 + 8) << 2) +#define STAT(p) inw(p + 144) +extern void inswb(int from, void *to, int len); static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, int len) { - void __iomem *base = priv(instance)->base; - + int iobase = instance->io_port; printk("writing %p len %d\n",addr, len); if(!len) return -1; while(1) { int status; - while (((status = readw(base + STAT)) & 0x100)==0); + while(((status = STAT(iobase)) & 0x100)==0); } } static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *addr, int len) { - void __iomem *base = priv(instance)->base; + int iobase = instance->io_port; printk("reading %p len %d\n", addr, len); while(len > 0) { - unsigned int status, timeout; + int status, timeout; unsigned long b; timeout = 0x01FFFFFF; - while (((status = readw(base + STAT)) & 0x100)==0) + while(((status = STAT(iobase)) & 0x100)==0) { timeout--; if(status & 0x200 || !timeout) { - printk("status = %08X\n", status); + printk("status = %08X\n",status); return 1; } } - if(len >= 128) { - readsw(base + DATA, addr, 128); + inswb(iobase + 136, addr, 128); addr += 128; len -= 128; } else { - b = (unsigned long) readw(base + DATA); + b = (unsigned long) inw(iobase + 136); *addr ++ = b; len -= 1; if(len) @@ -108,8 +103,10 @@ printk("reading %p len %d\n", addr, len); return 0; } +#define oakscsi_read(instance,reg) (inb((instance)->io_port + (reg))) +#define oakscsi_write(instance,reg,val) (outb((val), (instance)->io_port + (reg))) + #undef STAT -#undef DATA #include "../NCR5380.c" @@ -135,26 +132,18 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id) struct Scsi_Host *host; int ret = -ENOMEM; - ret = ecard_request_resources(ec); - if (ret) - goto out; - host = scsi_host_alloc(&oakscsi_template, sizeof(struct NCR5380_hostdata)); - if (!host) { - ret = -ENOMEM; - goto release; - } - - priv(host)->base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), - ecard_resource_len(ec, ECARD_RES_MEMC)); - if (!priv(host)->base) { - ret = -ENOMEM; - goto unreg; - } + if (!host) + goto out; + host->io_port = ecard_address(ec, ECARD_MEMC, 0); host->irq = IRQ_NONE; host->n_io_port = 255; + ret = -EBUSY; + if (!request_region (host->io_port, host->n_io_port, "Oak SCSI")) + goto unreg; + NCR5380_init(host, 0); printk("scsi%d: at port 0x%08lx irqs disabled", @@ -167,17 +156,15 @@ oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ret = scsi_add_host(host, &ec->dev); if (ret) - goto out_unmap; + goto out_release; scsi_scan_host(host); goto out; - out_unmap: - iounmap(priv(host)->base); + out_release: + release_region(host->io_port, host->n_io_port); unreg: scsi_host_put(host); - release: - ecard_release_resources(ec); out: return ret; } @@ -190,9 +177,8 @@ static void __devexit oakscsi_remove(struct expansion_card *ec) scsi_remove_host(host); NCR5380_exit(host); - iounmap(priv(host)->base); + release_region(host->io_port, host->n_io_port); scsi_host_put(host); - ecard_release_resources(ec); } static const struct ecard_id oakscsi_cids[] = { diff --git a/trunk/include/asm-arm/arch-sa1100/jornada720.h b/trunk/include/asm-arm/arch-sa1100/jornada720.h deleted file mode 100644 index 45d2bb59f9d0..000000000000 --- a/trunk/include/asm-arm/arch-sa1100/jornada720.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * include/asm-arm/arch-sa1100/jornada720.h - * - * This file contains SSP/MCU communication definitions for HP Jornada 710/720/728 - * - * Copyright (C) 2007 Kristoffer Ericson - * Copyright (C) 2000 John Ankcorn - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - */ - - /* HP Jornada 7xx microprocessor commands */ -#define GETBATTERYDATA 0xc0 -#define GETSCANKEYCODE 0x90 -#define GETTOUCHSAMPLES 0xa0 -#define GETCONTRAST 0xD0 -#define SETCONTRAST 0xD1 -#define GETBRIGHTNESS 0xD2 -#define SETBRIGHTNESS 0xD3 -#define CONTRASTOFF 0xD8 -#define BRIGHTNESSOFF 0xD9 -#define PWMOFF 0xDF -#define TXDUMMY 0x11 -#define ERRORCODE 0x00 diff --git a/trunk/include/asm-arm/elf.h b/trunk/include/asm-arm/elf.h index ec1c685562ce..d7a777f05088 100644 --- a/trunk/include/asm-arm/elf.h +++ b/trunk/include/asm-arm/elf.h @@ -1,14 +1,13 @@ #ifndef __ASMARM_ELF_H #define __ASMARM_ELF_H -#include - #ifndef __ASSEMBLY__ /* * ELF register definitions.. */ #include #include +#include typedef unsigned long elf_greg_t; typedef unsigned long elf_freg_t[3]; diff --git a/trunk/include/asm-arm/floppy.h b/trunk/include/asm-arm/floppy.h index d595c15166a4..54b5ae44ed94 100644 --- a/trunk/include/asm-arm/floppy.h +++ b/trunk/include/asm-arm/floppy.h @@ -30,21 +30,15 @@ #define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) #define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) -static inline int fd_dma_setup(void *data, unsigned int length, - unsigned int mode, unsigned long addr) -{ - set_dma_mode(DMA_FLOPPY, mode); - __set_dma_addr(DMA_FLOPPY, data); - set_dma_count(DMA_FLOPPY, length); - virtual_dma_port = addr; - enable_dma(DMA_FLOPPY); - return 0; -} -#define fd_dma_setup fd_dma_setup - #define fd_request_dma() request_dma(DMA_FLOPPY,"floppy") #define fd_free_dma() free_dma(DMA_FLOPPY) #define fd_disable_dma() disable_dma(DMA_FLOPPY) +#define fd_enable_dma() enable_dma(DMA_FLOPPY) +#define fd_clear_dma_ff() clear_dma_ff(DMA_FLOPPY) +#define fd_set_dma_mode(mode) set_dma_mode(DMA_FLOPPY, (mode)) +#define fd_set_dma_addr(addr) set_dma_addr(DMA_FLOPPY, virt_to_bus((addr))) +#define fd_set_dma_count(len) set_dma_count(DMA_FLOPPY, (len)) +#define fd_cacheflush(addr,sz) /* need to clean up dma.h */ #define DMA_FLOPPYDISK DMA_FLOPPY diff --git a/trunk/include/asm-arm/pgtable-nommu.h b/trunk/include/asm-arm/pgtable-nommu.h index b186bc820e30..0c8be19fd66b 100644 --- a/trunk/include/asm-arm/pgtable-nommu.h +++ b/trunk/include/asm-arm/pgtable-nommu.h @@ -102,8 +102,7 @@ extern int is_in_rom(unsigned long); #define v4_tlb_fns (0) #define v4wb_tlb_fns (0) #define v4wbi_tlb_fns (0) -#define v6wbi_tlb_fns (0) -#define v7wbi_tlb_fns (0) +#define v6_tlb_fns (0) #define v3_user_fns (0) #define v4_user_fns (0) diff --git a/trunk/include/asm-arm/thread_info.h b/trunk/include/asm-arm/thread_info.h index 69c65d56a6ac..eae85b09db2e 100644 --- a/trunk/include/asm-arm/thread_info.h +++ b/trunk/include/asm-arm/thread_info.h @@ -24,6 +24,7 @@ struct task_struct; struct exec_domain; +#include #include #include diff --git a/trunk/include/asm-arm/unistd.h b/trunk/include/asm-arm/unistd.h index d327b25c986c..bfdbebebdc1b 100644 --- a/trunk/include/asm-arm/unistd.h +++ b/trunk/include/asm-arm/unistd.h @@ -441,6 +441,7 @@ /* * Unimplemented (or alternatively implemented) syscalls */ +#define __IGNORE_sync_file_range 1 #define __IGNORE_fadvise64_64 1 #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-arm/vfp.h b/trunk/include/asm-arm/vfp.h index bd6be9d7f772..14c5e0946c47 100644 --- a/trunk/include/asm-arm/vfp.h +++ b/trunk/include/asm-arm/vfp.h @@ -26,8 +26,8 @@ #define FPSID_REV_MASK (0xF << FPSID_REV_BIT) /* FPEXC bits */ -#define FPEXC_EX (1 << 31) -#define FPEXC_EN (1 << 30) +#define FPEXC_EXCEPTION (1<<31) +#define FPEXC_ENABLE (1<<30) /* FPSCR bits */ #define FPSCR_DEFAULT_NAN (1<<25)