Commit cc9dc0dc authored by James Bottomley's avatar James Bottomley

Merge mulgrave.(none):/home/jejb/BK/linux-2.5

into mulgrave.(none):/home/jejb/BK/scsi-for-linus-2.5
parents 0af9479e d3131293
...@@ -222,7 +222,7 @@ config SA1111 ...@@ -222,7 +222,7 @@ config SA1111
config FORCE_MAX_ZONEORDER config FORCE_MAX_ZONEORDER
int int
depends on ASSABET_NEPONSET || SA1100_ADSBITSY || SA1100_BADGE4 || SA1100_CONSUS || SA1100_GRAPHICSMASTER || SA1100_JORNADA720 || ARCH_LUBBOCK || SA1100_PFS168 || SA1100_PT_SYSTEM3 || SA1100_XP860 depends on SA1111
default "9" default "9"
comment "Processor Type" comment "Processor Type"
...@@ -1043,11 +1043,6 @@ config KBDMOUSE ...@@ -1043,11 +1043,6 @@ config KBDMOUSE
depends on ARCH_ACORN && BUSMOUSE=y && !ARCH_RPC depends on ARCH_ACORN && BUSMOUSE=y && !ARCH_RPC
default y default y
config RPCMOUSE
bool
depends on ARCH_ACORN && BUSMOUSE=y && ARCH_RPC
default y
source "drivers/media/Kconfig" source "drivers/media/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
......
...@@ -34,14 +34,12 @@ apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 ...@@ -34,14 +34,12 @@ apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3
# Note that GCC is lame - it doesn't numerically define an # Note that GCC is lame - it doesn't numerically define an
# architecture version macro, but instead defines a whole # architecture version macro, but instead defines a whole
# series of macros. # series of macros.
arch-y :=
arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3 arch-$(CONFIG_CPU_32v3) :=-D__LINUX_ARM_ARCH__=3 -march=armv3
arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 -march=armv5 arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 -march=armv5
arch-$(CONFIG_CPU_XSCALE) :=-D__LINUX_ARM_ARCH__=5 -march=armv4 -Wa,-mxscale #-march=armv5te arch-$(CONFIG_CPU_XSCALE) :=-D__LINUX_ARM_ARCH__=5 -march=armv4 -Wa,-mxscale #-march=armv5te
# This selects how we optimise for the processor. # This selects how we optimise for the processor.
tune-y :=
tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610 tune-$(CONFIG_CPU_ARM610) :=-mtune=arm610
tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710 tune-$(CONFIG_CPU_ARM710) :=-mtune=arm710
tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi tune-$(CONFIG_CPU_ARM720T) :=-mtune=arm7tdmi
...@@ -58,123 +56,67 @@ CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa, ...@@ -58,123 +56,67 @@ CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,
CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu
AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float -Wa,-mno-fpu AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float -Wa,-mno-fpu
#Default value
DATAADDR := .
ifeq ($(CONFIG_CPU_26),y) ifeq ($(CONFIG_CPU_26),y)
PROCESSOR := armo PROCESSOR := armo
HEAD := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o HEAD := arch/arm/mach-arc/head.o arch/arm/kernel/init_task.o
LDFLAGS_BLOB += --oformat elf26-littlearm LDFLAGS_BLOB += --oformat elf26-littlearm
ifeq ($(CONFIG_ROM_KERNEL),y) ifeq ($(CONFIG_ROM_KERNEL),y)
DATAADDR = 0x02080000 DATAADDR := 0x02080000
TEXTADDR = 0x03800000 textaddr-y := 0x03800000
else else
TEXTADDR = 0x02080000 textaddr-y := 0x02080000
endif endif
endif endif
ifeq ($(CONFIG_CPU_32),y) ifeq ($(CONFIG_CPU_32),y)
PROCESSOR = armv PROCESSOR := armv
HEAD := arch/arm/kernel/head.o arch/arm/kernel/init_task.o HEAD := arch/arm/kernel/head.o arch/arm/kernel/init_task.o
TEXTADDR = 0xC0008000
LDFLAGS_BLOB += --oformat elf32-littlearm LDFLAGS_BLOB += --oformat elf32-littlearm
endif textaddr-y := 0xC0008000
endif
ifeq ($(CONFIG_ARCH_ARCA5K),y)
MACHINE = arc machine-$(CONFIG_ARCH_ARCA5K) := arc
endif machine-$(CONFIG_ARCH_RPC) := rpc
machine-$(CONFIG_ARCH_EBSA110) := ebsa110
ifeq ($(CONFIG_ARCH_RPC),y) machine-$(CONFIG_ARCH_CLPS7500) := clps7500
MACHINE = rpc incdir-$(CONFIG_ARCH_CLPS7500) := cl7500
endif machine-$(CONFIG_FOOTBRIDGE) := footbridge
incdir-$(CONFIG_FOOTBRIDGE) := ebsa285
ifeq ($(CONFIG_ARCH_EBSA110),y) textaddr-$(CONFIG_ARCH_CO285) := 0x60008000
MACHINE = ebsa110 machine-$(CONFIG_ARCH_CO285) := footbridge
endif incdir-$(CONFIG_ARCH_CO285) := ebsa285
machine-$(CONFIG_ARCH_FTVPCI) := ftvpci
ifeq ($(CONFIG_ARCH_CLPS7500),y) incdir-$(CONFIG_ARCH_FTVPCI) := nexuspci
MACHINE = clps7500 machine-$(CONFIG_ARCH_TBOX) := tbox
INCDIR = cl7500 machine-$(CONFIG_ARCH_SHARK) := shark
endif machine-$(CONFIG_ARCH_SA1100) := sa1100
ifeq ($(CONFIG_FOOTBRIDGE),y)
MACHINE = footbridge
INCDIR = ebsa285
endif
ifeq ($(CONFIG_ARCH_CO285),y)
TEXTADDR = 0x60008000
MACHINE = footbridge
INCDIR = ebsa285
endif
ifeq ($(CONFIG_ARCH_FTVPCI),y)
MACHINE = ftvpci
INCDIR = nexuspci
endif
ifeq ($(CONFIG_ARCH_TBOX),y)
MACHINE = tbox
endif
ifeq ($(CONFIG_ARCH_SHARK),y)
MACHINE = shark
endif
ifeq ($(CONFIG_ARCH_SA1100),y) ifeq ($(CONFIG_ARCH_SA1100),y)
ifeq ($(CONFIG_SA1111),y)
# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
TEXTADDR = 0xc0208000 textaddr-$(CONFIG_SA1111) := 0xc0208000
endif endif
MACHINE = sa1100 machine-$(CONFIG_ARCH_PXA) := pxa
endif machine-$(CONFIG_ARCH_L7200) := l7200
machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
ifeq ($(CONFIG_ARCH_PXA),y) machine-$(CONFIG_ARCH_CAMELOT) := epxa10db
MACHINE = pxa textaddr-$(CONFIG_ARCH_CLPS711X) := 0xc0028000
endif machine-$(CONFIG_ARCH_CLPS711X) := clps711x
textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000
ifeq ($(CONFIG_ARCH_L7200),y) machine-$(CONFIG_ARCH_ANAKIN) := anakin
MACHINE = l7200 machine-$(CONFIG_ARCH_IOP310) := iop310
endif machine-$(CONFIG_ARCH_ADIFCC) := adifcc
ifeq ($(CONFIG_ARCH_INTEGRATOR),y) MACHINE := $(machine-y)
MACHINE = integrator TEXTADDR := $(textaddr-y)
endif ifeq ($(incdir-y),)
incdir-y := $(MACHINE)
ifeq ($(CONFIG_ARCH_CAMELOT),y) endif
MACHINE = epxa10db INCDIR := $(incdir-y)
endif
ifeq ($(CONFIG_ARCH_CLPS711X),y)
TEXTADDR = 0xc0028000
MACHINE = clps711x
endif
ifeq ($(CONFIG_ARCH_FORTUNET),y)
TEXTADDR = 0xc0008000
endif
ifeq ($(CONFIG_ARCH_ANAKIN),y)
MACHINE = anakin
endif
ifeq ($(CONFIG_ARCH_IOP310),y)
MACHINE = iop310
endif
ifeq ($(CONFIG_ARCH_ADIFCC),y)
MACHINE = adifcc
endif
export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT
# Only set INCDIR if its not already defined above
# Grr, ?= doesn't work as all the other assignment operators do. Make bug?
ifeq ($(origin INCDIR), undefined)
INCDIR :=$(MACHINE)
endif
ifeq ($(origin DATAADDR), undefined)
DATAADDR := .
endif
# Do we have FASTFPE? # Do we have FASTFPE?
FASTFPE :=arch/arm/fastfpe FASTFPE :=arch/arm/fastfpe
ifeq ($(FASTFPE),$(wildcard $(FASTFPE))) ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
...@@ -194,7 +136,10 @@ drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/ ...@@ -194,7 +136,10 @@ drivers-$(CONFIG_ARCH_L7200) += drivers/acorn/char/
libs-y += arch/arm/lib/ libs-y += arch/arm/lib/
makeboot = $(call descend,arch/arm/boot,$(1)) # Default target when executing plain make
all: zImage
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/arm/boot $(1)
# Update machine arch and proc symlinks if something which affects # Update machine arch and proc symlinks if something which affects
# them changed. We use .arch and .proc to indicate when they were # them changed. We use .arch and .proc to indicate when they were
...@@ -217,13 +162,17 @@ prepare: maketools ...@@ -217,13 +162,17 @@ prepare: maketools
.PHONY: maketools FORCE .PHONY: maketools FORCE
maketools: include/asm-arm/.arch include/asm-arm/.proc \ maketools: include/asm-arm/.arch include/asm-arm/.proc \
include/asm-arm/constants.h include/linux/version.h FORCE include/asm-arm/constants.h include/linux/version.h FORCE
+@$(call descend,arch/arm/tools, include/asm-arm/mach-types.h) $(Q)$(MAKE) -f scripts/Makefile.build obj=arch/arm/tools include/asm-arm/mach-types.h
# Convert bzImage to zImage
bzImage: vmlinux
$(call makeboot,arch/arm/boot/zImage)
zImage Image bootpImage: vmlinux zImage Image bootpImage: vmlinux
+@$(call makeboot,arch/arm/boot/$@) $(call makeboot,arch/arm/boot/$@)
bzImage zinstall install: vmlinux zinstall install: vmlinux
+@$(call makeboot,$@) $(call makeboot,$@)
MRPROPER_FILES += \ MRPROPER_FILES += \
include/asm-arm/arch include/asm-arm/.arch \ include/asm-arm/arch include/asm-arm/.arch \
...@@ -233,15 +182,15 @@ MRPROPER_FILES += \ ...@@ -233,15 +182,15 @@ MRPROPER_FILES += \
# We use MRPROPER_FILES and CLEAN_FILES now # We use MRPROPER_FILES and CLEAN_FILES now
archmrproper: archmrproper:
archclean: FORCE archclean:
+@$(call makeboot,clean) $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/arm/boot
# My testing targets (that short circuit a few dependencies) # My testing targets (that short circuit a few dependencies)
zImg:; +@$(call makeboot, zImage) zImg:; $(call makeboot, arch/arm/boot/zImage)
Img:; +@$(call makeboot, Image) Img:; $(call makeboot, arch/arm/boot/Image)
i:; +@$(call makeboot, install) bp:; $(call makeboot, arch/arm/boot/bootpImage)
zi:; +@$(call makeboot, zinstall) i:; $(call makeboot, install)
bp:; +@$(call makeboot, bootpImage) zi:; $(call makeboot, zinstall)
# #
# Configuration targets. Use these to select a # Configuration targets. Use these to select a
...@@ -261,10 +210,9 @@ bp:; +@$(call makeboot, bootpImage) ...@@ -261,10 +210,9 @@ bp:; +@$(call makeboot, bootpImage)
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER include/config/MARKER
@:
include/asm-$(ARCH)/constants.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/constants.h: include/asm-$(ARCH)/constants.h.tmp
@echo -n ' Generating $@' @echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed) @$(update-if-changed)
...@@ -13,132 +13,81 @@ ...@@ -13,132 +13,81 @@
# PARAMS_PHYS must be with 4MB of ZRELADDR # PARAMS_PHYS must be with 4MB of ZRELADDR
# INITRD_PHYS must be in RAM # INITRD_PHYS must be in RAM
ifeq ($(CONFIG_CPU_26),y) zreladdr-$(CONFIG_CPU_26) := 0x02080000
ZRELADDR = 0x02080000 params_phys-$(CONFIG_CPU_26) := 0x0207c000
PARAMS_PHYS = 0x0207c000 initrd_phys-$(CONFIG_CPU_26) := 0x02180000
INITRD_PHYS = 0x02180000 zreladdr-$(CONFIG_ARCH_RPC) := 0x10008000
endif params_phys-$(CONFIG_ARCH_RPC) := 0x10000100
initrd_phys-$(CONFIG_ARCH_RPC) := 0x18000000
ifeq ($(CONFIG_ARCH_RPC),y) zreladdr-$(CONFIG_ARCH_CLPS7500) := 0x10008000
ZRELADDR = 0x10008000 zreladdr-$(CONFIG_ARCH_CLPS7500) := 0x10008000
PARAMS_PHYS = 0x10000100 zreladdr-$(CONFIG_ARCH_EBSA110) := 0x00008000
INITRD_PHYS = 0x18000000 params_phys-$(CONFIG_ARCH_EBSA110) := 0x00000400
endif initrd_phys-$(CONFIG_ARCH_EBSA110) := 0x00800000
ztextaddr-$(CONFIG_ARCH_SHARK) := 0x08508000
ifeq ($(CONFIG_ARCH_CLPS7500),y) zreladdr-$(CONFIG_ARCH_SHARK) := 0x08008000
ZRELADDR = 0x10008000 zreladdr-$(CONFIG_FOOTBRIDGE) := 0x00008000
endif params_phys-$(CONFIG_FOOTBRIDGE) := 0x00000100
initrd_phys-$(CONFIG_FOOTBRIDGE) := 0x00800000
ifeq ($(CONFIG_ARCH_EBSA110),y) zreladdr-$(CONFIG_ARCH_INTEGRATOR) := 0x00008000
ZRELADDR = 0x00008000 params_phys-$(CONFIG_ARCH_INTEGRATOR) := 0x00000100
PARAMS_PHYS = 0x00000400 initrd_phys-$(CONFIG_ARCH_INTEGRATOR) := 0x00800000
INITRD_PHYS = 0x00800000 zreladdr-$(CONFIG_ARCH_CAMELOT) := 0x00008000
endif zreladdr-$(CONFIG_ARCH_NEXUSPCI) := 0x40008000
zreladdr-$(CONFIG_ARCH_L7200) := 0xf0008000
ifeq ($(CONFIG_ARCH_SHARK),y)
ZTEXTADDR = 0x08508000
ZRELADDR = 0x08008000
endif
ifeq ($(CONFIG_FOOTBRIDGE),y)
ZRELADDR = 0x00008000
PARAMS_PHYS = 0x00000100
INITRD_PHYS = 0x00800000
endif
ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
ZRELADDR = 0x00008000
PARAMS_PHYS = 0x00000100
INITRD_PHYS = 0x00800000
endif
ifeq ($(CONFIG_ARCH_CAMELOT),y)
ZRELADDR = 0x00008000
endif
ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
ZRELADDR = 0x40008000
endif
ifeq ($(CONFIG_ARCH_L7200),y)
ZRELADDR = 0xf0008000
endif
# The standard locations for stuff on CLPS711x type processors # The standard locations for stuff on CLPS711x type processors
ifeq ($(CONFIG_ARCH_CLPS711X),y) zreladdr-$(CONFIG_ARCH_CLPS711X) := 0xc0028000
ZRELADDR = 0xc0028000 params_phys-$(CONFIG_ARCH_CLPS711X) := 0xc0000100
PARAMS_PHYS = 0xc0000100
endif
# Should probably have some agreement on these... # Should probably have some agreement on these...
ifeq ($(CONFIG_ARCH_P720T),y) initrd_phys-$(CONFIG_ARCH_P720T) := 0xc0400000
INITRD_PHYS = 0xc0400000 initrd_phys-$(CONFIG_ARCH_CDB89712) := 0x00700000
endif zreladdr-$(CONFIG_ARCH_SA1100) := 0xc0008000
ifeq ($(CONFIG_ARCH_CDB89712),y)
INITRD_PHYS = 0x00700000
endif
ifeq ($(CONFIG_ARCH_SA1100),y) ifeq ($(CONFIG_ARCH_SA1100),y)
ZRELADDR = 0xc0008000 zreladdr-$(CONFIG_SA1111) := 0xc0208000
# No defconfig file to move this into...
#ifeq ($(CONFIG_SA1100_YOPY),y)
# ZTEXTADDR = 0x00080000
# ZBSSADDR = 0xc0200000
#endif
ifeq ($(CONFIG_SA1111),y)
ZRELADDR = 0xc0208000
endif
endif
ifeq ($(CONFIG_ARCH_PXA),y)
ZRELADDR = 0xa0008000
endif
ifeq ($(CONFIG_ARCH_ANAKIN),y)
ZRELADDR = 0x20008000
endif
ifeq ($(CONFIG_ARCH_IQ80310),y)
ZRELADDR = 0xa0008000
endif
ifeq ($(CONFIG_ARCH_ADIFCC),y)
ZRELADDR = 0xc0008000
endif endif
zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000
zreladdr-$(CONFIG_ARCH_ANAKIN) := 0x20008000
zreladdr-$(CONFIG_ARCH_IQ80310) := 0xa0008000
zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000
ZRELADDR := $(zreladdr-y)
ZTEXTADDR := $(ztextaddr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)
# #
# We now have a PIC decompressor implementation. Decompressors running # We now have a PIC decompressor implementation. Decompressors running
# from RAM should not define ZTEXTADDR. Decompressors running directly # from RAM should not define ZTEXTADDR. Decompressors running directly
# from ROM or Flash must define ZTEXTADDR (preferably via the config) # from ROM or Flash must define ZTEXTADDR (preferably via the config)
# # FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
ifeq ($(CONFIG_ZBOOT_ROM),y) ifeq ($(CONFIG_ZBOOT_ROM),y)
ZTEXTADDR =$(CONFIG_ZBOOT_ROM_TEXT) ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
ZBSSADDR =$(CONFIG_ZBOOT_ROM_BSS) ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
else else
ZTEXTADDR =0 ZTEXTADDR := 0
ZBSSADDR =ALIGN(4) ZBSSADDR := ALIGN(4)
endif endif
export ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS PARAMS_PHYS export ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS PARAMS_PHYS
include $(TOPDIR)/Rules.make EXTRA_TARGETS := Image zImage bootpImage
$(obj)/Image: vmlinux FORCE $(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
@echo ' Kernel: $@ is ready'
bzImage: $(obj)/zImage
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
@echo ' Kernel: $@ is ready'
$(obj)/bootpImage: $(obj)/bootp/bootp FORCE $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
$(call if_changed,objcopy) $(call if_changed,objcopy)
@echo ' Kernel: $@ is ready'
$(obj)/compressed/vmlinux: vmlinux FORCE $(obj)/compressed/vmlinux: vmlinux FORCE
+@$(call descend,arch/arm/boot/compressed, $(obj)/compressed/vmlinux) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@
$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
+@$(call descend,arch/arm/boot/bootp, $(obj)/bootp/bootp) $(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@
.PHONY: initrd .PHONY: initrd
initrd: initrd:
...@@ -157,19 +106,16 @@ zinstall: $(obj)/zImage ...@@ -157,19 +106,16 @@ zinstall: $(obj)/zImage
$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) \ $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) \
$(obj)/zImage System.map "$(INSTALL_PATH)" $(obj)/zImage System.map "$(INSTALL_PATH)"
clean: clean-files := $(addprefix $(obj)/,Image zImage bootpImage)
$(RM) $(addprefix $(obj)/,Image zImage bootpImage) subdir- := bootp compressed
+@$(call descend,arch/arm/boot/bootp, clean)
+@$(call descend,arch/arm/boot/compressed, clean)
archhelp: archhelp:
@echo '* bzImage/zImage- Compressed kernel image (arch/$(ARCH)/boot/zImage)' @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
@echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' @echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
@echo ' bootpImage - Combined zImage and initial RAM disk' @echo ' bootpImage - Combined zImage and initial RAM disk'
@echo ' initrd - Create an initial image'
@echo ' install - Install uncompressed kernel' @echo ' install - Install uncompressed kernel'
@echo ' zinstall - Install compressed kernel' @echo ' zinstall - Install compressed kernel'
@echo ' Install using (your) ~/bin/installkernel or' @echo ' Install using (your) ~/bin/installkernel or'
@echo ' (distribution) /sbin/installkernel or' @echo ' (distribution) /sbin/installkernel or'
@echo ' install to $$(INSTALL_PATH) and run lilo' @echo ' install to $$(INSTALL_PATH) and run lilo'
...@@ -9,8 +9,6 @@ ZLDFLAGS =-p -X -T $(obj)/bootp.lds \ ...@@ -9,8 +9,6 @@ ZLDFLAGS =-p -X -T $(obj)/bootp.lds \
EXTRA_TARGETS := bootp EXTRA_TARGETS := bootp
include $(TOPDIR)/Rules.make
# Note that bootp.lds picks up kernel.o and initrd.o # Note that bootp.lds picks up kernel.o and initrd.o
$(obj)/bootp: $(addprefix $(obj)/,init.o kernel.o initrd.o bootp.lds) $(obj)/bootp: $(addprefix $(obj)/,init.o kernel.o initrd.o bootp.lds)
$(LD) $(ZLDFLAGS) -o $@ $(obj)/init.o $(LD) $(ZLDFLAGS) -o $@ $(obj)/init.o
...@@ -22,5 +20,3 @@ $(obj)/initrd.o: $(INITRD) ...@@ -22,5 +20,3 @@ $(obj)/initrd.o: $(INITRD)
$(LD) -r -s -o $@ -b binary $(INITRD) $(LD) -r -s -o $@ -b binary $(INITRD)
.PHONY: $(INITRD) $(ZSYSTEM) .PHONY: $(INITRD) $(ZSYSTEM)
clean:; $(RM) $(obj)/bootp
...@@ -63,28 +63,30 @@ ifeq ($(CONFIG_CPU_XSCALE),y) ...@@ -63,28 +63,30 @@ ifeq ($(CONFIG_CPU_XSCALE),y)
OBJS += head-xscale.o OBJS += head-xscale.o
endif endif
SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;\ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
s/BSS_START/$(ZBSSADDR)/;s#OBJ#$(obj)#
EXTRA_TARGETS := vmlinux piggy.o font.o head.o $(OBJS) EXTRA_TARGETS := vmlinux vmlinux.lds piggy piggy.gz\
piggy.o font.o head.o $(OBJS)
EXTRA_CFLAGS := $(CFLAGS_BOOT) -fpic EXTRA_CFLAGS := $(CFLAGS_BOOT) -fpic
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
include $(TOPDIR)/Rules.make
LDFLAGS_vmlinux := -p -X \ LDFLAGS_vmlinux := -p -X \
$(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \ $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
$(addprefix $(obj)/, $(OBJS)) $(addprefix $(obj)/, $(OBJS)) FORCE
$(call if_changed,ld) $(call if_changed,ld)
@:
$(obj)/piggy: vmlinux FORCE
$(call if_changed,objcopy)
$(obj)/piggy: vmlinux; $(call if_changed,objcopy) $(obj)/piggy.gz: $(obj)/piggy FORCE
$(obj)/piggy.gz: $(obj)/piggy; $(call if_changed,gzip) $(call if_changed,gzip)
LDFLAGS_piggy.o := -r -b binary LDFLAGS_piggy.o := -r -b binary
$(obj)/piggy.o: $(obj)/piggy.gz $(obj)/piggy.o: $(obj)/piggy.gz FORCE
$(call if_changed,ld) $(call if_changed,ld)
CFLAGS_font.o := -Dstatic= CFLAGS_font.o := -Dstatic=
...@@ -93,9 +95,7 @@ $(obj)/font.o: $(FONTC) ...@@ -93,9 +95,7 @@ $(obj)/font.o: $(FONTC)
$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config
@sed "$(SEDFLAGS)" < $< > $@ @sed "$(SEDFLAGS)" < $< > $@
.PHONY: clean clean-files := $(addprefix $(obj)/,vmlinux piggy* vmlinux.lds)
clean:
rm -f $(addprefix $(obj)/,vmlinux core piggy* vmlinux.lds)
$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c $(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
* arch/arm/kernel/dma-ebsa285.c * arch/arm/kernel/dma-ebsa285.c
* Copyright (C) 1998 Phil Blundell * Copyright (C) 1998 Phil Blundell
*/ */
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
...@@ -989,42 +989,6 @@ ecard_probe(int slot, card_type_t type) ...@@ -989,42 +989,6 @@ ecard_probe(int slot, card_type_t type)
return rc; return rc;
} }
static ecard_t *finding_pos;
void ecard_startfind(void)
{
finding_pos = NULL;
}
ecard_t *ecard_find(int cid, const card_ids *cids)
{
if (!finding_pos)
finding_pos = cards;
else
finding_pos = finding_pos->next;
for (; finding_pos; finding_pos = finding_pos->next) {
if (finding_pos->claimed)
continue;
if (finding_pos->dev.driver)
continue;
if (!cids) {
if ((finding_pos->cid.id ^ cid) == 0)
break;
} else {
const struct ecard_id *id;
id = ecard_match_device(cids, finding_pos);
if (id)
break;
}
}
return finding_pos;
}
/* /*
* Initialise the expansion card system. * Initialise the expansion card system.
* Locate all hardware - interrupt management and * Locate all hardware - interrupt management and
...@@ -1087,10 +1051,15 @@ static int ecard_drv_probe(struct device *dev) ...@@ -1087,10 +1051,15 @@ static int ecard_drv_probe(struct device *dev)
struct expansion_card *ec = ECARD_DEV(dev); struct expansion_card *ec = ECARD_DEV(dev);
struct ecard_driver *drv = ECARD_DRV(dev->driver); struct ecard_driver *drv = ECARD_DRV(dev->driver);
const struct ecard_id *id; const struct ecard_id *id;
int ret;
id = ecard_match_device(drv->id_table, ec); id = ecard_match_device(drv->id_table, ec);
return drv->probe(ec, id); ecard_claim(ec);
ret = drv->probe(ec, id);
if (ret)
ecard_release(ec);
return ret;
} }
static int ecard_drv_remove(struct device *dev) static int ecard_drv_remove(struct device *dev)
...@@ -1099,6 +1068,7 @@ static int ecard_drv_remove(struct device *dev) ...@@ -1099,6 +1068,7 @@ static int ecard_drv_remove(struct device *dev)
struct ecard_driver *drv = ECARD_DRV(dev->driver); struct ecard_driver *drv = ECARD_DRV(dev->driver);
drv->remove(ec); drv->remove(ec);
ecard_release(ec);
return 0; return 0;
} }
...@@ -1144,12 +1114,8 @@ static int ecard_bus_init(void) ...@@ -1144,12 +1114,8 @@ static int ecard_bus_init(void)
postcore_initcall(ecard_bus_init); postcore_initcall(ecard_bus_init);
EXPORT_SYMBOL(ecard_startfind);
EXPORT_SYMBOL(ecard_find);
EXPORT_SYMBOL(ecard_readchunk); EXPORT_SYMBOL(ecard_readchunk);
EXPORT_SYMBOL(ecard_address); EXPORT_SYMBOL(ecard_address);
EXPORT_SYMBOL(ecard_register_driver); EXPORT_SYMBOL(ecard_register_driver);
EXPORT_SYMBOL(ecard_remove_driver); EXPORT_SYMBOL(ecard_remove_driver);
EXPORT_SYMBOL(ecard_bus_type); EXPORT_SYMBOL(ecard_bus_type);
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel_stat.h> #include <linux/kernel_stat.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
...@@ -661,7 +660,7 @@ unsigned int probe_irq_mask(unsigned long irqs) ...@@ -661,7 +660,7 @@ unsigned int probe_irq_mask(unsigned long irqs)
unsigned int mask = 0, i; unsigned int mask = 0, i;
spin_lock_irq(&irq_controller_lock); spin_lock_irq(&irq_controller_lock);
for(i = 0; i < 16 && i < NR_IRQS; i++) for (i = 0; i < 16 && i < NR_IRQS; i++)
if (irq_desc[i].probing && irq_desc[i].triggered) if (irq_desc[i].probing && irq_desc[i].triggered)
mask |= 1 << i; mask |= 1 << i;
spin_unlock_irq(&irq_controller_lock); spin_unlock_irq(&irq_controller_lock);
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
* 10-Oct-1996 RMK Brought up to date with arch-sa110eval * 10-Oct-1996 RMK Brought up to date with arch-sa110eval
* 04-Dec-1997 RMK Updated for new arch/arm/time.c * 04-Dec-1997 RMK Updated for new arch/arm/time.c
*/ */
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/time.h> #include <linux/time.h>
......
#include <linux/config.h> #include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <asm/types.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* support for PCI though. * support for PCI though.
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
*/ */
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
* DMA functions specific to Archimedes and A5000 architecture * DMA functions specific to Archimedes and A5000 architecture
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -17,17 +17,9 @@ ...@@ -17,17 +17,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mman.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/mach/dma.h> #include <asm/mach/dma.h>
void __init arch_dma_init(dma_t *dma) void __init arch_dma_init(dma_t *dma)
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/blk.h> #include <linux/blk.h>
...@@ -32,7 +30,6 @@ ...@@ -32,7 +30,6 @@
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/amba_kmi.h>
extern void clps711x_map_io(void); extern void clps711x_map_io(void);
extern void clps711x_init_irq(void); extern void clps711x_init_irq(void);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/config.h> #include <linux/config.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/sched.h> #include <linux/timex.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -19,12 +19,9 @@ ...@@ -19,12 +19,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
......
...@@ -18,17 +18,9 @@ ...@@ -18,17 +18,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mman.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/mach/dma.h> #include <asm/mach/dma.h>
void __init arch_dma_init(dma_t *dma) void __init arch_dma_init(dma_t *dma)
......
...@@ -9,13 +9,11 @@ ...@@ -9,13 +9,11 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
extern int (*set_rtc)(void); extern int (*set_rtc)(void);
static int epxa10db_set_rtc(void) static int epxa10db_set_rtc(void)
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* *
* Copyright (C) 1998, 1999 Russell King, Phil Blundell * Copyright (C) 1998, 1999 Russell King, Phil Blundell
*/ */
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
* ISA DMA controllers. * ISA DMA controllers.
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
* 26-Jan-1999 PJB Don't use IACK on CATS * 26-Jan-1999 PJB Don't use IACK on CATS
* 16-Mar-1999 RMK Added autodetect of ISA PICs * 16-Mar-1999 RMK Added autodetect of ISA PICs
*/ */
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
* 26-Jan-1999 PJB Don't use IACK on CATS * 26-Jan-1999 PJB Don't use IACK on CATS
* 16-Mar-1999 RMK Added autodetect of ISA PICs * 16-Mar-1999 RMK Added autodetect of ISA PICs
*/ */
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* *
* PCI functions for Integrator * PCI functions for Integrator
*/ */
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/time.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <asm/types.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/memory.h> #include <asm/memory.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
* *
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
......
...@@ -11,10 +11,8 @@ ...@@ -11,10 +11,8 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
* Moved demux from asm to C - DS * Moved demux from asm to C - DS
* Fixes for various revision boards - DS * Fixes for various revision boards - DS
*/ */
#include <linux/kernel_stat.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -11,14 +11,11 @@ ...@@ -11,14 +11,11 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
*/ */
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/smp.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h>
#include <asm/types.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -16,9 +16,7 @@ ...@@ -16,9 +16,7 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h>
#include <asm/types.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/memory.h> #include <asm/memory.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
* DMA functions specific to RiscPC architecture * DMA functions specific to RiscPC architecture
*/ */
#include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/ioport.h> #include <linux/ioport.h>
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/sched.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/ioport.h> #include <linux/ioport.h>
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/device.h> #include <linux/device.h>
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ioport.h> #include <linux/ioport.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/sched.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/hardware.h> #include <asm/hardware.h>
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
......
...@@ -9,12 +9,9 @@ ...@@ -9,12 +9,9 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h>
#include <asm/mach/dma.h> #include <asm/mach/dma.h>
void __init arch_dma_init(dma_t *dma) void __init arch_dma_init(dma_t *dma)
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* Extra MM routines for the Tbox architecture * Extra MM routines for the Tbox architecture
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -22,24 +22,21 @@ obj-$(CONFIG_DISCONTIGMEM) += discontig.o ...@@ -22,24 +22,21 @@ obj-$(CONFIG_DISCONTIGMEM) += discontig.o
p-$(CONFIG_CPU_26) += proc-arm2_3.o p-$(CONFIG_CPU_26) += proc-arm2_3.o
# ARMv3 # ARMv3
p-$(CONFIG_CPU_ARM610) += proc-arm6_7.o tlb-v3.o copypage-v3.o p-$(CONFIG_CPU_ARM610) += proc-arm6_7.o tlb-v3.o copypage-v3.o
p-$(CONFIG_CPU_ARM710) += proc-arm6_7.o tlb-v3.o copypage-v3.o p-$(CONFIG_CPU_ARM710) += proc-arm6_7.o tlb-v3.o copypage-v3.o
# ARMv4 # ARMv4
p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o p-$(CONFIG_CPU_ARM720T) += proc-arm720.o tlb-v4.o copypage-v4wt.o abort-lv4t.o
p-$(CONFIG_CPU_ARM920T) += proc-arm920.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o p-$(CONFIG_CPU_ARM920T) += proc-arm920.o tlb-v4wbi.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_ARM922T) += proc-arm922.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o p-$(CONFIG_CPU_ARM922T) += proc-arm922.o tlb-v4wbi.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_ARM1020) += proc-arm1020.o tlb-v4wb.o copypage-v4wb.o abort-ev4t.o p-$(CONFIG_CPU_ARM1020) += proc-arm1020.o tlb-v4wbi.o copypage-v4wb.o abort-ev4t.o
p-$(CONFIG_CPU_SA110) += proc-sa110.o tlb-v4wb.o copypage-v4wb.o abort-ev4.o minicache.o p-$(CONFIG_CPU_SA110) += proc-sa110.o tlb-v4wb.o copypage-v4wb.o abort-ev4.o minicache.o
p-$(CONFIG_CPU_SA1100) += proc-sa110.o tlb-v4wb.o copypage-v4mc.o abort-ev4.o minicache.o p-$(CONFIG_CPU_SA1100) += proc-sa110.o tlb-v4wb.o copypage-v4mc.o abort-ev4.o minicache.o
# ARMv5 # ARMv5
p-$(CONFIG_CPU_ARM926T) += proc-arm926.o tlb-v4wb.o copypage-v4wb.o abort-ev5tej.o p-$(CONFIG_CPU_ARM926T) += proc-arm926.o tlb-v4wbi.o copypage-v4wb.o abort-ev5tej.o
p-$(CONFIG_CPU_XSCALE) += proc-xscale.o tlb-v4wb.o copypage-xscale.o abort-xscale.o minicache.o p-$(CONFIG_CPU_XSCALE) += proc-xscale.o tlb-v4wbi.o copypage-xscale.o abort-xscale.o minicache.o
obj-y += $(sort $(p-y)) obj-y += $(sort $(p-y))
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
# Special dependencies
$(obj)/$(p-y): include/asm-arm/constants.h
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -19,7 +18,6 @@ ...@@ -19,7 +18,6 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -131,21 +131,22 @@ do_PrefetchAbort(unsigned long addr, struct pt_regs *regs) ...@@ -131,21 +131,22 @@ do_PrefetchAbort(unsigned long addr, struct pt_regs *regs)
* We take the easy way out of this problem - we make the * We take the easy way out of this problem - we make the
* PTE uncacheable. However, we leave the write buffer on. * PTE uncacheable. However, we leave the write buffer on.
*/ */
static void adjust_pte(struct vm_area_struct *vma, unsigned long address) static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
{ {
pgd_t *pgd; pgd_t *pgd;
pmd_t *pmd; pmd_t *pmd;
pte_t *pte, entry; pte_t *pte, entry;
int ret = 0;
pgd = pgd_offset(vma->vm_mm, address); pgd = pgd_offset(vma->vm_mm, address);
if (pgd_none(*pgd)) if (pgd_none(*pgd))
return; goto no_pgd;
if (pgd_bad(*pgd)) if (pgd_bad(*pgd))
goto bad_pgd; goto bad_pgd;
pmd = pmd_offset(pgd, address); pmd = pmd_offset(pgd, address);
if (pmd_none(*pmd)) if (pmd_none(*pmd))
return; goto no_pmd;
if (pmd_bad(*pmd)) if (pmd_bad(*pmd))
goto bad_pmd; goto bad_pmd;
...@@ -161,23 +162,64 @@ static void adjust_pte(struct vm_area_struct *vma, unsigned long address) ...@@ -161,23 +162,64 @@ static void adjust_pte(struct vm_area_struct *vma, unsigned long address)
pte_val(entry) &= ~L_PTE_CACHEABLE; pte_val(entry) &= ~L_PTE_CACHEABLE;
set_pte(pte, entry); set_pte(pte, entry);
flush_tlb_page(vma, address); flush_tlb_page(vma, address);
ret = 1;
} }
pte_unmap(pte); pte_unmap(pte);
return; return ret;
bad_pgd: bad_pgd:
pgd_ERROR(*pgd); pgd_ERROR(*pgd);
pgd_clear(pgd); pgd_clear(pgd);
return; no_pgd:
return 0;
bad_pmd: bad_pmd:
pmd_ERROR(*pmd); pmd_ERROR(*pmd);
pmd_clear(pmd); pmd_clear(pmd);
return; no_pmd:
return 0;
}
void __flush_dcache_page(struct page *page)
{
struct mm_struct *mm = current->active_mm;
struct list_head *l;
unsigned long kaddr = (unsigned long)page_address(page);
cpu_cache_clean_invalidate_range(kaddr, kaddr + PAGE_SIZE, 0);
if (!page->mapping)
return;
/*
* With a VIVT cache, we need to also write back
* and invalidate any user data.
*/
list_for_each(l, &page->mapping->i_mmap_shared) {
struct vm_area_struct *mpnt;
unsigned long off;
mpnt = list_entry(l, struct vm_area_struct, shared);
/*
* If this VMA is not in our MM, we can ignore it.
*/
if (mpnt->vm_mm != mm)
continue;
if (page->index < mpnt->vm_pgoff)
continue;
off = page->index - mpnt->vm_pgoff;
if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
continue;
flush_cache_page(mpnt, off);
}
} }
static void static void
make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page) make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty)
{ {
struct list_head *l; struct list_head *l;
struct mm_struct *mm = vma->vm_mm; struct mm_struct *mm = vma->vm_mm;
...@@ -213,14 +255,17 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page) ...@@ -213,14 +255,17 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page)
if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT) if (off >= (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)
continue; continue;
off = mpnt->vm_start + (off << PAGE_SHIFT);
/* /*
* Ok, it is within mpnt. Fix it up. * Ok, it is within mpnt. Fix it up.
*/ */
adjust_pte(mpnt, mpnt->vm_start + (off << PAGE_SHIFT)); aliases += adjust_pte(mpnt, off);
aliases ++;
} }
if (aliases) if (aliases)
adjust_pte(vma, addr); adjust_pte(vma, addr);
else
flush_cache_page(vma, addr);
} }
/* /*
...@@ -245,9 +290,12 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte) ...@@ -245,9 +290,12 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
return; return;
page = pfn_to_page(pfn); page = pfn_to_page(pfn);
if (page->mapping) { if (page->mapping) {
if (test_and_clear_bit(PG_dcache_dirty, &page->flags)) int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);
__flush_dcache_page(page); unsigned long kaddr = (unsigned long)page_address(page);
if (dirty)
cpu_cache_clean_invalidate_range(kaddr, kaddr + PAGE_SIZE, 0);
make_coherent(vma, addr, page); make_coherent(vma, addr, page, dirty);
} }
} }
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
* Page table sludge for ARM v3 and v4 processor architectures. * Page table sludge for ARM v3 and v4 processor architectures.
*/ */
#include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
...@@ -166,14 +165,13 @@ void free_pgd_slow(pgd_t *pgd) ...@@ -166,14 +165,13 @@ void free_pgd_slow(pgd_t *pgd)
static inline void static inline void
alloc_init_section(unsigned long virt, unsigned long phys, int prot) alloc_init_section(unsigned long virt, unsigned long phys, int prot)
{ {
pmd_t *pmdp, pmd; pmd_t *pmdp;
pmdp = pmd_offset(pgd_offset_k(virt), virt); pmdp = pmd_offset(pgd_offset_k(virt), virt);
if (virt & (1 << 20)) if (virt & (1 << 20))
pmdp++; pmdp++;
pmd_val(pmd) = phys | prot; set_pmd(pmdp, __pmd(phys | prot));
set_pmd(pmdp, pmd);
} }
/* /*
...@@ -186,19 +184,20 @@ alloc_init_section(unsigned long virt, unsigned long phys, int prot) ...@@ -186,19 +184,20 @@ alloc_init_section(unsigned long virt, unsigned long phys, int prot)
static inline void static inline void
alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot) alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot)
{ {
pmd_t *pmdp, pmd; pmd_t *pmdp;
pte_t *ptep; pte_t *ptep;
pmdp = pmd_offset(pgd_offset_k(virt), virt); pmdp = pmd_offset(pgd_offset_k(virt), virt);
if (pmd_none(*pmdp)) { if (pmd_none(*pmdp)) {
unsigned long pmdval;
ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
sizeof(pte_t)); sizeof(pte_t));
pmd_val(pmd) = __pa(ptep) | prot_l1; pmdval = __pa(ptep) | prot_l1;
set_pmd(pmdp, pmd); pmdp[0] = __pmd(pmdval);
pmd_val(pmd) += 256 * sizeof(pte_t); pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
set_pmd(pmdp + 1, pmd); cpu_flush_pmd(pmdp);
} }
ptep = pte_offset_kernel(pmdp, virt); ptep = pte_offset_kernel(pmdp, virt);
...@@ -360,8 +359,9 @@ static void __init create_mapping(struct map_desc *md) ...@@ -360,8 +359,9 @@ static void __init create_mapping(struct map_desc *md)
*/ */
void setup_mm_for_reboot(char mode) void setup_mm_for_reboot(char mode)
{ {
unsigned long pmdval;
pgd_t *pgd; pgd_t *pgd;
pmd_t pmd; pmd_t *pmd;
int i; int i;
if (current->mm && current->mm->pgd) if (current->mm && current->mm->pgd)
...@@ -370,10 +370,11 @@ void setup_mm_for_reboot(char mode) ...@@ -370,10 +370,11 @@ void setup_mm_for_reboot(char mode)
pgd = init_mm.pgd; pgd = init_mm.pgd;
for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) { for (i = 0; i < FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
pmd_val(pmd) = (i << PGDIR_SHIFT) | pmdval = (i << PGDIR_SHIFT) |
PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
PMD_TYPE_SECT; PMD_BIT4 | PMD_TYPE_SECT;
set_pmd(pmd_offset(pgd + i, i << PGDIR_SHIFT), pmd); pmd = pmd_offset(pgd + i, i << PGDIR_SHIFT);
set_pmd(pmd, __pmd(pmdval));
} }
} }
......
...@@ -365,17 +365,15 @@ ENTRY(cpu_arm1020_set_pgd) ...@@ -365,17 +365,15 @@ ENTRY(cpu_arm1020_set_pgd)
mov pc, lr mov pc, lr
/* /*
* cpu_arm1020_set_pmd(pmdp, pmd) * cpu_arm1020_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020_set_pmd) ENTRY(cpu_arm1020_flush_pmd)
str r1, [r0]
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mcr p15, 0, r0, c7, c10, 4 mcr p15, 0, r0, c7, c10, 4
mcr p15, 0, r0, c7, c10, 1 @ clean D entry (drain is done by TLB fns) mcr p15, 0, r0, c7, c10, 1 @ clean D entry (drain is done by TLB fns)
...@@ -515,7 +513,7 @@ arm1020_processor_functions: ...@@ -515,7 +513,7 @@ arm1020_processor_functions:
/* pgtable */ /* pgtable */
.word cpu_arm1020_set_pgd .word cpu_arm1020_set_pgd
.word cpu_arm1020_set_pmd .word cpu_arm1020_flush_pmd
.word cpu_arm1020_set_pte .word cpu_arm1020_set_pte
.size arm1020_processor_functions, . - arm1020_processor_functions .size arm1020_processor_functions, . - arm1020_processor_functions
......
...@@ -234,34 +234,14 @@ ENTRY(cpu_arm7_set_pgd) ...@@ -234,34 +234,14 @@ ENTRY(cpu_arm7_set_pgd)
mov pc, lr mov pc, lr
/* /*
* Function: arm6_set_pmd () * Function: arm6_flush_pmd(pmdp)
* *
* Params : r0 = Address to set * Params : r0 = Address to set
* : r1 = value to set
*
* Purpose : Set a PMD and flush it out of any WB cache
*/
ENTRY(cpu_arm6_set_pmd)
and r2, r1, #11
teq r2, #1
teqne r2, #9
teqne r2, #10
orreq r1, r1, #16 @ Updatable = 1 if Page table/Cacheable section
str r1, [r0]
mov pc, lr
/*
* Function: arm7_set_pmd ()
*
* Params : r0 = Address to set
* : r1 = value to set
* *
* Purpose : Set a PMD and flush it out of any WB cache * Purpose : Set a PMD and flush it out of any WB cache
*/ */
ENTRY(cpu_arm7_set_pmd) ENTRY(cpu_arm6_flush_pmd)
tst r1, #3 ENTRY(cpu_arm7_flush_pmd)
orrne r1, r1, #16 @ Updatable bit is always set on ARM7
str r1, [r0]
mov pc, lr mov pc, lr
/* /*
...@@ -368,7 +348,7 @@ ENTRY(arm6_processor_functions) ...@@ -368,7 +348,7 @@ ENTRY(arm6_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_arm6_set_pgd .word cpu_arm6_set_pgd
.word cpu_arm6_set_pmd .word cpu_arm6_flush_pmd
.word cpu_arm6_set_pte .word cpu_arm6_set_pte
.size arm6_processor_functions, . - arm6_processor_functions .size arm6_processor_functions, . - arm6_processor_functions
...@@ -402,7 +382,7 @@ ENTRY(arm7_processor_functions) ...@@ -402,7 +382,7 @@ ENTRY(arm7_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_arm7_set_pgd .word cpu_arm7_set_pgd
.word cpu_arm7_set_pmd .word cpu_arm7_flush_pmd
.word cpu_arm7_set_pte .word cpu_arm7_set_pte
.size arm7_processor_functions, . - arm7_processor_functions .size arm7_processor_functions, . - arm7_processor_functions
......
...@@ -115,17 +115,13 @@ ENTRY(cpu_arm720_set_pgd) ...@@ -115,17 +115,13 @@ ENTRY(cpu_arm720_set_pgd)
mov pc, lr mov pc, lr
/* /*
* Function: arm720_set_pmd () * Function: arm720_flush_pmd(pmdp)
* *
* Params : r0 = Address to set * Params : r0 = Address to set
* : r1 = value to set
* *
* Purpose : Set a PMD and flush it out of any WB cache * Purpose : Set a PMD and flush it out of any WB cache
*/ */
ENTRY(cpu_arm720_set_pmd) ENTRY(cpu_arm720_flush_pmd)
tst r1, #3
orrne r1, r1, #16 @ Updatable bit is
str r1, [r0] @ always set on ARM720
mov pc, lr mov pc, lr
/* /*
...@@ -222,7 +218,7 @@ ENTRY(arm720_processor_functions) ...@@ -222,7 +218,7 @@ ENTRY(arm720_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_arm720_set_pgd .word cpu_arm720_set_pgd
.word cpu_arm720_set_pmd .word cpu_arm720_flush_pmd
.word cpu_arm720_set_pte .word cpu_arm720_set_pte
.size arm720_processor_functions, . - arm720_processor_functions .size arm720_processor_functions, . - arm720_processor_functions
......
...@@ -368,17 +368,15 @@ ENTRY(cpu_arm920_set_pgd) ...@@ -368,17 +368,15 @@ ENTRY(cpu_arm920_set_pgd)
mov pc, lr mov pc, lr
/* /*
* cpu_arm920_set_pmd(pmdp, pmd) * cpu_arm920_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_arm920_set_pmd) ENTRY(cpu_arm920_flush_pmd)
str r1, [r0]
mcr p15, 0, r0, c7, c10, 1 @ clean D entry mcr p15, 0, r0, c7, c10, 1 @ clean D entry
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr mov pc, lr
...@@ -503,7 +501,7 @@ arm920_processor_functions: ...@@ -503,7 +501,7 @@ arm920_processor_functions:
/* pgtable */ /* pgtable */
.word cpu_arm920_set_pgd .word cpu_arm920_set_pgd
.word cpu_arm920_set_pmd .word cpu_arm920_flush_pmd
.word cpu_arm920_set_pte .word cpu_arm920_set_pte
.size arm920_processor_functions, . - arm920_processor_functions .size arm920_processor_functions, . - arm920_processor_functions
......
...@@ -369,17 +369,15 @@ ENTRY(cpu_arm922_set_pgd) ...@@ -369,17 +369,15 @@ ENTRY(cpu_arm922_set_pgd)
mov pc, lr mov pc, lr
/* /*
* cpu_arm922_set_pmd(pmdp, pmd) * cpu_arm922_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_arm922_set_pmd) ENTRY(cpu_arm922_flush_pmd)
str r1, [r0]
mcr p15, 0, r0, c7, c10, 1 @ clean D entry mcr p15, 0, r0, c7, c10, 1 @ clean D entry
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr mov pc, lr
...@@ -502,7 +500,7 @@ arm922_processor_functions: ...@@ -502,7 +500,7 @@ arm922_processor_functions:
/* pgtable */ /* pgtable */
.word cpu_arm922_set_pgd .word cpu_arm922_set_pgd
.word cpu_arm922_set_pmd .word cpu_arm922_flush_pmd
.word cpu_arm922_set_pte .word cpu_arm922_set_pte
.size arm922_processor_functions, . - arm922_processor_functions .size arm922_processor_functions, . - arm922_processor_functions
......
...@@ -350,17 +350,15 @@ ENTRY(cpu_arm926_set_pgd) ...@@ -350,17 +350,15 @@ ENTRY(cpu_arm926_set_pgd)
mov pc, lr mov pc, lr
/* /*
* cpu_arm926_set_pmd(pmdp, pmd) * cpu_arm926_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_arm926_set_pmd) ENTRY(cpu_arm926_flush_pmd)
str r1, [r0]
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
mcr p15, 0, r0, c7, c10, 1 @ clean D entry mcr p15, 0, r0, c7, c10, 1 @ clean D entry
#endif #endif
...@@ -500,7 +498,7 @@ arm926_processor_functions: ...@@ -500,7 +498,7 @@ arm926_processor_functions:
/* pgtable */ /* pgtable */
.word cpu_arm926_set_pgd .word cpu_arm926_set_pgd
.word cpu_arm926_set_pmd .word cpu_arm926_flush_pmd
.word cpu_arm926_set_pte .word cpu_arm926_set_pte
.size arm926_processor_functions, . - arm926_processor_functions .size arm926_processor_functions, . - arm926_processor_functions
......
...@@ -425,18 +425,16 @@ ENTRY(cpu_sa1100_set_pgd) ...@@ -425,18 +425,16 @@ ENTRY(cpu_sa1100_set_pgd)
mov pc, lr mov pc, lr
/* /*
* cpu_sa110_set_pmd(pmdp, pmd) * cpu_sa110_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_sa110_set_pmd) ENTRY(cpu_sa110_flush_pmd)
ENTRY(cpu_sa1100_set_pmd) ENTRY(cpu_sa1100_flush_pmd)
str r1, [r0]
mcr p15, 0, r0, c7, c10, 1 @ clean D entry mcr p15, 0, r0, c7, c10, 1 @ clean D entry
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr mov pc, lr
...@@ -544,7 +542,7 @@ ENTRY(sa110_processor_functions) ...@@ -544,7 +542,7 @@ ENTRY(sa110_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_sa110_set_pgd .word cpu_sa110_set_pgd
.word cpu_sa110_set_pmd .word cpu_sa110_flush_pmd
.word cpu_sa110_set_pte .word cpu_sa110_set_pte
.size sa110_processor_functions, . - sa110_processor_functions .size sa110_processor_functions, . - sa110_processor_functions
...@@ -584,7 +582,7 @@ ENTRY(sa1100_processor_functions) ...@@ -584,7 +582,7 @@ ENTRY(sa1100_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_sa1100_set_pgd .word cpu_sa1100_set_pgd
.word cpu_sa1100_set_pmd .word cpu_sa1100_flush_pmd
.word cpu_sa1100_set_pte .word cpu_sa1100_set_pte
.size sa1100_processor_functions, . - sa1100_processor_functions .size sa1100_processor_functions, . - sa1100_processor_functions
......
/* /*
* linux/arch/arm/mm/proc-syms.c * linux/arch/arm/mm/proc-syms.c
* *
* Copyright (C) 2000 Russell King * Copyright (C) 2000-2002 Russell King
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <asm/proc-fns.h> #include <asm/proc-fns.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
EXPORT_SYMBOL(__flush_dcache_page);
#ifndef MULTI_CPU #ifndef MULTI_CPU
EXPORT_SYMBOL(cpu_cache_clean_invalidate_all); EXPORT_SYMBOL(cpu_cache_clean_invalidate_all);
EXPORT_SYMBOL(cpu_cache_clean_invalidate_range); EXPORT_SYMBOL(cpu_cache_clean_invalidate_range);
...@@ -25,7 +27,7 @@ EXPORT_SYMBOL(cpu_dcache_invalidate_range); ...@@ -25,7 +27,7 @@ EXPORT_SYMBOL(cpu_dcache_invalidate_range);
EXPORT_SYMBOL(cpu_icache_invalidate_range); EXPORT_SYMBOL(cpu_icache_invalidate_range);
EXPORT_SYMBOL(cpu_icache_invalidate_page); EXPORT_SYMBOL(cpu_icache_invalidate_page);
EXPORT_SYMBOL(cpu_set_pgd); EXPORT_SYMBOL(cpu_set_pgd);
EXPORT_SYMBOL(cpu_set_pmd); EXPORT_SYMBOL(cpu_flush_pmd);
EXPORT_SYMBOL(cpu_set_pte); EXPORT_SYMBOL(cpu_set_pte);
#else #else
EXPORT_SYMBOL(processor); EXPORT_SYMBOL(processor);
......
...@@ -573,17 +573,15 @@ ENTRY(cpu_xscale_set_pgd) ...@@ -573,17 +573,15 @@ ENTRY(cpu_xscale_set_pgd)
cpwait_ret lr, ip cpwait_ret lr, ip
/* /*
* cpu_xscale_set_pmd(pmdp, pmd) * cpu_xscale_flush_pmd(pmdp)
* *
* Set a level 1 translation table entry, and clean it out of * Set a level 1 translation table entry, and clean it out of
* any caches such that the MMUs can load it correctly. * any caches such that the MMUs can load it correctly.
* *
* pmdp: pointer to PMD entry * pmdp: pointer to PMD entry
* pmd: PMD value to store
*/ */
.align 5 .align 5
ENTRY(cpu_xscale_set_pmd) ENTRY(cpu_xscale_flush_pmd)
str r1, [r0]
mov ip, #0 mov ip, #0
mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
...@@ -721,7 +719,7 @@ ENTRY(xscale_processor_functions) ...@@ -721,7 +719,7 @@ ENTRY(xscale_processor_functions)
/* pgtable */ /* pgtable */
.word cpu_xscale_set_pgd .word cpu_xscale_set_pgd
.word cpu_xscale_set_pmd .word cpu_xscale_flush_pmd
.word cpu_xscale_set_pte .word cpu_xscale_set_pte
.size xscale_processor_functions, . - xscale_processor_functions .size xscale_processor_functions, . - xscale_processor_functions
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* ARM architecture version 4 and version 5 TLB handling functions. * ARM architecture version 4 TLB handling functions.
* These assume a split I/D TLBs, with a write buffer. * These assume a split I/D TLBs w/o I TLB entry, with a write buffer.
* *
* Processors: ARM920 ARM922 ARM926 SA110 SA1100 SA1110 XScale * Processors: SA110 SA1100 SA1110
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -67,50 +67,6 @@ ENTRY(v4wb_flush_kern_tlb_range) ...@@ -67,50 +67,6 @@ ENTRY(v4wb_flush_kern_tlb_range)
blo 1b blo 1b
mov pc, lr mov pc, lr
/*
* These two are optimised for ARM920, ARM922, ARM926, Xscale
*/
/*
* v4wb_flush_user_tlb_range(start, end, mm)
*
* Invalidate a range of TLB entries in the specified address space.
*
* - start - range start address
* - end - range end address
* - mm - mm_struct describing address space
*/
.align 5
ENTRY(v4wbi_flush_user_tlb_range)
vma_vm_mm ip, r2
act_mm r3 @ get current->active_mm
eors r3, ip, r3 @ == mm ?
movne pc, lr @ no, we dont do anything
mov r3, #0
mcr p15, 0, r3, c7, c10, 4 @ drain WB
vma_vm_flags r2, r2
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: tst r2, #VM_EXEC
mcrne p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
mov pc, lr
ENTRY(v4wbi_flush_kern_tlb_range)
mov r3, #0
mcr p15, 0, r3, c7, c10, 4 @ drain WB
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: mcr p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
mov pc, lr
__INIT __INIT
.type v4wb_tlb_fns, #object .type v4wb_tlb_fns, #object
...@@ -119,10 +75,3 @@ ENTRY(v4wb_tlb_fns) ...@@ -119,10 +75,3 @@ ENTRY(v4wb_tlb_fns)
.long v4wb_flush_kern_tlb_range .long v4wb_flush_kern_tlb_range
.long v4wb_tlb_flags .long v4wb_tlb_flags
.size v4wb_tlb_fns, . - v4wb_tlb_fns .size v4wb_tlb_fns, . - v4wb_tlb_fns
.type v4wbi_tlb_fns, #object
ENTRY(v4wbi_tlb_fns)
.long v4wbi_flush_user_tlb_range
.long v4wbi_flush_kern_tlb_range
.long v4wbi_tlb_flags
.size v4wbi_tlb_fns, . - v4wbi_tlb_fns
/*
* linux/arch/arm/mm/tlbv4wbi.S
*
* Copyright (C) 1997-2002 Russell King
*
* 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.
*
* ARM architecture version 4 and version 5 TLB handling functions.
* These assume a split I/D TLBs, with a write buffer.
*
* Processors: ARM920 ARM922 ARM926 XScale
*/
#include <linux/linkage.h>
#include <linux/init.h>
#include <asm/constants.h>
#include <asm/tlbflush.h>
#include "proc-macros.S"
/*
* v4wb_flush_user_tlb_range(start, end, mm)
*
* Invalidate a range of TLB entries in the specified address space.
*
* - start - range start address
* - end - range end address
* - mm - mm_struct describing address space
*/
.align 5
ENTRY(v4wbi_flush_user_tlb_range)
vma_vm_mm ip, r2
act_mm r3 @ get current->active_mm
eors r3, ip, r3 @ == mm ?
movne pc, lr @ no, we dont do anything
mov r3, #0
mcr p15, 0, r3, c7, c10, 4 @ drain WB
vma_vm_flags r2, r2
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: tst r2, #VM_EXEC
mcrne p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
mov pc, lr
ENTRY(v4wbi_flush_kern_tlb_range)
mov r3, #0
mcr p15, 0, r3, c7, c10, 4 @ drain WB
bic r0, r0, #0x0ff
bic r0, r0, #0xf00
1: mcr p15, 0, r0, c8, c5, 1 @ invalidate I TLB entry
mcr p15, 0, r0, c8, c6, 1 @ invalidate D TLB entry
add r0, r0, #PAGE_SZ
cmp r0, r1
blo 1b
mov pc, lr
__INIT
.type v4wbi_tlb_fns, #object
ENTRY(v4wbi_tlb_fns)
.long v4wbi_flush_user_tlb_range
.long v4wbi_flush_kern_tlb_range
.long v4wbi_tlb_flags
.size v4wbi_tlb_fns, . - v4wbi_tlb_fns
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
# Copyright (C) 2001 Russell King # Copyright (C) 2001 Russell King
# #
include $(TOPDIR)/Rules.make
include/asm-arm/mach-types.h: $(obj)/mach-types $(obj)/gen-mach-types include/asm-arm/mach-types.h: $(obj)/mach-types $(obj)/gen-mach-types
@echo ' Generating $@' @echo ' Generating $@'
@awk -f $(obj)/gen-mach-types $(obj)/mach-types > $@ @$(AWK) -f $(obj)/gen-mach-types $(obj)/mach-types > $@
...@@ -160,13 +160,6 @@ struct hd_geometry { ...@@ -160,13 +160,6 @@ struct hd_geometry {
#ifndef DEBUG #ifndef DEBUG
/*#define DEBUG */ /*#define DEBUG */
#endif #endif
/*
* List of card types that we recognise
*/
static const card_ids mfm_cids[] = {
{ MANU_ACORN, PROD_ACORN_MFM },
{ 0xffff, 0xffff }
};
/* /*
* End of configuration * End of configuration
*/ */
...@@ -1230,8 +1223,6 @@ static struct block_device_operations mfm_fops = ...@@ -1230,8 +1223,6 @@ static struct block_device_operations mfm_fops =
.ioctl = mfm_ioctl, .ioctl = mfm_ioctl,
}; };
static struct expansion_card *ecs;
/* /*
* See if there is a controller at the address presently at mfm_addr * See if there is a controller at the address presently at mfm_addr
* *
...@@ -1266,44 +1257,18 @@ static int mfm_probecontroller (unsigned int mfm_addr) ...@@ -1266,44 +1257,18 @@ static int mfm_probecontroller (unsigned int mfm_addr)
return 1; return 1;
} }
/* static int mfm_do_init(unsigned char irqmask)
* Look for a MFM controller - first check the motherboard, then the podules
* The podules have an extra interrupt enable that needs to be played with
*
* The HDC is accessed at MEDIUM IOC speeds.
*/
static int __init mfm_init (void)
{ {
unsigned char irqmask; int i, ret;
int i;
if (mfm_probecontroller(ONBOARD_MFM_ADDRESS)) {
mfm_addr = ONBOARD_MFM_ADDRESS;
mfm_IRQPollLoc = IOC_IRQSTATB;
mfm_irqenable = 0;
mfm_irq = IRQ_HARDDISK;
irqmask = 0x08; /* IL3 pin */
} else {
ecs = ecard_find(0, mfm_cids);
if (!ecs) {
mfm_addr = 0;
return -1;
}
mfm_addr = ecard_address(ecs, ECARD_IOC, ECARD_MEDIUM) + 0x800;
mfm_IRQPollLoc = ioaddr(mfm_addr + 0x400);
mfm_irqenable = mfm_IRQPollLoc;
mfm_irq = ecs->irq;
irqmask = 0x08;
ecard_claim(ecs);
}
printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq); printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq);
ret = -EBUSY;
if (!request_region (mfm_addr, 10, "mfm")) if (!request_region (mfm_addr, 10, "mfm"))
goto out1; goto out1;
if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) { ret = register_blkdev(MAJOR_NR, "mfm", &mfm_fops);
if (ret) {
printk("mfm_init: unable to get major number %d\n", MAJOR_NR); printk("mfm_init: unable to get major number %d\n", MAJOR_NR);
goto out2; goto out2;
} }
...@@ -1319,8 +1284,10 @@ static int __init mfm_init (void) ...@@ -1319,8 +1284,10 @@ static int __init mfm_init (void)
lastspecifieddrive = -1; lastspecifieddrive = -1;
mfm_drives = mfm_initdrives(); mfm_drives = mfm_initdrives();
if (!mfm_drives) if (!mfm_drives) {
ret = -ENODEV;
goto out3; goto out3;
}
for (i = 0; i < mfm_drives; i++) { for (i = 0; i < mfm_drives; i++) {
struct gendisk *disk = alloc_disk(64); struct gendisk *disk = alloc_disk(64);
...@@ -1335,7 +1302,8 @@ static int __init mfm_init (void) ...@@ -1335,7 +1302,8 @@ static int __init mfm_init (void)
printk("mfm: detected %d hard drive%s\n", mfm_drives, printk("mfm: detected %d hard drive%s\n", mfm_drives,
mfm_drives == 1 ? "" : "s"); mfm_drives == 1 ? "" : "s");
if (request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL)) { ret = request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk", NULL);
if (ret) {
printk("mfm: unable to get IRQ%d\n", mfm_irq); printk("mfm: unable to get IRQ%d\n", mfm_irq);
goto out4; goto out4;
} }
...@@ -1359,19 +1327,17 @@ static int __init mfm_init (void) ...@@ -1359,19 +1327,17 @@ static int __init mfm_init (void)
out2: out2:
release_region(mfm_addr, 10); release_region(mfm_addr, 10);
out1: out1:
ecard_release(ecs); return ret;
return -1;
Enomem: Enomem:
while (i--) while (i--)
put_disk(mfm_gendisk[i]); put_disk(mfm_gendisk[i]);
goto out3; goto out3;
} }
static void __exit mfm_exit(void) static void mfm_do_exit(void)
{ {
int i; int i;
if (ecs && mfm_irqenable)
outw (0, mfm_irqenable); /* Required to enable IRQs from MFM podule */
free_irq(mfm_irq, NULL); free_irq(mfm_irq, NULL);
for (i = 0; i < mfm_drives; i++) { for (i = 0; i < mfm_drives; i++) {
del_gendisk(mfm_gendisk[i]); del_gendisk(mfm_gendisk[i]);
...@@ -1379,12 +1345,72 @@ static void __exit mfm_exit(void) ...@@ -1379,12 +1345,72 @@ static void __exit mfm_exit(void)
} }
blk_cleanup_queue(&mfm_queue); blk_cleanup_queue(&mfm_queue);
unregister_blkdev(MAJOR_NR, "mfm"); unregister_blkdev(MAJOR_NR, "mfm");
if (ecs)
ecard_release(ecs);
if (mfm_addr) if (mfm_addr)
release_region(mfm_addr, 10); release_region(mfm_addr, 10);
} }
static int __devinit mfm_probe(struct expansion_card *ec, struct ecard_id *id)
{
if (mfm_addr)
return -EBUSY;
mfm_addr = ecard_address(ec, ECARD_IOC, ECARD_MEDIUM) + 0x800;
mfm_IRQPollLoc = ioaddr(mfm_addr + 0x400);
mfm_irqenable = mfm_IRQPollLoc;
mfm_irq = ec->irq;
return mfm_do_init(0x08);
}
static void __devexit mfm_remove(struct expansion_card *ec)
{
outw (0, mfm_irqenable); /* Required to enable IRQs from MFM podule */
mfm_do_exit();
}
static const struct ecard_id mfm_cids[] = {
{ MANU_ACORN, PROD_ACORN_MFM },
{ 0xffff, 0xffff },
};
static struct ecard_driver mfm_driver = {
.probe = mfm_probe,
.remove = __devexit(mfm_remove),
.id_table = mfm_cids,
.drv = {
.name = "mfm",
},
};
/*
* Look for a MFM controller - first check the motherboard, then the podules
* The podules have an extra interrupt enable that needs to be played with
*
* The HDC is accessed at MEDIUM IOC speeds.
*/
static int __init mfm_init (void)
{
unsigned char irqmask;
if (mfm_probecontroller(ONBOARD_MFM_ADDRESS)) {
mfm_addr = ONBOARD_MFM_ADDRESS;
mfm_IRQPollLoc = IOC_IRQSTATB;
mfm_irqenable = 0;
mfm_irq = IRQ_HARDDISK;
return mfm_do_init(0x08); /* IL3 pin */
} else {
return ecard_register_driver(&mfm_driver);
}
}
static void __exit mfm_exit(void)
{
if (mfm_addr == ONBOARD_MFM_ADDRESS)
mfm_do_exit();
else
ecard_unregister_driver(&mfm_driver);
}
module_init(mfm_init) module_init(mfm_init)
module_exit(mfm_exit) module_exit(mfm_exit)
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -1021,8 +1021,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -1021,8 +1021,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
ether1_banner(); ether1_banner();
ecard_claim(ec);
dev = init_etherdev(NULL, sizeof(struct ether1_priv)); dev = init_etherdev(NULL, sizeof(struct ether1_priv));
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1077,7 +1075,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -1077,7 +1075,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
unregister_netdev(dev); unregister_netdev(dev);
kfree(dev); kfree(dev);
out: out:
ecard_release(ec);
return ret; return ret;
} }
...@@ -1092,8 +1089,6 @@ static void __devexit ether1_remove(struct expansion_card *ec) ...@@ -1092,8 +1089,6 @@ static void __devexit ether1_remove(struct expansion_card *ec)
release_region(dev->base_addr, 16); release_region(dev->base_addr, 16);
release_region(dev->base_addr + 0x800, 4096); release_region(dev->base_addr + 0x800, 4096);
kfree(dev); kfree(dev);
ecard_release(ec);
} }
static const struct ecard_id ether1_ids[] = { static const struct ecard_id ether1_ids[] = {
......
...@@ -830,8 +830,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -830,8 +830,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
ether3_banner(); ether3_banner();
ecard_claim(ec);
dev = init_etherdev(NULL, sizeof(struct dev_priv)); dev = init_etherdev(NULL, sizeof(struct dev_priv));
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -918,7 +916,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -918,7 +916,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
unregister_netdev(dev); unregister_netdev(dev);
kfree(dev); kfree(dev);
out: out:
ecard_release(ec);
return ret; return ret;
} }
...@@ -931,8 +928,6 @@ static void __devexit ether3_remove(struct expansion_card *ec) ...@@ -931,8 +928,6 @@ static void __devexit ether3_remove(struct expansion_card *ec)
unregister_netdev(dev); unregister_netdev(dev);
release_region(dev->base_addr, 128); release_region(dev->base_addr, 128);
kfree(dev); kfree(dev);
ecard_release(ec);
} }
static const struct ecard_id ether3_ids[] = { static const struct ecard_id ether3_ids[] = {
......
...@@ -568,8 +568,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -568,8 +568,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
etherh_banner(); etherh_banner();
ecard_claim(ec);
dev = init_etherdev(NULL, sizeof(struct etherh_priv)); dev = init_etherdev(NULL, sizeof(struct etherh_priv));
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -725,7 +723,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -725,7 +723,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
kfree(dev->priv); kfree(dev->priv);
kfree(dev); kfree(dev);
out: out:
ecard_release(ec);
return ret; return ret;
} }
...@@ -744,7 +741,6 @@ static void __devexit etherh_remove(struct expansion_card *ec) ...@@ -744,7 +741,6 @@ static void __devexit etherh_remove(struct expansion_card *ec)
ec->ops = NULL; ec->ops = NULL;
kfree(ec->irq_data); kfree(ec->irq_data);
ecard_release(ec);
} }
static const struct ecard_id etherh_ids[] = { static const struct ecard_id etherh_ids[] = {
......
...@@ -109,10 +109,7 @@ ...@@ -109,10 +109,7 @@
* If not set, then use PIO mode (not currently supported). * If not set, then use PIO mode (not currently supported).
*/ */
#define USE_DMAC #define USE_DMAC
/*
* List of devices that the driver will recognise
*/
#define ACORNSCSI_LIST { MANU_ACORN, PROD_ACORN_SCSI }
/* /*
* ==================================================================================== * ====================================================================================
*/ */
...@@ -2832,148 +2829,6 @@ int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) ...@@ -2832,148 +2829,6 @@ int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags)
/*============================================================================================== /*==============================================================================================
* initialisation & miscellaneous support * initialisation & miscellaneous support
*/ */
static struct expansion_card *ecs[MAX_ECARDS];
/*
* Prototype: void acornscsi_init(AS_Host *host)
* Purpose : initialise the AS_Host structure for one interface & setup hardware
* Params : host - host to setup
*/
static
void acornscsi_host_init(AS_Host *host)
{
memset(&host->stats, 0, sizeof (host->stats));
queue_initialise(&host->queues.issue);
queue_initialise(&host->queues.disconnected);
msgqueue_initialise(&host->scsi.msgs);
acornscsi_resetcard(host);
}
int acornscsi_detect(Scsi_Host_Template * tpnt)
{
static const card_ids acornscsi_cids[] = { ACORNSCSI_LIST, { 0xffff, 0xffff } };
int i, count = 0;
struct Scsi_Host *instance;
AS_Host *host;
tpnt->proc_name = "acornscsi";
for (i = 0; i < MAX_ECARDS; i++)
ecs[i] = NULL;
ecard_startfind();
while(1) {
ecs[count] = ecard_find(0, acornscsi_cids);
if (!ecs[count])
break;
if (ecs[count]->irq == 0xff) {
printk("scsi: WD33C93 does not have IRQ enabled - ignoring\n");
continue;
}
ecard_claim(ecs[count]); /* Must claim here - card produces irq on reset */
instance = scsi_register(tpnt, sizeof(AS_Host));
if (!instance) {
ecard_release(ecs[count]);
break;
}
host = (AS_Host *)instance->hostdata;
instance->io_port = ecard_address(ecs[count], ECARD_MEMC, 0);
instance->irq = ecs[count]->irq;
host->host = instance;
host->scsi.io_port = ioaddr(instance->io_port + 0x800);
host->scsi.irq = instance->irq;
host->card.io_intr = POD_SPACE(instance->io_port) + 0x800;
host->card.io_page = POD_SPACE(instance->io_port) + 0xc00;
host->card.io_ram = ioaddr(instance->io_port);
host->dma.io_port = instance->io_port + 0xc00;
host->dma.io_intr_clear = POD_SPACE(instance->io_port) + 0x800;
ecs[count]->irqaddr = (char *)ioaddr(host->card.io_intr);
ecs[count]->irqmask = 0x0a;
if (!request_region(instance->io_port + 0x800, 2, "acornscsi(sbic)"))
goto err_1;
if (!request_region(host->card.io_intr, 1, "acornscsi(intr)"))
goto err_2;
if (!request_region(host->card.io_page, 1, "acornscsi(page)"))
goto err_3;
#ifdef USE_DMAC
if (!request_region(host->dma.io_port, 256, "acornscsi(dmac)"))
goto err_4;
#endif
if (!request_region(instance->io_port, 2048, "acornscsi(ram)"))
goto err_5;
if (request_irq(host->scsi.irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", host)) {
printk(KERN_CRIT "scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, host->scsi.irq);
host->scsi.irq = NO_IRQ;
}
acornscsi_host_init(host);
++count;
}
return count;
err_5:
#ifdef USE_DMAC
release_region(host->dma.io_port, 256);
#endif
err_4:
release_region(host->card.io_page, 1);
err_3:
release_region(host->card.io_intr, 1);
err_2:
release_region(instance->io_port + 0x800, 2);
err_1:
scsi_unregister(instance);
return 0;
}
/*
* Function: int acornscsi_release(struct Scsi_Host *host)
* Purpose : release all resources used by this adapter
* Params : host - driver structure to release
* Returns : nothing of any consequence
*/
int acornscsi_release(struct Scsi_Host *instance)
{
AS_Host *host = (AS_Host *)instance->hostdata;
int i;
/*
* Put card into RESET state
*/
outb(0x80, host->card.io_page);
if (host->scsi.irq != NO_IRQ)
free_irq(host->scsi.irq, host);
release_region(instance->io_port + 0x800, 2);
release_region(host->card.io_intr, 1);
release_region(host->card.io_page, 1);
release_region(host->dma.io_port, 256);
release_region(instance->io_port, 2048);
for (i = 0; i < MAX_ECARDS; i++)
if (ecs[i] && instance->io_port == ecard_address(ecs[i], ECARD_MEMC, 0))
ecard_release(ecs[i]);
msgqueue_free(&host->scsi.msgs);
queue_free(&host->queues.disconnected);
queue_free(&host->queues.issue);
return 0;
}
/* /*
* Function: char *acornscsi_info(struct Scsi_Host *host) * Function: char *acornscsi_info(struct Scsi_Host *host)
...@@ -3126,10 +2981,9 @@ static Scsi_Host_Template acornscsi_template = { ...@@ -3126,10 +2981,9 @@ static Scsi_Host_Template acornscsi_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_info = acornscsi_proc_info, .proc_info = acornscsi_proc_info,
.name = "AcornSCSI", .name = "AcornSCSI",
.detect = acornscsi_detect,
.release = acornscsi_release,
.info = acornscsi_info, .info = acornscsi_info,
.queuecommand = acornscsi_queuecmd, .queuecommand = acornscsi_queuecmd,
#warning fixme
.abort = acornscsi_abort, .abort = acornscsi_abort,
.reset = acornscsi_reset, .reset = acornscsi_reset,
.can_queue = 16, .can_queue = 16,
...@@ -3137,22 +2991,137 @@ static Scsi_Host_Template acornscsi_template = { ...@@ -3137,22 +2991,137 @@ static Scsi_Host_Template acornscsi_template = {
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.cmd_per_lun = 2, .cmd_per_lun = 2,
.unchecked_isa_dma = 0, .unchecked_isa_dma = 0,
.use_clustering = DISABLE_CLUSTERING .use_clustering = DISABLE_CLUSTERING,
.proc_name = "acornscsi",
}; };
static int __init acornscsi_init(void) static int __devinit
acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
scsi_register_host(&acornscsi_template); struct Scsi_Host *host;
if (acornscsi_template.present) AS_Host *ashost;
return 0; int ret = -ENOMEM;
host = scsi_register(&acornscsi_template, sizeof(AS_Host));
if (!host)
goto out;
scsi_unregister_host(&acornscsi_template); ashost = (AS_Host *)host->hostdata;
return -ENODEV;
host->io_port = ecard_address(ec, ECARD_MEMC, 0);
host->irq = ec->irq;
ashost->host = host;
ashost->scsi.io_port = ioaddr(host->io_port + 0x800);
ashost->scsi.irq = host->irq;
ashost->card.io_intr = POD_SPACE(host->io_port) + 0x800;
ashost->card.io_page = POD_SPACE(host->io_port) + 0xc00;
ashost->card.io_ram = ioaddr(host->io_port);
ashost->dma.io_port = host->io_port + 0xc00;
ashost->dma.io_intr_clear = POD_SPACE(host->io_port) + 0x800;
ec->irqaddr = (char *)ioaddr(ashost->card.io_intr);
ec->irqmask = 0x0a;
ret = -EBUSY;
if (!request_region(host->io_port + 0x800, 2, "acornscsi(sbic)"))
goto err_1;
if (!request_region(ashost->card.io_intr, 1, "acornscsi(intr)"))
goto err_2;
if (!request_region(ashost->card.io_page, 1, "acornscsi(page)"))
goto err_3;
#ifdef USE_DMAC
if (!request_region(ashost->dma.io_port, 256, "acornscsi(dmac)"))
goto err_4;
#endif
if (!request_region(host->io_port, 2048, "acornscsi(ram)"))
goto err_5;
ret = request_irq(host->irq, acornscsi_intr, SA_INTERRUPT, "acornscsi", ashost);
if (ret) {
printk(KERN_CRIT "scsi%d: IRQ%d not free: %d\n",
host->host_no, ashost->scsi.irq, ret);
goto err_6;
}
memset(&ashost->stats, 0, sizeof (ashost->stats));
queue_initialise(&ashost->queues.issue);
queue_initialise(&ashost->queues.disconnected);
msgqueue_initialise(&ashost->scsi.msgs);
acornscsi_resetcard(ashost);
ret = scsi_add_host(host);
if (ret == 0)
goto out;
free_irq(host->irq, ashost);
err_6:
release_region(host->io_port, 2048);
err_5:
#ifdef USE_DMAC
release_region(ashost->dma.io_port, 256);
#endif
err_4:
release_region(ashost->card.io_page, 1);
err_3:
release_region(ashost->card.io_intr, 1);
err_2:
release_region(host->io_port + 0x800, 2);
err_1:
scsi_unregister(host);
out:
return ret;
}
static void __devexit acornscsi_remove(struct expansion_card *ec)
{
struct Scsi_Host *host = ecard_get_drvdata(ec);
AS_Host *ashost = (AS_Host *)host->hostdata;
ecard_set_drvdata(ec, NULL);
scsi_remove_host(host);
/*
* Put card into RESET state
*/
outb(0x80, ashost->card.io_page);
free_irq(host->irq, ashost);
release_region(host->io_port + 0x800, 2);
release_region(ashost->card.io_intr, 1);
release_region(ashost->card.io_page, 1);
release_region(ashost->dma.io_port, 256);
release_region(host->io_port, 2048);
msgqueue_free(&ashost->scsi.msgs);
queue_free(&ashost->queues.disconnected);
queue_free(&ashost->queues.issue);
}
static const struct ecard_id acornscsi_cids[] = {
{ MANU_ACORN, PROD_ACORN_SCSI },
{ 0xffff, 0xffff },
};
static struct ecard_driver acornscsi_driver = {
.probe = acornscsi_probe,
.remove = __devexit_p(acornscsi_remove),
.id_table = acornscsi_cids,
.drv = {
.name = "acornscsi",
},
};
static int __init acornscsi_init(void)
{
return ecard_register_driver(&acornscsi_driver);
} }
static void __exit acornscsi_exit(void) static void __exit acornscsi_exit(void)
{ {
scsi_unregister_host(&acornscsi_template); ecard_remove_driver(&acornscsi_driver);
} }
module_init(acornscsi_init); module_init(acornscsi_init);
...@@ -3161,4 +3130,3 @@ module_exit(acornscsi_exit); ...@@ -3161,4 +3130,3 @@ module_exit(acornscsi_exit);
MODULE_AUTHOR("Russell King"); MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("AcornSCSI driver"); MODULE_DESCRIPTION("AcornSCSI driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -37,21 +37,29 @@ ...@@ -37,21 +37,29 @@
#include "../../scsi/scsi.h" #include "../../scsi/scsi.h"
#include "../../scsi/hosts.h" #include "../../scsi/hosts.h"
#include "arxescsi.h"
#include "fas216.h" #include "fas216.h"
/* Hmm - this should go somewhere else */ struct arxescsi_info {
#define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE) FAS216_Info info;
/* Configuration */ /* other info... */
#define ARXESCSI_XTALFREQ 24 unsigned int cstatus; /* card status register */
#define ARXESCSI_ASYNC_PERIOD 200 unsigned int dmaarea; /* Pseudo DMA area */
#define ARXESCSI_SYNC_DEPTH 0 };
/* #define CSTATUS_IRQ (1 << 0)
* List of devices that the driver will recognise #define CSTATUS_DRQ (1 << 0)
*/
#define ARXESCSI_LIST { MANU_ARXE, PROD_ARXE_SCSI } #ifndef CAN_QUEUE
#define CAN_QUEUE 1
#endif
#ifndef CMD_PER_LUN
#define CMD_PER_LUN 1
#endif
/* Hmm - this should go somewhere else */
#define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE)
/* /*
* Version * Version
...@@ -60,8 +68,6 @@ ...@@ -60,8 +68,6 @@
#define VER_MINOR 1 #define VER_MINOR 1
#define VER_PATCH 1 #define VER_PATCH 1
static struct expansion_card *ecs[MAX_ECARDS];
/* /*
* Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type) * Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type)
* Purpose : initialises DMA/PIO * Purpose : initialises DMA/PIO
...@@ -85,7 +91,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -85,7 +91,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
/* Faster transfer routines, written by SH to speed up the loops */ /* Faster transfer routines, written by SH to speed up the loops */
static __inline__ unsigned char getb(unsigned int address, unsigned int reg) static inline unsigned char getb(unsigned int address, unsigned int reg)
{ {
unsigned char value; unsigned char value;
...@@ -96,7 +102,7 @@ static __inline__ unsigned char getb(unsigned int address, unsigned int reg) ...@@ -96,7 +102,7 @@ static __inline__ unsigned char getb(unsigned int address, unsigned int reg)
return value; return value;
} }
static __inline__ unsigned int getw(unsigned int address, unsigned int reg) static inline unsigned int getw(unsigned int address, unsigned int reg)
{ {
unsigned int value; unsigned int value;
...@@ -109,7 +115,7 @@ static __inline__ unsigned int getw(unsigned int address, unsigned int reg) ...@@ -109,7 +115,7 @@ static __inline__ unsigned int getw(unsigned int address, unsigned int reg)
return value; return value;
} }
static __inline__ void putw(unsigned int address, unsigned int reg, unsigned long value) static inline void putw(unsigned int address, unsigned int reg, unsigned long value)
{ {
__asm__ __volatile__( __asm__ __volatile__(
"mov %0, %0, lsl #16\n\t" "mov %0, %0, lsl #16\n\t"
...@@ -157,7 +163,7 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io) ...@@ -157,7 +163,7 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io)
void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, int transfer) fasdmadir_t direction, int transfer)
{ {
ARXEScsi_Info *info = (ARXEScsi_Info *)host->hostdata; struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
unsigned int length, io, error=0; unsigned int length, io, error=0;
unsigned char *addr; unsigned char *addr;
...@@ -247,106 +253,6 @@ static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -247,106 +253,6 @@ static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
*/ */
} }
/*
* Function: int arxescsi_detect(Scsi_Host_Template * tpnt)
* Purpose : initialises ARXE SCSI driver
* Params : tpnt - template for this SCSI adapter
* Returns : >0 if host found, 0 otherwise.
*/
int arxescsi_detect(Scsi_Host_Template *tpnt)
{
static const card_ids arxescsi_cids[] = { ARXESCSI_LIST, { 0xffff, 0xffff} };
int count = 0;
struct Scsi_Host *host;
tpnt->proc_name = "arxescsi";
memset(ecs, 0, sizeof (ecs));
ecard_startfind();
while (1) {
ARXEScsi_Info *info;
ecs[count] = ecard_find(0, arxescsi_cids);
if (!ecs[count])
break;
ecard_claim(ecs[count]);
host = scsi_register(tpnt, sizeof (ARXEScsi_Info));
if (!host) {
ecard_release(ecs[count]);
break;
}
host->io_port = ecard_address(ecs[count], ECARD_MEMC, 0) + 0x0800;
host->irq = NO_IRQ;
host->dma_channel = NO_DMA;
host->can_queue = 0; /* no command queueing */
info = (ARXEScsi_Info *)host->hostdata;
info->info.scsi.io_port = host->io_port;
info->info.scsi.irq = host->irq;
info->info.scsi.io_shift = 3;
info->info.ifcfg.clockrate = ARXESCSI_XTALFREQ;
info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = ARXESCSI_ASYNC_PERIOD;
info->info.ifcfg.sync_max_depth = ARXESCSI_SYNC_DEPTH;
info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 0;
info->info.ifcfg.wide_max_size = 0;
info->info.dma.setup = arxescsi_dma_setup;
info->info.dma.pseudo = arxescsi_dma_pseudo;
info->info.dma.stop = arxescsi_dma_stop;
info->dmaarea = host->io_port + 128;
info->cstatus = host->io_port + 384;
ecs[count]->irqaddr = (unsigned char *)BUS_ADDR(host->io_port);
ecs[count]->irqmask = CSTATUS_IRQ;
if (!request_region(host->io_port, 120, "arxescsi-fas")) {
ecard_release(ecs[count]);
scsi_unregister(host);
break;
}
if (!request_region(host->io_port + 128, 384, "arxescsi-dma")) {
ecard_release(ecs[count]);
release_region(host->io_port, 120);
scsi_unregister(host);
break;
}
printk("scsi%d: Has no interrupts - using polling mode\n",
host->host_no);
fas216_init(host);
++count;
}
return count;
}
/*
* Function: int arxescsi_release(struct Scsi_Host * host)
* Purpose : releases all resources used by this adapter
* Params : host - driver host structure to return info for.
* Returns : nothing
*/
int arxescsi_release(struct Scsi_Host *host)
{
int i;
fas216_release(host);
release_region(host->io_port, 120);
release_region(host->io_port + 128, 384);
for (i = 0; i < MAX_ECARDS; i++)
if (ecs[i] && host->io_port == (ecard_address(ecs[i], ECARD_MEMC, 0) + 0x0800))
ecard_release(ecs[i]);
return 0;
}
/* /*
* Function: const char *arxescsi_info(struct Scsi_Host * host) * Function: const char *arxescsi_info(struct Scsi_Host * host)
* Purpose : returns a descriptive string about this interface, * Purpose : returns a descriptive string about this interface,
...@@ -355,7 +261,7 @@ int arxescsi_release(struct Scsi_Host *host) ...@@ -355,7 +261,7 @@ int arxescsi_release(struct Scsi_Host *host)
*/ */
const char *arxescsi_info(struct Scsi_Host *host) const char *arxescsi_info(struct Scsi_Host *host)
{ {
ARXEScsi_Info *info = (ARXEScsi_Info *)host->hostdata; struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
static char string[100], *p; static char string[100], *p;
p = string; p = string;
...@@ -385,14 +291,14 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -385,14 +291,14 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset,
{ {
int pos, begin; int pos, begin;
struct Scsi_Host *host; struct Scsi_Host *host;
ARXEScsi_Info *info; struct arxescsi_info *info;
Scsi_Device *scd; Scsi_Device *scd;
host = scsi_host_hn_get(host_no); host = scsi_host_hn_get(host_no);
if (!host) if (!host)
return 0; return 0;
info = (ARXEScsi_Info *)host->hostdata; info = (struct arxescsi_info *)host->hostdata;
if (inout == 1) if (inout == 1)
return -EINVAL; return -EINVAL;
...@@ -424,22 +330,122 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -424,22 +330,122 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset,
return pos; return pos;
} }
static Scsi_Host_Template arxescsi_template = ARXEScsi; static Scsi_Host_Template arxescsi_template = {
.proc_info = arxescsi_proc_info,
.name = "ARXE SCSI card",
.info = arxescsi_info,
.command = fas216_command,
.queuecommand = fas216_queue_command,
.eh_host_reset_handler = fas216_eh_host_reset,
.eh_bus_reset_handler = fas216_eh_bus_reset,
.eh_device_reset_handler = fas216_eh_device_reset,
.eh_abort_handler = fas216_eh_abort,
.can_queue = 0,
.this_id = 7,
.sg_tablesize = SG_ALL,
.cmd_per_lun = CMD_PER_LUN,
.use_clustering = DISABLE_CLUSTERING,
.proc_name = "arxescsi",
};
static int __devinit
arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{
struct Scsi_Host *host;
struct arxescsi_info *info;
int ret = -ENOMEM;
static int __init init_arxe_scsi_driver(void) host = scsi_register(&arxescsi_template, sizeof(struct arxescsi_info));
if (!host)
goto out;
host->io_port = ecard_address(ec, ECARD_MEMC, 0) + 0x0800;
host->irq = NO_IRQ;
host->dma_channel = NO_DMA;
info = (struct arxescsi_info *)host->hostdata;
info->info.scsi.io_port = host->io_port;
info->info.scsi.irq = host->irq;
info->info.scsi.io_shift = 3;
info->info.ifcfg.clockrate = 24; /* MHz */
info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */
info->info.ifcfg.sync_max_depth = 0;
info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 0;
info->info.ifcfg.wide_max_size = 0;
info->info.dma.setup = arxescsi_dma_setup;
info->info.dma.pseudo = arxescsi_dma_pseudo;
info->info.dma.stop = arxescsi_dma_stop;
info->dmaarea = host->io_port + 128;
info->cstatus = host->io_port + 384;
ec->irqaddr = (unsigned char *)BUS_ADDR(host->io_port);
ec->irqmask = CSTATUS_IRQ;
if (!request_region(host->io_port, 120, "arxescsi-fas")) {
ret = -EBUSY;
goto out_free;
}
if (!request_region(host->io_port + 128, 384, "arxescsi-dma")) {
ret = -EBUSY;
goto out_release;
}
printk("scsi%d: Has no interrupts - using polling mode\n",
host->host_no);
fas216_init(host);
ret = scsi_add_host(host);
if (ret == 0)
goto out;
release_region(host->io_port + 128, 384);
out_release:
release_region(host->io_port, 120);
out_free:
scsi_unregister(host);
out:
return ret;
}
static void __devexit arxescsi_release(struct expansion_card *ec)
{ {
arxescsi_template.module = THIS_MODULE; struct Scsi_Host *host = ecard_get_drvdata(ec);
scsi_register_host(&arxescsi_template);
if (arxescsi_template.present) ecard_set_drvdata(ec, NULL);
return 0; scsi_remove_host(host);
fas216_release(host);
release_region(host->io_port + 128, 384);
release_region(host->io_port, 120);
scsi_unregister(host);
}
scsi_unregister_host(&arxescsi_template); static const struct ecard_id arxescsi_cids[] = {
return -ENODEV; { MANU_ARXE, PROD_ARXE_SCSI },
{ 0xffff, 0xffff },
};
static struct ecard_driver arxescsi_driver = {
.probe = arxescsi_probe,
.remove = __devexit_p(arxescsi_remove),
.id_table = arxescsi_cids,
.drv = {
.name = "arxescsi",
},
};
static int __init init_arxe_scsi_driver(void)
{
return ecard_register_driver(&arxescsi_driver);
} }
static void __exit exit_arxe_scsi_driver(void) static void __exit exit_arxe_scsi_driver(void)
{ {
scsi_unregister_host(&arxescsi_template); ecard_remove_driver(&arxescsi_driver);
} }
module_init(init_arxe_scsi_driver); module_init(init_arxe_scsi_driver);
......
This diff is collapsed.
This diff is collapsed.
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/blk.h> #include <linux/blk.h>
......
This diff is collapsed.
This diff is collapsed.
...@@ -214,10 +214,22 @@ typedef enum { ...@@ -214,10 +214,22 @@ typedef enum {
typedef struct { typedef struct {
unsigned long magic_start; unsigned long magic_start;
spinlock_t host_lock;
struct Scsi_Host *host; /* host */ struct Scsi_Host *host; /* host */
Scsi_Cmnd *SCpnt; /* currently processing command */ Scsi_Cmnd *SCpnt; /* currently processing command */
Scsi_Cmnd *origSCpnt; /* original connecting command */ Scsi_Cmnd *origSCpnt; /* original connecting command */
Scsi_Cmnd *reqSCpnt; /* request sense command */ Scsi_Cmnd *reqSCpnt; /* request sense command */
Scsi_Cmnd *rstSCpnt; /* reset command */
Scsi_Cmnd *pending_SCpnt[8]; /* per-device pending commands */
int next_pending; /* next pending device */
/*
* Error recovery
*/
wait_queue_head_t eh_wait;
struct timer_list eh_timer;
unsigned int rst_dev_status;
unsigned int rst_bus_status;
/* driver information */ /* driver information */
struct { struct {
...@@ -281,6 +293,8 @@ typedef struct { ...@@ -281,6 +293,8 @@ typedef struct {
/* per-device info */ /* per-device info */
struct fas216_device { struct fas216_device {
unsigned char disconnect_ok:1; /* device can disconnect */ unsigned char disconnect_ok:1; /* device can disconnect */
unsigned char parity_enabled:1; /* parity checking enabled */
unsigned char parity_check:1; /* need to check parity checking */
unsigned char period; /* sync xfer period in (*4ns) */ unsigned char period; /* sync xfer period in (*4ns) */
unsigned char stp; /* synchronous transfer period */ unsigned char stp; /* synchronous transfer period */
unsigned char sof; /* synchronous offset register */ unsigned char sof; /* synchronous offset register */
......
#define AUTOSENSE
/*#define PSEUDO_DMA*/
/* /*
* Oak Generic NCR5380 driver * Oak Generic NCR5380 driver
* *
* Copyright 1995, Russell King * Copyright 1995-2002, Russell King
*
* ALPHA RELEASE 1.
*
* For more information, please consult
*
* NCR 5380 Family
* SCSI Protocol Controller
* Databook
*
* NCR Microelectronics
* 1635 Aeroplaza Drive
* Colorado Springs, CO 80916
* 1+ (719) 578-3400
* 1+ (800) 334-5454
*/
/*
* Options :
*
* PARITY - enable parity checking. Not supported.
*
* SCSI2 - enable support for SCSI-II tagged queueing. Untested.
*
* USLEEP - enable support for devices that don't disconnect. Untested.
*/
/*
* $Log: oak.c,v $
* Revision 1.3 1998/05/03 20:45:37 alan
* ARM SCSI update. This adds the eesox driver and massively updates the
* Cumana driver. The folks who bought cumana arent anal retentive all
* docs are secret weenies so now there are docs ..
*
* Revision 1.2 1998/03/08 05:49:48 davem
* Merge to 2.1.89
*
* Revision 1.1 1998/02/23 02:45:27 davem
* Merge to 2.1.88
*
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -60,6 +19,9 @@ ...@@ -60,6 +19,9 @@
#include "../../scsi/scsi.h" #include "../../scsi/scsi.h"
#include "../../scsi/hosts.h" #include "../../scsi/hosts.h"
#define AUTOSENSE
/*#define PSEUDO_DMA*/
#define OAKSCSI_PUBLIC_RELEASE 1 #define OAKSCSI_PUBLIC_RELEASE 1
#define NCR5380_read(reg) oakscsi_read(_instance, reg) #define NCR5380_read(reg) oakscsi_read(_instance, reg)
...@@ -71,14 +33,9 @@ ...@@ -71,14 +33,9 @@
int NCR5380_proc_info(char *buffer, char **start, off_t offset, int NCR5380_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout); int length, int hostno, int inout);
#define NCR5380_implementation_fields \ #define NCR5380_implementation_fields int port, ctrl
int port, ctrl #define NCR5380_local_declare() struct Scsi_Host *_instance
#define NCR5380_setup(instance) _instance = instance
#define NCR5380_local_declare() \
struct Scsi_Host *_instance
#define NCR5380_setup(instance) \
_instance = instance
#define BOARD_NORMAL 0 #define BOARD_NORMAL 0
#define BOARD_NCR53C400 1 #define BOARD_NCR53C400 1
...@@ -88,106 +45,9 @@ int NCR5380_proc_info(char *buffer, char **start, off_t offset, ...@@ -88,106 +45,9 @@ int NCR5380_proc_info(char *buffer, char **start, off_t offset,
#undef START_DMA_INITIATOR_RECEIVE_REG #undef START_DMA_INITIATOR_RECEIVE_REG
#define START_DMA_INITIATOR_RECEIVE_REG (7 + 128) #define START_DMA_INITIATOR_RECEIVE_REG (7 + 128)
static const card_ids oakscsi_cids[] = { const char * oakscsi_info (struct Scsi_Host *spnt)
{ MANU_OAK, PROD_OAK_SCSI },
{ 0xffff, 0xffff }
};
#define OAK_ADDRESS(card) (ecard_address((card), ECARD_MEMC, 0))
#define OAK_IRQ(card) (IRQ_NONE)
/*
* Function : int oakscsi_detect(Scsi_Host_Template * tpnt)
*
* Purpose : initializes oak NCR5380 driver based on the
* command line / compile time port and irq definitions.
*
* Inputs : tpnt - template for this SCSI adapter.
*
* Returns : 1 if a host adapter was found, 0 if not.
*
*/
static struct expansion_card *ecs[4];
int oakscsi_detect(Scsi_Host_Template * tpnt)
{
int count = 0;
struct Scsi_Host *instance;
tpnt->proc_name = "oakscsi";
memset (ecs, 0, sizeof (ecs));
ecard_startfind ();
while(1) {
if ((ecs[count] = ecard_find(0, oakscsi_cids)) == NULL)
break;
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
if (!instance)
break;
instance->io_port = OAK_ADDRESS(ecs[count]);
instance->irq = OAK_IRQ(ecs[count]);
NCR5380_init(instance, 0);
ecard_claim(ecs[count]);
instance->n_io_port = 255;
if (!request_region (instance->io_port, instance->n_io_port, "Oak SCSI")) {
ecard_release(ecs[count]);
scsi_unregister(instance);
break;
}
if (instance->irq != IRQ_NONE)
if (request_irq(instance->irq, oakscsi_intr, SA_INTERRUPT, "Oak SCSI", NULL)) {
printk("scsi%d: IRQ%d not free, interrupts disabled\n",
instance->host_no, instance->irq);
instance->irq = IRQ_NONE;
}
if (instance->irq != IRQ_NONE) {
printk("scsi%d: eek! Interrupts enabled, but I don't think\n", instance->host_no);
printk("scsi%d: that the board had an interrupt!\n", instance->host_no);
}
printk("scsi%d: at port %lX irq", instance->host_no, instance->io_port);
if (instance->irq == IRQ_NONE)
printk ("s disabled");
else
printk (" %d", instance->irq);
printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
tpnt->can_queue, tpnt->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE);
printk("\nscsi%d:", instance->host_no);
NCR5380_print_options(instance);
printk("\n");
++count;
}
#ifdef MODULE
if(count == 0)
printk("No oak scsi devices found\n");
#endif
return count;
}
int oakscsi_release (struct Scsi_Host *shpnt)
{ {
int i; return "";
if (shpnt->irq != IRQ_NONE)
free_irq (shpnt->irq, NULL);
if (shpnt->io_port)
release_region (shpnt->io_port, shpnt->n_io_port);
for (i = 0; i < 4; i++)
if (shpnt->io_port == OAK_ADDRESS(ecs[i]))
ecard_release (ecs[i]);
return 0;
}
const char * oakscsi_info (struct Scsi_Host *spnt) {
return "";
} }
#define STAT(p) inw(p + 144) #define STAT(p) inw(p + 144)
...@@ -255,37 +115,95 @@ printk("reading %p len %d\n", addr, len); ...@@ -255,37 +115,95 @@ printk("reading %p len %d\n", addr, len);
#include "../../scsi/NCR5380.c" #include "../../scsi/NCR5380.c"
static Scsi_Host_Template oakscsi_template = { static Scsi_Host_Template oakscsi_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_info = oakscsi_proc_info, .proc_info = oakscsi_proc_info,
.name = "Oak 16-bit SCSI", .name = "Oak 16-bit SCSI",
.detect = oakscsi_detect, .info = oakscsi_info,
.release = oakscsi_release, .queuecommand = oakscsi_queue_command,
.info = oakscsi_info,
.queuecommand = oakscsi_queue_command,
.eh_abort_handler = NCR5380_abort, .eh_abort_handler = NCR5380_abort,
.eh_device_reset_handler= NCR5380_device_reset, .eh_device_reset_handler= NCR5380_device_reset,
.eh_bus_reset_handler = NCR5380_bus_reset, .eh_bus_reset_handler = NCR5380_bus_reset,
.eh_host_reset_handler = NCR5380_host_reset, .eh_host_reset_handler = NCR5380_host_reset,
.can_queue = 16, .can_queue = 16,
.this_id = 7, .this_id = 7,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.cmd_per_lun = 2, .cmd_per_lun = 2,
.use_clustering = DISABLE_CLUSTERING .use_clustering = DISABLE_CLUSTERING,
.proc_name = "oakscsi",
}; };
static int __init oakscsi_init(void) static int __devinit
oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{
struct Scsi_Host *host;
int ret = -ENOMEM;
host = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
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",
host->host_no, host->io_port);
printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
tpnt->can_queue, tpnt->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE);
printk("\nscsi%d:", host->host_no);
NCR5380_print_options(host);
printk("\n");
ret = scsi_add_host(host);
if (ret == 0)
goto out;
release_region(host->io_port, host->n_io_port);
unreg:
scsi_unregister(host);
out:
return ret;
}
static void __devexit oakscsi_remove(struct expansion_card *ec)
{ {
scsi_register_host(&oakscsi_template); struct Scsi_Host *host = ecard_get_drvdata(ec);
if (oakscsi_template.present)
return 0; ecard_set_drvdata(ec, NULL);
scsi_remove_host(host);
release_region(host->io_port, host->n_io_port);
scsi_unregister(host);
}
static const struct ecard_id oakscsi_cids[] = {
{ MANU_OAK, PROD_OAK_SCSI },
{ 0xffff, 0xffff }
};
scsi_unregister_host(&oakscsi_template); static struct ecard_driver oakscsi_driver = {
return -ENODEV; .probe = oakscsi_probe,
.remove = __devexit_p(oakscsi_remove),
.id_table = oakscsi_cids,
.drv = {
.name = "oakscsi",
},
};
static int __init oakscsi_init(void)
{
return ecard_register_driver(&oakscsi_driver);
} }
static void __exit oakscsi_exit(void) static void __exit oakscsi_exit(void)
{ {
scsi_unregister_host(&oakscsi_template); ecard_remove_driver(&oakscsi_driver);
} }
module_init(oakscsi_init); module_init(oakscsi_init);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment