Commit 49a85c6a authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 4251bd1a 1687c697
...@@ -17,7 +17,7 @@ GZFLAGS :=-9 ...@@ -17,7 +17,7 @@ GZFLAGS :=-9
CFLAGS :=$(CFLAGS:-O2=-Os) CFLAGS :=$(CFLAGS:-O2=-Os)
ifeq ($(CONFIG_FRAME_POINTER),y) ifeq ($(CONFIG_FRAME_POINTER),y)
CFLAGS :=$(CFLAGS:-fomit-frame-pointer=-mapcs -mno-sched-prolog) CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
endif endif
ifeq ($(CONFIG_DEBUG_INFO),y) ifeq ($(CONFIG_DEBUG_INFO),y)
...@@ -36,7 +36,7 @@ apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 ...@@ -36,7 +36,7 @@ apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3
# series of macros. # series of macros.
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=armv5te
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.
...@@ -124,10 +124,10 @@ FASTFPE_OBJ :=$(FASTFPE)/ ...@@ -124,10 +124,10 @@ FASTFPE_OBJ :=$(FASTFPE)/
endif endif
# If we have a machine-specific directory, then include it in the build. # If we have a machine-specific directory, then include it in the build.
core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
ifneq ($(MACHINE),) ifneq ($(MACHINE),)
core-y += arch/arm/mach-$(MACHINE)/ core-y += arch/arm/mach-$(MACHINE)/
endif endif
core-y += arch/arm/kernel/ arch/arm/mm/
core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/ core-$(CONFIG_FPE_NWFPE) += arch/arm/nwfpe/
core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ) core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
......
...@@ -664,5 +664,5 @@ memdump: mov r12, r0 ...@@ -664,5 +664,5 @@ memdump: mov r12, r0
reloc_end: reloc_end:
.align .align
.section ".stack", "aw" .section ".stack", "w"
user_stack: .space 4096 user_stack: .space 4096
#
# Makefile for the linux kernel.
#
export-objs := sa1111.o sa1111-pcibuf.o sa1111-pcipool.o
obj-$(CONFIG_SA1111) += sa1111.o sa1111-pcibuf.o sa1111-pcipool.o
obj-$(CONFIG_PCI_HOST_PLX90X0) += plx90x0.o
obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
#
# Automatically generated make config: don't edit
#
CONFIG_ARM=y
CONFIG_MMU=y
CONFIG_SWAP=y
CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
#
# General setup
#
CONFIG_NET=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_KMOD=y
#
# System Type
#
# CONFIG_ARCH_ADIFCC is not set
# CONFIG_ARCH_ANAKIN is not set
# CONFIG_ARCH_ARCA5K is not set
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_CAMELOT is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_IOP310 is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_RPC is not set
CONFIG_ARCH_SA1100=y
# CONFIG_ARCH_SHARK is not set
#
# Archimedes/A5000 Implementations
#
#
# Archimedes/A5000 Implementations (select only ONE)
#
#
# CLPS711X/EP721X Implementations
#
#
# Epxa10db
#
#
# Footbridge Implementations
#
#
# IOP310 Implementation Options
#
#
# IOP310 Chipset Features
#
#
# Intel PXA250/210 Implementations
#
#
# SA11x0 Implementations
#
# CONFIG_SA1100_ASSABET is not set
# CONFIG_SA1100_ADSBITSY is not set
# CONFIG_SA1100_BRUTUS is not set
# CONFIG_SA1100_CERF is not set
# CONFIG_SA1100_H3100 is not set
# CONFIG_SA1100_H3600 is not set
# CONFIG_SA1100_H3800 is not set
# CONFIG_SA1100_EXTENEX1 is not set
# CONFIG_SA1100_FLEXANET is not set
# CONFIG_SA1100_FREEBIRD is not set
# CONFIG_SA1100_GRAPHICSCLIENT is not set
# CONFIG_SA1100_GRAPHICSMASTER is not set
# CONFIG_SA1100_BADGE4 is not set
# CONFIG_SA1100_JORNADA720 is not set
CONFIG_SA1100_HACKKIT=y
# CONFIG_SA1100_HUW_WEBPANEL is not set
# CONFIG_SA1100_ITSY is not set
# CONFIG_SA1100_LART is not set
# CONFIG_SA1100_NANOENGINE is not set
# CONFIG_SA1100_OMNIMETER is not set
# CONFIG_SA1100_PANGOLIN is not set
# CONFIG_SA1100_PLEB is not set
# CONFIG_SA1100_PT_SYSTEM3 is not set
# CONFIG_SA1100_SHANNON is not set
# CONFIG_SA1100_SHERMAN is not set
# CONFIG_SA1100_SIMPAD is not set
# CONFIG_SA1100_PFS168 is not set
# CONFIG_SA1100_VICTOR is not set
# CONFIG_SA1100_XP860 is not set
# CONFIG_SA1100_YOPY is not set
# CONFIG_SA1100_STORK is not set
# CONFIG_SA1100_USB is not set
#
# Processor Type
#
CONFIG_CPU_32=y
CONFIG_CPU_SA1100=y
CONFIG_CPU_32v4=y
#
# Processor Features
#
#
# General setup
#
CONFIG_DISCONTIGMEM=y
CONFIG_ISA=y
# CONFIG_ZBOOT_ROM is not set
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_24_API=y
CONFIG_CPU_FREQ_26_API=y
# CONFIG_HOTPLUG is not set
#
# At least one math emulation must be selected
#
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_FASTFPE is not set
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
# CONFIG_PREEMPT is not set
# CONFIG_ARTHUR is not set
CONFIG_CMDLINE="console=ttySA0,115200 root=/dev/ram0 initrd=0xc0400000,8M init=/rootshell"
CONFIG_LEDS=y
CONFIG_LEDS_TIMER=y
CONFIG_LEDS_CPU=y
CONFIG_ALIGNMENT_TRAP=y
#
# Parallel port support
#
# CONFIG_PARPORT is not set
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
# CONFIG_MTD_PARTITIONS is not set
# CONFIG_MTD_CONCAT is not set
#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
#
# Mapping drivers for chip access
#
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_NORA is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_EDB7312 is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set
#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set
#
# Plug and Play configuration
#
# CONFIG_PNP is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=8192
CONFIG_BLK_DEV_INITRD=y
#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
CONFIG_INET_ECN=y
CONFIG_SYN_COOKIES=y
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_XFRM_USER is not set
# CONFIG_IPV6 is not set
#
# SCTP Configuration (EXPERIMENTAL)
#
CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
#
# Network device support
#
CONFIG_NETDEVICES=y
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
CONFIG_DUMMY=y
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_ETHERTAP is not set
#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
#
# Ethernet (1000 Mbit)
#
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
CONFIG_NET_RADIO=y
# CONFIG_STRIP is not set
# CONFIG_ARLAN is not set
# CONFIG_AIRONET4500 is not set
#
# Wireless ISA/PCI cards support
#
# CONFIG_WAVELAN is not set
# CONFIG_AIRO is not set
# CONFIG_HERMES is not set
CONFIG_NET_WIRELESS=y
#
# Token Ring devices (depends on LLC=y)
#
# CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set
#
# SCSI support
#
# CONFIG_SCSI is not set
#
# I2O device support
#
# CONFIG_I2O is not set
#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set
#
# Input device support
#
CONFIG_INPUT=y
#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_TSLIBDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set
#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
# CONFIG_SERIO_I8042 is not set
CONFIG_SERIO_SERPORT=y
# CONFIG_SERIO_CT82C710 is not set
#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set
#
# Non-8250 serial port support
#
CONFIG_SERIAL_SA1100=y
CONFIG_SERIAL_SA1100_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
#
# I2C support
#
# CONFIG_I2C is not set
#
# L3 serial bus support
#
# CONFIG_L3 is not set
#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set
#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
CONFIG_SA1100_RTC=y
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
#
# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
# CONFIG_JFFS2_FS is not set
CONFIG_CRAMFS=y
CONFIG_TMPFS=y
CONFIG_RAMFS=y
# CONFIG_ISO9660_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
# CONFIG_QNX4FS_FS is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_XFS_FS is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
# CONFIG_EXPORTFS is not set
# CONFIG_CIFS is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_AFS_FS is not set
#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_NLS=y
#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
# CONFIG_NLS_ISO8859_15 is not set
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set
#
# Console drivers
#
# CONFIG_VGA_CONSOLE is not set
#
# Frame-buffer support
#
# CONFIG_FB is not set
#
# Sound
#
# CONFIG_SOUND is not set
#
# Misc devices
#
#
# Multimedia Capabilities Port drivers
#
# CONFIG_MCP is not set
#
# Console Switches
#
# CONFIG_SWITCHES is not set
#
# USB support
#
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# Kernel hacking
#
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_SLAB=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_WAITQ=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_ERRORS=y
CONFIG_KALLSYMS=y
CONFIG_DEBUG_LL=y
#
# Security options
#
CONFIG_SECURITY_CAPABILITIES=y
#
# Cryptographic options
#
# CONFIG_CRYPTO is not set
#
# Library routines
#
# CONFIG_CRC32 is not set
CONFIG_ZLIB_INFLATE=y
#
# Automatically generated by make menuconfig: don't edit
#
CONFIG_ARM=y
# CONFIG_EISA is not set
# CONFIG_SBUS is not set
# CONFIG_MCA is not set
CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
# CONFIG_GENERIC_BUST_SPINLOCK is not set
# CONFIG_GENERIC_ISA_DMA is not set
#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
#
# General setup
#
CONFIG_NET=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
#
# Loadable module support
#
CONFIG_MODULES=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
#
# System Type
#
# CONFIG_ARCH_ADIFCC is not set
# CONFIG_ARCH_ANAKIN is not set
# CONFIG_ARCH_ARCA5K is not set
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set
# CONFIG_ARCH_PXA is not set
# CONFIG_ARCH_EBSA110 is not set
# CONFIG_ARCH_CAMELOT is not set
# CONFIG_ARCH_FOOTBRIDGE is not set
# CONFIG_ARCH_INTEGRATOR is not set
# CONFIG_ARCH_IOP310 is not set
# CONFIG_ARCH_L7200 is not set
# CONFIG_ARCH_RPC is not set
CONFIG_ARCH_SA1100=y
# CONFIG_ARCH_SHARK is not set
#
# Archimedes/A5000 Implementations
#
# CONFIG_ARCH_ARC is not set
# CONFIG_ARCH_A5K is not set
#
# CLPS711X/EP721X Implementations
#
# CONFIG_ARCH_AUTCPU12 is not set
# CONFIG_ARCH_CDB89712 is not set
# CONFIG_ARCH_CEIVA is not set
# CONFIG_ARCH_CLEP7312 is not set
# CONFIG_ARCH_EDB7211 is not set
# CONFIG_ARCH_P720T is not set
# CONFIG_ARCH_FORTUNET is not set
# CONFIG_ARCH_EP7211 is not set
# CONFIG_ARCH_EP7212 is not set
#
# Epxa10db
#
#
# Footbridge Implementations
#
# CONFIG_ARCH_CATS is not set
# CONFIG_ARCH_PERSONAL_SERVER is not set
# CONFIG_ARCH_EBSA285_ADDIN is not set
# CONFIG_ARCH_EBSA285_HOST is not set
# CONFIG_ARCH_NETWINDER is not set
#
# IOP310 Implementation Options
#
# CONFIG_ARCH_IQ80310 is not set
# CONFIG_IOP310_AAU is not set
# CONFIG_IOP310_DMA is not set
# CONFIG_IOP310_MU is not set
# CONFIG_IOP310_PMON is not set
#
# Intel PXA250/210 Implementations
#
# CONFIG_ARCH_LUBBOCK is not set
# CONFIG_ARCH_PXA_IDP is not set
#
# SA11x0 Implementations
#
# CONFIG_SA1100_ASSABET is not set
# CONFIG_ASSABET_NEPONSET is not set
# CONFIG_SA1100_ADSBITSY is not set
# CONFIG_SA1100_BRUTUS is not set
# CONFIG_SA1100_CERF is not set
# CONFIG_SA1100_H3100 is not set
# CONFIG_SA1100_H3600 is not set
# CONFIG_SA1100_H3800 is not set
# CONFIG_SA1100_H3XXX is not set
# CONFIG_SA1100_EXTENEX1 is not set
# CONFIG_SA1100_FLEXANET is not set
# CONFIG_SA1100_FREEBIRD is not set
# CONFIG_SA1100_GRAPHICSCLIENT is not set
# CONFIG_SA1100_GRAPHICSMASTER is not set
# CONFIG_SA1100_BADGE4 is not set
# CONFIG_SA1100_JORNADA720 is not set
# CONFIG_SA1100_HUW_WEBPANEL is not set
# CONFIG_SA1100_ITSY is not set
# CONFIG_SA1100_LART is not set
# CONFIG_SA1100_NANOENGINE is not set
# CONFIG_SA1100_OMNIMETER is not set
# CONFIG_SA1100_PANGOLIN is not set
# CONFIG_SA1100_PLEB is not set
# CONFIG_SA1100_PT_SYSTEM3 is not set
# CONFIG_SA1100_SHANNON is not set
# CONFIG_SA1100_SHERMAN is not set
# CONFIG_SA1100_SIMPAD is not set
CONFIG_SA1100_TRIZEPS=y
CONFIG_TRIZEPS_MFTB2=y
# CONFIG_SA1100_PFS168 is not set
# CONFIG_SA1100_VICTOR is not set
# CONFIG_SA1100_XP860 is not set
# CONFIG_SA1100_YOPY is not set
# CONFIG_SA1100_STORK is not set
# CONFIG_SA1100_USB is not set
# CONFIG_SA1100_USB_NETLINK is not set
# CONFIG_SA1100_USB_CHAR is not set
# CONFIG_H3600_SLEEVE is not set
# CONFIG_ARCH_ACORN is not set
# CONFIG_FOOTBRIDGE is not set
# CONFIG_FOOTBRIDGE_HOST is not set
# CONFIG_FOOTBRIDGE_ADDIN is not set
# CONFIG_SA1111 is not set
CONFIG_CPU_32=y
# CONFIG_CPU_26 is not set
# CONFIG_CPU_ARM610 is not set
# CONFIG_CPU_ARM710 is not set
# CONFIG_CPU_ARM720T is not set
# CONFIG_CPU_ARM920T is not set
# CONFIG_CPU_ARM922T is not set
# CONFIG_CPU_ARM926T is not set
# CONFIG_CPU_ARM1020 is not set
# CONFIG_CPU_SA110 is not set
CONFIG_CPU_SA1100=y
# CONFIG_CPU_XSCALE is not set
# CONFIG_CPU_32v3 is not set
CONFIG_CPU_32v4=y
# CONFIG_CPU_32v5 is not set
# CONFIG_ARM_THUMB is not set
#
# General setup
#
CONFIG_DISCONTIGMEM=y
# CONFIG_PCI is not set
CONFIG_ISA=y
# CONFIG_ISA_DMA is not set
# CONFIG_FIQ is not set
# CONFIG_ZBOOT_ROM is not set
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
# CONFIG_CPU_FREQ is not set
# CONFIG_CPU_FREQ_24_API is not set
# CONFIG_CPU_FREQ_26_API is not set
CONFIG_HOTPLUG=y
#
# PCMCIA/CardBus support
#
CONFIG_PCMCIA=m
# CONFIG_I82092 is not set
# CONFIG_I82365 is not set
# CONFIG_TCIC is not set
# CONFIG_PCMCIA_CLPS6700 is not set
CONFIG_PCMCIA_SA1100=m
# CONFIG_PCMCIA_SA1111 is not set
CONFIG_FPE_NWFPE=y
# CONFIG_FPE_FASTFPE is not set
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
# CONFIG_PREEMPT is not set
# CONFIG_APM is not set
# CONFIG_ARTHUR is not set
CONFIG_CMDLINE="keepinitrd mem=16M root=/dev/hda2 1"
# CONFIG_LEDS is not set
CONFIG_ALIGNMENT_TRAP=y
#
# Parallel port support
#
# CONFIG_PARPORT is not set
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_PARTITIONS=m
CONFIG_MTD_CONCAT=m
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_AFS_PARTS=m
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set
#
# Mapping drivers for chip access
#
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_NORA is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_CDB89712 is not set
CONFIG_MTD_SA1100=m
# CONFIG_MTD_2PARTS_IPAQ is not set
# CONFIG_MTD_DC21285 is not set
# CONFIG_MTD_IQ80310 is not set
# CONFIG_MTD_EPXA10DB is not set
# CONFIG_MTD_FORTUNET is not set
# CONFIG_MTD_AUTCPU12 is not set
# CONFIG_MTD_EDB7312 is not set
# CONFIG_MTD_IMPA7 is not set
# CONFIG_MTD_CEIVA is not set
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLKMTD is not set
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOCPROBE is not set
#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set
#
# Plug and Play configuration
#
# CONFIG_PNP is not set
# CONFIG_PNP_NAMES is not set
# CONFIG_PNP_DEBUG is not set
# CONFIG_ISAPNP is not set
# CONFIG_PNPBIOS is not set
#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_CISS_SCSI_TAPE is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_BLK_DEV_INITRD is not set
#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_MD_LINEAR is not set
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID5 is not set
# CONFIG_MD_MULTIPATH is not set
# CONFIG_BLK_DEV_LVM is not set
#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_IPV6 is not set
#
# SCTP Configuration (EXPERIMENTAL)
#
CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_DEV_APPLETALK is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set
#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
#
# Network device support
#
CONFIG_NETDEVICES=y
#
# ARCnet devices
#
# CONFIG_ARCNET is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_ETHERTAP is not set
#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET is not set
#
# Ethernet (1000 Mbit)
#
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
# CONFIG_E1000_NAPI is not set
# CONFIG_MYRI_SBUS is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
# CONFIG_PPP_SYNC_TTY is not set
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
# CONFIG_PPPOE is not set
# CONFIG_SLIP is not set
#
# Wireless LAN (non-hamradio)
#
CONFIG_NET_RADIO=y
# CONFIG_STRIP is not set
# CONFIG_ARLAN is not set
# CONFIG_AIRONET4500 is not set
# CONFIG_AIRONET4500_NONCS is not set
# CONFIG_AIRONET4500_PROC is not set
# CONFIG_WAVELAN is not set
# CONFIG_AIRO is not set
# CONFIG_HERMES is not set
# CONFIG_PCMCIA_NETWAVE is not set
# CONFIG_PCMCIA_WAVELAN is not set
# CONFIG_PCMCIA_HERMES is not set
CONFIG_AIRO_CS=m
CONFIG_NET_WIRELESS=y
#
# Token Ring devices
#
# CONFIG_TR is not set
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set
#
# Wan interfaces
#
# CONFIG_WAN is not set
#
# PCMCIA network device support
#
CONFIG_NET_PCMCIA=y
# CONFIG_PCMCIA_3C589 is not set
# CONFIG_PCMCIA_3C574 is not set
# CONFIG_PCMCIA_FMVJ18X is not set
# CONFIG_PCMCIA_PCNET is not set
# CONFIG_PCMCIA_NMCLAN is not set
# CONFIG_PCMCIA_SMC91C92 is not set
# CONFIG_PCMCIA_XIRC2PS is not set
# CONFIG_PCMCIA_AXNET is not set
# CONFIG_ARCNET_COM20020_CS is not set
# CONFIG_PCMCIA_IBMTR is not set
CONFIG_NET_PCMCIA_RADIO=y
# CONFIG_PCMCIA_RAYCS is not set
# CONFIG_AIRONET4500_CS is not set
#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set
#
# IrDA (infrared) support
#
# CONFIG_IRDA is not set
#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y
#
# IDE, ATA and ATAPI Block devices
#
CONFIG_BLK_DEV_IDE=y
# CONFIG_BLK_DEV_HD_IDE is not set
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_IDEDISK_STROKE is not set
CONFIG_BLK_DEV_IDECS=m
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_IDE_TASK_IOCTL is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
# CONFIG_BLK_DEV_ISAPNP is not set
# CONFIG_BLK_DEV_IDE_ICSIDE is not set
# CONFIG_BLK_DEV_IDEDMA_ICS is not set
# CONFIG_IDEDMA_ICS_AUTO is not set
# CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_BLK_DEV_IDE_RAPIDE is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEDMA_AUTO is not set
# CONFIG_DMA_NONPCI is not set
CONFIG_BLK_DEV_IDE_MODES=y
#
# SCSI support
#
# CONFIG_SCSI is not set
#
# I2O device support
#
# CONFIG_I2O is not set
# CONFIG_I2O_BLOCK is not set
# CONFIG_I2O_LAN is not set
# CONFIG_I2O_SCSI is not set
# CONFIG_I2O_PROC is not set
#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set
#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_TSLIBDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
# CONFIG_GAMEPORT_NS558 is not set
# CONFIG_GAMEPORT_L4 is not set
# CONFIG_GAMEPORT_EMU10K1 is not set
# CONFIG_GAMEPORT_VORTEX is not set
# CONFIG_GAMEPORT_FM801 is not set
# CONFIG_GAMEPORT_CS461x is not set
# CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
# CONFIG_SERIO_RPCKBD is not set
# CONFIG_SERIO_AMBAKMI is not set
# CONFIG_SERIO_SA1111 is not set
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_KEYBOARD_ATKBD is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_MOUSE_PS2 is not set
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_INPORT is not set
# CONFIG_MOUSE_LOGIBM is not set
# CONFIG_MOUSE_PC110PAD is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_JOYSTICK_ANALOG is not set
# CONFIG_JOYSTICK_A3D is not set
# CONFIG_JOYSTICK_ADI is not set
# CONFIG_JOYSTICK_COBRA is not set
# CONFIG_JOYSTICK_GF2K is not set
# CONFIG_JOYSTICK_GRIP is not set
# CONFIG_JOYSTICK_GRIP_MP is not set
# CONFIG_JOYSTICK_GUILLEMOT is not set
# CONFIG_JOYSTICK_INTERACT is not set
# CONFIG_JOYSTICK_SIDEWINDER is not set
# CONFIG_JOYSTICK_TMDC is not set
# CONFIG_JOYSTICK_IFORCE is not set
# CONFIG_JOYSTICK_WARRIOR is not set
# CONFIG_JOYSTICK_MAGELLAN is not set
# CONFIG_JOYSTICK_SPACEORB is not set
# CONFIG_JOYSTICK_SPACEBALL is not set
# CONFIG_JOYSTICK_STINGER is not set
# CONFIG_JOYSTICK_TWIDDLER is not set
# CONFIG_JOYSTICK_DB9 is not set
# CONFIG_JOYSTICK_GAMECON is not set
# CONFIG_JOYSTICK_TURBOGRAFX is not set
# CONFIG_INPUT_JOYDUMP is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_INPUT_MISC is not set
# CONFIG_INPUT_PCSPKR is not set
# CONFIG_INPUT_UINPUT is not set
#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set
#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set
# CONFIG_SERIAL_8250_CONSOLE is not set
# CONFIG_SERIAL_8250_CS is not set
# CONFIG_SERIAL_8250_EXTENDED is not set
# CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_MULTIPORT is not set
# CONFIG_SERIAL_8250_RSA is not set
# CONFIG_SERIAL_ACORN is not set
# CONFIG_SERIAL_ANAKIN is not set
# CONFIG_SERIAL_ANAKIN_CONSOLE is not set
# CONFIG_SERIAL_AMBA is not set
# CONFIG_SERIAL_AMBA_CONSOLE is not set
# CONFIG_SERIAL_CLPS711X is not set
# CONFIG_SERIAL_CLPS711X_CONSOLE is not set
# CONFIG_SERIAL_CLPS711X_OLD_NAME is not set
# CONFIG_SERIAL_21285 is not set
# CONFIG_SERIAL_21285_OLD is not set
# CONFIG_SERIAL_21285_CONSOLE is not set
# CONFIG_SERIAL_UART00 is not set
# CONFIG_SERIAL_UART00_CONSOLE is not set
CONFIG_SERIAL_SA1100=y
CONFIG_SERIAL_SA1100_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_UNIX98_PTYS is not set
#
# I2C support
#
CONFIG_I2C=m
CONFIG_I2C_ALGOBIT=m
# CONFIG_I2C_PHILIPSPAR is not set
# CONFIG_I2C_ELV is not set
# CONFIG_I2C_VELLEMAN is not set
# CONFIG_SCx200_I2C is not set
# CONFIG_SCx200_ACB is not set
# CONFIG_I2C_BIT_SA1100_GPIO is not set
# CONFIG_I2C_ALGOPCF is not set
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_PROC=m
#
# L3 serial bus support
#
# CONFIG_L3 is not set
# CONFIG_L3_ALGOBIT is not set
# CONFIG_L3_BIT_SA1100_GPIO is not set
# CONFIG_BIT_SA1100_GPIO is not set
#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set
#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_SA1100_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
#
# PCMCIA character devices
#
# CONFIG_SYNCLINK_CS is not set
# CONFIG_SCx200_GPIO is not set
# CONFIG_RAW_DRIVER is not set
#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
#
# File systems
#
# CONFIG_QUOTA is not set
# CONFIG_QFMT_V1 is not set
# CONFIG_QFMT_V2 is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_ADFS_FS is not set
# CONFIG_ADFS_FS_RW is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_JBD is not set
# CONFIG_JBD_DEBUG is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
# CONFIG_JFFS2_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_TMPFS is not set
CONFIG_RAMFS=y
# CONFIG_ISO9660_FS is not set
# CONFIG_JOLIET is not set
# CONFIG_ZISOFS is not set
# CONFIG_JFS_FS is not set
# CONFIG_JFS_DEBUG is not set
# CONFIG_JFS_STATISTICS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVFS_MOUNT is not set
# CONFIG_DEVFS_DEBUG is not set
# CONFIG_DEVPTS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_QNX4FS_RW is not set
# CONFIG_ROMFS_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_SYSV_FS is not set
# CONFIG_UDF_FS is not set
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_FS is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_QUOTA is not set
#
# Network File Systems
#
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
# CONFIG_NFS_V4 is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3 is not set
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
# CONFIG_CIFS is not set
# CONFIG_SMB_FS is not set
# CONFIG_NCP_FS is not set
# CONFIG_NCPFS_PACKET_SIGNING is not set
# CONFIG_NCPFS_IOCTL_LOCKING is not set
# CONFIG_NCPFS_STRONG is not set
# CONFIG_NCPFS_NFS_NS is not set
# CONFIG_NCPFS_OS2_NS is not set
# CONFIG_NCPFS_SMALLDOS is not set
# CONFIG_NCPFS_NLS is not set
# CONFIG_NCPFS_EXTRAS is not set
# CONFIG_AFS_FS is not set
# CONFIG_ZISOFS_FS is not set
#
# Partition Types
#
CONFIG_PARTITION_ADVANCED=y
# CONFIG_ACORN_PARTITION is not set
# CONFIG_OSF_PARTITION is not set
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_ATARI_PARTITION is not set
# CONFIG_MAC_PARTITION is not set
CONFIG_MSDOS_PARTITION=y
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_MINIX_SUBPARTITION is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
# CONFIG_EFI_PARTITION is not set
# CONFIG_SMB_NLS is not set
# CONFIG_NLS is not set
#
# Sound
#
# CONFIG_SOUND is not set
#
# Multimedia Capabilities Port drivers
#
# CONFIG_MCP is not set
# CONFIG_MCP_SA1100 is not set
# CONFIG_MCP_UCB1200 is not set
# CONFIG_MCP_UCB1200_AUDIO is not set
# CONFIG_MCP_UCB1200_TS is not set
#
# Console Switches
#
# CONFIG_SWITCHES is not set
# CONFIG_SWITCHES_SA1100 is not set
# CONFIG_SWITCHES_UCB1X00 is not set
#
# USB support
#
# CONFIG_USB is not set
#
# Bluetooth support
#
# CONFIG_BT is not set
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_WAITQ is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_ERRORS=y
# CONFIG_DEBUG_LL is not set
# CONFIG_DEBUG_DC21285_PORT is not set
# CONFIG_DEBUG_CLPS711X_UART2 is not set
#
# Security options
#
CONFIG_SECURITY_CAPABILITIES=y
#
# Library routines
#
# CONFIG_CRC32 is not set
CONFIG_ZLIB_INFLATE=m
CONFIG_ZLIB_DEFLATE=m
...@@ -26,8 +26,6 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o ...@@ -26,8 +26,6 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o
obj-$(CONFIG_ARTHUR) += arthur.o obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o obj-$(CONFIG_ISA_DMA) += dma-isa.o
obj-$(CONFIG_PCI) += bios32.o obj-$(CONFIG_PCI) += bios32.o
obj-$(CONFIG_PCI_HOST_PLX90X0) += plx90x0.o
obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
ifneq ($(MACHINE),ebsa110) ifneq ($(MACHINE),ebsa110)
obj-y += io.o obj-y += io.o
......
...@@ -881,6 +881,90 @@ static void ecard_proc_init(void) ...@@ -881,6 +881,90 @@ static void ecard_proc_init(void)
get_ecard_dev_info); get_ecard_dev_info);
} }
#define ec_set_resource(ec,nr,st,sz,flg) \
do { \
(ec)->resource[nr].name = ec->dev.name; \
(ec)->resource[nr].start = st; \
(ec)->resource[nr].end = (st) + (sz) - 1; \
(ec)->resource[nr].flags = flg; \
} while (0)
static void __init ecard_init_resources(struct expansion_card *ec)
{
unsigned long base = PODSLOT_IOC4_BASE;
unsigned int slot = ec->slot_no;
int i;
if (slot < 4) {
ec_set_resource(ec, ECARD_RES_MEMC,
PODSLOT_MEMC_BASE + (slot << 14),
PODSLOT_MEMC_SIZE, IORESOURCE_MEM);
base = PODSLOT_IOC0_BASE;
}
#ifdef CONFIG_ARCH_RPC
if (slot < 8) {
ec_set_resource(ec, ECARD_RES_EASI,
PODSLOT_EASI_BASE + (slot << 24),
PODSLOT_EASI_SIZE, IORESOURCE_MEM);
}
if (slot == 8) {
ec_set_resource(ec, ECARD_RES_MEMC, NETSLOT_BASE,
NETSLOT_SIZE, IORESOURCE_MEM);
} else
#endif
for (i = 0; i < ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++) {
ec_set_resource(ec, i + ECARD_RES_IOCSLOW,
base + (slot << 14) + (i << 19),
PODSLOT_IOC_SIZE, IORESOURCE_MEM);
}
for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
if (ec->resource[i].start &&
request_resource(&iomem_resource, &ec->resource[i])) {
printk(KERN_ERR "%s: resource(s) not available\n",
ec->dev.bus_id);
ec->resource[i].end -= ec->resource[i].start;
ec->resource[i].start = 0;
}
}
}
static ssize_t ecard_show_irq(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
return sprintf(buf, "%u\n", ec->irq);
}
static DEVICE_ATTR(irq, S_IRUGO, ecard_show_irq, NULL);
static ssize_t ecard_show_dma(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
return sprintf(buf, "%u\n", ec->dma);
}
static DEVICE_ATTR(dma, S_IRUGO, ecard_show_dma, NULL);
static ssize_t ecard_show_resources(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
char *str = buf;
int i;
for (i = 0; i < ECARD_NUM_RESOURCES; i++)
str += sprintf(str, "%08lx %08lx %08lx\n",
ec->resource[i].start,
ec->resource[i].end,
ec->resource[i].flags);
return str - buf;
}
static DEVICE_ATTR(resource, S_IRUGO, ecard_show_resources, NULL);
/* /*
* Probe for an expansion card. * Probe for an expansion card.
* *
...@@ -949,6 +1033,16 @@ ecard_probe(int slot, card_type_t type) ...@@ -949,6 +1033,16 @@ ecard_probe(int slot, card_type_t type)
break; break;
} }
snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot);
snprintf(ec->dev.name, sizeof(ec->dev.name), "ecard %04x:%04x",
ec->cid.manufacturer, ec->cid.product);
ec->dev.parent = NULL;
ec->dev.bus = &ecard_bus_type;
ec->dev.dma_mask = &ec->dma_mask;
ec->dma_mask = (u64)0xffffffff;
ecard_init_resources(ec);
/* /*
* hook the interrupt handlers * hook the interrupt handlers
*/ */
...@@ -974,14 +1068,10 @@ ecard_probe(int slot, card_type_t type) ...@@ -974,14 +1068,10 @@ ecard_probe(int slot, card_type_t type)
*ecp = ec; *ecp = ec;
slot_to_expcard[slot] = ec; slot_to_expcard[slot] = ec;
snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot);
strcpy(ec->dev.name, "fixme!");
ec->dev.parent = NULL;
ec->dev.bus = &ecard_bus_type;
ec->dev.dma_mask = &ec->dma_mask;
ec->dma_mask = (u64)0xffffffff;
device_register(&ec->dev); device_register(&ec->dev);
device_create_file(&ec->dev, &dev_attr_dma);
device_create_file(&ec->dev, &dev_attr_irq);
device_create_file(&ec->dev, &dev_attr_resource);
return 0; return 0;
......
...@@ -78,7 +78,8 @@ static struct irqdesc bad_irq_desc = { ...@@ -78,7 +78,8 @@ static struct irqdesc bad_irq_desc = {
* disable_irq - disable an irq and wait for completion * disable_irq - disable an irq and wait for completion
* @irq: Interrupt to disable * @irq: Interrupt to disable
* *
* Disable the selected interrupt line. We do this lazily. * Disable the selected interrupt line. Enables and disables
* are nested. We do this lazily.
* *
* This function may be called from IRQ context. * This function may be called from IRQ context.
*/ */
...@@ -88,8 +89,7 @@ void disable_irq(unsigned int irq) ...@@ -88,8 +89,7 @@ void disable_irq(unsigned int irq)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&irq_controller_lock, flags); spin_lock_irqsave(&irq_controller_lock, flags);
if (!desc->depth++) desc->disable_depth++;
desc->enabled = 0;
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
} }
...@@ -107,24 +107,25 @@ void enable_irq(unsigned int irq) ...@@ -107,24 +107,25 @@ void enable_irq(unsigned int irq)
{ {
struct irqdesc *desc = irq_desc + irq; struct irqdesc *desc = irq_desc + irq;
unsigned long flags; unsigned long flags;
int pending = 0;
spin_lock_irqsave(&irq_controller_lock, flags); spin_lock_irqsave(&irq_controller_lock, flags);
if (unlikely(!desc->depth)) { if (unlikely(!desc->disable_depth)) {
printk("enable_irq(%u) unbalanced from %p\n", irq, printk("enable_irq(%u) unbalanced from %p\n", irq,
__builtin_return_address(0)); __builtin_return_address(0));
} else if (!--desc->depth) { } else if (!--desc->disable_depth) {
desc->probing = 0; desc->probing = 0;
desc->enabled = 1;
desc->chip->unmask(irq); desc->chip->unmask(irq);
pending = desc->pending;
desc->pending = 0;
/* /*
* If the interrupt was waiting to be processed, * If the interrupt is waiting to be processed,
* retrigger it. * try to re-run it. We can't directly run it
* from here since the caller might be in an
* interrupt-protected region.
*/ */
if (pending) if (desc->pending) {
desc->pending = 0;
desc->chip->rerun(irq); desc->chip->rerun(irq);
}
} }
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
} }
...@@ -264,7 +265,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -264,7 +265,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
* we shouldn't process the IRQ. Instead, turn on the * we shouldn't process the IRQ. Instead, turn on the
* hardware masks. * hardware masks.
*/ */
if (unlikely(desc->running || !desc->enabled)) if (unlikely(desc->running || desc->disable_depth))
goto running; goto running;
/* /*
...@@ -286,13 +287,13 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -286,13 +287,13 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
if (!action) if (!action)
break; break;
if (desc->pending && desc->enabled) { if (desc->pending && !desc->disable_depth) {
desc->pending = 0; desc->pending = 0;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
__do_irq(irq, action, regs); __do_irq(irq, action, regs);
} while (desc->pending && desc->enabled); } while (desc->pending && !desc->disable_depth);
desc->running = 0; desc->running = 0;
...@@ -328,7 +329,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -328,7 +329,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
*/ */
desc->chip->ack(irq); desc->chip->ack(irq);
if (likely(desc->enabled)) { if (likely(!desc->disable_depth)) {
kstat_cpu(cpu).irqs[irq]++; kstat_cpu(cpu).irqs[irq]++;
/* /*
...@@ -338,7 +339,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -338,7 +339,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
if (action) { if (action) {
__do_irq(irq, desc->action, regs); __do_irq(irq, desc->action, regs);
if (likely(desc->enabled && if (likely(!desc->disable_depth &&
!check_irq_lock(desc, irq, regs))) !check_irq_lock(desc, irq, regs)))
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
...@@ -390,14 +391,13 @@ void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) ...@@ -390,14 +391,13 @@ void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
if (handle == do_bad_IRQ) { if (handle == do_bad_IRQ) {
desc->chip->mask(irq); desc->chip->mask(irq);
desc->chip->ack(irq); desc->chip->ack(irq);
desc->depth = 1; desc->disable_depth = 1;
desc->enabled = 0;
} }
desc->handle = handle; desc->handle = handle;
if (handle != do_bad_IRQ && is_chained) { if (handle != do_bad_IRQ && is_chained) {
desc->valid = 0; desc->valid = 0;
desc->probe_ok = 0; desc->probe_ok = 0;
desc->depth = 0; desc->disable_depth = 0;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
...@@ -512,10 +512,9 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -512,10 +512,9 @@ int setup_irq(unsigned int irq, struct irqaction *new)
desc->probing = 0; desc->probing = 0;
desc->running = 0; desc->running = 0;
desc->pending = 0; desc->pending = 0;
desc->depth = 1; desc->disable_depth = 1;
if (!desc->noautoenable) { if (!desc->noautoenable) {
desc->depth = 0; desc->disable_depth = 0;
desc->enabled = 1;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/root_dev.h> #include <linux/root_dev.h>
#include <linux/cpu.h>
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/hardware.h> #include <asm/hardware.h>
...@@ -691,6 +692,15 @@ void __init setup_arch(char **cmdline_p) ...@@ -691,6 +692,15 @@ void __init setup_arch(char **cmdline_p)
#endif #endif
} }
static struct cpu cpu[1];
static int __init topology_init(void)
{
return register_cpu(cpu, 0, NULL);
}
subsys_initcall(topology_init);
static const char *hwcap_str[] = { static const char *hwcap_str[] = {
"swp", "swp",
"half", "half",
......
...@@ -53,7 +53,8 @@ static const char *handler[]= { "prefetch abort", "data abort", "address excepti ...@@ -53,7 +53,8 @@ static const char *handler[]= { "prefetch abort", "data abort", "address excepti
void dump_backtrace_entry(unsigned long where, unsigned long from) void dump_backtrace_entry(unsigned long where, unsigned long from)
{ {
printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
print_symbol(" %s\n", where); print_symbol(" %s", where);
printk("\n");
} }
/* /*
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Object file lists. # Object file lists.
obj-y := core.o io.o time.o obj-y := core.o io.o
obj-m := obj-m :=
obj-n := obj-n :=
obj- := obj- :=
......
/*
* linux/arch/arm/mach-ebsa110/time.c
*
* Copyright (C) 2001 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.
*/
#include <linux/init.h>
#include <asm/io.h>
#define PIT_CTRL (PIT_BASE + 0x0d)
#define PIT_T2 (PIT_BASE + 0x09)
#define PIT_T1 (PIT_BASE + 0x05)
#define PIT_T0 (PIT_BASE + 0x01)
/*
* This is the rate at which your MCLK signal toggles (in Hz)
* This was measured on a 10 digit frequency counter sampling
* over 1 second.
*/
#define MCLK 47894000
/*
* This is the rate at which the PIT timers get clocked
*/
#define CLKBY7 (MCLK / 7)
/*
* If CLKBY7 is larger than this, then we must do software
* division of the timer interrupt.
*/
#if CLKBY7 > 6553500
#define DIVISOR 2
#else
#define DIVISOR 1
#endif
/*
* This is the counter value
*/
#define COUNT ((CLKBY7 + (DIVISOR * HZ / 2)) / (DIVISOR * HZ))
extern unsigned long (*gettimeoffset)(void);
static unsigned long divisor;
/*
* Get the time offset from the system PIT. Note that if we have missed an
* interrupt, then the PIT counter will roll over (ie, be negative).
* This actually works out to be convenient.
*/
static unsigned long ebsa110_gettimeoffset(void)
{
unsigned long offset, count;
__raw_writeb(0x40, PIT_CTRL);
count = __raw_readb(PIT_T1);
count |= __raw_readb(PIT_T1) << 8;
/*
* If count > COUNT, make the number negative.
*/
if (count > COUNT)
count |= 0xffff0000;
offset = COUNT * (DIVISOR - divisor);
offset -= count;
/*
* `offset' is in units of timer counts. Convert
* offset to units of microseconds.
*/
offset = offset * (1000000 / HZ) / (COUNT * DIVISOR);
return offset;
}
int ebsa110_reset_timer(void)
{
u32 count;
/* latch and read timer 1 */
__raw_writeb(0x40, PIT_CTRL);
count = __raw_readb(PIT_T1);
count |= __raw_readb(PIT_T1) << 8;
count += COUNT;
__raw_writeb(count & 0xff, PIT_T1);
__raw_writeb(count >> 8, PIT_T1);
if (divisor == 0)
divisor = DIVISOR;
divisor -= 1;
return divisor;
}
void __init ebsa110_setup_timer(void)
{
/*
* Timer 1, mode 2, LSB/MSB
*/
__raw_writeb(0x70, PIT_CTRL);
__raw_writeb(COUNT & 0xff, PIT_T1);
__raw_writeb(COUNT >> 8, PIT_T1);
divisor = DIVISOR - 1;
gettimeoffset = ebsa110_gettimeoffset;
}
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/mach/pci.h> #include <asm/mach/pci.h>
...@@ -295,7 +296,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where, ...@@ -295,7 +296,7 @@ static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
v = __raw_readw(addr); v = __raw_readw(addr);
break; break;
case 4: default:
v = __raw_readl(addr); v = __raw_readl(addr);
break; break;
} }
......
...@@ -165,6 +165,13 @@ config SA1100_JORNADA720 ...@@ -165,6 +165,13 @@ config SA1100_JORNADA720
handheld computer. See <http://www.hp.com/jornada/products/720> handheld computer. See <http://www.hp.com/jornada/products/720>
for details. for details.
config SA1100_HACKKIT
bool "HackKit Core CPU Board"
depends on ARCH_SA1100
help
Say Y here to support the HackKit Core CPU Board
<http://hackkit.eletztrick.de>;
config SA1100_HUW_WEBPANEL config SA1100_HUW_WEBPANEL
bool "HuW WebPanel" bool "HuW WebPanel"
depends on ARCH_SA1100 depends on ARCH_SA1100
...@@ -307,6 +314,18 @@ config SA1100_STORK ...@@ -307,6 +314,18 @@ config SA1100_STORK
Say Y here if you intend to run this kernel on the Stork Say Y here if you intend to run this kernel on the Stork
handheld computer. handheld computer.
#config SA1100_TRIZEPS
# bool "Trizeps"
# depends on ARCH_SA1100
# help
# :: write me ::
#config TRIZEPS_MFTB2
# bool "MFTB2"
# depends on SA1100_TRIZEPS
# help
# :: write me ::
config SA1100_USB config SA1100_USB
tristate "SA1100 USB function support" tristate "SA1100 USB function support"
depends on ARCH_SA1100 depends on ARCH_SA1100
......
...@@ -9,20 +9,18 @@ obj-n := ...@@ -9,20 +9,18 @@ obj-n :=
obj- := obj- :=
led-y := leds.o led-y := leds.o
export-objs := dma.o generic.o pcipool.o pm.o sa1111.o sa1111-pcibuf.o export-objs := dma.o generic.o pm.o
# This needs to be cleaned up. We probably need to have SA1100 # This needs to be cleaned up. We probably need to have SA1100
# and SA1110 config symbols. # and SA1110 config symbols.
ifeq ($(CONFIG_CPU_FREQ),y) ifeq ($(CONFIG_CPU_FREQ),y)
obj-$(CONFIG_SA1100_ASSABET) += cpu-sa1110.o obj-$(CONFIG_SA1100_ASSABET) += cpu-sa1110.o
obj-$(CONFIG_SA1100_CERF) += cpu-sa1110.o obj-$(CONFIG_SA1100_CERF) += cpu-sa1110.o
obj-$(CONFIG_SA1100_HACKKIT) += cpu-sa1110.o
obj-$(CONFIG_SA1100_LART) += cpu-sa1100.o obj-$(CONFIG_SA1100_LART) += cpu-sa1100.o
obj-$(CONFIG_SA1100_PT_SYSTEM3) += cpu-sa1110.o obj-$(CONFIG_SA1100_PT_SYSTEM3) += cpu-sa1110.o
endif endif
# Next, the SA1111 stuff.
obj-$(CONFIG_SA1111) += sa1111.o sa1111-pcibuf.o pcipool.o
# Specific board support # Specific board support
obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o obj-$(CONFIG_SA1100_ADSBITSY) += adsbitsy.o
led-$(CONFIG_SA1100_ADSBITSY) += leds-adsbitsy.o led-$(CONFIG_SA1100_ADSBITSY) += leds-adsbitsy.o
...@@ -60,6 +58,9 @@ led-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o ...@@ -60,6 +58,9 @@ led-$(CONFIG_SA1100_GRAPHICSMASTER) += leds-graphicsmaster.o
obj-$(CONFIG_SA1100_H3600) += h3600.o obj-$(CONFIG_SA1100_H3600) += h3600.o
export-objs += h3600.o export-objs += h3600.o
obj-$(CONFIG_SA1100_HACKKIT) += hackkit.o
led-$(CONFIG_SA1100_HACKKIT) += leds-hackkit.o
obj-$(CONFIG_SA1100_HUW_WEBPANEL) += huw_webpanel.o obj-$(CONFIG_SA1100_HUW_WEBPANEL) += huw_webpanel.o
export-objs += huw_webpanel.o export-objs += huw_webpanel.o
...@@ -94,6 +95,9 @@ led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o ...@@ -94,6 +95,9 @@ led-$(CONFIG_SA1100_SIMPAD) += leds-simpad.o
obj-$(CONFIG_SA1100_STORK) += stork.o obj-$(CONFIG_SA1100_STORK) += stork.o
export-objs += stork.o export-objs += stork.o
obj-$(CONFIG_SA1100_TRIZEPS) += trizeps.o
export-objs += trizeps.o
obj-$(CONFIG_SA1100_XP860) += xp860.o obj-$(CONFIG_SA1100_XP860) += xp860.o
obj-$(CONFIG_SA1100_YOPY) += yopy.o obj-$(CONFIG_SA1100_YOPY) += yopy.o
...@@ -106,4 +110,4 @@ obj-$(CONFIG_LEDS) += $(led-y) ...@@ -106,4 +110,4 @@ obj-$(CONFIG_LEDS) += $(led-y)
#obj-$(CONFIG_SA1100_USB) += usb/ #obj-$(CONFIG_SA1100_USB) += usb/
# Miscelaneous functions # Miscelaneous functions
obj-$(CONFIG_PM) += pm.o sleep.o obj-$(CONFIG_PM) += pm.o sleep.o
/*
* linux/arch/arm/mach-sa1100/hackkit.c
*
* Copyright (C) 2002 Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>
*
* This file contains all HackKit tweaks. Based on original work from
* Nicolas Pitre's assabet fixes
*
* 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.
*
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/cpufreq.h>
#include <linux/serial_core.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/setup.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
/**********************************************************************
* prototypes
*/
/* init funcs */
static void __init get_hackkit_scr(void);
static int __init hackkit_init(void);
static void __init hackkit_init_irq(void);
static void __init hackkit_map_io(void);
static u_int hackkit_get_mctrl(struct uart_port *port);
static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl);
static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate);
/**********************************************************************
* global data
*/
/**********************************************************************
* static data
*/
static struct map_desc hackkit_io_desc[] __initdata = {
/* virtual physical length type */
{ 0xe8000000, 0x00000000, 0x01000000, MT_DEVICE } /* Flash bank 0 */
};
static struct sa1100_port_fns hackkit_port_fns __initdata = {
.set_mctrl = hackkit_set_mctrl,
.get_mctrl = hackkit_get_mctrl,
.pm = hackkit_uart_pm,
};
/**********************************************************************
* Static functions
*/
static void __init hackkit_map_io(void)
{
sa1100_map_io();
iotable_init(hackkit_io_desc, ARRAY_SIZE(hackkit_io_desc));
sa1100_register_uart_fns(&hackkit_port_fns);
sa1100_register_uart(0, 1); /* com port */
sa1100_register_uart(1, 2);
sa1100_register_uart(2, 3); /* radio module */
Ser1SDCR0 |= SDCR0_SUS;
}
static void __init hackkit_init_irq(void)
{
/* none used yet */
}
/**
* hackkit_uart_pm - powermgmt callback function for system 3 UART
* @port: uart port structure
* @state: pm state
* @oldstate: old pm state
*
*/
static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
{
/* TODO: switch on/off uart in powersave mode */
}
/*
* Note! this can be called from IRQ context.
* FIXME: No modem ctrl lines yet.
*/
static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl)
{
#if 0
if (port->mapbase == _Ser1UTCR0) {
u_int set = 0, clear = 0;
if (mctrl & TIOCM_RTS)
set |= PT_CTRL2_RS1_RTS;
else
clear |= PT_CTRL2_RS1_RTS;
if (mctrl & TIOCM_DTR)
set |= PT_CTRL2_RS1_DTR;
else
clear |= PT_CTRL2_RS1_DTR;
PTCTRL2_clear(clear);
PTCTRL2_set(set);
}
#endif
}
static u_int hackkit_get_mctrl(struct uart_port *port)
{
u_int ret = 0;
#if 0
u_int irqsr = PT_IRQSR;
/* need 2 reads to read current value */
irqsr = PT_IRQSR;
/* TODO: check IRQ source register for modem/com
status lines and set them correctly. */
#endif
ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
return ret;
}
static int __init hackkit_init(void)
{
int ret = 0;
if ( !machine_is_hackkit() ) {
ret = -EINVAL;
goto DONE;
}
hackkit_init_irq();
ret = 0;
DONE:
return ret;
}
/**********************************************************************
* Exported Functions
*/
/**********************************************************************
* kernel magic macros
*/
arch_initcall(hackkit_init);
MACHINE_START(HACKKIT, "HackKit Cpu Board")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
BOOT_PARAMS(0xc0000100)
MAPIO(hackkit_map_io)
INITIRQ(sa1100_init_irq)
MACHINE_END
/*
* linux/arch/arm/mach-sa1100/leds-hackkit.c
*
* based on leds-lart.c
*
* (C) Erik Mouw (J.A.K.Mouw@its.tudelft.nl), April 21, 2000
* (C) Stefan Eletzhofer <stefan.eletzhofer@eletztrick.de>, 2002
*
* The HackKit has two leds (GPIO 22/23). The red led (gpio 22) is used
* as cpu led, the green one is used as timer led.
*/
#include <linux/config.h>
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/leds.h>
#include <asm/system.h>
#include "leds.h"
#define LED_STATE_ENABLED 1
#define LED_STATE_CLAIMED 2
static unsigned int led_state;
static unsigned int hw_led_state;
#define LED_GREEN GPIO_GPIO23
#define LED_RED GPIO_GPIO22
#define LED_MASK (LED_RED | LED_GREEN)
void hackkit_leds_event(led_event_t evt)
{
unsigned long flags;
local_irq_save(flags);
switch(evt) {
case led_start:
/* pin 22/23 are outputs */
GPDR |= LED_MASK;
hw_led_state = LED_MASK;
led_state = LED_STATE_ENABLED;
break;
case led_stop:
led_state &= ~LED_STATE_ENABLED;
break;
case led_claim:
led_state |= LED_STATE_CLAIMED;
hw_led_state = LED_MASK;
break;
case led_release:
led_state &= ~LED_STATE_CLAIMED;
hw_led_state = LED_MASK;
break;
#ifdef CONFIG_LEDS_TIMER
case led_timer:
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state ^= LED_GREEN;
break;
#endif
#ifdef CONFIG_LEDS_CPU
case led_idle_start:
/* The LART people like the LED to be off when the
system is idle... */
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state &= ~LED_RED;
break;
case led_idle_end:
/* ... and on if the system is not idle */
if (!(led_state & LED_STATE_CLAIMED))
hw_led_state |= LED_RED;
break;
#endif
case led_red_on:
if (led_state & LED_STATE_CLAIMED)
hw_led_state &= ~LED_RED;
break;
case led_red_off:
if (led_state & LED_STATE_CLAIMED)
hw_led_state |= LED_RED;
break;
case led_green_on:
if (led_state & LED_STATE_CLAIMED)
hw_led_state &= ~LED_GREEN;
break;
case led_green_off:
if (led_state & LED_STATE_CLAIMED)
hw_led_state |= LED_GREEN;
break;
default:
break;
}
/* Now set the GPIO state, or nothing will happen at all */
if (led_state & LED_STATE_ENABLED) {
GPSR = hw_led_state;
GPCR = hw_led_state ^ LED_MASK;
}
local_irq_restore(flags);
}
...@@ -29,6 +29,8 @@ sa1100_leds_init(void) ...@@ -29,6 +29,8 @@ sa1100_leds_init(void)
leds_event = flexanet_leds_event; leds_event = flexanet_leds_event;
if (machine_is_graphicsclient()) if (machine_is_graphicsclient())
leds_event = graphicsclient_leds_event; leds_event = graphicsclient_leds_event;
if (machine_is_hackkit())
leds_event = hackkit_leds_event;
if (machine_is_lart()) if (machine_is_lart())
leds_event = lart_leds_event; leds_event = lart_leds_event;
if (machine_is_pfs168()) if (machine_is_pfs168())
......
...@@ -5,6 +5,7 @@ extern void brutus_leds_event(led_event_t evt); ...@@ -5,6 +5,7 @@ extern void brutus_leds_event(led_event_t evt);
extern void cerf_leds_event(led_event_t evt); extern void cerf_leds_event(led_event_t evt);
extern void flexanet_leds_event(led_event_t evt); extern void flexanet_leds_event(led_event_t evt);
extern void graphicsclient_leds_event(led_event_t evt); extern void graphicsclient_leds_event(led_event_t evt);
extern void hackkit_leds_event(led_event_t evt);
extern void lart_leds_event(led_event_t evt); extern void lart_leds_event(led_event_t evt);
extern void pfs168_leds_event(led_event_t evt); extern void pfs168_leds_event(led_event_t evt);
extern void graphicsmaster_leds_event(led_event_t evt); extern void graphicsmaster_leds_event(led_event_t evt);
......
/*
* linux/arch/arm/mach-sa1100/trizeps.c
*
* Authors:
* Andreas Hofer <ho@dsa-ac.de>,
* Peter Lueg <pl@dsa-ac.de>,
* Guennadi Liakhovetski <gl@dsa-ac.de>
*
* This file contains all Trizeps-specific tweaks.
*
* 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.
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <asm/mach-types.h>
#include <asm/hardware.h>
#include <asm/arch/trizeps.h>
#include <asm/setup.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/mach/serial_sa1100.h>
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <asm/arch/serial.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/arch/irqs.h>
#include "generic.h"
#undef DEBUG_TRIZEPS
#ifdef DEBUG_TRIZEPS
#define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
#else
#define DPRINTK( x... )
#endif
static struct tri_uart_cts_data_t tri_uart_cts_data[] = {
{ TRIZEPS_GPIO_UART1_CTS, 0, NULL, NULL,"int. UART1 cts" },
{ TRIZEPS_GPIO_UART2_CTS, 0, NULL, NULL,"int. UART2 cts" },
{ TRIZEPS_GPIO_UART3_CTS, 0, NULL, NULL,"int. UART3 cts" }
};
static void trizeps_cts_intr(int irq, void *dev_id, struct pt_regs *regs)
{
struct tri_uart_cts_data_t * uart_data = (struct tri_uart_cts_data_t *)dev_id;
int cts = (!(GPLR & uart_data->cts_gpio));
/* NOTE: I suppose that we will not get any interrupts
if the GPIO is not changed, so maybe
the cts_prev_state can be removed ... */
if (cts != uart_data->cts_prev_state) {
uart_data->cts_prev_state = cts;
uart_handle_cts_change(uart_data->port, cts);
DPRINTK("(IRQ %d) changed (cts=%d) stop=%d\n",
irq, cts, uart_data->info->tty->hw_stopped);
}
}
static int
trizeps_register_cts_intr(int gpio,
int irq,
struct tri_uart_cts_data_t *uart_data)
{
int ret = 0;
if(irq != NO_IRQ)
{
set_irq_type(irq, IRQT_BOTHEDGE);
ret = request_irq(irq, trizeps_cts_intr,
SA_INTERRUPT, uart_data->name, uart_data);
if (ret)
printk(KERN_ERR "uart_open: failed to register CTS irq (%d)\n", ret);
}
return ret;
}
static void trizeps_set_mctrl(struct uart_port *port, u_int mctrl)
{
if (port->mapbase == _Ser1UTCR0)
{
/**** ttySA1 ****/
if (mctrl & TIOCM_RTS)
GPCR |= TRIZEPS_GPIO_UART1_RTS;
else
GPSR |= TRIZEPS_GPIO_UART1_RTS;
DPRINTK("2 ttySA%d Set RTS %s\n",port->line,
mctrl & TIOCM_RTS ? "low" : "high");
}
else if (port->mapbase == _Ser3UTCR0)
{
/**** ttySA0 ****/
}
else
{
/**** ttySA2 ****/
}
}
static u_int trizeps_get_mctrl(struct uart_port *port)
{
int result = TIOCM_CD | TIOCM_DSR;
if (port->mapbase == _Ser1UTCR0)
{
if (!(GPLR & TRIZEPS_GPIO_UART1_CTS))
result |= TIOCM_CTS;
}
else if (port->mapbase == _Ser2UTCR0)
{
result |= TIOCM_CTS;
}
else if (port->mapbase == _Ser3UTCR0)
{
result |= TIOCM_CTS;
}
else
{
result = TIOCM_CTS;
}
DPRINTK(" ttySA%d %s%s%s\n",port->line,
result & TIOCM_CD ? "CD " : "",
result & TIOCM_CTS ? "CTS " : "",
result & TIOCM_DSR ? "DSR " : "");
return result;
}
static struct sa1100_port_fns trizeps_port_fns __initdata = {
.set_mctrl = trizeps_set_mctrl,
.get_mctrl = trizeps_get_mctrl,
};
static void trizeps_power_off(void)
{
printk("trizeps power off\n");
mdelay(100);
cli();
/* disable internal oscillator, float CS lines */
PCFR = (PCFR_OPDE | PCFR_FP | PCFR_FS);
/* enable wake-up on GPIO0 (Assabet...) */
PWER = GFER = GRER = 1;
/*
* set scratchpad to zero, just in case it is used as a
* restart address by the bootloader.
*/
PSPR = 0;
/*
* Power off
* -> disconnect AKku
*/
TRIZEPS_BCR_set(TRIZEPS_BCR0, TRIZEPS_MFT_OFF);
/*
* if power supply no Akku
* -> enter sleep mode
*/
PMCR = PMCR_SF;
}
static int __init trizeps_init(void)
{
if (!machine_is_trizeps())
return -EINVAL;
DPRINTK(" \n");
pm_power_off = trizeps_power_off;
// Init UART2 for IrDA
// PPDR |= PPC_TXD2; // Set TXD2 as output
Ser2UTCR4 = UTCR4_HSE; // enable HSE
Ser2HSCR0 = 0;
Ser2HSSR0 = HSSR0_EIF | HSSR0_TUR | HSSR0_RAB | HSSR0_FRE;
/* Init MECR */
MECR = 0x00060006;
/* Set up external serial IRQs */
GAFR &= ~(GPIO_GPIO16 | GPIO_GPIO17); // no alternate function
GPDR &= ~(GPIO_GPIO16 | GPIO_GPIO17); // Set to Input
set_irq_type(IRQ_GPIO16, IRQT_RISING);
set_irq_type(IRQ_GPIO17, IRQT_RISING);
return 0;
}
__initcall(trizeps_init);
static struct map_desc trizeps_io_desc[] __initdata = {
/* virtual physical length type */
{ 0xF0000000l, 0x30000000l, 0x00800000l, MT_DEVICE },
{ 0xF2000000l, 0x38000000l, 0x00800000l, MT_DEVICE },
};
static void __init trizeps_map_io(void)
{
sa1100_map_io();
iotable_init(trizeps_io_desc, ARRAY_SIZE(trizeps_io_desc));
sa1100_register_uart_fns(&trizeps_port_fns);
sa1100_register_uart(0, 3);
sa1100_register_uart(1, 1);
sa1100_register_uart(2, 2);
}
MACHINE_START(TRIZEPS, "TRIZEPS")
MAINTAINER("DSA")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
MAPIO(trizeps_map_io)
INITIRQ(sa1100_init_irq)
MACHINE_END
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/errno.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include "pcf8583.h" #include "pcf8583.h"
......
...@@ -3110,7 +3110,8 @@ static struct ecard_driver acornscsi_driver = { ...@@ -3110,7 +3110,8 @@ static struct ecard_driver acornscsi_driver = {
.remove = __devexit_p(acornscsi_remove), .remove = __devexit_p(acornscsi_remove),
.id_table = acornscsi_cids, .id_table = acornscsi_cids,
.drv = { .drv = {
.name = "acornscsi", .devclass = &shost_devclass,
.name = "acornscsi",
}, },
}; };
......
...@@ -40,33 +40,18 @@ ...@@ -40,33 +40,18 @@
#include "fas216.h" #include "fas216.h"
struct arxescsi_info { struct arxescsi_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec;
/* other info... */
unsigned int cstatus; /* card status register */
unsigned int dmaarea; /* Pseudo DMA area */
}; };
#define CSTATUS_IRQ (1 << 0) #define DMADATA_OFFSET (0x200)
#define CSTATUS_DRQ (1 << 0)
#ifndef CAN_QUEUE
#define CAN_QUEUE 1
#endif
#ifndef CMD_PER_LUN #define DMASTAT_OFFSET (0x600)
#define CMD_PER_LUN 1 #define DMASTAT_DRQ (1 << 0)
#endif
/* Hmm - this should go somewhere else */ #define CSTATUS_IRQ (1 << 0)
#define BUS_ADDR(x) ((((unsigned long)(x)) << 2) + IO_BASE)
/* #define VERSION "1.10 (23/01/2003 2.5.57)"
* Version
*/
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_PATCH 1
/* /*
* Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type) * Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type)
...@@ -87,44 +72,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -87,44 +72,7 @@ arxescsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
return fasdma_pseudo; return fasdma_pseudo;
} }
static void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned char *base)
/* Faster transfer routines, written by SH to speed up the loops */
static inline unsigned char getb(unsigned int address, unsigned int reg)
{
unsigned char value;
__asm__ __volatile__(
"ldrb %0, [%1, %2, lsl #5]"
: "=r" (value)
: "r" (address), "r" (reg) );
return value;
}
static inline unsigned int getw(unsigned int address, unsigned int reg)
{
unsigned int value;
__asm__ __volatile__(
"ldr %0, [%1, %2, lsl #5]\n\t"
"mov %0, %0, lsl #16\n\t"
"mov %0, %0, lsr #16"
: "=r" (value)
: "r" (address), "r" (reg) );
return value;
}
static inline void putw(unsigned int address, unsigned int reg, unsigned long value)
{
__asm__ __volatile__(
"mov %0, %0, lsl #16\n\t"
"str %0, [%1, %2, lsl #5]"
:
: "r" (value), "r" (address), "r" (reg) );
}
void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io)
{ {
__asm__ __volatile__( __asm__ __volatile__(
" stmdb sp!, {r0-r12}\n" " stmdb sp!, {r0-r12}\n"
...@@ -149,7 +97,7 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io) ...@@ -149,7 +97,7 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io)
" bne .loop_1\n" " bne .loop_1\n"
" ldmia sp!, {r0-r12}\n" " ldmia sp!, {r0-r12}\n"
: :
: "r" (addr), "r" (io) ); : "r" (addr), "r" (base));
} }
/* /*
...@@ -160,40 +108,41 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io) ...@@ -160,40 +108,41 @@ void arxescsi_pseudo_dma_write(unsigned char *addr, unsigned int io)
* direction - DMA on to/off of card * direction - DMA on to/off of card
* transfer - minimum number of bytes we expect to transfer * transfer - minimum number of bytes we expect to transfer
*/ */
void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, static void
fasdmadir_t direction, int transfer) arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, int transfer)
{ {
struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
unsigned int length, io, error=0; unsigned int length, error = 0;
unsigned char *base = info->info.scsi.io_base;
unsigned char *addr; unsigned char *addr;
length = SCp->this_residual; length = SCp->this_residual;
addr = SCp->ptr; addr = SCp->ptr;
io = __ioaddr(host->io_port);
if (direction == DMA_OUT) { if (direction == DMA_OUT) {
unsigned int word; unsigned int word;
while (length > 256) { while (length > 256) {
if (getb(io, 4) & STAT_INT) { if (readb(base + 0x80) & STAT_INT) {
error=1; error = 1;
break; break;
} }
arxescsi_pseudo_dma_write(addr, io); arxescsi_pseudo_dma_write(addr, base);
addr += 256; addr += 256;
length -= 256; length -= 256;
} }
if (!error) if (!error)
while (length > 0) { while (length > 0) {
if (getb(io, 4) & STAT_INT) if (readb(base + 0x80) & STAT_INT)
break; break;
if (!(getb(io, 48) & CSTATUS_IRQ)) if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ))
continue; continue;
word = *addr | *(addr + 1) << 8; word = *addr | *(addr + 1) << 8;
putw(io, 16, word); writew(word, base + DMADATA_OFFSET);
if (length > 1) { if (length > 1) {
addr += 2; addr += 2;
length -= 2; length -= 2;
...@@ -206,15 +155,15 @@ void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -206,15 +155,15 @@ void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
else { else {
if (transfer && (transfer & 255)) { if (transfer && (transfer & 255)) {
while (length >= 256) { while (length >= 256) {
if (getb(io, 4) & STAT_INT) { if (readb(base + 0x80) & STAT_INT) {
error=1; error = 1;
break; break;
} }
if (!(getb(io, 48) & CSTATUS_IRQ)) if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ))
continue; continue;
insw(info->dmaarea, addr, 256 >> 1); readsw(base + DMADATA_OFFSET, addr, 256 >> 1);
addr += 256; addr += 256;
length -= 256; length -= 256;
} }
...@@ -224,13 +173,13 @@ void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -224,13 +173,13 @@ void arxescsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
while (length > 0) { while (length > 0) {
unsigned long word; unsigned long word;
if (getb(io, 4) & STAT_INT) if (readb(base + 0x80) & STAT_INT)
break; break;
if (!(getb(io, 48) & CSTATUS_IRQ)) if (!(readb(base + DMASTAT_OFFSET) & DMASTAT_DRQ))
continue; continue;
word = getw(io, 16); word = readw(base + DMADATA_OFFSET);
*addr++ = word; *addr++ = word;
if (--length > 0) { if (--length > 0) {
*addr++ = word >> 8; *addr++ = word >> 8;
...@@ -259,15 +208,14 @@ static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -259,15 +208,14 @@ static void arxescsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
* Params : host - driver host structure to return info for. * Params : host - driver host structure to return info for.
* Returns : pointer to a static buffer containing null terminated string. * Returns : pointer to a static buffer containing null terminated string.
*/ */
const char *arxescsi_info(struct Scsi_Host *host) static const char *arxescsi_info(struct Scsi_Host *host)
{ {
struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
static char string[100], *p; static char string[150];
p = string; sprintf(string, "%s (%s) in slot %d v%s",
p += sprintf(p, "%s ", host->hostt->name); host->hostt->name, info->info.scsi.type, info->ec->slot_no,
p += fas216_info(&info->info, p); VERSION);
p += sprintf(p, "v%d.%d.%d", VER_MAJOR, VER_MINOR, VER_PATCH);
return string; return string;
} }
...@@ -286,8 +234,9 @@ const char *arxescsi_info(struct Scsi_Host *host) ...@@ -286,8 +234,9 @@ const char *arxescsi_info(struct Scsi_Host *host)
* inout - 0 for reading, 1 for writing. * inout - 0 for reading, 1 for writing.
* Returns : length of data written to buffer. * Returns : length of data written to buffer.
*/ */
int arxescsi_proc_info(char *buffer, char **start, off_t offset, static int
int length, int host_no, int inout) arxescsi_proc_info(char *buffer, char **start, off_t offset, int length,
int host_no, int inout)
{ {
int pos, begin; int pos, begin;
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -303,9 +252,7 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -303,9 +252,7 @@ int arxescsi_proc_info(char *buffer, char **start, off_t offset,
return -EINVAL; return -EINVAL;
begin = 0; begin = 0;
pos = sprintf(buffer, pos = sprintf(buffer, "ARXE 16-bit SCSI driver v%s\n", VERSION);
"ARXE 16-bit SCSI driver version %d.%d.%d\n",
VER_MAJOR, VER_MINOR, VER_PATCH);
pos += fas216_print_host(&info->info, buffer + pos); pos += fas216_print_host(&info->info, buffer + pos);
pos += fas216_print_stats(&info->info, buffer + pos); pos += fas216_print_stats(&info->info, buffer + pos);
...@@ -343,7 +290,7 @@ static Scsi_Host_Template arxescsi_template = { ...@@ -343,7 +290,7 @@ static Scsi_Host_Template arxescsi_template = {
.can_queue = 0, .can_queue = 0,
.this_id = 7, .this_id = 7,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.cmd_per_lun = CMD_PER_LUN, .cmd_per_lun = 1,
.use_clustering = DISABLE_CLUSTERING, .use_clustering = DISABLE_CLUSTERING,
.proc_name = "arxescsi", .proc_name = "arxescsi",
}; };
...@@ -352,21 +299,41 @@ static int __devinit ...@@ -352,21 +299,41 @@ static int __devinit
arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
struct arxescsi_info *info; struct arxescsi_info *info;
int ret = -ENOMEM; unsigned long resbase, reslen;
unsigned char *base;
int ret;
host = scsi_register(&arxescsi_template, sizeof(struct arxescsi_info)); resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
if (!host) reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
if (!request_mem_region(resbase, reslen, "arxescsi")) {
ret = -EBUSY;
goto out; goto out;
}
host->io_port = ecard_address(ec, ECARD_MEMC, 0) + 0x0800; base = ioremap(resbase, reslen);
if (!base) {
ret = -ENOMEM;
goto out_region;
}
host = scsi_register(&arxescsi_template, sizeof(struct arxescsi_info));
if (!host) {
ret = -ENOMEM;
goto out_unmap;
}
host->base = (unsigned long)base;
host->irq = NO_IRQ; host->irq = NO_IRQ;
host->dma_channel = NO_DMA; host->dma_channel = NO_DMA;
info = (struct arxescsi_info *)host->hostdata; info = (struct arxescsi_info *)host->hostdata;
info->info.scsi.io_port = host->io_port; info->ec = ec;
info->info.scsi.io_base = base + 0x2000;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
info->info.scsi.io_shift = 3; info->info.scsi.io_shift = 5;
info->info.ifcfg.clockrate = 24; /* MHz */ info->info.ifcfg.clockrate = 24; /* MHz */
info->info.ifcfg.select_timeout = 255; info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */ info->info.ifcfg.asyncperiod = 200; /* ns */
...@@ -374,39 +341,29 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -374,39 +341,29 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 0; info->info.ifcfg.disconnect_ok = 0;
info->info.ifcfg.wide_max_size = 0; info->info.ifcfg.wide_max_size = 0;
info->info.ifcfg.capabilities = FASCAP_PSEUDODMA;
info->info.dma.setup = arxescsi_dma_setup; info->info.dma.setup = arxescsi_dma_setup;
info->info.dma.pseudo = arxescsi_dma_pseudo; info->info.dma.pseudo = arxescsi_dma_pseudo;
info->info.dma.stop = arxescsi_dma_stop; 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->irqaddr = base;
ec->irqmask = CSTATUS_IRQ; ec->irqmask = CSTATUS_IRQ;
if (!request_region(host->io_port, 120, "arxescsi-fas")) { ret = fas216_init(host);
ret = -EBUSY; if (ret)
goto out_free; goto out_unregister;
}
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 = fas216_add(host, &ec->dev);
ret = scsi_add_host(host, &ec->dev);
if (ret == 0) if (ret == 0)
goto out; goto out;
release_region(host->io_port + 128, 384); fas216_release(host);
out_release: out_unregister:
release_region(host->io_port, 120);
out_free:
scsi_unregister(host); scsi_unregister(host);
out_unmap:
iounmap(base);
out_region:
release_mem_region(resbase, reslen);
out: out:
return ret; return ret;
} }
...@@ -414,13 +371,19 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -414,13 +371,19 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit arxescsi_remove(struct expansion_card *ec) static void __devexit arxescsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
scsi_remove_host(host); fas216_remove(host);
fas216_release(host);
iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
release_region(host->io_port + 128, 384); release_mem_region(resbase, reslen);
release_region(host->io_port, 120);
fas216_release(host);
scsi_unregister(host); scsi_unregister(host);
} }
...@@ -434,7 +397,8 @@ static struct ecard_driver arxescsi_driver = { ...@@ -434,7 +397,8 @@ static struct ecard_driver arxescsi_driver = {
.remove = __devexit_p(arxescsi_remove), .remove = __devexit_p(arxescsi_remove),
.id_table = arxescsi_cids, .id_table = arxescsi_cids,
.drv = { .drv = {
.name = "arxescsi", .devclass = &shost_devclass,
.name = "arxescsi",
}, },
}; };
......
...@@ -334,7 +334,8 @@ static struct ecard_driver cumanascsi1_driver = { ...@@ -334,7 +334,8 @@ static struct ecard_driver cumanascsi1_driver = {
.remove = __devexit_p(cumanascsi1_remove), .remove = __devexit_p(cumanascsi1_remove),
.id_table = cumanascsi1_cids, .id_table = cumanascsi1_cids,
.drv = { .drv = {
.name = "cumanascsi1", .devclass = &shost_devclass,
.name = "cumanascsi1",
}, },
}; };
......
...@@ -41,12 +41,12 @@ ...@@ -41,12 +41,12 @@
#include <scsi/scsicam.h> #include <scsi/scsicam.h>
#define CUMANASCSI2_STATUS (0) #define CUMANASCSI2_STATUS (0x0000)
#define STATUS_INT (1 << 0) #define STATUS_INT (1 << 0)
#define STATUS_DRQ (1 << 1) #define STATUS_DRQ (1 << 1)
#define STATUS_LATCHED (1 << 3) #define STATUS_LATCHED (1 << 3)
#define CUMANASCSI2_ALATCH (5) #define CUMANASCSI2_ALATCH (0x0014)
#define ALATCH_ENA_INT (3) #define ALATCH_ENA_INT (3)
#define ALATCH_DIS_INT (2) #define ALATCH_DIS_INT (2)
#define ALATCH_ENA_TERM (5) #define ALATCH_ENA_TERM (5)
...@@ -58,11 +58,10 @@ ...@@ -58,11 +58,10 @@
#define ALATCH_DMA_OUT (15) #define ALATCH_DMA_OUT (15)
#define ALATCH_DMA_IN (14) #define ALATCH_DMA_IN (14)
#define CUMANASCSI2_PSEUDODMA (0x80) #define CUMANASCSI2_PSEUDODMA (0x0200)
#define CUMANASCSI2_FAS216_OFFSET (0xc0) #define CUMANASCSI2_FAS216_OFFSET (0x0300)
#define CUMANASCSI2_FAS216_SHIFT 0 #define CUMANASCSI2_FAS216_SHIFT 2
#define CUMANASCSI2_FAS216_SIZE (16)
/* /*
* Version * Version
...@@ -77,13 +76,14 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -77,13 +76,14 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
#define NR_SG 256 #define NR_SG 256
struct cumanascsi2_info { struct cumanascsi2_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec;
unsigned int status; /* card status register */
unsigned int alatch; /* Control register */ void *status; /* card status register */
unsigned int terms; /* Terminator state */ void *alatch; /* Control register */
unsigned int dmaarea; /* Pseudo DMA area */ unsigned int terms; /* Terminator state */
struct scatterlist sg[NR_SG]; /* Scatter DMA list */ void *dmaarea; /* Pseudo DMA area */
struct scatterlist sg[NR_SG]; /* Scatter DMA list */
}; };
#define CSTATUS_IRQ (1 << 0) #define CSTATUS_IRQ (1 << 0)
...@@ -97,8 +97,7 @@ struct cumanascsi2_info { ...@@ -97,8 +97,7 @@ struct cumanascsi2_info {
static void static void
cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr) cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr)
{ {
unsigned int port = (unsigned int)ec->irq_data; writeb(ALATCH_ENA_INT, ec->irq_data);
outb(ALATCH_ENA_INT, port);
} }
/* Prototype: void cumanascsi_2_irqdisable(ec, irqnr) /* Prototype: void cumanascsi_2_irqdisable(ec, irqnr)
...@@ -109,8 +108,7 @@ cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr) ...@@ -109,8 +108,7 @@ cumanascsi_2_irqenable(struct expansion_card *ec, int irqnr)
static void static void
cumanascsi_2_irqdisable(struct expansion_card *ec, int irqnr) cumanascsi_2_irqdisable(struct expansion_card *ec, int irqnr)
{ {
unsigned int port = (unsigned int)ec->irq_data; writeb(ALATCH_DIS_INT, ec->irq_data);
outb(ALATCH_DIS_INT, port);
} }
static const expansioncard_ops_t cumanascsi_2_ops = { static const expansioncard_ops_t cumanascsi_2_ops = {
...@@ -130,10 +128,10 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -130,10 +128,10 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off)
if (on_off) { if (on_off) {
info->terms = 1; info->terms = 1;
outb (ALATCH_ENA_TERM, info->alatch); writeb(ALATCH_ENA_TERM, info->alatch);
} else { } else {
info->terms = 0; info->terms = 0;
outb (ALATCH_DIS_TERM, info->alatch); writeb(ALATCH_DIS_TERM, info->alatch);
} }
} }
...@@ -146,9 +144,9 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -146,9 +144,9 @@ cumanascsi_2_terminator_ctl(struct Scsi_Host *host, int on_off)
static void static void
cumanascsi_2_intr(int irq, void *dev_id, struct pt_regs *regs) cumanascsi_2_intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct Scsi_Host *host = (struct Scsi_Host *)dev_id; struct cumanascsi2_info *info = dev_id;
fas216_intr(host); fas216_intr(&info->info);
} }
/* Prototype: fasdmatype_t cumanascsi_2_dma_setup(host, SCpnt, direction, min_type) /* Prototype: fasdmatype_t cumanascsi_2_dma_setup(host, SCpnt, direction, min_type)
...@@ -167,7 +165,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -167,7 +165,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
struct device *dev = scsi_get_device(host); struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
outb(ALATCH_DIS_DMA, info->alatch); writeb(ALATCH_DIS_DMA, info->alatch);
if (dmach != NO_DMA && if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
...@@ -188,11 +186,11 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -188,11 +186,11 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
disable_dma(dmach); disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1); set_dma_sg(dmach, info->sg, bufs + 1);
outb(alatch_dir, info->alatch); writeb(alatch_dir, info->alatch);
set_dma_mode(dmach, dma_dir); set_dma_mode(dmach, dma_dir);
enable_dma(dmach); enable_dma(dmach);
outb(ALATCH_ENA_DMA, info->alatch); writeb(ALATCH_ENA_DMA, info->alatch);
outb(ALATCH_DIS_BIT32, info->alatch); writeb(ALATCH_DIS_BIT32, info->alatch);
return fasdma_real_all; return fasdma_real_all;
} }
...@@ -226,7 +224,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -226,7 +224,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
#if 0 #if 0
while (length > 1) { while (length > 1) {
unsigned long word; unsigned long word;
unsigned int status = inb(info->status); unsigned int status = readb(info->status);
if (status & STATUS_INT) if (status & STATUS_INT)
goto end; goto end;
...@@ -235,7 +233,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -235,7 +233,7 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
continue; continue;
word = *addr | *(addr + 1) << 8; word = *addr | *(addr + 1) << 8;
outw (info->dmaarea); writew(word, info->dmaarea);
addr += 2; addr += 2;
length -= 2; length -= 2;
} }
...@@ -245,15 +243,15 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -245,15 +243,15 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
else { else {
if (transfer && (transfer & 255)) { if (transfer && (transfer & 255)) {
while (length >= 256) { while (length >= 256) {
unsigned int status = inb(info->status); unsigned int status = readb(info->status);
if (status & STATUS_INT) if (status & STATUS_INT)
goto end; return;
if (!(status & STATUS_DRQ)) if (!(status & STATUS_DRQ))
continue; continue;
insw(info->dmaarea, addr, 256 >> 1); readsw(info->dmaarea, addr, 256 >> 1);
addr += 256; addr += 256;
length -= 256; length -= 256;
} }
...@@ -261,15 +259,15 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -261,15 +259,15 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
while (length > 0) { while (length > 0) {
unsigned long word; unsigned long word;
unsigned int status = inb(info->status); unsigned int status = readb(info->status);
if (status & STATUS_INT) if (status & STATUS_INT)
goto end; return;
if (!(status & STATUS_DRQ)) if (!(status & STATUS_DRQ))
continue; continue;
word = inw (info->dmaarea); word = readw(info->dmaarea);
*addr++ = word; *addr++ = word;
if (--length > 0) { if (--length > 0) {
*addr++ = word >> 8; *addr++ = word >> 8;
...@@ -277,8 +275,6 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -277,8 +275,6 @@ cumanascsi_2_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
} }
} }
} }
end:
} }
/* Prototype: int cumanascsi_2_dma_stop(host, SCpnt) /* Prototype: int cumanascsi_2_dma_stop(host, SCpnt)
...@@ -291,7 +287,7 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -291,7 +287,7 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
{ {
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
if (host->dma_channel != NO_DMA) { if (host->dma_channel != NO_DMA) {
outb(ALATCH_DIS_DMA, info->alatch); writeb(ALATCH_DIS_DMA, info->alatch);
disable_dma(host->dma_channel); disable_dma(host->dma_channel);
} }
} }
...@@ -304,13 +300,11 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -304,13 +300,11 @@ cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
const char *cumanascsi_2_info(struct Scsi_Host *host) const char *cumanascsi_2_info(struct Scsi_Host *host)
{ {
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
static char string[100], *p; static char string[150];
p = string; sprintf(string, "%s (%s) in slot %d v%s terminators o%s",
p += sprintf(p, "%s ", host->hostt->name); host->hostt->name, info->info.scsi.type, info->ec->slot_no,
p += fas216_info(&info->info, p); VERSION, info->terms ? "n" : "ff");
p += sprintf(p, "v%s terminators o%s",
VERSION, info->terms ? "n" : "ff");
return string; return string;
} }
...@@ -377,10 +371,7 @@ int cumanascsi_2_proc_info (char *buffer, char **start, off_t offset, ...@@ -377,10 +371,7 @@ int cumanascsi_2_proc_info (char *buffer, char **start, off_t offset,
info = (struct cumanascsi2_info *)host->hostdata; info = (struct cumanascsi2_info *)host->hostdata;
begin = 0; begin = 0;
pos = sprintf(buffer, pos = sprintf(buffer, "Cumana SCSI II driver v%s\n", VERSION);
"Cumana SCSI II driver version v%s\n",
VERSION);
pos += fas216_print_host(&info->info, buffer + pos); pos += fas216_print_host(&info->info, buffer + pos);
pos += sprintf(buffer + pos, "Term : o%s\n", pos += sprintf(buffer + pos, "Term : o%s\n",
info->terms ? "n" : "ff"); info->terms ? "n" : "ff");
...@@ -440,38 +431,52 @@ static int __devinit ...@@ -440,38 +431,52 @@ static int __devinit
cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
struct cumanascsi2_info *info; struct cumanascsi2_info *info;
int ret = -ENOMEM; unsigned long resbase, reslen;
unsigned char *base;
int ret;
host = scsi_register(&cumanascsi2_template, sizeof (struct cumanascsi2_info)); resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
if (!host) reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
if (!request_mem_region(resbase, reslen, "cumanascsi2")) {
ret = -EBUSY;
goto out; goto out;
}
host->io_port = ecard_address(ec, ECARD_MEMC, 0); base = ioremap(resbase, reslen);
host->irq = ec->irq; if (!base) {
host->dma_channel = ec->dma; ret = -ENOMEM;
goto out_region;
}
if (!request_region(host->io_port + CUMANASCSI2_FAS216_OFFSET, host = scsi_register(&cumanascsi2_template,
CUMANASCSI2_FAS216_SIZE, "cumanascsi2-fas")) { sizeof(struct cumanascsi2_info));
ret = -EBUSY; if (!host) {
goto out_free; ret = -ENOMEM;
goto out_unmap;
} }
host->base = (unsigned long)base;
host->irq = ec->irq;
host->dma_channel = ec->dma;
ecard_set_drvdata(ec, host); ecard_set_drvdata(ec, host);
info = (struct cumanascsi2_info *)host->hostdata; info = (struct cumanascsi2_info *)host->hostdata;
info->dmaarea = host->io_port + CUMANASCSI2_PSEUDODMA; info->ec = ec;
info->status = host->io_port + CUMANASCSI2_STATUS; info->dmaarea = base + CUMANASCSI2_PSEUDODMA;
info->alatch = host->io_port + CUMANASCSI2_ALATCH; info->status = base + CUMANASCSI2_STATUS;
info->alatch = base + CUMANASCSI2_ALATCH;
ec->irqaddr = (unsigned char *)ioaddr(info->status); ec->irqaddr = info->status;
ec->irqmask = STATUS_INT; ec->irqmask = STATUS_INT;
ec->irq_data = (void *)info->alatch; ec->irq_data = base + CUMANASCSI2_ALATCH;
ec->ops = (expansioncard_ops_t *)&cumanascsi_2_ops; ec->ops = &cumanascsi_2_ops;
cumanascsi_2_terminator_ctl(host, term[ec->slot_no]); cumanascsi_2_terminator_ctl(host, term[ec->slot_no]);
info->info.scsi.io_port = host->io_port + CUMANASCSI2_FAS216_OFFSET; info->info.scsi.io_base = base + CUMANASCSI2_FAS216_OFFSET;
info->info.scsi.io_shift = CUMANASCSI2_FAS216_SHIFT; info->info.scsi.io_shift = CUMANASCSI2_FAS216_SHIFT;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
info->info.ifcfg.clockrate = 40; /* MHz */ info->info.ifcfg.clockrate = 40; /* MHz */
...@@ -481,16 +486,21 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -481,16 +486,21 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.disconnect_ok = 1;
info->info.ifcfg.wide_max_size = 0; info->info.ifcfg.wide_max_size = 0;
info->info.ifcfg.capabilities = FASCAP_PSEUDODMA;
info->info.dma.setup = cumanascsi_2_dma_setup; info->info.dma.setup = cumanascsi_2_dma_setup;
info->info.dma.pseudo = cumanascsi_2_dma_pseudo; info->info.dma.pseudo = cumanascsi_2_dma_pseudo;
info->info.dma.stop = cumanascsi_2_dma_stop; info->info.dma.stop = cumanascsi_2_dma_stop;
ret = fas216_init(host);
if (ret)
goto out_free;
ret = request_irq(host->irq, cumanascsi_2_intr, ret = request_irq(host->irq, cumanascsi_2_intr,
SA_INTERRUPT, "cumanascsi2", host); SA_INTERRUPT, "cumanascsi2", info);
if (ret) { if (ret) {
printk("scsi%d: IRQ%d not free: %d\n", printk("scsi%d: IRQ%d not free: %d\n",
host->host_no, host->irq, ret); host->host_no, host->irq, ret);
goto out_region; goto out_release;
} }
if (host->dma_channel != NO_DMA) { if (host->dma_channel != NO_DMA) {
...@@ -500,26 +510,30 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -500,26 +510,30 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
host->dma_channel = NO_DMA; host->dma_channel = NO_DMA;
} else { } else {
set_dma_speed(host->dma_channel, 180); set_dma_speed(host->dma_channel, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
} }
} }
fas216_init(host); ret = fas216_add(host, &ec->dev);
ret = scsi_add_host(host, &ec->dev);
if (ret == 0) if (ret == 0)
goto out; goto out;
fas216_release(host);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, host);
out_region:
release_region(host->io_port + CUMANASCSI2_FAS216_OFFSET, out_release:
CUMANASCSI2_FAS216_SIZE); fas216_release(host);
out_free: out_free:
scsi_unregister(host); scsi_unregister(host);
out_unmap:
iounmap(base);
out_region:
release_mem_region(resbase, reslen);
out: out:
return ret; return ret;
} }
...@@ -527,17 +541,24 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -527,17 +541,24 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit cumanascsi2_remove(struct expansion_card *ec) static void __devexit cumanascsi2_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
scsi_remove_host(host); fas216_remove(host);
fas216_release(host);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, info);
release_region(host->io_port + CUMANASCSI2_FAS216_OFFSET,
CUMANASCSI2_FAS216_SIZE);
iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
release_mem_region(resbase, reslen);
fas216_release(host);
scsi_unregister(host); scsi_unregister(host);
} }
...@@ -551,7 +572,8 @@ static struct ecard_driver cumanascsi2_driver = { ...@@ -551,7 +572,8 @@ static struct ecard_driver cumanascsi2_driver = {
.remove = __devexit_p(cumanascsi2_remove), .remove = __devexit_p(cumanascsi2_remove),
.id_table = cumanascsi2_cids, .id_table = cumanascsi2_cids,
.drv = { .drv = {
.name = "cumanascsi2", .devclass = &shost_devclass,
.name = "cumanascsi2",
}, },
}; };
......
/* /*
* linux/drivers/acorn/scsi/eesox.c * linux/drivers/acorn/scsi/eesox.c
* *
* Copyright (C) 1997-2002 Russell King * Copyright (C) 1997-2003 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
...@@ -47,25 +47,21 @@ ...@@ -47,25 +47,21 @@
#include <scsi/scsicam.h> #include <scsi/scsicam.h>
#define EESOX_FAS216_OFFSET 0xc00 #define EESOX_FAS216_OFFSET 0x3000
#define EESOX_FAS216_SHIFT 3 #define EESOX_FAS216_SHIFT 5
#define EESOX_FAS216_SIZE (16 << EESOX_FAS216_SHIFT)
#define EESOX_STATUS 0xa00 #define EESOX_DMASTAT 0x2800
#define EESOX_STAT_INTR 0x01 #define EESOX_STAT_INTR 0x01
#define EESOX_STAT_DMA 0x02 #define EESOX_STAT_DMA 0x02
#define EESOX_CONTROL 0xa00 #define EESOX_CONTROL 0x2800
#define EESOX_INTR_ENABLE 0x04 #define EESOX_INTR_ENABLE 0x04
#define EESOX_TERM_ENABLE 0x02 #define EESOX_TERM_ENABLE 0x02
#define EESOX_RESET 0x01 #define EESOX_RESET 0x01
#define EESOX_DMA_OFFSET 0xe00 #define EESOX_DMADATA 0x3800
/* #define VERSION "1.10 (17/01/2003 2.5.59)"
* Version
*/
#define VERSION "1.00 (13/11/2002 2.5.47)"
/* /*
* Use term=0,1,0,0,0 to turn terminators on/off * Use term=0,1,0,0,0 to turn terminators on/off
...@@ -75,12 +71,12 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -75,12 +71,12 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
#define NR_SG 256 #define NR_SG 256
struct eesoxscsi_info { struct eesoxscsi_info {
FAS216_Info info; FAS216_Info info;
struct expansion_card *ec;
unsigned int ctl_port; void *ctl_port;
unsigned int control; unsigned int control;
unsigned int dmaarea; /* Pseudo DMA area */ struct scatterlist sg[NR_SG]; /* Scatter DMA list */
struct scatterlist sg[NR_SG]; /* Scatter DMA list */
}; };
/* Prototype: void eesoxscsi_irqenable(ec, irqnr) /* Prototype: void eesoxscsi_irqenable(ec, irqnr)
...@@ -95,7 +91,7 @@ eesoxscsi_irqenable(struct expansion_card *ec, int irqnr) ...@@ -95,7 +91,7 @@ eesoxscsi_irqenable(struct expansion_card *ec, int irqnr)
info->control |= EESOX_INTR_ENABLE; info->control |= EESOX_INTR_ENABLE;
outb(info->control, info->ctl_port); writeb(info->control, info->ctl_port);
} }
/* Prototype: void eesoxscsi_irqdisable(ec, irqnr) /* Prototype: void eesoxscsi_irqdisable(ec, irqnr)
...@@ -110,7 +106,7 @@ eesoxscsi_irqdisable(struct expansion_card *ec, int irqnr) ...@@ -110,7 +106,7 @@ eesoxscsi_irqdisable(struct expansion_card *ec, int irqnr)
info->control &= ~EESOX_INTR_ENABLE; info->control &= ~EESOX_INTR_ENABLE;
outb(info->control, info->ctl_port); writeb(info->control, info->ctl_port);
} }
static const expansioncard_ops_t eesoxscsi_ops = { static const expansioncard_ops_t eesoxscsi_ops = {
...@@ -135,7 +131,7 @@ eesoxscsi_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -135,7 +131,7 @@ eesoxscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
else else
info->control &= ~EESOX_TERM_ENABLE; info->control &= ~EESOX_TERM_ENABLE;
outb(info->control, info->ctl_port); writeb(info->control, info->ctl_port);
spin_unlock_irqrestore(host->host_lock, flags); spin_unlock_irqrestore(host->host_lock, flags);
} }
...@@ -148,9 +144,9 @@ eesoxscsi_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -148,9 +144,9 @@ eesoxscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
static void static void
eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs) eesoxscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct Scsi_Host *host = (struct Scsi_Host *)dev_id; struct eesoxscsi_info *info = dev_id;
fas216_intr(host); fas216_intr(&info->info);
} }
/* Prototype: fasdmatype_t eesoxscsi_dma_setup(host, SCpnt, direction, min_type) /* Prototype: fasdmatype_t eesoxscsi_dma_setup(host, SCpnt, direction, min_type)
...@@ -198,93 +194,164 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -198,93 +194,164 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
return fasdma_pseudo; return fasdma_pseudo;
} }
static void static void eesoxscsi_buffer_in(void *buf, int length, void *base)
eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t dir, int transfer_size)
{ {
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; const void *reg_fas = base + EESOX_FAS216_OFFSET;
unsigned int status; const void *reg_dmastat = base + EESOX_DMASTAT;
unsigned int length = SCp->this_residual; const void *reg_dmadata = base + EESOX_DMADATA;
union { const register unsigned long mask = 0xffff;
unsigned char *c;
unsigned short *s; do {
unsigned long *l; unsigned int status;
} buffer;
/*
* Interrupt request?
*/
status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT));
if (status & STAT_INT)
break;
/*
* DMA request active?
*/
status = readb(reg_dmastat);
if (!(status & EESOX_STAT_DMA))
continue;
/*
* Get number of bytes in FIFO
*/
status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF;
if (status > 16)
status = 16;
if (status > length)
status = length;
/*
* Align buffer.
*/
if (((u32)buf) & 2 && status >= 2) {
*((u16 *)buf)++ = readl(reg_dmadata);
status -= 2;
length -= 2;
}
buffer.c = SCp->ptr; if (status >= 8) {
unsigned long l1, l2;
l1 = readl(reg_dmadata) & mask;
l1 |= readl(reg_dmadata) << 16;
l2 = readl(reg_dmadata) & mask;
l2 |= readl(reg_dmadata) << 16;
*((u32 *)buf)++ = l1;
*((u32 *)buf)++ = l2;
length -= 8;
continue;
}
status = inb(host->io_port + EESOX_STATUS); if (status >= 4) {
if (dir == DMA_IN) { unsigned long l1;
while (length > 8) {
if (status & EESOX_STAT_DMA) { l1 = readl(reg_dmadata) & mask;
unsigned long l1, l2; l1 |= readl(reg_dmadata) << 16;
l1 = inw(info->dmaarea); *((u32 *)buf)++ = l1;
l1 |= inw(info->dmaarea) << 16; length -= 4;
l2 = inw(info->dmaarea); continue;
l2 |= inw(info->dmaarea) << 16;
*buffer.l++ = l1;
*buffer.l++ = l2;
length -= 8;
} else if (status & EESOX_STAT_INTR)
goto end;
status = inb(host->io_port + EESOX_STATUS);
} }
while (length > 1) { if (status >= 2) {
if (status & EESOX_STAT_DMA) { *((u16 *)buf)++ = readl(reg_dmadata);
*buffer.s++ = inw(info->dmaarea); length -= 2;
length -= 2;
} else if (status & EESOX_STAT_INTR)
goto end;
status = inb(host->io_port + EESOX_STATUS);
} }
} while (length);
}
while (length > 0) { static void eesoxscsi_buffer_out(void *buf, int length, void *base)
if (status & EESOX_STAT_DMA) { {
*buffer.c++ = inw(info->dmaarea); const void *reg_fas = base + EESOX_FAS216_OFFSET;
length -= 1; const void *reg_dmastat = base + EESOX_DMASTAT;
} else if (status & EESOX_STAT_INTR) const void *reg_dmadata = base + EESOX_DMADATA;
goto end;
status = inb(host->io_port + EESOX_STATUS); do {
unsigned int status;
/*
* Interrupt request?
*/
status = readb(reg_fas + (REG_STAT << EESOX_FAS216_SHIFT));
if (status & STAT_INT)
break;
/*
* DMA request active?
*/
status = readb(reg_dmastat);
if (!(status & EESOX_STAT_DMA))
continue;
/*
* Get number of bytes in FIFO
*/
status = readb(reg_fas + (REG_CFIS << EESOX_FAS216_SHIFT)) & CFIS_CF;
if (status > 16)
status = 16;
status = 16 - status;
if (status > length)
status = length;
status &= ~1;
/*
* Align buffer.
*/
if (((u32)buf) & 2 && status >= 2) {
writel(*((u16 *)buf)++ << 16, reg_dmadata);
status -= 2;
length -= 2;
} }
} else {
while (length > 8) { if (status >= 8) {
if (status & EESOX_STAT_DMA) { unsigned long l1, l2;
unsigned long l1, l2;
l1 = *((u32 *)buf)++;
l1 = *buffer.l++; l2 = *((u32 *)buf)++;
l2 = *buffer.l++;
writel(l1 << 16, reg_dmadata);
outw(l1, info->dmaarea); writel(l1, reg_dmadata);
outw(l1 >> 16, info->dmaarea); writel(l2 << 16, reg_dmadata);
outw(l2, info->dmaarea); writel(l2, reg_dmadata);
outw(l2 >> 16, info->dmaarea); length -= 8;
length -= 8; continue;
} else if (status & EESOX_STAT_INTR)
goto end;
status = inb(host->io_port + EESOX_STATUS);
} }
while (length > 1) { if (status >= 4) {
if (status & EESOX_STAT_DMA) { unsigned long l1;
outw(*buffer.s++, info->dmaarea);
length -= 2; l1 = *((u32 *)buf)++;
} else if (status & EESOX_STAT_INTR)
goto end; writel(l1 << 16, reg_dmadata);
status = inb(host->io_port + EESOX_STATUS); writel(l1, reg_dmadata);
length -= 4;
continue;
} }
while (length > 0) { if (status >= 2) {
if (status & EESOX_STAT_DMA) { writel(*((u16 *)buf)++ << 16, reg_dmadata);
outw(*buffer.c++, info->dmaarea); length -= 2;
length -= 1;
} else if (status & EESOX_STAT_INTR)
goto end;
status = inb(host->io_port + EESOX_STATUS);
} }
} while (length);
}
static void
eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t dir, int transfer_size)
{
void *base = (void *)host->base;
if (dir == DMA_IN) {
eesoxscsi_buffer_in(SCp->ptr, SCp->this_residual, base);
} else {
eesoxscsi_buffer_out(SCp->ptr, SCp->this_residual, base);
} }
end:
} }
/* Prototype: int eesoxscsi_dma_stop(host, SCpnt) /* Prototype: int eesoxscsi_dma_stop(host, SCpnt)
...@@ -307,14 +374,11 @@ eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -307,14 +374,11 @@ eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
const char *eesoxscsi_info(struct Scsi_Host *host) const char *eesoxscsi_info(struct Scsi_Host *host)
{ {
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
static char string[100], *p; static char string[150];
p = string; sprintf(string, "%s (%s) in slot %d v%s terminators o%s",
p += sprintf(p, "%s ", host->hostt->name); host->hostt->name, info->info.scsi.type, info->ec->slot_no,
p += fas216_info(&info->info, p); VERSION, info->control & EESOX_TERM_ENABLE ? "n" : "ff");
p += sprintf(p, "v%s terminators o%s",
VERSION,
info->control & EESOX_TERM_ENABLE ? "n" : "ff");
return string; return string;
} }
...@@ -381,9 +445,7 @@ int eesoxscsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -381,9 +445,7 @@ int eesoxscsi_proc_info(char *buffer, char **start, off_t offset,
info = (struct eesoxscsi_info *)host->hostdata; info = (struct eesoxscsi_info *)host->hostdata;
begin = 0; begin = 0;
pos = sprintf(buffer, pos = sprintf(buffer, "EESOX SCSI driver v%s\n", VERSION);
"EESOX SCSI driver version v%s\n",
VERSION);
pos += fas216_print_host(&info->info, buffer + pos); pos += fas216_print_host(&info->info, buffer + pos);
pos += sprintf(buffer + pos, "Term : o%s\n", pos += sprintf(buffer + pos, "Term : o%s\n",
info->control & EESOX_TERM_ENABLE ? "n" : "ff"); info->control & EESOX_TERM_ENABLE ? "n" : "ff");
...@@ -417,6 +479,39 @@ int eesoxscsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -417,6 +479,39 @@ int eesoxscsi_proc_info(char *buffer, char **start, off_t offset,
return pos; return pos;
} }
static ssize_t eesoxscsi_show_term(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
struct Scsi_Host *host = ecard_get_drvdata(ec);
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0);
}
static ssize_t eesoxscsi_store_term(struct device *dev, const char *buf, size_t len)
{
struct expansion_card *ec = ECARD_DEV(dev);
struct Scsi_Host *host = ecard_get_drvdata(ec);
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
unsigned long flags;
if (len > 1) {
spin_lock_irqsave(host->host_lock, flags);
if (buf[0] != '0') {
info->control |= EESOX_TERM_ENABLE;
} else {
info->control &= ~EESOX_TERM_ENABLE;
}
writeb(info->control, info->ctl_port);
spin_unlock_irqrestore(host->host_lock, flags);
}
return len;
}
static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
eesoxscsi_show_term, eesoxscsi_store_term);
static Scsi_Host_Template eesox_template = { static Scsi_Host_Template eesox_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_info = eesoxscsi_proc_info, .proc_info = eesoxscsi_proc_info,
...@@ -440,57 +535,75 @@ static int __devinit ...@@ -440,57 +535,75 @@ static int __devinit
eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
struct eesoxscsi_info *info; struct eesoxscsi_info *info;
int ret = -ENOMEM; unsigned long resbase, reslen;
unsigned char *base;
int ret;
host = scsi_register(&eesox_template, resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
sizeof(struct eesoxscsi_info)); reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
if (!host)
if (!request_mem_region(resbase, reslen, "eesoxscsi")) {
ret = -EBUSY;
goto out; goto out;
}
host->io_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); base = ioremap(resbase, reslen);
host->irq = ec->irq; if (!base) {
host->dma_channel = ec->dma; ret = -ENOMEM;
goto out_region;
}
if (!request_region(host->io_port + EESOX_FAS216_OFFSET, host = scsi_register(&eesox_template,
EESOX_FAS216_SIZE, "eesox2-fas")) { sizeof(struct eesoxscsi_info));
ret = -EBUSY; if (!host) {
goto out_free; ret = -ENOMEM;
goto out_unmap;
} }
host->base = (unsigned long)base;
host->irq = ec->irq;
host->dma_channel = ec->dma;
ecard_set_drvdata(ec, host); ecard_set_drvdata(ec, host);
info = (struct eesoxscsi_info *)host->hostdata; info = (struct eesoxscsi_info *)host->hostdata;
info->ctl_port = host->io_port + EESOX_CONTROL; info->ec = ec;
info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0; info->ctl_port = base + EESOX_CONTROL;
outb(info->control, info->ctl_port); info->control = term[ec->slot_no] ? EESOX_TERM_ENABLE : 0;
writeb(info->control, info->ctl_port);
ec->irqaddr = (unsigned char *)ioaddr(host->io_port + EESOX_STATUS); ec->irqaddr = base + EESOX_DMASTAT;
ec->irqmask = EESOX_STAT_INTR; ec->irqmask = EESOX_STAT_INTR;
ec->irq_data = info; ec->irq_data = info;
ec->ops = (expansioncard_ops_t *)&eesoxscsi_ops; ec->ops = &eesoxscsi_ops;
info->info.scsi.io_port = host->io_port + EESOX_FAS216_OFFSET; info->info.scsi.io_base = base + EESOX_FAS216_OFFSET;
info->info.scsi.io_shift = EESOX_FAS216_SHIFT; info->info.scsi.io_shift = EESOX_FAS216_SHIFT;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
info->info.ifcfg.clockrate = 40; /* MHz */ info->info.ifcfg.clockrate = 40; /* MHz */
info->info.ifcfg.select_timeout = 255; info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */ info->info.ifcfg.asyncperiod = 200; /* ns */
info->info.ifcfg.sync_max_depth = 7; info->info.ifcfg.sync_max_depth = 7;
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.cntl3 = CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.disconnect_ok = 1;
info->info.ifcfg.wide_max_size = 0; info->info.ifcfg.wide_max_size = 0;
info->info.ifcfg.capabilities = FASCAP_PSEUDODMA;
info->info.dma.setup = eesoxscsi_dma_setup; info->info.dma.setup = eesoxscsi_dma_setup;
info->info.dma.pseudo = eesoxscsi_dma_pseudo; info->info.dma.pseudo = eesoxscsi_dma_pseudo;
info->info.dma.stop = eesoxscsi_dma_stop; info->info.dma.stop = eesoxscsi_dma_stop;
info->dmaarea = host->io_port + EESOX_DMA_OFFSET;
ret = request_irq(host->irq, eesoxscsi_intr, device_create_file(&ec->dev, &dev_attr_bus_term);
SA_INTERRUPT, "eesox", host);
ret = fas216_init(host);
if (ret)
goto out_free;
ret = request_irq(host->irq, eesoxscsi_intr, 0, "eesoxscsi", info);
if (ret) { if (ret) {
printk("scsi%d: IRQ%d not free: %d\n", printk("scsi%d: IRQ%d not free: %d\n",
host->host_no, host->irq, ret); host->host_no, host->irq, ret);
goto out_region; goto out_remove;
} }
if (host->dma_channel != NO_DMA) { if (host->dma_channel != NO_DMA) {
...@@ -500,24 +613,32 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -500,24 +613,32 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
host->dma_channel = NO_DMA; host->dma_channel = NO_DMA;
} else { } else {
set_dma_speed(host->dma_channel, 180); set_dma_speed(host->dma_channel, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
info->info.ifcfg.cntl3 |= CNTL3_BS8;
} }
} }
fas216_init(host); ret = fas216_add(host, &ec->dev);
ret = scsi_add_host(host, &ec->dev);
if (ret == 0) if (ret == 0)
goto out; goto out;
fas216_release(host);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, host);
out_region:
release_region(host->io_port + EESOX_FAS216_OFFSET, out_remove:
EESOX_FAS216_SIZE); fas216_remove(host);
out_free: out_free:
device_remove_file(&ec->dev, &dev_attr_bus_term);
scsi_unregister(host); scsi_unregister(host);
out_unmap:
iounmap(base);
out_region:
release_mem_region(resbase, reslen);
out: out:
return ret; return ret;
} }
...@@ -525,15 +646,26 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -525,15 +646,26 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit eesoxscsi_remove(struct expansion_card *ec) static void __devexit eesoxscsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
scsi_remove_host(host); fas216_remove(host);
fas216_release(host);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, info);
release_region(host->io_port + EESOX_FAS216_OFFSET, EESOX_FAS216_SIZE);
device_remove_file(&ec->dev, &dev_attr_bus_term);
iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
release_mem_region(resbase, reslen);
fas216_release(host);
scsi_unregister(host); scsi_unregister(host);
} }
...@@ -547,7 +679,8 @@ static struct ecard_driver eesoxscsi_driver = { ...@@ -547,7 +679,8 @@ static struct ecard_driver eesoxscsi_driver = {
.remove = __devexit_p(eesoxscsi_remove), .remove = __devexit_p(eesoxscsi_remove),
.id_table = eesoxscsi_cids, .id_table = eesoxscsi_cids,
.drv = { .drv = {
.name = "eesoxscsi", .devclass = &shost_devclass,
.name = "eesoxscsi",
}, },
}; };
......
/* /*
* linux/drivers/acorn/scsi/fas216.c * linux/drivers/acorn/scsi/fas216.c
* *
* Copyright (C) 1997-2000 Russell King * Copyright (C) 1997-2003 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
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Based on information in qlogicfas.c by Tom Zerucha, Michael Griffith, and * Based on information in qlogicfas.c by Tom Zerucha, Michael Griffith, and
* other sources, including: * other sources, including:
* the AMD Am53CF94 data sheet * the AMD Am53CF94 data sheet
* the AMD Am53C94 data sheet * the AMD Am53C94 data sheet
* *
* This is a generic driver. To use it, have a look at cumana_2.c. You * This is a generic driver. To use it, have a look at cumana_2.c. You
* should define your own structure that overlays FAS216_Info, eg: * should define your own structure that overlays FAS216_Info, eg:
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
* 02-04-2000 RMK Converted to use the new error handling, and * 02-04-2000 RMK Converted to use the new error handling, and
* automatically request sense data upon check * automatically request sense data upon check
* condition status from targets. * condition status from targets.
*
* Todo:
* - allow individual devices to enable sync xfers.
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/blk.h> #include <linux/blk.h>
...@@ -45,6 +42,7 @@ ...@@ -45,6 +42,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/dma.h> #include <asm/dma.h>
...@@ -52,17 +50,11 @@ ...@@ -52,17 +50,11 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/ecard.h> #include <asm/ecard.h>
#define FAS216_C
#include "../../scsi/scsi.h" #include "../../scsi/scsi.h"
#include "../../scsi/hosts.h" #include "../../scsi/hosts.h"
#include "fas216.h" #include "fas216.h"
#include "scsi.h" #include "scsi.h"
#define VER_MAJOR 0
#define VER_MINOR 0
#define VER_PATCH 5
/* NOTE: SCSI2 Synchronous transfers *require* DMA according to /* NOTE: SCSI2 Synchronous transfers *require* DMA according to
* the data sheet. This restriction is crazy, especially when * the data sheet. This restriction is crazy, especially when
* you only want to send 16 bytes! What were the guys who * you only want to send 16 bytes! What were the guys who
...@@ -104,22 +96,43 @@ ...@@ -104,22 +96,43 @@
static int level_mask = LOG_ERROR; static int level_mask = LOG_ERROR;
static inline unsigned char fas216_readb(FAS216_Info *info, unsigned int reg)
{
unsigned int off = reg << info->scsi.io_shift;
if (info->scsi.io_base)
return readb(info->scsi.io_base + off);
else
return inb(info->scsi.io_port + off);
}
static inline void fas216_writeb(FAS216_Info *info, unsigned int reg, unsigned int val)
{
unsigned int off = reg << info->scsi.io_shift;
if (info->scsi.io_base)
writeb(val, info->scsi.io_base + off);
else
outb(val, info->scsi.io_port + off);
}
static void fas216_dumpstate(FAS216_Info *info) static void fas216_dumpstate(FAS216_Info *info)
{ {
unsigned char is, stat, inst; unsigned char is, stat, inst;
is = inb(REG_IS(info)); is = fas216_readb(info, REG_IS);
stat = inb(REG_STAT(info)); stat = fas216_readb(info, REG_STAT);
inst = inb(REG_INST(info)); inst = fas216_readb(info, REG_INST);
printk("FAS216: CTCL=%02X CTCM=%02X CMD=%02X STAT=%02X" printk("FAS216: CTCL=%02X CTCM=%02X CMD=%02X STAT=%02X"
" INST=%02X IS=%02X CFIS=%02X", " INST=%02X IS=%02X CFIS=%02X",
inb(REG_CTCL(info)), inb(REG_CTCM(info)), fas216_readb(info, REG_CTCL),
inb(REG_CMD(info)), stat, inst, is, fas216_readb(info, REG_CTCM),
inb(REG_CFIS(info))); fas216_readb(info, REG_CMD), stat, inst, is,
fas216_readb(info, REG_CFIS));
printk(" CNTL1=%02X CNTL2=%02X CNTL3=%02X CTCH=%02X\n", printk(" CNTL1=%02X CNTL2=%02X CNTL3=%02X CTCH=%02X\n",
inb(REG_CNTL1(info)), inb(REG_CNTL2(info)), fas216_readb(info, REG_CNTL1),
inb(REG_CNTL3(info)), inb(REG_CTCH(info))); fas216_readb(info, REG_CNTL2),
fas216_readb(info, REG_CNTL3),
fas216_readb(info, REG_CTCH));
} }
static void print_SCp(Scsi_Pointer *SCp, const char *prefix, const char *suffix) static void print_SCp(Scsi_Pointer *SCp, const char *prefix, const char *suffix)
...@@ -236,19 +249,63 @@ static char fas216_target(FAS216_Info *info) ...@@ -236,19 +249,63 @@ static char fas216_target(FAS216_Info *info)
return 'H'; return 'H';
} }
static void
fas216_do_log(FAS216_Info *info, char target, char *fmt, va_list ap)
{
static char buf[1024];
vsnprintf(buf, sizeof(buf), fmt, ap);
printk("scsi%d.%c: %s", info->host->host_no, target, buf);
}
static void
fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ...)
{
va_list args;
if (level != 0 && !(level & level_mask))
return;
va_start(args, fmt);
fas216_do_log(info, '0' + SCpnt->target, fmt, args);
va_end(args);
printk(" CDB: ");
print_command(SCpnt->cmnd);
}
static void
fas216_log_target(FAS216_Info *info, int level, int target, char *fmt, ...)
{
va_list args;
if (level != 0 && !(level & level_mask))
return;
if (target < 0)
target = 'H';
else
target += '0';
va_start(args, fmt);
fas216_do_log(info, target, fmt, args);
va_end(args);
printk("\n");
}
static void fas216_log(FAS216_Info *info, int level, char *fmt, ...) static void fas216_log(FAS216_Info *info, int level, char *fmt, ...)
{ {
va_list args; va_list args;
static char buf[1024];
if (level != 0 && !(level & level_mask)) if (level != 0 && !(level & level_mask))
return; return;
va_start(args, fmt); va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args); fas216_do_log(info, fas216_target(info), fmt, args);
va_end(args); va_end(args);
printk("scsi%d.%c: %s\n", info->host->host_no, fas216_target(info), buf); printk("\n");
} }
#define PH_SIZE 32 #define PH_SIZE 32
...@@ -276,7 +333,7 @@ static void fas216_cmd(FAS216_Info *info, unsigned int command) ...@@ -276,7 +333,7 @@ static void fas216_cmd(FAS216_Info *info, unsigned int command)
cmd_ptr = (cmd_ptr + 1) & 7; cmd_ptr = (cmd_ptr + 1) & 7;
outb(command, REG_CMD(info)); fas216_writeb(info, REG_CMD, command);
} }
static void print_debug_list(void) static void print_debug_list(void)
...@@ -308,11 +365,11 @@ static void print_debug_list(void) ...@@ -308,11 +365,11 @@ static void print_debug_list(void)
static void fas216_done(FAS216_Info *info, unsigned int result); static void fas216_done(FAS216_Info *info, unsigned int result);
/** /**
* fast216_clockrate - calculate clock conversion factor * fas216_clockrate - calculate clock conversion factor
* @clock: clock speed in MHz * @clock: clock speed in MHz
* *
* Calculate correct value to be written into clock conversion factor * Calculate correct value to be written into clock conversion factor
* register. Returns CLKF_ value. * register. Returns CLKF_ value.
*/ */
static int fas216_clockrate(int clock) static int fas216_clockrate(int clock)
...@@ -327,11 +384,11 @@ static int fas216_clockrate(int clock) ...@@ -327,11 +384,11 @@ static int fas216_clockrate(int clock)
return clock; return clock;
} }
/** /**
* fas216_get_last_msg - retrive last message from the list * fas216_get_last_msg - retrive last message from the list
* @info: interface to search * @info: interface to search
* @pos: current fifo position * @pos: current fifo position
* *
* Retrieve a last message from the list, using position in fifo. * Retrieve a last message from the list, using position in fifo.
*/ */
static inline unsigned short static inline unsigned short
...@@ -359,12 +416,12 @@ fas216_get_last_msg(FAS216_Info *info, int pos) ...@@ -359,12 +416,12 @@ fas216_get_last_msg(FAS216_Info *info, int pos)
return packed_msg; return packed_msg;
} }
/** /**
* fas216_syncperiod - calculate STP register value * fas216_syncperiod - calculate STP register value
* @info: state structure for interface connected to device * @info: state structure for interface connected to device
* @ns: period in ns (between subsequent bytes) * @ns: period in ns (between subsequent bytes)
* *
* Calculate value to be loaded into the STP register for a given period * Calculate value to be loaded into the STP register for a given period
* in ns. Returns a value suitable for REG_STP. * in ns. Returns a value suitable for REG_STP.
*/ */
static int fas216_syncperiod(FAS216_Info *info, int ns) static int fas216_syncperiod(FAS216_Info *info, int ns)
...@@ -381,11 +438,11 @@ static int fas216_syncperiod(FAS216_Info *info, int ns) ...@@ -381,11 +438,11 @@ static int fas216_syncperiod(FAS216_Info *info, int ns)
return value & 31; return value & 31;
} }
/** /**
* fas216_set_sync - setup FAS216 chip for specified transfer period. * fas216_set_sync - setup FAS216 chip for specified transfer period.
* @info: state structure for interface connected to device * @info: state structure for interface connected to device
* @target: target * @target: target
* *
* Correctly setup FAS216 chip for specified transfer period. * Correctly setup FAS216 chip for specified transfer period.
* Notes : we need to switch the chip out of FASTSCSI mode if we have * Notes : we need to switch the chip out of FASTSCSI mode if we have
* a transfer period >= 200ns - otherwise the chip will violate * a transfer period >= 200ns - otherwise the chip will violate
...@@ -393,12 +450,16 @@ static int fas216_syncperiod(FAS216_Info *info, int ns) ...@@ -393,12 +450,16 @@ static int fas216_syncperiod(FAS216_Info *info, int ns)
*/ */
static void fas216_set_sync(FAS216_Info *info, int target) static void fas216_set_sync(FAS216_Info *info, int target)
{ {
outb(info->device[target].sof, REG_SOF(info)); unsigned int cntl3;
outb(info->device[target].stp, REG_STP(info));
fas216_writeb(info, REG_SOF, info->device[target].sof);
fas216_writeb(info, REG_STP, info->device[target].stp);
cntl3 = info->scsi.cfg[2];
if (info->device[target].period >= (200 / 4)) if (info->device[target].period >= (200 / 4))
outb(info->scsi.cfg[2] & ~CNTL3_FASTSCSI, REG_CNTL3(info)); cntl3 = cntl3 & ~CNTL3_FASTSCSI;
else
outb(info->scsi.cfg[2], REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, cntl3);
} }
/* Synchronous transfer support /* Synchronous transfer support
...@@ -428,8 +489,8 @@ static void fas216_set_sync(FAS216_Info *info, int target) ...@@ -428,8 +489,8 @@ static void fas216_set_sync(FAS216_Info *info, int target)
/** /**
* fas216_handlesync - Handle a synchronous transfer message * fas216_handlesync - Handle a synchronous transfer message
* @info: state structure for interface * @info: state structure for interface
* @ms: message from target * @msg: message from target
* *
* Handle a synchronous transfer message from the target * Handle a synchronous transfer message from the target
*/ */
static void fas216_handlesync(FAS216_Info *info, char *msg) static void fas216_handlesync(FAS216_Info *info, char *msg)
...@@ -538,11 +599,11 @@ static void fas216_handlesync(FAS216_Info *info, char *msg) ...@@ -538,11 +599,11 @@ static void fas216_handlesync(FAS216_Info *info, char *msg)
} }
} }
/** /**
* fas216_handlewide - Handle a wide transfer message * fas216_handlewide - Handle a wide transfer message
* @info: state structure for interface * @info: state structure for interface
* @msg: message from target * @msg: message from target
* *
* Handle a wide transfer message from the target * Handle a wide transfer message from the target
*/ */
static void fas216_handlewide(FAS216_Info *info, char *msg) static void fas216_handlewide(FAS216_Info *info, char *msg)
...@@ -637,11 +698,11 @@ static void fas216_handlewide(FAS216_Info *info, char *msg) ...@@ -637,11 +698,11 @@ static void fas216_handlewide(FAS216_Info *info, char *msg)
} }
} }
/** /**
* fas216_updateptrs - update data pointers after transfer suspended/paused * fas216_updateptrs - update data pointers after transfer suspended/paused
* @info: interface's local pointer to update * @info: interface's local pointer to update
* @bytes_transferred: number of bytes transferred * @bytes_transferred: number of bytes transferred
* *
* Update data pointers after transfer suspended/paused * Update data pointers after transfer suspended/paused
*/ */
static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
...@@ -662,7 +723,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) ...@@ -662,7 +723,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
* next buffer. * next buffer.
*/ */
bytes_transferred -= SCp->this_residual; bytes_transferred -= SCp->this_residual;
if (!next_SCp(&info->scsi.SCp) && bytes_transferred) { if (!next_SCp(SCp) && bytes_transferred) {
printk(KERN_WARNING "scsi%d.%c: out of buffers\n", printk(KERN_WARNING "scsi%d.%c: out of buffers\n",
info->host->host_no, '0' + info->SCpnt->target); info->host->host_no, '0' + info->SCpnt->target);
return; return;
...@@ -680,33 +741,67 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) ...@@ -680,33 +741,67 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
* fas216_pio - transfer data off of/on to card using programmed IO * fas216_pio - transfer data off of/on to card using programmed IO
* @info: interface to transfer data to/from * @info: interface to transfer data to/from
* @direction: direction to transfer data (DMA_OUT/DMA_IN) * @direction: direction to transfer data (DMA_OUT/DMA_IN)
* *
* Transfer data off of/on to card using programmed IO. * Transfer data off of/on to card using programmed IO.
* Notes: this is incredibly slow. * Notes: this is incredibly slow.
*/ */
static void fas216_pio(FAS216_Info *info, fasdmadir_t direction) static void fas216_pio(FAS216_Info *info, fasdmadir_t direction)
{ {
Scsi_Pointer *SCp = &info->scsi.SCp;
fas216_checkmagic(info); fas216_checkmagic(info);
if (direction == DMA_OUT) if (direction == DMA_OUT)
outb(get_next_SCp_byte(&info->scsi.SCp), REG_FF(info)); fas216_writeb(info, REG_FF, get_next_SCp_byte(SCp));
else else
put_next_SCp_byte(&info->scsi.SCp, inb(REG_FF(info))); put_next_SCp_byte(SCp, fas216_readb(info, REG_FF));
if (SCp->this_residual == 0)
next_SCp(SCp);
}
static void fas216_set_stc(FAS216_Info *info, unsigned int length)
{
fas216_writeb(info, REG_STCL, length);
fas216_writeb(info, REG_STCM, length >> 8);
fas216_writeb(info, REG_STCH, length >> 16);
}
static unsigned int fas216_get_ctc(FAS216_Info *info)
{
return fas216_readb(info, REG_CTCL) +
(fas216_readb(info, REG_CTCM) << 8) +
(fas216_readb(info, REG_CTCH) << 16);
} }
/**
* fas216_cleanuptransfer - clean up after a transfer has completed.
* @info: interface to clean up
*
* Update the data pointers according to the number of bytes transferred
* on the SCSI bus.
*/
static void fas216_cleanuptransfer(FAS216_Info *info) static void fas216_cleanuptransfer(FAS216_Info *info)
{ {
unsigned long total, residual, fifo; unsigned long total, residual, fifo;
fasdmatype_t dmatype = info->dma.transfer_type;
info->dma.transfer_type = fasdma_none;
if (info->dma.transfer_type == fasdma_real_all) /*
* PIO transfers do not need to be cleaned up.
*/
if (dmatype == fasdma_pio || dmatype == fasdma_none)
return;
if (dmatype == fasdma_real_all)
total = info->SCpnt->request_bufflen; total = info->SCpnt->request_bufflen;
else else
total = info->scsi.SCp.this_residual; total = info->scsi.SCp.this_residual;
residual = inb(REG_CTCL(info)) + (inb(REG_CTCM(info)) << 8) + residual = fas216_get_ctc(info);
(inb(REG_CTCH(info)) << 16);
fifo = inb(REG_CFIS(info)) & CFIS_CF; fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
fas216_log(info, LOG_BUFFER, "cleaning up from previous " fas216_log(info, LOG_BUFFER, "cleaning up from previous "
"transfer: length 0x%06x, residual 0x%x, fifo %d", "transfer: length 0x%06x, residual 0x%x, fifo %d",
...@@ -718,54 +813,22 @@ static void fas216_cleanuptransfer(FAS216_Info *info) ...@@ -718,54 +813,22 @@ static void fas216_cleanuptransfer(FAS216_Info *info)
* host to the FIFO. This means we must include the * host to the FIFO. This means we must include the
* bytes left in the FIFO from the transfer counter. * bytes left in the FIFO from the transfer counter.
*/ */
if (info->scsi.phase == PHASE_DATAOUT) { if (info->scsi.phase == PHASE_DATAOUT)
residual += fifo; residual += fifo;
fifo = 0;
}
if (info->dma.transfer_type != fasdma_none &&
info->dma.transfer_type != fasdma_pio) {
fas216_updateptrs(info, total - residual);
}
/*
* If we were performing Data-In, then the FIFO counter
* contains the number of bytes not transferred via DMA
* from the on-board FIFO. Read them manually.
*/
if (info->scsi.phase == PHASE_DATAIN) {
while (fifo && info->scsi.SCp.ptr) {
*info->scsi.SCp.ptr = inb(REG_FF(info));
fas216_updateptrs(info, 1);
fifo--;
}
}
info->dma.transfer_type = fasdma_none; fas216_updateptrs(info, total - residual);
} }
/** /**
* fas216_starttransfer - Start a DMA/PIO transfer off of/on to card * fas216_transfer - Perform a DMA/PIO transfer off of/on to card
* @info: interface from which device disconnected from * @info: interface from which device disconnected from
* @direction: transfer direction (DMA_OUT/DMA_IN) *
*
* Start a DMA/PIO transfer off of/on to card * Start a DMA/PIO transfer off of/on to card
*/ */
static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction) static void fas216_transfer(FAS216_Info *info)
{ {
fasdmadir_t direction;
fasdmatype_t dmatype; fasdmatype_t dmatype;
int phase = (direction == DMA_OUT) ? PHASE_DATAOUT : PHASE_DATAIN;
fas216_checkmagic(info);
if (phase != info->scsi.phase) {
info->scsi.phase = phase;
if (direction == DMA_OUT)
fas216_cmd(info, CMD_FLUSHFIFO);
} else {
fas216_cleanuptransfer(info);
}
fas216_log(info, LOG_BUFFER, fas216_log(info, LOG_BUFFER,
"starttransfer: buffer %p length 0x%06x reqlen 0x%06x", "starttransfer: buffer %p length 0x%06x reqlen 0x%06x",
...@@ -781,36 +844,41 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction) ...@@ -781,36 +844,41 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction)
} }
/* /*
* Default to PIO mode or DMA mode if we have * If we have a synchronous transfer agreement in effect, we must
* a synchronous transfer agreement. * use DMA mode. If we are using asynchronous transfers, we may
* use DMA mode or PIO mode.
*/ */
if (info->device[info->SCpnt->target].sof && info->dma.setup) if (info->device[info->SCpnt->target].sof)
dmatype = fasdma_real_all; dmatype = fasdma_real_all;
else else
dmatype = fasdma_pio; dmatype = fasdma_pio;
if (info->scsi.phase == PHASE_DATAOUT)
direction = DMA_OUT;
else
direction = DMA_IN;
if (info->dma.setup) if (info->dma.setup)
dmatype = info->dma.setup(info->host, &info->scsi.SCp, dmatype = info->dma.setup(info->host, &info->scsi.SCp,
direction, dmatype); direction, dmatype);
info->dma.transfer_type = dmatype; info->dma.transfer_type = dmatype;
if (dmatype == fasdma_real_all)
fas216_set_stc(info, info->SCpnt->request_bufflen);
else
fas216_set_stc(info, info->scsi.SCp.this_residual);
switch (dmatype) { switch (dmatype) {
case fasdma_pio: case fasdma_pio:
fas216_log(info, LOG_BUFFER, "PIO transfer"); fas216_log(info, LOG_BUFFER, "PIO transfer");
outb(0, REG_SOF(info)); fas216_writeb(info, REG_SOF, 0);
outb(info->scsi.async_stp, REG_STP(info)); fas216_writeb(info, REG_STP, info->scsi.async_stp);
outb(info->scsi.SCp.this_residual, REG_STCL(info));
outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info));
outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info));
fas216_cmd(info, CMD_TRANSFERINFO); fas216_cmd(info, CMD_TRANSFERINFO);
fas216_pio(info, direction); fas216_pio(info, direction);
break; break;
case fasdma_pseudo: case fasdma_pseudo:
fas216_log(info, LOG_BUFFER, "pseudo transfer"); fas216_log(info, LOG_BUFFER, "pseudo transfer");
outb(info->scsi.SCp.this_residual, REG_STCL(info));
outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info));
outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info));
fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA);
info->dma.pseudo(info->host, &info->scsi.SCp, info->dma.pseudo(info->host, &info->scsi.SCp,
direction, info->SCpnt->transfersize); direction, info->SCpnt->transfersize);
...@@ -818,17 +886,11 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction) ...@@ -818,17 +886,11 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction)
case fasdma_real_block: case fasdma_real_block:
fas216_log(info, LOG_BUFFER, "block dma transfer"); fas216_log(info, LOG_BUFFER, "block dma transfer");
outb(info->scsi.SCp.this_residual, REG_STCL(info));
outb(info->scsi.SCp.this_residual >> 8, REG_STCM(info));
outb(info->scsi.SCp.this_residual >> 16, REG_STCH(info));
fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA);
break; break;
case fasdma_real_all: case fasdma_real_all:
fas216_log(info, LOG_BUFFER, "total dma transfer"); fas216_log(info, LOG_BUFFER, "total dma transfer");
outb(info->SCpnt->request_bufflen, REG_STCL(info));
outb(info->SCpnt->request_bufflen >> 8, REG_STCM(info));
outb(info->SCpnt->request_bufflen >> 16, REG_STCH(info));
fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA); fas216_cmd(info, CMD_TRANSFERINFO | CMD_WITHDMA);
break; break;
...@@ -839,44 +901,61 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction) ...@@ -839,44 +901,61 @@ static void fas216_starttransfer(FAS216_Info *info, fasdmadir_t direction)
} }
} }
/** /**
* fas216_stoptransfer - Stop a DMA transfer onto / off of the card * fas216_stoptransfer - Stop a DMA transfer onto / off of the card
* @info: interface from which device disconnected from * @info: interface from which device disconnected from
* *
* Stop a DMA transfer onto / off of the card * Called when we switch away from DATA IN or DATA OUT phases.
*/ */
static void fas216_stoptransfer(FAS216_Info *info) static void fas216_stoptransfer(FAS216_Info *info)
{ {
fas216_checkmagic(info); fas216_checkmagic(info);
if ((info->dma.transfer_type == fasdma_real_all || if (info->dma.transfer_type == fasdma_real_all ||
info->dma.transfer_type == fasdma_real_block) && info->dma.transfer_type == fasdma_real_block)
info->dma.stop)
info->dma.stop(info->host, &info->scsi.SCp); info->dma.stop(info->host, &info->scsi.SCp);
fas216_cleanuptransfer(info); fas216_cleanuptransfer(info);
if (info->scsi.phase == PHASE_DATAOUT) if (info->scsi.phase == PHASE_DATAIN) {
unsigned int fifo;
/*
* If we were performing Data-In, then the FIFO counter
* contains the number of bytes not transferred via DMA
* from the on-board FIFO. Read them manually.
*/
fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
while (fifo && info->scsi.SCp.ptr) {
*info->scsi.SCp.ptr = fas216_readb(info, REG_FF);
fas216_updateptrs(info, 1);
fifo--;
}
} else {
/*
* After a Data-Out phase, there may be unsent
* bytes left in the FIFO. Flush them out.
*/
fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_FLUSHFIFO);
}
} }
static void fas216_aborttransfer(FAS216_Info *info) static void fas216_aborttransfer(FAS216_Info *info)
{ {
fas216_checkmagic(info); fas216_checkmagic(info);
if ((info->dma.transfer_type == fasdma_real_all || if (info->dma.transfer_type == fasdma_real_all ||
info->dma.transfer_type == fasdma_real_block) && info->dma.transfer_type == fasdma_real_block)
info->dma.stop)
info->dma.stop(info->host, &info->scsi.SCp); info->dma.stop(info->host, &info->scsi.SCp);
info->dma.transfer_type = fasdma_none; info->dma.transfer_type = fasdma_none;
fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_FLUSHFIFO);
} }
/** /**
* fas216_disconnected_intr - handle device disconnection * fas216_disconnected_intr - handle device disconnection
* @info: interface from which device disconnected from * @info: interface from which device disconnected from
* *
* Handle device disconnection * Handle device disconnection
*/ */
static void fas216_disconnect_intr(FAS216_Info *info) static void fas216_disconnect_intr(FAS216_Info *info)
...@@ -924,10 +1003,10 @@ static void fas216_disconnect_intr(FAS216_Info *info) ...@@ -924,10 +1003,10 @@ static void fas216_disconnect_intr(FAS216_Info *info)
} }
} }
/** /**
* fas216_reselected_intr - start reconnection of a device * fas216_reselected_intr - start reconnection of a device
* @info: interface which was reselected * @info: interface which was reselected
* *
* Start reconnection of a device * Start reconnection of a device
*/ */
static void static void
...@@ -952,19 +1031,14 @@ fas216_reselected_intr(FAS216_Info *info) ...@@ -952,19 +1031,14 @@ fas216_reselected_intr(FAS216_Info *info)
fas216_log(info, LOG_CONNECT, "reconnect phase=%02X", info->scsi.phase); fas216_log(info, LOG_CONNECT, "reconnect phase=%02X", info->scsi.phase);
if ((inb(REG_CFIS(info)) & CFIS_CF) != 2) { if ((fas216_readb(info, REG_CFIS) & CFIS_CF) != 2) {
printk(KERN_ERR "scsi%d.H: incorrect number of bytes after reselect\n", printk(KERN_ERR "scsi%d.H: incorrect number of bytes after reselect\n",
info->host->host_no); info->host->host_no);
fas216_cmd(info, CMD_SETATN); goto initiator_error;
msgqueue_flush(&info->scsi.msgs);
msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR);
info->scsi.phase = PHASE_MSGOUT_EXPECT;
fas216_cmd(info, CMD_MSGACCEPTED);
return;
} }
target = inb(REG_FF(info)); target = fas216_readb(info, REG_FF);
identify_msg = inb(REG_FF(info)); identify_msg = fas216_readb(info, REG_FF);
ok = 1; ok = 1;
if (!(target & (1 << info->host->this_id))) { if (!(target & (1 << info->host->this_id))) {
...@@ -983,26 +1057,11 @@ fas216_reselected_intr(FAS216_Info *info) ...@@ -983,26 +1057,11 @@ fas216_reselected_intr(FAS216_Info *info)
* Something went wrong - send an initiator error to * Something went wrong - send an initiator error to
* the target. * the target.
*/ */
fas216_cmd(info, CMD_SETATN); goto initiator_error;
msgqueue_flush(&info->scsi.msgs);
msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR);
info->scsi.phase = PHASE_MSGOUT_EXPECT;
fas216_cmd(info, CMD_MSGACCEPTED);
return;
} }
target &= ~(1 << info->host->this_id); target &= ~(1 << info->host->this_id);
switch (target) { target = ffs(target) - 1;
case 1: target = 0; break;
case 2: target = 1; break;
case 4: target = 2; break;
case 8: target = 3; break;
case 16: target = 4; break;
case 32: target = 5; break;
case 64: target = 6; break;
case 128: target = 7; break;
default: target = info->host->this_id; break;
}
identify_msg &= 7; identify_msg &= 7;
info->scsi.reconnected.target = target; info->scsi.reconnected.target = target;
...@@ -1023,7 +1082,7 @@ fas216_reselected_intr(FAS216_Info *info) ...@@ -1023,7 +1082,7 @@ fas216_reselected_intr(FAS216_Info *info)
msgqueue_flush(&info->scsi.msgs); msgqueue_flush(&info->scsi.msgs);
if (ok) { if (ok) {
info->scsi.phase = PHASE_RECONNECTED; info->scsi.phase = PHASE_RECONNECTED;
outb(target, REG_SDID(info)); fas216_writeb(info, REG_SDID, target);
} else { } else {
/* /*
* Our command structure not found - abort the * Our command structure not found - abort the
...@@ -1037,9 +1096,17 @@ fas216_reselected_intr(FAS216_Info *info) ...@@ -1037,9 +1096,17 @@ fas216_reselected_intr(FAS216_Info *info)
} }
fas216_cmd(info, CMD_MSGACCEPTED); fas216_cmd(info, CMD_MSGACCEPTED);
return;
initiator_error:
fas216_cmd(info, CMD_SETATN);
msgqueue_flush(&info->scsi.msgs);
msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR);
info->scsi.phase = PHASE_MSGOUT_EXPECT;
fas216_cmd(info, CMD_MSGACCEPTED);
} }
/** /**
* fas216_finish_reconnect - finish reconnection sequence for device * fas216_finish_reconnect - finish reconnection sequence for device
* @info: interface which caused function done interrupt * @info: interface which caused function done interrupt
* *
...@@ -1232,7 +1299,7 @@ static int fas216_wait_cmd(FAS216_Info *info, int cmd) ...@@ -1232,7 +1299,7 @@ static int fas216_wait_cmd(FAS216_Info *info, int cmd)
fas216_cmd(info, cmd); fas216_cmd(info, cmd);
for (tout = 1000; tout; tout -= 1) { for (tout = 1000; tout; tout -= 1) {
stat = inb(REG_STAT(info)); stat = fas216_readb(info, REG_STAT);
if (stat & (STAT_INT|STAT_PARITYERROR)) if (stat & (STAT_INT|STAT_PARITYERROR))
break; break;
udelay(1); udelay(1);
...@@ -1251,7 +1318,7 @@ static int fas216_get_msg_byte(FAS216_Info *info) ...@@ -1251,7 +1318,7 @@ static int fas216_get_msg_byte(FAS216_Info *info)
if ((stat & STAT_BUSMASK) != STAT_MESGIN) if ((stat & STAT_BUSMASK) != STAT_MESGIN)
goto unexpected_phase_change; goto unexpected_phase_change;
inb(REG_INST(info)); fas216_readb(info, REG_INST);
stat = fas216_wait_cmd(info, CMD_TRANSFERINFO); stat = fas216_wait_cmd(info, CMD_TRANSFERINFO);
...@@ -1264,9 +1331,9 @@ static int fas216_get_msg_byte(FAS216_Info *info) ...@@ -1264,9 +1331,9 @@ static int fas216_get_msg_byte(FAS216_Info *info)
if ((stat & STAT_BUSMASK) != STAT_MESGIN) if ((stat & STAT_BUSMASK) != STAT_MESGIN)
goto unexpected_phase_change; goto unexpected_phase_change;
inb(REG_INST(info)); fas216_readb(info, REG_INST);
return inb(REG_FF(info)); return fas216_readb(info, REG_FF);
timedout: timedout:
fas216_log(info, LOG_ERROR, "timed out waiting for message byte"); fas216_log(info, LOG_ERROR, "timed out waiting for message byte");
...@@ -1284,7 +1351,7 @@ static int fas216_get_msg_byte(FAS216_Info *info) ...@@ -1284,7 +1351,7 @@ static int fas216_get_msg_byte(FAS216_Info *info)
/** /**
* fas216_message - handle a function done interrupt from FAS216 chip * fas216_message - handle a function done interrupt from FAS216 chip
* @info: interface which caused function done interrupt * @info: interface which caused function done interrupt
* *
* Handle a function done interrupt from FAS216 chip * Handle a function done interrupt from FAS216 chip
*/ */
static void fas216_message(FAS216_Info *info) static void fas216_message(FAS216_Info *info)
...@@ -1295,7 +1362,7 @@ static void fas216_message(FAS216_Info *info) ...@@ -1295,7 +1362,7 @@ static void fas216_message(FAS216_Info *info)
fas216_checkmagic(info); fas216_checkmagic(info);
message[0] = inb(REG_FF(info)); message[0] = fas216_readb(info, REG_FF);
if (message[0] == EXTENDED_MESSAGE) { if (message[0] == EXTENDED_MESSAGE) {
msgbyte = fas216_get_msg_byte(info); msgbyte = fas216_get_msg_byte(info);
...@@ -1317,8 +1384,6 @@ static void fas216_message(FAS216_Info *info) ...@@ -1317,8 +1384,6 @@ static void fas216_message(FAS216_Info *info)
if (msgbyte == -3) if (msgbyte == -3)
goto parity_error; goto parity_error;
info->scsi.msglen = msglen;
#ifdef DEBUG_MESSAGES #ifdef DEBUG_MESSAGES
{ {
int i; int i;
...@@ -1354,7 +1419,7 @@ static void fas216_message(FAS216_Info *info) ...@@ -1354,7 +1419,7 @@ static void fas216_message(FAS216_Info *info)
/** /**
* fas216_send_command - send command after all message bytes have been sent * fas216_send_command - send command after all message bytes have been sent
* @info: interface which caused bus service * @info: interface which caused bus service
* *
* Send a command to a target after all message bytes have been sent * Send a command to a target after all message bytes have been sent
*/ */
static void fas216_send_command(FAS216_Info *info) static void fas216_send_command(FAS216_Info *info)
...@@ -1368,17 +1433,17 @@ static void fas216_send_command(FAS216_Info *info) ...@@ -1368,17 +1433,17 @@ static void fas216_send_command(FAS216_Info *info)
/* load command */ /* load command */
for (i = info->scsi.SCp.sent_command; i < info->SCpnt->cmd_len; i++) for (i = info->scsi.SCp.sent_command; i < info->SCpnt->cmd_len; i++)
outb(info->SCpnt->cmnd[i], REG_FF(info)); fas216_writeb(info, REG_FF, info->SCpnt->cmnd[i]);
fas216_cmd(info, CMD_TRANSFERINFO); fas216_cmd(info, CMD_TRANSFERINFO);
info->scsi.phase = PHASE_COMMAND; info->scsi.phase = PHASE_COMMAND;
} }
/** /**
* fas216_send_messageout - handle bus service to send a message * fas216_send_messageout - handle bus service to send a message
* @info: interface which caused bus service * @info: interface which caused bus service
* *
* Handle bus service to send a message. * Handle bus service to send a message.
* Note: We do not allow the device to change the data direction! * Note: We do not allow the device to change the data direction!
*/ */
...@@ -1398,25 +1463,25 @@ static void fas216_send_messageout(FAS216_Info *info, int start) ...@@ -1398,25 +1463,25 @@ static void fas216_send_messageout(FAS216_Info *info, int start)
int i; int i;
for (i = start; i < msg->length; i++) for (i = start; i < msg->length; i++)
outb(msg->msg[i], REG_FF(info)); fas216_writeb(info, REG_FF, msg->msg[i]);
msg->fifo = tot_msglen - (inb(REG_CFIS(info)) & CFIS_CF); msg->fifo = tot_msglen - (fas216_readb(info, REG_CFIS) & CFIS_CF);
start = 0; start = 0;
} }
} else } else
outb(NOP, REG_FF(info)); fas216_writeb(info, REG_FF, NOP);
fas216_cmd(info, CMD_TRANSFERINFO); fas216_cmd(info, CMD_TRANSFERINFO);
info->scsi.phase = PHASE_MSGOUT; info->scsi.phase = PHASE_MSGOUT;
} }
/** /**
* fas216_busservice_intr - handle bus service interrupt from FAS216 chip * fas216_busservice_intr - handle bus service interrupt from FAS216 chip
* @info: interface which caused bus service interrupt * @info: interface which caused bus service interrupt
* @stat: Status register contents * @stat: Status register contents
* @ssr: SCSI Status register contents * @ssr: SCSI Status register contents
* *
* Handle a bus service interrupt from FAS216 chip * Handle a bus service interrupt from FAS216 chip
*/ */
static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr) static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr)
...@@ -1429,7 +1494,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1429,7 +1494,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
switch (info->scsi.phase) { switch (info->scsi.phase) {
case PHASE_SELECTION: case PHASE_SELECTION:
if ((ssr & IS_BITS) != 1) if ((ssr & IS_BITS) != IS_MSGBYTESENT)
goto bad_is; goto bad_is;
break; break;
...@@ -1464,15 +1529,17 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1464,15 +1529,17 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
case STATE(STAT_DATAIN, PHASE_RECONNECTED): case STATE(STAT_DATAIN, PHASE_RECONNECTED):
fas216_finish_reconnect(info); fas216_finish_reconnect(info);
case STATE(STAT_DATAIN, PHASE_SELSTEPS):/* Sel w/ steps -> Data In */ case STATE(STAT_DATAIN, PHASE_SELSTEPS):/* Sel w/ steps -> Data In */
case STATE(STAT_DATAIN, PHASE_DATAIN): /* Data In -> Data In */
case STATE(STAT_DATAIN, PHASE_MSGOUT): /* Message Out -> Data In */ case STATE(STAT_DATAIN, PHASE_MSGOUT): /* Message Out -> Data In */
case STATE(STAT_DATAIN, PHASE_COMMAND): /* Command -> Data In */ case STATE(STAT_DATAIN, PHASE_COMMAND): /* Command -> Data In */
case STATE(STAT_DATAIN, PHASE_MSGIN): /* Message In -> Data In */ case STATE(STAT_DATAIN, PHASE_MSGIN): /* Message In -> Data In */
fas216_starttransfer(info, DMA_IN); info->scsi.phase = PHASE_DATAIN;
fas216_transfer(info);
return; return;
case STATE(STAT_DATAIN, PHASE_DATAIN): /* Data In -> Data In */
case STATE(STAT_DATAOUT, PHASE_DATAOUT):/* Data Out -> Data Out */ case STATE(STAT_DATAOUT, PHASE_DATAOUT):/* Data Out -> Data Out */
fas216_starttransfer(info, DMA_OUT); fas216_cleanuptransfer(info);
fas216_transfer(info);
return; return;
/* Reselmsgin -> Data Out */ /* Reselmsgin -> Data Out */
...@@ -1482,7 +1549,9 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1482,7 +1549,9 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
case STATE(STAT_DATAOUT, PHASE_MSGOUT): /* Message Out -> Data Out */ case STATE(STAT_DATAOUT, PHASE_MSGOUT): /* Message Out -> Data Out */
case STATE(STAT_DATAOUT, PHASE_COMMAND):/* Command -> Data Out */ case STATE(STAT_DATAOUT, PHASE_COMMAND):/* Command -> Data Out */
case STATE(STAT_DATAOUT, PHASE_MSGIN): /* Message In -> Data Out */ case STATE(STAT_DATAOUT, PHASE_MSGIN): /* Message In -> Data Out */
fas216_starttransfer(info, DMA_OUT); fas216_cmd(info, CMD_FLUSHFIFO);
info->scsi.phase = PHASE_DATAOUT;
fas216_transfer(info);
return; return;
/* Reselmsgin -> Status */ /* Reselmsgin -> Status */
...@@ -1507,7 +1576,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1507,7 +1576,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */ case STATE(STAT_MESGIN, PHASE_COMMAND): /* Command -> Message In */
case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */ case STATE(STAT_MESGIN, PHASE_SELSTEPS):/* Sel w/ steps -> Message In */
case STATE(STAT_MESGIN, PHASE_MSGOUT): /* Message Out -> Message In */ case STATE(STAT_MESGIN, PHASE_MSGOUT): /* Message Out -> Message In */
info->scsi.msgin_fifo = inb(REG_CFIS(info)) & CFIS_CF; info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_FLUSHFIFO);
fas216_cmd(info, CMD_TRANSFERINFO); fas216_cmd(info, CMD_TRANSFERINFO);
info->scsi.phase = PHASE_MSGIN; info->scsi.phase = PHASE_MSGIN;
...@@ -1516,7 +1585,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1516,7 +1585,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
/* Reselmsgin -> Message In */ /* Reselmsgin -> Message In */
case STATE(STAT_MESGIN, PHASE_RECONNECTED): case STATE(STAT_MESGIN, PHASE_RECONNECTED):
case STATE(STAT_MESGIN, PHASE_MSGIN): case STATE(STAT_MESGIN, PHASE_MSGIN):
info->scsi.msgin_fifo = inb(REG_CFIS(info)) & CFIS_CF; info->scsi.msgin_fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
fas216_cmd(info, CMD_TRANSFERINFO); fas216_cmd(info, CMD_TRANSFERINFO);
return; return;
...@@ -1555,7 +1624,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1555,7 +1624,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
*/ */
info->device[info->SCpnt->target].parity_check = 0; info->device[info->SCpnt->target].parity_check = 0;
info->device[info->SCpnt->target].parity_enabled = 1; info->device[info->SCpnt->target].parity_enabled = 1;
outb(info->scsi.cfg[0], REG_CNTL1(info)); fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]);
} }
if (msgqueue_msglength(&info->scsi.msgs) > 1) if (msgqueue_msglength(&info->scsi.msgs) > 1)
...@@ -1584,9 +1653,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1584,9 +1653,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
"target trying to receive more command bytes\n", "target trying to receive more command bytes\n",
info->host->host_no, fas216_target(info)); info->host->host_no, fas216_target(info));
fas216_cmd(info, CMD_SETATN); fas216_cmd(info, CMD_SETATN);
outb(15, REG_STCL(info)); fas216_set_stc(info, 15);
outb(0, REG_STCM(info));
outb(0, REG_STCH(info));
fas216_cmd(info, CMD_PADBYTES | CMD_WITHDMA); fas216_cmd(info, CMD_PADBYTES | CMD_WITHDMA);
msgqueue_flush(&info->scsi.msgs); msgqueue_flush(&info->scsi.msgs);
msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR); msgqueue_addmsg(&info->scsi.msgs, 1, INITIATOR_ERROR);
...@@ -1615,6 +1682,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1615,6 +1682,7 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
bad_is: bad_is:
fas216_log(info, 0, "bus service at step %d?", ssr & IS_BITS); fas216_log(info, 0, "bus service at step %d?", ssr & IS_BITS);
fas216_dumpstate(info);
print_debug_list(); print_debug_list();
fas216_done(info, DID_ERROR); fas216_done(info, DID_ERROR);
...@@ -1625,12 +1693,12 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne ...@@ -1625,12 +1693,12 @@ static void fas216_busservice_intr(FAS216_Info *info, unsigned int stat, unsigne
* @info: interface which caused function done interrupt * @info: interface which caused function done interrupt
* @stat: Status register contents * @stat: Status register contents
* @ssr: SCSI Status register contents * @ssr: SCSI Status register contents
* *
* Handle a function done interrupt from FAS216 chip * Handle a function done interrupt from FAS216 chip
*/ */
static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr) static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned int ssr)
{ {
unsigned int fifo_len = inb(REG_CFIS(info)) & CFIS_CF; unsigned int fifo_len = fas216_readb(info, REG_CFIS) & CFIS_CF;
unsigned int status, message; unsigned int status, message;
fas216_checkmagic(info); fas216_checkmagic(info);
...@@ -1644,8 +1712,8 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned ...@@ -1644,8 +1712,8 @@ static void fas216_funcdone_intr(FAS216_Info *info, unsigned int stat, unsigned
if (fifo_len != 2) { if (fifo_len != 2) {
fas216_log(info, 0, "odd number of bytes in FIFO: %d", fifo_len); fas216_log(info, 0, "odd number of bytes in FIFO: %d", fifo_len);
} }
status = inb(REG_FF(info)); status = fas216_readb(info, REG_FF);
message = inb(REG_FF(info)); message = fas216_readb(info, REG_FF);
info->scsi.SCp.Message = message; info->scsi.SCp.Message = message;
info->scsi.SCp.Status = status; info->scsi.SCp.Status = status;
info->scsi.phase = PHASE_DONE; info->scsi.phase = PHASE_DONE;
...@@ -1679,26 +1747,21 @@ static void fas216_bus_reset(FAS216_Info *info) ...@@ -1679,26 +1747,21 @@ static void fas216_bus_reset(FAS216_Info *info)
info->scsi.reconnected.lun = 0; info->scsi.reconnected.lun = 0;
info->scsi.reconnected.tag = 0; info->scsi.reconnected.tag = 0;
if (info->ifcfg.wide_max_size == 0) wide_state = neg_invalid;
wide_state = neg_invalid; sync_state = neg_invalid;
else
#ifdef SCSI2_WIDE #ifdef SCSI2_WIDE
if (info->ifcfg.wide_max_size != 0)
wide_state = neg_wait; wide_state = neg_wait;
#else
wide_state = neg_invalid;
#endif #endif
if (info->host->dma_channel == NO_DMA || !info->dma.setup)
sync_state = neg_invalid;
else
#ifdef SCSI2_SYNC #ifdef SCSI2_SYNC
if (info->ifcfg.capabilities & (FASCAP_DMA|FASCAP_PSEUDODMA))
sync_state = neg_wait; sync_state = neg_wait;
#else
sync_state = neg_invalid;
#endif #endif
info->scsi.phase = PHASE_IDLE; info->scsi.phase = PHASE_IDLE;
info->SCpnt = NULL; /* bug! */ info->SCpnt = NULL; /* bug! */
memset(&info->scsi.SCp, 0, sizeof(info->scsi.SCp));
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
info->device[i].disconnect_ok = info->ifcfg.disconnect_ok; info->device[i].disconnect_ok = info->ifcfg.disconnect_ok;
...@@ -1714,22 +1777,21 @@ static void fas216_bus_reset(FAS216_Info *info) ...@@ -1714,22 +1777,21 @@ static void fas216_bus_reset(FAS216_Info *info)
wake_up(&info->eh_wait); wake_up(&info->eh_wait);
} }
/** /**
* fas216_intr - handle interrupts to progress a command * fas216_intr - handle interrupts to progress a command
* @instance: interface to service * @info: interface to service
* *
* Handle interrupts from the interface to progress a command * Handle interrupts from the interface to progress a command
*/ */
void fas216_intr(struct Scsi_Host *instance) void fas216_intr(FAS216_Info *info)
{ {
FAS216_Info *info = (FAS216_Info *)instance->hostdata;
unsigned char isr, ssr, stat; unsigned char isr, ssr, stat;
fas216_checkmagic(info); fas216_checkmagic(info);
stat = inb(REG_STAT(info)); stat = fas216_readb(info, REG_STAT);
ssr = inb(REG_IS(info)); ssr = fas216_readb(info, REG_IS);
isr = inb(REG_INST(info)); isr = fas216_readb(info, REG_INST);
add_debug_list(stat, ssr, isr, info->scsi.phase); add_debug_list(stat, ssr, isr, info->scsi.phase);
...@@ -1762,17 +1824,15 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1762,17 +1824,15 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
int tot_msglen; int tot_msglen;
/* following what the ESP driver says */ /* following what the ESP driver says */
outb(0, REG_STCL(info)); fas216_set_stc(info, 0);
outb(0, REG_STCM(info));
outb(0, REG_STCH(info));
fas216_cmd(info, CMD_NOP | CMD_WITHDMA); fas216_cmd(info, CMD_NOP | CMD_WITHDMA);
/* flush FIFO */ /* flush FIFO */
fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_FLUSHFIFO);
/* load bus-id and timeout */ /* load bus-id and timeout */
outb(BUSID(SCpnt->target), REG_SDID(info)); fas216_writeb(info, REG_SDID, BUSID(SCpnt->target));
outb(info->ifcfg.select_timeout, REG_STIM(info)); fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout);
/* synchronous transfers */ /* synchronous transfers */
fas216_set_sync(info, SCpnt->target); fas216_set_sync(info, SCpnt->target);
...@@ -1808,13 +1868,13 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1808,13 +1868,13 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
/* load message bytes */ /* load message bytes */
while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) { while ((msg = msgqueue_getmsg(&info->scsi.msgs, msgnr++)) != NULL) {
for (i = 0; i < msg->length; i++) for (i = 0; i < msg->length; i++)
outb(msg->msg[i], REG_FF(info)); fas216_writeb(info, REG_FF, msg->msg[i]);
msg->fifo = tot_msglen - (inb(REG_CFIS(info)) & CFIS_CF); msg->fifo = tot_msglen - (fas216_readb(info, REG_CFIS) & CFIS_CF);
} }
/* load command */ /* load command */
for (i = 0; i < SCpnt->cmd_len; i++) for (i = 0; i < SCpnt->cmd_len; i++)
outb(SCpnt->cmnd[i], REG_FF(info)); fas216_writeb(info, REG_FF, SCpnt->cmnd[i]);
if (tot_msglen == 1) if (tot_msglen == 1)
fas216_cmd(info, CMD_SELECTATN); fas216_cmd(info, CMD_SELECTATN);
...@@ -1828,7 +1888,7 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1828,7 +1888,7 @@ static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
*/ */
struct message *msg = msgqueue_getmsg(&info->scsi.msgs, 0); struct message *msg = msgqueue_getmsg(&info->scsi.msgs, 0);
outb(msg->msg[0], REG_FF(info)); fas216_writeb(info, REG_FF, msg->msg[0]);
msg->fifo = 1; msg->fifo = 1;
fas216_cmd(info, CMD_SELECTATNSTOP); fas216_cmd(info, CMD_SELECTATNSTOP);
...@@ -1855,11 +1915,6 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1855,11 +1915,6 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
{ {
int disconnect_ok; int disconnect_ok;
if (parity_test(info, SCpnt->target))
outb(info->scsi.cfg[0] | CNTL1_PTE, REG_CNTL1(info));
else
outb(info->scsi.cfg[0], REG_CNTL1(info));
/* /*
* claim host busy * claim host busy
*/ */
...@@ -1868,6 +1923,11 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1868,6 +1923,11 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
info->SCpnt = SCpnt; info->SCpnt = SCpnt;
info->dma.transfer_type = fasdma_none; info->dma.transfer_type = fasdma_none;
if (parity_test(info, SCpnt->target))
fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_PTE);
else
fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]);
/* /*
* Don't allow request sense commands to disconnect. * Don't allow request sense commands to disconnect.
*/ */
...@@ -1966,24 +2026,22 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1966,24 +2026,22 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt)
msgqueue_addmsg(&info->scsi.msgs, 1, BUS_DEVICE_RESET); msgqueue_addmsg(&info->scsi.msgs, 1, BUS_DEVICE_RESET);
/* following what the ESP driver says */ /* following what the ESP driver says */
outb(0, REG_STCL(info)); fas216_set_stc(info, 0);
outb(0, REG_STCM(info));
outb(0, REG_STCH(info));
fas216_cmd(info, CMD_NOP | CMD_WITHDMA); fas216_cmd(info, CMD_NOP | CMD_WITHDMA);
/* flush FIFO */ /* flush FIFO */
fas216_cmd(info, CMD_FLUSHFIFO); fas216_cmd(info, CMD_FLUSHFIFO);
/* load bus-id and timeout */ /* load bus-id and timeout */
outb(BUSID(SCpnt->target), REG_SDID(info)); fas216_writeb(info, REG_SDID, BUSID(SCpnt->target));
outb(info->ifcfg.select_timeout, REG_STIM(info)); fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout);
/* synchronous transfers */ /* synchronous transfers */
fas216_set_sync(info, SCpnt->target); fas216_set_sync(info, SCpnt->target);
msg = msgqueue_getmsg(&info->scsi.msgs, 0); msg = msgqueue_getmsg(&info->scsi.msgs, 0);
outb(BUS_DEVICE_RESET, REG_FF(info)); fas216_writeb(info, REG_FF, BUS_DEVICE_RESET);
msg->fifo = 1; msg->fifo = 1;
fas216_cmd(info, CMD_SELECTATNSTOP); fas216_cmd(info, CMD_SELECTATNSTOP);
...@@ -1992,8 +2050,8 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -1992,8 +2050,8 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt)
/** /**
* fas216_kick - kick a command to the interface * fas216_kick - kick a command to the interface
* @info: our host interface to kick * @info: our host interface to kick
* *
* kick a command to the interface, interface should be idle. * Kick a command to the interface, interface should be idle.
* Notes: Interrupts are always disabled! * Notes: Interrupts are always disabled!
*/ */
static void fas216_kick(FAS216_Info *info) static void fas216_kick(FAS216_Info *info)
...@@ -2050,11 +2108,8 @@ static void fas216_kick(FAS216_Info *info) ...@@ -2050,11 +2108,8 @@ static void fas216_kick(FAS216_Info *info)
info->SCpnt = NULL; info->SCpnt = NULL;
} }
#if defined(DEBUG_CONNECT) || defined(DEBUG_MESSAGES) fas216_log_command(info, LOG_CONNECT | LOG_MESSAGES, SCpnt,
printk("scsi%d.%c: starting ", "starting");
info->host->host_no, '0' + SCpnt->target);
print_command(SCpnt->cmnd);
#endif
switch (where_from) { switch (where_from) {
case TYPE_QUEUE: case TYPE_QUEUE:
...@@ -2094,13 +2149,13 @@ fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result ...@@ -2094,13 +2149,13 @@ fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result
* @info: interface that completed * @info: interface that completed
* @SCpnt: command that completed * @SCpnt: command that completed
* @result: driver byte of result * @result: driver byte of result
* *
* Finish processing automatic request sense command * Finish processing automatic request sense command
*/ */
static void static void
fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
{ {
fas216_log(info, LOG_CONNECT, fas216_log_target(info, LOG_CONNECT, SCpnt->target,
"request sense complete, result=0x%04x%02x%02x", "request sense complete, result=0x%04x%02x%02x",
result, SCpnt->SCp.Message, SCpnt->SCp.Status); result, SCpnt->SCp.Message, SCpnt->SCp.Status);
...@@ -2127,7 +2182,7 @@ fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2127,7 +2182,7 @@ fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
* @info: interface that completed * @info: interface that completed
* @SCpnt: command that completed * @SCpnt: command that completed
* @result: driver byte of result * @result: driver byte of result
* *
* Finish processing of standard command * Finish processing of standard command
*/ */
static void static void
...@@ -2138,17 +2193,14 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2138,17 +2193,14 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 | SCpnt->result = result << 16 | info->scsi.SCp.Message << 8 |
info->scsi.SCp.Status; info->scsi.SCp.Status;
#ifdef DEBUG_CONNECT fas216_log_command(info, LOG_CONNECT, SCpnt,
printk("scsi%d.%c: command complete, result=%08X, command=", "command complete, result=0x%08x", SCpnt->result);
info->host->host_no, '0' + SCpnt->target, SCpnt->result);
print_command(SCpnt->cmnd);
#endif
/* /*
* If the driver detected an error, or the command * If the driver detected an error, we're all done.
* was request sense, then we're all done.
*/ */
if (result != DID_OK || SCpnt->cmnd[0] == REQUEST_SENSE) if (host_byte(SCpnt->result) != DID_OK ||
msg_byte(SCpnt->result) != COMMAND_COMPLETE)
goto done; goto done;
/* /*
...@@ -2163,7 +2215,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2163,7 +2215,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
* If the command did not complete with GOOD status, * If the command did not complete with GOOD status,
* we are all done here. * we are all done here.
*/ */
if (info->scsi.SCp.Status != GOOD) if (status_byte(SCpnt->result) != GOOD)
goto done; goto done;
/* /*
...@@ -2177,17 +2229,19 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2177,17 +2229,19 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
switch (SCpnt->cmnd[0]) { switch (SCpnt->cmnd[0]) {
case INQUIRY: case INQUIRY:
case START_STOP: case START_STOP:
// case READ_CAPACITY:
case MODE_SENSE: case MODE_SENSE:
break; break;
default: default:
printk(KERN_ERR "scsi%d.%c: incomplete data transfer " printk(KERN_ERR "scsi%d.%c: incomplete data transfer "
"detected: res=%08X ptr=%p len=%X command=", "detected: res=%08X ptr=%p len=%X CDB: ",
info->host->host_no, '0' + SCpnt->target, info->host->host_no, '0' + SCpnt->target,
SCpnt->result, info->scsi.SCp.ptr, SCpnt->result, info->scsi.SCp.ptr,
info->scsi.SCp.this_residual); info->scsi.SCp.this_residual);
print_command(SCpnt->cmnd); print_command(SCpnt->cmnd);
SCpnt->result &= ~(255 << 16);
SCpnt->result |= DID_BAD_TARGET << 16;
goto request_sense;
} }
} }
...@@ -2202,6 +2256,11 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2202,6 +2256,11 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
request_sense: request_sense:
if (SCpnt->cmnd[0] == REQUEST_SENSE)
goto done;
fas216_log_target(info, LOG_CONNECT, SCpnt->target,
"requesting sense");
memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd)); memset(SCpnt->cmnd, 0, sizeof (SCpnt->cmnd));
SCpnt->cmnd[0] = REQUEST_SENSE; SCpnt->cmnd[0] = REQUEST_SENSE;
SCpnt->cmnd[1] = SCpnt->lun << 5; SCpnt->cmnd[1] = SCpnt->lun << 5;
...@@ -2213,6 +2272,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2213,6 +2272,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer); SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
SCpnt->SCp.Message = 0; SCpnt->SCp.Message = 0;
SCpnt->SCp.Status = 0; SCpnt->SCp.Status = 0;
SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
SCpnt->sc_data_direction = SCSI_DATA_READ; SCpnt->sc_data_direction = SCSI_DATA_READ;
SCpnt->use_sg = 0; SCpnt->use_sg = 0;
SCpnt->tag = 0; SCpnt->tag = 0;
...@@ -2233,7 +2293,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) ...@@ -2233,7 +2293,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
* fas216_done - complete processing for current command * fas216_done - complete processing for current command
* @info: interface that completed * @info: interface that completed
* @result: driver byte of result * @result: driver byte of result
* *
* Complete processing for current command * Complete processing for current command
*/ */
static void fas216_done(FAS216_Info *info, unsigned int result) static void fas216_done(FAS216_Info *info, unsigned int result)
...@@ -2263,7 +2323,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result) ...@@ -2263,7 +2323,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
*/ */
if (info->scsi.SCp.ptr && info->scsi.SCp.this_residual == 0) { if (info->scsi.SCp.ptr && info->scsi.SCp.this_residual == 0) {
printk("scsi%d.%c: zero bytes left to transfer, but " printk("scsi%d.%c: zero bytes left to transfer, but "
"buffer pointer still valid: ptr=%p len=%08x command=", "buffer pointer still valid: ptr=%p len=%08x CDB: ",
info->host->host_no, '0' + SCpnt->target, info->host->host_no, '0' + SCpnt->target,
info->scsi.SCp.ptr, info->scsi.SCp.this_residual); info->scsi.SCp.ptr, info->scsi.SCp.this_residual);
info->scsi.SCp.ptr = NULL; info->scsi.SCp.ptr = NULL;
...@@ -2298,9 +2358,9 @@ static void fas216_done(FAS216_Info *info, unsigned int result) ...@@ -2298,9 +2358,9 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
* fas216_queue_command - queue a command for adapter to process. * fas216_queue_command - queue a command for adapter to process.
* @SCpnt: Command to queue * @SCpnt: Command to queue
* @done: done function to call once command is complete * @done: done function to call once command is complete
* *
* Queue a command for adapter to process. * Queue a command for adapter to process.
* Returns: 0 in success, else error. * Returns: 0 on success, else error.
* Notes: io_request_lock is held, interrupts are disabled. * Notes: io_request_lock is held, interrupts are disabled.
*/ */
int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
...@@ -2310,11 +2370,8 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -2310,11 +2370,8 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
fas216_checkmagic(info); fas216_checkmagic(info);
#ifdef DEBUG_CONNECT fas216_log_command(info, LOG_CONNECT, SCpnt,
printk("scsi%d.H: received command for id %d (%p) ", "received command (%p)", SCpnt);
SCpnt->host->host_no, SCpnt->target, SCpnt);
print_command(SCpnt->cmnd);
#endif
SCpnt->scsi_done = done; SCpnt->scsi_done = done;
SCpnt->host_scribble = (void *)fas216_std_done; SCpnt->host_scribble = (void *)fas216_std_done;
...@@ -2341,10 +2398,8 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -2341,10 +2398,8 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
fas216_kick(info); fas216_kick(info);
spin_unlock(&info->host_lock); spin_unlock(&info->host_lock);
#ifdef DEBUG_CONNECT fas216_log_target(info, LOG_CONNECT, -1, "queue %s",
printk("scsi%d.H: queue %s\n", info->host->host_no,
result ? "failure" : "success"); result ? "failure" : "success");
#endif
return result; return result;
} }
...@@ -2352,7 +2407,7 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -2352,7 +2407,7 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
/** /**
* fas216_internal_done - trigger restart of a waiting thread in fas216_command * fas216_internal_done - trigger restart of a waiting thread in fas216_command
* @SCpnt: Command to wake * @SCpnt: Command to wake
* *
* Trigger restart of a waiting thread in fas216_command * Trigger restart of a waiting thread in fas216_command
*/ */
static void fas216_internal_done(Scsi_Cmnd *SCpnt) static void fas216_internal_done(Scsi_Cmnd *SCpnt)
...@@ -2366,9 +2421,9 @@ static void fas216_internal_done(Scsi_Cmnd *SCpnt) ...@@ -2366,9 +2421,9 @@ static void fas216_internal_done(Scsi_Cmnd *SCpnt)
/** /**
* fas216_command - queue a command for adapter to process. * fas216_command - queue a command for adapter to process.
* @SCpnt: Command to queue * @SCpnt: Command to queue
* *
* Qqueue a command for adapter to process. * Queue a command for adapter to process.
* Returns: scsi result code. * Returns: scsi result code.
* Notes: io_request_lock is held, interrupts are disabled. * Notes: io_request_lock is held, interrupts are disabled.
*/ */
...@@ -2405,9 +2460,9 @@ int fas216_command(Scsi_Cmnd *SCpnt) ...@@ -2405,9 +2460,9 @@ int fas216_command(Scsi_Cmnd *SCpnt)
* and go to sleep if we know that the device is going * and go to sleep if we know that the device is going
* to be some time (eg, disconnected). * to be some time (eg, disconnected).
*/ */
if (inb(REG_STAT(info)) & STAT_INT) { if (fas216_readb(info, REG_STAT) & STAT_INT) {
spin_lock_irq(info->host->host_lock); spin_lock_irq(info->host->host_lock);
fas216_intr(info->host); fas216_intr(info);
spin_unlock_irq(info->host->host_lock); spin_unlock_irq(info->host->host_lock);
} }
} }
...@@ -2446,7 +2501,7 @@ enum res_find { ...@@ -2446,7 +2501,7 @@ enum res_find {
/** /**
* fas216_do_abort - decide how to abort a command * fas216_do_abort - decide how to abort a command
* @SCpnt: command to abort * @SCpnt: command to abort
* *
* Decide how to abort a command. * Decide how to abort a command.
* Returns: abort status * Returns: abort status
*/ */
...@@ -2512,7 +2567,7 @@ static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) ...@@ -2512,7 +2567,7 @@ static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
/** /**
* fas216_eh_abort - abort this command * fas216_eh_abort - abort this command
* @SCpnt: command to abort * @SCpnt: command to abort
* *
* Abort this command. * Abort this command.
* Returns: FAILED if unable to abort * Returns: FAILED if unable to abort
* Notes: io_request_lock is taken, and irqs are disabled * Notes: io_request_lock is taken, and irqs are disabled
...@@ -2567,12 +2622,12 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt) ...@@ -2567,12 +2622,12 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
/** /**
* fas216_eh_device_reset - Reset the device associated with this command * fas216_eh_device_reset - Reset the device associated with this command
* @SCpnt: command specifing device to reset * @SCpnt: command specifing device to reset
* *
* Reset the device associated with this command. * Reset the device associated with this command.
* Returns: FAILED if unable to reset. * Returns: FAILED if unable to reset.
* Notes: We won't be re-entered, so we'll only have one device * Notes: We won't be re-entered, so we'll only have one device
* reset on the go at one time. * reset on the go at one time.
*/ */
int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
{ {
...@@ -2650,7 +2705,7 @@ int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) ...@@ -2650,7 +2705,7 @@ int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
/** /**
* fas216_eh_bus_reset - Reset the bus associated with the command * fas216_eh_bus_reset - Reset the bus associated with the command
* @SCpnt: command specifing bus to reset * @SCpnt: command specifing bus to reset
* *
* Reset the bus associated with the command. * Reset the bus associated with the command.
* Returns: FAILED if unable to reset. * Returns: FAILED if unable to reset.
* Notes: Further commands are blocked. * Notes: Further commands are blocked.
...@@ -2672,13 +2727,13 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) ...@@ -2672,13 +2727,13 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
* Stop all activity on this interface. * Stop all activity on this interface.
*/ */
fas216_aborttransfer(info); fas216_aborttransfer(info);
outb(info->scsi.cfg[2], REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]);
/* /*
* Clear any pending interrupts. * Clear any pending interrupts.
*/ */
while (inb(REG_STAT(info)) & STAT_INT) while (fas216_readb(info, REG_STAT) & STAT_INT)
inb(REG_INST(info)); fas216_readb(info, REG_INST);
info->rst_bus_status = 0; info->rst_bus_status = 0;
...@@ -2728,26 +2783,26 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) ...@@ -2728,26 +2783,26 @@ int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt)
/** /**
* fas216_init_chip - Initialise FAS216 state after reset * fas216_init_chip - Initialise FAS216 state after reset
* @info: state structure for interface * @info: state structure for interface
* *
* Initialise FAS216 state after reset * Initialise FAS216 state after reset
*/ */
static void fas216_init_chip(FAS216_Info *info) static void fas216_init_chip(FAS216_Info *info)
{ {
outb(fas216_clockrate(info->ifcfg.clockrate), REG_CLKF(info)); fas216_writeb(info, REG_CLKF, fas216_clockrate(info->ifcfg.clockrate));
outb(info->scsi.cfg[0], REG_CNTL1(info)); fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]);
outb(info->scsi.cfg[1], REG_CNTL2(info)); fas216_writeb(info, REG_CNTL2, info->scsi.cfg[1]);
outb(info->scsi.cfg[2], REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, info->scsi.cfg[2]);
outb(info->ifcfg.select_timeout, REG_STIM(info)); fas216_writeb(info, REG_STIM, info->ifcfg.select_timeout);
outb(0, REG_SOF(info)); fas216_writeb(info, REG_SOF, 0);
outb(info->scsi.async_stp, REG_STP(info)); fas216_writeb(info, REG_STP, info->scsi.async_stp);
outb(info->scsi.cfg[0], REG_CNTL1(info)); fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]);
} }
/** /**
* fas216_eh_host_reset - Reset the host associated with this command * fas216_eh_host_reset - Reset the host associated with this command
* @SCpnt: command specifing host to reset * @SCpnt: command specifing host to reset
* *
* Reset the host associated with this command. * Reset the host associated with this command.
* Returns: FAILED if unable to reset. * Returns: FAILED if unable to reset.
* Notes: io_request_lock is taken, and irqs are disabled * Notes: io_request_lock is taken, and irqs are disabled
...@@ -2811,56 +2866,56 @@ static int fas216_detect_type(FAS216_Info *info) ...@@ -2811,56 +2866,56 @@ static int fas216_detect_type(FAS216_Info *info)
/* /*
* Reset the chip. * Reset the chip.
*/ */
outb(CMD_RESETCHIP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_RESETCHIP);
udelay(50); udelay(50);
outb(CMD_NOP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_NOP);
/* /*
* Check to see if control reg 2 is present. * Check to see if control reg 2 is present.
*/ */
outb(0, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, 0);
outb(CNTL2_S2FE, REG_CNTL2(info)); fas216_writeb(info, REG_CNTL2, CNTL2_S2FE);
/* /*
* If we are unable to read back control reg 2 * If we are unable to read back control reg 2
* correctly, it is not present, and we have a * correctly, it is not present, and we have a
* NCR53C90. * NCR53C90.
*/ */
if ((inb(REG_CNTL2(info)) & (~0xe0)) != CNTL2_S2FE) if ((fas216_readb(info, REG_CNTL2) & (~0xe0)) != CNTL2_S2FE)
return TYPE_NCR53C90; return TYPE_NCR53C90;
/* /*
* Now, check control register 3 * Now, check control register 3
*/ */
outb(0, REG_CNTL2(info)); fas216_writeb(info, REG_CNTL2, 0);
outb(0, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, 0);
outb(5, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, 5);
/* /*
* If we are unable to read the register back * If we are unable to read the register back
* correctly, we have a NCR53C90A * correctly, we have a NCR53C90A
*/ */
if (inb(REG_CNTL3(info)) != 5) if (fas216_readb(info, REG_CNTL3) != 5)
return TYPE_NCR53C90A; return TYPE_NCR53C90A;
/* /*
* Now read the ID from the chip. * Now read the ID from the chip.
*/ */
outb(0, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, 0);
outb(CNTL3_ADIDCHK, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, CNTL3_ADIDCHK);
outb(0, REG_CNTL3(info)); fas216_writeb(info, REG_CNTL3, 0);
outb(CMD_RESETCHIP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_RESETCHIP);
udelay(5); udelay(50);
outb(CMD_WITHDMA | CMD_NOP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_WITHDMA | CMD_NOP);
outb(CNTL2_ENF, REG_CNTL2(info)); fas216_writeb(info, REG_CNTL2, CNTL2_ENF);
outb(CMD_RESETCHIP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_RESETCHIP);
udelay(5); udelay(50);
outb(CMD_NOP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_NOP);
rev = inb(REG1_ID(info)); rev = fas216_readb(info, REG_ID);
family = rev >> 3; family = rev >> 3;
rev &= 7; rev &= 7;
...@@ -2886,10 +2941,10 @@ static int fas216_detect_type(FAS216_Info *info) ...@@ -2886,10 +2941,10 @@ static int fas216_detect_type(FAS216_Info *info)
return TYPE_NCR53C9x; return TYPE_NCR53C9x;
} }
/** /**
* fas216_reset_state - Initialise driver internal state * fas216_reset_state - Initialise driver internal state
* @info: state to initialise * @info: state to initialise
* *
* Initialise driver internal state * Initialise driver internal state
*/ */
static void fas216_reset_state(FAS216_Info *info) static void fas216_reset_state(FAS216_Info *info)
...@@ -2927,23 +2982,23 @@ static void fas216_reset_state(FAS216_Info *info) ...@@ -2927,23 +2982,23 @@ static void fas216_reset_state(FAS216_Info *info)
} }
/** /**
* fas216_init - initialise FAS/NCR/AMD SCSI ic. * fas216_init - initialise FAS/NCR/AMD SCSI structures.
* @instance: a driver-specific filled-out structure * @host: a driver-specific filled-out structure
* *
* Initialise FAS/NCR/AMD SCSI ic. * Initialise FAS/NCR/AMD SCSI structures.
* Returns: 0 on success * Returns: 0 on success
*/ */
int fas216_init(struct Scsi_Host *instance) int fas216_init(struct Scsi_Host *host)
{ {
FAS216_Info *info = (FAS216_Info *)instance->hostdata; FAS216_Info *info = (FAS216_Info *)host->hostdata;
int type;
info->magic_start = MAGIC; info->magic_start = MAGIC;
info->magic_end = MAGIC; info->magic_end = MAGIC;
info->host = instance; info->host = host;
info->scsi.cfg[0] = instance->this_id | CNTL1_PERE; info->scsi.cfg[0] = host->this_id | CNTL1_PERE;
info->scsi.cfg[1] = CNTL2_ENF | CNTL2_S2FE; info->scsi.cfg[1] = CNTL2_ENF | CNTL2_S2FE;
info->scsi.cfg[2] = info->ifcfg.cntl3 | CNTL3_ADIDCHK | CNTL3_G2CB; info->scsi.cfg[2] = info->ifcfg.cntl3 |
CNTL3_ADIDCHK | CNTL3_G2CB | CNTL3_LBTM;
info->scsi.async_stp = fas216_syncperiod(info, info->ifcfg.asyncperiod); info->scsi.async_stp = fas216_syncperiod(info, info->ifcfg.asyncperiod);
info->rst_dev_status = -1; info->rst_dev_status = -1;
...@@ -2960,13 +3015,29 @@ int fas216_init(struct Scsi_Host *instance) ...@@ -2960,13 +3015,29 @@ int fas216_init(struct Scsi_Host *instance)
msgqueue_initialise(&info->scsi.msgs); msgqueue_initialise(&info->scsi.msgs);
if (!queue_initialise(&info->queues.issue)) if (!queue_initialise(&info->queues.issue))
return 1; return -ENOMEM;
if (!queue_initialise(&info->queues.disconnected)) { if (!queue_initialise(&info->queues.disconnected)) {
queue_free(&info->queues.issue); queue_free(&info->queues.issue);
return 1; return -ENOMEM;
} }
return 0;
}
/**
* fas216_add - initialise FAS/NCR/AMD SCSI ic.
* @host: a driver-specific filled-out structure
* @dev: parent device
*
* Initialise FAS/NCR/AMD SCSI ic.
* Returns: 0 on success
*/
int fas216_add(struct Scsi_Host *host, struct device *dev)
{
FAS216_Info *info = (FAS216_Info *)host->hostdata;
int type, ret;
fas216_reset_state(info); fas216_reset_state(info);
type = fas216_detect_type(info); type = fas216_detect_type(info);
info->scsi.type = chip_types[type]; info->scsi.type = chip_types[type];
...@@ -2983,8 +3054,8 @@ int fas216_init(struct Scsi_Host *instance) ...@@ -2983,8 +3054,8 @@ int fas216_init(struct Scsi_Host *instance)
* the resulting reset interrupt, so mask it * the resulting reset interrupt, so mask it
* out. * out.
*/ */
outb(info->scsi.cfg[0] | CNTL1_DISR, REG_CNTL1(info)); fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0] | CNTL1_DISR);
outb(CMD_RESETSCSI, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_RESETSCSI);
/* /*
* scsi standard says wait 250ms * scsi standard says wait 250ms
...@@ -2993,60 +3064,40 @@ int fas216_init(struct Scsi_Host *instance) ...@@ -2993,60 +3064,40 @@ int fas216_init(struct Scsi_Host *instance)
scsi_sleep(100*HZ/100); scsi_sleep(100*HZ/100);
spin_lock_irq(info->host->host_lock); spin_lock_irq(info->host->host_lock);
outb(info->scsi.cfg[0], REG_CNTL1(info)); fas216_writeb(info, REG_CNTL1, info->scsi.cfg[0]);
inb(REG_INST(info)); fas216_readb(info, REG_INST);
fas216_checkmagic(info); fas216_checkmagic(info);
return 0; ret = scsi_add_host(host, dev);
if (ret)
fas216_writeb(info, REG_CMD, CMD_RESETCHIP);
return ret;
} }
/** void fas216_remove(struct Scsi_Host *host)
* fas216_release - release all resources for FAS/NCR/AMD SCSI ic.
* @instance: a driver-specific filled-out structure
*
* release all resources and put everything to bed for FAS/NCR/AMD SCSI ic,
* Returns: 0 on success.
*/
int fas216_release(struct Scsi_Host *instance)
{ {
FAS216_Info *info = (FAS216_Info *)instance->hostdata; FAS216_Info *info = (FAS216_Info *)host->hostdata;
fas216_checkmagic(info); fas216_checkmagic(info);
scsi_remove_host(host);
outb(CMD_RESETCHIP, REG_CMD(info)); fas216_writeb(info, REG_CMD, CMD_RESETCHIP);
queue_free(&info->queues.disconnected);
queue_free(&info->queues.issue);
return 0;
} }
/** /**
* fas216_info - generate a string containing information about host. * fas216_release - release all resources for FAS/NCR/AMD SCSI ic.
* @info: FAS216 host information * @host: a driver-specific filled-out structure
* @buffer: string buffer to build string *
* * release all resources and put everything to bed for FAS/NCR/AMD SCSI ic.
* Generate a string containing information about this host.
* Returns: size of built string
*/ */
int fas216_info(FAS216_Info *info, char *buffer) void fas216_release(struct Scsi_Host *host)
{ {
char *p = buffer; FAS216_Info *info = (FAS216_Info *)host->hostdata;
p += sprintf(p, "(%s) at port 0x%08lX ",
info->scsi.type, info->host->io_port);
if (info->host->irq != NO_IRQ) queue_free(&info->queues.disconnected);
p += sprintf(p, "irq %d ", info->host->irq); queue_free(&info->queues.issue);
else
p += sprintf(p, "no irq ");
if (info->host->dma_channel != NO_DMA)
p += sprintf(p, "dma %d ", info->host->dma_channel);
else
p += sprintf(p, "no dma ");
return p - buffer;
} }
int fas216_print_host(FAS216_Info *info, char *buffer) int fas216_print_host(FAS216_Info *info, char *buffer)
...@@ -3054,7 +3105,7 @@ int fas216_print_host(FAS216_Info *info, char *buffer) ...@@ -3054,7 +3105,7 @@ int fas216_print_host(FAS216_Info *info, char *buffer)
return sprintf(buffer, return sprintf(buffer,
"\n" "\n"
"Chip : %s\n" "Chip : %s\n"
" Address: 0x%08lX\n" " Address: 0x%08lx\n"
" IRQ : %d\n" " IRQ : %d\n"
" DMA : %d\n", " DMA : %d\n",
info->scsi.type, info->host->io_port, info->scsi.type, info->host->io_port,
...@@ -3116,11 +3167,12 @@ int fas216_print_device(FAS216_Info *info, Scsi_Device *scd, char *buffer) ...@@ -3116,11 +3167,12 @@ int fas216_print_device(FAS216_Info *info, Scsi_Device *scd, char *buffer)
return p - buffer; return p - buffer;
} }
EXPORT_SYMBOL(fas216_info);
EXPORT_SYMBOL(fas216_init); EXPORT_SYMBOL(fas216_init);
EXPORT_SYMBOL(fas216_add);
EXPORT_SYMBOL(fas216_queue_command); EXPORT_SYMBOL(fas216_queue_command);
EXPORT_SYMBOL(fas216_command); EXPORT_SYMBOL(fas216_command);
EXPORT_SYMBOL(fas216_intr); EXPORT_SYMBOL(fas216_intr);
EXPORT_SYMBOL(fas216_remove);
EXPORT_SYMBOL(fas216_release); EXPORT_SYMBOL(fas216_release);
EXPORT_SYMBOL(fas216_eh_abort); EXPORT_SYMBOL(fas216_eh_abort);
EXPORT_SYMBOL(fas216_eh_device_reset); EXPORT_SYMBOL(fas216_eh_device_reset);
......
...@@ -22,18 +22,18 @@ ...@@ -22,18 +22,18 @@
/* FAS register definitions */ /* FAS register definitions */
/* transfer count low */ /* transfer count low */
#define REG_CTCL(x) ((x)->scsi.io_port) #define REG_CTCL (0)
#define REG_STCL(x) ((x)->scsi.io_port) #define REG_STCL (0)
/* transfer count medium */ /* transfer count medium */
#define REG_CTCM(x) ((x)->scsi.io_port + (1 << (x)->scsi.io_shift)) #define REG_CTCM (1)
#define REG_STCM(x) ((x)->scsi.io_port + (1 << (x)->scsi.io_shift)) #define REG_STCM (1)
/* fifo data */ /* fifo data */
#define REG_FF(x) ((x)->scsi.io_port + (2 << (x)->scsi.io_shift)) #define REG_FF (2)
/* command */ /* command */
#define REG_CMD(x) ((x)->scsi.io_port + (3 << (x)->scsi.io_shift)) #define REG_CMD (3)
#define CMD_NOP 0x00 #define CMD_NOP 0x00
#define CMD_FLUSHFIFO 0x01 #define CMD_FLUSHFIFO 0x01
#define CMD_RESETCHIP 0x02 #define CMD_RESETCHIP 0x02
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#define CMD_WITHDMA 0x80 #define CMD_WITHDMA 0x80
/* status register (read) */ /* status register (read) */
#define REG_STAT(x) ((x)->scsi.io_port + (4 << (x)->scsi.io_shift)) #define REG_STAT (4)
#define STAT_IO (1 << 0) /* IO phase */ #define STAT_IO (1 << 0) /* IO phase */
#define STAT_CD (1 << 1) /* CD phase */ #define STAT_CD (1 << 1) /* CD phase */
#define STAT_MSG (1 << 2) /* MSG phase */ #define STAT_MSG (1 << 2) /* MSG phase */
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
#define STAT_MESGIN (STAT_MSG|STAT_CD|STAT_IO) /* Message In */ #define STAT_MESGIN (STAT_MSG|STAT_CD|STAT_IO) /* Message In */
/* bus ID for select / reselect */ /* bus ID for select / reselect */
#define REG_SDID(x) ((x)->scsi.io_port + (4 << (x)->scsi.io_shift)) #define REG_SDID (4)
#define BUSID(target) ((target) & 7) #define BUSID(target) ((target) & 7)
/* Interrupt status register (read) */ /* Interrupt status register (read) */
#define REG_INST(x) ((x)->scsi.io_port + (5 << (x)->scsi.io_shift)) #define REG_INST (5)
#define INST_SELWOATN (1 << 0) /* Select w/o ATN */ #define INST_SELWOATN (1 << 0) /* Select w/o ATN */
#define INST_SELATN (1 << 1) /* Select w/ATN */ #define INST_SELATN (1 << 1) /* Select w/ATN */
#define INST_RESELECTED (1 << 2) /* Reselected */ #define INST_RESELECTED (1 << 2) /* Reselected */
...@@ -91,10 +91,10 @@ ...@@ -91,10 +91,10 @@
#define INST_BUSRESET (1 << 7) /* SCSI Bus reset */ #define INST_BUSRESET (1 << 7) /* SCSI Bus reset */
/* Timeout register (write) */ /* Timeout register (write) */
#define REG_STIM(x) ((x)->scsi.io_port + (5 << (x)->scsi.io_shift)) #define REG_STIM (5)
/* Sequence step register (read) */ /* Sequence step register (read) */
#define REG_IS(x) ((x)->scsi.io_port + (6 << (x)->scsi.io_shift)) #define REG_IS (6)
#define IS_BITS 0x07 #define IS_BITS 0x07
#define IS_SELARB 0x00 /* Select & Arb ok */ #define IS_SELARB 0x00 /* Select & Arb ok */
#define IS_MSGBYTESENT 0x01 /* One byte message sent*/ #define IS_MSGBYTESENT 0x01 /* One byte message sent*/
...@@ -104,18 +104,18 @@ ...@@ -104,18 +104,18 @@
#define IS_SOF 0x08 /* Sync off flag */ #define IS_SOF 0x08 /* Sync off flag */
/* Transfer period step (write) */ /* Transfer period step (write) */
#define REG_STP(x) ((x)->scsi.io_port + (6 << (x)->scsi.io_shift)) #define REG_STP (6)
/* Synchronous Offset (write) */ /* Synchronous Offset (write) */
#define REG_SOF(x) ((x)->scsi.io_port + (7 << (x)->scsi.io_shift)) #define REG_SOF (7)
/* Fifo state register (read) */ /* Fifo state register (read) */
#define REG_CFIS(x) ((x)->scsi.io_port + (7 << (x)->scsi.io_shift)) #define REG_CFIS (7)
#define CFIS_CF 0x1f /* Num bytes in FIFO */ #define CFIS_CF 0x1f /* Num bytes in FIFO */
#define CFIS_IS 0xe0 /* Step */ #define CFIS_IS 0xe0 /* Step */
/* config register 1 */ /* config register 1 */
#define REG_CNTL1(x) ((x)->scsi.io_port + (8 << (x)->scsi.io_shift)) #define REG_CNTL1 (8)
#define CNTL1_CID (7 << 0) /* Chip ID */ #define CNTL1_CID (7 << 0) /* Chip ID */
#define CNTL1_STE (1 << 3) /* Self test enable */ #define CNTL1_STE (1 << 3) /* Self test enable */
#define CNTL1_PERE (1 << 4) /* Parity enable reporting en. */ #define CNTL1_PERE (1 << 4) /* Parity enable reporting en. */
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
#define CNTL1_ETM (1 << 7) /* Extended Timing Mode */ #define CNTL1_ETM (1 << 7) /* Extended Timing Mode */
/* Clock conversion factor (read) */ /* Clock conversion factor (read) */
#define REG_CLKF(x) ((x)->scsi.io_port + (9 << (x)->scsi.io_shift)) #define REG_CLKF (9)
#define CLKF_F37MHZ 0x00 /* 35.01 - 40 MHz */ #define CLKF_F37MHZ 0x00 /* 35.01 - 40 MHz */
#define CLKF_F10MHZ 0x02 /* 10 MHz */ #define CLKF_F10MHZ 0x02 /* 10 MHz */
#define CLKF_F12MHZ 0x03 /* 10.01 - 15 MHz */ #define CLKF_F12MHZ 0x03 /* 10.01 - 15 MHz */
...@@ -134,13 +134,13 @@ ...@@ -134,13 +134,13 @@
#define CLKF_F32MHZ 0x07 /* 30.01 - 35 MHz */ #define CLKF_F32MHZ 0x07 /* 30.01 - 35 MHz */
/* Chip test register (write) */ /* Chip test register (write) */
#define REG0_FTM(x) ((x)->scsi.io_port + (10 << (x)->scsi.io_shift)) #define REG_FTM (10)
#define TEST_FTM 0x01 /* Force target mode */ #define TEST_FTM 0x01 /* Force target mode */
#define TEST_FIM 0x02 /* Force initiator mode */ #define TEST_FIM 0x02 /* Force initiator mode */
#define TEST_FHI 0x04 /* Force high impedance mode */ #define TEST_FHI 0x04 /* Force high impedance mode */
/* Configuration register 2 (read/write) */ /* Configuration register 2 (read/write) */
#define REG_CNTL2(x) ((x)->scsi.io_port + (11 << (x)->scsi.io_shift)) #define REG_CNTL2 (11)
#define CNTL2_PGDP (1 << 0) /* Pass Th/Generate Data Parity */ #define CNTL2_PGDP (1 << 0) /* Pass Th/Generate Data Parity */
#define CNTL2_PGRP (1 << 1) /* Pass Th/Generate Reg Parity */ #define CNTL2_PGRP (1 << 1) /* Pass Th/Generate Reg Parity */
#define CNTL2_ACDPE (1 << 2) /* Abort on Cmd/Data Parity Err */ #define CNTL2_ACDPE (1 << 2) /* Abort on Cmd/Data Parity Err */
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
#define CNTL2_DAE (1 << 7) /* Data Alignment Enable */ #define CNTL2_DAE (1 << 7) /* Data Alignment Enable */
/* Configuration register 3 (read/write) */ /* Configuration register 3 (read/write) */
#define REG_CNTL3(x) ((x)->scsi.io_port + (12 << (x)->scsi.io_shift)) #define REG_CNTL3 (12)
#define CNTL3_BS8 (1 << 0) /* Burst size 8 */ #define CNTL3_BS8 (1 << 0) /* Burst size 8 */
#define CNTL3_MDM (1 << 1) /* Modify DMA mode */ #define CNTL3_MDM (1 << 1) /* Modify DMA mode */
#define CNTL3_LBTM (1 << 2) /* Last Byte Transfer mode */ #define CNTL3_LBTM (1 << 2) /* Last Byte Transfer mode */
...@@ -162,14 +162,14 @@ ...@@ -162,14 +162,14 @@
#define CNTL3_ADIDCHK (1 << 7) /* Additional ID check */ #define CNTL3_ADIDCHK (1 << 7) /* Additional ID check */
/* High transfer count (read/write) */ /* High transfer count (read/write) */
#define REG_CTCH(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) #define REG_CTCH (14)
#define REG_STCH(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) #define REG_STCH (14)
/* ID reigster (read only) */ /* ID register (read only) */
#define REG1_ID(x) ((x)->scsi.io_port + (14 << (x)->scsi.io_shift)) #define REG_ID (14)
/* Data alignment */ /* Data alignment */
#define REG0_DAL(x) ((x)->scsi.io_port + (15 << (x)->scsi.io_shift)) #define REG_DAL (15)
typedef enum { typedef enum {
PHASE_IDLE, /* we're not planning on doing anything */ PHASE_IDLE, /* we're not planning on doing anything */
...@@ -212,6 +212,9 @@ typedef enum { ...@@ -212,6 +212,9 @@ typedef enum {
#define MAGIC 0x441296bdUL #define MAGIC 0x441296bdUL
#define NR_MSGS 8 #define NR_MSGS 8
#define FASCAP_DMA (1 << 0)
#define FASCAP_PSEUDODMA (1 << 1)
typedef struct { typedef struct {
unsigned long magic_start; unsigned long magic_start;
spinlock_t host_lock; spinlock_t host_lock;
...@@ -233,12 +236,13 @@ typedef struct { ...@@ -233,12 +236,13 @@ typedef struct {
/* driver information */ /* driver information */
struct { struct {
phase_t phase; /* current phase */
void *io_base; /* iomem base of FAS216 */
unsigned int io_port; /* base address of FAS216 */ unsigned int io_port; /* base address of FAS216 */
unsigned int io_shift; /* shift to adjust reg offsets by */ unsigned int io_shift; /* shift to adjust reg offsets by */
unsigned int irq; /* interrupt */
unsigned char cfg[4]; /* configuration registers */ unsigned char cfg[4]; /* configuration registers */
const char *type; /* chip type */ const char *type; /* chip type */
phase_t phase; /* current phase */ unsigned int irq; /* interrupt */
struct { struct {
unsigned char target; /* reconnected target */ unsigned char target; /* reconnected target */
...@@ -253,7 +257,6 @@ typedef struct { ...@@ -253,7 +257,6 @@ typedef struct {
unsigned int async_stp; /* Async transfer STP value */ unsigned int async_stp; /* Async transfer STP value */
unsigned char msgin_fifo; /* bytes in fifo at time of message in */ unsigned char msgin_fifo; /* bytes in fifo at time of message in */
unsigned char message[256]; /* last message received from device */ unsigned char message[256]; /* last message received from device */
unsigned int msglen; /* length of last message received */
unsigned char disconnectable:1; /* this command can be disconnected */ unsigned char disconnectable:1; /* this command can be disconnected */
unsigned char aborting:1; /* aborting command */ unsigned char aborting:1; /* aborting command */
...@@ -281,6 +284,7 @@ typedef struct { ...@@ -281,6 +284,7 @@ typedef struct {
unsigned char wide_max_size; /* Maximum wide transfer size */ unsigned char wide_max_size; /* Maximum wide transfer size */
unsigned char cntl3; /* Control Reg 3 */ unsigned char cntl3; /* Control Reg 3 */
unsigned int asyncperiod; /* Async transfer period (ns) */ unsigned int asyncperiod; /* Async transfer period (ns) */
unsigned int capabilities; /* driver capabilities */
unsigned int disconnect_ok:1; /* Disconnects allowed? */ unsigned int disconnect_ok:1; /* Disconnects allowed? */
} ifcfg; } ifcfg;
...@@ -319,26 +323,18 @@ typedef struct { ...@@ -319,26 +323,18 @@ typedef struct {
} FAS216_Info; } FAS216_Info;
/* Function: int fas216_init (struct Scsi_Host *instance) /* Function: int fas216_init (struct Scsi_Host *instance)
* Purpose : initialise FAS/NCR/AMD SCSI ic. * Purpose : initialise FAS/NCR/AMD SCSI structures.
* Params : instance - a driver-specific filled-out structure * Params : instance - a driver-specific filled-out structure
* Returns : 0 on success * Returns : 0 on success
*/ */
extern int fas216_init (struct Scsi_Host *instance); extern int fas216_init (struct Scsi_Host *instance);
/* Function: int fas216_abort (Scsi_Cmnd *SCpnt) /* Function: int fas216_add (struct Scsi_Host *instance, struct device *dev)
* Purpose : abort a command if something horrible happens. * Purpose : initialise FAS/NCR/AMD SCSI ic.
* Params : SCpnt - Command that is believed to be causing a problem. * Params : instance - a driver-specific filled-out structure
* Returns : one of SCSI_ABORT_ macros. * Returns : 0 on success
*/
extern int fas216_abort (Scsi_Cmnd *);
/* Function: int fas216_reset (Scsi_Cmnd *SCpnt, unsigned int reset_flags)
* Purpose : resets the adapter if something horrible happens.
* Params : SCpnt - Command that is believed to be causing a problem.
* reset_flags - flags indicating reset type that is believed to be required.
* Returns : one of SCSI_RESET_ macros, or'd with the SCSI_RESET_*_RESET macros.
*/ */
extern int fas216_reset (Scsi_Cmnd *, unsigned int); extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
/* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) /* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
* Purpose : queue a command for adapter to process. * Purpose : queue a command for adapter to process.
...@@ -355,20 +351,21 @@ extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); ...@@ -355,20 +351,21 @@ extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
*/ */
extern int fas216_command (Scsi_Cmnd *); extern int fas216_command (Scsi_Cmnd *);
/* Function: void fas216_intr (struct Scsi_Host *instance) /* Function: void fas216_intr (FAS216_Info *info)
* Purpose : handle interrupts from the interface to progress a command * Purpose : handle interrupts from the interface to progress a command
* Params : instance - interface to service * Params : info - interface to service
*/ */
extern void fas216_intr (struct Scsi_Host *instance); extern void fas216_intr (FAS216_Info *info);
extern void fas216_remove (struct Scsi_Host *instance);
/* Function: int fas216_release (struct Scsi_Host *instance) /* Function: void fas216_release (struct Scsi_Host *instance)
* Purpose : release all resources and put everything to bed for FAS/NCR/AMD SCSI ic. * Purpose : release all resources and put everything to bed for FAS/NCR/AMD SCSI ic.
* Params : instance - a driver-specific filled-out structure * Params : instance - a driver-specific filled-out structure
* Returns : 0 on success * Returns : 0 on success
*/ */
extern int fas216_release (struct Scsi_Host *instance); extern void fas216_release (struct Scsi_Host *instance);
extern int fas216_info(FAS216_Info *info, char *buffer);
extern int fas216_print_host(FAS216_Info *info, char *buffer); extern int fas216_print_host(FAS216_Info *info, char *buffer);
extern int fas216_print_stats(FAS216_Info *info, char *buffer); extern int fas216_print_stats(FAS216_Info *info, char *buffer);
extern int fas216_print_device(FAS216_Info *info, Scsi_Device *scd, char *buffer); extern int fas216_print_device(FAS216_Info *info, Scsi_Device *scd, char *buffer);
......
...@@ -192,7 +192,8 @@ static struct ecard_driver oakscsi_driver = { ...@@ -192,7 +192,8 @@ static struct ecard_driver oakscsi_driver = {
.remove = __devexit_p(oakscsi_remove), .remove = __devexit_p(oakscsi_remove),
.id_table = oakscsi_cids, .id_table = oakscsi_cids,
.drv = { .drv = {
.name = "oakscsi", .devclass = &shost_devclass,
.name = "oakscsi",
}, },
}; };
......
/* /*
* linux/drivers/acorn/scsi/powertec.c * linux/drivers/acorn/scsi/powertec.c
* *
* Copyright (C) 1997-2002 Russell King * Copyright (C) 1997-2003 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
...@@ -32,24 +32,23 @@ ...@@ -32,24 +32,23 @@
#include <scsi/scsicam.h> #include <scsi/scsicam.h>
#define POWERTEC_FAS216_OFFSET 0xc00 #define POWERTEC_FAS216_OFFSET 0x3000
#define POWERTEC_FAS216_SHIFT 4 #define POWERTEC_FAS216_SHIFT 6
#define POWERTEC_FAS216_SIZE (16 << POWERTEC_FAS216_SHIFT)
#define POWERTEC_INTR_STATUS 0x800 #define POWERTEC_INTR_STATUS 0x2000
#define POWERTEC_INTR_BIT 0x80 #define POWERTEC_INTR_BIT 0x80
#define POWERTEC_RESET_CONTROL 0x406 #define POWERTEC_RESET_CONTROL 0x1018
#define POWERTEC_RESET_BIT 1 #define POWERTEC_RESET_BIT 1
#define POWERTEC_TERM_CONTROL 0x806 #define POWERTEC_TERM_CONTROL 0x2018
#define POWERTEC_TERM_ENABLE 1 #define POWERTEC_TERM_ENABLE 1
#define POWERTEC_INTR_CONTROL 0x407 #define POWERTEC_INTR_CONTROL 0x101c
#define POWERTEC_INTR_ENABLE 1 #define POWERTEC_INTR_ENABLE 1
#define POWERTEC_INTR_DISABLE 0 #define POWERTEC_INTR_DISABLE 0
#define VERSION "1.00 (13/11/2002 2.5.47)" #define VERSION "1.10 (19/01/2003 2.5.59)"
/* /*
* Use term=0,1,0,0,0 to turn terminators on/off. * Use term=0,1,0,0,0 to turn terminators on/off.
...@@ -60,10 +59,11 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 }; ...@@ -60,10 +59,11 @@ static int term[MAX_ECARDS] = { 1, 1, 1, 1, 1, 1, 1, 1 };
#define NR_SG 256 #define NR_SG 256
struct powertec_info { struct powertec_info {
FAS216_Info info; FAS216_Info info;
unsigned int term_port; struct expansion_card *ec;
unsigned int term_ctl; void *term_port;
struct scatterlist sg[NR_SG]; unsigned int term_ctl;
struct scatterlist sg[NR_SG];
}; };
/* Prototype: void powertecscsi_irqenable(ec, irqnr) /* Prototype: void powertecscsi_irqenable(ec, irqnr)
...@@ -74,8 +74,7 @@ struct powertec_info { ...@@ -74,8 +74,7 @@ struct powertec_info {
static void static void
powertecscsi_irqenable(struct expansion_card *ec, int irqnr) powertecscsi_irqenable(struct expansion_card *ec, int irqnr)
{ {
unsigned int port = (unsigned int)ec->irq_data; writeb(POWERTEC_INTR_ENABLE, ec->irq_data);
outb(POWERTEC_INTR_ENABLE, port);
} }
/* Prototype: void powertecscsi_irqdisable(ec, irqnr) /* Prototype: void powertecscsi_irqdisable(ec, irqnr)
...@@ -86,8 +85,7 @@ powertecscsi_irqenable(struct expansion_card *ec, int irqnr) ...@@ -86,8 +85,7 @@ powertecscsi_irqenable(struct expansion_card *ec, int irqnr)
static void static void
powertecscsi_irqdisable(struct expansion_card *ec, int irqnr) powertecscsi_irqdisable(struct expansion_card *ec, int irqnr)
{ {
unsigned int port = (unsigned int)ec->irq_data; writeb(POWERTEC_INTR_DISABLE, ec->irq_data);
outb(POWERTEC_INTR_DISABLE, port);
} }
static const expansioncard_ops_t powertecscsi_ops = { static const expansioncard_ops_t powertecscsi_ops = {
...@@ -106,7 +104,7 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -106,7 +104,7 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
struct powertec_info *info = (struct powertec_info *)host->hostdata; struct powertec_info *info = (struct powertec_info *)host->hostdata;
info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0; info->term_ctl = on_off ? POWERTEC_TERM_ENABLE : 0;
outb(info->term_ctl, info->term_port); writeb(info->term_ctl, info->term_port);
} }
/* Prototype: void powertecscsi_intr(irq, *dev_id, *regs) /* Prototype: void powertecscsi_intr(irq, *dev_id, *regs)
...@@ -118,9 +116,9 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off) ...@@ -118,9 +116,9 @@ powertecscsi_terminator_ctl(struct Scsi_Host *host, int on_off)
static void static void
powertecscsi_intr(int irq, void *dev_id, struct pt_regs *regs) powertecscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct Scsi_Host *host = (struct Scsi_Host *)dev_id; struct powertec_info *info = dev_id;
fas216_intr(host); fas216_intr(&info->info);
} }
/* Prototype: fasdmatype_t powertecscsi_dma_setup(host, SCpnt, direction, min_type) /* Prototype: fasdmatype_t powertecscsi_dma_setup(host, SCpnt, direction, min_type)
...@@ -139,8 +137,8 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp, ...@@ -139,8 +137,8 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
struct device *dev = scsi_get_device(host); struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel; int dmach = host->dma_channel;
if (dmach != NO_DMA && if (info->info.ifcfg.capabilities & FASCAP_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) { min_type == fasdma_real_all) {
int bufs, map_dir, dma_dir; int bufs, map_dir, dma_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG); bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
...@@ -188,13 +186,11 @@ powertecscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp) ...@@ -188,13 +186,11 @@ powertecscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
const char *powertecscsi_info(struct Scsi_Host *host) const char *powertecscsi_info(struct Scsi_Host *host)
{ {
struct powertec_info *info = (struct powertec_info *)host->hostdata; struct powertec_info *info = (struct powertec_info *)host->hostdata;
static char string[100], *p; static char string[150];
p = string; sprintf(string, "%s (%s) in slot %d v%s terminators o%s",
p += sprintf(p, "%s ", host->hostt->name); host->hostt->name, info->info.scsi.type, info->ec->slot_no,
p += fas216_info(&info->info, p); VERSION, info->term_ctl ? "n" : "ff");
p += sprintf(p, "v%s terminators o%s",
VERSION, info->term_ctl ? "n" : "ff");
return string; return string;
} }
...@@ -262,7 +258,6 @@ int powertecscsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -262,7 +258,6 @@ int powertecscsi_proc_info(char *buffer, char **start, off_t offset,
begin = 0; begin = 0;
pos = sprintf(buffer, "PowerTec SCSI driver v%s\n", VERSION); pos = sprintf(buffer, "PowerTec SCSI driver v%s\n", VERSION);
pos += fas216_print_host(&info->info, buffer + pos); pos += fas216_print_host(&info->info, buffer + pos);
pos += sprintf(buffer + pos, "Term : o%s\n", pos += sprintf(buffer + pos, "Term : o%s\n",
info->term_ctl ? "n" : "ff"); info->term_ctl ? "n" : "ff");
...@@ -290,6 +285,30 @@ int powertecscsi_proc_info(char *buffer, char **start, off_t offset, ...@@ -290,6 +285,30 @@ int powertecscsi_proc_info(char *buffer, char **start, off_t offset,
return pos; return pos;
} }
static ssize_t powertecscsi_show_term(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
struct Scsi_Host *host = ecard_get_drvdata(ec);
struct powertec_info *info = (struct powertec_info *)host->hostdata;
return sprintf(buf, "%d\n", info->term_ctl ? 1 : 0);
}
static ssize_t
powertecscsi_store_term(struct device *dev, const char *buf, size_t len)
{
struct expansion_card *ec = ECARD_DEV(dev);
struct Scsi_Host *host = ecard_get_drvdata(ec);
if (len > 1)
powertecscsi_terminator_ctl(host, buf[0] != '0');
return len;
}
static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
powertecscsi_show_term, powertecscsi_store_term);
static Scsi_Host_Template powertecscsi_template = { static Scsi_Host_Template powertecscsi_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_info = powertecscsi_proc_info, .proc_info = powertecscsi_proc_info,
...@@ -302,10 +321,10 @@ static Scsi_Host_Template powertecscsi_template = { ...@@ -302,10 +321,10 @@ static Scsi_Host_Template powertecscsi_template = {
.eh_device_reset_handler = fas216_eh_device_reset, .eh_device_reset_handler = fas216_eh_device_reset,
.eh_abort_handler = fas216_eh_abort, .eh_abort_handler = fas216_eh_abort,
.can_queue = 1, .can_queue = 8,
.this_id = 7, .this_id = 7,
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
.cmd_per_lun = 1, .cmd_per_lun = 2,
.use_clustering = ENABLE_CLUSTERING, .use_clustering = ENABLE_CLUSTERING,
.proc_name = "powertec", .proc_name = "powertec",
}; };
...@@ -314,37 +333,50 @@ static int __devinit ...@@ -314,37 +333,50 @@ static int __devinit
powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct Scsi_Host *host; struct Scsi_Host *host;
struct powertec_info *info; struct powertec_info *info;
int ret = -ENOMEM; unsigned long resbase, reslen;
unsigned char *base;
int ret;
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
if (!request_mem_region(resbase, reslen, "powertecscsi")) {
ret = -EBUSY;
goto out;
}
base = ioremap(resbase, reslen);
if (!base) {
ret = -ENOMEM;
goto out_region;
}
host = scsi_register(&powertecscsi_template, host = scsi_register(&powertecscsi_template,
sizeof (struct powertec_info)); sizeof (struct powertec_info));
if (!host) if (!host) {
goto out; ret = -ENOMEM;
goto out_unmap;
}
host->io_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); host->base = (unsigned long)base;
host->irq = ec->irq; host->irq = ec->irq;
host->dma_channel = ec->dma; host->dma_channel = ec->dma;
if (!request_region(host->io_port + POWERTEC_FAS216_OFFSET, ec->irqaddr = base + POWERTEC_INTR_STATUS;
POWERTEC_FAS216_SIZE, "powertec2-fas")) {
ret = -EBUSY;
goto out_free;
}
ec->irqaddr = (unsigned char *)
ioaddr(host->io_port + POWERTEC_INTR_STATUS);
ec->irqmask = POWERTEC_INTR_BIT; ec->irqmask = POWERTEC_INTR_BIT;
ec->irq_data = (void *)(host->io_port + POWERTEC_INTR_CONTROL); ec->irq_data = base + POWERTEC_INTR_CONTROL;
ec->ops = (expansioncard_ops_t *)&powertecscsi_ops; ec->ops = &powertecscsi_ops;
ecard_set_drvdata(ec, host); ecard_set_drvdata(ec, host);
info = (struct powertec_info *)host->hostdata; info = (struct powertec_info *)host->hostdata;
info->term_port = host->io_port + POWERTEC_TERM_CONTROL; info->term_port = base + POWERTEC_TERM_CONTROL;
powertecscsi_terminator_ctl(host, term[ec->slot_no]); powertecscsi_terminator_ctl(host, term[ec->slot_no]);
info->info.scsi.io_port = host->io_port + POWERTEC_FAS216_OFFSET; device_create_file(&ec->dev, &dev_attr_bus_term);
info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET;
info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT; info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT;
info->info.scsi.irq = host->irq; info->info.scsi.irq = host->irq;
info->info.ifcfg.clockrate = 40; /* MHz */ info->info.ifcfg.clockrate = 40; /* MHz */
...@@ -354,16 +386,21 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -354,16 +386,21 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK; info->info.ifcfg.cntl3 = CNTL3_BS8 | CNTL3_FASTSCSI | CNTL3_FASTCLK;
info->info.ifcfg.disconnect_ok = 1; info->info.ifcfg.disconnect_ok = 1;
info->info.ifcfg.wide_max_size = 0; info->info.ifcfg.wide_max_size = 0;
info->info.ifcfg.capabilities = 0;
info->info.dma.setup = powertecscsi_dma_setup; info->info.dma.setup = powertecscsi_dma_setup;
info->info.dma.pseudo = NULL; info->info.dma.pseudo = NULL;
info->info.dma.stop = powertecscsi_dma_stop; info->info.dma.stop = powertecscsi_dma_stop;
ret = fas216_init(host);
if (ret)
goto out_free;
ret = request_irq(host->irq, powertecscsi_intr, ret = request_irq(host->irq, powertecscsi_intr,
SA_INTERRUPT, "powertec", host); SA_INTERRUPT, "powertec", info);
if (ret) { if (ret) {
printk("scsi%d: IRQ%d not free: %d\n", printk("scsi%d: IRQ%d not free: %d\n",
host->host_no, host->irq, ret); host->host_no, host->irq, ret);
goto out_region; goto out_release;
} }
if (host->dma_channel != NO_DMA) { if (host->dma_channel != NO_DMA) {
...@@ -373,26 +410,31 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -373,26 +410,31 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
host->dma_channel = NO_DMA; host->dma_channel = NO_DMA;
} else { } else {
set_dma_speed(host->dma_channel, 180); set_dma_speed(host->dma_channel, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
} }
} }
fas216_init(host); ret = fas216_add(host, &ec->dev);
ret = scsi_add_host(host, &ec->dev);
if (ret == 0) if (ret == 0)
goto out; goto out;
fas216_release(host);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, host);
out_region:
release_region(host->io_port + POWERTEC_FAS216_OFFSET, out_release:
POWERTEC_FAS216_SIZE); fas216_release(host);
out_free: out_free:
device_remove_file(&ec->dev, &dev_attr_bus_term);
scsi_unregister(host); scsi_unregister(host);
out_unmap:
iounmap(base);
out_region:
release_mem_region(resbase, reslen);
out: out:
return ret; return ret;
} }
...@@ -400,16 +442,26 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -400,16 +442,26 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit powertecscsi_remove(struct expansion_card *ec) static void __devexit powertecscsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct powertecscsi_info *info = (struct powertecscsi_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
scsi_remove_host(host); fas216_remove(host);
fas216_release(host);
device_remove_file(&ec->dev, &dev_attr_bus_term);
if (host->dma_channel != NO_DMA) if (host->dma_channel != NO_DMA)
free_dma(host->dma_channel); free_dma(host->dma_channel);
free_irq(host->irq, host); free_irq(host->irq, info);
release_region(host->io_port + POWERTEC_FAS216_OFFSET,
POWERTEC_FAS216_SIZE); iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
release_mem_region(resbase, reslen);
fas216_release(host);
scsi_unregister(host); scsi_unregister(host);
} }
...@@ -423,7 +475,8 @@ static struct ecard_driver powertecscsi_driver = { ...@@ -423,7 +475,8 @@ static struct ecard_driver powertecscsi_driver = {
.remove = __devexit_p(powertecscsi_remove), .remove = __devexit_p(powertecscsi_remove),
.id_table = powertecscsi_cids, .id_table = powertecscsi_cids,
.drv = { .drv = {
.name = "powertecscsi", .devclass = &shost_devclass,
.name = "powertecscsi",
}, },
}; };
......
...@@ -55,8 +55,6 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp) ...@@ -55,8 +55,6 @@ static inline unsigned char get_next_SCp_byte(Scsi_Pointer *SCp)
SCp->ptr += 1; SCp->ptr += 1;
SCp->this_residual -= 1; SCp->this_residual -= 1;
if (SCp->this_residual == 0)
next_SCp(SCp);
return c; return c;
} }
...@@ -66,8 +64,6 @@ static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c) ...@@ -66,8 +64,6 @@ static inline void put_next_SCp_byte(Scsi_Pointer *SCp, unsigned char c)
*SCp->ptr = c; *SCp->ptr = c;
SCp->ptr += 1; SCp->ptr += 1;
SCp->this_residual -= 1; SCp->this_residual -= 1;
if (SCp->this_residual == 0)
next_SCp(SCp);
} }
static inline void init_SCp(Scsi_Cmnd *SCpnt) static inline void init_SCp(Scsi_Cmnd *SCpnt)
...@@ -112,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt) ...@@ -112,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt)
* we aren't interested in the buffer pointer. * we aren't interested in the buffer pointer.
*/ */
if (SCpnt->SCp.this_residual == 0 && SCpnt->SCp.ptr) { if (SCpnt->SCp.this_residual == 0 && SCpnt->SCp.ptr) {
#ifdef BELT_AND_BRACES #if 0 //def BELT_AND_BRACES
printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for "
"command ", SCpnt->host->host_no, '0' + SCpnt->target); "command ", SCpnt->host->host_no, '0' + SCpnt->target);
print_command(SCpnt->cmnd); print_command(SCpnt->cmnd);
......
...@@ -88,7 +88,7 @@ static int __init rpcmouse_init(void) ...@@ -88,7 +88,7 @@ static int __init rpcmouse_init(void)
input_register_device(&rpcmouse_dev); input_register_device(&rpcmouse_dev);
printk(KERN_INFO "input: Acorn RiscPC mouse irq %d", IRQ_VSYNCPULSE); printk(KERN_INFO "input: Acorn RiscPC mouse\n");
return 0; return 0;
} }
......
...@@ -512,6 +512,37 @@ static void h3xxx_set_vpp(struct map_info *map, int vpp) ...@@ -512,6 +512,37 @@ static void h3xxx_set_vpp(struct map_info *map, int vpp)
#define h3xxx_set_vpp NULL #define h3xxx_set_vpp NULL
#endif #endif
#ifdef CONFIG_SA1100_HACKKIT
static struct mtd_partition hackkit_partitions[] = {
{
.name = "BLOB",
.size = 0x00040000,
.offset = 0x00000000,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}, {
.name = "config",
.size = 0x00040000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "kernel",
.size = 0x00100000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "initrd",
.size = 0x00180000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "rootfs",
.size = 0x700000,
.offset = MTDPART_OFS_APPEND,
}, {
.name = "data",
.size = MTDPART_SIZ_FULL,
.offset = MTDPART_OFS_APPEND,
}
};
#endif
#ifdef CONFIG_SA1100_HUW_WEBPANEL #ifdef CONFIG_SA1100_HUW_WEBPANEL
static struct mtd_partition huw_webpanel_partitions[] = { static struct mtd_partition huw_webpanel_partitions[] = {
{ {
...@@ -849,6 +880,12 @@ static int __init sa1100_static_partitions(struct mtd_partition **parts) ...@@ -849,6 +880,12 @@ static int __init sa1100_static_partitions(struct mtd_partition **parts)
nb_parts = ARRAY_SIZE(h3xxx_partitions); nb_parts = ARRAY_SIZE(h3xxx_partitions);
} }
#endif #endif
#ifdef CONFIG_SA1100_HACKKIT
if (machine_is_hackkit()) {
*parts = hackkit_partitions;
nb_parts = ARRAY_SIZE(hackkit_partitions);
}
#endif
#ifdef CONFIG_SA1100_HUW_WEBPANEL #ifdef CONFIG_SA1100_HUW_WEBPANEL
if (machine_is_huw_webpanel()) { if (machine_is_huw_webpanel()) {
*parts = huw_webpanel_partitions; *parts = huw_webpanel_partitions;
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/hardware.h> // included trizeps.h #include <asm/hardware.h>
#include <asm/arch/trizeps.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -54,7 +55,7 @@ static int trizeps_pcmcia_init(struct pcmcia_init *init) ...@@ -54,7 +55,7 @@ static int trizeps_pcmcia_init(struct pcmcia_init *init)
return NUMBER_OF_TRIZEPS_PCMCIA_SLOTS; return NUMBER_OF_TRIZEPS_PCMCIA_SLOTS;
irq_err: irq_err:
printk( KERN_ERR __FUNCTION__ ": PCMCIA Request for IRQ %u failed\n", TRIZEPS_IRQ_PCMCIA_CD0 ); printk( KERN_ERR "%s(): PCMCIA Request for IRQ %u failed\n", __FUNCTION__, TRIZEPS_IRQ_PCMCIA_CD0 );
return -1; return -1;
} }
......
/* /*
* linux/drivers/char/uart00.c * linux/drivers/serial/uart00.c
* *
* Driver for UART00 serial ports * Driver for UART00 serial ports
* *
...@@ -149,7 +149,7 @@ uart00_rx_chars(struct uart_port *port, struct pt_regs *regs) ...@@ -149,7 +149,7 @@ uart00_rx_chars(struct uart_port *port, struct pt_regs *regs)
goto ignore_char; goto ignore_char;
} else if (rds & UART_RDS_PE_MSK) } else if (rds & UART_RDS_PE_MSK)
port->icount.parity++; port->icount.parity++;
else if (rds & UART_RDS_PE_MSK) else if (rds & UART_RDS_FE_MSK)
port->icount.frame++; port->icount.frame++;
if (rds & UART_RDS_OE_MSK) if (rds & UART_RDS_OE_MSK)
port->icount.overrun++; port->icount.overrun++;
...@@ -168,7 +168,7 @@ uart00_rx_chars(struct uart_port *port, struct pt_regs *regs) ...@@ -168,7 +168,7 @@ uart00_rx_chars(struct uart_port *port, struct pt_regs *regs)
else if (rds & UART_RDS_FE_MSK) else if (rds & UART_RDS_FE_MSK)
flg = TTY_FRAME; flg = TTY_FRAME;
if (status & UART_RDS_OE_MSK) { if (rds & UART_RDS_OE_MSK) {
/* /*
* CHECK: does overrun affect the current character? * CHECK: does overrun affect the current character?
* ASSUMPTION: it does not. * ASSUMPTION: it does not.
......
...@@ -896,6 +896,7 @@ static struct fb_ops acornfb_ops = { ...@@ -896,6 +896,7 @@ static struct fb_ops acornfb_ops = {
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_mmap = acornfb_mmap, .fb_mmap = acornfb_mmap,
.fb_cursor = soft_cursor,
}; };
/* /*
......
...@@ -1122,6 +1122,7 @@ static struct fb_ops sa1100fb_ops = { ...@@ -1122,6 +1122,7 @@ static struct fb_ops sa1100fb_ops = {
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_blank = sa1100fb_blank, .fb_blank = sa1100fb_blank,
.fb_cursor = soft_cursor,
}; };
/* /*
......
/* /*
* linux/include/asm-arm/arch-ebsa110/param.h * linux/include/asm-arm/arch-ebsa110/param.h
*/ */
#define __KERNEL_HZ 200
...@@ -17,17 +17,80 @@ ...@@ -17,17 +17,80 @@
*/ */
#include <asm/leds.h> #include <asm/leds.h>
#include <asm/io.h>
extern int ebsa110_reset_timer(void); extern unsigned long (*gettimeoffset)(void);
extern void ebsa110_setup_timer(void);
#define PIT_CTRL (PIT_BASE + 0x0d)
#define PIT_T2 (PIT_BASE + 0x09)
#define PIT_T1 (PIT_BASE + 0x05)
#define PIT_T0 (PIT_BASE + 0x01)
/*
* This is the rate at which your MCLK signal toggles (in Hz)
* This was measured on a 10 digit frequency counter sampling
* over 1 second.
*/
#define MCLK 47894000
/*
* This is the rate at which the PIT timers get clocked
*/
#define CLKBY7 (MCLK / 7)
/*
* This is the counter value. We tick at 200Hz on this platform.
*/
#define COUNT ((CLKBY7 + (HZ / 2)) / HZ)
/*
* Get the time offset from the system PIT. Note that if we have missed an
* interrupt, then the PIT counter will roll over (ie, be negative).
* This actually works out to be convenient.
*/
static unsigned long ebsa110_gettimeoffset(void)
{
unsigned long offset, count;
__raw_writeb(0x40, PIT_CTRL);
count = __raw_readb(PIT_T1);
count |= __raw_readb(PIT_T1) << 8;
/*
* If count > COUNT, make the number negative.
*/
if (count > COUNT)
count |= 0xffff0000;
offset = COUNT;
offset -= count;
/*
* `offset' is in units of timer counts. Convert
* offset to units of microseconds.
*/
offset = offset * (1000000 / HZ) / COUNT;
return offset;
}
static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
if (ebsa110_reset_timer()) { u32 count;
do_leds();
do_timer(regs); /* latch and read timer 1 */
do_profile(regs); __raw_writeb(0x40, PIT_CTRL);
} count = __raw_readb(PIT_T1);
count |= __raw_readb(PIT_T1) << 8;
count += COUNT;
__raw_writeb(count & 0xff, PIT_T1);
__raw_writeb(count >> 8, PIT_T1);
do_leds();
do_timer(regs);
do_profile(regs);
} }
/* /*
...@@ -35,7 +98,14 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -35,7 +98,14 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*/ */
void __init time_init(void) void __init time_init(void)
{ {
ebsa110_setup_timer(); /*
* Timer 1, mode 2, LSB/MSB
*/
__raw_writeb(0x70, PIT_CTRL);
__raw_writeb(COUNT & 0xff, PIT_T1);
__raw_writeb(COUNT >> 8, PIT_T1);
gettimeoffset = ebsa110_gettimeoffset;
timer_irq.handler = timer_interrupt; timer_irq.handler = timer_interrupt;
......
...@@ -63,6 +63,17 @@ ...@@ -63,6 +63,17 @@
#define IO_EC_MEMC8_BASE 0x8000ac00 #define IO_EC_MEMC8_BASE 0x8000ac00
#define IO_EC_MEMC_BASE 0x80000000 #define IO_EC_MEMC_BASE 0x80000000
#define NETSLOT_BASE 0x0302b000
#define NETSLOT_SIZE 0x00001000
#define PODSLOT_IOC0_BASE 0x03240000
#define PODSLOT_IOC4_BASE 0x03270000
#define PODSLOT_IOC_SIZE (1 << 14)
#define PODSLOT_MEMC_BASE 0x03000000
#define PODSLOT_MEMC_SIZE (1 << 14)
#define PODSLOT_EASI_BASE 0x08000000
#define PODSLOT_EASI_SIZE (1 << 24)
#define EXPMASK_STATUS (EXPMASK_BASE + 0x00) #define EXPMASK_STATUS (EXPMASK_BASE + 0x00)
#define EXPMASK_ENABLE (EXPMASK_BASE + 0x04) #define EXPMASK_ENABLE (EXPMASK_BASE + 0x04)
......
...@@ -247,4 +247,9 @@ DECLARE_IO(int,l,"") ...@@ -247,4 +247,9 @@ DECLARE_IO(int,l,"")
#define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l) #define outsb(p,d,l) __raw_writesb(__ioaddr(p),d,l)
#define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l) #define outsw(p,d,l) __raw_writesw(__ioaddr(p),d,l)
/*
* 1:1 mapping for ioremapped regions.
*/
#define __mem_pci(x) (x)
#endif #endif
...@@ -49,8 +49,9 @@ ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq) ...@@ -49,8 +49,9 @@ ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
*irq = 0; *irq = 0;
} }
#ifdef CONFIG_SA1100_TRIZEPS
#include <asm/arch/trizeps.h>
#endif
/* /*
* This registers the standard ports for this architecture with the IDE * This registers the standard ports for this architecture with the IDE
...@@ -124,6 +125,23 @@ ide_init_default_hwifs(void) ...@@ -124,6 +125,23 @@ ide_init_default_hwifs(void)
ide_register_hw(&hw); ide_register_hw(&hw);
#endif #endif
} }
} else if( machine_is_trizeps() ){
#ifdef CONFIG_SA1100_TRIZEPS
hw_regs_t hw;
/* Enable appropriate GPIOs as interrupt lines */
GPDR &= ~GPIO_GPIO(TRIZEPS_IRQ_IDE);
set_irq_type( TRIZEPS_IRQ_IDE, IRQT_RISING );
/* set the pcmcia interface timing */
//MECR = 0x00060006; // Done on trizeps init
/* Take hard drives out of reset */
GPSR = GPIO_GPIO(TRIZEPS_IRQ_IDE);
ide_init_hwif_ports(&hw, TRIZEPS_IDE_CS0 + 0, TRIZEPS_IDE_CS1 + 6, NULL);
hw.irq = TRIZEPS_IRQ_IDE;
ide_register_hw(&hw, NULL);
#endif
}
}
#ifndef _ARCH_ARM_MFTB2_h_
#define _ARCH_ARM_MFTB2_h_
// Defines for arch/arm/mm/mm-sa1100.h
#define TRIZEPS_PHYS_VIRT_MAP_SIZE 0x00800000l
// physical address (only for mm-sa1100.h)
#define TRIZEPS_PHYS_IO_BASE 0x30000000l
#define TRIZEPS_PHYS_MEM_BASE 0x38000000l
// virtual
#define TRIZEPS_IO_BASE 0xF0000000l
#define TRIZEPS_MEM_BASE 0xF2000000l
// Offsets for phys and virtual
#define TRIZEPS_OFFSET_REG0 0x00300000l
#define TRIZEPS_OFFSET_REG1 0x00380000l
#define TRIZEPS_OFFSET_IDE_CS0 0x00000000l
#define TRIZEPS_OFFSET_IDE_CS1 0x00080000l
#define TRIZEPS_OFFSET_UART5 0x00100000l
#define TRIZEPS_OFFSET_UART6 0x00180000l
#define TRIZEPS_PHYS_REG0 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_REG0)
#define TRIZEPS_PHYS_REG1 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_REG1)
#define TRIZEPS_PHYS_IDE_CS0 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_IDE_CS0)
#define TRIZEPS_PHYS_IDE_CS1 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_IDE_CS1)
#define TRIZEPS_PHYS_UART5 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_UART5)
#define TRIZEPS_PHYS_UART6 (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_UART6)
// Use follow defines in devices
// virtual address
#define TRIZEPS_REG0 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_REG0)
#define TRIZEPS_REG1 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_REG1)
#define TRIZEPS_IDE_CS0 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_IDE_CS0)
#define TRIZEPS_IDE_CS1 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_IDE_CS1)
#define TRIZEPS_UART5 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_UART5)
#define TRIZEPS_UART6 (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_UART6)
#define TRIZEPS_BAUD_BASE 1500000
//#if 0 //temporarily disabled
#ifndef __ASSEMBLY__
struct tri_uart_cts_data_t {
int cts_gpio;
int cts_prev_state;
struct uart_info *info;
struct uart_port *port;
const char *name;
};
#endif /* __ASSEMBLY__ */
/* Defines for MFTB2 serial_sa1100.c hardware handshaking lines */
#define SERIAL_FULL
#define NOT_CONNECTED 0
#ifdef SERIAL_FULL
#define TRIZEPS_GPIO_UART1_RTS GPIO_GPIO14
#define TRIZEPS_GPIO_UART1_DTR NOT_CONNECTED //GPIO_GPIO9
#define TRIZEPS_GPIO_UART1_CTS GPIO_GPIO15
#define TRIZEPS_GPIO_UART1_DCD NOT_CONNECTED //GPIO_GPIO2
#define TRIZEPS_GPIO_UART1_DSR NOT_CONNECTED //GPIO_GPIO3
#define TRIZEPS_GPIO_UART3_RTS NOT_CONNECTED //GPIO_GPIO7
#define TRIZEPS_GPIO_UART3_DTR NOT_CONNECTED //GPIO_GPIO8
#define TRIZEPS_GPIO_UART3_CTS NOT_CONNECTED //GPIO_GPIO4
#define TRIZEPS_GPIO_UART3_DCD NOT_CONNECTED //GPIO_GPIO5
#define TRIZEPS_GPIO_UART3_DSR NOT_CONNECTED //GPIO_GPIO6
#define TRIZEPS_GPIO_UART2_RTS NOT_CONNECTED //GPIO_GPIO7
#define TRIZEPS_GPIO_UART2_DTR NOT_CONNECTED //GPIO_GPIO8
#define TRIZEPS_GPIO_UART2_CTS NOT_CONNECTED //GPIO_GPIO4
#define TRIZEPS_GPIO_UART2_DCD NOT_CONNECTED //GPIO_GPIO5
#define TRIZEPS_GPIO_UART2_DSR NOT_CONNECTED //GPIO_GPIO6
#define TRIZEPS_IRQ_UART1_CTS IRQ_GPIO15
#define TRIZEPS_IRQ_UART1_DCD NO_IRQ //IRQ_GPIO2
#define TRIZEPS_IRQ_UART1_DSR NO_IRQ //IRQ_GPIO3
#define TRIZEPS_IRQ_UART3_CTS NO_IRQ //IRQ_GPIO4
#define TRIZEPS_IRQ_UART3_DCD NO_IRQ //IRQ_GPIO5
#define TRIZEPS_IRQ_UART3_DSR NO_IRQ //IRQ_GPIO6
#define TRIZEPS_IRQ_UART2_CTS NO_IRQ //IRQ_GPIO4
#define TRIZEPS_IRQ_UART2_DCD NO_IRQ //IRQ_GPIO5
#define TRIZEPS_IRQ_UART2_DSR NO_IRQ //IRQ_GPIO6
#endif /* SERIAL_FULL */
//#endif //0
/*
* This section contains the defines for the MFTB2 implementation
* of drivers/ide/hd.c. HD_IOBASE_0 and HD_IOBASE_1 have to be
* adjusted if hardware changes.
*/
#define TRIZEPS_IRQ_IDE 10 /* MFTB2 specific */
/*--- ROOT ---*/
#define TRIZEPS_GPIO_ROOT_NFS 0
#define TRIZEPS_GPIO_ROOT_HD 21
/*--- PCMCIA ---*/
#define TRIZEPS_GPIO_PCMCIA_IRQ0 1
#define TRIZEPS_GPIO_PCMCIA_CD0 24
#define TRIZEPS_IRQ_PCMCIA_IRQ0 TRIZEPS_GPIO_PCMCIA_IRQ0
#define TRIZEPS_IRQ_PCMCIA_CD0 TRIZEPS_GPIO_PCMCIA_CD0 + 32 - 11
// REGISTER 0 -> 0x0XXXX (16bit access)
// read only
#define TRIZEPS_A_STAT 0x8000l
#define TRIZEPS_F_STAT 0x4000l
#define TRIZEPS_BATT_FAULT_EN 0x2000l
#define TRIZEPS_nDQ 0x1000l
#define TRIZEPS_MFT_OFF 0x0800l
#define TRIZEPS_D_APWOFF 0x0400l
#define TRIZEPS_F_CTRL 0x0200l
#define TRIZEPS_F_STOP 0x0100l
// read / write
#define TRIZEPS_KP_IR_EN 0x0080l
#define TRIZEPS_FIR 0x0040l
#define TRIZEPS_BAR_ON 0x0020l
#define TRIZEPS_VCI_ON 0x0010l
#define TRIZEPS_LED4 0x0008l
#define TRIZEPS_LED3 0x0004l
#define TRIZEPS_LED2 0x0002l
#define TRIZEPS_LED1 0x0001l
// REGISTER 1 -> 0x1XXXX (16bit access)
// read only
#define TRIZEPS_nVCI2 0x8000l
#define TRIZEPS_nAB_LOW 0x4000l
#define TRIZEPS_nMB_DEAD 0x2000l
#define TRIZEPS_nMB_LOW 0x1000l
#define TRIZEPS_nPCM_VS2 0x0800l
#define TRIZEPS_nPCM_VS1 0x0400l
#define TRIZEPS_PCM_BVD2 0x0200l
#define TRIZEPS_PCM_BVD1 0x0100l
// read / write
#define TRIZEPS_nROOT_NFS 0x0080l
#define TRIZEPS_nROOT_HD 0x0040l
#define TRIZEPS_nPCM_ENA_REG 0x0020l
#define TRIZEPS_nPCM_RESET_DISABLE 0x0010l
#define TRIZEPS_PCM_EN0_REG 0x0008l
#define TRIZEPS_PCM_EN1_REG 0x0004l
#define TRIZEPS_PCM_V3_EN_REG 0x0002l
#define TRIZEPS_PCM_V5_EN_REG 0x0001l
/* Access to Board Control Register */
#define TRIZEPS_BCR0 (*(volatile unsigned short *)(TRIZEPS_REG0))
#define TRIZEPS_BCR1 (*(volatile unsigned short *)(TRIZEPS_REG1))
#define TRIZEPS_BCR_set( reg, x ) do { \
unsigned long flags; \
local_irq_save(flags); \
(reg) |= (x); \
local_irq_restore(flags); \
} while (0)
#define TRIZEPS_BCR_clear( reg, x ) do { \
unsigned long flags; \
local_irq_save(flags); \
(reg) &= ~(x); \
local_irq_restore(flags); \
} while (0)
#define TRIZEPS_OFFSET_KP_REG 0x00200000l
#define TRIZEPS_OFFSET_VCI2 0x00280000l
#define TRIZEPS_OFFSET_VCI4 0x00400000l
#define TRIZEPS_OFFSET_VCI2_1_DPR (TRIZEPS_OFFSET_VCI2 + 0x00010000l)
#define TRIZEPS_OFFSET_VCI2_2_DPR (TRIZEPS_OFFSET_VCI2 + 0x00018000l)
#define TRIZEPS_OFFSET_VCI2_1_SEMA (TRIZEPS_OFFSET_VCI2 + 0x00020000l)
#define TRIZEPS_OFFSET_VCI2_2_SEMA (TRIZEPS_OFFSET_VCI2 + 0x00028000l)
#define TRIZEPS_OFFSET_VCI4_1_DPR (TRIZEPS_OFFSET_VCI4 + 0x00000000l)
#define TRIZEPS_OFFSET_VCI4_2_DPR (TRIZEPS_OFFSET_VCI4 + 0x00008000l)
#define TRIZEPS_OFFSET_VCI4_1_SEMA (TRIZEPS_OFFSET_VCI4 + 0x00000380l)
#define TRIZEPS_OFFSET_VCI4_2_SEMA (TRIZEPS_OFFSET_VCI4 + 0x00000388l)
#define TRIZEPS_OFFSET_VCI4_1_CNTR (TRIZEPS_OFFSET_VCI4 + 0x00000390l)
#define TRIZEPS_OFFSET_VCI4_2_CNTR (TRIZEPS_OFFSET_VCI4 + 0x00000392l)
#define TRIZEPS_PHYS_KP_REG (PHYS_TRIZEPS_IO_BASE + TRIZEPS_OFFSET_KP_REG)
// VCI address
#define TRIZEPS_PHYS_VCI2_1_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_DPR)
#define TRIZEPS_PHYS_VCI2_2_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_DPR)
#define TRIZEPS_PHYS_VCI2_1_SEMA (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_SEMA)
#define TRIZEPS_PHYS_VCI2_2_SEMA (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_SEMA)
// VCI4 address
#define TRIZEPS_PHYS_VCI4_1_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI4_1_DPR)
#define TRIZEPS_PHYS_VCI4_2_DPR (TRIZEPS_PHYS_MEM_BASE + TRIZEPS_OFFSET_VCI4_2_DPR)
#define TRIZEPS_PHYS_VCI4_1_SEMA (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_SEMA)
#define TRIZEPS_PHYS_VCI4_2_SEMA (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_SEMA)
#define TRIZEPS_PHYS_VCI4_1_CNTR (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_CNTR)
#define TRIZEPS_PHYS_VCI4_2_CNTR (TRIZEPS_PHYS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_CNTR)
#define TRIZEPS_KP_REG (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_KP_REG)
// VCI address
#define TRIZEPS_VCI2_1_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_DPR)
#define TRIZEPS_VCI2_2_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_DPR)
#define TRIZEPS_VCI2_1_SEMA (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_1_SEMA)
#define TRIZEPS_VCI2_2_SEMA (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI2_2_SEMA)
// VCI4 address
#define TRIZEPS_VCI4_1_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI4_1_DPR)
#define TRIZEPS_VCI4_2_DPR (TRIZEPS_MEM_BASE + TRIZEPS_OFFSET_VCI4_2_DPR)
#define TRIZEPS_VCI4_1_SEMA (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_SEMA)
#define TRIZEPS_VCI4_2_SEMA (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_SEMA)
#define TRIZEPS_VCI4_1_CNTR (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_1_CNTR)
#define TRIZEPS_VCI4_2_CNTR (TRIZEPS_IO_BASE + TRIZEPS_OFFSET_VCI4_2_CNTR)
#endif
/*
* linux/include/asm-arm/arch-sa1100/trizeps.h
*
* This file contains the hardware specific definitions for Trizeps
*
* Authors:
* Andreas Hofer <ho@dsa-ac.de>,
* Peter Lueg <pl@dsa-ac.de>,
* Guennadi Liakhovetski <gl@dsa-ac.de>
*
*/
#ifndef _ASM_ARCH_TRIZEPS_H_
#define _ASM_ARCH_TRIZEPS_H_
#ifdef CONFIG_TRIZEPS_MFTB2
#include "mftb2.h"
#endif
#endif // _INCLUDE_TRIZEPS_
...@@ -18,3 +18,4 @@ extern volatile void __bug(const char *file, int line, void *data); ...@@ -18,3 +18,4 @@ extern volatile void __bug(const char *file, int line, void *data);
#endif #endif
#endif
...@@ -130,6 +130,20 @@ typedef struct { /* Card handler routines */ ...@@ -130,6 +130,20 @@ typedef struct { /* Card handler routines */
int (*fiqpending)(ecard_t *ec); int (*fiqpending)(ecard_t *ec);
} expansioncard_ops_t; } expansioncard_ops_t;
#define ECARD_NUM_RESOURCES (6)
#define ECARD_RES_IOCSLOW (0)
#define ECARD_RES_IOCMEDIUM (1)
#define ECARD_RES_IOCFAST (2)
#define ECARD_RES_IOCSYNC (3)
#define ECARD_RES_MEMC (4)
#define ECARD_RES_EASI (5)
#define ecard_resource_start(ec,nr) ((ec)->resource[nr].start)
#define ecard_resource_end(ec,nr) ((ec)->resource[nr].end)
#define ecard_resource_len(ec,nr) ((ec)->resource[nr].end - \
(ec)->resource[nr].start + 1)
/* /*
* This contains all the info needed on an expansion card * This contains all the info needed on an expansion card
*/ */
...@@ -137,6 +151,7 @@ struct expansion_card { ...@@ -137,6 +151,7 @@ struct expansion_card {
struct expansion_card *next; struct expansion_card *next;
struct device dev; struct device dev;
struct resource resource[ECARD_NUM_RESOURCES];
/* Public data */ /* Public data */
volatile unsigned char *irqaddr; /* address of IRQ register */ volatile unsigned char *irqaddr; /* address of IRQ register */
...@@ -147,7 +162,7 @@ struct expansion_card { ...@@ -147,7 +162,7 @@ struct expansion_card {
void *irq_data; /* Data for use for IRQ by card */ void *irq_data; /* Data for use for IRQ by card */
void *fiq_data; /* Data for use for FIQ by card */ void *fiq_data; /* Data for use for FIQ by card */
expansioncard_ops_t *ops; /* Enable/Disable Ops for card */ const expansioncard_ops_t *ops; /* Enable/Disable Ops for card */
CONST unsigned int slot_no; /* Slot number */ CONST unsigned int slot_no; /* Slot number */
CONST unsigned int dma; /* DMA number (for request_dma) */ CONST unsigned int dma; /* DMA number (for request_dma) */
......
...@@ -150,10 +150,18 @@ extern void _memset_io(unsigned long, int, size_t); ...@@ -150,10 +150,18 @@ extern void _memset_io(unsigned long, int, size_t);
#define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; }) #define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; })
#define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; }) #define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; })
#define readsb(p,d,l) __raw_readsb((unsigned int)__mem_pci(p),d,l)
#define readsw(p,d,l) __raw_readsw((unsigned int)__mem_pci(p),d,l)
#define readsl(p,d,l) __raw_readsl((unsigned int)__mem_pci(p),d,l)
#define writeb(v,c) __raw_writeb(v,__mem_pci(c)) #define writeb(v,c) __raw_writeb(v,__mem_pci(c))
#define writew(v,c) __raw_writew(cpu_to_le16(v),__mem_pci(c)) #define writew(v,c) __raw_writew(cpu_to_le16(v),__mem_pci(c))
#define writel(v,c) __raw_writel(cpu_to_le32(v),__mem_pci(c)) #define writel(v,c) __raw_writel(cpu_to_le32(v),__mem_pci(c))
#define writesb(p,d,l) __raw_writesb((unsigned int)__mem_pci(p),d,l)
#define writesw(p,d,l) __raw_writesw((unsigned int)__mem_pci(p),d,l)
#define writesl(p,d,l) __raw_writesl((unsigned int)__mem_pci(p),d,l)
#define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l)) #define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l))
#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) #define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) #define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
......
...@@ -50,8 +50,8 @@ struct irqdesc { ...@@ -50,8 +50,8 @@ struct irqdesc {
irq_handler_t handle; irq_handler_t handle;
struct irqchip *chip; struct irqchip *chip;
struct irqaction *action; struct irqaction *action;
unsigned int disable_depth;
unsigned int enabled : 1; /* IRQ is currently enabled */
unsigned int triggered: 1; /* IRQ has occurred */ unsigned int triggered: 1; /* IRQ has occurred */
unsigned int running : 1; /* IRQ is running */ unsigned int running : 1; /* IRQ is running */
unsigned int pending : 1; /* IRQ is pending */ unsigned int pending : 1; /* IRQ is pending */
...@@ -59,8 +59,7 @@ struct irqdesc { ...@@ -59,8 +59,7 @@ struct irqdesc {
unsigned int probe_ok : 1; /* IRQ can be used for probe */ unsigned int probe_ok : 1; /* IRQ can be used for probe */
unsigned int valid : 1; /* IRQ claimable */ unsigned int valid : 1; /* IRQ claimable */
unsigned int noautoenable : 1; /* don't automatically enable IRQ */ unsigned int noautoenable : 1; /* don't automatically enable IRQ */
unsigned int unused :23; unsigned int unused :25;
unsigned int depth; /* disable depth */
/* /*
* IRQ lock detection * IRQ lock detection
......
...@@ -10,4 +10,9 @@ struct mod_arch_specific ...@@ -10,4 +10,9 @@ struct mod_arch_specific
#define Elf_Sym Elf32_Sym #define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr #define Elf_Ehdr Elf32_Ehdr
/*
* Include the ARM architecture version.
*/
#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
#endif /* _ASM_ARM_MODULE_H */ #endif /* _ASM_ARM_MODULE_H */
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define KERNEL_STACK_SIZE PAGE_SIZE #define KERNEL_STACK_SIZE PAGE_SIZE
#define INIT_EXTRA_THREAD_INFO \ #define INIT_EXTRA_THREAD_INFO \
cpu_domain: domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \ .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \
domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
domain_val(DOMAIN_IO, DOMAIN_CLIENT) domain_val(DOMAIN_IO, DOMAIN_CLIENT)
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \
}) })
#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019]) #define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1017]) #define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1017])
#endif #endif
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