diff options
author | Koen Kooi <koen@openembedded.org> | 2006-03-02 17:54:35 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-03-02 17:54:35 +0000 |
commit | 40ce95ca64d662c16cec3d1efabc966dda5a2610 (patch) | |
tree | c5687492fbbc7f7e46b8db8448b1da640fef9955 /packages/linux | |
parent | 858ca7bc53e7c03eac036217486e87e36eb1e3e6 (diff) | |
parent | 966f3a94af2c83ffd2c634171fbe04917731b6f9 (diff) |
explicit_merge of '601faaded8a6427e29dc8dc43433fe9be662c96c'
and 'a67386ccbaf4538441ab5d8769e018207ab0c744'
using ancestor '9c1b32d8825be71ddfdcbe3ddfa31b4cc8bb2aa0'
to branch 'org.openembedded.dev'
Diffstat (limited to 'packages/linux')
73 files changed, 15045 insertions, 2010 deletions
diff --git a/packages/linux/LAB-kernel-2.6.13-hh2/.mtn2git_empty b/packages/linux/LAB-kernel-2.6.13-hh2/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/linux/LAB-kernel-2.6.13-hh2/.mtn2git_empty diff --git a/packages/linux/LAB-kernel-2.6.13-hh2/defconfig b/packages/linux/LAB-kernel-2.6.13-hh2/defconfig new file mode 100644 index 0000000000..466c2072f5 --- /dev/null +++ b/packages/linux/LAB-kernel-2.6.13-hh2/defconfig @@ -0,0 +1,1092 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.13-hh1 +# Thu Feb 16 14:58:20 2006 +# +CONFIG_ARM=y +CONFIG_MMU=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +# CONFIG_SWAP is not set +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +# CONFIG_MINIMAL_OOPS is not set +CONFIG_EMBEDDED=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +# CONFIG_SHMEM is not set +CONFIG_USELIB=y +CONFIG_CORE_DUMP=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_TINY_SHMEM=y +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 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_IOP3XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_L7200 is not set +CONFIG_ARCH_PXA=y +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set + +# +# Intel PXA2xx Implementations +# +# CONFIG_ARCH_LUBBOCK is not set +# CONFIG_MACH_MAINSTONE is not set +# CONFIG_ARCH_PXA_IDP is not set +# CONFIG_ARCH_ESERIES is not set +# CONFIG_MACH_A620 is not set +# CONFIG_MACH_A716 is not set +# CONFIG_ARCH_H1900 is not set +CONFIG_ARCH_H2200=y +CONFIG_H2200_PM=y +# CONFIG_ARCH_H3900 is not set +# CONFIG_MACH_H4000 is not set +# CONFIG_MACH_H4700 is not set +# CONFIG_MACH_HX2750 is not set +# CONFIG_ARCH_H5400 is not set +# CONFIG_MACH_HIMALAYA is not set +# CONFIG_ARCH_AXIMX5 is not set +# CONFIG_ARCH_AXIMX3 is not set +# CONFIG_ARCH_ROVERP1 is not set +# CONFIG_ARCH_ROVERP5P is not set +# CONFIG_MACH_XSCALE_PALMLD is not set +# CONFIG_MACH_T3XSCALE is not set +# CONFIG_PXA_SHARPSL is not set +CONFIG_PXA25x=y +CONFIG_PXA_KEYS=y +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set + +# +# Linux As Bootloader +# +CONFIG_LAB=y +# CONFIG_LAB_BOOTSTRAP is not set + +# +# LAB modules +# +CONFIG_LAB_BOOTLOGO=y +CONFIG_LAB_DUMMY=y +CONFIG_LAB_PM=y +CONFIG_LAB_DMESG=y +CONFIG_LAB_DEBUGLOG=y +CONFIG_LAB_DEVMEM=y +CONFIG_LAB_CRC=y +CONFIG_LAB_XMODEM=y +CONFIG_LAB_YMODEM=y +CONFIG_LAB_MTD=y +CONFIG_LAB_ERASEMTD=y +CONFIG_LAB_COPY=y +CONFIG_LAB_COPY_YMODEM=y +CONFIG_LAB_COPY_XMODEM=y +CONFIG_LAB_COPY_FLASH=y +CONFIG_LAB_COPY_NAND=y +CONFIG_LAB_COPY_FS=y +CONFIG_LAB_COPY_BUF=y +# CONFIG_LAB_COPY_DUMMY is not set +CONFIG_LAB_COPY_WRAPPER=y +CONFIG_LAB_INSMOD=y +CONFIG_LAB_RMMOD=y +CONFIG_LAB_MOUNT=y +CONFIG_LAB_MKDIR=y +CONFIG_ARMBOOT=y +CONFIG_ARMBOOT_LBL_SYSCALL=y +CONFIG_LAB_ARMBOOT=y +CONFIG_LAB_NANDDUMP=y +CONFIG_LAB_NANDCHECK=y +CONFIG_LAB_RUN=y + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_XSCALE=y +# CONFIG_CPU_XSCALE_PXA250 is not set +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_TLB_V4WBI=y + +# +# Processor Features +# +# CONFIG_ARM_FASTCALL is not set +CONFIG_ARM_THUMB=y +CONFIG_XSCALE_PMU=y + +# +# Compaq/iPAQ Platforms +# +CONFIG_PXA_IPAQ=y + +# +# XScale-based iPAQ +# +CONFIG_IPAQ_HANDHELD=y + +# +# Compaq/iPAQ Drivers +# + +# +# Compaq/HP iPAQ Drivers +# +CONFIG_IPAQ_CLOCKS=y +# CONFIG_IPAQ_SLEEVE is not set +# CONFIG_IPAQ_SAMCOP is not set +CONFIG_IPAQ_HAMCOP=y +CONFIG_IPAQ_SAMCOP_TOUCHSCREEN=y +CONFIG_IPAQ_SAMCOP_DMA=y +CONFIG_DMABOUNCE=y + +# +# Bus support +# +CONFIG_ISA_DMA_API=y + +# +# PCCARD (PCMCIA/CardBus) support +# +CONFIG_PCCARD=y +# CONFIG_PCMCIA_DEBUG is not set +CONFIG_PCMCIA=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_PCMCIA_IOCTL=y + +# +# PC-card bridges +# +# CONFIG_TCIC is not set +CONFIG_PCMCIA_PXA2XX=y +CONFIG_PCMCIA_H2200=y + +# +# Kernel Features +# +CONFIG_PREEMPT=y +# CONFIG_NO_IDLE_HZ is not set +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_ALIGNMENT_TRAP=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyS0,115200n8 mem=64M" +# CONFIG_XIP_KERNEL is not set + +# +# CPU Frequency scaling +# +# CONFIG_CPU_FREQ is not set + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set +# CONFIG_ARTHUR is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_APM=y + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP 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_FIB_HASH=y +CONFIG_IP_PNP=y +# CONFIG_IP_PNP_DHCP is not set +# CONFIG_IP_PNP_BOOTP is not set +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set +# CONFIG_IPV6 is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set + +# +# IP: Netfilter Configuration +# +# CONFIG_IP_NF_CONNTRACK is not set +# CONFIG_IP_NF_CONNTRACK_MARK is not set +# CONFIG_IP_NF_QUEUE is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_ARPTABLES is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK 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_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_FW_LOADER=y +# CONFIG_DEBUG_DRIVER is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS 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 +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL is not set + +# +# RAM/ROM/Flash chip drivers +# +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_SHARP_SL is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_RAMTD is not set +# CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_VERIFY_WRITE=y +# CONFIG_MTD_NAND_H1900 is not set +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_NAND_HAMCOP=y +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_SHARPSL is not set +# CONFIG_MTD_NAND_NANDSIM is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +CONFIG_BLK_DEV_IDECS=y +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +CONFIG_IDE_GENERIC=y +# CONFIG_IDE_ARM is not set +# CONFIG_BLK_DEV_IDEDMA is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_BLK_DEV_HD is not set + +# +# SCSI device support +# +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set +# CONFIG_HOSTAP is not set + +# +# PCMCIA network device support +# +# CONFIG_NET_PCMCIA is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_KEYBOARD_H2200=y +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT 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_PXA=y +CONFIG_SERIAL_PXA_CONSOLE=y +CONFIG_SERIAL_PXA_COUNT=4 +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ELV is not set +CONFIG_I2C_PXA=y +# CONFIG_I2C_PXA_SLAVE is not set +# CONFIG_I2C_ISA is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_PCA_ISA is not set +# CONFIG_I2C_SENSOR is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_SENSORS_DS1337 is not set +# CONFIG_SENSORS_DS1374 is not set +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_SENSORS_MAX6875 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# L3 serial bus support +# +# CONFIG_L3 is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_SA1100_RTC is not set +# CONFIG_S3C2410_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# + +# +# Hardware Monitoring support +# +# CONFIG_HWMON is not set + +# +# SoC drivers +# +CONFIG_SOC_MQ11XX=y +# CONFIG_SOC_T7L66XB is not set +# CONFIG_SOC_TC6387XB is not set +# CONFIG_SOC_TC6393XB is not set +# CONFIG_HTC_ASIC2 is not set +# CONFIG_HTC_ASIC3 is not set +# CONFIG_SOC_TSC2101 is not set + +# +# Misc devices +# +CONFIG_BATTERY_MONITOR=y +CONFIG_H2200_BATTERY=y + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SOFT_CURSOR=y +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_IMAGEON is not set +# CONFIG_FB_PXA is not set +CONFIG_FB_MQ1100=y +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE is not set + +# +# Logo configuration +# +# CONFIG_LOGO is not set +CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_DEVICE=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_DEVICE=y +CONFIG_BACKLIGHT_H2200=y + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# Dallas's 1-wire bus +# +CONFIG_W1=y +# CONFIG_W1_THERM is not set +# CONFIG_W1_SMEM is not set +CONFIG_W1_SAMCOP=y +CONFIG_W1_SAMCOP_ONE_DEVICE=y +CONFIG_W1_DS2760=y + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB is not set + +# +# USB Gadget Support +# +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG_FILES is not set +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_NET2280 is not set +CONFIG_USB_GADGET_PXA2XX=y +CONFIG_USB_PXA2XX=y +CONFIG_USB_PXA2XX_SMALL=y +# CONFIG_USB_GADGET_PXA27X is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_MQ11XX is not set +# CONFIG_USB_GADGET_LH7A40X is not set +# CONFIG_USB_GADGET_OMAP is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_DUALSPEED is not set +# CONFIG_USB_ZERO is not set +CONFIG_USB_ETH=y +# CONFIG_USB_ETH_RNDIS is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FILE_STORAGE is not set +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_G_CHAR is not set + +# +# MMC/SD Card support +# +CONFIG_MMC=y +# CONFIG_MMC_DEBUG is not set +CONFIG_MMC_BLOCK=y +# CONFIG_MMC_PXA is not set +# CONFIG_MMC_WBSD is not set +# CONFIG_MMC_TMIO is not set +CONFIG_MMC_SAMCOP=y +# CONFIG_MMC_ASIC3 is not set + +# +# LED devices +# +# CONFIG_CLASS_LEDS is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set + +# +# XFS support +# +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +CONFIG_DEVFS_FS=y +CONFIG_DEVFS_MOUNT=y +# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_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 + +# +# Native Language Support +# +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_NLS_CODEPAGE_437=y +# 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_ASCII is not set +CONFIG_NLS_ISO8859_1=y +# 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=y + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_PREEMPT=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set +CONFIG_FRAME_POINTER=y +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_LL is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_AES is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_DEFLATE=y +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +CONFIG_CRC_CCITT=y +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff --git a/packages/linux/LAB-kernel/h2200/labrun.patch b/packages/linux/LAB-kernel-2.6.13-hh2/labrun.patch index 29ff10eda2..29ff10eda2 100644 --- a/packages/linux/LAB-kernel/h2200/labrun.patch +++ b/packages/linux/LAB-kernel-2.6.13-hh2/labrun.patch diff --git a/packages/linux/LAB-kernel/h2200/defconfig b/packages/linux/LAB-kernel/h2200/defconfig index 466c2072f5..b7f924e44d 100644 --- a/packages/linux/LAB-kernel/h2200/defconfig +++ b/packages/linux/LAB-kernel/h2200/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.13-hh1 -# Thu Feb 16 14:58:20 2006 +# Linux kernel version: 2.6.15-hh1 +# Wed Feb 22 17:27:41 2006 # CONFIG_ARM=y CONFIG_MMU=y @@ -22,6 +22,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 # General setup # CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y # CONFIG_SWAP is not set CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set @@ -32,6 +33,10 @@ CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_MINIMAL_OOPS is not set +CONFIG_INITRAMFS_SOURCE="initramfs_list" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set @@ -41,7 +46,6 @@ CONFIG_BUG=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_SHMEM is not set CONFIG_USELIB=y CONFIG_CORE_DUMP=y @@ -64,6 +68,23 @@ CONFIG_OBSOLETE_MODPARM=y CONFIG_KMOD=y # +# Block layer +# + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +# CONFIG_IOSCHED_AS is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +CONFIG_DEFAULT_NOOP=y +CONFIG_DEFAULT_IOSCHED="noop" + +# # System Type # # CONFIG_ARCH_CLPS7500 is not set @@ -85,6 +106,7 @@ CONFIG_ARCH_PXA=y # CONFIG_ARCH_LH7A40X is not set # CONFIG_ARCH_OMAP is not set # CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_IMX is not set # CONFIG_ARCH_H720X is not set # CONFIG_ARCH_AAEC2000 is not set @@ -115,10 +137,10 @@ CONFIG_H2200_PM=y # CONFIG_MACH_T3XSCALE is not set # CONFIG_PXA_SHARPSL is not set CONFIG_PXA25x=y -CONFIG_PXA_KEYS=y # CONFIG_SA1100_H3100 is not set # CONFIG_SA1100_H3600 is not set # CONFIG_SA1100_H3800 is not set +CONFIG_GPIO_KEYS=y # # Linux As Bootloader @@ -165,7 +187,6 @@ CONFIG_LAB_RUN=y # CONFIG_CPU_32=y CONFIG_CPU_XSCALE=y -# CONFIG_CPU_XSCALE_PXA250 is not set CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV5T=y CONFIG_CPU_CACHE_VIVT=y @@ -174,7 +195,6 @@ CONFIG_CPU_TLB_V4WBI=y # # Processor Features # -# CONFIG_ARM_FASTCALL is not set CONFIG_ARM_THUMB=y CONFIG_XSCALE_PMU=y @@ -220,7 +240,6 @@ CONFIG_PCMCIA_IOCTL=y # # PC-card bridges # -# CONFIG_TCIC is not set CONFIG_PCMCIA_PXA2XX=y CONFIG_PCMCIA_H2200=y @@ -236,6 +255,8 @@ CONFIG_FLATMEM_MANUAL=y # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4096 CONFIG_ALIGNMENT_TRAP=y # @@ -247,11 +268,6 @@ CONFIG_CMDLINE="console=ttyS0,115200n8 mem=64M" # CONFIG_XIP_KERNEL is not set # -# CPU Frequency scaling -# -# CONFIG_CPU_FREQ is not set - -# # Floating point emulation # @@ -274,6 +290,8 @@ CONFIG_BINFMT_ELF=y # Power management options # CONFIG_PM=y +CONFIG_PM_LEGACY=y +# CONFIG_PM_DEBUG is not set CONFIG_APM=y # @@ -304,8 +322,8 @@ CONFIG_IP_PNP=y # CONFIG_INET_ESP is not set # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set -CONFIG_IP_TCPDIAG=y -# CONFIG_IP_TCPDIAG_IPV6 is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y @@ -318,15 +336,25 @@ CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # +# Core Netfilter Configuration +# +# CONFIG_NETFILTER_NETLINK is not set +# CONFIG_NF_CONNTRACK is not set + +# # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set -# CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set # +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set @@ -342,8 +370,11 @@ CONFIG_NETFILTER=y # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# # CONFIG_NET_SCHED is not set -# CONFIG_NET_CLS_ROUTE is not set # # Network testing @@ -352,6 +383,7 @@ CONFIG_NETFILTER=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set +# CONFIG_IEEE80211 is not set # # Device Drivers @@ -366,6 +398,11 @@ CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# # Memory Technology Devices (MTD) # CONFIG_MTD=y @@ -418,7 +455,6 @@ CONFIG_MTD_CFI_I2=y # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set -# CONFIG_RAMTD is not set # CONFIG_MTD_BLKMTD is not set # CONFIG_MTD_BLOCK2MTD is not set @@ -442,6 +478,11 @@ CONFIG_MTD_NAND_HAMCOP=y # CONFIG_MTD_NAND_NANDSIM is not set # +# OneNAND Flash Device Drivers +# +# CONFIG_MTD_ONENAND is not set + +# # Parallel port support # # CONFIG_PARPORT is not set @@ -458,16 +499,7 @@ CONFIG_MTD_NAND_HAMCOP=y # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_INITRAMFS_SOURCE="" # CONFIG_CDROM_PKTCDVD is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_AS is not set -# CONFIG_IOSCHED_DEADLINE is not set -# CONFIG_IOSCHED_CFQ is not set # CONFIG_ATA_OVER_ETH is not set # @@ -500,6 +532,7 @@ CONFIG_IDE_GENERIC=y # # SCSI device support # +# CONFIG_RAID_ATTRS is not set # CONFIG_SCSI is not set # @@ -530,6 +563,10 @@ CONFIG_NETDEVICES=y # CONFIG_TUN is not set # +# PHY device support +# + +# # Ethernet (10 or 100Mbit) # # CONFIG_NET_ETHERNET is not set @@ -550,7 +587,6 @@ CONFIG_NETDEVICES=y # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set -# CONFIG_HOSTAP is not set # # PCMCIA network device support @@ -654,11 +690,9 @@ CONFIG_I2C_CHARDEV=y # CONFIG_I2C_ELV is not set CONFIG_I2C_PXA=y # CONFIG_I2C_PXA_SLAVE is not set -# CONFIG_I2C_ISA is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_PCA_ISA is not set -# CONFIG_I2C_SENSOR is not set # # Miscellaneous I2C Chip support @@ -668,9 +702,11 @@ CONFIG_I2C_PXA=y # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set +# CONFIG_SENSORS_PCA9535 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set +# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -697,7 +733,6 @@ CONFIG_I2C_PXA=y # CONFIG_WATCHDOG is not set # CONFIG_NVRAM is not set # CONFIG_SA1100_RTC is not set -# CONFIG_S3C2410_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -709,16 +744,21 @@ CONFIG_I2C_PXA=y # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set # CONFIG_RAW_DRIVER is not set # # TPM devices # +# CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set # # Hardware Monitoring support # # CONFIG_HWMON is not set +# CONFIG_HWMON_VID is not set # # SoC drivers @@ -743,6 +783,10 @@ CONFIG_H2200_BATTERY=y # CONFIG_MCP is not set # +# Multimedia Capabilities Port drivers +# + +# # Multimedia devices # # CONFIG_VIDEO_DEV is not set @@ -759,14 +803,13 @@ CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_IMAGEON is not set +# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_PXA is not set CONFIG_FB_MQ1100=y -# CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # @@ -798,8 +841,8 @@ CONFIG_BACKLIGHT_H2200=y CONFIG_W1=y # CONFIG_W1_THERM is not set # CONFIG_W1_SMEM is not set +# CONFIG_W1_DS2433 is not set CONFIG_W1_SAMCOP=y -CONFIG_W1_SAMCOP_ONE_DEVICE=y CONFIG_W1_DS2760=y # @@ -810,6 +853,10 @@ CONFIG_USB_ARCH_HAS_HCD=y # CONFIG_USB is not set # +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# # USB Gadget Support # CONFIG_USB_GADGET=y @@ -827,12 +874,11 @@ CONFIG_USB_PXA2XX_SMALL=y # CONFIG_USB_GADGET_DUMMY_HCD is not set # CONFIG_USB_GADGET_DUALSPEED is not set # CONFIG_USB_ZERO is not set -CONFIG_USB_ETH=y -# CONFIG_USB_ETH_RNDIS is not set +# CONFIG_USB_ETH is not set # CONFIG_USB_GADGETFS is not set # CONFIG_USB_FILE_STORAGE is not set # CONFIG_USB_G_SERIAL is not set -# CONFIG_USB_G_CHAR is not set +CONFIG_USB_G_CHAR=y # # MMC/SD Card support @@ -862,10 +908,6 @@ CONFIG_EXT2_FS=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set - -# -# XFS support -# # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -874,6 +916,7 @@ CONFIG_INOTIFY=y CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set # # CD-ROM/DVD Filesystems @@ -896,14 +939,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_PROC_FS=y CONFIG_SYSFS=y -CONFIG_DEVFS_FS=y -CONFIG_DEVFS_MOUNT=y -# CONFIG_DEVFS_DEBUG is not set -# CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y -# CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set # # Miscellaneous filesystems @@ -919,6 +958,7 @@ CONFIG_RAMFS=y CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_SUMMARY is not set # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y @@ -951,6 +991,7 @@ CONFIG_SUNRPC=y # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set +# CONFIG_9P_FS is not set # # Partition Types @@ -1028,6 +1069,7 @@ CONFIG_NLS_UTF8=y CONFIG_DEBUG_KERNEL=y # CONFIG_MAGIC_SYSRQ is not set CONFIG_LOG_BUF_SHIFT=14 +CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_PREEMPT=y @@ -1037,7 +1079,9 @@ CONFIG_DEBUG_PREEMPT=y # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_VM is not set CONFIG_FRAME_POINTER=y +# CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_USER is not set # CONFIG_DEBUG_WAITQ is not set CONFIG_DEBUG_ERRORS=y @@ -1086,6 +1130,7 @@ CONFIG_CRYPTO_DEFLATE=y # Library routines # CONFIG_CRC_CCITT=y +# CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y diff --git a/packages/linux/LAB-kernel/initramfs_list b/packages/linux/LAB-kernel/initramfs_list new file mode 100644 index 0000000000..665d0baad5 --- /dev/null +++ b/packages/linux/LAB-kernel/initramfs_list @@ -0,0 +1,32 @@ +# Populate the rootfs with enough nodes for LAB to operate. + +dir /dev 0755 0 0 +nod /dev/console 0600 0 0 c 5 1 +nod /dev/mem 0600 0 0 c 1 1 +nod /dev/kmem 0600 0 0 c 1 2 +nod /dev/fb0 0600 0 0 c 29 0 +nod /dev/ttyS0 0600 0 0 c 4 64 +nod /dev/mtdblock0 0600 0 0 b 31 0 +nod /dev/mtdblock1 0600 0 0 b 31 1 +nod /dev/mtdblock2 0600 0 0 b 31 2 +nod /dev/mtdblock3 0600 0 0 b 31 3 +nod /dev/mmcblk0 0600 0 0 b 254 0 +nod /dev/mmcblk0p1 0600 0 0 b 254 1 +nod /dev/mmcblk0p2 0600 0 0 b 254 2 +nod /dev/mmcblk0p3 0600 0 0 b 254 3 +nod /dev/mmcblk0p4 0600 0 0 b 254 4 +nod /dev/mmcblk0p5 0600 0 0 b 254 5 +nod /dev/mmcblk0p6 0600 0 0 b 254 6 +nod /dev/mmcblk0p7 0600 0 0 b 254 7 +nod /dev/hda 0600 0 0 b 3 0 +nod /dev/hda1 0600 0 0 b 3 1 +nod /dev/hda2 0600 0 0 b 3 2 +nod /dev/hda3 0600 0 0 b 3 3 +nod /dev/hda4 0600 0 0 b 3 4 +nod /dev/hda5 0600 0 0 b 3 5 +nod /dev/hda6 0600 0 0 b 3 6 +nod /dev/hda7 0600 0 0 b 3 7 +dir /root 0700 0 0 +dir /proc 755 0 0 +dir /sys 755 0 0 +dir /mnt 755 0 0 diff --git a/packages/linux/LAB-kernel_2.6.13-hh2.bb b/packages/linux/LAB-kernel_2.6.13-hh2.bb index f50baf64ad..eb5e97cc70 100644 --- a/packages/linux/LAB-kernel_2.6.13-hh2.bb +++ b/packages/linux/LAB-kernel_2.6.13-hh2.bb @@ -28,8 +28,8 @@ do_configure() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/LAB-image-${MACHINE} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/LAB-image-${MACHINE} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/LAB-kernel_cvs.bb b/packages/linux/LAB-kernel_cvs.bb index 25241cec1e..22128880ed 100644 --- a/packages/linux/LAB-kernel_cvs.bb +++ b/packages/linux/LAB-kernel_cvs.bb @@ -15,33 +15,42 @@ COMPATIBLE_HOST = "arm.*-linux" FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/handhelds-pxa-${PV}" SRC_URI = "${HANDHELDS_CVS};module=linux/kernel26 \ - file://labrun.patch;patch=1 \ + file://initramfs_list \ file://defconfig" S = "${WORKDIR}/kernel26" inherit kernel +FILES_kernel-image_h2200 = "" +ALLOW_EMPTY_kernel-image_h2200 = 1 + K_MAJOR = "2" K_MINOR = "6" -K_MICRO = "13" -HHV = "2" +K_MICRO = "15" +HHV = "0" # KERNEL_PRIORITY = "${@'%d' % (int(bb.data.getVar('K_MAJOR',d,1)) * 100000000 + int(bb.data.getVar('K_MINOR',d,1)) * 1000000 + int(bb.data.getVar('K_MICRO',d,1)) * 10000 + float(bb.data.getVar('HHV',d,1)))}" do_configure() { - install -m 0644 ${WORKDIR}/defconfig ${S}/.config || die "No default configuration for ${MACHINE} available." + # Substitute our uid/gid so the initramfs gets the right ownership. + MY_UID=`id -u` + MY_GID=`id -g` + sed -e "s/^CONFIG_INITRAMFS_ROOT_UID.*$/CONFIG_INITRAMFS_ROOT_UID=$MY_UID/" \ + -e "s/^CONFIG_INITRAMFS_ROOT_GID.*$/CONFIG_INITRAMFS_ROOT_GID=$MY_GID/" \ + ${WORKDIR}/defconfig > ${S}/.config + + install -m 0644 ${WORKDIR}/initramfs_list ${S}/initramfs_list + yes '' | oe_runmake oldconfig } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/LAB-image-${MACHINE} -#add the bootshim? + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/LAB-image-${MACHINE} } do_stage() { -#do nothing } diff --git a/packages/linux/collie-kernel-58-6-debug_2.4.18-rmk7-pxa3-embedix20030509.bb b/packages/linux/collie-kernel-58-6-debug_2.4.18-rmk7-pxa3-embedix20030509.bb index 5b594a959b..8f42d6b383 100644 --- a/packages/linux/collie-kernel-58-6-debug_2.4.18-rmk7-pxa3-embedix20030509.bb +++ b/packages/linux/collie-kernel-58-6-debug_2.4.18-rmk7-pxa3-embedix20030509.bb @@ -5,7 +5,7 @@ KERNEL_CONSOLE = "tty0" include ../linux/openzaurus-sa_2.4.18-rmk7-pxa3-embedix20030509.bb do_deploy() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \ - ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${COLLIE_MEMORY_SIZE}-${COLLIE_RAMDISK_SIZE}-DEBUG-${DATETIME}.bin + ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${COLLIE_MEMORY_SIZE}-${COLLIE_RAMDISK_SIZE}-DEBUG-${DATETIME}.bin } diff --git a/packages/linux/devkitidp-pxa255-kernel_2.6.11.bb b/packages/linux/devkitidp-pxa255-kernel_2.6.11.bb index a0571bedb7..0b8b6ab63a 100644 --- a/packages/linux/devkitidp-pxa255-kernel_2.6.11.bb +++ b/packages/linux/devkitidp-pxa255-kernel_2.6.11.bb @@ -31,8 +31,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/ep93xx-kernel/derevo6.diff b/packages/linux/ep93xx-kernel/derevo6.diff new file mode 100644 index 0000000000..fc7f609056 --- /dev/null +++ b/packages/linux/ep93xx-kernel/derevo6.diff @@ -0,0 +1,4434 @@ +diff -urN linux-2.6.15.commit/arch/arm/common/Kconfig linux-2.6.15.snap/arch/arm/common/Kconfig +--- linux-2.6.15.commit/arch/arm/common/Kconfig 2006-02-12 10:22:18.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/common/Kconfig 2006-02-20 13:56:04.000000000 +0100 +@@ -1,7 +1,10 @@ +-config ICST525 ++config ARM_GIC + bool + +-config ARM_GIC ++config ARM_VIC ++ bool ++ ++config ICST525 + bool + + config ICST307 +diff -urN linux-2.6.15.commit/arch/arm/common/Makefile linux-2.6.15.snap/arch/arm/common/Makefile +--- linux-2.6.15.commit/arch/arm/common/Makefile 2006-02-12 10:22:18.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/common/Makefile 2006-02-20 13:56:32.000000000 +0100 +@@ -5,6 +5,7 @@ + obj-y += rtctime.o + obj-$(CONFIG_ARM_AMBA) += amba.o + obj-$(CONFIG_ARM_GIC) += gic.o ++obj-$(CONFIG_ARM_VIC) += vic.o + obj-$(CONFIG_ICST525) += icst525.o + obj-$(CONFIG_ICST307) += icst307.o + obj-$(CONFIG_SA1111) += sa1111.o +diff -urN linux-2.6.15.commit/arch/arm/common/vic.c linux-2.6.15.snap/arch/arm/common/vic.c +--- linux-2.6.15.commit/arch/arm/common/vic.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/common/vic.c 2006-02-20 18:38:41.000000000 +0100 +@@ -0,0 +1,91 @@ ++/* ++ * linux/arch/arm/common/vic.c ++ * ++ * Copyright (C) 1999 - 2003 ARM Limited ++ * Copyright (C) 2000 Deep Blue Solutions Ltd ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#include <linux/init.h> ++#include <linux/list.h> ++ ++#include <asm/io.h> ++#include <asm/irq.h> ++#include <asm/mach/irq.h> ++#include <asm/hardware/vic.h> ++ ++static void vic_mask_irq(unsigned int irq) ++{ ++ void __iomem *base = get_irq_chipdata(irq); ++ irq &= 31; ++ writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); ++} ++ ++static void vic_unmask_irq(unsigned int irq) ++{ ++ void __iomem *base = get_irq_chipdata(irq); ++ irq &= 31; ++ writel(1 << irq, base + VIC_INT_ENABLE); ++} ++ ++static struct irqchip vic_chip = { ++ .ack = vic_mask_irq, ++ .mask = vic_mask_irq, ++ .unmask = vic_unmask_irq, ++}; ++ ++void __init vic_init(void __iomem *base, unsigned int irq_start, ++ u32 vic_sources) ++{ ++ unsigned int i; ++ ++ /* Disable all interrupts initially. */ ++ ++ writel(0, base + VIC_INT_SELECT); ++ writel(~0, base + VIC_INT_ENABLE_CLEAR); ++ writel(0, base + VIC_ITCR); ++ writel(~0, base + VIC_INT_SOFT_CLEAR); ++ ++ /* ++ * Make sure we clear all existing interrupts ++ */ ++ writel(0, base + VIC_VECT_ADDR); ++ for (i = 0; i < 19; i++) { ++ unsigned int value; ++ ++ value = readl(base + VIC_VECT_ADDR); ++ writel(value, base + VIC_VECT_ADDR); ++ } ++ ++ for (i = 0; i < 16; i++) { ++ void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); ++// writel(VIC_VECT_CNTL_ENABLE | i, reg); ++ writel(0, reg); ++ } ++ ++ writel(32, base + VIC_DEF_VECT_ADDR); ++ ++ for (i = 0; i < 32; i++) { ++ unsigned int irq = irq_start + i; ++ ++ set_irq_chip(irq, &vic_chip); ++ set_irq_chipdata(irq, base); ++ ++ if (vic_sources & (1 << i)) { ++ set_irq_handler(irq, do_level_IRQ); ++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); ++ } ++ } ++} +diff -urN linux-2.6.15.commit/arch/arm/configs/ep93xx_defconfig linux-2.6.15.snap/arch/arm/configs/ep93xx_defconfig +--- linux-2.6.15.commit/arch/arm/configs/ep93xx_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/configs/ep93xx_defconfig 2006-02-20 21:11:41.000000000 +0100 +@@ -0,0 +1,850 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.15 ++# Mon Feb 20 13:59:13 2006 ++# ++CONFIG_ARM=y ++CONFIG_MMU=y ++CONFIG_UID16=y ++CONFIG_RWSEM_GENERIC_SPINLOCK=y ++CONFIG_GENERIC_CALIBRATE_DELAY=y ++ ++# ++# Code maturity level options ++# ++CONFIG_EXPERIMENTAL=y ++CONFIG_CLEAN_COMPILE=y ++CONFIG_BROKEN_ON_SMP=y ++CONFIG_INIT_ENV_ARG_LIMIT=32 ++ ++# ++# General setup ++# ++CONFIG_LOCALVERSION="" ++CONFIG_LOCALVERSION_AUTO=y ++# CONFIG_SWAP is not set ++CONFIG_SYSVIPC=y ++# CONFIG_POSIX_MQUEUE is not set ++# CONFIG_BSD_PROCESS_ACCT is not set ++CONFIG_SYSCTL=y ++# CONFIG_AUDIT is not set ++CONFIG_HOTPLUG=y ++CONFIG_KOBJECT_UEVENT=y ++CONFIG_IKCONFIG=y ++CONFIG_IKCONFIG_PROC=y ++CONFIG_INITRAMFS_SOURCE="" ++CONFIG_CC_OPTIMIZE_FOR_SIZE=y ++CONFIG_EMBEDDED=y ++CONFIG_KALLSYMS=y ++# CONFIG_KALLSYMS_ALL is not set ++# CONFIG_KALLSYMS_EXTRA_PASS is not set ++CONFIG_PRINTK=y ++CONFIG_BUG=y ++CONFIG_BASE_FULL=y ++CONFIG_FUTEX=y ++CONFIG_EPOLL=y ++CONFIG_SHMEM=y ++CONFIG_CC_ALIGN_FUNCTIONS=0 ++CONFIG_CC_ALIGN_LABELS=0 ++CONFIG_CC_ALIGN_LOOPS=0 ++CONFIG_CC_ALIGN_JUMPS=0 ++# CONFIG_TINY_SHMEM is not set ++CONFIG_BASE_SMALL=0 ++ ++# ++# Loadable module support ++# ++CONFIG_MODULES=y ++CONFIG_MODULE_UNLOAD=y ++CONFIG_MODULE_FORCE_UNLOAD=y ++CONFIG_OBSOLETE_MODPARM=y ++# CONFIG_MODVERSIONS is not set ++# CONFIG_MODULE_SRCVERSION_ALL is not set ++CONFIG_KMOD=y ++ ++# ++# Block layer ++# ++ ++# ++# IO Schedulers ++# ++CONFIG_IOSCHED_NOOP=y ++# CONFIG_IOSCHED_AS is not set ++CONFIG_IOSCHED_DEADLINE=y ++# CONFIG_IOSCHED_CFQ is not set ++# CONFIG_DEFAULT_AS is not set ++CONFIG_DEFAULT_DEADLINE=y ++# CONFIG_DEFAULT_CFQ is not set ++# CONFIG_DEFAULT_NOOP is not set ++CONFIG_DEFAULT_IOSCHED="deadline" ++ ++# ++# System Type ++# ++# CONFIG_ARCH_CLPS7500 is not set ++# CONFIG_ARCH_CLPS711X is not set ++# CONFIG_ARCH_CO285 is not set ++# CONFIG_ARCH_EBSA110 is not set ++CONFIG_ARCH_EP93XX=y ++# CONFIG_ARCH_CAMELOT is not set ++# CONFIG_ARCH_FOOTBRIDGE is not set ++# CONFIG_ARCH_INTEGRATOR is not set ++# CONFIG_ARCH_IOP3XX is not set ++# CONFIG_ARCH_IXP4XX is not set ++# CONFIG_ARCH_IXP2000 is not set ++# CONFIG_ARCH_L7200 is not set ++# CONFIG_ARCH_PXA is not set ++# CONFIG_ARCH_RPC is not set ++# CONFIG_ARCH_SA1100 is not set ++# CONFIG_ARCH_S3C2410 is not set ++# CONFIG_ARCH_SHARK is not set ++# CONFIG_ARCH_LH7A40X is not set ++# CONFIG_ARCH_OMAP is not set ++# CONFIG_ARCH_VERSATILE is not set ++# CONFIG_ARCH_REALVIEW is not set ++# CONFIG_ARCH_IMX is not set ++# CONFIG_ARCH_H720X is not set ++# CONFIG_ARCH_AAEC2000 is not set ++ ++# ++# Cirrus EP93xx Implementation Options ++# ++ ++# ++# EP93xx Platforms ++# ++CONFIG_MACH_GESBC9312=y ++CONFIG_MACH_TS72XX=y ++ ++# ++# Processor Type ++# ++CONFIG_CPU_32=y ++CONFIG_CPU_ARM920T=y ++CONFIG_CPU_32v4=y ++CONFIG_CPU_ABRT_EV4T=y ++CONFIG_CPU_CACHE_V4WT=y ++CONFIG_CPU_CACHE_VIVT=y ++CONFIG_CPU_COPY_V4WB=y ++CONFIG_CPU_TLB_V4WBI=y ++ ++# ++# Processor Features ++# ++CONFIG_ARM_THUMB=y ++# CONFIG_CPU_ICACHE_DISABLE is not set ++# CONFIG_CPU_DCACHE_DISABLE is not set ++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set ++CONFIG_ARM_VIC=y ++ ++# ++# Bus support ++# ++CONFIG_ARM_AMBA=y ++CONFIG_ISA_DMA_API=y ++ ++# ++# PCCARD (PCMCIA/CardBus) support ++# ++# CONFIG_PCCARD is not set ++ ++# ++# Kernel Features ++# ++# CONFIG_PREEMPT is not set ++# CONFIG_NO_IDLE_HZ is not set ++# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set ++CONFIG_SELECT_MEMORY_MODEL=y ++CONFIG_FLATMEM_MANUAL=y ++# CONFIG_DISCONTIGMEM_MANUAL is not set ++# CONFIG_SPARSEMEM_MANUAL is not set ++CONFIG_FLATMEM=y ++CONFIG_FLAT_NODE_MEM_MAP=y ++# CONFIG_SPARSEMEM_STATIC is not set ++CONFIG_SPLIT_PTLOCK_CPUS=4096 ++CONFIG_ALIGNMENT_TRAP=y ++ ++# ++# Boot options ++# ++CONFIG_ZBOOT_ROM_TEXT=0x0 ++CONFIG_ZBOOT_ROM_BSS=0x0 ++CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/nfs ip=bootp" ++# CONFIG_XIP_KERNEL is not set ++ ++# ++# Floating point emulation ++# ++ ++# ++# At least one emulation must be selected ++# ++CONFIG_FPE_NWFPE=y ++CONFIG_FPE_NWFPE_XP=y ++# CONFIG_FPE_FASTFPE is not set ++ ++# ++# Userspace binary formats ++# ++CONFIG_BINFMT_ELF=y ++# CONFIG_BINFMT_AOUT is not set ++# CONFIG_BINFMT_MISC is not set ++# CONFIG_ARTHUR is not set ++ ++# ++# Power management options ++# ++# CONFIG_PM is not set ++ ++# ++# Networking ++# ++CONFIG_NET=y ++ ++# ++# Networking options ++# ++CONFIG_PACKET=y ++CONFIG_PACKET_MMAP=y ++CONFIG_UNIX=y ++CONFIG_XFRM=y ++# CONFIG_XFRM_USER is not set ++CONFIG_NET_KEY=y ++CONFIG_INET=y ++# CONFIG_IP_MULTICAST is not set ++# CONFIG_IP_ADVANCED_ROUTER is not set ++CONFIG_IP_FIB_HASH=y ++CONFIG_IP_PNP=y ++CONFIG_IP_PNP_DHCP=y ++CONFIG_IP_PNP_BOOTP=y ++# CONFIG_IP_PNP_RARP is not set ++# CONFIG_NET_IPIP is not set ++# CONFIG_NET_IPGRE is not set ++# CONFIG_ARPD is not set ++CONFIG_SYN_COOKIES=y ++# CONFIG_INET_AH is not set ++# CONFIG_INET_ESP is not set ++# CONFIG_INET_IPCOMP is not set ++# CONFIG_INET_TUNNEL is not set ++CONFIG_INET_DIAG=y ++CONFIG_INET_TCP_DIAG=y ++# CONFIG_TCP_CONG_ADVANCED is not set ++CONFIG_TCP_CONG_BIC=y ++# CONFIG_IPV6 is not set ++# CONFIG_NETFILTER is not set ++ ++# ++# DCCP Configuration (EXPERIMENTAL) ++# ++# CONFIG_IP_DCCP is not set ++ ++# ++# SCTP Configuration (EXPERIMENTAL) ++# ++# CONFIG_IP_SCTP is not set ++# CONFIG_ATM is not set ++# CONFIG_BRIDGE is not set ++# CONFIG_VLAN_8021Q is not set ++# CONFIG_DECNET is not set ++# CONFIG_LLC2 is not set ++# CONFIG_IPX is not set ++# CONFIG_ATALK 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 ++ ++# ++# QoS and/or fair queueing ++# ++# CONFIG_NET_SCHED is not set ++ ++# ++# Network testing ++# ++# CONFIG_NET_PKTGEN is not set ++# CONFIG_HAMRADIO is not set ++# CONFIG_IRDA is not set ++# CONFIG_BT is not set ++# CONFIG_IEEE80211 is not set ++ ++# ++# Device Drivers ++# ++ ++# ++# Generic Driver Options ++# ++CONFIG_STANDALONE=y ++CONFIG_PREVENT_FIRMWARE_BUILD=y ++# CONFIG_FW_LOADER is not set ++# CONFIG_DEBUG_DRIVER is not set ++ ++# ++# Connector - unified userspace <-> kernelspace linker ++# ++# CONFIG_CONNECTOR is not set ++ ++# ++# Memory Technology Devices (MTD) ++# ++CONFIG_MTD=y ++# CONFIG_MTD_DEBUG is not set ++# CONFIG_MTD_CONCAT is not set ++CONFIG_MTD_PARTITIONS=y ++CONFIG_MTD_REDBOOT_PARTS=y ++CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 ++# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set ++# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set ++# CONFIG_MTD_CMDLINE_PARTS is not set ++# CONFIG_MTD_AFS_PARTS 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 ++# CONFIG_INFTL is not set ++# CONFIG_RFD_FTL is not set ++ ++# ++# RAM/ROM/Flash chip drivers ++# ++# CONFIG_MTD_CFI is not set ++# CONFIG_MTD_JEDECPROBE is not set ++CONFIG_MTD_MAP_BANK_WIDTH_1=y ++CONFIG_MTD_MAP_BANK_WIDTH_2=y ++CONFIG_MTD_MAP_BANK_WIDTH_4=y ++# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set ++# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set ++# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set ++CONFIG_MTD_CFI_I1=y ++CONFIG_MTD_CFI_I2=y ++# CONFIG_MTD_CFI_I4 is not set ++# CONFIG_MTD_CFI_I8 is not set ++# CONFIG_MTD_RAM is not set ++CONFIG_MTD_ROM=y ++# CONFIG_MTD_ABSENT is not set ++ ++# ++# Mapping drivers for chip access ++# ++# CONFIG_MTD_COMPLEX_MAPPINGS is not set ++# CONFIG_MTD_PLATRAM is not set ++ ++# ++# Self-contained MTD device drivers ++# ++# CONFIG_MTD_SLRAM is not set ++# CONFIG_MTD_PHRAM is not set ++# CONFIG_MTD_MTDRAM is not set ++# CONFIG_MTD_BLKMTD is not set ++# CONFIG_MTD_BLOCK2MTD is not set ++ ++# ++# Disk-On-Chip Device Drivers ++# ++# CONFIG_MTD_DOC2000 is not set ++# CONFIG_MTD_DOC2001 is not set ++# CONFIG_MTD_DOC2001PLUS is not set ++ ++# ++# NAND Flash Device Drivers ++# ++# CONFIG_MTD_NAND is not set ++ ++# ++# OneNAND Flash Device Drivers ++# ++# CONFIG_MTD_ONENAND is not set ++ ++# ++# Parallel port support ++# ++# CONFIG_PARPORT is not set ++ ++# ++# Plug and Play support ++# ++ ++# ++# Block devices ++# ++# CONFIG_BLK_DEV_COW_COMMON is not set ++# CONFIG_BLK_DEV_LOOP is not set ++# CONFIG_BLK_DEV_NBD is not set ++# CONFIG_BLK_DEV_RAM is not set ++CONFIG_BLK_DEV_RAM_COUNT=16 ++# CONFIG_CDROM_PKTCDVD is not set ++# CONFIG_ATA_OVER_ETH is not set ++ ++# ++# SCSI device support ++# ++# CONFIG_RAID_ATTRS is not set ++# CONFIG_SCSI is not set ++ ++# ++# Multi-device support (RAID and LVM) ++# ++# CONFIG_MD is not set ++ ++# ++# Fusion MPT device support ++# ++# CONFIG_FUSION is not set ++ ++# ++# IEEE 1394 (FireWire) support ++# ++ ++# ++# I2O device support ++# ++ ++# ++# Network device support ++# ++CONFIG_NETDEVICES=y ++# CONFIG_DUMMY is not set ++# CONFIG_BONDING is not set ++# CONFIG_EQUALIZER is not set ++# CONFIG_TUN is not set ++ ++# ++# PHY device support ++# ++# CONFIG_PHYLIB is not set ++ ++# ++# Ethernet (10 or 100Mbit) ++# ++CONFIG_NET_ETHERNET=y ++CONFIG_MII=y ++CONFIG_EP93XX_ETHERNET=y ++# CONFIG_SMC91X is not set ++# CONFIG_DM9000 is not set ++ ++# ++# Ethernet (1000 Mbit) ++# ++ ++# ++# Ethernet (10000 Mbit) ++# ++ ++# ++# Token Ring devices ++# ++ ++# ++# Wireless LAN (non-hamradio) ++# ++# CONFIG_NET_RADIO is not set ++ ++# ++# Wan interfaces ++# ++# CONFIG_WAN is not set ++# CONFIG_PPP is not set ++# CONFIG_SLIP is not set ++# CONFIG_SHAPER is not set ++# CONFIG_NETCONSOLE is not set ++# CONFIG_NETPOLL is not set ++# CONFIG_NET_POLL_CONTROLLER is not set ++ ++# ++# ISDN subsystem ++# ++# CONFIG_ISDN is not set ++ ++# ++# Input device support ++# ++# CONFIG_INPUT is not set ++ ++# ++# Hardware I/O ports ++# ++# CONFIG_SERIO is not set ++# CONFIG_GAMEPORT is not set ++ ++# ++# Character devices ++# ++# CONFIG_VT is not set ++# CONFIG_SERIAL_NONSTANDARD is not set ++ ++# ++# Serial drivers ++# ++# CONFIG_SERIAL_8250 is not set ++ ++# ++# Non-8250 serial port support ++# ++CONFIG_SERIAL_AMBA_PL010=y ++CONFIG_SERIAL_AMBA_PL010_CONSOLE=y ++# CONFIG_SERIAL_AMBA_PL011 is not set ++CONFIG_SERIAL_CORE=y ++CONFIG_SERIAL_CORE_CONSOLE=y ++CONFIG_UNIX98_PTYS=y ++# CONFIG_LEGACY_PTYS is not set ++ ++# ++# IPMI ++# ++# CONFIG_IPMI_HANDLER is not set ++ ++# ++# Watchdog Cards ++# ++# CONFIG_WATCHDOG is not set ++# CONFIG_NVRAM is not set ++# CONFIG_RTC is not set ++# CONFIG_DTLK is not set ++# CONFIG_R3964 is not set ++ ++# ++# Ftape, the floppy tape device driver ++# ++# CONFIG_RAW_DRIVER is not set ++ ++# ++# TPM devices ++# ++# CONFIG_TCG_TPM is not set ++# CONFIG_TELCLOCK is not set ++ ++# ++# I2C support ++# ++CONFIG_I2C=y ++CONFIG_I2C_CHARDEV=y ++ ++# ++# I2C Algorithms ++# ++CONFIG_I2C_ALGOBIT=y ++# CONFIG_I2C_ALGOPCF is not set ++# CONFIG_I2C_ALGOPCA is not set ++ ++# ++# I2C Hardware Bus support ++# ++# CONFIG_I2C_PARPORT_LIGHT is not set ++# CONFIG_I2C_STUB is not set ++# CONFIG_I2C_PCA_ISA is not set ++ ++# ++# Miscellaneous I2C Chip support ++# ++# CONFIG_SENSORS_DS1337 is not set ++# CONFIG_SENSORS_DS1374 is not set ++# CONFIG_SENSORS_EEPROM is not set ++# CONFIG_SENSORS_PCF8574 is not set ++# CONFIG_SENSORS_PCA9539 is not set ++# CONFIG_SENSORS_PCF8591 is not set ++# CONFIG_SENSORS_RTC8564 is not set ++# CONFIG_SENSORS_MAX6875 is not set ++# CONFIG_RTC_X1205_I2C is not set ++CONFIG_I2C_DEBUG_CORE=y ++CONFIG_I2C_DEBUG_ALGO=y ++CONFIG_I2C_DEBUG_BUS=y ++CONFIG_I2C_DEBUG_CHIP=y ++ ++# ++# Hardware Monitoring support ++# ++CONFIG_HWMON=y ++# CONFIG_HWMON_VID is not set ++# CONFIG_SENSORS_ADM1021 is not set ++# CONFIG_SENSORS_ADM1025 is not set ++# CONFIG_SENSORS_ADM1026 is not set ++# CONFIG_SENSORS_ADM1031 is not set ++# CONFIG_SENSORS_ADM9240 is not set ++# CONFIG_SENSORS_ASB100 is not set ++# CONFIG_SENSORS_ATXP1 is not set ++# CONFIG_SENSORS_DS1621 is not set ++# CONFIG_SENSORS_FSCHER is not set ++# CONFIG_SENSORS_FSCPOS is not set ++# CONFIG_SENSORS_GL518SM is not set ++# CONFIG_SENSORS_GL520SM is not set ++# CONFIG_SENSORS_IT87 is not set ++# CONFIG_SENSORS_LM63 is not set ++# CONFIG_SENSORS_LM75 is not set ++# CONFIG_SENSORS_LM77 is not set ++# CONFIG_SENSORS_LM78 is not set ++# CONFIG_SENSORS_LM80 is not set ++# CONFIG_SENSORS_LM83 is not set ++# CONFIG_SENSORS_LM85 is not set ++# CONFIG_SENSORS_LM87 is not set ++# CONFIG_SENSORS_LM90 is not set ++# CONFIG_SENSORS_LM92 is not set ++# CONFIG_SENSORS_MAX1619 is not set ++# CONFIG_SENSORS_PC87360 is not set ++# CONFIG_SENSORS_SMSC47M1 is not set ++# CONFIG_SENSORS_SMSC47B397 is not set ++# CONFIG_SENSORS_W83781D is not set ++# CONFIG_SENSORS_W83792D is not set ++# CONFIG_SENSORS_W83L785TS is not set ++# CONFIG_SENSORS_W83627HF is not set ++# CONFIG_SENSORS_W83627EHF is not set ++# CONFIG_HWMON_DEBUG_CHIP is not set ++ ++# ++# Misc devices ++# ++ ++# ++# Multimedia Capabilities Port drivers ++# ++ ++# ++# Multimedia devices ++# ++# CONFIG_VIDEO_DEV is not set ++ ++# ++# Digital Video Broadcasting Devices ++# ++# CONFIG_DVB is not set ++ ++# ++# Graphics support ++# ++# CONFIG_FB is not set ++ ++# ++# Sound ++# ++# CONFIG_SOUND is not set ++ ++# ++# USB support ++# ++CONFIG_USB_ARCH_HAS_HCD=y ++# CONFIG_USB_ARCH_HAS_OHCI is not set ++# CONFIG_USB is not set ++ ++# ++# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' ++# ++ ++# ++# USB Gadget Support ++# ++# CONFIG_USB_GADGET is not set ++ ++# ++# MMC/SD Card support ++# ++# CONFIG_MMC is not set ++ ++# ++# File systems ++# ++# CONFIG_EXT2_FS is not set ++# CONFIG_EXT3_FS is not set ++# CONFIG_JBD is not set ++# CONFIG_REISERFS_FS is not set ++# CONFIG_JFS_FS is not set ++# CONFIG_FS_POSIX_ACL is not set ++# CONFIG_XFS_FS is not set ++# CONFIG_MINIX_FS is not set ++# CONFIG_ROMFS_FS is not set ++CONFIG_INOTIFY=y ++# CONFIG_QUOTA is not set ++CONFIG_DNOTIFY=y ++# CONFIG_AUTOFS_FS is not set ++# CONFIG_AUTOFS4_FS is not set ++# CONFIG_FUSE_FS is not set ++ ++# ++# CD-ROM/DVD Filesystems ++# ++# CONFIG_ISO9660_FS is not set ++# CONFIG_UDF_FS is not set ++ ++# ++# DOS/FAT/NT Filesystems ++# ++CONFIG_FAT_FS=y ++# CONFIG_MSDOS_FS is not set ++CONFIG_VFAT_FS=y ++CONFIG_FAT_DEFAULT_CODEPAGE=437 ++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" ++# CONFIG_NTFS_FS is not set ++ ++# ++# Pseudo filesystems ++# ++CONFIG_PROC_FS=y ++CONFIG_SYSFS=y ++CONFIG_TMPFS=y ++# CONFIG_HUGETLB_PAGE is not set ++CONFIG_RAMFS=y ++# CONFIG_RELAYFS_FS is not set ++ ++# ++# Miscellaneous filesystems ++# ++# CONFIG_ADFS_FS is not set ++# CONFIG_AFFS_FS is not set ++# CONFIG_HFS_FS is not set ++# CONFIG_HFSPLUS_FS is not set ++# CONFIG_BEFS_FS is not set ++# CONFIG_BFS_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_VXFS_FS is not set ++# CONFIG_HPFS_FS is not set ++# CONFIG_QNX4FS_FS is not set ++# CONFIG_SYSV_FS is not set ++# CONFIG_UFS_FS is not set ++ ++# ++# Network File Systems ++# ++CONFIG_NFS_FS=y ++CONFIG_NFS_V3=y ++# CONFIG_NFS_V3_ACL is not set ++# CONFIG_NFS_V4 is not set ++# CONFIG_NFS_DIRECTIO is not set ++# CONFIG_NFSD is not set ++CONFIG_ROOT_NFS=y ++CONFIG_LOCKD=y ++CONFIG_LOCKD_V4=y ++CONFIG_NFS_COMMON=y ++CONFIG_SUNRPC=y ++# CONFIG_RPCSEC_GSS_KRB5 is not set ++# CONFIG_RPCSEC_GSS_SPKM3 is not set ++# CONFIG_SMB_FS is not set ++# CONFIG_CIFS is not set ++# CONFIG_NCP_FS is not set ++# CONFIG_CODA_FS is not set ++# CONFIG_AFS_FS is not set ++# CONFIG_9P_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 ++ ++# ++# Native Language Support ++# ++CONFIG_NLS=y ++CONFIG_NLS_DEFAULT="iso8859-1" ++CONFIG_NLS_CODEPAGE_437=y ++# 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_ASCII is not set ++CONFIG_NLS_ISO8859_1=y ++# 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 ++ ++# ++# Profiling support ++# ++# CONFIG_PROFILING is not set ++ ++# ++# Kernel hacking ++# ++# CONFIG_PRINTK_TIME is not set ++CONFIG_DEBUG_KERNEL=y ++CONFIG_MAGIC_SYSRQ=y ++CONFIG_LOG_BUF_SHIFT=14 ++CONFIG_DETECT_SOFTLOCKUP=y ++# CONFIG_SCHEDSTATS is not set ++CONFIG_DEBUG_SLAB=y ++CONFIG_DEBUG_SPINLOCK=y ++# CONFIG_DEBUG_SPINLOCK_SLEEP is not set ++# CONFIG_DEBUG_KOBJECT is not set ++CONFIG_DEBUG_BUGVERBOSE=y ++# CONFIG_DEBUG_INFO is not set ++# CONFIG_DEBUG_FS is not set ++# CONFIG_DEBUG_VM is not set ++CONFIG_FRAME_POINTER=y ++# CONFIG_RCU_TORTURE_TEST is not set ++CONFIG_DEBUG_USER=y ++CONFIG_DEBUG_WAITQ=y ++CONFIG_DEBUG_ERRORS=y ++CONFIG_DEBUG_LL=y ++# CONFIG_DEBUG_ICEDCC is not set ++ ++# ++# Security options ++# ++# CONFIG_KEYS is not set ++# CONFIG_SECURITY is not set ++ ++# ++# Cryptographic options ++# ++# CONFIG_CRYPTO is not set ++ ++# ++# Hardware crypto devices ++# ++ ++# ++# Library routines ++# ++# CONFIG_CRC_CCITT is not set ++# CONFIG_CRC16 is not set ++CONFIG_CRC32=y ++CONFIG_LIBCRC32C=y +diff -urN linux-2.6.15.commit/arch/arm/Kconfig linux-2.6.15.snap/arch/arm/Kconfig +--- linux-2.6.15.commit/arch/arm/Kconfig 2006-02-12 10:22:17.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/Kconfig 2006-02-20 13:56:20.000000000 +0100 +@@ -103,6 +103,13 @@ + Ethernet interface, two PCMCIA sockets, two serial ports and a + parallel port. + ++config ARCH_EP93XX ++ bool "EP93xx-based" ++ select ARM_AMBA ++ select ARM_VIC ++ help ++ This enables support for the Cirrus EP93xx series of CPUs. ++ + config ARCH_CAMELOT + bool "Epxa10db" + help +@@ -219,6 +226,8 @@ + + source "arch/arm/mach-clps711x/Kconfig" + ++source "arch/arm/mach-ep93xx/Kconfig" ++ + source "arch/arm/mach-epxa10db/Kconfig" + + source "arch/arm/mach-footbridge/Kconfig" +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/core.c linux-2.6.15.snap/arch/arm/mach-ep93xx/core.c +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/core.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/core.c 2006-02-28 01:41:25.000000000 +0100 +@@ -0,0 +1,223 @@ ++/* ++ * arch/arm/mach-ep93xx/core.c ++ * Core routines for Cirrus EP93xx chips. ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * Thanks go to Michael Burian and Ray Lehtiniemi for their key ++ * role in the ep93xx linux community. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++#include <linux/config.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/spinlock.h> ++#include <linux/sched.h> ++#include <linux/interrupt.h> ++#include <linux/serial.h> ++#include <linux/tty.h> ++#include <linux/bitops.h> ++#include <linux/serial.h> ++#include <linux/serial_8250.h> ++#include <linux/serial_core.h> ++#include <linux/device.h> ++#include <linux/mm.h> ++#include <linux/time.h> ++#include <linux/timex.h> ++#include <linux/delay.h> ++ ++#include <asm/types.h> ++#include <asm/setup.h> ++#include <asm/memory.h> ++#include <asm/hardware.h> ++#include <asm/irq.h> ++#include <asm/system.h> ++#include <asm/tlbflush.h> ++#include <asm/pgtable.h> ++#include <asm/io.h> ++ ++#include <asm/mach/map.h> ++#include <asm/mach/time.h> ++#include <asm/mach/irq.h> ++ ++#include <asm/hardware/amba.h> ++#include <asm/hardware/vic.h> ++ ++ ++/************************************************************************* ++ * Static I/O mappings that are needed for all EP93xx platforms ++ *************************************************************************/ ++static struct map_desc ep93xx_io_desc[] __initdata = { ++ { ++ .virtual = EP93XX_AHB_VIRT_BASE, ++ .pfn = __phys_to_pfn(EP93XX_AHB_PHYS_BASE), ++ .length = EP93XX_AHB_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = EP93XX_APB_VIRT_BASE, ++ .pfn = __phys_to_pfn(EP93XX_APB_PHYS_BASE), ++ .length = EP93XX_APB_SIZE, ++ .type = MT_DEVICE, ++ }, ++}; ++ ++void __init ep93xx_map_io(void) ++{ ++ iotable_init(ep93xx_io_desc, ARRAY_SIZE(ep93xx_io_desc)); ++} ++ ++ ++/************************************************************************* ++ * Timer handling for EP93xx ++ ************************************************************************* ++ * The ep93xx has four internal timers. Timers 1, 2 (both 16 bit) and ++ * 3 (32 bit) count down at 508 kHz, are self-reloading, and can generate ++ * an interrupt on underflow. Timer 4 (40 bit) counts down at 983.04 kHz, ++ * is free-running, and can't generate interrupts. ++ * ++ * The 508 kHz timers are ideal for use for the timer interrupt, as the ++ * most common values of HZ divide 508 kHz nicely. We pick one of the 16 ++ * bit timers (timer 1) since we don't need more than 16 bits of reload ++ * value as long as HZ >= 8. ++ * ++ * The higher clock rate of timer 4 makes it a better choice than the ++ * other timers for use in gettimeoffset(), while the fact that it can't ++ * generate interrupts means we don't have to worry about not being able ++ * to use this timer for something else. We also use timer 4 for keeping ++ * track of lost jiffies. ++ */ ++static unsigned int last_jiffy_time; ++ ++#define TIMER4_TICKS_PER_JIFFY ((983040 + (HZ/2)) / HZ) ++ ++static int ep93xx_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ write_seqlock(&xtime_lock); ++ ++ __raw_writel(1, EP93XX_TIMER1_CLEAR); ++ while (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time ++ >= TIMER4_TICKS_PER_JIFFY) { ++ last_jiffy_time += TIMER4_TICKS_PER_JIFFY; ++ timer_tick(regs); ++ } ++ ++ write_sequnlock(&xtime_lock); ++ ++ return IRQ_HANDLED; ++} ++ ++static struct irqaction ep93xx_timer_irq = { ++ .name = "ep93xx timer", ++ .flags = SA_INTERRUPT | SA_TIMER, ++ .handler = ep93xx_timer_interrupt, ++}; ++ ++static void __init ep93xx_timer_init(void) ++{ ++ /* Enable periodic HZ timer. */ ++ __raw_writel(0x48, EP93XX_TIMER1_CONTROL); ++ __raw_writel((CLOCK_TICK_RATE / HZ) - 1, EP93XX_TIMER1_LOAD); ++ __raw_writel(0xc8, EP93XX_TIMER1_CONTROL); ++ ++ /* Enable lost jiffy timer. */ ++ __raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH); ++ ++ setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq); ++} ++ ++static unsigned long ep93xx_gettimeoffset(void) ++{ ++ int offset; ++ ++ offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time; ++ ++ /* Calculate (1000000 / 983040) * offset. */ ++ return offset + (53 * offset / 3072); ++} ++ ++struct sys_timer ep93xx_timer = { ++ .init = ep93xx_timer_init, ++ .offset = ep93xx_gettimeoffset, ++}; ++ ++ ++/************************************************************************* ++ * EP93xx IRQ handling ++ *************************************************************************/ ++void __init ep93xx_init_irq(void) ++{ ++ vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK); ++ vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK); ++} ++ ++ ++/************************************************************************* ++ * EP93xx peripheral handling ++ *************************************************************************/ ++static struct amba_device uart1_device = { ++ .dev = { ++ .bus_id = "apb:uart1", ++ }, ++ .res = { ++ .start = EP93XX_UART1_BASE, ++ .end = EP93XX_UART1_BASE + 0xfff, ++ .flags = IORESOURCE_MEM, ++ }, ++ .irq = { IRQ_EP93XX_UART1, NO_IRQ }, ++ .periphid = 0x0041010, ++}; ++ ++static struct amba_device uart2_device = { ++ .dev = { ++ .bus_id = "apb:uart2", ++ }, ++ .res = { ++ .start = EP93XX_UART2_BASE, ++ .end = EP93XX_UART2_BASE + 0xfff, ++ .flags = IORESOURCE_MEM, ++ }, ++ .irq = { IRQ_EP93XX_UART2, NO_IRQ }, ++ .periphid = 0x0041010, ++}; ++ ++static struct resource ep93xx_ohci_resources[] = { ++ [0] = { ++ .start = EP93XX_USB_BASE, ++ .end = EP93XX_USB_BASE + 0xffff, ++ .flags = IORESOURCE_MEM, ++ }, ++ [1] = { ++ .start = IRQ_EP93XX_USB, ++ .end = IRQ_EP93XX_USB, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct platform_device ep93xx_ohci_device = { ++ .name = "ep93xx-ohci", ++ .id = -1, ++ .dev = { ++ .dma_mask = (void *)0xffffffff, ++ .coherent_dma_mask = 0xffffffff, ++ }, ++ .num_resources = ARRAY_SIZE(ep93xx_ohci_resources), ++ .resource = ep93xx_ohci_resources, ++}; ++ ++void __init ep93xx_init_devices(void) ++{ ++#if 0 ++ __raw_writel(__raw_readl(EP93XX_SYSCON_CLOCK_CONTROL) | ++ EP93XX_SYSCON_CLOCK_UARTBAUD, ++ EP93XX_SYSCON_CLOCK_CONTROL); ++#endif ++ ++ amba_device_register(&uart1_device, &iomem_resource); ++ amba_device_register(&uart2_device, &iomem_resource); ++ platform_device_register(&ep93xx_ohci_device); ++} +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/gesbc9312.c linux-2.6.15.snap/arch/arm/mach-ep93xx/gesbc9312.c +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/gesbc9312.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/gesbc9312.c 2006-02-20 22:30:19.000000000 +0100 +@@ -0,0 +1,40 @@ ++/* ++ * arch/arm/mach-ep93xx/gesbc9312.c ++ * Glomation GESBC-9312-sx support. ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++#include <linux/config.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/mm.h> ++#include <linux/sched.h> ++#include <linux/interrupt.h> ++#include <linux/mtd/physmap.h> ++#include <asm/io.h> ++#include <asm/hardware.h> ++#include <asm/mach-types.h> ++#include <asm/mach/arch.h> ++ ++static void __init gesbc9312_init_machine(void) ++{ ++ ep93xx_init_devices(); ++ physmap_configure(0x60000000, 0x02000000, 1, NULL); ++} ++ ++MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx") ++ /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ ++ .phys_io = EP93XX_APB_PHYS_BASE, ++ .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, ++ .boot_params = 0x00000100, ++ .map_io = ep93xx_map_io, ++ .init_irq = ep93xx_init_irq, ++ .timer = &ep93xx_timer, ++ .init_machine = gesbc9312_init_machine, ++MACHINE_END +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/Kconfig linux-2.6.15.snap/arch/arm/mach-ep93xx/Kconfig +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/Kconfig 2006-02-19 18:09:49.000000000 +0100 +@@ -0,0 +1,21 @@ ++if ARCH_EP93XX ++ ++menu "Cirrus EP93xx Implementation Options" ++ ++comment "EP93xx Platforms" ++ ++config MACH_GESBC9312 ++ bool "Support Glomation GESBC-9312-sx" ++ help ++ Say 'Y' here if you want your kernel to support the Glomation ++ GESBC-9312-sx board. ++ ++config MACH_TS72XX ++ bool "Support Technologic Systems TS-72xx SBC" ++ help ++ Say 'Y' here if you want your kernel to support the TS-72xx ++ board. ++ ++endmenu ++ ++endif +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/Makefile linux-2.6.15.snap/arch/arm/mach-ep93xx/Makefile +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/Makefile 2006-02-19 17:47:43.000000000 +0100 +@@ -0,0 +1,10 @@ ++# ++# Makefile for the linux kernel. ++# ++obj-y := core.o ++obj-m := ++obj-n := ++obj- := ++ ++obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o ++obj-$(CONFIG_MACH_TS72XX) += ts72xx.o +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/Makefile.boot linux-2.6.15.snap/arch/arm/mach-ep93xx/Makefile.boot +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/Makefile.boot 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/Makefile.boot 2006-02-19 22:04:54.000000000 +0100 +@@ -0,0 +1,2 @@ ++ zreladdr-y := 0x00008000 ++params_phys-y := 0x00000100 +diff -urN linux-2.6.15.commit/arch/arm/mach-ep93xx/ts72xx.c linux-2.6.15.snap/arch/arm/mach-ep93xx/ts72xx.c +--- linux-2.6.15.commit/arch/arm/mach-ep93xx/ts72xx.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mach-ep93xx/ts72xx.c 2006-02-22 17:01:43.000000000 +0100 +@@ -0,0 +1,118 @@ ++/* ++ * arch/arm/mach-ep93xx/ts72xx.c ++ * Technologic Systems TS72xx SBC support. ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++#include <linux/config.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/mm.h> ++#include <linux/sched.h> ++#include <linux/interrupt.h> ++#include <linux/mtd/physmap.h> ++#include <asm/io.h> ++#include <asm/hardware.h> ++#include <asm/mach-types.h> ++#include <asm/mach/arch.h> ++#include <asm/mach/map.h> ++ ++static struct map_desc ts72xx_io_desc[] __initdata = { ++ { ++ .virtual = TS72XX_MODEL_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_MODEL_PHYS_BASE), ++ .length = TS72XX_MODEL_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_OPTIONS_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE), ++ .length = TS72XX_OPTIONS_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_OPTIONS2_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE), ++ .length = TS72XX_OPTIONS2_SIZE, ++ .type = MT_DEVICE, ++ } ++}; ++ ++static struct map_desc ts72xx_nand_io_desc[] __initdata = { ++ { ++ .virtual = TS72XX_NAND_DATA_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND1_DATA_PHYS_BASE), ++ .length = TS72XX_NAND_DATA_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_NAND_CONTROL_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND1_CONTROL_PHYS_BASE), ++ .length = TS72XX_NAND_CONTROL_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_NAND_BUSY_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND1_BUSY_PHYS_BASE), ++ .length = TS72XX_NAND_BUSY_SIZE, ++ .type = MT_DEVICE, ++ } ++}; ++ ++static struct map_desc ts72xx_alternate_nand_io_desc[] __initdata = { ++ { ++ .virtual = TS72XX_NAND_DATA_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND2_DATA_PHYS_BASE), ++ .length = TS72XX_NAND_DATA_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_NAND_CONTROL_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND2_CONTROL_PHYS_BASE), ++ .length = TS72XX_NAND_CONTROL_SIZE, ++ .type = MT_DEVICE, ++ }, { ++ .virtual = TS72XX_NAND_BUSY_VIRT_BASE, ++ .pfn = __phys_to_pfn(TS72XX_NAND2_BUSY_PHYS_BASE), ++ .length = TS72XX_NAND_BUSY_SIZE, ++ .type = MT_DEVICE, ++ } ++}; ++ ++static void __init ts72xx_map_io(void) ++{ ++ ep93xx_map_io(); ++ iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc)); ++ ++ /* ++ * The TS-7200 has NOR flash, the other models have NAND flash. ++ */ ++ if (board_is_ts7200()) { ++ physmap_configure(TS72XX_NOR_PHYS_BASE, 0x01000000, 1, NULL); ++ } else { ++ if (is_ts9420_installed()) { ++ iotable_init(ts72xx_alternate_nand_io_desc, ++ ARRAY_SIZE(ts72xx_alternate_nand_io_desc)); ++ } else { ++ iotable_init(ts72xx_nand_io_desc, ++ ARRAY_SIZE(ts72xx_nand_io_desc)); ++ } ++ } ++} ++ ++static void __init ts72xx_init_machine(void) ++{ ++ ep93xx_init_devices(); ++} ++ ++MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") ++ /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ ++ .phys_io = EP93XX_APB_PHYS_BASE, ++ .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, ++ .boot_params = 0x00000100, ++ .map_io = ts72xx_map_io, ++ .init_irq = ep93xx_init_irq, ++ .timer = &ep93xx_timer, ++ .init_machine = ts72xx_init_machine, ++MACHINE_END +diff -urN linux-2.6.15.commit/arch/arm/Makefile linux-2.6.15.snap/arch/arm/Makefile +--- linux-2.6.15.commit/arch/arm/Makefile 2006-02-12 10:22:18.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/Makefile 2006-02-19 17:29:10.000000000 +0100 +@@ -102,6 +102,7 @@ + machine-$(CONFIG_ARCH_H720X) := h720x + machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 + machine-$(CONFIG_ARCH_REALVIEW) := realview ++ machine-$(CONFIG_ARCH_EP93XX) := ep93xx + + ifeq ($(CONFIG_ARCH_EBSA110),y) + # This is what happens if you forget the IOCS16 line. +diff -urN linux-2.6.15.commit/arch/arm/mm/Kconfig linux-2.6.15.snap/arch/arm/mm/Kconfig +--- linux-2.6.15.commit/arch/arm/mm/Kconfig 2006-02-12 10:22:18.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/mm/Kconfig 2006-02-19 19:14:48.000000000 +0100 +@@ -62,7 +62,7 @@ + # ARM920T + config CPU_ARM920T + bool "Support ARM920T processor" if !ARCH_S3C2410 +- depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 ++ depends on ARCH_EP93XX || ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 + default y if ARCH_S3C2410 + select CPU_32v4 + select CPU_ABRT_EV4T +diff -urN linux-2.6.15.commit/arch/arm/tools/mach-types linux-2.6.15.snap/arch/arm/tools/mach-types +--- linux-2.6.15.commit/arch/arm/tools/mach-types 2006-02-12 10:22:18.000000000 +0100 ++++ linux-2.6.15.snap/arch/arm/tools/mach-types 2006-02-19 19:49:29.000000000 +0100 +@@ -910,3 +910,4 @@ + nadia2vb MACH_NADIA2VB NADIA2VB 897 + r1000 MACH_R1000 R1000 898 + hw90250 MACH_HW90250 HW90250 899 ++gesbc9312 MACH_GESBC9312 GESBC9312 958 +diff -urN linux-2.6.15.commit/drivers/mtd/maps/physmap.c linux-2.6.15.snap/drivers/mtd/maps/physmap.c +--- linux-2.6.15.commit/drivers/mtd/maps/physmap.c 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/mtd/maps/physmap.c 2006-02-20 21:14:23.000000000 +0100 +@@ -51,6 +51,9 @@ + static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL }; + const char **type; + ++ if (!physmap_map.size) ++ return -EIO; ++ + printk(KERN_NOTICE "physmap flash device: %lx at %lx\n", physmap_map.size, physmap_map.phys); + physmap_map.virt = ioremap(physmap_map.phys, physmap_map.size); + +diff -urN linux-2.6.15.commit/drivers/mtd/nand/Kconfig linux-2.6.15.snap/drivers/mtd/nand/Kconfig +--- linux-2.6.15.commit/drivers/mtd/nand/Kconfig 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/mtd/nand/Kconfig 2006-02-20 21:20:41.000000000 +0100 +@@ -55,6 +55,12 @@ + help + Support for NAND flash on Texas Instruments Toto platform. + ++config MTD_NAND_TS7250 ++ tristate "NAND Flash device on TS-7250 board" ++ depends on MACH_TS72XX && MTD_NAND ++ help ++ Support for NAND flash on Technologic Systems TS-7250 platform. ++ + config MTD_NAND_IDS + tristate + +diff -urN linux-2.6.15.commit/drivers/mtd/nand/Makefile linux-2.6.15.snap/drivers/mtd/nand/Makefile +--- linux-2.6.15.commit/drivers/mtd/nand/Makefile 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/mtd/nand/Makefile 2006-02-20 21:19:38.000000000 +0100 +@@ -17,6 +17,7 @@ + obj-$(CONFIG_MTD_NAND_H1900) += h1910.o + obj-$(CONFIG_MTD_NAND_RTC_FROM4) += rtc_from4.o + obj-$(CONFIG_MTD_NAND_SHARPSL) += sharpsl.o ++obj-$(CONFIG_MTD_NAND_TS7250) += ts7250.o + obj-$(CONFIG_MTD_NAND_NANDSIM) += nandsim.o + + nand-objs = nand_base.o nand_bbt.o +diff -urN linux-2.6.15.commit/drivers/mtd/nand/ts7250.c linux-2.6.15.snap/drivers/mtd/nand/ts7250.c +--- linux-2.6.15.commit/drivers/mtd/nand/ts7250.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/drivers/mtd/nand/ts7250.c 2006-02-22 17:07:53.000000000 +0100 +@@ -0,0 +1,212 @@ ++/* ++ * drivers/mtd/nand/ts7250.c ++ * ++ * Copyright (C) 2004 Technologic Systems (support@embeddedARM.com) ++ * ++ * Derived from drivers/mtd/nand/edb7312.c ++ * Copyright (C) 2004 Marius Gröger (mag@sysgo.de) ++ * ++ * Derived from drivers/mtd/nand/autcpu12.c ++ * Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de) ++ * ++ * $Id: ts7250.c,v 1.4 2004/12/30 22:02:07 joff Exp $ ++ * ++ * 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. ++ * ++ * Overview: ++ * This is a device driver for the NAND flash device found on the ++ * TS-7250 board which utilizes a Samsung 32 Mbyte part. ++ */ ++ ++#include <linux/slab.h> ++#include <linux/module.h> ++#include <linux/init.h> ++#include <linux/mtd/mtd.h> ++#include <linux/mtd/nand.h> ++#include <linux/mtd/partitions.h> ++#include <asm/io.h> ++#include <asm/arch/hardware.h> ++#include <asm/sizes.h> ++ ++/* ++ * MTD structure for TS7250 board ++ */ ++static struct mtd_info *ts7250_mtd = NULL; ++ ++ ++/* ++ * Module stuff ++ */ ++static void *ts7250_nandctrl = (void *)TS72XX_NAND_CONTROL_VIRT_BASE; ++static void *ts7250_nandbusy = (void *)TS72XX_NAND_BUSY_VIRT_BASE; ++ ++#ifdef CONFIG_MTD_PARTITIONS ++/* ++ * Define static partitions for flash device ++ */ ++static struct mtd_partition partition_info32[] = { ++ { ++ .name = "TS-BOOTROM", ++ .offset = 0x00000000, ++ .size = 0x00004000, ++ }, { ++ .name = "Linux", ++ .offset = 0x00004000, ++ .size = 0x01d00000, ++ }, { ++ .name = "RedBoot", ++ .offset = 0x01d04000, ++ .size = 0x002fc000, ++ }, ++}; ++ ++/* ++ * Define static partitions for flash device ++ */ ++static struct mtd_partition partition_info128[] = { ++ { ++ .name = "TS-BOOTROM", ++ .offset = 0x00000000, ++ .size = 0x00004000, ++ }, { ++ .name = "Linux", ++ .offset = 0x00004000, ++ .size = 0x07d00000, ++ }, { ++ .name = "RedBoot", ++ .offset = 0x07d04000, ++ .size = 0x002fc000, ++ }, ++}; ++ ++#define NUM_PARTITIONS 3 ++ ++extern int parse_cmdline_partitions(struct mtd_info *master, ++ struct mtd_partition **pparts, const char *mtd_id); ++#endif ++ ++ ++/* ++ * hardware specific access to control-lines ++ */ ++static void ts7250_hwcontrol(struct mtd_info *mtd, int cmd) ++{ ++ switch(cmd) { ++ case NAND_CTL_SETCLE: ++ writeb(readb(ts7250_nandctrl) | 0x2, ts7250_nandctrl); ++ break; ++ case NAND_CTL_CLRCLE: ++ writeb(readb(ts7250_nandctrl) & ~0x2, ts7250_nandctrl); ++ break; ++ case NAND_CTL_SETALE: ++ writeb(readb(ts7250_nandctrl) | 0x1, ts7250_nandctrl); ++ break; ++ case NAND_CTL_CLRALE: ++ writeb(readb(ts7250_nandctrl) & ~0x1, ts7250_nandctrl); ++ break; ++ case NAND_CTL_SETNCE: ++ writeb(readb(ts7250_nandctrl) | 0x4, ts7250_nandctrl); ++ break; ++ case NAND_CTL_CLRNCE: ++ writeb(readb(ts7250_nandctrl) & ~0x4, ts7250_nandctrl); ++ break; ++ } ++} ++ ++/* ++ * read device ready pin ++ */ ++static int ts7250_device_ready(struct mtd_info *mtd) ++{ ++ return readb(ts7250_nandbusy) & 0x20; ++} ++ ++/* ++ * Main initialization routine ++ */ ++static int __init ts7250_init (void) ++{ ++ struct nand_chip *this; ++ const char *part_type = 0; ++ int mtd_parts_nb = 0; ++ struct mtd_partition *mtd_parts = 0; ++ ++ if (board_is_ts7200()) ++ return -ENXIO; ++ ++ /* Allocate memory for MTD device structure and private data */ ++ ts7250_mtd = kmalloc(sizeof(struct mtd_info) + ++ sizeof(struct nand_chip), GFP_KERNEL); ++ if (!ts7250_mtd) { ++ printk("Unable to allocate TS7250 NAND MTD device structure.\n"); ++ return -ENOMEM; ++ } ++ ++ /* Get pointer to private data */ ++ this = (struct nand_chip *) (&ts7250_mtd[1]); ++ ++ /* Initialize structures */ ++ memset(ts7250_mtd, 0, sizeof(struct mtd_info)); ++ memset(this, 0, sizeof(struct nand_chip)); ++ ++ /* Link the private data with the MTD structure */ ++ ts7250_mtd->priv = this; ++ ++ /* insert callbacks */ ++ this->IO_ADDR_R = (void *)TS72XX_NAND_DATA_VIRT_BASE; ++ this->IO_ADDR_W = (void *)TS72XX_NAND_DATA_VIRT_BASE; ++ this->hwcontrol = ts7250_hwcontrol; ++ this->dev_ready = ts7250_device_ready; ++ this->chip_delay = 15; ++ this->eccmode = NAND_ECC_SOFT; ++ ++ printk("Searching for NAND flash...\n"); ++ /* Scan to find existence of the device */ ++ if (nand_scan (ts7250_mtd, 1)) { ++ kfree (ts7250_mtd); ++ return -ENXIO; ++ } ++ ++#ifdef CONFIG_MTD_CMDLINE_PARTS ++ mtd_parts_nb = parse_cmdline_partitions(ts7250_mtd, &mtd_parts, ++ "ts7250-nand"); ++ if (mtd_parts_nb > 0) ++ part_type = "command line"; ++ else ++ mtd_parts_nb = 0; ++#endif ++ if (mtd_parts_nb == 0) { ++ mtd_parts = partition_info32; ++ if (ts7250_mtd->size >= (128 * 0x100000)) ++ mtd_parts = partition_info128; ++ mtd_parts_nb = NUM_PARTITIONS; ++ part_type = "static"; ++ } ++ ++ /* Register the partitions */ ++ printk(KERN_NOTICE "Using %s partition definition\n", part_type); ++ add_mtd_partitions(ts7250_mtd, mtd_parts, mtd_parts_nb); ++ ++ /* Return happy */ ++ return 0; ++} ++module_init(ts7250_init); ++ ++/* ++ * Clean up routine ++ */ ++static void __exit ts7250_cleanup (void) ++{ ++ /* Unregister the device */ ++ del_mtd_device (ts7250_mtd); ++ ++ /* Free the MTD device structure */ ++ kfree (ts7250_mtd); ++} ++module_exit(ts7250_cleanup); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Jesse Off <joff@embeddedARM.com>"); ++MODULE_DESCRIPTION("MTD map driver for Technologic Systems TS-7250 board"); +diff -urN linux-2.6.15.commit/drivers/net/arm/ep93xx_eth_need_rewrite.c linux-2.6.15.snap/drivers/net/arm/ep93xx_eth_need_rewrite.c +--- linux-2.6.15.commit/drivers/net/arm/ep93xx_eth_need_rewrite.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/drivers/net/arm/ep93xx_eth_need_rewrite.c 2006-02-22 15:54:07.000000000 +0100 +@@ -0,0 +1,1417 @@ ++/* ++ * ep93xx_eth.c ++ * Ethernet Device Driver for Cirrus Logic EP93xx. ++ * ++ * Copyright (C) 2003 by Cirrus Logic www.cirrus.com ++ * This software may be used and distributed according to the terms ++ * of the GNU Public License. ++ * ++ * This driver was written based on skeleton.c by Donald Becker and ++ * smc9194.c by Erik Stahlman. ++ * ++ * Getting a MAC address: ++ * ++ * Former versions of this driver got their MAC from I2C EEPROM or even used ++ * hardcoded ones. Unfortunately I had to remove the board dependant I2C stuff, ++ * and use a random generated MAC instead of the hardcoded one. Good news is ++ * the there is support for setting the MAC from userspace now. (see below) ++ * ++ * first consider some potential problems if you use this random generated MAC: ++ * ++ * you can no longer count on it to be really unique ++ * identifying a particular board over network will be difficult ++ * DHCP servers can no longer use the MAC for assigning static IPs ++ * DHCP servers with long leasetimes quickly run out of leases ++ * ... ++ * ++ * So how can you set a valid MAC from userspace then? ++ * ++ * Let's say you've just bought your OUI from IEEE and it's "aa:bb:cc" ++ * Now you'd like to assign the MAC for your EP93xx board with serial #5 ++ * MAC = OUI<<24 + serial number = aa:bb:cc:00:00:05 ++ * ++ * ifconfig eth0 hw ether aa:bb:cc:00:00:05 # first set the MAC ++ * ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up # then set the IP ++ * ++ * Apart from hardcoding this lines in your startup scripts you could also use ++ * some userspace utility to read (and set) the MAC from eeprom, flash, ... ++ * ++ * History: ++ * 07/19/01 0.1 Sungwook Kim initial release ++ * 10/16/01 0.2 Sungwook Kim add workaround for ignorance of Tx request ++ * while sending frame ++ * add some error stuations handling ++ * ++ * 03/25/03 Melody Lee Modified for EP93xx ++ * ++ * 2004/2005 Michael Burian porting to linux-2.6 ++ * 2005-10-12 Michael Burian fix problems when setting MAC with ifconfig ++ * 2005-10-30 Michael Burian cleanups, ethtool support ++ */ ++ ++/* TODO: ++ * 1. try if it's possible to use skbuff directly for RX/TX (avoid memcpy) ++ * 2. use kzalloc instead of kmalloc+memset ++ */ ++ ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/types.h> ++#include <linux/fcntl.h> ++#include <linux/interrupt.h> ++#include <linux/ioport.h> ++#include <linux/in.h> ++#include <linux/delay.h> ++#include <linux/slab.h> ++#include <linux/string.h> ++#include <linux/errno.h> ++#include <linux/init.h> ++#include <linux/netdevice.h> ++#include <linux/etherdevice.h> ++#include <linux/skbuff.h> ++#include <linux/dma-mapping.h> ++#include <linux/mii.h> ++#include <linux/crc32.h> ++#include <linux/random.h> ++#include <linux/ethtool.h> ++ ++#include <asm/system.h> ++#include <asm/bitops.h> ++#include <asm/io.h> ++#include <asm/dma.h> ++#include <asm/irq.h> ++#include <asm/arch/hardware.h> ++ ++#include "ep93xx_eth_need_rewrite.h" ++ ++#define DRV_NAME "ep93xx_eth" ++#define DRV_VERSION "2.8" ++#define DRV_DATE "2005-11-08" ++ ++static const char *version = DRV_NAME ": version " DRV_VERSION " " DRV_DATE \ ++ " Cirrus Logic\n"; ++ ++/* total number of device instance, 0 means the 1st instance. */ ++static int num_of_instance; ++static struct net_device * ep93xx_etherdev; ++ ++/* ++ * A List of default device port configuration for auto probing. ++ * At this time, the CPU has only one Ethernet device, ++ * but better to support multiple device configuration. ++ * Keep in mind that the array must end in zero. ++ */ ++ ++/* We get the MAC_BASE from include/asm-arm/arch-ep93xx/regmap.h */ ++static struct { ++ unsigned int base_addr; /* base address, (0:end mark) */ ++ int irq; /* IRQ number, (0:auto detect) */ ++} port_list[] __initdata = { ++ { EP93XX_ETHERNET_BASE, IRQ_EP93XX_ETHERNET }, ++ { 0 /* end mark */ , 0 }, ++}; ++ ++/* ++ * Some definitions belong to the operation of this driver. ++ * You should understand how it affect to driver before any modification. ++ */ ++ ++/* Interrupt Sources in Use */ ++#define DEF_INT_SRC (IntEn_TxSQIE|IntEn_RxEOFIE|IntEn_RxEOBIE|IntEn_RxHDRIE) ++ ++/* ++ * Length of Device Queue in number of entries ++ * (must be less than or equal to 255) ++ */ ++ ++/* length of Rx Descriptor Queue (4 or bigger) Must be power of 2. */ ++#define LQRXD 64 ++#define LQRXS LQRXD /* length of Rx Status Queue */ ++ ++/* length of Tx Descriptor Queue (4 or bigger) Must be power of 2. */ ++#define LQTXD 8 ++#define LQTXS LQTXD /* length of Tx Status Queue */ ++ ++/* Tx Queue fill-up level control */ ++#define LVL_TXSTOP LQTXD - 2 /* level to ask the stack to stop Tx */ ++#define LVL_TXRESUME 2 /* level to ask the stack to resume Tx */ ++ ++/* Rx Buffer length in byte */ ++#define LRXB (1518+2+16) /* length of Rx buf, must be 4-byte aligned */ ++#define LTXB LRXB ++ ++#define EP93XX_DEF_MSG (NETIF_MSG_DRV | \ ++ NETIF_MSG_PROBE | \ ++ NETIF_MSG_LINK | \ ++ NETIF_MSG_RX_ERR | \ ++ NETIF_MSG_TX_ERR | \ ++ NETIF_MSG_HW) ++ ++#define DBG(lvl,msg,args...) do { printk(lvl"%s:%d: %s(): " msg, __FILE__, \ ++ __LINE__, __FUNCTION__, ## args); } while (0) ++ ++/* ++ * Custom Data Structures ++ */ ++ ++/* ++ * the information about the buffer passed to device. ++ * there are matching bufdsc informations ++ * for each Tx/Rx Descriptor Queue entry to trace ++ * the buffer within those queues. ++ */ ++struct bufdsc { ++ /* virtual address representing the buffer passed to device */ ++ void *vaddr; ++ /* free routine */ ++ int (*free_rout) (void *buf); ++}; ++ ++/* device private information */ ++struct ep93xx_priv { ++ /* static device information */ ++ int id; /* device instance ID */ ++ /* pointers to various queues (virtual address) */ ++ struct rx_dsc *rdq; /* Rx Descriptor Queue */ ++ struct rx_sts *rsq; /* Rx Status Queue */ ++ struct tx_dsc *tdq; /* Tx Descriptor Queue */ ++ struct tx_sts *tsq; /* Tx Status Queue */ ++ unsigned char *rxbuf; /* base of Rx Buffer pool */ ++ unsigned char *txbuf; /* base of Tx Buffer pool */ ++ struct bufdsc *rxbd; /* Rx Buffers info */ ++ struct bufdsc *txbd; /* Tx Buffers info */ ++ /* physical addresses of the same queues */ ++ dma_addr_t p_qbase; /* base */ ++ dma_addr_t p_rdq; /* Rx Descriptor Queue */ ++ dma_addr_t p_rsq; /* Rx Status Queue */ ++ dma_addr_t p_tdq; /* Tx Descriptor Queue */ ++ dma_addr_t p_tsq; /* Tx Status Queue */ ++ dma_addr_t p_rxbuf; /* Rx Buffer pool */ ++ dma_addr_t p_txbuf; /* Tx Buffer pool */ ++ /* MII Bus ID of Ethernet PHY */ ++ struct mii_if_info mii; ++ /* lock for mii when using ioctls */ ++ spinlock_t mii_lock; ++ /* dynamic information, subject to clear when device open */ ++ struct net_device_stats stats; /* statistic data */ ++ /* next processing index of device queues */ ++ int idx_rdq; ++ int idx_rsq; ++ int idx_tdqhead; ++ int idx_tdqtail; ++ int idx_tsq; ++ void __iomem *base_addr; /* base address */ ++ u32 msg_enable; ++ int regs_len; ++}; ++ ++/* ++ * Internal Routines ++ */ ++ ++static inline unsigned int next_index(unsigned int idx_cur, unsigned int len) ++{ ++ return (idx_cur + 1) % len; /* next array index */ ++} ++ ++static inline u32 _rdl(struct net_device *dev, u32 reg) ++{ ++ return readl(((struct ep93xx_priv *)(netdev_priv(dev)))->base_addr + reg); ++} ++ ++static inline void _wrl(struct net_device *dev, u32 val, u32 reg) ++{ ++ writel(val, ((struct ep93xx_priv *)(netdev_priv(dev)))->base_addr + reg); ++} ++ ++static inline void _wrw(struct net_device *dev, u16 val, u32 reg) ++{ ++ writew(val, ((struct ep93xx_priv *)(netdev_priv(dev)))->base_addr + reg); ++} ++ ++static inline void _wrb(struct net_device *dev, u8 val, u32 reg) ++{ ++ writeb(val, ((struct ep93xx_priv *)(netdev_priv(dev)))->base_addr + reg); ++} ++ ++/** ++ * wait_on_reg() ++ */ ++static int wait_on_reg(struct net_device *dev, int reg, unsigned long mask, unsigned long expect) ++{ ++ int i, dt; ++ ++ for (i = 0; i < 10000; i++) { ++ dt = _rdl(dev, reg); ++ dt = (dt ^ expect) & mask; ++ if (0 == dt) ++ break; ++ } ++ return dt; ++} ++ ++/** ++ * mdio_write() ++ */ ++static void mdio_write(struct net_device *dev, int idPhy, int reg, int dt) ++{ ++ wait_on_reg(dev, REG_MIISts, MIISts_Busy, ~MIISts_Busy); ++ _wrl(dev, dt, REG_MIIData); ++ _wrl(dev, MIICmd_OP_WR | ((idPhy & 0x1f) << 5) | ((reg & 0x1f) << 0), REG_MIICmd); ++} ++ ++/** ++ * mdio_read() ++ */ ++static int mdio_read(struct net_device *dev, int idPhy, int reg) ++{ ++ int dt; ++ ++ wait_on_reg(dev, REG_MIISts, MIISts_Busy, ~MIISts_Busy); ++ _wrl(dev, MIICmd_OP_RD | ((idPhy & 0x1f) << 5) | ((reg & 0x1f) << 0), REG_MIICmd); ++ ++ wait_on_reg(dev, REG_MIISts, MIISts_Busy, ~MIISts_Busy); ++ dt = _rdl(dev, REG_MIIData); ++ ++ return dt & 0xffff; ++} ++ ++/** ++ * phy_init() ++ */ ++static void phy_init(struct net_device *dev) ++{ ++ ++ u32 oldval; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ oldval = _rdl(dev, REG_SelfCTL); ++ ++#if 0 ++ /* Set MDC clock to be divided by 8 and disable PreambleSuppress bit */ ++ _wrl(dev, 0x0e00, REG_SelfCTL); ++#else ++ /* Set MDC clock to be divided by 32 and disable PreambleSuppress bit */ ++ _wrl(dev, 0x6200, REG_SelfCTL); ++#endif ++ ++ if (mii_link_ok(&(priv->mii))) ++ mii_check_media(&(priv->mii), netif_msg_link(priv), 1); ++ ++ /* restore the old value */ ++ _wrl(dev, oldval, REG_SelfCTL); ++} ++ ++/** ++ * devQue_start() ++ * ++ * make descriptor queues active ++ * allocate queue entries if needed ++ * and set device registers up to make it operational ++ * assume device has been initialized ++ */ ++static int devQue_start(struct net_device *dev) ++{ ++ int err; ++ int i; ++ void *buf; ++ u32 phy_addr; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* turn off device bus mastering */ ++ _wrl(dev, BMCtl_RxDis | BMCtl_TxDis | _rdl(dev, REG_BMCtl), REG_BMCtl); ++ err = wait_on_reg(dev, REG_BMSts, BMSts_TxAct, ~BMSts_TxAct); ++ err |= wait_on_reg(dev, REG_BMSts, BMSts_RxAct, ~BMSts_RxAct); ++ if (err && netif_msg_hw(priv)) ++ DBG(KERN_ERR, "%s: BM does not stop\n", dev->name); ++ ++ /* Tx Status Queue */ ++ memset(priv->tsq, 0, sizeof(priv->tsq[0]) * LQTXS); ++ priv->idx_tsq = 0; ++ _wrl(dev, priv->p_tsq, REG_TxSBA); ++ _wrl(dev, priv->p_tsq, REG_TxSCA); ++ _wrw(dev, sizeof(priv->tsq[0]) * LQTXS, REG_TxSBL); ++ _wrw(dev, sizeof(priv->tsq[0]) * LQTXS, REG_TxSCL); ++ ++ /* Tx Descriptor Queue */ ++ memset(priv->tdq, 0, sizeof(priv->tdq[0]) * LQTXD); ++ priv->idx_tdqhead = priv->idx_tdqtail = 0; ++ _wrl(dev, priv->p_tdq, REG_TxDBA); ++ _wrl(dev, priv->p_tdq, REG_TxDCA); ++ _wrw(dev, sizeof(priv->tdq[0]) * LQTXD, REG_TxDBL); ++ _wrw(dev, sizeof(priv->tdq[0]) * LQTXD, REG_TxDCL); ++ ++ /* Rx Status Queue */ ++ memset(priv->rsq, 0, sizeof(priv->rsq[0]) * LQRXS); ++ priv->idx_rsq = 0; ++ _wrl(dev, priv->p_rsq, REG_RxSBA); ++ _wrl(dev, priv->p_rsq, REG_RxSCA); ++ _wrw(dev, sizeof(priv->rsq[0]) * LQRXS, REG_RxSBL); ++ _wrw(dev, sizeof(priv->rsq[0]) * LQRXS, REG_RxSCL); ++ ++ /* Rx Descriptor Queue */ ++ memset(priv->rdq, 0, sizeof(priv->rdq[0]) * LQRXD); ++ phy_addr = priv->p_rxbuf; ++ for (i = 0; i < LQRXD; i++) { ++ priv->rdq[i].bi = i; /* index */ ++ priv->rdq[i].ba = phy_addr; /* physical address */ ++ priv->rdq[i].bl = LRXB; /* length */ ++ phy_addr += LRXB; ++ } ++ priv->idx_rdq = 0; ++ _wrl(dev, priv->p_rdq, REG_RxDBA); ++ _wrl(dev, priv->p_rdq, REG_RxDCA); ++ _wrw(dev, sizeof(priv->rdq[0]) * LQRXD, REG_RxDBL); ++ _wrw(dev, sizeof(priv->rdq[0]) * LQRXD, REG_RxDCL); ++ ++ /* init Rx Buffer Descriptors */ ++ buf = priv->rxbuf; ++ for (i = 0; i < LQRXD; i++) { ++ priv->rxbd[i].vaddr = buf; ++ priv->rxbd[i].free_rout = NULL; ++ buf += LRXB; ++ } ++ ++ /* init Tx Buffer Descriptors */ ++ memset(priv->txbd, 0x0, sizeof(*priv->txbd) * LQTXD); ++ ++ buf = priv->txbuf; ++ for (i = 0; i < LQTXD; i++) { ++ priv->txbd[i].vaddr = buf; ++ priv->txbd[i].free_rout = NULL; ++ buf += LTXB; ++ } ++ ++ /* turn on device bus mastering */ ++ _wrl(dev, BMCtl_TxEn | BMCtl_RxEn | _rdl(dev, REG_BMCtl), REG_BMCtl); ++ err = wait_on_reg(dev, REG_BMSts, BMSts_TxAct | BMSts_TxAct, BMSts_TxAct | BMSts_TxAct); ++ if (err && netif_msg_hw(priv)) ++ DBG(KERN_ERR, "%s: BM does not start\n", dev->name); ++ ++ /* Enqueue whole entries; this must be done after BM activation */ ++ _wrl(dev, LQRXS, REG_RxSEQ); /* Rx Status Queue */ ++ _wrl(dev, LQRXD, REG_RxDEQ); /* Rx Desc. queue */ ++ ++ return 0; ++} ++ ++/** ++ * devQue_init() ++ * init device descriptor queues at system level ++ * device access is not recommended at this point ++ * ++ */ ++static int devQue_init(struct net_device *dev) ++{ ++ void *buf; ++ void *tmp; ++ int size, size2; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* verify device Tx/Rx Descriptor/Status Queue data size */ ++ if (8 != sizeof(struct rx_dsc)) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "sizeof rx_dsc != 8 bytes!\n"); ++ return -ENOMEM; ++ } else if (8 != sizeof(struct rx_sts)) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "sizeof rx_sts != 8 bytes!\n"); ++ return -ENOMEM; ++ } else if (8 != sizeof(struct tx_dsc)) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "sizeof tx_dsc != 8 bytes!\n"); ++ return -ENOMEM; ++ } else if (4 != sizeof(struct tx_sts)) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "sizeof tx_sts != 4 bytes!\n"); ++ return -ENOMEM; ++ } ++ ++ /* ++ allocate kernel memory for whole queues ++ best if non-cached memory block due to DMA access by the device ++ if CPU doesn't have bus snooping ++ */ ++ size = sizeof(struct rx_dsc) * (LQRXD + 1) + ++ sizeof(struct rx_sts) * (LQRXS + 1) + ++ sizeof(struct tx_dsc) * (LQTXD + 1) + ++ sizeof(struct tx_sts) * (LQTXS + 1) + sizeof(unsigned long) * 4; ++ ++ buf = tmp = dma_alloc_coherent(NULL, size, &priv->p_qbase, GFP_KERNEL | GFP_DMA); ++ if (!buf) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "no memory for queue\n"); ++ return -ENOMEM; ++ } ++ ++ /* ++ * assign memory to each queue ++ */ ++ priv->rdq = buf; ++ buf = buf + sizeof(struct rx_dsc) * (LQRXD + 1); ++ priv->rsq = buf; ++ buf = buf + sizeof(struct rx_sts) * (LQRXS + 1); ++ priv->tdq = buf; ++ buf = buf + sizeof(struct tx_dsc) * (LQTXD + 1); ++ priv->tsq = buf; ++ buf = buf + sizeof(struct tx_sts) * (LQTXS + 1); ++ ++ /* ++ * store physical address of each queue ++ */ ++ priv->p_rdq = priv->p_qbase; ++ priv->p_rsq = priv->p_rdq + ((u32) priv->rsq - (u32) priv->rdq); ++ priv->p_tdq = priv->p_rdq + ((u32) priv->tdq - (u32) priv->rdq); ++ priv->p_tsq = priv->p_rdq + ((u32) priv->tsq - (u32) priv->rdq); ++ ++ /* ++ * init queue entries ++ */ ++ memset(priv->rdq, 0, sizeof(struct rx_dsc) * LQRXD); ++ memset(priv->rsq, 0, sizeof(struct rx_sts) * LQRXS); ++ memset(priv->tdq, 0, sizeof(struct tx_dsc) * LQTXD); ++ memset(priv->tsq, 0, sizeof(struct tx_sts) * LQTXS); ++ ++ /* Allocate Rx Buffer ++ (We might need to copy from Rx buf to skbuff in whatever case, ++ because device bus master requires 32bit aligned Rx buffer address ++ but Linux network stack requires odd 16bit aligned Rx buf address) */ ++ priv->rxbuf = dma_alloc_coherent(NULL, LRXB * LQRXD, &priv->p_rxbuf, GFP_KERNEL | GFP_DMA); ++ ++ if (!priv->rxbuf) { ++ priv->rxbuf = NULL; ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "no memory for RxBuf\n"); ++ goto err_free_qbase_1; ++ } ++ ++ /* Allocate Tx Buffer */ ++ priv->txbuf = dma_alloc_coherent(NULL, LTXB * LQTXD, &priv->p_txbuf, GFP_KERNEL | GFP_DMA); ++ ++ if (!priv->txbuf) { ++ priv->txbuf = NULL; ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "no memory for TxBuf\n"); ++ goto err_free_rxbuf_2; ++ } ++ ++ /* ++ * allocate kernel memory for buffer descriptors ++ */ ++ size2 = sizeof(struct bufdsc) * (LQRXD + LQTXD); ++ buf = kmalloc(size2, GFP_KERNEL); ++ if (!buf) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "no memory for buf desc\n"); ++ goto err_free_txbuf_3; ++ } ++ memset(buf, 0x0, size2); /* clear with 0 */ ++ priv->rxbd = buf; ++ priv->txbd = buf + sizeof(struct bufdsc) * LQRXD; ++ ++ return 0; ++ ++err_free_txbuf_3: ++ dma_free_coherent(NULL, LTXB * LQTXD, priv->txbuf, priv->p_txbuf); ++err_free_rxbuf_2: ++ dma_free_coherent(NULL, LRXB * LQRXD, priv->rxbuf, priv->p_rxbuf); ++err_free_qbase_1: ++ dma_free_coherent(NULL, size, tmp, priv->p_qbase); ++ return -ENOMEM; ++} ++ ++/** ++ * devQue_cleanup() ++ * Release queue, Tx buffers and Rx buffers memory ++ * Only call after unregister_netdev ++ */ ++static void devQue_cleanup(struct net_device *dev) ++{ ++ int size; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* descriptor queues size */ ++ size = sizeof(struct rx_dsc) * (LQRXD + 1) + ++ sizeof(struct rx_sts) * (LQRXS + 1) + ++ sizeof(struct tx_dsc) * (LQTXD + 1) + ++ sizeof(struct tx_sts) * (LQTXS + 1) + sizeof(unsigned long) * 4; ++ ++ dma_free_coherent(NULL, size, priv->rdq, priv->p_qbase); ++ dma_free_coherent(NULL, LTXB * LQTXD, priv->txbuf, priv->p_txbuf); ++ dma_free_coherent(NULL, LRXB * LQRXD, priv->rxbuf, priv->p_rxbuf); ++ kfree(priv->rxbd); ++ ++} ++ ++/** ++ * set_multicast_tbl() ++ */ ++static void set_multicast_tbl(struct net_device *dev, u8 *buf) ++{ ++ int i; ++ unsigned char position; ++ struct dev_mc_list *cur_addr; ++ ++ memset(buf, 0x00, 8); ++ ++ cur_addr = dev->mc_list; ++ for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) { ++ ++ if (!cur_addr) ++ break; ++ if (!(*cur_addr->dmi_addr & 1)) ++ continue; /* make sure multicast addr */ ++ position = ether_crc_le(6, cur_addr->dmi_addr) >> 26; ++ buf[position >> 3] |= 1 << (position & 0x07); ++ } ++} ++ ++/** ++ * ind_addr_wr() ++ */ ++static int ind_addr_wr(struct net_device *dev, int afp, char *buf) ++{ ++ u32 rxctl; ++ int i, len; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ afp &= 0x07; ++ if (4 == afp || 5 == afp) { ++ if (netif_msg_hw(priv)) ++ DBG(KERN_ERR, "invalid afp value\n"); ++ return -1; ++ } ++ len = (AFP_AFP_HASH == afp) ? 8 : 6; ++ ++ rxctl = _rdl(dev, REG_RxCTL); /* turn Rx off */ ++ _wrl(dev, ~RxCTL_SRxON & rxctl, REG_RxCTL); ++ _wrl(dev, afp, REG_AFP); /* load new address pattern */ ++ for (i = 0; i < len; i++) ++ _wrb(dev, buf[i], REG_IndAD + i); ++ _wrl(dev, rxctl, REG_RxCTL); /* turn Rx back */ ++ ++ return 0; ++} ++ ++/** ++ * rx_ctl() ++ */ ++static int rx_ctl(struct net_device *dev, int sw) ++{ ++ unsigned long tmp = _rdl(dev, REG_RxCTL); ++ ++ /* ++ * Workaround for MAC lost 60-byte-long frames: ++ * must enable Runt_CRC_Accept bit ++ */ ++ if (sw) ++ _wrl(dev, tmp | RxCTL_SRxON | RxCTL_RCRCA, REG_RxCTL); ++ else ++ _wrl(dev, tmp & ~RxCTL_SRxON, REG_RxCTL); ++ ++ return 0; ++} ++ ++/** ++ * chk_tx_lvl() ++ */ ++static void chk_tx_lvl(struct net_device *dev) ++{ ++ int filled; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* check Tx Descriptor Queue fill-up level */ ++ filled = priv->idx_tdqhead - priv->idx_tdqtail; ++ if (filled < 0) ++ filled += LQTXD; ++ ++ if (filled <= (LVL_TXRESUME + 1)) ++ netif_wake_queue(dev); ++} ++ ++/** ++ * cleanup_tx() ++ */ ++static void cleanup_tx(struct net_device *dev) ++{ ++ struct tx_sts *txsts; ++ int idxsts, bi; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* ++ * process Tx Status Queue (no need to limit processing of TxStatus ++ * Queue because each queue entry consist of 1 dword) ++ */ ++ while (priv->tsq[priv->idx_tsq].flags & TXSTS_TXFP) { ++ idxsts = priv->idx_tsq; ++ priv->idx_tsq = next_index(priv->idx_tsq, LQTXS); ++ txsts = &priv->tsq[idxsts]; ++ if (!(txsts->flags & TXSTS_TXFP)) { /* empty? */ ++ if (netif_msg_tx_err(priv)) ++ DBG(KERN_ERR, "QueTxSts is empty\n"); ++ return; ++ } ++ txsts->flags &= ~TXSTS_TXFP; /* mark processed */ ++ ++ bi = txsts->bi & TXSTS_BI; /* buffer index */ ++ ++ /* statistics collection */ ++ if (txsts->flags & TXSTS_TXWE) { /* Sent without error */ ++ priv->stats.tx_packets++; ++ priv->stats.tx_bytes += ((struct tx_dsc *)(priv->txbd[bi].vaddr))->bl_af & TXDSC_BL; ++ } else { /* Tx failed due to error */ ++ if (netif_msg_tx_err(priv)) ++ DBG(KERN_ERR, "Tx failed QueTxSts"); ++ priv->stats.tx_errors++; ++ if (txsts->flags & TXSTS_LCRS) ++ priv->stats.tx_carrier_errors++; ++ if (txsts->flags & TXSTS_TXU) ++ priv->stats.tx_fifo_errors++; ++ if (txsts->flags & TXSTS_ECOLL) ++ priv->stats.collisions++; ++ } ++ ++ /* free Tx buffer */ ++ if (priv->txbd[bi].free_rout) { ++ (*priv->txbd[bi].free_rout)(priv->txbd[bi].vaddr); ++ priv->txbd[bi].free_rout = NULL; ++ } ++ ++ /* ahead Tx Descriptor Queue tail index */ ++ priv->idx_tdqtail = next_index(priv->idx_tdqtail, LQTXD); ++ } ++} ++ ++/** ++ * restart_tx() ++ */ ++static int restart_tx(struct net_device *dev) ++{ ++ int i; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* disable int */ ++ ++ /* turn off master INT control */ ++ _wrl(dev, _rdl(dev, REG_GIntMsk) & ~GIntMsk_IntEn, REG_GIntMsk); ++ ++ /* stop Tx and disable Tx DMA */ ++ _wrl(dev, _rdl(dev, REG_TxCTL) & ~TxCTL_STxON, REG_TxCTL); ++ _wrl(dev, _rdl(dev, REG_BMCtl) | BMCtl_TxDis, REG_BMCtl); ++ ++ /* reset Tx DMA */ ++ _wrl(dev, BMCtl_TxChR | _rdl(dev, REG_BMCtl), REG_BMCtl); ++ ++ /* release Tx buffers */ ++ for (i = 0; i < LQTXD; i++) { ++ if (priv->txbd[i].free_rout) { ++ priv->txbd[i].free_rout(priv->txbd[i].vaddr); ++ priv->txbd[i].free_rout = NULL; ++ } ++ priv->stats.tx_dropped++; ++ } ++ ++ /* init Tx Queues and flush cache */ ++ memset(priv->tsq, 0, sizeof(priv->tsq[0]) * LQTXS); ++ ++ /* init variables */ ++ priv->idx_tsq = priv->idx_tdqhead = priv->idx_tdqtail = 0; ++ ++ /* init registers */ ++ wait_on_reg(dev, REG_BMSts, BMCtl_TxChR, ~BMCtl_TxChR); ++ _wrl(dev, priv->p_tsq, REG_TxSBA); ++ _wrl(dev, priv->p_tsq, REG_TxSCA); ++ _wrw(dev, sizeof(priv->tsq[0]) * LQTXS, REG_TxSBL); ++ _wrw(dev, sizeof(priv->tsq[0]) * LQTXS, REG_TxSCL); ++ _wrl(dev, priv->p_tdq, REG_TxDBA); ++ _wrl(dev, priv->p_tdq, REG_TxDCA); ++ _wrw(dev, sizeof(priv->tdq[0]) * LQTXD, REG_TxDBL); ++ _wrw(dev, sizeof(priv->tdq[0]) * LQTXD, REG_TxDCL); ++ ++ /* start Tx and enable Tx DMA */ ++ _wrl(dev, _rdl(dev, REG_TxCTL) | TxCTL_STxON, REG_TxCTL); ++ _wrl(dev, _rdl(dev, REG_BMCtl) | BMCtl_TxEn, REG_BMCtl); ++ ++ /* enable int again */ ++ _wrl(dev, _rdl(dev, REG_GIntMsk) | GIntMsk_IntEn, REG_GIntMsk); ++ ++ return 0; ++} ++ ++/** ++ * reset() ++ */ ++static void reset(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ /* soft reset command */ ++ _wrb(dev, SelfCTL_RESET, REG_SelfCTL); ++ if (wait_on_reg(dev, REG_SelfCTL, SelfCTL_RESET, ~SelfCTL_RESET)) ++ if (netif_msg_drv(priv)) ++ DBG(KERN_WARNING, "Soft Reset does not self-clear\n"); ++} ++ ++/** ++ * eth_shutdown()- closes down the Ethernet module ++ * ++ * Make sure to: ++ * 1. disable all interrupt mask ++ * 2. disable Rx ++ * 3. disable Tx ++ * ++ * TODO: ++ * (1) maybe utilize power down mode. ++ * Why not yet? Because while the chip will go into power down mode, ++ * the manual says that it will wake up in response to any I/O requests ++ * in the register space. Empirical results do not show this working. ++ */ ++static int eth_shutdown(struct net_device *dev) ++{ ++ reset(dev); ++ return 0; ++} ++ ++/** ++ * eth_init() - Reset and initialize the device. ++ * ++ * Device should be initialized enough to function in polling mode. ++ * Tx and Rx must be disabled and no INT generation. ++ */ ++static int eth_init(struct net_device *dev) ++{ ++ /* reset device */ ++ reset(dev); ++ ++ /* init PHY */ ++ phy_init(dev); ++ ++ /* init MAC */ ++ ++ /*i Set MDC clock to be divided by 8 and enable PreambleSuppress bit */ ++ _wrl(dev, 0x0f00, REG_SelfCTL); ++ /* mask Interrupt */ ++ _wrl(dev, 0x00, REG_GIntMsk); ++ /* no Rx on at this point */ ++ _wrl(dev, RxCTL_BA | RxCTL_IA0, REG_RxCTL); ++ _wrl(dev, 0x00, REG_TxCTL); ++ _wrl(dev, 0x00, REG_GT); ++ _wrl(dev, 0x00, REG_BMCtl); ++ /* Buffer Threshold */ ++ _wrl(dev, (0x80 << 16) | (0x40 << 0), REG_RxBTH); ++ _wrl(dev, (0x80 << 16) | (0x40 << 0), REG_TxBTH); ++ /* Status Threshold */ ++ _wrl(dev, (4 << 16) | (2 << 0), REG_RxSTH); ++ _wrl(dev, (4 << 16) | (2 << 0), REG_TxSTH); ++ /* Descriptor Threshold */ ++ _wrl(dev, (4 << 16) | (2 << 0), REG_RxDTH); ++ _wrl(dev, (4 << 16) | (2 << 0), REG_TxDTH); ++ /* Max Frame Length & Tx Start Threshold */ ++ _wrl(dev, ((1518 + 1) << 16) | (944 << 0), REG_MaxFL); ++ ++ _rdl(dev, REG_TxCollCnt); /* clear Tx Collision Count */ ++ _rdl(dev, REG_RxMissCnt); /* clear Rx Miss Counter */ ++ _rdl(dev, REG_RxRntCnt); /* clear Rx Runt Counter */ ++ ++ /* clear Pending INT */ ++ _rdl(dev, REG_IntStsC); ++ /* Tx on */ ++ _wrl(dev, TxCTL_STxON | _rdl(dev, REG_TxCTL), REG_TxCTL); ++ ++ /* Set MAC address */ ++ ind_addr_wr(dev, AFP_AFP_IA0, &dev->dev_addr[0]); ++ ++ /* init queue */ ++ devQue_start(dev); ++ ++ return 0; ++} ++ ++/** ++ * rx_isr() - Receive Interrupt Service Routine ++ */ ++static void rx_isr(struct net_device *dev) ++{ ++ struct rx_sts *rxsts; ++ /* index of Rx Status Queue Head from device (next put point) */ ++ int idx_rsqhead; ++ int idxsts; ++ int cnt_sts_processed, cnt_desc_processed; ++ char *dest; ++ struct sk_buff *skb; ++ int len; ++ unsigned int dt; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* get Current Rx Status Queue pointer */ ++ dt = _rdl(dev, REG_RxSCA); ++ ++ /* convert to array index */ ++ idx_rsqhead = (dt - priv->p_rsq) / sizeof(priv->rsq[0]); ++ if (!(0 <= idx_rsqhead && idx_rsqhead < LQRXS)) { ++ if (netif_msg_rx_err(priv)) ++ DBG(KERN_ERR, " invalid REG_RxSCA\n"); ++ return; ++ } ++ ++ /* process Rx (limit to idx_rsqhead due to cache) */ ++ cnt_sts_processed = cnt_desc_processed = 0; ++ while (idx_rsqhead != priv->idx_rsq) { ++ idxsts = priv->idx_rsq; ++ priv->idx_rsq = next_index(priv->idx_rsq, LQRXS); ++ rxsts = &priv->rsq[idxsts]; ++ if (!(rxsts->w1 & RXSTS_RFP)) { /* empty? */ ++ if (netif_msg_rx_err(priv)) ++ DBG(KERN_ERR, "QueRxSts empty\n"); ++ return; ++ } ++ rxsts->w1 &= ~RXSTS_RFP; /* mark processed */ ++ ++ cnt_sts_processed++; ++ ++ if (!(rxsts->w1 & RXSTS_EOB)) /* buffer has no data */ ++ continue; ++ ++ if ((rxsts->bi & RXSTS_BI) != priv->idx_rdq) { ++ if (netif_msg_rx_err(priv)) ++ DBG(KERN_ERR, "unmatching idx_rdq\n"); ++ continue; ++ } ++ priv->idx_rdq = next_index(priv->idx_rdq, LQRXD); ++ cnt_desc_processed++; ++ ++ /* received a frame with error */ ++ if (!((rxsts->w1 & RXSTS_EOF) && (rxsts->w1 & RXSTS_RWE))) { ++ if (netif_msg_rx_err(priv)) ++ DBG(KERN_WARNING, "Rx error RxSts\n"); ++ priv->stats.rx_errors++; ++ if (rxsts->w1 & RXSTS_OE) ++ priv->stats.rx_fifo_errors++; ++ if (rxsts->w1 & RXSTS_FE) ++ priv->stats.rx_frame_errors++; ++ if ((rxsts->w1 & RXSTS_RUNT) || (rxsts->w1 & RXSTS_EDATA)) ++ priv->stats.rx_length_errors++; ++ if (rxsts->w1 & RXSTS_CRCE) ++ priv->stats.rx_crc_errors++; ++ continue; ++ } ++ ++ len = rxsts->fl; ++ ++ /* alloc buffer for protocal stack */ ++ skb = dev_alloc_skb(len + 5); ++ if (NULL == skb) { ++ if (netif_msg_rx_err(priv)) ++ DBG(KERN_ERR, "Low Memory, Rx dropped\n"); ++ priv->stats.rx_dropped++; ++ continue; ++ } ++ ++ /* odd 16 bit alignment to make protocal stack happy */ ++ skb_reserve(skb, 2); ++ skb->dev = dev; ++ dest = skb_put(skb, len); ++ memcpy(dest, priv->rxbd[(rxsts->bi & RXSTS_BI)].vaddr, len); ++ skb->protocol = eth_type_trans(skb, dev); ++ /* pass Rx packet to system */ ++ netif_rx(skb); ++ dev->last_rx = jiffies; ++ priv->stats.rx_packets++; ++ priv->stats.rx_bytes += len; ++ if (RXSTS_AM == (rxsts->w1 & RXSTS_AM)) ++ priv->stats.multicast++; ++ } ++ ++ /* enqueue */ ++ _wrl(dev, cnt_sts_processed, REG_RxSEQ); ++ _wrl(dev, cnt_desc_processed, REG_RxDEQ); ++} ++ ++/** ++ * tx_isr() - Transmit Interrupt Service Routine ++ */ ++static int tx_isr(struct net_device *dev) ++{ ++ cleanup_tx(dev); ++ chk_tx_lvl(dev); /* resume Tx if it was stopped */ ++ return 0; ++} ++ ++/** ++ * ep93xx_isr() ++ */ ++static irqreturn_t ep93xx_isr(int irq, void *dev_id, struct pt_regs *pRegs) ++{ ++ struct net_device *dev = dev_id; ++ int lpCnt; ++ u32 intS; ++ ++ lpCnt = 0; ++ do { ++ /* get INT status and then clear */ ++ intS = _rdl(dev, REG_IntStsC); ++ ++ if (!intS) ++ break; /* no INT */ ++ if (IntSts_RxSQ & intS) ++ rx_isr(dev); /* Rx INT */ ++ if (IntSts_TxSQ & intS) ++ tx_isr(dev); /* Tx INT */ ++ } while (lpCnt++ < 64); /* limit loop to serve other interrupts too */ ++ return IRQ_HANDLED; ++} ++ ++/* Exposed Driver Routines to the Outside World */ ++ ++/** ++ * ep93xx_get_stats() ++ */ ++static struct net_device_stats *ep93xx_get_stats(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ return &priv->stats; ++} ++ ++/** ++ * ep93xx_set_multicast_list() ++ */ ++static void ep93xx_set_multicast_list(struct net_device *dev) ++{ ++ u8 tbl[8 + 1]; ++ ++ if (IFF_PROMISC & dev->flags) { ++ _wrl(dev, RxCTL_PA | _rdl(dev, REG_RxCTL), REG_RxCTL); ++ ++ } else if (IFF_ALLMULTI & dev->flags) { /* receive all multicast addr */ ++ _wrl(dev, RxCTL_MA | (~RxCTL_PA & _rdl(dev, REG_RxCTL)), REG_RxCTL); ++ memset(tbl, 0xff, 8); ++ ind_addr_wr(dev, AFP_AFP_HASH, &tbl[0]); ++ ++ } else if (dev->mc_count) { /* set H/W multicasting filter */ ++ _wrl(dev, RxCTL_MA | (~RxCTL_PA & _rdl(dev, REG_RxCTL)), REG_RxCTL); ++ set_multicast_tbl(dev, &tbl[0]); ++ ind_addr_wr(dev, AFP_AFP_HASH, &tbl[0]); ++ ++ } else { /* no multicasting */ ++ _wrl(dev, ~(RxCTL_PA | RxCTL_MA) & _rdl(dev, REG_RxCTL), REG_RxCTL); ++ } ++} ++ ++/** ++ * ep93xx_tx_timeout() ++ */ ++static void ep93xx_tx_timeout(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ /* If we get here, some higher level has decided we are broken. ++ There should really be a "kick me" function call instead. */ ++ if (netif_msg_tx_err(priv)) ++ DBG(KERN_WARNING, "transmit timed out\n"); ++ ++ phy_init(dev); ++ ++ /* kick Tx engine */ ++ restart_tx(dev); ++ ++ /* ask the Network Stack to resume Tx if there is room available */ ++ chk_tx_lvl(dev); ++} ++ ++/** ++ * ep93xx_start_xmit() ++ */ ++static int ep93xx_start_xmit(struct sk_buff *skb, struct net_device *dev) ++{ ++/* @swk check H/W defect of Tx Underrun Error caused by certain frame length */ ++ struct tx_dsc *txdsc; ++ int idx_tdqhd; ++ int filled; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ idx_tdqhd = priv->idx_tdqhead; ++ txdsc = &priv->tdq[idx_tdqhd]; ++ ++ /* check Tx Descriptor Queue fill-up level */ ++ filled = idx_tdqhd - priv->idx_tdqtail; ++ if (filled < 0) ++ filled += LQTXD; ++ filled += 1; ++ ++ /* check Queue level */ ++ if (LVL_TXSTOP <= filled) { ++ netif_stop_queue(dev); /* no more Tx allowed */ ++ if (netif_msg_tx_err(priv)) ++ DBG(KERN_INFO, "%s: Tx STOP requested\n", dev->name); ++ if (LVL_TXSTOP < filled) { ++ /* this situation can not be happen */ ++ if (netif_msg_tx_err(priv)) ++ DBG(KERN_ERR, "%s: Tx Request while stopped\n", dev->name); ++ return NETDEV_TX_BUSY; ++ } ++ } ++ ++ /* fill up Tx Descriptor Queue entry */ ++ if (skb->len < ETH_ZLEN) { ++ txdsc->bl_af = ETH_ZLEN & TXDSC_BL; /* also clears AF! */ ++ skb = skb_padto(skb, ETH_ZLEN); ++ if (skb == NULL) ++ return NETDEV_TX_OK; ++ } else { ++ txdsc->bl_af = skb->len & TXDSC_BL; /* also clears AF! */ ++ } ++ txdsc->ba = priv->p_txbuf + (idx_tdqhd * LTXB); ++ txdsc->bi_eof = (idx_tdqhd & TXDSC_BI) | TXDSC_EOF; ++ ++ dev->trans_start = jiffies; ++ ++ /* copy data to Tx buffer */ ++ memcpy(priv->txbd[idx_tdqhd].vaddr, skb->data, skb->len); ++ priv->txbd[idx_tdqhd].free_rout = NULL; ++ ++ /* Free the data buffer passed by upper layer */ ++ dev_kfree_skb_any(skb); ++ ++ /* ahead Tx Desc Queue */ ++ priv->idx_tdqhead = next_index(priv->idx_tdqhead, LQTXD); ++ wmb(); ++ ++ /* Enqueue a Tx Descriptor to the device */ ++ _wrl(dev, 1, REG_TxDEQ); ++ ++ if (netif_msg_tx_queued(priv)) ++ DBG(KERN_DEBUG, "%s: Tx packet queued\n", dev->name); ++ ++ return NETDEV_TX_OK; ++} ++ ++/** ++ * ep93xx_close() ++ * ++ * this makes the board clean up everything that it can ++ * and not talk to the outside world. Caused by ++ *. an 'ifconfig ethX down' ++ */ ++static int ep93xx_close(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ free_irq(dev->irq, dev); ++ ++ netif_stop_queue(dev); ++ eth_shutdown(dev); ++ ++ if (netif_msg_ifdown(priv)) ++ DBG(KERN_INFO, "%s: ep93xx_close()\n", dev->name); ++ ++ return 0; ++} ++ ++/** ++ * ep93xx_open() - Open and Initialize the board ++ * ++ * Set up everything, reset the card, etc .. ++ */ ++static int ep93xx_open(struct net_device *dev) ++{ ++ int status; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ /* clear dynamic device info */ ++ memset(&priv->stats, 0, sizeof(priv->stats)); ++ priv->idx_rdq = 0; ++ priv->idx_rsq = 0; ++ priv->idx_tdqhead = 0; ++ priv->idx_tdqtail = 0; ++ priv->idx_tsq = 0; ++ ++ /* reset/init device */ ++ status = eth_init(dev); ++ if (status != 0) { ++ return -EAGAIN; ++ } ++ ++ /* turn on INT, turn on Rx */ ++ status = request_irq(dev->irq, &ep93xx_isr, 0, DRV_NAME, dev); ++ if (status) { ++ if (netif_msg_ifup(priv)) ++ DBG(KERN_ERR, "%s: unable to get IRQ\n", dev->name); ++ return status; ++ } ++ ++ /* Enable interrupt driven operation. Also turn on Rx but no Tx. */ ++ /* setup Interrupt sources */ ++ _wrl(dev, DEF_INT_SRC, REG_IntEn); ++ /* turn on INT */ ++ _wrl(dev, GIntMsk_IntEn, REG_GIntMsk); ++ /* turn on Rx */ ++ rx_ctl(dev, 1); ++ ++ /* link to upper layer */ ++ netif_start_queue(dev); ++ ++ if (netif_msg_ifup(priv)) ++ DBG(KERN_INFO, "%s: irq=%d\n", dev->name, dev->irq); ++ ++ return 0; ++} ++ ++static int ep93xx_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ int rc; ++ ++ if (!netif_running(dev)) ++ return -EINVAL; ++ ++ spin_lock_irq(&priv->mii_lock); ++ rc = generic_mii_ioctl(&priv->mii, if_mii(rq), cmd, NULL); ++ spin_unlock_irq(&priv->mii_lock); ++ ++ return rc; ++} ++ ++/* ++ * Ethtool support ++ */ ++ ++static void ep93xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ++{ ++ strcpy(info->driver, DRV_NAME); ++ strcpy(info->version, DRV_VERSION); ++} ++ ++static int ep93xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ spin_lock_irq(&priv->mii_lock); ++ mii_ethtool_gset(&priv->mii, cmd); ++ spin_unlock_irq(&priv->mii_lock); ++ return 0; ++} ++ ++static int ep93xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ int rc; ++ spin_lock_irq(&priv->mii_lock); ++ rc = mii_ethtool_sset(&priv->mii, cmd); ++ spin_unlock_irq(&priv->mii_lock); ++ return rc; ++} ++ ++static int ep93xx_nway_reset(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ return mii_nway_restart(&priv->mii); ++} ++ ++static u32 ep93xx_get_link(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ return mii_link_ok(&priv->mii); ++} ++ ++static u32 ep93xx_get_msglevel(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ return priv->msg_enable; ++} ++ ++static void ep93xx_set_msglevel(struct net_device *dev, u32 datum) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ priv->msg_enable = datum; ++} ++ ++static void ep93xx_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *regbuf) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ spin_lock_irq(&priv->mii_lock); ++ memcpy_fromio(regbuf, priv->base_addr, regs->len); ++ spin_unlock_irq(&priv->mii_lock); ++} ++ ++static int ep93xx_get_regs_len(struct net_device *dev) ++{ ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ return priv->regs_len; ++} ++ ++static struct ethtool_ops ep93xx_ethtool_ops = { ++ .get_drvinfo = ep93xx_get_drvinfo, ++ .get_settings = ep93xx_get_settings, ++ .set_settings = ep93xx_set_settings, ++ .get_regs = ep93xx_get_regs, ++ .get_regs_len = ep93xx_get_regs_len, ++ .nway_reset = ep93xx_nway_reset, ++ .get_link = ep93xx_get_link, ++ .get_msglevel = ep93xx_get_msglevel, ++ .set_msglevel = ep93xx_set_msglevel, ++}; ++ ++/** ++ * driver_init() - Logical driver initialization for an individual device ++ * ++ * Minimum device H/W access at this point ++ * ++ * Task: ++ * Initialize the structure if needed ++ * print out my vanity message if not done so already ++ * print out what type of hardware is detected ++ * print out the ethernet address ++ * find the IRQ ++ * set up my private data ++ * configure the dev structure with my subroutines ++ * actually GRAB the irq. ++ * GRAB the region ++ * ++ */ ++static int __init driver_init(struct net_device *dev, u32 baseA, int irq) ++{ ++ int i; ++ struct resource *res; ++ struct sockaddr sa; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ if (0 == num_of_instance) ++ printk("%s", version); ++ ++ /* skip probing for a second one, we _know_ that it does not exist */ ++ if (1 == num_of_instance) ++ return -ENODEV; ++ ++ memset(dev->priv, 0x00, sizeof(struct ep93xx_priv)); ++ ++ /* device instance ID */ ++ priv->id = num_of_instance; ++ ++ /* mii stuff */ ++ spin_lock_init(&priv->mii_lock); ++ priv->mii.dev = dev; ++ priv->mii.mdio_read = mdio_read; ++ priv->mii.mdio_write = mdio_write; ++ priv->mii.phy_id_mask = 0x1f; ++ priv->mii.reg_num_mask = 0x1f; ++ priv->msg_enable = EP93XX_DEF_MSG; ++ priv->regs_len = DEV_REG_SPACE; ++ ++ priv->base_addr = (void *)(baseA); ++ ++ dev->irq = irq; ++ ++ res = request_mem_region(baseA, DEV_REG_SPACE, DRV_NAME); ++ if (res == NULL) { ++ if (netif_msg_probe(priv)) ++ DBG(KERN_ERR, "request_mem_region failed!\n"); ++ goto err_free_priv_1; ++ } ++ ++ dev->open = &ep93xx_open; ++ dev->stop = &ep93xx_close; ++ dev->do_ioctl = &ep93xx_ioctl; ++ dev->hard_start_xmit = &ep93xx_start_xmit; ++ dev->tx_timeout = &ep93xx_tx_timeout; ++ dev->watchdog_timeo = HZ * 5; ++ dev->get_stats = &ep93xx_get_stats; ++ dev->set_multicast_list = &ep93xx_set_multicast_list; ++ dev->ethtool_ops = &ep93xx_ethtool_ops; ++ ++ ether_setup(dev); ++ ++ if (devQue_init(dev)) ++ goto err_free_bd_memregion_irq_2; ++ ++ reset(dev); ++ ++ /* ++ * use a random MAC for now - ++ * don't forget to set a valid MAC later on with ifconfig ++ */ ++ sa.sa_family = AF_INET; ++// random_ether_addr(sa.sa_data); ++ memcpy(sa.sa_data, "\x00\xd0\x69\x40\x2b\x13", 6); ++ dev->set_mac_address(dev, &sa); ++ ++ if (netif_msg_probe(priv)) { ++ printk(KERN_INFO DRV_NAME ": #%d at 0x%p IRQ:%d\n", priv->id, priv->base_addr, dev->irq); ++ printk(KERN_INFO DRV_NAME ": using random number"); ++ for (i = 0; i < 6; i++) ++ printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]); ++ ++ printk(" as MAC, don't forget to assign a valid MAC later!\n"); ++ } ++ num_of_instance++; ++ return 0; ++ ++err_free_bd_memregion_irq_2: ++ kfree(priv->rxbd); ++ disable_irq(dev->irq); ++ free_irq(dev->irq, dev); ++ release_mem_region((u32)priv->base_addr, DEV_REG_SPACE); ++err_free_priv_1: ++ kfree(dev->priv); ++ return -EAGAIN; ++} ++ ++/** ++ * ep93xx_probe - probe for ep93xx device ++ * ++ * Probe for the one (and only) ethernet device found on ++ * EP93xx SOC CPU. ++ */ ++static int __init ep93xx_probe(void) ++{ ++ int err; ++ struct ep93xx_priv *priv; ++ struct net_device *dev = alloc_etherdev(sizeof(struct ep93xx_priv)); ++ ++ if (!dev) ++ return -ENODEV; ++ ++ priv = netdev_priv(dev); ++ ++ SET_MODULE_OWNER(dev); ++ ++ sprintf(dev->name, "eth0"); ++ ++ priv->base_addr = (void *)(port_list[0].base_addr); ++ ++ dev->irq = port_list[0].irq; ++ ++ err = driver_init(dev, (u32)priv->base_addr, dev->irq); ++ if (err) ++ goto err_free_netdev; ++ ++ err = register_netdev(dev); ++ if (err) ++ goto err_free_memregion_irq_1; ++ ++ ep93xx_etherdev = dev; ++ disable_irq(dev->irq); ++ return 0; ++ ++err_free_memregion_irq_1: ++ kfree(priv->rxbd); ++ disable_irq(dev->irq); ++ free_irq(dev->irq, dev); ++ release_mem_region((u32)priv->base_addr, DEV_REG_SPACE); ++err_free_netdev: ++ free_netdev(dev); ++ return err; ++} ++ ++static void __exit ep93xx_exit(void) ++{ ++ struct net_device *dev = ep93xx_etherdev; ++ struct ep93xx_priv *priv = netdev_priv(dev); ++ ++ if (dev) { ++ unregister_netdev(dev); ++ devQue_cleanup(dev); ++ free_irq(dev->irq, dev); ++ release_mem_region((u32)priv->base_addr, DEV_REG_SPACE); ++ free_netdev(dev); ++ } ++} ++ ++module_init(ep93xx_probe); ++module_exit(ep93xx_exit); ++MODULE_LICENSE("GPL"); +diff -urN linux-2.6.15.commit/drivers/net/arm/ep93xx_eth_need_rewrite.h linux-2.6.15.snap/drivers/net/arm/ep93xx_eth_need_rewrite.h +--- linux-2.6.15.commit/drivers/net/arm/ep93xx_eth_need_rewrite.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/drivers/net/arm/ep93xx_eth_need_rewrite.h 2006-02-20 00:09:48.000000000 +0100 +@@ -0,0 +1,355 @@ ++/* ++ * ep93xx_eth.h ++ * : header file of Ethernet Device Driver for Cirrus Logic EP93xx. ++ * ++ * Copyright (C) 2003 by Cirrus Logic www.cirrus.com ++ * This software may be used and distributed according to the terms ++ * of the GNU Public License. ++ * ++ * This file contains device related information like register info ++ * and register access method macros for the Ethernet device ++ * embedded within Cirrus Logic's EP93xx SOC chip. ++ * ++ * Information contained in this file was obtained from ++ * the EP9312 Manual Revision 0.12 and 0.14 from Cirrus Logic. ++ * ++ * History ++ * 05/18/01 Sungwook Kim Initial release ++ * 03/25/2003 Melody Modified for EP92xx ++ */ ++ ++#ifndef _EP93xx_ETH_H_ ++#define _EP93xx_ETH_H_ ++ ++/* ++ * Definition of the registers. ++ * For details, refer to the datasheet . ++ * ++ * Basically, most registers are 32 bits width register. ++ * But some are 16 bits and some are 6 or 8 bytes long. ++ */ ++ ++#define REG_RxCTL 0x0000 /*offset to Receiver Control Reg */ ++#define RxCTL_PauseA (1<<20) ++#define RxCTL_RxFCE1 (1<<19) ++#define RxCTL_RxFCE0 (1<<18) ++#define RxCTL_BCRC (1<<17) ++#define RxCTL_SRxON (1<<16) ++#define RxCTL_RCRCA (1<<13) ++#define RxCTL_RA (1<<12) ++#define RxCTL_PA (1<<11) ++#define RxCTL_BA (1<<10) ++#define RxCTL_MA (1<<9) ++#define RxCTL_IAHA (1<<8) ++#define RxCTL_IA3 (1<<3) ++#define RxCTL_IA2 (1<<2) ++#define RxCTL_IA1 (1<<1) ++#define RxCTL_IA0 (1<<0) ++ ++#define REG_TxCTL 0x0004 /*offset to Transmit Control Reg */ ++#define TxCTL_DefDis (1<<7) ++#define TxCTL_MBE (1<<6) ++#define TxCTL_ICRC (1<<5) ++#define TxCTL_TxPD (1<<5) ++#define TxCTL_OColl (1<<3) ++#define TxCTL_SP (1<<2) ++#define TxCTL_PB (1<<1) ++#define TxCTL_STxON (1<<0) ++ ++#define REG_TestCTL 0x0008 /*Test Control Reg, R/W */ ++#define TestCTL_MACF (1<<7) ++#define TestCTL_MFDX (1<<6) ++#define TestCTL_DB (1<<5) ++#define TestCTL_MIIF (1<<4) ++ ++#define REG_MIICmd 0x0010 /*offset to MII Command Reg, R/W */ ++#define MIICmd_OP (0x03<<14) ++#define MIICmd_OP_RD (2<<14) ++#define MIICmd_OP_WR (1<<14) ++#define MIICmd_PHYAD (0x1f<<5) ++#define MIICmd_REGAD (0x1f<<0) ++ ++#define REG_MIIData 0x0014 /*offset to MII Data Reg, R/W */ ++#define MIIData_MIIData (0xffff<<0) ++ ++#define REG_MIISts 0x0018 /*offset to MII Status Reg, R */ ++#define MIISts_Busy (1<<0) ++ ++#define REG_SelfCTL 0x0020 /*offset to Self Control Reg */ ++#define SelfCTL_RWP (1<<7) /*Remote Wake Pin */ ++#define SelfCTL_GPO0 (1<<5) ++#define SelfCTL_PUWE (1<<4) ++#define SelfCTL_PDWE (1<<3) ++#define SelfCTL_MIIL (1<<2) ++#define SelfCTL_RESET (1<<0) ++ ++#define REG_IntEn 0x0024 /*Interrupt Enable Reg, R/W */ ++#define IntEn_RWIE (1<<30) ++#define IntEn_RxMIE (1<<29) ++#define IntEn_RxBIE (1<<28) ++#define IntEn_RxSQIE (1<<27) ++#define IntEn_TxLEIE (1<<26) ++#define IntEn_ECIE (1<<25) ++#define IntEn_TxUHIE (1<<24) ++#define IntEn_MOIE (1<<18) ++#define IntEn_TxCOIE (1<<17) ++#define IntEn_RxROIE (1<<16) ++#define IntEn_MIIIE (1<<12) ++#define IntEn_PHYSIE (1<<11) ++#define IntEn_TIE (1<<10) ++#define IntEn_SWIE (1<<8) ++#define IntEn_TxSQIE (1<<3) ++#define IntEn_RxEOFIE (1<<2) ++#define IntEn_RxEOBIE (1<<1) ++#define IntEn_RxHDRIE (1<<0) ++ ++#define REG_IntStsP 0x0028 /*offset to Interrupt Status Preserve Reg, R/W */ ++#define REG_IntStsC 0x002c /*offset to Interrupt Status Clear Reg, R */ ++#define IntSts_RWI (1<<30) ++#define IntSts_RxMI (1<<29) ++#define IntSts_RxBI (1<<28) ++#define IntSts_RxSQI (1<<27) ++#define IntSts_TxLEI (1<<26) ++#define IntSts_ECI (1<<25) ++#define IntSts_TxUHI (1<<24) ++#define IntSts_MOI (1<<18) ++#define IntSts_TxCOI (1<<17) ++#define IntSts_RxROI (1<<16) ++#define IntSts_MIII (1<<12) ++#define IntSts_PHYSI (1<<11) ++#define IntSts_TI (1<<10) ++#define IntSts_AHBE (1<<9) ++#define IntSts_SWI (1<<8) ++#define IntSts_OTHER (1<<4) ++#define IntSts_TxSQ (1<<3) ++#define IntSts_RxSQ (1<<2) ++ ++#define REG_GT 0x0040 /*offset to General Timer Reg */ ++#define GT_GTC (0xffff<<16) ++#define GT_GTP (0xffff<<0) ++ ++#define REG_FCT 0x0044 /*offset to Flow Control Timer Reg */ ++#define FCT_FCT (0x00ffffff<<0) ++ ++#define REG_FCF 0x0048 /*offset to Flow Control Format Reg */ ++#define FCF_MACCT (0xffff<<16) ++#define FCF_TPT (0xffff<<0) ++ ++#define REG_AFP 0x004c /*offset to Address Filter Pointer Reg */ ++#define AFP_AFP (0x07<<0) /*Address Filter Pointer ++ (bank control for REG_IndAD) */ ++#define AFP_AFP_IA0 0 /*Primary Individual Address (MAC Addr) */ ++#define AFP_AFP_IA1 1 /*Individual Address 1 */ ++#define AFP_AFP_IA2 2 /*Individual Address 2 */ ++#define AFP_AFP_IA3 3 /*Individual Address 3 */ ++#define AFP_AFP_DTxP 6 /*Destination Address of Tx Pause Frame */ ++#define AFP_AFP_HASH 7 /*Hash Table */ ++ ++#define REG_IndAD 0x0050 /*offset to Individual Address Reg, ++ n bytes, R/W */ ++ ++#define REG_GIntSts 0x0060 /*offset to Global Interrupt ++ Status Reg (writing 1 will clear) */ ++#define REG_GIntROS 0x0068 /*offset to Global Interrupt ++ Status Read Only Reg */ ++#define GIntSts_INT (1<<15) /*Global Interrupt Request Status */ ++ ++#define REG_GIntMsk 0x0064 /*offset to Global Interrupt Mask Reg */ ++#define GIntMsk_IntEn (1<<15) /*Global Interrupt Enable */ ++ ++#define REG_GIntFrc 0x006c /*offset to Global Interrupt Force Reg */ ++#define GIntFrc_INT (1<<15) /*Force to set GIntSts */ ++ ++#define REG_TxCollCnt 0x0070 /*Transmit Collision Count Reg, R */ ++#define REG_RxMissCnt 0x0074 /*Receive Miss Count Reg, R */ ++#define REG_RxRntCnt 0x0078 /*Receive Runt Count Reg, R */ ++ ++#define REG_BMCtl 0x0080 /*offset to Bus Master Control Reg, R/W */ ++#define BMCtl_MT (1<<13) ++#define BMCtl_TT (1<<12) ++#define BMCtl_UnH (1<<11) ++#define BMCtl_TxChR (1<<10) ++#define BMCtl_TxDis (1<<9) ++#define BMCtl_TxEn (1<<8) ++#define BMCtl_EH2 (1<<6) ++#define BMCtl_EH1 (1<<5) ++#define BMCtl_EEOB (1<<4) ++#define BMCtl_RxChR (1<<2) ++#define BMCtl_RxDis (1<<1) ++#define BMCtl_RxEn (1<<0) ++ ++#define REG_BMSts 0x0084 /*offset to Bus Master Status Reg, R */ ++#define BMSts_TxAct (1<<7) ++#define BMSts_TP (1<<4) ++#define BMSts_RxAct (1<<3) ++#define BMSts_QID (0x07<<0) ++#define BMSts_QID_RxDt (0<<0) ++#define BMSts_QID_TxDt (1<<0) ++#define BMSts_QID_RxSts (2<<0) ++#define BMSts_QID_TxSts (3<<0) ++#define BMSts_QID_RxDesc (4<<0) ++#define BMSts_QID_TxDesc (5<<0) ++ ++#define REG_RBCA 0x0088 /*offset to Receive Buffer ++ Current Address Reg, R */ ++#define REG_TBCA 0x008c /*offset to Transmit Buffer ++ Current Address Reg, R */ ++ ++#define REG_RxDBA 0x0090 /*offset to Receive Descriptor Queue ++ Base Address Reg, R/W */ ++#define REG_RxDBL 0x0094 /*offset to Receive Descriptor Queue ++ Base Length Reg, R/W, 16bits */ ++#define REG_RxDCL 0x0096 /*offset to Receive Descriptor Queue ++ Current Length Reg, R/W, 16bits */ ++#define REG_RxDCA 0x0098 /*offset to Receive Descriptor Queue ++ Current Address Reg, R/W */ ++ ++#define REG_RxDEQ 0x009c /*offset to Receive Descriptor ++ Enqueue Reg, R/W */ ++#define RxDEQ_RDV (0xffff<<16) /*R 16bit; Receive Descriptor Value */ ++#define RxDEQ_RDI (0xff<<0) /*W 8bit; Receive Descriptor Increment */ ++ ++#define REG_RxSBA 0x00a0 /*offset to Receive Status Queue ++ Base Address Reg, R/W */ ++#define REG_RxSBL 0x00a4 /*offset to Receive Status Queue ++ Base Length Reg, R/W, 16bits */ ++#define REG_RxSCL 0x00a6 /*offset to Receive Status Queue ++ Current Length Reg, R/W, 16bits */ ++#define REG_RxSCA 0x00a8 /*offset to Receive Status Queue ++ Current Address Reg, R/W */ ++ ++#define REG_RxSEQ 0x00ac /*offset to Receive Status Queue ++ Current Address Reg, R/W */ ++#define RxSEQ_RSV (0xffff<<16) ++#define RxSEQ_RSI (0xff<<0) ++ ++#define REG_TxDBA 0x00b0 /*offset to Transmit Descriptor Queue ++ Base Address Reg, R/W */ ++#define REG_TxDBL 0x00b4 /*offset to Transmit Descriptor Queue ++ Base Length Reg, R/W, 16bits */ ++#define REG_TxDCL 0x00b6 /*offset to Transmit Descriptor Queue ++ Current Length Reg, R/W, 16bits */ ++#define REG_TxDCA 0x00b8 /*offset to Transmit Descriptor Queue ++ Current Address Reg, R/W */ ++ ++#define REG_TxDEQ 0x00bc /*offset to Transmit Descriptor Queue ++ Current Address Reg, R/W */ ++#define TxDEQ_TDV (0xffff<<16) ++#define TxDEQ_TDI (0xff<<0) ++ ++#define REG_TxSBA 0x00c0 /*offset to Transmit Status Queue ++ Base Address Reg, R/W */ ++#define REG_TxSBL 0x00c4 /*offset to Transmit Status Queue ++ Base Length Reg, R/W, 16bits */ ++#define REG_TxSCL 0x00c6 /*offset to Transmit Status Queue ++ Current Length Reg, R/W, 16bits */ ++#define REG_TxSCA 0x00c8 /*offset to Transmit Status Queue ++ Current Address Reg, R/W */ ++ ++#define REG_RxBTH 0x00d0 /*offset to Receive Buffer ++ Threshold Reg, R/W */ ++#define RxBTH_RDHT (0x03ff<<16) ++#define RxBTH_RDST (0x03ff<<0) ++ ++#define REG_TxBTH 0x00d4 /*offset to Transmit Buffer ++ Threshold Reg, R/W */ ++#define TxBTH_TDHT (0x03ff<<16) ++#define TxBTH_TDST (0x03ff<<0) ++ ++#define REG_RxSTH 0x00d8 /*offset to Receive Status ++ Threshold Reg, R/W */ ++#define RxSTH_RSHT (0x003f<<16) ++#define RxSTH_RSST (0x003f<<0) ++ ++#define REG_TxSTH 0x00dc /*offset to Transmit Status ++ Threshold Reg, R/W */ ++#define TxSTH_TSHT (0x003f<<16) ++#define TxSTH_TSST (0x003f<<0) ++ ++#define REG_RxDTH 0x00e0 /*offset to Receive Descriptor ++ Threshold Reg, R/W */ ++#define RxDTH_RDHT (0x003f<<16) ++#define RxDTH_RDST (0x003f<<0) ++ ++#define REG_TxDTH 0x00e4 /*offset to Transmit Descriptor ++ Threshold Reg, R/W */ ++#define TxDTH_TDHT (0x003f<<16) ++#define TxDTH_TDST (0x003f<<0) ++ ++#define REG_MaxFL 0x00e8 /*offset to Max Frame Length Reg, R/W */ ++#define MaxFL_MFL (0x07ff<<16) ++#define MaxFL_TST (0x07ff<<0) ++ ++#define REG_RxHL 0x00ec /*offset to Receive Header Length Reg, R/W */ ++#define RxHL_RHL2 (0x07ff<<16) ++#define RxHL_RHL1 (0x03ff<<0) ++ ++#define REG_MACCFG0 0x0100 /*offset to Test Reg #0, R/W */ ++#define MACCFG0_DbgSel (1<<7) ++#define MACCFG0_LCKEN (1<<6) ++#define MACCFG0_LRATE (1<<5) ++#define MACCFG0_RXERR (1<<4) ++#define MACCFG0_BIT33 (1<<2) ++#define MACCFG0_PMEEN (1<<1) ++#define MACCFG0_PMEST (1<<0) ++ ++#define REG_MACCFG1 0x0104 /*offset to Test Reg #1, R/W */ ++#define REG_MACCFG2 0x0108 /*offset to Test Reg #2, R */ ++#define REG_MACCFG3 0x010c /*offset to Test Reg #3, R */ ++ ++/*--------------------------------------------------------------- ++ * Definition of Descriptor/Status Queue Entry ++ *-------------------------------------------------------------*/ ++struct rx_dsc { ++ __be32 ba; ++ __be16 bl; ++ __be16 bi; /* let nsof flag be part of bi */ ++}; ++ ++#define RXSTS_RFP 0x80000000 ++#define RXSTS_RWE 0x40000000 ++#define RXSTS_EOF 0x20000000 ++#define RXSTS_EOB 0x10000000 ++#define RXSTS_AM 0x00C00000 ++#define RXSTS_OE 0x00100000 ++#define RXSTS_FE 0x00080000 ++#define RXSTS_RUNT 0x00040000 ++#define RXSTS_EDATA 0x00020000 ++#define RXSTS_CRCE 0x00010000 ++ ++#define RXSTS_BI 0x7FFF ++struct rx_sts { /* Receive Status Queue Entry */ ++ __be32 w1; ++ __be16 fl; ++ __be16 bi; /* bi and rfp2 */ ++}; ++ ++#define TXDSC_BL 0x0FFF ++#define TXDSC_AF 0x8000 ++#define TXDSC_BI 0x7FFF ++#define TXDSC_EOF 0x8000 ++struct tx_dsc { /* Transmit Descriptor Queue Entry */ ++ __be32 ba; /*b31-0: physical Buffer Address */ ++ __be16 bl_af; /* Buffer Length, Abort Frame */ ++ __be16 bi_eof; /* Buffer Index, End Of Frame */ ++}; ++ ++#define TXSTS_BI 0x7fff ++#define TXSTS_TXFP 0x80 ++#define TXSTS_TXWE 0x40 ++#define TXSTS_LCRS 0x10 ++#define TXSTS_TXU 0x02 ++#define TXSTS_ECOLL 0x01 ++ ++struct tx_sts { ++ __be16 bi; ++ u8 ncoll; ++ u8 flags; ++}; ++ ++/* ++ * Size of device registers occupied in memory/IO address map ++ */ ++#define DEV_REG_SPACE 0x00010000 ++ ++#endif /* _EP93xx_ETH_H_ */ +diff -urN linux-2.6.15.commit/drivers/net/arm/Kconfig linux-2.6.15.snap/drivers/net/arm/Kconfig +--- linux-2.6.15.commit/drivers/net/arm/Kconfig 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/net/arm/Kconfig 2006-02-20 00:10:36.000000000 +0100 +@@ -44,3 +44,12 @@ + will generate a suitable hw address based on the board serial + number (MTD support is required for this). Otherwise you will + need to set a suitable hw address using ifconfig. ++ ++config EP93XX_ETHERNET ++ tristate "EP93xx Ethernet support" ++ depends on NET_ETHERNET && ARM && ARCH_EP93XX ++ select CRC32 ++ select MII ++ help ++ This is a driver for the ethernet hardware included in EP93xx CPUs. ++ Say Y if you are building a kernel for EP93xx based devices. +diff -urN linux-2.6.15.commit/drivers/net/arm/Makefile linux-2.6.15.snap/drivers/net/arm/Makefile +--- linux-2.6.15.commit/drivers/net/arm/Makefile 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/net/arm/Makefile 2006-02-20 00:12:09.000000000 +0100 +@@ -8,3 +8,4 @@ + obj-$(CONFIG_ARM_ETHERH) += etherh.o + obj-$(CONFIG_ARM_ETHER3) += ether3.o + obj-$(CONFIG_ARM_ETHER1) += ether1.o ++obj-$(CONFIG_EP93XX_ETHERNET) += ep93xx_eth_need_rewrite.o +diff -urN linux-2.6.15.commit/drivers/serial/amba-pl010.c linux-2.6.15.snap/drivers/serial/amba-pl010.c +--- linux-2.6.15.commit/drivers/serial/amba-pl010.c 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/serial/amba-pl010.c 2006-02-20 00:08:56.000000000 +0100 +@@ -93,8 +93,8 @@ + * UART0 7 6 + * UART1 5 4 + */ +-#define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) +-#define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) ++//#define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) ++//#define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) + + /* + * We wrap our port structure around the generic uart_port. +@@ -339,8 +339,8 @@ + else + ctrls |= uap->dtr_mask; + +- __raw_writel(ctrls, SC_CTRLS); +- __raw_writel(ctrlc, SC_CTRLC); ++// __raw_writel(ctrls, SC_CTRLS); ++// __raw_writel(ctrlc, SC_CTRLC); + } + + static void pl010_break_ctl(struct uart_port *port, int break_state) +@@ -568,11 +568,12 @@ + static struct uart_amba_port amba_ports[UART_NR] = { + { + .port = { +- .membase = (void *)IO_ADDRESS(INTEGRATOR_UART0_BASE), +- .mapbase = INTEGRATOR_UART0_BASE, ++ .membase = (void *)(EP93XX_APB_VIRT_BASE + 0x000c0000), ++ .mapbase = EP93XX_APB_PHYS_BASE + 0x000c0000, + .iotype = SERIAL_IO_MEM, +- .irq = IRQ_UARTINT0, +- .uartclk = 14745600, ++ .irq = IRQ_EP93XX_UART1, ++// .uartclk = 14745600, ++ .uartclk = 7372800, + .fifosize = 16, + .ops = &amba_pl010_pops, + .flags = ASYNC_BOOT_AUTOCONF, +@@ -583,11 +584,12 @@ + }, + { + .port = { +- .membase = (void *)IO_ADDRESS(INTEGRATOR_UART1_BASE), +- .mapbase = INTEGRATOR_UART1_BASE, ++ .membase = (void *)(EP93XX_APB_VIRT_BASE + 0x000d0000), ++ .mapbase = EP93XX_APB_PHYS_BASE + 0x000d0000, + .iotype = SERIAL_IO_MEM, +- .irq = IRQ_UARTINT1, +- .uartclk = 14745600, ++ .irq = IRQ_EP93XX_UART2, ++// .uartclk = 14745600, ++ .uartclk = 7372800, + .fifosize = 16, + .ops = &amba_pl010_pops, + .flags = ASYNC_BOOT_AUTOCONF, +diff -urN linux-2.6.15.commit/drivers/usb/host/ohci-ep93xx.c linux-2.6.15.snap/drivers/usb/host/ohci-ep93xx.c +--- linux-2.6.15.commit/drivers/usb/host/ohci-ep93xx.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/drivers/usb/host/ohci-ep93xx.c 2006-02-28 02:18:54.000000000 +0100 +@@ -0,0 +1,170 @@ ++/* ++ * OHCI HCD (Host Controller Driver) for USB. ++ * ++ * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at> ++ * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net> ++ * (C) Copyright 2002 Hewlett-Packard Company ++ * ++ * Bus Glue for ep93xx. ++ * ++ * Written by Christopher Hoover <ch@hpl.hp.com> ++ * Based on fragments of previous driver by Russell King et al. ++ * ++ * Modified for LH7A404 from ohci-sa1111.c ++ * by Durgesh Pattamatta <pattamattad@sharpsec.com> ++ * ++ * Modified for pxa27x from ohci-lh7a404.c ++ * by Nick Bane <nick@cecomputing.co.uk> 26-8-2004 ++ * ++ * Modified for ep93xx from ohci-pxa27x.c ++ * by Lennert Buytenhek <buytenh@wantstofly.org> 28-2-2006 ++ * Based on an earlier driver by Ray Lehtiniemi ++ * ++ * This file is licenced under the GPL. ++ */ ++ ++#include <linux/device.h> ++#include <linux/signal.h> ++#include <linux/platform_device.h> ++ ++#include <asm/mach-types.h> ++#include <asm/hardware.h> ++ ++static void ep93xx_start_hc(struct platform_device *dev) ++{ ++ unsigned int pwrcnt; ++ ++ pwrcnt = __raw_readl(EP93XX_SYSCON_CLOCK_CONTROL); ++ pwrcnt |= EP93XX_SYSCON_CLOCK_USH_EN; ++ __raw_writel(pwrcnt, EP93XX_SYSCON_CLOCK_CONTROL); ++} ++ ++static void ep93xx_stop_hc(struct platform_device *dev) ++{ ++ unsigned int pwrcnt; ++ ++ pwrcnt = __raw_readl(EP93XX_SYSCON_CLOCK_CONTROL); ++ pwrcnt &= ~EP93XX_SYSCON_CLOCK_USH_EN; ++ __raw_writel(pwrcnt, EP93XX_SYSCON_CLOCK_CONTROL); ++} ++ ++int usb_hcd_ep93xx_probe(const struct hc_driver *driver, ++ struct platform_device *dev) ++{ ++ int retval; ++ struct usb_hcd *hcd; ++ ++ hcd = usb_create_hcd(driver, &dev->dev, "ep93xx"); ++ if (hcd == NULL) ++ return -ENOMEM; ++ ++ hcd->rsrc_start = dev->resource[0].start; ++ hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1; ++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { ++ usb_put_hcd(hcd); ++ retval = -EBUSY; ++ goto err1; ++ } ++ ++ hcd->regs = (void __iomem *)dev->resource[0].start; ++ ++ ep93xx_start_hc(dev); ++ ++ ohci_hcd_init(hcd_to_ohci(hcd)); ++ ++ retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); ++ if (retval == 0) ++ return retval; ++ ++ ep93xx_stop_hc(dev); ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++err1: ++ usb_put_hcd(hcd); ++ ++ return retval; ++} ++ ++void usb_hcd_ep93xx_remove(struct usb_hcd *hcd, struct platform_device *dev) ++{ ++ usb_remove_hcd(hcd); ++ ep93xx_stop_hc(dev); ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++ usb_put_hcd(hcd); ++} ++ ++static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd) ++{ ++ struct ohci_hcd *ohci = hcd_to_ohci(hcd); ++ int ret; ++ ++ if ((ret = ohci_init(ohci)) < 0) ++ return ret; ++ ++ if ((ret = ohci_run(ohci)) < 0) { ++ err("can't start %s", hcd->self.bus_name); ++ ohci_stop(hcd); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++static struct hc_driver ohci_ep93xx_hc_driver = { ++ .description = hcd_name, ++ .product_desc = "EP93xx OHCI", ++ .hcd_priv_size = sizeof(struct ohci_hcd), ++ .irq = ohci_irq, ++ .flags = HCD_USB11, ++ .start = ohci_ep93xx_start, ++ .stop = ohci_stop, ++ .urb_enqueue = ohci_urb_enqueue, ++ .urb_dequeue = ohci_urb_dequeue, ++ .endpoint_disable = ohci_endpoint_disable, ++ .get_frame_number = ohci_get_frame, ++ .hub_status_data = ohci_hub_status_data, ++ .hub_control = ohci_hub_control, ++}; ++ ++extern int usb_disabled(void); ++ ++static int ohci_hcd_ep93xx_drv_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = -ENODEV; ++ if (!usb_disabled()) ++ ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev); ++ ++ return ret; ++ return -ENODEV; ++} ++ ++static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev) ++{ ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); ++ ++ usb_hcd_ep93xx_remove(hcd, pdev); ++ ++ return 0; ++} ++ ++static struct platform_driver ohci_hcd_ep93xx_driver = { ++ .probe = ohci_hcd_ep93xx_drv_probe, ++ .remove = ohci_hcd_ep93xx_drv_remove, ++ .driver = { ++ .name = "ep93xx-ohci", ++ }, ++}; ++ ++static int __init ohci_hcd_ep93xx_init(void) ++{ ++ return platform_driver_register(&ohci_hcd_ep93xx_driver); ++} ++ ++static void __exit ohci_hcd_ep93xx_cleanup(void) ++{ ++ platform_driver_unregister(&ohci_hcd_ep93xx_driver); ++} ++ ++module_init(ohci_hcd_ep93xx_init); ++module_exit(ohci_hcd_ep93xx_cleanup); +diff -urN linux-2.6.15.commit/drivers/usb/host/ohci-hcd.c linux-2.6.15.snap/drivers/usb/host/ohci-hcd.c +--- linux-2.6.15.commit/drivers/usb/host/ohci-hcd.c 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/usb/host/ohci-hcd.c 2006-02-28 01:30:21.000000000 +0100 +@@ -909,6 +909,10 @@ + #include "ohci-pxa27x.c" + #endif + ++#ifdef CONFIG_ARCH_EP93XX ++#include "ohci-ep93xx.c" ++#endif ++ + #ifdef CONFIG_SOC_AU1X00 + #include "ohci-au1xxx.c" + #endif +@@ -923,6 +927,7 @@ + || defined(CONFIG_ARCH_OMAP) \ + || defined (CONFIG_ARCH_LH7A404) \ + || defined (CONFIG_PXA27x) \ ++ || defined (CONFIG_ARCH_EP93XX) \ + || defined (CONFIG_SOC_AU1X00) \ + || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \ + ) +diff -urN linux-2.6.15.commit/drivers/usb/Kconfig linux-2.6.15.snap/drivers/usb/Kconfig +--- linux-2.6.15.commit/drivers/usb/Kconfig 2006-02-12 10:22:16.000000000 +0100 ++++ linux-2.6.15.snap/drivers/usb/Kconfig 2006-02-20 22:56:03.000000000 +0100 +@@ -22,6 +22,7 @@ + default y if ARCH_LH7A404 + default y if ARCH_S3C2410 + default y if PXA27x ++ default y if ARCH_EP93XX + # PPC: + default y if STB03xxx + default y if PPC_MPC52xx +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/debug-macro.S linux-2.6.15.snap/include/asm-arm/arch-ep93xx/debug-macro.S +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/debug-macro.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/debug-macro.S 2006-02-19 18:59:06.000000000 +0100 +@@ -0,0 +1,35 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/debug-macro.S ++ * Debugging macro include header ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++ .macro addruart,rx ++ mrc p15, 0, \rx, c1, c0 ++ tst \rx, #1 @ MMU enabled? ++ ldreq \rx, =EP93XX_APB_PHYS_BASE @ Physical base ++ ldrne \rx, =EP93XX_APB_VIRT_BASE @ virtual base ++ orr \rx, \rx, #0x000c0000 ++ .endm ++ ++ .macro senduart,rd,rx ++ strb \rd, [\rx] ++ .endm ++ ++ .macro busyuart,rd,rx ++1001: ldrb \rd, [\rx, #0x18] ++ tst \rd, #0x08 ++ bne 1001b ++ .endm ++ ++ .macro waituart,rd,rx ++ nop ++ nop ++ nop ++ .endm +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/dma.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/dma.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/dma.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/dma.h 2006-02-19 19:28:06.000000000 +0100 +@@ -0,0 +1,6 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/dma.h ++ */ ++ ++#define MAX_DMA_ADDRESS 0xffffffff ++#define MAX_DMA_CHANNELS 0 +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/entry-macro.S linux-2.6.15.snap/include/asm-arm/arch-ep93xx/entry-macro.S +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/entry-macro.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/entry-macro.S 2006-02-20 19:04:14.000000000 +0100 +@@ -0,0 +1,52 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/entry-macro.S ++ * IRQ demultiplexing for EP93xx ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++ .macro disable_fiq ++ .endm ++ ++ .macro get_irqnr_and_base, irqnr, irqstat, base, tmp ++ ldr \base, =(EP93XX_AHB_VIRT_BASE) ++ orr \base, \base, #0x000b0000 ++ mov \irqnr, #0 ++ ldr \irqstat, [\base] @ lower 32 interrupts ++ cmp \irqstat, #0 ++ bne 1001f ++ ++ eor \base, \base, #0x00070000 ++ ldr \irqstat, [\base] @ upper 32 interrupts ++ cmp \irqstat, #0 ++ beq 1002f ++ mov \irqnr, #0x20 ++ ++1001: ++ movs \tmp, \irqstat, lsl #16 ++ movne \irqstat, \tmp ++ addeq \irqnr, \irqnr, #16 ++ ++ movs \tmp, \irqstat, lsl #8 ++ movne \irqstat, \tmp ++ addeq \irqnr, \irqnr, #8 ++ ++ movs \tmp, \irqstat, lsl #4 ++ movne \irqstat, \tmp ++ addeq \irqnr, \irqnr, #4 ++ ++ movs \tmp, \irqstat, lsl #2 ++ movne \irqstat, \tmp ++ addeq \irqnr, \irqnr, #2 ++ ++ movs \tmp, \irqstat, lsl #1 ++ addeq \irqnr, \irqnr, #1 ++ orrs \base, \base, #1 ++ ++1002: ++ .endm +Binary files linux-2.6.15.commit/include/asm-arm/arch-ep93xx/.entry-macro.S.swp and linux-2.6.15.snap/include/asm-arm/arch-ep93xx/.entry-macro.S.swp differ +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/ep93xx-regs.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/ep93xx-regs.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/ep93xx-regs.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/ep93xx-regs.h 2006-02-28 01:32:57.000000000 +0100 +@@ -0,0 +1,118 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/ep93xx-regs.h ++ */ ++ ++#ifndef __ARCH_EP93XX_REGS_H ++#define __ARCH_EP93XX_REGS_H ++ ++/* ++ * EP93xx linux memory map: ++ * ++ * virt phys size ++ * fe800000 5M per-platform mappings ++ * fed00000 80800000 2M APB ++ * fef00000 80000000 1M AHB ++ */ ++ ++#define EP93XX_AHB_PHYS_BASE 0x80000000 ++#define EP93XX_AHB_VIRT_BASE 0xfef00000 ++#define EP93XX_AHB_SIZE 0x00100000 ++ ++#define EP93XX_APB_PHYS_BASE 0x80800000 ++#define EP93XX_APB_VIRT_BASE 0xfed00000 ++#define EP93XX_APB_SIZE 0x00200000 ++ ++ ++/* AHB peripherals */ ++#define EP93XX_DMA_BASE (EP93XX_AHB_VIRT_BASE + 0x00000000) ++ ++#define EP93XX_ETHERNET_BASE (EP93XX_AHB_VIRT_BASE + 0x00010000) ++ ++#define EP93XX_USB_BASE (EP93XX_AHB_VIRT_BASE + 0x00020000) ++ ++#define EP93XX_RASTER_BASE (EP93XX_AHB_VIRT_BASE + 0x00030000) ++ ++#define EP93XX_SDRAM_CONTROLLER_BASE (EP93XX_AHB_VIRT_BASE + 0x00060000) ++ ++#define EP93XX_PCMCIA_CONTROLLER_BASE (EP93XX_AHB_VIRT_BASE + 0x00080000) ++ ++#define EP93XX_BOOT_ROM_BASE (EP93XX_AHB_VIRT_BASE + 0x00090000) ++ ++#define EP93XX_IDE_BASE (EP93XX_AHB_VIRT_BASE + 0x000a0000) ++ ++#define EP93XX_VIC1_BASE (EP93XX_AHB_VIRT_BASE + 0x000b0000) ++#define EP93XX_VIC1_REG(x) (EP93XX_VIC1_BASE + (x)) ++#define EP93XX_VIC1_IRQ_STATUS EP93XX_VIC1_REG(0x0000) ++#define EP93XX_VIC1_SELECT EP93XX_VIC1_REG(0x000c) ++#define EP93XX_VIC1_ENABLE EP93XX_VIC1_REG(0x0010) ++#define EP93XX_VIC1_ENABLE_CLEAR EP93XX_VIC1_REG(0x0014) ++#define EP93XX_VIC1_VECT_CNTRL EP93XX_VIC1_REG(0x0200) ++ ++#define EP93XX_VIC2_BASE (EP93XX_AHB_VIRT_BASE + 0x000c0000) ++#define EP93XX_VIC2_REG(x) (EP93XX_VIC2_BASE + (x)) ++#define EP93XX_VIC2_IRQ_STATUS EP93XX_VIC2_REG(0x0000) ++#define EP93XX_VIC2_SELECT EP93XX_VIC2_REG(0x000c) ++#define EP93XX_VIC2_ENABLE EP93XX_VIC2_REG(0x0010) ++#define EP93XX_VIC2_ENABLE_CLEAR EP93XX_VIC2_REG(0x0014) ++#define EP93XX_VIC2_VECT_CNTRL EP93XX_VIC2_REG(0x0200) ++ ++ ++/* APB peripherals */ ++#define EP93XX_TIMER_BASE (EP93XX_APB_VIRT_BASE + 0x00010000) ++#define EP93XX_TIMER_REG(x) (EP93XX_TIMER_BASE + (x)) ++#define EP93XX_TIMER1_LOAD EP93XX_TIMER_REG(0x00) ++#define EP93XX_TIMER1_VALUE EP93XX_TIMER_REG(0x04) ++#define EP93XX_TIMER1_CONTROL EP93XX_TIMER_REG(0x08) ++#define EP93XX_TIMER1_CLEAR EP93XX_TIMER_REG(0x0c) ++#define EP93XX_TIMER2_LOAD EP93XX_TIMER_REG(0x20) ++#define EP93XX_TIMER2_VALUE EP93XX_TIMER_REG(0x24) ++#define EP93XX_TIMER2_CONTROL EP93XX_TIMER_REG(0x28) ++#define EP93XX_TIMER2_CLEAR EP93XX_TIMER_REG(0x2c) ++#define EP93XX_TIMER4_VALUE_LOW EP93XX_TIMER_REG(0x60) ++#define EP93XX_TIMER4_VALUE_HIGH EP93XX_TIMER_REG(0x64) ++#define EP93XX_TIMER3_LOAD EP93XX_TIMER_REG(0x80) ++#define EP93XX_TIMER3_VALUE EP93XX_TIMER_REG(0x84) ++#define EP93XX_TIMER3_CONTROL EP93XX_TIMER_REG(0x88) ++#define EP93XX_TIMER3_CLEAR EP93XX_TIMER_REG(0x8c) ++ ++#define EP93XX_I2S_BASE (EP93XX_APB_VIRT_BASE + 0x00020000) ++ ++#define EP93XX_SECURITY_BASE (EP93XX_APB_VIRT_BASE + 0x00030000) ++ ++#define EP93XX_GPIO_BASE (EP93XX_APB_VIRT_BASE + 0x00040000) ++ ++#define EP93XX_AAC_BASE (EP93XX_APB_VIRT_BASE + 0x00080000) ++ ++#define EP93XX_SPI_BASE (EP93XX_APB_VIRT_BASE + 0x000a0000) ++ ++#define EP93XX_IRDA_BASE (EP93XX_APB_VIRT_BASE + 0x000b0000) ++ ++#define EP93XX_UART1_BASE (EP93XX_APB_VIRT_BASE + 0x000c0000) ++ ++#define EP93XX_UART2_BASE (EP93XX_APB_VIRT_BASE + 0x000d0000) ++ ++#define EP93XX_UART3_BASE (EP93XX_APB_VIRT_BASE + 0x000e0000) ++ ++#define EP93XX_KEY_MATRIX_BASE (EP93XX_APB_VIRT_BASE + 0x000f0000) ++ ++#define EP93XX_TOUCHSCREEN_BASE (EP93XX_APB_VIRT_BASE + 0x00100000) ++ ++#define EP93XX_PWM_BASE (EP93XX_APB_VIRT_BASE + 0x00110000) ++ ++#define EP93XX_RTC_BASE (EP93XX_APB_VIRT_BASE + 0x00120000) ++ ++#define EP93XX_SYSCON_BASE (EP93XX_APB_VIRT_BASE + 0x00130000) ++#define EP93XX_SYSCON_REG(x) (EP93XX_SYSCON_BASE + (x)) ++#define EP93XX_SYSCON_POWER_STATE EP93XX_SYSCON_REG(0x00) ++#define EP93XX_SYSCON_CLOCK_CONTROL EP93XX_SYSCON_REG(0x04) ++#define EP93XX_SYSCON_CLOCK_UARTBAUD 0x20000000 ++#define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000 ++#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) ++#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) ++#define EP93XX_SYSCON_DEVICE_CONFIG EP93XX_SYSCON_REG(0x80) ++#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) ++ ++#define EP93XX_WATCHDOG_BASE (EP93XX_APB_VIRT_BASE + 0x00140000) ++ ++ ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/gesbc9312.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/gesbc9312.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/gesbc9312.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/gesbc9312.h 2006-02-19 19:30:10.000000000 +0100 +@@ -0,0 +1,3 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/gesbc9312.h ++ */ +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/hardware.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/hardware.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/hardware.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/hardware.h 2006-02-19 20:15:12.000000000 +0100 +@@ -0,0 +1,12 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/hardware.h ++ */ ++ ++#include "ep93xx-regs.h" ++ ++#define pcibios_assign_all_busses() 0 ++ ++#include "platform.h" ++ ++#include "gesbc9312.h" ++#include "ts72xx.h" +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/io.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/io.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/io.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/io.h 2006-02-19 20:03:57.000000000 +0100 +@@ -0,0 +1,8 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/io.h ++ */ ++ ++#define IO_SPACE_LIMIT 0xffffffff ++ ++#define __io(p) ((void __iomem *)(p)) ++#define __mem_pci(p) (p) +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/irqs.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/irqs.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/irqs.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/irqs.h 2006-02-19 21:29:37.000000000 +0100 +@@ -0,0 +1,78 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/irqs.h ++ */ ++ ++#ifndef _IRQS_H ++#define _IRQS_H ++ ++#define IRQ_EP93XX_COMMRX 2 ++#define IRQ_EP93XX_COMMTX 3 ++#define IRQ_EP93XX_TIMER1 4 ++#define IRQ_EP93XX_TIMER2 5 ++#define IRQ_EP93XX_AACINTR 6 ++#define IRQ_EP93XX_DMAM2P0 7 ++#define IRQ_EP93XX_DMAM2P1 8 ++#define IRQ_EP93XX_DMAM2P2 9 ++#define IRQ_EP93XX_DMAM2P3 10 ++#define IRQ_EP93XX_DMAM2P4 11 ++#define IRQ_EP93XX_DMAM2P5 12 ++#define IRQ_EP93XX_DMAM2P6 13 ++#define IRQ_EP93XX_DMAM2P7 14 ++#define IRQ_EP93XX_DMAM2P8 15 ++#define IRQ_EP93XX_DMAM2P9 16 ++#define IRQ_EP93XX_DMAM2M0 17 ++#define IRQ_EP93XX_DMAM2M1 18 ++#define IRQ_EP93XX_GPIO0MUX 20 ++#define IRQ_EP93XX_GPIO1MUX 21 ++#define IRQ_EP93XX_GPIO2MUX 22 ++#define IRQ_EP93XX_GPIO3MUX 22 ++#define IRQ_EP93XX_UART1RX 23 ++#define IRQ_EP93XX_UART1TX 24 ++#define IRQ_EP93XX_UART2RX 25 ++#define IRQ_EP93XX_UART2TX 26 ++#define IRQ_EP93XX_UART3RX 27 ++#define IRQ_EP93XX_UART3TX 28 ++#define IRQ_EP93XX_KEY 29 ++#define IRQ_EP93XX_TOUCH 30 ++#define EP93XX_VIC1_VALID_IRQ_MASK 0x7ffffffc ++ ++#define IRQ_EP93XX_EXT0 32 ++#define IRQ_EP93XX_EXT1 33 ++#define IRQ_EP93XX_EXT2 34 ++#define IRQ_EP93XX_64HZ 35 ++#define IRQ_EP93XX_WATCHDOG 36 ++#define IRQ_EP93XX_RTC 37 ++#define IRQ_EP93XX_IRDA 38 ++#define IRQ_EP93XX_ETHERNET 39 ++#define IRQ_EP93XX_EXT3 40 ++#define IRQ_EP93XX_PROG 41 ++#define IRQ_EP93XX_1HZ 42 ++#define IRQ_EP93XX_VSYNC 43 ++#define IRQ_EP93XX_VIDEO_FIFO 44 ++#define IRQ_EP93XX_SSP1RX 45 ++#define IRQ_EP93XX_SSP1TX 46 ++#define IRQ_EP93XX_GPIO4MUX 47 ++#define IRQ_EP93XX_GPIO5MUX 48 ++#define IRQ_EP93XX_GPIO6MUX 49 ++#define IRQ_EP93XX_GPIO7MUX 50 ++#define IRQ_EP93XX_TIMER3 51 ++#define IRQ_EP93XX_UART1 52 ++#define IRQ_EP93XX_SSP 53 ++#define IRQ_EP93XX_UART2 54 ++#define IRQ_EP93XX_UART3 55 ++#define IRQ_EP93XX_USB 56 ++#define IRQ_EP93XX_ETHERNET_PME 57 ++#define IRQ_EP93XX_DSP 58 ++#define IRQ_EP93XX_GPIO 59 ++#define IRQ_EP93XX_SAI 60 ++#define EP93XX_VIC2_VALID_IRQ_MASK 0x1fffffff ++ ++#define NR_EP93XX_IRQS 64 ++ ++#define EP93XX_BOARD_IRQ(x) (NR_EP93XX_IRQS + (x)) ++#define EP93XX_BOARD_IRQS 32 ++ ++#define NR_IRQS (NR_EP93XX_IRQS + EP93XX_BOARD_IRQS) ++ ++ ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/memory.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/memory.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/memory.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/memory.h 2006-02-22 02:05:51.000000000 +0100 +@@ -0,0 +1,14 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/memory.h ++ */ ++ ++#ifndef __ASM_ARCH_MEMORY_H ++#define __ASM_ARCH_MEMORY_H ++ ++#define PHYS_OFFSET UL(0x00000000) ++ ++#define __bus_to_virt(x) __phys_to_virt(x) ++#define __virt_to_bus(x) __virt_to_phys(x) ++ ++ ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/param.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/param.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/param.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/param.h 2006-02-22 02:05:20.000000000 +0100 +@@ -0,0 +1,3 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/param.h ++ */ +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/platform.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/platform.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/platform.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/platform.h 2006-02-20 14:26:36.000000000 +0100 +@@ -0,0 +1,14 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/platform.h ++ */ ++ ++#ifndef __ASSEMBLY__ ++ ++void ep93xx_map_io(void); ++void ep93xx_init_irq(void); ++void ep93xx_init_time(unsigned long); ++void ep93xx_init_devices(void); ++extern struct sys_timer ep93xx_timer; ++ ++ ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/system.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/system.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/system.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/system.h 2006-02-20 21:28:04.000000000 +0100 +@@ -0,0 +1,26 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/system.h ++ */ ++ ++#include <asm/hardware.h> ++ ++static inline void arch_idle(void) ++{ ++ cpu_do_idle(); ++} ++ ++static inline void arch_reset(char mode) ++{ ++ u32 devicecfg; ++ ++ local_irq_disable(); ++ ++ devicecfg = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG); ++ __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); ++ __raw_writel(devicecfg | 0x80000000, EP93XX_SYSCON_DEVICE_CONFIG); ++ __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); ++ __raw_writel(devicecfg & ~0x80000000, EP93XX_SYSCON_DEVICE_CONFIG); ++ ++ while (1) ++ ; ++} +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/timex.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/timex.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/timex.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/timex.h 2006-02-19 19:16:38.000000000 +0100 +@@ -0,0 +1,5 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/timex.h ++ */ ++ ++#define CLOCK_TICK_RATE 508000 +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/ts72xx.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/ts72xx.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/ts72xx.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/ts72xx.h 2006-02-22 17:01:02.000000000 +0100 +@@ -0,0 +1,90 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/ts72xx.h ++ */ ++ ++/* ++ * TS72xx memory map: ++ * ++ * virt phys size ++ * febff000 22000000 4K model number register ++ * febfe000 22400000 4K options register ++ * febfd000 22800000 4K options register #2 ++ * febfc000 [67]0000000 4K NAND data register ++ * febfb000 [67]0400000 4K NAND control register ++ * febfa000 [67]0800000 4K NAND busy register ++ */ ++ ++#define TS72XX_MODEL_PHYS_BASE 0x22000000 ++#define TS72XX_MODEL_VIRT_BASE 0xfebff000 ++#define TS72XX_MODEL_SIZE 0x00001000 ++ ++#define TS72XX_MODEL_TS7200 0x00 ++#define TS72XX_MODEL_TS7250 0x01 ++#define TS72XX_MODEL_TS7260 0x02 ++ ++ ++#define TS72XX_OPTIONS_PHYS_BASE 0x22400000 ++#define TS72XX_OPTIONS_VIRT_BASE 0xfebfe000 ++#define TS72XX_OPTIONS_SIZE 0x00001000 ++ ++#define TS72XX_OPTIONS_COM2_RS485 0x02 ++#define TS72XX_OPTIONS_MAX197 0x01 ++ ++ ++#define TS72XX_OPTIONS2_PHYS_BASE 0x22800000 ++#define TS72XX_OPTIONS2_VIRT_BASE 0xfebfd000 ++#define TS72XX_OPTIONS2_SIZE 0x00001000 ++ ++#define TS72XX_OPTIONS2_TS9420 0x04 ++#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 ++ ++ ++#define TS72XX_NOR_PHYS_BASE 0x60000000 ++#define TS72XX_NOR2_PHYS_BASE 0x62000000 ++ ++#define TS72XX_NAND1_DATA_PHYS_BASE 0x60000000 ++#define TS72XX_NAND2_DATA_PHYS_BASE 0x70000000 ++#define TS72XX_NAND_DATA_VIRT_BASE 0xfebfc000 ++#define TS72XX_NAND_DATA_SIZE 0x00001000 ++ ++#define TS72XX_NAND1_CONTROL_PHYS_BASE 0x60400000 ++#define TS72XX_NAND2_CONTROL_PHYS_BASE 0x70400000 ++#define TS72XX_NAND_CONTROL_VIRT_BASE 0xfebfb000 ++#define TS72XX_NAND_CONTROL_SIZE 0x00001000 ++ ++#define TS72XX_NAND1_BUSY_PHYS_BASE 0x60800000 ++#define TS72XX_NAND2_BUSY_PHYS_BASE 0x70800000 ++#define TS72XX_NAND_BUSY_VIRT_BASE 0xfebfa000 ++#define TS72XX_NAND_BUSY_SIZE 0x00001000 ++ ++ ++#ifndef __ASSEMBLY__ ++#include <asm/io.h> ++ ++static inline int board_is_ts7200(void) ++{ ++ return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200; ++} ++ ++static inline int board_is_ts7250(void) ++{ ++ return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250; ++} ++ ++static inline int board_is_ts7260(void) ++{ ++ return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260; ++} ++ ++static inline int is_max197_installed(void) ++{ ++ return !!(__raw_readb(TS72XX_OPTIONS_VIRT_BASE) & ++ TS72XX_OPTIONS_MAX197); ++} ++ ++static inline int is_ts9420_installed(void) ++{ ++ return !!(__raw_readb(TS72XX_OPTIONS2_VIRT_BASE) & ++ TS72XX_OPTIONS2_TS9420); ++} ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/uncompress.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/uncompress.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/uncompress.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/uncompress.h 2006-02-22 02:20:49.000000000 +0100 +@@ -0,0 +1,42 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/uncompress.h ++ * ++ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or (at ++ * your option) any later version. ++ */ ++ ++#include <asm/arch/ep93xx-regs.h> ++ ++#define PHYS_UART1_DATA ((unsigned long *)0x808c0000) ++#define PHYS_UART1_FLAG ((unsigned long *)0x808c0018) ++#define UART1_FLAG_TXFF 0x20 ++ ++static __inline__ void putc(char c) ++{ ++ int i; ++ ++ for (i = 0; i < 1000; i++) { ++ /* Transmit fifo not full? */ ++ if (!(*PHYS_UART1_FLAG & UART1_FLAG_TXFF)) ++ break; ++ } ++ ++ *PHYS_UART1_DATA = c; ++} ++ ++static void putstr(const char *s) ++{ ++ while (*s) { ++ putc(*s); ++ if (*s == '\n') ++ putc('\r'); ++ s++; ++ } ++} ++ ++#define arch_decomp_setup() ++#define arch_decomp_wdog() +diff -urN linux-2.6.15.commit/include/asm-arm/arch-ep93xx/vmalloc.h linux-2.6.15.snap/include/asm-arm/arch-ep93xx/vmalloc.h +--- linux-2.6.15.commit/include/asm-arm/arch-ep93xx/vmalloc.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/arch-ep93xx/vmalloc.h 2006-02-19 22:05:22.000000000 +0100 +@@ -0,0 +1,5 @@ ++/* ++ * linux/include/asm-arm/arch-ep93xx/vmalloc.h ++ */ ++ ++#define VMALLOC_END 0xfe800000 +diff -urN linux-2.6.15.commit/include/asm-arm/hardware/vic.h linux-2.6.15.snap/include/asm-arm/hardware/vic.h +--- linux-2.6.15.commit/include/asm-arm/hardware/vic.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/hardware/vic.h 2006-02-20 13:57:02.000000000 +0100 +@@ -0,0 +1,45 @@ ++/* ++ * linux/include/asm-arm/hardware/vic.h ++ * ++ * Copyright (c) ARM Limited 2003. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++#ifndef __ASM_ARM_HARDWARE_VIC_H ++#define __ASM_ARM_HARDWARE_VIC_H ++ ++#define VIC_IRQ_STATUS 0x00 ++#define VIC_FIQ_STATUS 0x04 ++#define VIC_RAW_STATUS 0x08 ++#define VIC_INT_SELECT 0x0c /* 1 = FIQ, 0 = IRQ */ ++#define VIC_INT_ENABLE 0x10 /* 1 = enable, 0 = disable */ ++#define VIC_INT_ENABLE_CLEAR 0x14 ++#define VIC_INT_SOFT 0x18 ++#define VIC_INT_SOFT_CLEAR 0x1c ++#define VIC_PROTECT 0x20 ++#define VIC_VECT_ADDR 0x30 ++#define VIC_DEF_VECT_ADDR 0x34 ++ ++#define VIC_VECT_ADDR0 0x100 /* 0 to 15 */ ++#define VIC_VECT_CNTL0 0x200 /* 0 to 15 */ ++#define VIC_ITCR 0x300 /* VIC test control register */ ++ ++#define VIC_VECT_CNTL_ENABLE (1 << 5) ++ ++#ifndef __ASSEMBLY__ ++void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources); ++#endif ++ ++#endif +diff -urN linux-2.6.15.commit/include/asm-arm/mach/irq.h linux-2.6.15.snap/include/asm-arm/mach/irq.h +--- linux-2.6.15.commit/include/asm-arm/mach/irq.h 2006-02-12 10:22:19.000000000 +0100 ++++ linux-2.6.15.snap/include/asm-arm/mach/irq.h 2006-02-20 13:57:02.000000000 +0100 +@@ -61,7 +61,7 @@ + struct irqchip *chip; + struct irqaction *action; + struct list_head pend; +- void *chipdata; ++ void __iomem *chipdata; + void *data; + unsigned int disable_depth; + diff --git a/packages/linux/ep93xx-kernel_2.6.15.bb b/packages/linux/ep93xx-kernel_2.6.15.bb index 500cae5fee..46cb819d7d 100644 --- a/packages/linux/ep93xx-kernel_2.6.15.bb +++ b/packages/linux/ep93xx-kernel_2.6.15.bb @@ -1,10 +1,10 @@ DESCRIPTION = "Linux Kernel for Cirrus Logic ep39xx compatible machines" SECTION = "kernel" LICENSE = "GPL" -PR = "r3" +PR = "r6" SRC_URI = "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \ - http://wantstofly.org/~buytenh/ep93xx/derevo2.diff;patch=1 \ + file://derevo6.diff;patch=1 \ " S = "${WORKDIR}/linux-${PV}" @@ -18,8 +18,8 @@ do_configure() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/handhelds-pxa-2.6/block-pio.patch b/packages/linux/handhelds-pxa-2.6/block-pio.patch new file mode 100644 index 0000000000..294140b6e8 --- /dev/null +++ b/packages/linux/handhelds-pxa-2.6/block-pio.patch @@ -0,0 +1,146 @@ +On architectures where highmem isn't used, arguments to kmap/unmap are +simply thrown away without being evaluated. This is fine until a +wrapper function is written. Even though it got ignored in the end, +the arguments are evaulated. As asm/highmem.h is not included by +linux/highmem.h when CONFIG_HIGHMEM is off, none of KM_* constants get +defined which results in error if those are evaluated. + +This patch makes linux/highmem.h include asm/kmap_types.h regardless +of CONFIG_HIGHMEM. To deal with the same problem, crypto subsystem +used to include asm/kmap_types.h directly. This patch kills it. + +Signed-off-by: Tejun Heo <htejun@gmail.com> + +--- + + crypto/internal.h | 1 - + include/linux/highmem.h | 1 + + 2 files changed, 1 insertions(+), 1 deletions(-) + +4e0462fa09e87da901867f37b2c7311ef714c3e7 +diff --git a/crypto/internal.h b/crypto/internal.h +index 959e602..4188672 100644 +--- a/crypto/internal.h ++++ b/crypto/internal.h +@@ -21,7 +21,6 @@ + #include <linux/kernel.h> + #include <linux/rwsem.h> + #include <linux/slab.h> +-#include <asm/kmap_types.h> + + extern struct list_head crypto_alg_list; + extern struct rw_semaphore crypto_alg_sem; +diff --git a/include/linux/highmem.h b/include/linux/highmem.h +index 6bece92..c605f01 100644 +--- a/include/linux/highmem.h ++++ b/include/linux/highmem.h +@@ -6,6 +6,7 @@ + #include <linux/mm.h> + + #include <asm/cacheflush.h> ++#include <asm/kmap_types.h> + + #ifdef CONFIG_HIGHMEM + + +When block requests are handled via DMA dma mapping functions take +care of cache coherency. Unfortunately, cache coherencly was left +unhandled until now for block PIOs, resulting in data corruption +issues on architectures with aliasing caches. + +All block PIO operations use kmap/unmap to access target memory area +and the mapping/unmapping points are the perfect places for cache +flushing. kmap/unmap are to PIO'ing cpus what dma_map/unmap are to +DMAing devices. + +This patch implements blk kmap helpers which additionally take +@direction argument and deal with cache coherency. + +Signed-off-by: Tejun Heo <htejun@gmail.com> + +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h +index 02a585f..1040029 100644 +--- a/include/linux/blkdev.h ++++ b/include/linux/blkdev.h +@@ -17,6 +17,10 @@ + + #include <asm/scatterlist.h> + ++/* for PIO kmap helpers */ ++#include <linux/highmem.h> ++#include <linux/dma-mapping.h> ++ + struct request_queue; + typedef struct request_queue request_queue_t; + struct elevator_queue; +@@ -812,6 +816,40 @@ static inline void put_dev_sector(Sector + page_cache_release(p.v); + } + ++/* ++ * PIO kmap helpers. ++ * ++ * Block PIO requires cache flushes on architectures with aliasing ++ * caches. If a driver wants to perform PIO on a user-mappable page ++ * (page cache page), it MUST use one of the following kmap/unmap ++ * helpers unless it handles cache coherency itself. ++ */ ++static inline void * blk_kmap_atomic(struct page *page, enum km_type type, ++ enum dma_data_direction dir) ++{ ++ return kmap_atomic(page, type); ++} ++ ++static inline void blk_kunmap_atomic(void *addr, enum km_type type, ++ enum dma_data_direction dir) ++{ ++ if (dir == DMA_BIDIRECTIONAL || dir == DMA_FROM_DEVICE) ++ flush_dcache_page(kmap_atomic_to_page(addr)); ++ kunmap_atomic(addr, type); ++} ++ ++static inline void * blk_kmap(struct page *page, enum dma_data_direction dir) ++{ ++ return kmap(page); ++} ++ ++static inline void blk_kunmap(struct page *page, enum dma_data_direction dir) ++{ ++ if (dir == DMA_BIDIRECTIONAL || dir == DMA_FROM_DEVICE) ++ flush_dcache_page(page); ++ kunmap(page); ++} ++ + struct work_struct; + int kblockd_schedule_work(struct work_struct *work); + void kblockd_flush(void); +diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c +index 62ebefd..24d5e56 100644 +--- a/drivers/ide/ide-taskfile.c ++++ b/drivers/ide/ide-taskfile.c +@@ -260,6 +260,7 @@ static void ide_pio_sector(ide_drive_t * + { + ide_hwif_t *hwif = drive->hwif; + struct scatterlist *sg = hwif->sg_table; ++ enum dma_data_direction dir = write ? DMA_TO_DEVICE : DMA_FROM_DEVICE; + struct page *page; + #ifdef CONFIG_HIGHMEM + unsigned long flags; +@@ -277,7 +278,7 @@ static void ide_pio_sector(ide_drive_t * + #ifdef CONFIG_HIGHMEM + local_irq_save(flags); + #endif +- buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset; ++ buf = blk_kmap_atomic(page, KM_BIO_SRC_IRQ, dir) + offset; + + hwif->nleft--; + hwif->cursg_ofs++; +@@ -293,7 +294,7 @@ static void ide_pio_sector(ide_drive_t * + else + taskfile_input_data(drive, buf, SECTOR_WORDS); + +- kunmap_atomic(buf, KM_BIO_SRC_IRQ); ++ blk_kunmap_atomic(buf, KM_BIO_SRC_IRQ, dir); + #ifdef CONFIG_HIGHMEM + local_irq_restore(flags); + #endif diff --git a/packages/linux/handhelds-pxa-2.6/h2200/defconfig b/packages/linux/handhelds-pxa-2.6/h2200/defconfig index d1790dfe27..adb05cd8e3 100644 --- a/packages/linux/handhelds-pxa-2.6/h2200/defconfig +++ b/packages/linux/handhelds-pxa-2.6/h2200/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-hh0 -# Fri Feb 10 12:28:28 2006 +# Linux kernel version: 2.6.15-hh1 +# Wed Feb 22 16:24:24 2006 # CONFIG_ARM=y CONFIG_MMU=y @@ -642,7 +642,7 @@ CONFIG_MTD_NAND_HAMCOP=y # # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m -# CONFIG_BLK_DEV_CRYPTOLOOP is not set +CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y @@ -992,7 +992,7 @@ CONFIG_SA1100_WATCHDOG=m # # CONFIG_USBPCWATCHDOG is not set # CONFIG_NVRAM is not set -CONFIG_SA1100_RTC=m +CONFIG_SA1100_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set @@ -1444,7 +1444,7 @@ CONFIG_RAMFS=y # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set -CONFIG_JFFS2_FS=m +CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_WRITEBUFFER=y CONFIG_JFFS2_SUMMARY=y diff --git a/packages/linux/handhelds-pxa-2.6_2.6.15-hh0.bb b/packages/linux/handhelds-pxa-2.6_2.6.15-hh0.bb index f0fe6f32e9..6c69b548d0 100644 --- a/packages/linux/handhelds-pxa-2.6_2.6.15-hh0.bb +++ b/packages/linux/handhelds-pxa-2.6_2.6.15-hh0.bb @@ -9,6 +9,7 @@ FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/handhelds-pxa-${PV}" SRC_URI = "${HANDHELDS_CVS};module=linux/kernel26;tag=${@'K' + bb.data.getVar('PV',d,1).replace('.', '-')} \ file://ide_not_removable-r0.patch;patch=1 \ + file://block-pio.patch;patch=1 \ file://defconfig" S = "${WORKDIR}/kernel26" @@ -27,8 +28,8 @@ do_configure() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/handhelds-pxa-2.6_cvs.bb b/packages/linux/handhelds-pxa-2.6_cvs.bb index 28b21328b2..122bb33efc 100644 --- a/packages/linux/handhelds-pxa-2.6_cvs.bb +++ b/packages/linux/handhelds-pxa-2.6_cvs.bb @@ -10,6 +10,8 @@ COMPATIBLE_HOST = "arm.*-linux" FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/handhelds-pxa-${PV}" SRC_URI = "${HANDHELDS_CVS};module=linux/kernel26 \ + file://ide_not_removable-r0.patch;patch=1 \ + file://block-pio.patch;patch=1 \ file://defconfig" S = "${WORKDIR}/kernel26" @@ -32,8 +34,8 @@ do_configure() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/ixp4xx-kernel.inc b/packages/linux/ixp4xx-kernel.inc index 2ddb7cbb61..52f216438a 100644 --- a/packages/linux/ixp4xx-kernel.inc +++ b/packages/linux/ixp4xx-kernel.inc @@ -297,6 +297,20 @@ pkg_postrm_kernel-image-nas100d () { update-alternatives --remove ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-nas100d${ARCH_BYTE_SEX}-${KERNEL_RELEASE} || true } +# The correct settings for the DSMG600 board: +dsmg600_MACHID = "964" +PACKAGES += "kernel-image-dsmg600" +PKG_kernel-image-dsmg600 = "kernel-image-${KERNEL_VERSION}" +PACKAGE_ARCH_kernel-image-dsmg600 = "dsmg600${ARCH_BYTE_SEX}" +DESCRIPTION_kernel-image-dsmg600 = "Linux kernel for the D-Link DSM-G600" +FILES_kernel-image-dsmg600 = "/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-dsmg600${ARCH_BYTE_SEX}-${KERNEL_RELEASE}" +pkg_postinst_kernel-image-dsmg600 () { + update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-dsmg600${ARCH_BYTE_SEX}-${KERNEL_RELEASE} ${KERNEL_PRIORITY} || true +} +pkg_postrm_kernel-image-dsmg600 () { + update-alternatives --remove ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-dsmg600${ARCH_BYTE_SEX}-${KERNEL_RELEASE} || true +} + #FIXUP: the correct instructions to copy the kernel prepended with the le fixup #FIXME: do a fixup for BE too... FIXUP_armeb = "cp$" @@ -345,16 +359,17 @@ do_install_append() { install_image 'ds101${ARCH_BYTE_SEX}' '${ds101_MACHID}' install_image 'loft${ARCH_BYTE_SEX}' '${loft_MACHID}' install_image 'nas100d${ARCH_BYTE_SEX}' '${nas100d_MACHID}' + install_image 'dsmg600${ARCH_BYTE_SEX}' '${dsmg600_MACHID}' } do_deploy[dirs] = "${S}" deploy_image() { - copy_image '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-'"$1" "$2" + copy_image '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-'"$1" "$2" } do_deploy() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} deploy_image '${IXP4XX_SUFFIX}' # And the machine specific images @@ -362,6 +377,7 @@ do_deploy() { deploy_image 'ds101${ARCH_BYTE_SEX}' '${ds101_MACHID}' deploy_image 'loft${ARCH_BYTE_SEX}' '${loft_MACHID}' deploy_image 'nas100d${ARCH_BYTE_SEX}' '${nas100d_MACHID}' + deploy_image 'dsmg600${ARCH_BYTE_SEX}' '${dsmg600_MACHID}' } addtask deploy before do_build after do_compile diff --git a/packages/linux/ixp4xx-kernel/2.6.15/defconfig b/packages/linux/ixp4xx-kernel/2.6.15/defconfig index 8279471c78..597d406940 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/defconfig +++ b/packages/linux/ixp4xx-kernel/2.6.15/defconfig @@ -1561,7 +1561,7 @@ CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set +CONFIG_CODA_FS=m # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set diff --git a/packages/linux/ixp4xx-kernel/2.6.16/06-remove-extraversion.patch b/packages/linux/ixp4xx-kernel/2.6.16/06-remove-extraversion.patch index 65aba13703..eca681b0aa 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/06-remove-extraversion.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/06-remove-extraversion.patch @@ -4,7 +4,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 16 --EXTRAVERSION =-rc2 +-EXTRAVERSION = -rc4-git9 +EXTRAVERSION = NAME=Sliding Snow Leopard diff --git a/packages/linux/ixp4xx-kernel/2.6.16/10-nslu2-fix-flash.patch b/packages/linux/ixp4xx-kernel/2.6.16/10-nslu2-fix-flash.patch deleted file mode 100644 index ab37b099b1..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/10-nslu2-fix-flash.patch +++ /dev/null @@ -1,14 +0,0 @@ - arch/arm/mach-ixp4xx/nslu2-setup.c | 2 -- - 1 file changed, 2 deletions(-) - ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 21:49:41.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 21:59:55.000000000 +0100 -@@ -27,8 +27,6 @@ static struct flash_platform_data nslu2_ - }; - - static struct resource nslu2_flash_resource = { -- .start = NSLU2_FLASH_BASE, -- .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE, - .flags = IORESOURCE_MEM, - }; - diff --git a/packages/linux/ixp4xx-kernel/2.6.16/40-rtc-class.patch b/packages/linux/ixp4xx-kernel/2.6.16/40-rtc-class.patch index 38359a1bc0..3cc84b2a9b 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/40-rtc-class.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/40-rtc-class.patch @@ -1,6 +1,6 @@ ---- linux-nslu2.orig/include/linux/rtc.h 2006-02-06 20:37:43.000000000 +0100 -+++ linux-nslu2/include/linux/rtc.h 2006-02-06 21:41:39.000000000 +0100 -@@ -93,8 +93,91 @@ struct rtc_pll_info { +--- linux-rtc.orig/include/linux/rtc.h 2006-02-19 23:33:10.000000000 +0100 ++++ linux-rtc/include/linux/rtc.h 2006-02-19 23:33:15.000000000 +0100 +@@ -93,8 +93,97 @@ struct rtc_pll_info { #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ @@ -16,6 +16,7 @@ +#include <linux/seq_file.h> +#include <linux/cdev.h> +#include <linux/poll.h> ++#include <linux/mutex.h> + +struct rtc_class_ops { + int (*open)(struct device *); @@ -29,6 +30,7 @@ + int (*set_mmss)(struct device *, unsigned long secs); + int (*irq_set_state)(struct device *, int enabled); + int (*irq_set_freq)(struct device *, int freq); ++ int (*read_callback)(struct device *, int data); +}; + +#define RTC_DEVICE_NAME_SIZE 20 @@ -36,23 +38,25 @@ + +struct rtc_device +{ -+ int id; -+ struct module *owner; + struct class_device class_dev; -+ struct semaphore ops_lock; -+ struct rtc_class_ops *ops; ++ struct module *owner; ++ ++ int id; + char name[RTC_DEVICE_NAME_SIZE]; + ++ struct rtc_class_ops *ops; ++ struct mutex ops_lock; ++ + struct cdev char_dev; -+ struct semaphore char_sem; ++ struct mutex char_lock; + + unsigned long irq_data; + spinlock_t irq_lock; + wait_queue_head_t irq_queue; + struct fasync_struct *async_queue; + -+ spinlock_t irq_task_lock; + struct rtc_task *irq_task; ++ spinlock_t irq_task_lock; + int irq_freq; +}; +#define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) @@ -71,15 +75,17 @@ + +extern int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm); +extern int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm); ++extern int rtc_set_mmss(struct class_device *class_dev, unsigned long secs); +extern int rtc_read_alarm(struct class_device *class_dev, -+ struct rtc_wkalrm *alrm); ++ struct rtc_wkalrm *alrm); +extern int rtc_set_alarm(struct class_device *class_dev, + struct rtc_wkalrm *alrm); +extern void rtc_update_irq(struct class_device *class_dev, + unsigned long num, unsigned long events); + -+extern struct class_device *rtc_open(char *name); -+extern void rtc_close(struct class_device *class_dev); ++extern struct class_device *rtc_class_open(char *name); ++extern void rtc_class_close(struct class_device *class_dev); ++ +extern int rtc_irq_register(struct class_device *class_dev, + struct rtc_task *task); +extern void rtc_irq_unregister(struct class_device *class_dev, @@ -92,8 +98,8 @@ typedef struct rtc_task { void (*func)(void *private_data); void *private_data; ---- linux-nslu2.orig/drivers/Kconfig 2006-02-06 20:37:14.000000000 +0100 -+++ linux-nslu2/drivers/Kconfig 2006-02-06 21:11:33.000000000 +0100 +--- linux-rtc.orig/drivers/Kconfig 2006-02-19 23:33:10.000000000 +0100 ++++ linux-rtc/drivers/Kconfig 2006-02-19 23:33:15.000000000 +0100 @@ -70,4 +70,6 @@ source "drivers/sn/Kconfig" source "drivers/edac/Kconfig" @@ -101,8 +107,8 @@ +source "drivers/rtc/Kconfig" + endmenu ---- linux-nslu2.orig/drivers/Makefile 2006-02-06 20:37:14.000000000 +0100 -+++ linux-nslu2/drivers/Makefile 2006-02-06 21:11:33.000000000 +0100 +--- linux-rtc.orig/drivers/Makefile 2006-02-19 23:33:10.000000000 +0100 ++++ linux-rtc/drivers/Makefile 2006-02-19 23:33:15.000000000 +0100 @@ -56,6 +56,7 @@ obj-$(CONFIG_USB_GADGET) += usb/gadget/ obj-$(CONFIG_GAMEPORT) += input/gameport/ obj-$(CONFIG_INPUT) += input/ @@ -112,7 +118,7 @@ obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_HWMON) += hwmon/ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/class.c 2006-02-06 21:41:25.000000000 +0100 ++++ linux-rtc/drivers/rtc/class.c 2006-02-19 23:33:15.000000000 +0100 @@ -0,0 +1,143 @@ +/* + * RTC subsystem, base class @@ -133,15 +139,15 @@ +#include <linux/idr.h> + +static DEFINE_IDR(rtc_idr); -+static DECLARE_MUTEX(idr_lock); ++static DEFINE_MUTEX(idr_lock); +struct class *rtc_class; + +static void rtc_device_release(struct class_device *class_dev) +{ + struct rtc_device *rtc = to_rtc_device(class_dev); -+ down(&idr_lock); ++ mutex_lock(&idr_lock); + idr_remove(&rtc_idr, rtc->id); -+ up(&idr_lock); ++ mutex_unlock(&idr_lock); + kfree(rtc); +} + @@ -167,9 +173,9 @@ + } + + -+ down(&idr_lock); ++ mutex_lock(&idr_lock); + err = idr_get_new(&rtc_idr, NULL, &id); -+ up(&idr_lock); ++ mutex_unlock(&idr_lock); + + if (err < 0) + goto exit; @@ -188,7 +194,7 @@ + rtc->class_dev.class = rtc_class; + rtc->class_dev.release = rtc_device_release; + -+ init_MUTEX(&rtc->ops_lock); ++ mutex_init(&rtc->ops_lock); + spin_lock_init(&rtc->irq_lock); + spin_lock_init(&rtc->irq_task_lock); + @@ -222,9 +228,9 @@ + */ +void rtc_device_unregister(struct rtc_device *rtc) +{ -+ down(&rtc->ops_lock); ++ mutex_lock(&rtc->ops_lock); + rtc->ops = NULL; -+ up(&rtc->ops_lock); ++ mutex_unlock(&rtc->ops_lock); + class_device_unregister(&rtc->class_dev); +} +EXPORT_SYMBOL_GPL(rtc_device_unregister); @@ -258,8 +264,8 @@ +MODULE_DESCRIPTION("RTC class support"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Kconfig 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,121 @@ ++++ linux-rtc/drivers/rtc/Kconfig 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,131 @@ +# +# RTC class/drivers configuration +# @@ -365,6 +371,16 @@ + This driver can also be built as a module. If so, the module + will be called rtc-pcf8563. + ++config RTC_DRV_RS5C372 ++ tristate "Ricoh RS5C372A/B" ++ depends on RTC_CLASS && I2C ++ help ++ If you say yes here you get support for the ++ Ricoh RS5C372A and RS5C372B RTC chips. ++ ++ This driver can also be built as a module. If so, the module ++ will be called rtc-rs5c372. ++ +config RTC_DRV_TEST + tristate "Test driver/device" + depends on RTC_CLASS @@ -382,8 +398,8 @@ + +endmenu --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Makefile 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,17 @@ ++++ linux-rtc/drivers/rtc/Makefile 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,18 @@ +# +# Makefile for RTC class/drivers. +# @@ -400,10 +416,11 @@ +obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o +obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o +obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o ++obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o + --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/interface.c 2006-02-07 01:32:10.000000000 +0100 -@@ -0,0 +1,232 @@ ++++ linux-rtc/drivers/rtc/interface.c 2006-02-19 23:33:15.000000000 +0100 +@@ -0,0 +1,274 @@ +/* + * RTC subsystem, interface functions + * @@ -426,7 +443,7 @@ + int err; + struct rtc_device *rtc = to_rtc_device(class_dev); + -+ if ((err = down_interruptible(&rtc->ops_lock))) ++ if ((err = mutex_lock_interruptible(&rtc->ops_lock))) + return err; + + if (!rtc->ops) @@ -438,7 +455,7 @@ + err = rtc->ops->read_time(class_dev->dev, tm); + } + -+ up(&rtc->ops_lock); ++ mutex_unlock(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_read_time); @@ -451,7 +468,7 @@ + if ((err = rtc_valid_tm(tm)) != 0) + return err; + -+ if ((err = down_interruptible(&rtc->ops_lock))) ++ if ((err = mutex_lock_interruptible(&rtc->ops_lock))) + return err; + + if (!rtc->ops) @@ -461,17 +478,59 @@ + else + err = rtc->ops->set_time(class_dev->dev, tm); + -+ up(&rtc->ops_lock); ++ mutex_unlock(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_set_time); + ++int rtc_set_mmss(struct class_device *class_dev, unsigned long secs) ++{ ++ int err; ++ struct rtc_device *rtc = to_rtc_device(class_dev); ++ ++ if ((err = mutex_lock_interruptible(&rtc->ops_lock))) ++ return err; ++ ++ if (!rtc->ops) ++ err = -ENODEV; ++ else if (!rtc->ops->set_mmss) { ++ if (rtc->ops->read_time && rtc->ops->set_time) { ++ struct rtc_time new, old; ++ ++ new.tm_sec = secs % 60; ++ secs /= 60; ++ new.tm_min = secs % 60; ++ secs /= 60; ++ new.tm_hour = secs % 24; ++ ++ /* ++ * avoid writing when we're going to change the day ++ * of the month. We will retry in the next minute. ++ * This basically means that if the RTC must not drift ++ * by more than 1 minute in 11 minutes. ++ */ ++ if (!((old.tm_hour == 23 && old.tm_min == 59) || ++ (new.tm_hour == 23 && new.tm_min == 59))) ++ err = rtc->ops->set_time(class_dev->dev, &new); ++ } ++ else ++ err = -EINVAL; ++ } ++ else ++ err = rtc->ops->set_mmss(class_dev->dev, secs); ++ ++ mutex_unlock(&rtc->ops_lock); ++ ++ return err; ++} ++EXPORT_SYMBOL(rtc_set_mmss); ++ +int rtc_read_alarm(struct class_device *class_dev, struct rtc_wkalrm *alarm) +{ + int err; + struct rtc_device *rtc = to_rtc_device(class_dev); + -+ if ((err = down_interruptible(&rtc->ops_lock))) ++ if ((err = mutex_lock_interruptible(&rtc->ops_lock))) + return err; + + if (rtc->ops == NULL) @@ -483,7 +542,7 @@ + err = rtc->ops->read_alarm(class_dev->dev, alarm); + } + -+ up(&rtc->ops_lock); ++ mutex_unlock(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_read_alarm); @@ -493,7 +552,7 @@ + int err; + struct rtc_device *rtc = to_rtc_device(class_dev); + -+ if ((err = down_interruptible(&rtc->ops_lock))) ++ if ((err = mutex_lock_interruptible(&rtc->ops_lock))) + return err; + + if (!rtc->ops) @@ -503,7 +562,7 @@ + else + err = rtc->ops->set_alarm(class_dev->dev, alarm); + -+ up(&rtc->ops_lock); ++ mutex_unlock(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_set_alarm); @@ -527,7 +586,7 @@ +} +EXPORT_SYMBOL(rtc_update_irq); + -+struct class_device *rtc_open(char *name) ++struct class_device *rtc_class_open(char *name) +{ + struct class_device *class_dev = NULL, + *class_dev_tmp; @@ -548,13 +607,13 @@ + + return class_dev; +} -+EXPORT_SYMBOL(rtc_open); ++EXPORT_SYMBOL(rtc_class_open); + -+void rtc_close(struct class_device *class_dev) ++void rtc_class_close(struct class_device *class_dev) +{ + module_put(to_rtc_device(class_dev)->owner); +} -+EXPORT_SYMBOL(rtc_close); ++EXPORT_SYMBOL(rtc_class_close); + +int rtc_irq_register(struct class_device *class_dev, struct rtc_task *task) +{ @@ -637,7 +696,7 @@ + +} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/utils.c 2006-02-06 21:11:33.000000000 +0100 ++++ linux-rtc/drivers/rtc/utils.c 2006-02-19 23:33:15.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * RTC subsystem, utility functions @@ -737,8 +796,8 @@ +} +EXPORT_SYMBOL(rtc_tm_to_time); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/hctosys.c 2006-02-06 21:11:33.000000000 +0100 -@@ -0,0 +1,62 @@ ++++ linux-rtc/drivers/rtc/hctosys.c 2006-02-21 00:34:57.000000000 +0100 +@@ -0,0 +1,67 @@ +/* + * RTC subsystem, initialize system time on startup + * @@ -766,12 +825,17 @@ +static int __init rtc_hctosys(void) +{ + int err; -+ struct class_device *class_dev = rtc_open(CONFIG_RTC_HCTOSYS_DEVICE); ++ struct rtc_time tm; ++ struct class_device *class_dev = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); + -+ if (class_dev) { -+ struct rtc_time tm; ++ if (class_dev == NULL) { ++ printk("%s: unable to open rtc device (%s)\n", ++ __FILE__, CONFIG_RTC_HCTOSYS_DEVICE); ++ return -ENODEV; ++ } + -+ if ((err = rtc_read_time(class_dev, &tm)) == 0) { ++ if ((err = rtc_read_time(class_dev, &tm)) == 0) { ++ if (rtc_valid_tm(&tm) == 0) { + struct timespec tv; + + tv.tv_nsec = NSEC_PER_SEC >> 1; @@ -789,21 +853,21 @@ + } + else + dev_err(class_dev->dev, -+ "unable to set the system clock\n"); -+ -+ rtc_close(class_dev); ++ "hctosys: invalid date/time\n"); + } + else -+ printk("%s: unable to open rtc device (%s)\n", -+ __FILE__, CONFIG_RTC_HCTOSYS_DEVICE); ++ dev_err(class_dev->dev, ++ "hctosys: unable to read the hardware clock\n"); ++ ++ rtc_class_close(class_dev); + + return 0; +} + +late_initcall(rtc_hctosys); ---- linux-nslu2.orig/arch/arm/Kconfig 2006-02-06 23:52:28.000000000 +0100 -+++ linux-nslu2/arch/arm/Kconfig 2006-02-06 23:53:25.000000000 +0100 -@@ -784,6 +784,8 @@ source "drivers/usb/Kconfig" +--- linux-rtc.orig/arch/arm/Kconfig 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/arch/arm/Kconfig 2006-02-21 00:36:42.000000000 +0100 +@@ -817,6 +817,8 @@ source "drivers/usb/Kconfig" source "drivers/mmc/Kconfig" @@ -812,8 +876,8 @@ endmenu source "fs/Kconfig" ---- linux-nslu2.orig/arch/arm/common/rtctime.c 2006-02-06 23:52:28.000000000 +0100 -+++ linux-nslu2/arch/arm/common/rtctime.c 2006-02-06 23:53:25.000000000 +0100 +--- linux-rtc.orig/arch/arm/common/rtctime.c 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/arch/arm/common/rtctime.c 2006-02-21 00:36:42.000000000 +0100 @@ -42,89 +42,6 @@ static struct rtc_ops *rtc_ops; #define rtc_epoch 1900UL @@ -984,24 +1048,6 @@ if (ret) break; ret = copy_to_user(uarg, &alrm, sizeof(alrm)); -@@ -353,7 +270,7 @@ static int rtc_ioctl(struct inode *inode - return ret; - } - --static int rtc_open(struct inode *inode, struct file *file) -+static int rtc_arm_open(struct inode *inode, struct file *file) - { - int ret; - -@@ -408,7 +325,7 @@ static struct file_operations rtc_fops = - .read = rtc_read, - .poll = rtc_poll, - .ioctl = rtc_ioctl, -- .open = rtc_open, -+ .open = rtc_arm_open, - .release = rtc_release, - .fasync = rtc_fasync, - }; @@ -427,7 +344,7 @@ static int rtc_read_proc(char *page, cha struct rtc_time tm; char *p = page; @@ -1020,8 +1066,8 @@ p += sprintf(p, "alrm_time\t: "); if ((unsigned int)alrm.time.tm_hour <= 24) p += sprintf(p, "%02d:", alrm.time.tm_hour); ---- linux-nslu2.orig/include/asm-arm/rtc.h 2006-02-06 23:52:28.000000000 +0100 -+++ linux-nslu2/include/asm-arm/rtc.h 2006-02-06 23:53:25.000000000 +0100 +--- linux-rtc.orig/include/asm-arm/rtc.h 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/include/asm-arm/rtc.h 2006-02-21 00:36:42.000000000 +0100 @@ -25,9 +25,6 @@ struct rtc_ops { int (*proc)(char *buf); }; @@ -1032,9 +1078,1269 @@ void rtc_next_alarm_time(struct rtc_time *, struct rtc_time *, struct rtc_time *); void rtc_update(unsigned long, unsigned long); int register_rtc(struct rtc_ops *); +--- linux-rtc.orig/drivers/char/Kconfig 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/drivers/char/Kconfig 2006-02-21 00:36:42.000000000 +0100 +@@ -695,7 +695,7 @@ config NVRAM + + config RTC + tristate "Enhanced Real Time Clock Support" +- depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV ++ depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV && !ARM + ---help--- + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you +--- linux-rtc.orig/drivers/i2c/chips/x1205.c 2006-02-21 00:34:27.000000000 +0100 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,698 +0,0 @@ +-/* +- * x1205.c - An i2c driver for the Xicor X1205 RTC +- * Copyright 2004 Karen Spearel +- * Copyright 2005 Alessandro Zummo +- * +- * please send all reports to: +- * kas11 at tampabay dot rr dot com +- * a dot zummo at towertech dot it +- * +- * based on the other drivers in this same directory. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- */ +- +-#include <linux/module.h> +-#include <linux/init.h> +-#include <linux/slab.h> +-#include <linux/i2c.h> +-#include <linux/string.h> +-#include <linux/bcd.h> +-#include <linux/rtc.h> +-#include <linux/list.h> +- +-#include <linux/x1205.h> +- +-#define DRV_VERSION "0.9.9" +- +-/* Addresses to scan: none. This chip is located at +- * 0x6f and uses a two bytes register addressing. +- * Two bytes need to be written to read a single register, +- * while most other chips just require one and take the second +- * one as the data to be written. To prevent corrupting +- * unknown chips, the user must explicitely set the probe parameter. +- */ +- +-static unsigned short normal_i2c[] = { I2C_CLIENT_END }; +- +-/* Insmod parameters */ +-I2C_CLIENT_INSMOD; +-I2C_CLIENT_MODULE_PARM(hctosys, +- "Set the system time from the hardware clock upon initialization"); +- +-/* offsets into CCR area */ +- +-#define CCR_SEC 0 +-#define CCR_MIN 1 +-#define CCR_HOUR 2 +-#define CCR_MDAY 3 +-#define CCR_MONTH 4 +-#define CCR_YEAR 5 +-#define CCR_WDAY 6 +-#define CCR_Y2K 7 +- +-#define X1205_REG_SR 0x3F /* status register */ +-#define X1205_REG_Y2K 0x37 +-#define X1205_REG_DW 0x36 +-#define X1205_REG_YR 0x35 +-#define X1205_REG_MO 0x34 +-#define X1205_REG_DT 0x33 +-#define X1205_REG_HR 0x32 +-#define X1205_REG_MN 0x31 +-#define X1205_REG_SC 0x30 +-#define X1205_REG_DTR 0x13 +-#define X1205_REG_ATR 0x12 +-#define X1205_REG_INT 0x11 +-#define X1205_REG_0 0x10 +-#define X1205_REG_Y2K1 0x0F +-#define X1205_REG_DWA1 0x0E +-#define X1205_REG_YRA1 0x0D +-#define X1205_REG_MOA1 0x0C +-#define X1205_REG_DTA1 0x0B +-#define X1205_REG_HRA1 0x0A +-#define X1205_REG_MNA1 0x09 +-#define X1205_REG_SCA1 0x08 +-#define X1205_REG_Y2K0 0x07 +-#define X1205_REG_DWA0 0x06 +-#define X1205_REG_YRA0 0x05 +-#define X1205_REG_MOA0 0x04 +-#define X1205_REG_DTA0 0x03 +-#define X1205_REG_HRA0 0x02 +-#define X1205_REG_MNA0 0x01 +-#define X1205_REG_SCA0 0x00 +- +-#define X1205_CCR_BASE 0x30 /* Base address of CCR */ +-#define X1205_ALM0_BASE 0x00 /* Base address of ALARM0 */ +- +-#define X1205_SR_RTCF 0x01 /* Clock failure */ +-#define X1205_SR_WEL 0x02 /* Write Enable Latch */ +-#define X1205_SR_RWEL 0x04 /* Register Write Enable */ +- +-#define X1205_DTR_DTR0 0x01 +-#define X1205_DTR_DTR1 0x02 +-#define X1205_DTR_DTR2 0x04 +- +-#define X1205_HR_MIL 0x80 /* Set in ccr.hour for 24 hr mode */ +- +-/* Prototypes */ +-static int x1205_attach(struct i2c_adapter *adapter); +-static int x1205_detach(struct i2c_client *client); +-static int x1205_probe(struct i2c_adapter *adapter, int address, int kind); +-static int x1205_command(struct i2c_client *client, unsigned int cmd, +- void *arg); +- +-static struct i2c_driver x1205_driver = { +- .driver = { +- .name = "x1205", +- }, +- .attach_adapter = &x1205_attach, +- .detach_client = &x1205_detach, +-}; +- +-struct x1205_data { +- struct i2c_client client; +- struct list_head list; +- unsigned int epoch; +-}; +- +-static const unsigned char days_in_mo[] = +- { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +- +-static LIST_HEAD(x1205_clients); +- +-/* Workaround until the I2C subsytem will allow to send +- * commands to a specific client. This function will send the command +- * to the first client. +- */ +-int x1205_do_command(unsigned int cmd, void *arg) +-{ +- struct list_head *walk; +- struct list_head *tmp; +- struct x1205_data *data; +- +- list_for_each_safe(walk, tmp, &x1205_clients) { +- data = list_entry(walk, struct x1205_data, list); +- return x1205_command(&data->client, cmd, arg); +- } +- +- return -ENODEV; +-} +- +-#define is_leap(year) \ +- ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) +- +-/* make sure the rtc_time values are in bounds */ +-static int x1205_validate_tm(struct rtc_time *tm) +-{ +- int year = tm->tm_year + 1900; +- +- if ((tm->tm_year < 70) || (tm->tm_year > 255)) +- return -EINVAL; +- +- if ((tm->tm_mon > 11) || (tm->tm_mday == 0)) +- return -EINVAL; +- +- if (tm->tm_mday > days_in_mo[tm->tm_mon] +- + ((tm->tm_mon == 1) && is_leap(year))) +- return -EINVAL; +- +- if ((tm->tm_hour >= 24) || (tm->tm_min >= 60) || (tm->tm_sec >= 60)) +- return -EINVAL; +- +- return 0; +-} +- +-/* +- * In the routines that deal directly with the x1205 hardware, we use +- * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch +- * Epoch is initialized as 2000. Time is set to UTC. +- */ +-static int x1205_get_datetime(struct i2c_client *client, struct rtc_time *tm, +- u8 reg_base) +-{ +- unsigned char dt_addr[2] = { 0, reg_base }; +- static unsigned char sr_addr[2] = { 0, X1205_REG_SR }; +- +- unsigned char buf[8], sr; +- +- struct i2c_msg msgs[] = { +- { client->addr, 0, 2, sr_addr }, /* setup read ptr */ +- { client->addr, I2C_M_RD, 1, &sr }, /* read status */ +- { client->addr, 0, 2, dt_addr }, /* setup read ptr */ +- { client->addr, I2C_M_RD, 8, buf }, /* read date */ +- }; +- +- struct x1205_data *data = i2c_get_clientdata(client); +- +- /* read status register */ +- if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { +- dev_err(&client->dev, "%s: read error\n", __FUNCTION__); +- return -EIO; +- } +- +- /* check for battery failure */ +- if (sr & X1205_SR_RTCF) { +- dev_warn(&client->dev, +- "Clock had a power failure, you must set the date.\n"); +- return -EINVAL; +- } +- +- /* read date registers */ +- if ((i2c_transfer(client->adapter, &msgs[2], 2)) != 2) { +- dev_err(&client->dev, "%s: read error\n", __FUNCTION__); +- return -EIO; +- } +- +- dev_dbg(&client->dev, +- "%s: raw read data - sec=%02x, min=%02x, hr=%02x, " +- "mday=%02x, mon=%02x, year=%02x, wday=%02x, y2k=%02x\n", +- __FUNCTION__, +- buf[0], buf[1], buf[2], buf[3], +- buf[4], buf[5], buf[6], buf[7]); +- +- tm->tm_sec = BCD2BIN(buf[CCR_SEC]); +- tm->tm_min = BCD2BIN(buf[CCR_MIN]); +- tm->tm_hour = BCD2BIN(buf[CCR_HOUR] & 0x3F); /* hr is 0-23 */ +- tm->tm_mday = BCD2BIN(buf[CCR_MDAY]); +- tm->tm_mon = BCD2BIN(buf[CCR_MONTH]); +- data->epoch = BCD2BIN(buf[CCR_Y2K]) * 100; +- tm->tm_year = BCD2BIN(buf[CCR_YEAR]) + data->epoch - 1900; +- tm->tm_wday = buf[CCR_WDAY]; +- +- dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " +- "mday=%d, mon=%d, year=%d, wday=%d\n", +- __FUNCTION__, +- tm->tm_sec, tm->tm_min, tm->tm_hour, +- tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); +- +- return 0; +-} +- +-static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm, +- int datetoo, u8 reg_base) +-{ +- int i, err, xfer; +- +- unsigned char buf[8]; +- +- static const unsigned char wel[3] = { 0, X1205_REG_SR, +- X1205_SR_WEL }; +- +- static const unsigned char rwel[3] = { 0, X1205_REG_SR, +- X1205_SR_WEL | X1205_SR_RWEL }; +- +- static const unsigned char diswe[3] = { 0, X1205_REG_SR, 0 }; +- +- struct x1205_data *data = i2c_get_clientdata(client); +- +- /* check if all values in the tm struct are correct */ +- if ((err = x1205_validate_tm(tm)) < 0) +- return err; +- +- dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " +- "mday=%d, mon=%d, year=%d, wday=%d\n", +- __FUNCTION__, +- tm->tm_sec, tm->tm_min, tm->tm_hour, +- tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); +- +- buf[CCR_SEC] = BIN2BCD(tm->tm_sec); +- buf[CCR_MIN] = BIN2BCD(tm->tm_min); +- +- /* set hour and 24hr bit */ +- buf[CCR_HOUR] = BIN2BCD(tm->tm_hour) | X1205_HR_MIL; +- +- /* should we also set the date? */ +- if (datetoo) { +- buf[CCR_MDAY] = BIN2BCD(tm->tm_mday); +- +- /* month, 0 - 11 */ +- buf[CCR_MONTH] = BIN2BCD(tm->tm_mon); +- +- /* year, since 1900 */ +- buf[CCR_YEAR] = BIN2BCD(tm->tm_year + 1900 - data->epoch); +- buf[CCR_WDAY] = tm->tm_wday & 0x07; +- buf[CCR_Y2K] = BIN2BCD(data->epoch / 100); +- } +- +- /* this sequence is required to unlock the chip */ +- xfer = i2c_master_send(client, wel, 3); +- if (xfer != 3) { +- dev_err(&client->dev, "%s: wel - %d\n", __FUNCTION__, xfer); +- return -EIO; +- } +- +- xfer = i2c_master_send(client, rwel, 3); +- if (xfer != 3) { +- dev_err(&client->dev, "%s: rwel - %d\n", __FUNCTION__, xfer); +- return -EIO; +- } +- +- /* write register's data */ +- for (i = 0; i < (datetoo ? 8 : 3); i++) { +- unsigned char rdata[3] = { 0, reg_base + i, buf[i] }; +- +- xfer = i2c_master_send(client, rdata, 3); +- if (xfer != 3) { +- dev_err(&client->dev, +- "%s: xfer=%d addr=%02x, data=%02x\n", +- __FUNCTION__, +- xfer, rdata[1], rdata[2]); +- return -EIO; +- } +- }; +- +- /* disable further writes */ +- xfer = i2c_master_send(client, diswe, 3); +- if (xfer != 3) { +- dev_err(&client->dev, "%s: diswe - %d\n", __FUNCTION__, xfer); +- return -EIO; +- } +- +- return 0; +-} +- +-static int x1205_get_dtrim(struct i2c_client *client, int *trim) +-{ +- unsigned char dtr; +- static unsigned char dtr_addr[2] = { 0, X1205_REG_DTR }; +- +- struct i2c_msg msgs[] = { +- { client->addr, 0, 2, dtr_addr }, /* setup read ptr */ +- { client->addr, I2C_M_RD, 1, &dtr }, /* read dtr */ +- }; +- +- /* read dtr register */ +- if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { +- dev_err(&client->dev, "%s: read error\n", __FUNCTION__); +- return -EIO; +- } +- +- dev_dbg(&client->dev, "%s: raw dtr=%x\n", __FUNCTION__, dtr); +- +- *trim = 0; +- +- if (dtr & X1205_DTR_DTR0) +- *trim += 20; +- +- if (dtr & X1205_DTR_DTR1) +- *trim += 10; +- +- if (dtr & X1205_DTR_DTR2) +- *trim = -*trim; +- +- return 0; +-} +- +-static int x1205_get_atrim(struct i2c_client *client, int *trim) +-{ +- s8 atr; +- static unsigned char atr_addr[2] = { 0, X1205_REG_ATR }; +- +- struct i2c_msg msgs[] = { +- { client->addr, 0, 2, atr_addr }, /* setup read ptr */ +- { client->addr, I2C_M_RD, 1, &atr }, /* read atr */ +- }; +- +- /* read atr register */ +- if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { +- dev_err(&client->dev, "%s: read error\n", __FUNCTION__); +- return -EIO; +- } +- +- dev_dbg(&client->dev, "%s: raw atr=%x\n", __FUNCTION__, atr); +- +- /* atr is a two's complement value on 6 bits, +- * perform sign extension. The formula is +- * Catr = (atr * 0.25pF) + 11.00pF. +- */ +- if (atr & 0x20) +- atr |= 0xC0; +- +- dev_dbg(&client->dev, "%s: raw atr=%x (%d)\n", __FUNCTION__, atr, atr); +- +- *trim = (atr * 250) + 11000; +- +- dev_dbg(&client->dev, "%s: real=%d\n", __FUNCTION__, *trim); +- +- return 0; +-} +- +-static int x1205_hctosys(struct i2c_client *client) +-{ +- int err; +- +- struct rtc_time tm; +- struct timespec tv; +- +- err = x1205_command(client, X1205_CMD_GETDATETIME, &tm); +- +- if (err) { +- dev_err(&client->dev, +- "Unable to set the system clock\n"); +- return err; +- } +- +- /* IMPORTANT: the RTC only stores whole seconds. It is arbitrary +- * whether it stores the most close value or the value with partial +- * seconds truncated. However, it is important that we use it to store +- * the truncated value. This is because otherwise it is necessary, +- * in an rtc sync function, to read both xtime.tv_sec and +- * xtime.tv_nsec. On some processors (i.e. ARM), an atomic read +- * of >32bits is not possible. So storing the most close value would +- * slow down the sync API. So here we have the truncated value and +- * the best guess is to add 0.5s. +- */ +- +- tv.tv_nsec = NSEC_PER_SEC >> 1; +- +- /* WARNING: this is not the C library 'mktime' call, it is a built in +- * inline function from include/linux/time.h. It expects (requires) +- * the month to be in the range 1-12 +- */ +- +- tv.tv_sec = mktime(tm.tm_year + 1900, tm.tm_mon + 1, +- tm.tm_mday, tm.tm_hour, +- tm.tm_min, tm.tm_sec); +- +- do_settimeofday(&tv); +- +- dev_info(&client->dev, +- "setting the system clock to %d-%d-%d %d:%d:%d\n", +- tm.tm_year + 1900, tm.tm_mon + 1, +- tm.tm_mday, tm.tm_hour, tm.tm_min, +- tm.tm_sec); +- +- return 0; +-} +- +-struct x1205_limit +-{ +- unsigned char reg; +- unsigned char mask; +- unsigned char min; +- unsigned char max; +-}; +- +-static int x1205_validate_client(struct i2c_client *client) +-{ +- int i, xfer; +- +- /* Probe array. We will read the register at the specified +- * address and check if the given bits are zero. +- */ +- static const unsigned char probe_zero_pattern[] = { +- /* register, mask */ +- X1205_REG_SR, 0x18, +- X1205_REG_DTR, 0xF8, +- X1205_REG_ATR, 0xC0, +- X1205_REG_INT, 0x18, +- X1205_REG_0, 0xFF, +- }; +- +- static const struct x1205_limit probe_limits_pattern[] = { +- /* register, mask, min, max */ +- { X1205_REG_Y2K, 0xFF, 19, 20 }, +- { X1205_REG_DW, 0xFF, 0, 6 }, +- { X1205_REG_YR, 0xFF, 0, 99 }, +- { X1205_REG_MO, 0xFF, 0, 12 }, +- { X1205_REG_DT, 0xFF, 0, 31 }, +- { X1205_REG_HR, 0x7F, 0, 23 }, +- { X1205_REG_MN, 0xFF, 0, 59 }, +- { X1205_REG_SC, 0xFF, 0, 59 }, +- { X1205_REG_Y2K1, 0xFF, 19, 20 }, +- { X1205_REG_Y2K0, 0xFF, 19, 20 }, +- }; +- +- /* check that registers have bits a 0 where expected */ +- for (i = 0; i < ARRAY_SIZE(probe_zero_pattern); i += 2) { +- unsigned char buf; +- +- unsigned char addr[2] = { 0, probe_zero_pattern[i] }; +- +- struct i2c_msg msgs[2] = { +- { client->addr, 0, 2, addr }, +- { client->addr, I2C_M_RD, 1, &buf }, +- }; +- +- xfer = i2c_transfer(client->adapter, msgs, 2); +- if (xfer != 2) { +- dev_err(&client->adapter->dev, +- "%s: could not read register %x\n", +- __FUNCTION__, addr[1]); +- +- return -EIO; +- } +- +- if ((buf & probe_zero_pattern[i+1]) != 0) { +- dev_err(&client->adapter->dev, +- "%s: register=%02x, zero pattern=%d, value=%x\n", +- __FUNCTION__, addr[1], i, buf); +- +- return -ENODEV; +- } +- } +- +- /* check limits (only registers with bcd values) */ +- for (i = 0; i < ARRAY_SIZE(probe_limits_pattern); i++) { +- unsigned char reg, value; +- +- unsigned char addr[2] = { 0, probe_limits_pattern[i].reg }; +- +- struct i2c_msg msgs[2] = { +- { client->addr, 0, 2, addr }, +- { client->addr, I2C_M_RD, 1, ® }, +- }; +- +- xfer = i2c_transfer(client->adapter, msgs, 2); +- +- if (xfer != 2) { +- dev_err(&client->adapter->dev, +- "%s: could not read register %x\n", +- __FUNCTION__, addr[1]); +- +- return -EIO; +- } +- +- value = BCD2BIN(reg & probe_limits_pattern[i].mask); +- +- if (value > probe_limits_pattern[i].max || +- value < probe_limits_pattern[i].min) { +- dev_dbg(&client->adapter->dev, +- "%s: register=%x, lim pattern=%d, value=%d\n", +- __FUNCTION__, addr[1], i, value); +- +- return -ENODEV; +- } +- } +- +- return 0; +-} +- +-static int x1205_attach(struct i2c_adapter *adapter) +-{ +- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); +- +- return i2c_probe(adapter, &addr_data, x1205_probe); +-} +- +-int x1205_direct_attach(int adapter_id, +- struct i2c_client_address_data *address_data) +-{ +- int err; +- struct i2c_adapter *adapter = i2c_get_adapter(adapter_id); +- +- if (adapter) { +- err = i2c_probe(adapter, +- address_data, x1205_probe); +- +- i2c_put_adapter(adapter); +- +- return err; +- } +- +- return -ENODEV; +-} +- +-static int x1205_probe(struct i2c_adapter *adapter, int address, int kind) +-{ +- struct i2c_client *client; +- struct x1205_data *data; +- +- int err = 0; +- +- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); +- +- if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { +- err = -ENODEV; +- goto exit; +- } +- +- if (!(data = kzalloc(sizeof(struct x1205_data), GFP_KERNEL))) { +- err = -ENOMEM; +- goto exit; +- } +- +- /* Initialize our structures */ +- data->epoch = 2000; +- +- client = &data->client; +- client->addr = address; +- client->driver = &x1205_driver; +- client->adapter = adapter; +- +- strlcpy(client->name, "x1205", I2C_NAME_SIZE); +- +- i2c_set_clientdata(client, data); +- +- /* Verify the chip is really an X1205 */ +- if (kind < 0) { +- if (x1205_validate_client(client) < 0) { +- err = -ENODEV; +- goto exit_kfree; +- } +- } +- +- /* Inform the i2c layer */ +- if ((err = i2c_attach_client(client))) +- goto exit_kfree; +- +- list_add(&data->list, &x1205_clients); +- +- dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); +- +- /* If requested, set the system time */ +- if (hctosys) +- x1205_hctosys(client); +- +- return 0; +- +-exit_kfree: +- kfree(data); +- +-exit: +- return err; +-} +- +-static int x1205_detach(struct i2c_client *client) +-{ +- int err; +- struct x1205_data *data = i2c_get_clientdata(client); +- +- dev_dbg(&client->dev, "%s\n", __FUNCTION__); +- +- if ((err = i2c_detach_client(client))) +- return err; +- +- list_del(&data->list); +- +- kfree(data); +- +- return 0; +-} +- +-static int x1205_command(struct i2c_client *client, unsigned int cmd, +- void *param) +-{ +- if (param == NULL) +- return -EINVAL; +- +- if (!capable(CAP_SYS_TIME)) +- return -EACCES; +- +- dev_dbg(&client->dev, "%s: cmd=%d\n", __FUNCTION__, cmd); +- +- switch (cmd) { +- case X1205_CMD_GETDATETIME: +- return x1205_get_datetime(client, param, X1205_CCR_BASE); +- +- case X1205_CMD_SETTIME: +- return x1205_set_datetime(client, param, 0, +- X1205_CCR_BASE); +- +- case X1205_CMD_SETDATETIME: +- return x1205_set_datetime(client, param, 1, +- X1205_CCR_BASE); +- +- case X1205_CMD_GETALARM: +- return x1205_get_datetime(client, param, X1205_ALM0_BASE); +- +- case X1205_CMD_SETALARM: +- return x1205_set_datetime(client, param, 1, +- X1205_ALM0_BASE); +- +- case X1205_CMD_GETDTRIM: +- return x1205_get_dtrim(client, param); +- +- case X1205_CMD_GETATRIM: +- return x1205_get_atrim(client, param); +- +- default: +- return -EINVAL; +- } +-} +- +-static int __init x1205_init(void) +-{ +- return i2c_add_driver(&x1205_driver); +-} +- +-static void __exit x1205_exit(void) +-{ +- i2c_del_driver(&x1205_driver); +-} +- +-MODULE_AUTHOR( +- "Karen Spearel <kas11@tampabay.rr.com>, " +- "Alessandro Zummo <a.zummo@towertech.it>"); +-MODULE_DESCRIPTION("Xicor X1205 RTC driver"); +-MODULE_LICENSE("GPL"); +-MODULE_VERSION(DRV_VERSION); +- +-EXPORT_SYMBOL_GPL(x1205_do_command); +-EXPORT_SYMBOL_GPL(x1205_direct_attach); +- +-module_init(x1205_init); +-module_exit(x1205_exit); +--- linux-rtc.orig/drivers/i2c/chips/Makefile 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/drivers/i2c/chips/Makefile 2006-02-21 00:36:43.000000000 +0100 +@@ -10,10 +10,8 @@ obj-$(CONFIG_SENSORS_M41T00) += m41t00.o + obj-$(CONFIG_SENSORS_PCA9539) += pca9539.o + obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o + obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o +-obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o + obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o + obj-$(CONFIG_TPS65010) += tps65010.o +-obj-$(CONFIG_RTC_X1205_I2C) += x1205.o + + ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) + EXTRA_CFLAGS += -DDEBUG +--- linux-rtc.orig/drivers/i2c/chips/rtc8564.c 2006-02-21 00:34:27.000000000 +0100 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,385 +0,0 @@ +-/* +- * linux/drivers/i2c/chips/rtc8564.c +- * +- * Copyright (C) 2002-2004 Stefan Eletzhofer +- * +- * based on linux/drivers/acron/char/pcf8583.c +- * Copyright (C) 2000 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. +- * +- * Driver for system3's EPSON RTC 8564 chip +- */ +-#include <linux/module.h> +-#include <linux/kernel.h> +-#include <linux/bcd.h> +-#include <linux/i2c.h> +-#include <linux/slab.h> +-#include <linux/string.h> +-#include <linux/rtc.h> /* get the user-level API */ +-#include <linux/init.h> +- +-#include "rtc8564.h" +- +-#ifdef DEBUG +-# define _DBG(x, fmt, args...) do{ if (debug>=x) printk(KERN_DEBUG"%s: " fmt "\n", __FUNCTION__, ##args); } while(0); +-#else +-# define _DBG(x, fmt, args...) do { } while(0); +-#endif +- +-#define _DBGRTCTM(x, rtctm) if (debug>=x) printk("%s: secs=%d, mins=%d, hours=%d, mday=%d, " \ +- "mon=%d, year=%d, wday=%d VL=%d\n", __FUNCTION__, \ +- (rtctm).secs, (rtctm).mins, (rtctm).hours, (rtctm).mday, \ +- (rtctm).mon, (rtctm).year, (rtctm).wday, (rtctm).vl); +- +-struct rtc8564_data { +- struct i2c_client client; +- u16 ctrl; +-}; +- +-static inline u8 _rtc8564_ctrl1(struct i2c_client *client) +-{ +- struct rtc8564_data *data = i2c_get_clientdata(client); +- return data->ctrl & 0xff; +-} +-static inline u8 _rtc8564_ctrl2(struct i2c_client *client) +-{ +- struct rtc8564_data *data = i2c_get_clientdata(client); +- return (data->ctrl & 0xff00) >> 8; +-} +- +-#define CTRL1(c) _rtc8564_ctrl1(c) +-#define CTRL2(c) _rtc8564_ctrl2(c) +- +-static int debug;; +-module_param(debug, int, S_IRUGO | S_IWUSR); +- +-static struct i2c_driver rtc8564_driver; +- +-static unsigned short ignore[] = { I2C_CLIENT_END }; +-static unsigned short normal_addr[] = { 0x51, I2C_CLIENT_END }; +- +-static struct i2c_client_address_data addr_data = { +- .normal_i2c = normal_addr, +- .probe = ignore, +- .ignore = ignore, +-}; +- +-static int rtc8564_read_mem(struct i2c_client *client, struct mem *mem); +-static int rtc8564_write_mem(struct i2c_client *client, struct mem *mem); +- +-static int rtc8564_read(struct i2c_client *client, unsigned char adr, +- unsigned char *buf, unsigned char len) +-{ +- int ret = -EIO; +- unsigned char addr[1] = { adr }; +- struct i2c_msg msgs[2] = { +- {client->addr, 0, 1, addr}, +- {client->addr, I2C_M_RD, len, buf} +- }; +- +- _DBG(1, "client=%p, adr=%d, buf=%p, len=%d", client, adr, buf, len); +- +- if (!buf) { +- ret = -EINVAL; +- goto done; +- } +- +- ret = i2c_transfer(client->adapter, msgs, 2); +- if (ret == 2) { +- ret = 0; +- } +- +-done: +- return ret; +-} +- +-static int rtc8564_write(struct i2c_client *client, unsigned char adr, +- unsigned char *data, unsigned char len) +-{ +- int ret = 0; +- unsigned char _data[16]; +- struct i2c_msg wr; +- int i; +- +- if (!data || len > 15) { +- ret = -EINVAL; +- goto done; +- } +- +- _DBG(1, "client=%p, adr=%d, buf=%p, len=%d", client, adr, data, len); +- +- _data[0] = adr; +- for (i = 0; i < len; i++) { +- _data[i + 1] = data[i]; +- _DBG(5, "data[%d] = 0x%02x (%d)", i, data[i], data[i]); +- } +- +- wr.addr = client->addr; +- wr.flags = 0; +- wr.len = len + 1; +- wr.buf = _data; +- +- ret = i2c_transfer(client->adapter, &wr, 1); +- if (ret == 1) { +- ret = 0; +- } +- +-done: +- return ret; +-} +- +-static int rtc8564_attach(struct i2c_adapter *adap, int addr, int kind) +-{ +- int ret; +- struct i2c_client *new_client; +- struct rtc8564_data *d; +- unsigned char data[10]; +- unsigned char ad[1] = { 0 }; +- struct i2c_msg ctrl_wr[1] = { +- {addr, 0, 2, data} +- }; +- struct i2c_msg ctrl_rd[2] = { +- {addr, 0, 1, ad}, +- {addr, I2C_M_RD, 2, data} +- }; +- +- d = kzalloc(sizeof(struct rtc8564_data), GFP_KERNEL); +- if (!d) { +- ret = -ENOMEM; +- goto done; +- } +- new_client = &d->client; +- +- strlcpy(new_client->name, "RTC8564", I2C_NAME_SIZE); +- i2c_set_clientdata(new_client, d); +- new_client->addr = addr; +- new_client->adapter = adap; +- new_client->driver = &rtc8564_driver; +- +- _DBG(1, "client=%p", new_client); +- +- /* init ctrl1 reg */ +- data[0] = 0; +- data[1] = 0; +- ret = i2c_transfer(new_client->adapter, ctrl_wr, 1); +- if (ret != 1) { +- printk(KERN_INFO "rtc8564: cant init ctrl1\n"); +- ret = -ENODEV; +- goto done; +- } +- +- /* read back ctrl1 and ctrl2 */ +- ret = i2c_transfer(new_client->adapter, ctrl_rd, 2); +- if (ret != 2) { +- printk(KERN_INFO "rtc8564: cant read ctrl\n"); +- ret = -ENODEV; +- goto done; +- } +- +- d->ctrl = data[0] | (data[1] << 8); +- +- _DBG(1, "RTC8564_REG_CTRL1=%02x, RTC8564_REG_CTRL2=%02x", +- data[0], data[1]); +- +- ret = i2c_attach_client(new_client); +-done: +- if (ret) { +- kfree(d); +- } +- return ret; +-} +- +-static int rtc8564_probe(struct i2c_adapter *adap) +-{ +- return i2c_probe(adap, &addr_data, rtc8564_attach); +-} +- +-static int rtc8564_detach(struct i2c_client *client) +-{ +- i2c_detach_client(client); +- kfree(i2c_get_clientdata(client)); +- return 0; +-} +- +-static int rtc8564_get_datetime(struct i2c_client *client, struct rtc_tm *dt) +-{ +- int ret = -EIO; +- unsigned char buf[15]; +- +- _DBG(1, "client=%p, dt=%p", client, dt); +- +- if (!dt) +- return -EINVAL; +- +- memset(buf, 0, sizeof(buf)); +- +- ret = rtc8564_read(client, 0, buf, 15); +- if (ret) +- return ret; +- +- /* century stored in minute alarm reg */ +- dt->year = BCD2BIN(buf[RTC8564_REG_YEAR]); +- dt->year += 100 * BCD2BIN(buf[RTC8564_REG_AL_MIN] & 0x3f); +- dt->mday = BCD2BIN(buf[RTC8564_REG_DAY] & 0x3f); +- dt->wday = BCD2BIN(buf[RTC8564_REG_WDAY] & 7); +- dt->mon = BCD2BIN(buf[RTC8564_REG_MON_CENT] & 0x1f); +- +- dt->secs = BCD2BIN(buf[RTC8564_REG_SEC] & 0x7f); +- dt->vl = (buf[RTC8564_REG_SEC] & 0x80) == 0x80; +- dt->mins = BCD2BIN(buf[RTC8564_REG_MIN] & 0x7f); +- dt->hours = BCD2BIN(buf[RTC8564_REG_HR] & 0x3f); +- +- _DBGRTCTM(2, *dt); +- +- return 0; +-} +- +-static int +-rtc8564_set_datetime(struct i2c_client *client, struct rtc_tm *dt, int datetoo) +-{ +- int ret, len = 5; +- unsigned char buf[15]; +- +- _DBG(1, "client=%p, dt=%p", client, dt); +- +- if (!dt) +- return -EINVAL; +- +- _DBGRTCTM(2, *dt); +- +- buf[RTC8564_REG_CTRL1] = CTRL1(client) | RTC8564_CTRL1_STOP; +- buf[RTC8564_REG_CTRL2] = CTRL2(client); +- buf[RTC8564_REG_SEC] = BIN2BCD(dt->secs); +- buf[RTC8564_REG_MIN] = BIN2BCD(dt->mins); +- buf[RTC8564_REG_HR] = BIN2BCD(dt->hours); +- +- if (datetoo) { +- len += 5; +- buf[RTC8564_REG_DAY] = BIN2BCD(dt->mday); +- buf[RTC8564_REG_WDAY] = BIN2BCD(dt->wday); +- buf[RTC8564_REG_MON_CENT] = BIN2BCD(dt->mon) & 0x1f; +- /* century stored in minute alarm reg */ +- buf[RTC8564_REG_YEAR] = BIN2BCD(dt->year % 100); +- buf[RTC8564_REG_AL_MIN] = BIN2BCD(dt->year / 100); +- } +- +- ret = rtc8564_write(client, 0, buf, len); +- if (ret) { +- _DBG(1, "error writing data! %d", ret); +- } +- +- buf[RTC8564_REG_CTRL1] = CTRL1(client); +- ret = rtc8564_write(client, 0, buf, 1); +- if (ret) { +- _DBG(1, "error writing data! %d", ret); +- } +- +- return ret; +-} +- +-static int rtc8564_get_ctrl(struct i2c_client *client, unsigned int *ctrl) +-{ +- struct rtc8564_data *data = i2c_get_clientdata(client); +- +- if (!ctrl) +- return -1; +- +- *ctrl = data->ctrl; +- return 0; +-} +- +-static int rtc8564_set_ctrl(struct i2c_client *client, unsigned int *ctrl) +-{ +- struct rtc8564_data *data = i2c_get_clientdata(client); +- unsigned char buf[2]; +- +- if (!ctrl) +- return -1; +- +- buf[0] = *ctrl & 0xff; +- buf[1] = (*ctrl & 0xff00) >> 8; +- data->ctrl = *ctrl; +- +- return rtc8564_write(client, 0, buf, 2); +-} +- +-static int rtc8564_read_mem(struct i2c_client *client, struct mem *mem) +-{ +- +- if (!mem) +- return -EINVAL; +- +- return rtc8564_read(client, mem->loc, mem->data, mem->nr); +-} +- +-static int rtc8564_write_mem(struct i2c_client *client, struct mem *mem) +-{ +- +- if (!mem) +- return -EINVAL; +- +- return rtc8564_write(client, mem->loc, mem->data, mem->nr); +-} +- +-static int +-rtc8564_command(struct i2c_client *client, unsigned int cmd, void *arg) +-{ +- +- _DBG(1, "cmd=%d", cmd); +- +- switch (cmd) { +- case RTC_GETDATETIME: +- return rtc8564_get_datetime(client, arg); +- +- case RTC_SETTIME: +- return rtc8564_set_datetime(client, arg, 0); +- +- case RTC_SETDATETIME: +- return rtc8564_set_datetime(client, arg, 1); +- +- case RTC_GETCTRL: +- return rtc8564_get_ctrl(client, arg); +- +- case RTC_SETCTRL: +- return rtc8564_set_ctrl(client, arg); +- +- case MEM_READ: +- return rtc8564_read_mem(client, arg); +- +- case MEM_WRITE: +- return rtc8564_write_mem(client, arg); +- +- default: +- return -EINVAL; +- } +-} +- +-static struct i2c_driver rtc8564_driver = { +- .driver = { +- .name = "RTC8564", +- }, +- .id = I2C_DRIVERID_RTC8564, +- .attach_adapter = rtc8564_probe, +- .detach_client = rtc8564_detach, +- .command = rtc8564_command +-}; +- +-static __init int rtc8564_init(void) +-{ +- return i2c_add_driver(&rtc8564_driver); +-} +- +-static __exit void rtc8564_exit(void) +-{ +- i2c_del_driver(&rtc8564_driver); +-} +- +-MODULE_AUTHOR("Stefan Eletzhofer <Stefan.Eletzhofer@eletztrick.de>"); +-MODULE_DESCRIPTION("EPSON RTC8564 Driver"); +-MODULE_LICENSE("GPL"); +- +-module_init(rtc8564_init); +-module_exit(rtc8564_exit); +--- linux-rtc.orig/drivers/i2c/chips/rtc8564.h 2006-02-21 00:34:27.000000000 +0100 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,78 +0,0 @@ +-/* +- * linux/drivers/i2c/chips/rtc8564.h +- * +- * Copyright (C) 2002-2004 Stefan Eletzhofer +- * +- * based on linux/drivers/acron/char/pcf8583.h +- * Copyright (C) 2000 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. +- */ +-struct rtc_tm { +- unsigned char secs; +- unsigned char mins; +- unsigned char hours; +- unsigned char mday; +- unsigned char mon; +- unsigned short year; /* xxxx 4 digits :) */ +- unsigned char wday; +- unsigned char vl; +-}; +- +-struct mem { +- unsigned int loc; +- unsigned int nr; +- unsigned char *data; +-}; +- +-#define RTC_GETDATETIME 0 +-#define RTC_SETTIME 1 +-#define RTC_SETDATETIME 2 +-#define RTC_GETCTRL 3 +-#define RTC_SETCTRL 4 +-#define MEM_READ 5 +-#define MEM_WRITE 6 +- +-#define RTC8564_REG_CTRL1 0x0 /* T 0 S 0 | T 0 0 0 */ +-#define RTC8564_REG_CTRL2 0x1 /* 0 0 0 TI/TP | AF TF AIE TIE */ +-#define RTC8564_REG_SEC 0x2 /* VL 4 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_MIN 0x3 /* x 4 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_HR 0x4 /* x x 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_DAY 0x5 /* x x 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_WDAY 0x6 /* x x x x | x 4 2 1 */ +-#define RTC8564_REG_MON_CENT 0x7 /* C x x 1 | 8 4 2 1 */ +-#define RTC8564_REG_YEAR 0x8 /* 8 4 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_AL_MIN 0x9 /* AE 4 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_AL_HR 0xa /* AE 4 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_AL_DAY 0xb /* AE x 2 1 | 8 4 2 1 */ +-#define RTC8564_REG_AL_WDAY 0xc /* AE x x x | x 4 2 1 */ +-#define RTC8564_REG_CLKOUT 0xd /* FE x x x | x x FD1 FD0 */ +-#define RTC8564_REG_TCTL 0xe /* TE x x x | x x FD1 FD0 */ +-#define RTC8564_REG_TIMER 0xf /* 8 bit binary */ +- +-/* Control reg */ +-#define RTC8564_CTRL1_TEST1 (1<<3) +-#define RTC8564_CTRL1_STOP (1<<5) +-#define RTC8564_CTRL1_TEST2 (1<<7) +- +-#define RTC8564_CTRL2_TIE (1<<0) +-#define RTC8564_CTRL2_AIE (1<<1) +-#define RTC8564_CTRL2_TF (1<<2) +-#define RTC8564_CTRL2_AF (1<<3) +-#define RTC8564_CTRL2_TI_TP (1<<4) +- +-/* CLKOUT frequencies */ +-#define RTC8564_FD_32768HZ (0x0) +-#define RTC8564_FD_1024HZ (0x1) +-#define RTC8564_FD_32 (0x2) +-#define RTC8564_FD_1HZ (0x3) +- +-/* Timer CTRL */ +-#define RTC8564_TD_4096HZ (0x0) +-#define RTC8564_TD_64HZ (0x1) +-#define RTC8564_TD_1HZ (0x2) +-#define RTC8564_TD_1_60HZ (0x3) +- +-#define I2C_DRIVERID_RTC8564 0xf000 +--- linux-rtc.orig/include/linux/x1205.h 2006-02-21 00:34:27.000000000 +0100 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,31 +0,0 @@ +-/* +- * x1205.h - defines for drivers/i2c/chips/x1205.c +- * Copyright 2004 Karen Spearel +- * Copyright 2005 Alessandro Zummo +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- */ +- +-#ifndef __LINUX_X1205_H__ +-#define __LINUX_X1205_H__ +- +-/* commands */ +- +-#define X1205_CMD_GETDATETIME 0 +-#define X1205_CMD_SETTIME 1 +-#define X1205_CMD_SETDATETIME 2 +-#define X1205_CMD_GETALARM 3 +-#define X1205_CMD_SETALARM 4 +-#define X1205_CMD_GETDTRIM 5 +-#define X1205_CMD_SETDTRIM 6 +-#define X1205_CMD_GETATRIM 7 +-#define X1205_CMD_SETATRIM 8 +- +-extern int x1205_do_command(unsigned int cmd, void *arg); +-extern int x1205_direct_attach(int adapter_id, +- struct i2c_client_address_data *address_data); +- +-#endif /* __LINUX_X1205_H__ */ +--- linux-rtc.orig/drivers/i2c/chips/Kconfig 2006-02-21 00:34:27.000000000 +0100 ++++ linux-rtc/drivers/i2c/chips/Kconfig 2006-02-21 00:36:43.000000000 +0100 +@@ -65,15 +65,6 @@ config SENSORS_PCF8591 + This driver can also be built as a module. If so, the module + will be called pcf8591. + +-config SENSORS_RTC8564 +- tristate "Epson 8564 RTC chip" +- depends on I2C && EXPERIMENTAL +- help +- If you say yes here you get support for the Epson 8564 RTC chip. +- +- This driver can also be built as a module. If so, the module +- will be called i2c-rtc8564. +- + config ISP1301_OMAP + tristate "Philips ISP1301 with OMAP OTG" + depends on I2C && ARCH_OMAP_OTG +@@ -126,13 +117,4 @@ config SENSORS_MAX6875 + This driver can also be built as a module. If so, the module + will be called max6875. + +-config RTC_X1205_I2C +- tristate "Xicor X1205 RTC chip" +- depends on I2C && EXPERIMENTAL +- help +- If you say yes here you get support for the Xicor X1205 RTC chip. +- +- This driver can also be built as a module. If so, the module +- will be called x1205. +- + endmenu --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-sysfs.c 2006-02-06 23:56:37.000000000 +0100 -@@ -0,0 +1,113 @@ ++++ linux-rtc/drivers/rtc/rtc-sysfs.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,120 @@ +/* + * RTC subsystem, sysfs interface + * @@ -1059,8 +2365,7 @@ + +static ssize_t rtc_sysfs_show_date(struct class_device *dev, char *buf) +{ -+ ssize_t retval = -ENODEV; -+ struct rtc_device *rtc = to_rtc_device(dev); ++ ssize_t retval; + struct rtc_time tm; + + if ((retval = rtc_read_time(dev, &tm)) == 0) { @@ -1074,8 +2379,7 @@ + +static ssize_t rtc_sysfs_show_time(struct class_device *dev, char *buf) +{ -+ ssize_t retval = -ENODEV; -+ struct rtc_device *rtc = to_rtc_device(dev); ++ ssize_t retval; + struct rtc_time tm; + + if ((retval = rtc_read_time(dev, &tm)) == 0) { @@ -1089,8 +2393,7 @@ + +static ssize_t rtc_sysfs_show_since_epoch(struct class_device *dev, char *buf) +{ -+ ssize_t retval = -ENODEV; -+ struct rtc_device *rtc = to_rtc_device(dev); ++ ssize_t retval; + struct rtc_time tm; + + if ((retval = rtc_read_time(dev, &tm)) == 0) { @@ -1103,26 +2406,36 @@ +} +static CLASS_DEVICE_ATTR(since_epoch, S_IRUGO, rtc_sysfs_show_since_epoch, NULL); + -+/* insertion/removal hooks */ ++static struct attribute *rtc_attrs[] = { ++ &class_device_attr_name.attr, ++ &class_device_attr_date.attr, ++ &class_device_attr_time.attr, ++ &class_device_attr_since_epoch.attr, ++ NULL, ++}; ++ ++static struct attribute_group rtc_attr_group = { ++ .attrs = rtc_attrs, ++}; + +static int __devinit rtc_sysfs_add_device(struct class_device *class_dev, + struct class_interface *class_intf) +{ -+ class_device_create_file(class_dev, &class_device_attr_name); -+ class_device_create_file(class_dev, &class_device_attr_date); -+ class_device_create_file(class_dev, &class_device_attr_time); -+ class_device_create_file(class_dev, &class_device_attr_since_epoch); ++ int err; ++ + dev_info(class_dev->dev, "rtc intf: sysfs\n"); -+ return 0; ++ ++ if ((err = sysfs_create_group(&class_dev->kobj, &rtc_attr_group)) != 0) ++ dev_err(class_dev->dev, ++ "failed to create sysfs attributes\n"); ++ ++ return err; +} + +static void rtc_sysfs_remove_device(struct class_device *class_dev, + struct class_interface *class_intf) +{ -+ class_device_remove_file(class_dev, &class_device_attr_name); -+ class_device_remove_file(class_dev, &class_device_attr_date); -+ class_device_remove_file(class_dev, &class_device_attr_time); -+ class_device_remove_file(class_dev, &class_device_attr_since_epoch); ++ sysfs_remove_group(&class_dev->kobj, &rtc_attr_group); +} + +/* interface registration */ @@ -1149,7 +2462,7 @@ +MODULE_DESCRIPTION("RTC class sysfs interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-proc.c 2006-02-06 23:58:32.000000000 +0100 ++++ linux-rtc/drivers/rtc/rtc-proc.c 2006-02-21 00:36:43.000000000 +0100 @@ -0,0 +1,158 @@ +/* + * RTC subsystem, proc interface @@ -1170,7 +2483,7 @@ +#include <linux/seq_file.h> + +static struct class_device *rtc_dev = NULL; -+static DECLARE_MUTEX(rtc_sem); ++static DEFINE_MUTEX(rtc_lock); + +static int rtc_proc_show(struct seq_file *seq, void *offset) +{ @@ -1254,7 +2567,7 @@ +static int rtc_proc_add_device(struct class_device *class_dev, + struct class_interface *class_intf) +{ -+ down(&rtc_sem); ++ mutex_lock(&rtc_lock); + if (rtc_dev == NULL) { + struct proc_dir_entry *ent; + @@ -1272,7 +2585,7 @@ + else + rtc_dev = NULL; + } -+ up(&rtc_sem); ++ mutex_unlock(&rtc_lock); + + return 0; +} @@ -1280,12 +2593,12 @@ +static void rtc_proc_remove_device(struct class_device *class_dev, + struct class_interface *class_intf) +{ -+ down(&rtc_sem); ++ mutex_lock(&rtc_lock); + if (rtc_dev == class_dev) { + remove_proc_entry("driver/rtc", NULL); + rtc_dev = NULL; + } -+ up(&rtc_sem); ++ mutex_unlock(&rtc_lock); +} + +struct class_interface rtc_proc_interface = { @@ -1310,8 +2623,8 @@ +MODULE_DESCRIPTION("RTC class proc interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-dev.c 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,366 @@ ++++ linux-rtc/drivers/rtc/rtc-dev.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,370 @@ +/* + * RTC subsystem, dev interface + * @@ -1342,7 +2655,7 @@ + /* We keep the lock as long as the device is in use + * and return immediately if busy + */ -+ if (down_trylock(&rtc->char_sem)) ++ if (!(mutex_trylock(&rtc->char_lock))) + return -EBUSY; + + file->private_data = &rtc->class_dev; @@ -1358,7 +2671,7 @@ + } + + /* something has gone wrong, release the lock */ -+ up(&rtc->char_sem); ++ mutex_unlock(&rtc->char_lock); + return err; +} + @@ -1402,6 +2715,10 @@ + remove_wait_queue(&rtc->irq_queue, &wait); + + if (ret == 0) { ++ /* Check for any data updates */ ++ if (rtc->ops->read_callback) ++ data = rtc->ops->read_callback(rtc->class_dev.dev, data); ++ + ret = put_user(data, (unsigned long __user *)buf); + if (ret == 0) + ret = sizeof(unsigned long); @@ -1549,7 +2866,7 @@ + if (rtc->ops->release) + rtc->ops->release(rtc->class_dev.dev); + -+ up(&rtc->char_sem); ++ mutex_unlock(&rtc->char_lock); + return 0; +} + @@ -1588,7 +2905,7 @@ + return -EINVAL; + } + -+ init_MUTEX(&rtc->char_sem); ++ mutex_init(&rtc->char_lock); + spin_lock_init(&rtc->irq_lock); + init_waitqueue_head(&rtc->irq_queue); + @@ -1679,16 +2996,16 @@ +MODULE_DESCRIPTION("RTC class dev interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-x1205.c 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,672 @@ ++++ linux-rtc/drivers/rtc/rtc-x1205.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,619 @@ +/* + * An i2c driver for the Xicor/Intersil X1205 RTC + * Copyright 2004 Karen Spearel + * Copyright 2005 Alessandro Zummo + * + * please send all reports to: -+ * kas11 at tampabay dot rr dot com -+ * a dot zummo at towertech dot it ++ * Karen Spearel <kas111 at gmail dot com> ++ * Alessandro Zummo <a.zummo@towertech.it> + * + * based on a lot of other RTC drivers. + * @@ -1698,17 +3015,12 @@ + * (at your option) any later version. + */ + -+#include <linux/module.h> -+#include <linux/init.h> -+#include <linux/slab.h> -+#include <linux/err.h> +#include <linux/i2c.h> -+#include <linux/string.h> +#include <linux/bcd.h> +#include <linux/rtc.h> +#include <linux/delay.h> + -+#define DRV_VERSION "1.0.5" ++#define DRV_VERSION "1.0.6" + +/* Addresses to scan: none. This chip is located at + * 0x6f and uses a two bytes register addressing. @@ -1900,14 +3212,12 @@ + } + + /* this sequence is required to unlock the chip */ -+ xfer = i2c_master_send(client, wel, 3); -+ if (xfer != 3) { ++ if ((xfer = i2c_master_send(client, wel, 3)) != 3) { + dev_err(&client->dev, "%s: wel - %d\n", __FUNCTION__, xfer); + return -EIO; + } + -+ xfer = i2c_master_send(client, rwel, 3); -+ if (xfer != 3) { ++ if ((xfer = i2c_master_send(client, rwel, 3)) != 3) { + dev_err(&client->dev, "%s: rwel - %d\n", __FUNCTION__, xfer); + return -EIO; + } @@ -1927,8 +3237,7 @@ + }; + + /* disable further writes */ -+ xfer = i2c_master_send(client, diswe, 3); -+ if (xfer != 3) { ++ if ((xfer = i2c_master_send(client, diswe, 3)) != 3) { + dev_err(&client->dev, "%s: diswe - %d\n", __FUNCTION__, xfer); + return -EIO; + } @@ -1941,13 +3250,11 @@ + int err; + struct rtc_time tm; + -+ tm.tm_hour = 0; -+ tm.tm_min = 0; -+ tm.tm_sec = 0; ++ tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + + if ((err = x1205_set_datetime(client, &tm, 0, X1205_CCR_BASE)) < 0) + dev_err(&client->dev, -+ "unable to restart the clock\n"); ++ "unable to restart the oscillator\n"); + + return err; +} @@ -2020,10 +3327,7 @@ + +struct x1205_limit +{ -+ unsigned char reg; -+ unsigned char mask; -+ unsigned char min; -+ unsigned char max; ++ unsigned char reg, mask, min, max; +}; + +static int x1205_validate_client(struct i2c_client *client) @@ -2067,11 +3371,10 @@ + { client->addr, I2C_M_RD, 1, &buf }, + }; + -+ xfer = i2c_transfer(client->adapter, msgs, 2); -+ if (xfer != 2) { ++ if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { + dev_err(&client->adapter->dev, + "%s: could not read register %x\n", -+ __FUNCTION__, addr[1]); ++ __FUNCTION__, probe_zero_pattern[i]); + + return -EIO; + } @@ -2079,7 +3382,7 @@ + if ((buf & probe_zero_pattern[i+1]) != 0) { + dev_err(&client->adapter->dev, + "%s: register=%02x, zero pattern=%d, value=%x\n", -+ __FUNCTION__, addr[1], i, buf); ++ __FUNCTION__, probe_zero_pattern[i], i, buf); + + return -ENODEV; + } @@ -2096,12 +3399,10 @@ + { client->addr, I2C_M_RD, 1, ® }, + }; + -+ xfer = i2c_transfer(client->adapter, msgs, 2); -+ -+ if (xfer != 2) { ++ if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { + dev_err(&client->adapter->dev, + "%s: could not read register %x\n", -+ __FUNCTION__, addr[1]); ++ __FUNCTION__, probe_limits_pattern[i].reg); + + return -EIO; + } @@ -2112,7 +3413,8 @@ + value < probe_limits_pattern[i].min) { + dev_dbg(&client->adapter->dev, + "%s: register=%x, lim pattern=%d, value=%d\n", -+ __FUNCTION__, addr[1], i, value); ++ __FUNCTION__, probe_limits_pattern[i].reg, ++ i, value); + + return -ENODEV; + } @@ -2121,87 +3423,51 @@ + return 0; +} + -+static int x1205_rtc_read_alarm(struct device *dev, -+ struct rtc_wkalrm *alrm) ++static int x1205_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) +{ + return x1205_get_datetime(to_i2c_client(dev), + &alrm->time, X1205_ALM0_BASE); +} + -+static int x1205_rtc_set_alarm(struct device *dev, -+ struct rtc_wkalrm *alrm) ++static int x1205_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) +{ + return x1205_set_datetime(to_i2c_client(dev), + &alrm->time, 1, X1205_ALM0_BASE); +} + -+static int x1205_rtc_read_time(struct device *dev, -+ struct rtc_time *tm) ++static int x1205_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return x1205_get_datetime(to_i2c_client(dev), + tm, X1205_CCR_BASE); +} + -+static int x1205_rtc_set_time(struct device *dev, -+ struct rtc_time *tm) ++static int x1205_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + return x1205_set_datetime(to_i2c_client(dev), + tm, 1, X1205_CCR_BASE); +} + -+static int x1205_rtc_set_mmss(struct device *dev, unsigned long secs) -+{ -+ int err; -+ -+ struct rtc_time new_tm, old_tm; -+ -+ if ((err = x1205_rtc_read_time(dev, &old_tm) == 0)) -+ return err; -+ -+ /* FIXME xtime.tv_nsec = old_tm.tm_sec * 10000000; */ -+ new_tm.tm_sec = secs % 60; -+ secs /= 60; -+ new_tm.tm_min = secs % 60; -+ secs /= 60; -+ new_tm.tm_hour = secs % 24; -+ -+ /* -+ * avoid writing when we're going to change the day -+ * of the month. We will retry in the next minute. -+ * This basically means that if the RTC must not drift -+ * by more than 1 minute in 11 minutes. -+ */ -+ if ((old_tm.tm_hour == 23 && old_tm.tm_min == 59) || -+ (new_tm.tm_hour == 23 && new_tm.tm_min == 59)) -+ return 1; -+ -+ return x1205_rtc_set_time(dev, &new_tm); -+} -+ +static int x1205_rtc_proc(struct device *dev, struct seq_file *seq) +{ + int err, dtrim, atrim; + + seq_printf(seq, "24hr\t\t: yes\n"); + -+ err = x1205_get_dtrim(to_i2c_client(dev), &dtrim); -+ if (err == 0) ++ if ((err = x1205_get_dtrim(to_i2c_client(dev), &dtrim)) == 0) + seq_printf(seq, "digital_trim\t: %d ppm\n", dtrim); + -+ err = x1205_get_atrim(to_i2c_client(dev), &atrim); -+ if (err == 0) ++ if ((err = x1205_get_atrim(to_i2c_client(dev), &atrim)) == 0) + seq_printf(seq, "analog_trim\t: %d.%02d pF\n", + atrim / 1000, atrim % 1000); + return 0; +} + +static struct rtc_class_ops x1205_rtc_ops = { -+ .proc = x1205_rtc_proc, -+ .read_time = x1205_rtc_read_time, -+ .set_time = x1205_rtc_set_time, -+ .read_alarm = x1205_rtc_read_alarm, -+ .set_alarm = x1205_rtc_set_alarm, -+ .set_mmss = x1205_rtc_set_mmss, ++ .proc = x1205_rtc_proc, ++ .read_time = x1205_rtc_read_time, ++ .set_time = x1205_rtc_set_time, ++ .read_alarm = x1205_rtc_read_alarm, ++ .set_alarm = x1205_rtc_set_alarm, +}; + +static ssize_t x1205_sysfs_show_atrim(struct device *dev, @@ -2209,10 +3475,10 @@ +{ + int atrim; + -+ if (x1205_get_atrim(to_i2c_client(dev), &atrim) == 0) { -+ return sprintf(buf, "%d.%02d pF\n", -+ atrim / 1000, atrim % 1000); } -+ return 0; ++ if (x1205_get_atrim(to_i2c_client(dev), &atrim) == 0) ++ return sprintf(buf, "%d.%02d pF\n", ++ atrim / 1000, atrim % 1000); ++ return 0; +} +static DEVICE_ATTR(atrim, S_IRUGO, x1205_sysfs_show_atrim, NULL); + @@ -2221,18 +3487,16 @@ +{ + int dtrim; + -+ if (x1205_get_dtrim(to_i2c_client(dev), &dtrim) == 0) { -+ return sprintf(buf, "%d ppm\n", dtrim); -+ } -+ return 0; ++ if (x1205_get_dtrim(to_i2c_client(dev), &dtrim) == 0) ++ return sprintf(buf, "%d ppm\n", dtrim); ++ ++ return 0; +} +static DEVICE_ATTR(dtrim, S_IRUGO, x1205_sysfs_show_dtrim, NULL); + -+ +static int x1205_attach(struct i2c_adapter *adapter) +{ + dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); -+ + return i2c_probe(adapter, &addr_data, x1205_probe); +} + @@ -2345,7 +3609,7 @@ +} + +MODULE_AUTHOR( -+ "Karen Spearel <kas11@tampabay.rr.com>, " ++ "Karen Spearel <kas111 at gmail dot com>, " + "Alessandro Zummo <a.zummo@towertech.it>"); +MODULE_DESCRIPTION("Xicor/Intersil X1205 RTC driver"); +MODULE_LICENSE("GPL"); @@ -2354,7 +3618,7 @@ +module_init(x1205_init); +module_exit(x1205_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-test.c 2006-02-06 23:58:32.000000000 +0100 ++++ linux-rtc/drivers/rtc/rtc-test.c 2006-02-21 00:36:43.000000000 +0100 @@ -0,0 +1,206 @@ +/* + * An RTC test device/driver @@ -2563,8 +3827,8 @@ +module_init(test_init); +module_exit(test_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-ds1672.c 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,234 @@ ++++ linux-rtc/drivers/rtc/rtc-ds1672.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,233 @@ +/* + * An rtc/i2c driver for the Dallas DS1672 + * Copyright 2005 Alessandro Zummo @@ -2689,15 +3953,14 @@ +} + +static struct rtc_class_ops ds1672_rtc_ops = { -+ .read_time = ds1672_rtc_read_time, -+ .set_time = ds1672_rtc_set_time, -+ .set_mmss = ds1672_rtc_set_mmss, ++ .read_time = ds1672_rtc_read_time, ++ .set_time = ds1672_rtc_set_time, ++ .set_mmss = ds1672_rtc_set_mmss, +}; + +static int ds1672_attach(struct i2c_adapter *adapter) +{ + dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); -+ + return i2c_probe(adapter, &addr_data, ds1672_probe); +} + @@ -2800,8 +4063,8 @@ +module_init(ds1672_init); +module_exit(ds1672_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-pcf8563.c 2006-02-06 23:58:32.000000000 +0100 -@@ -0,0 +1,384 @@ ++++ linux-rtc/drivers/rtc/rtc-pcf8563.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,355 @@ +/* + * An I2C driver for the Philips PCF8563 RTC + * Copyright 2005-06 Tower Technologies @@ -2819,15 +4082,18 @@ + * (at your option) any later version. + */ + -+#include <linux/module.h> +#include <linux/i2c.h> +#include <linux/bcd.h> +#include <linux/rtc.h> + -+#define DRV_VERSION "0.4.0" ++#define DRV_VERSION "0.4.2" + -+/* Addresses to scan */ -+static unsigned short normal_i2c[] = { 0x51, I2C_CLIENT_END }; ++/* Addresses to scan: none ++ * This chip cannot be reliably autodetected. An empty eeprom ++ * located at 0x51 will pass the validation routine due to ++ * the way the registers are implemented. ++ */ ++static unsigned short normal_i2c[] = { I2C_CLIENT_END }; + +/* Module parameters */ +I2C_CLIENT_INSMOD; @@ -2874,11 +4140,10 @@ + */ +static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) +{ -+ unsigned char buf[13]; -+ unsigned char addr = PCF8563_REG_ST1; ++ unsigned char buf[13] = { PCF8563_REG_ST1 }; + + struct i2c_msg msgs[] = { -+ { client->addr, 0, 1, &addr }, /* setup read ptr */ ++ { client->addr, 0, 1, buf }, /* setup read ptr */ + { client->addr, I2C_M_RD, 13, buf }, /* read status + date */ + }; + @@ -2980,46 +4245,48 @@ + +static int pcf8563_validate_client(struct i2c_client *client) +{ -+ int i, xfer; ++ int i; + -+ static const struct pcf8563_limit probe_limits_pattern[] = { ++ static const struct pcf8563_limit pattern[] = { + /* register, mask, min, max */ + { PCF8563_REG_SC, 0x7F, 0, 59 }, + { PCF8563_REG_MN, 0x7F, 0, 59 }, + { PCF8563_REG_HR, 0x3F, 0, 23 }, + { PCF8563_REG_DM, 0x3F, 0, 31 }, + { PCF8563_REG_MO, 0x1F, 0, 12 }, -+ { PCF8563_REG_YR, 0xFF, 0, 99 }, + }; + + /* check limits (only registers with bcd values) */ -+ for (i = 0; i < ARRAY_SIZE(probe_limits_pattern); i++) { -+ unsigned char addr, buf, value; ++ for (i = 0; i < ARRAY_SIZE(pattern); i++) { ++ int xfer; ++ unsigned char value; ++ unsigned char buf = pattern[i].reg; + -+ addr = probe_limits_pattern[i].reg; -+ -+ struct i2c_msg msgs[2] = { -+ { client->addr, 0, 2, &addr }, ++ struct i2c_msg msgs[] = { ++ { client->addr, 0, 1, &buf }, + { client->addr, I2C_M_RD, 1, &buf }, + }; + -+ xfer = i2c_transfer(client->adapter, msgs, 2); ++ xfer = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); + -+ if (xfer != 2) { ++ if (xfer != ARRAY_SIZE(msgs)) { + dev_err(&client->adapter->dev, -+ "%s: could not read register %x\n", -+ __FUNCTION__, probe_limits_pattern[i].reg); ++ "%s: could not read register 0x%02X\n", ++ __FUNCTION__, pattern[i].reg); + + return -EIO; + } + -+ value = BCD2BIN(buf & probe_limits_pattern[i].mask); ++ value = BCD2BIN(buf & pattern[i].mask); + -+ if (value > probe_limits_pattern[i].max || -+ value < probe_limits_pattern[i].min) { ++ if (value > pattern[i].max || ++ value < pattern[i].min) { + dev_dbg(&client->adapter->dev, -+ "%s: register=%x, lim pattern=%d, value=%d\n", -+ __FUNCTION__, probe_limits_pattern[i].reg, i, value); ++ "%s: pattern=%d, reg=%x, mask=0x%02x, min=%d, " ++ "max=%d, value=%d, raw=0x%02X\n", ++ __FUNCTION__, i, pattern[i].reg, pattern[i].mask, ++ pattern[i].min, pattern[i].max, ++ value, buf); + + return -ENODEV; + } @@ -3028,47 +4295,16 @@ + return 0; +} + -+static int pcf8563_rtc_read_time(struct device *dev, -+ struct rtc_time *tm) ++static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + return pcf8563_get_datetime(to_i2c_client(dev), tm); +} + -+static int pcf8563_rtc_set_time(struct device *dev, -+ struct rtc_time *tm) ++static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + return pcf8563_set_datetime(to_i2c_client(dev), tm); +} + -+static int pcf8563_rtc_set_mmss(struct device *dev, unsigned long secs) -+{ -+ int err; -+ -+ struct rtc_time new_tm, old_tm; -+ -+ if ((err = pcf8563_rtc_read_time(dev, &old_tm) == 0)) -+ return err; -+ -+ /* FIXME xtime.tv_nsec = old_tm.tm_sec * 10000000; */ -+ new_tm.tm_sec = secs % 60; -+ secs /= 60; -+ new_tm.tm_min = secs % 60; -+ secs /= 60; -+ new_tm.tm_hour = secs % 24; -+ -+ /* -+ * avoid writing when we're going to change the day -+ * of the month. We will retry in the next minute. -+ * This basically means that if the RTC must not drift -+ * by more than 1 minute in 11 minutes. -+ */ -+ if ((old_tm.tm_hour == 23 && old_tm.tm_min == 59) || -+ (new_tm.tm_hour == 23 && new_tm.tm_min == 59)) -+ return 1; -+ -+ return pcf8563_rtc_set_time(dev, &new_tm); -+} -+ +static int pcf8563_rtc_proc(struct device *dev, struct seq_file *seq) +{ + seq_printf(seq, "24hr\t\t: yes\n"); @@ -3076,10 +4312,9 @@ +} + +static struct rtc_class_ops pcf8563_rtc_ops = { -+ .proc = pcf8563_rtc_proc, -+ .read_time = pcf8563_rtc_read_time, -+ .set_time = pcf8563_rtc_set_time, -+ .set_mmss = pcf8563_rtc_set_mmss, ++ .proc = pcf8563_rtc_proc, ++ .read_time = pcf8563_rtc_read_time, ++ .set_time = pcf8563_rtc_set_time, +}; + +static int pcf8563_attach(struct i2c_adapter *adapter) @@ -3185,4 +4420,301 @@ + +module_init(pcf8563_init); +module_exit(pcf8563_exit); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-rtc/drivers/rtc/rtc-rs5c372.c 2006-02-21 00:36:43.000000000 +0100 +@@ -0,0 +1,295 @@ ++/* ++ * An I2C driver for the Ricoh RS5C372 RTC ++ * ++ * Copyright (C) 2005 Pavel Mironchik pmironchik@optifacio.net ++ * Copyright (C) 2006 Tower Technologies ++ * ++ * 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/i2c.h> ++#include <linux/rtc.h> ++#include <linux/bcd.h> ++ ++#define DRV_VERSION "0.2" ++ ++/* Addresses to scan */ ++static unsigned short normal_i2c[] = { /* 0x32,*/ I2C_CLIENT_END }; ++ ++/* Insmod parameters */ ++I2C_CLIENT_INSMOD; ++ ++#define RS5C372_REG_SECS 0 ++#define RS5C372_REG_MINS 1 ++#define RS5C372_REG_HOURS 2 ++#define RS5C372_REG_WDAY 3 ++#define RS5C372_REG_DAY 4 ++#define RS5C372_REG_MONTH 5 ++#define RS5C372_REG_YEAR 6 ++#define RS5C372_REG_TRIM 7 ++ ++#define RS5C372_TRIM_XSL 0x80 ++#define RS5C372_TRIM_MASK 0x7F ++ ++#define RS5C372_REG_BASE 0 ++ ++static int rs5c372_attach(struct i2c_adapter *adapter); ++static int rs5c372_detach(struct i2c_client *client); ++static int rs5c372_probe(struct i2c_adapter *adapter, int address, int kind); ++ ++static struct i2c_driver rs5c372_driver = { ++ .driver = { ++ .name = "rs5c372", ++ }, ++ .attach_adapter = &rs5c372_attach, ++ .detach_client = &rs5c372_detach, ++}; ++ ++static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm) ++{ ++ unsigned char buf[7] = { RS5C372_REG_BASE }; ++ ++ /* this implements the 1st reading method, according ++ * to the datasheet. buf[0] is initialized with ++ * address ptr and transmission format register. ++ */ ++ struct i2c_msg msgs[] = { ++ { client->addr, 0, 1, buf }, ++ { client->addr, I2C_M_RD, 7, buf }, ++ }; ++ ++ if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { ++ dev_err(&client->dev, "%s: read error\n", __FUNCTION__); ++ return -EIO; ++ } ++ ++ tm->tm_sec = BCD2BIN(buf[RS5C372_REG_SECS] & 0x7f); ++ tm->tm_min = BCD2BIN(buf[RS5C372_REG_MINS] & 0x7f); ++ tm->tm_hour = BCD2BIN(buf[RS5C372_REG_HOURS] & 0x3f); ++ tm->tm_wday = BCD2BIN(buf[RS5C372_REG_WDAY] & 0x07); ++ tm->tm_mday = BCD2BIN(buf[RS5C372_REG_DAY] & 0x3f); ++ ++ /* tm->tm_mon is zero-based */ ++ tm->tm_mon = BCD2BIN(buf[RS5C372_REG_MONTH] & 0x1f) - 1; ++ ++ /* year is 1900 + tm->tm_year */ ++ tm->tm_year = BCD2BIN(buf[RS5C372_REG_YEAR]) + 100; ++ ++ dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " ++ "mday=%d, mon=%d, year=%d, wday=%d\n", ++ __FUNCTION__, ++ tm->tm_sec, tm->tm_min, tm->tm_hour, ++ tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); ++ ++ return 0; ++} ++ ++static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm) ++{ ++ unsigned char buf[8] = { RS5C372_REG_BASE }; ++ ++ dev_dbg(&client->dev, ++ "%s: secs=%d, mins=%d, hours=%d ", ++ "mday=%d, mon=%d, year=%d, wday=%d\n", ++ __FUNCTION__, tm->tm_sec, tm->tm_min, tm->tm_hour, ++ tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); ++ ++ buf[1] = BIN2BCD(tm->tm_sec); ++ buf[2] = BIN2BCD(tm->tm_min); ++ buf[3] = BIN2BCD(tm->tm_hour); ++ buf[4] = BIN2BCD(tm->tm_wday); ++ buf[5] = BIN2BCD(tm->tm_mday); ++ buf[6] = BIN2BCD(tm->tm_mon + 1); ++ buf[7] = BIN2BCD(tm->tm_year - 100); ++ ++ if ((i2c_master_send(client, buf, 8)) != 8) { ++ dev_err(&client->dev, "%s: write error\n", __FUNCTION__); ++ return -EIO; ++ } ++ ++ return 0; ++} ++ ++static int rs5c372_get_trim(struct i2c_client *client, int *osc, int *trim) ++{ ++ unsigned char buf = RS5C372_REG_TRIM; ++ ++ struct i2c_msg msgs[] = { ++ { client->addr, 0, 1, &buf }, ++ { client->addr, I2C_M_RD, 1, &buf }, ++ }; ++ ++ if ((i2c_transfer(client->adapter, msgs, 2)) != 2) { ++ dev_err(&client->dev, "%s: read error\n", __FUNCTION__); ++ return -EIO; ++ } ++ ++ dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, trim); ++ ++ if (osc) ++ *osc = (buf & RS5C372_TRIM_XSL) ? 32000 : 32768; ++ ++ if (trim) ++ *trim = buf & RS5C372_TRIM_MASK; ++ ++ return 0; ++} ++ ++static int rs5c372_rtc_read_time(struct device *dev, struct rtc_time *tm) ++{ ++ return rs5c372_get_datetime(to_i2c_client(dev), tm); ++} ++ ++static int rs5c372_rtc_set_time(struct device *dev, struct rtc_time *tm) ++{ ++ return rs5c372_set_datetime(to_i2c_client(dev), tm); ++} ++ ++static int rs5c372_rtc_proc(struct device *dev, struct seq_file *seq) ++{ ++ int err, osc, trim; ++ ++ seq_printf(seq, "24hr\t\t: yes\n"); ++ ++ if ((err = rs5c372_get_trim(to_i2c_client(dev), &osc, &trim)) == 0) { ++ seq_printf(seq, "%d.%03d KHz\n", osc / 1000, osc % 1000); ++ seq_printf(seq, "trim\t: %d\n", trim); ++ } ++ ++ return 0; ++} ++ ++static struct rtc_class_ops rs5c372_rtc_ops = { ++ .proc = rs5c372_rtc_proc, ++ .read_time = rs5c372_rtc_read_time, ++ .set_time = rs5c372_rtc_set_time, ++}; ++ ++static ssize_t rs5c372_sysfs_show_trim(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ int trim; ++ ++ if (rs5c372_get_trim(to_i2c_client(dev), NULL, &trim) == 0) ++ return sprintf(buf, "0x%2x\n", trim); ++ ++ return 0; ++} ++static DEVICE_ATTR(trim, S_IRUGO, rs5c372_sysfs_show_trim, NULL); ++ ++static ssize_t rs5c372_sysfs_show_osc(struct device *dev, ++ struct device_attribute *attr, char *buf) ++{ ++ int osc; ++ ++ if (rs5c372_get_trim(to_i2c_client(dev), &osc, NULL) == 0) ++ return sprintf(buf, "%d.%03d KHz\n", osc / 1000, osc % 1000); ++ ++ return 0; ++} ++static DEVICE_ATTR(osc, S_IRUGO, rs5c372_sysfs_show_osc, NULL); ++ ++static int rs5c372_attach(struct i2c_adapter *adapter) ++{ ++ dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); ++ return i2c_probe(adapter, &addr_data, rs5c372_probe); ++} ++ ++static int rs5c372_probe(struct i2c_adapter *adapter, int address, int kind) ++{ ++ int err = 0; ++ struct i2c_client *client; ++ struct rtc_device *rtc; ++ ++ dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { ++ err = -ENODEV; ++ goto exit; ++ } ++ ++ if (!(client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL))) { ++ err = -ENOMEM; ++ goto exit; ++ } ++ ++ /* I2C client */ ++ client->addr = address; ++ client->driver = &rs5c372_driver; ++ client->adapter = adapter; ++ ++ strlcpy(client->name, rs5c372_driver.driver.name, I2C_NAME_SIZE); ++ ++ /* Inform the i2c layer */ ++ if ((err = i2c_attach_client(client))) ++ goto exit_kfree; ++ ++ dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); ++ ++ rtc = rtc_device_register(rs5c372_driver.driver.name, &client->dev, ++ &rs5c372_rtc_ops, THIS_MODULE); ++ ++ if (IS_ERR(rtc)) { ++ err = PTR_ERR(rtc); ++ dev_err(&client->dev, ++ "unable to register the class device\n"); ++ goto exit_detach; ++ } ++ ++ i2c_set_clientdata(client, rtc); ++ ++ device_create_file(&client->dev, &dev_attr_trim); ++ device_create_file(&client->dev, &dev_attr_osc); ++ ++ return 0; ++ ++exit_detach: ++ i2c_detach_client(client); ++ ++exit_kfree: ++ kfree(client); ++ ++exit: ++ return err; ++} ++ ++static int rs5c372_detach(struct i2c_client *client) ++{ ++ int err; ++ struct rtc_device *rtc = i2c_get_clientdata(client); ++ ++ dev_dbg(&client->dev, "%s\n", __FUNCTION__); ++ ++ if (rtc) ++ rtc_device_unregister(rtc); ++ ++ if ((err = i2c_detach_client(client))) ++ return err; ++ ++ kfree(client); ++ ++ return 0; ++} ++ ++static __init int rs5c372_init(void) ++{ ++ return i2c_add_driver(&rs5c372_driver); ++} ++ ++static __exit void rs5c372_exit(void) ++{ ++ i2c_del_driver(&rs5c372_driver); ++} ++ ++module_init(rs5c372_init); ++module_exit(rs5c372_exit); ++ ++MODULE_AUTHOR( ++ "Pavel Mironchik <pmironchik@optifacio.net>, " ++ "Alessandro Zummo <a.zummo@towertech.it>"); ++MODULE_DESCRIPTION("Ricoh RS5C372 RTC driver"); ++MODULE_LICENSE("GPL"); ++MODULE_VERSION(DRV_VERSION); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/50-hwmon-ad741x.patch b/packages/linux/ixp4xx-kernel/2.6.16/50-hwmon-ad741x.patch new file mode 100644 index 0000000000..9d0a35b3fa --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/50-hwmon-ad741x.patch @@ -0,0 +1,378 @@ +--- + drivers/hwmon/Kconfig | 10 + + drivers/hwmon/Makefile | 1 + drivers/hwmon/ad741x.c | 340 +++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 351 insertions(+) + +--- linux-ixp4xx.orig/drivers/hwmon/Makefile 2006-02-19 17:45:45.000000000 +0100 ++++ linux-ixp4xx/drivers/hwmon/Makefile 2006-02-19 17:46:12.000000000 +0100 +@@ -44,6 +44,7 @@ obj-$(CONFIG_SENSORS_VIA686A) += via686a + obj-$(CONFIG_SENSORS_VT8231) += vt8231.o + obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o + obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o ++obj-$(CONFIG_SENSORS_AD741X) += ad741x.o + + ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y) + EXTRA_CFLAGS += -DDEBUG +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/hwmon/ad741x.c 2006-02-19 17:45:59.000000000 +0100 +@@ -0,0 +1,340 @@ ++/* ++ * An hwmon driver for the Analog Devices AD7417/18 ++ * Copyright 2006 Tower Technologies ++ * ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * ++ * Based on lm75.c ++ * Copyright 1998-99 Frodo Looijaard <frodol@dds.nl> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#include <linux/module.h> ++#include <linux/jiffies.h> ++#include <linux/i2c.h> ++#include <linux/hwmon.h> ++#include <linux/err.h> ++#include <linux/mutex.h> ++ ++#define DRV_VERSION "0.1" ++ ++/* straight from the datasheet */ ++#define AD741X_TEMP_MIN (-55000) ++#define AD741X_TEMP_MAX 125000 ++ ++/* Addresses to scan */ ++static unsigned short normal_i2c[] = { 0x28, 0x29, 0x2A, 0x2B, 0x2C, ++ 0x2D, 0x2E, 0x2F, I2C_CLIENT_END }; ++ ++/* Insmod parameters */ ++I2C_CLIENT_INSMOD; ++ ++/* AD741X registers */ ++#define AD741X_REG_TEMP 0x00 ++#define AD741X_REG_CONF 0x01 ++#define AD741X_REG_TEMP_HYST 0x02 ++#define AD741X_REG_TEMP_OS 0x03 ++#define AD741X_REG_ADC 0x04 ++#define AD741X_REG_CONF2 0x05 ++ ++#define AD741X_REG_ADC_CH(x) (x << 5) ++ ++#define AD741X_CH_TEMP AD741X_REG_ADC_CH(0) ++#define AD741X_CH_AIN1 AD741X_REG_ADC_CH(1) ++#define AD741X_CH_AIN2 AD741X_REG_ADC_CH(2) ++#define AD741X_CH_AIN3 AD741X_REG_ADC_CH(3) ++#define AD741X_CH_AIN4 AD741X_REG_ADC_CH(4) ++ ++struct ad741x_data { ++ struct i2c_client client; ++ struct class_device *class_dev; ++ struct mutex lock; ++ char valid; /* !=0 if following fields are valid */ ++ unsigned long last_updated; /* In jiffies */ ++ u16 temp_input; /* Register values */ ++ u16 temp_max; ++ u16 temp_hyst; ++ u16 in1; ++ u16 in2; ++ u16 in3; ++ u16 in4; ++}; ++ ++static int ad741x_attach_adapter(struct i2c_adapter *adapter); ++static int ad741x_detect(struct i2c_adapter *adapter, int address, int kind); ++static int ad741x_detach_client(struct i2c_client *client); ++ ++static struct i2c_driver ad741x_driver = { ++ .driver = { ++ .name = "ad741x", ++ }, ++ .attach_adapter = ad741x_attach_adapter, ++ .detach_client = ad741x_detach_client, ++}; ++ ++/* TEMP: 0.001C/bit (-55C to +125C) ++ * REG: (0.5C/bit, two's complement) << 7 ++ */ ++static inline u16 AD741X_TEMP_TO_REG(int temp) ++{ ++ int ntemp = SENSORS_LIMIT(temp, AD741X_TEMP_MIN, AD741X_TEMP_MAX); ++ ntemp += (ntemp < 0 ? -250 : 250); ++ return (u16)((ntemp / 500) << 7); ++} ++ ++static inline int AD741X_TEMP_FROM_REG(u16 reg) ++{ ++ /* use integer division instead of equivalent right shift to ++ * guarantee arithmetic shift and preserve the sign ++ */ ++ return ((s16)reg / 128) * 500; ++} ++ ++/* All registers are word-sized, except for the configuration registers. ++ * AD741X uses a high-byte first convention, which is exactly opposite to ++ * the usual practice. ++ */ ++static int ad741x_read(struct i2c_client *client, u8 reg) ++{ ++ if (reg == AD741X_REG_CONF || reg == AD741X_REG_CONF2) ++ return i2c_smbus_read_byte_data(client, reg); ++ else ++ return swab16(i2c_smbus_read_word_data(client, reg)); ++} ++ ++static int ad741x_write(struct i2c_client *client, u8 reg, u16 value) ++{ ++ if (reg == AD741X_REG_CONF || reg == AD741X_REG_CONF2) ++ return i2c_smbus_write_byte_data(client, reg, value); ++ else ++ return i2c_smbus_write_word_data(client, reg, swab16(value)); ++} ++ ++static void ad741x_init_client(struct i2c_client *client) ++{ ++ /* Enable if in shutdown mode */ ++ int reg = ad741x_read(client, AD741X_REG_CONF); ++ if (reg >= 0 && (reg & 0x01)) ++ ad741x_write(client, AD741X_REG_CONF, reg & 0xfe); ++} ++ ++static struct ad741x_data *ad741x_update_device(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct ad741x_data *data = i2c_get_clientdata(client); ++ ++ mutex_lock(&data->lock); ++ ++ if (time_after(jiffies, data->last_updated + HZ + HZ / 2) ++ || !data->valid) { ++ u8 cfg; ++ dev_dbg(&client->dev, "starting ad741x update\n"); ++ ++ data->temp_input = ad741x_read(client, AD741X_REG_TEMP); ++ data->temp_max = ad741x_read(client, AD741X_REG_TEMP_OS); ++ data->temp_hyst = ad741x_read(client, AD741X_REG_TEMP_HYST); ++ ++ /* read config register and clear channel bits */ ++ cfg = ad741x_read(client, AD741X_REG_CONF); ++ cfg &= 0x1F; ++ ++ ad741x_write(client, AD741X_REG_CONF, cfg | AD741X_CH_AIN1); ++ data->in1 = ad741x_read(client, AD741X_REG_ADC); ++ ++ ad741x_write(client, AD741X_REG_CONF, cfg | AD741X_CH_AIN2); ++ data->in2 = ad741x_read(client, AD741X_REG_ADC); ++ ++ ad741x_write(client, AD741X_REG_CONF, cfg | AD741X_CH_AIN3); ++ data->in3 = ad741x_read(client, AD741X_REG_ADC); ++ ++ ad741x_write(client, AD741X_REG_CONF, cfg | AD741X_CH_AIN4); ++ data->in4 = ad741x_read(client, AD741X_REG_ADC); ++ ++ /* restore old configuration value */ ++ ad741x_write(client, AD741X_REG_CONF, cfg); ++ ++ data->last_updated = jiffies; ++ data->valid = 1; ++ } ++ ++ mutex_unlock(&data->lock); ++ ++ return data; ++} ++ ++#define show(value) \ ++static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ ++{ \ ++ struct ad741x_data *data = ad741x_update_device(dev); \ ++ return sprintf(buf, "%d\n", AD741X_TEMP_FROM_REG(data->value)); \ ++} ++show(temp_max); ++show(temp_hyst); ++show(temp_input); ++ ++#define show_adc(value) \ ++static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ ++{ \ ++ struct ad741x_data *data = ad741x_update_device(dev); \ ++ return sprintf(buf, "%d\n", data->value >> 6); \ ++} ++ ++show_adc(in1); ++show_adc(in2); ++show_adc(in3); ++show_adc(in4); ++ ++#define set(value, reg) \ ++static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ ++{ \ ++ struct i2c_client *client = to_i2c_client(dev); \ ++ struct ad741x_data *data = i2c_get_clientdata(client); \ ++ int temp = simple_strtoul(buf, NULL, 10); \ ++ \ ++ mutex_lock(&data->lock); \ ++ data->value = AD741X_TEMP_TO_REG(temp); \ ++ ad741x_write(client, reg, data->value); \ ++ mutex_unlock(&data->lock); \ ++ return count; \ ++} ++set(temp_max, AD741X_REG_TEMP_OS); ++set(temp_hyst, AD741X_REG_TEMP_HYST); ++ ++static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); ++static DEVICE_ATTR(temp1_max_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); ++static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL); ++ ++static DEVICE_ATTR(in1, S_IRUGO, show_in1, NULL); ++static DEVICE_ATTR(in2, S_IRUGO, show_in2, NULL); ++static DEVICE_ATTR(in3, S_IRUGO, show_in3, NULL); ++static DEVICE_ATTR(in4, S_IRUGO, show_in4, NULL); ++ ++static int ad741x_attach_adapter(struct i2c_adapter *adapter) ++{ ++ if (!(adapter->class & I2C_CLASS_HWMON)) ++ return 0; ++ return i2c_probe(adapter, &addr_data, ad741x_detect); ++} ++ ++static int ad741x_detect(struct i2c_adapter *adapter, int address, int kind) ++{ ++ struct i2c_client *client; ++ struct ad741x_data *data; ++ int err = 0; ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | ++ I2C_FUNC_SMBUS_WORD_DATA)) ++ goto exit; ++ ++ if (!(data = kzalloc(sizeof(struct ad741x_data), GFP_KERNEL))) { ++ err = -ENOMEM; ++ goto exit; ++ } ++ ++ client = &data->client; ++ client->addr = address; ++ client->adapter = adapter; ++ client->driver = &ad741x_driver; ++ client->flags = 0; ++ ++ i2c_set_clientdata(client, data); ++ ++ mutex_init(&data->lock); ++ ++ /* AD7418 has a curious behaviour on registers 6 and 7. They ++ * both always read 0xC071 and are not documented on the datasheet. ++ * We use them to detect the chip. ++ */ ++ if (kind < 0) { ++ int reg; ++ ++ reg = i2c_smbus_read_word_data(client, 0x06); ++ if (reg != 0xC071) { ++ dev_dbg(&adapter->dev, "failed detection at %d: %x\n", 6, reg); ++ err = -ENODEV; ++ goto exit_free; ++ } ++ ++ reg = i2c_smbus_read_word_data(client, 0x07); ++ if (reg != 0xC071) { ++ dev_dbg(&adapter->dev, "failed detection at %d: %x\n", 7, reg); ++ err = -ENODEV; ++ goto exit_free; ++ } ++ ++ reg = i2c_smbus_read_byte_data(client, AD741X_REG_CONF2); ++ ++ /* bits 0-5 must be at 0 */ ++ if (reg & 0x3F) { ++ dev_dbg(&adapter->dev, "failed detection at %d: %x\n", ++ AD741X_REG_CONF2, reg); ++ err = -ENODEV; ++ goto exit_free; ++ } ++ } ++ ++ strlcpy(client->name, ad741x_driver.driver.name, I2C_NAME_SIZE); ++ ++ if ((err = i2c_attach_client(client))) ++ goto exit_free; ++ ++ dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); ++ ++ /* Initialize the AD741X chip */ ++ ad741x_init_client(client); ++ ++ /* Register sysfs hooks */ ++ data->class_dev = hwmon_device_register(&client->dev); ++ if (IS_ERR(data->class_dev)) { ++ err = PTR_ERR(data->class_dev); ++ goto exit_detach; ++ } ++ ++ device_create_file(&client->dev, &dev_attr_temp1_max); ++ device_create_file(&client->dev, &dev_attr_temp1_max_hyst); ++ device_create_file(&client->dev, &dev_attr_temp1_input); ++ device_create_file(&client->dev, &dev_attr_in1); ++ device_create_file(&client->dev, &dev_attr_in2); ++ device_create_file(&client->dev, &dev_attr_in3); ++ device_create_file(&client->dev, &dev_attr_in4); ++ ++ return 0; ++ ++exit_detach: ++ i2c_detach_client(client); ++exit_free: ++ kfree(data); ++exit: ++ return err; ++} ++ ++static int ad741x_detach_client(struct i2c_client *client) ++{ ++ struct ad741x_data *data = i2c_get_clientdata(client); ++ hwmon_device_unregister(data->class_dev); ++ i2c_detach_client(client); ++ kfree(data); ++ return 0; ++} ++ ++static int __init ad741x_init(void) ++{ ++ return i2c_add_driver(&ad741x_driver); ++} ++ ++static void __exit ad741x_exit(void) ++{ ++ i2c_del_driver(&ad741x_driver); ++} ++ ++MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); ++MODULE_DESCRIPTION("AD741X driver"); ++MODULE_LICENSE("GPL"); ++MODULE_VERSION(DRV_VERSION); ++ ++module_init(ad741x_init); ++module_exit(ad741x_exit); +--- linux-ixp4xx.orig/drivers/hwmon/Kconfig 2006-02-19 17:45:45.000000000 +0100 ++++ linux-ixp4xx/drivers/hwmon/Kconfig 2006-02-19 17:47:07.000000000 +0100 +@@ -433,6 +433,16 @@ config SENSORS_W83627EHF + This driver can also be built as a module. If so, the module + will be called w83627ehf. + ++config SENSORS_AD741X ++ tristate "Analog Devices AD7417/18" ++ depends on HWMON && I2C && EXPERIMENTAL ++ help ++ If you say yes here you get support for the Analog Devices AD7417 ++ and AD7418 chips. ++ ++ This driver can also be built as a module. If so, the module ++ will be called ad741x. ++ + config SENSORS_HDAPS + tristate "IBM Hard Drive Active Protection System (hdaps)" + depends on HWMON && INPUT && X86 diff --git a/packages/linux/ixp4xx-kernel/2.6.16/50-i2c-bus-ixp4xx-hwmon.patch b/packages/linux/ixp4xx-kernel/2.6.16/50-i2c-bus-ixp4xx-hwmon.patch new file mode 100644 index 0000000000..d7fb8e55dc --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/50-i2c-bus-ixp4xx-hwmon.patch @@ -0,0 +1,14 @@ +--- + drivers/i2c/busses/i2c-ixp4xx.c | 1 + + 1 file changed, 1 insertion(+) + +--- linux-ixp4xx.orig/drivers/i2c/busses/i2c-ixp4xx.c 2006-02-11 15:18:29.000000000 +0100 ++++ linux-ixp4xx/drivers/i2c/busses/i2c-ixp4xx.c 2006-02-18 16:20:12.000000000 +0100 +@@ -126,6 +126,7 @@ static int ixp4xx_i2c_probe(struct platf + drv_data->algo_data.timeout = 100; + + drv_data->adapter.id = I2C_HW_B_IXP4XX; ++ drv_data->adapter.class = I2C_CLASS_HWMON; + strlcpy(drv_data->adapter.name, plat_dev->dev.driver->name, + I2C_NAME_SIZE); + drv_data->adapter.algo_data = &drv_data->algo_data; diff --git a/packages/linux/ixp4xx-kernel/2.6.16/61-ixp4xx-beeper-irq.patch b/packages/linux/ixp4xx-kernel/2.6.16/61-ixp4xx-beeper-irq.patch deleted file mode 100644 index 4a97bf57a5..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/61-ixp4xx-beeper-irq.patch +++ /dev/null @@ -1,13 +0,0 @@ - drivers/input/misc/ixp4xx-beeper.c | 1 + - 1 file changed, 1 insertion(+) - ---- linux-nslu2.orig/drivers/input/misc/ixp4xx-beeper.c 2006-02-06 20:37:19.000000000 +0100 -+++ linux-nslu2/drivers/input/misc/ixp4xx-beeper.c 2006-02-06 22:04:59.000000000 +0100 -@@ -19,6 +19,7 @@ - #include <linux/input.h> - #include <linux/delay.h> - #include <linux/platform_device.h> -+#include <linux/interrupt.h> - #include <asm/hardware.h> - - MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/61-nslu2-beeper.patch b/packages/linux/ixp4xx-kernel/2.6.16/61-nslu2-beeper.patch deleted file mode 100644 index cc2e4ef69f..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/61-nslu2-beeper.patch +++ /dev/null @@ -1,30 +0,0 @@ -NSLU2 beeper support. - -Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> - - arch/arm/mach-ixp4xx/nslu2-setup.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 20:37:01.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:21:17.000000000 +0100 -@@ -52,6 +52,12 @@ static struct platform_device nslu2_i2c_ - .num_resources = 0, - }; - -+static struct platform_device nslu2_beeper = { -+ .name = "ixp4xx-beeper", -+ .id = NSLU2_GPIO_BUZZ, -+ .num_resources = 0, -+}; -+ - static struct resource nslu2_uart_resources[] = { - { - .start = IXP4XX_UART1_BASE_PHYS, -@@ -99,6 +105,7 @@ static struct platform_device *nslu2_dev - &nslu2_i2c_controller, - &nslu2_flash, - &nslu2_uart, -+ &nslu2_beeper, - }; - - static void nslu2_power_off(void) diff --git a/packages/linux/ixp4xx-kernel/2.6.16/70-artop-latency.patch b/packages/linux/ixp4xx-kernel/2.6.16/70-artop-latency.patch new file mode 100644 index 0000000000..ad3ad11999 --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/70-artop-latency.patch @@ -0,0 +1,27 @@ +On some controllers the pci latency timer +default value does not allow burst mode. +This patch fixes the latency value if it +is <= 0x80. + +Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> + +--- + drivers/scsi/pata_artop.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- linux-ixp4xx.orig/drivers/scsi/pata_artop.c 2006-02-21 02:53:43.000000000 +0100 ++++ linux-ixp4xx/drivers/scsi/pata_artop.c 2006-02-21 02:54:01.000000000 +0100 +@@ -450,6 +450,13 @@ static int artop_init_one (struct pci_de + pci_read_config_byte(pdev, 0x49, ®); + pci_write_config_byte(pdev, 0x49, reg & ~ 0x30); + ++ /* PCI latency must be > 0x80 for burst mode, tweak it ++ * if required. ++ */ ++ pci_read_config_byte(pdev, PCI_LATENCY_TIMER, ®); ++ if (reg <= 0x80) ++ pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x90); ++ + /* Enable IRQ output and burst mode */ + pci_read_config_byte(pdev, 0x4a, ®); + pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/75-dsmg600.patch b/packages/linux/ixp4xx-kernel/2.6.16/75-dsmg600.patch new file mode 100644 index 0000000000..05d467d0be --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/75-dsmg600.patch @@ -0,0 +1,353 @@ +--- + arch/arm/mach-ixp4xx/Kconfig | 8 + + arch/arm/mach-ixp4xx/Makefile | 1 + arch/arm/mach-ixp4xx/dsmg600-pci.c | 74 +++++++++++++++++ + arch/arm/mach-ixp4xx/dsmg600-setup.c | 139 +++++++++++++++++++++++++++++++++ + arch/arm/tools/mach-types | 1 + include/asm-arm/arch-ixp4xx/dsmg600.h | 62 ++++++++++++++ + include/asm-arm/arch-ixp4xx/hardware.h | 1 + include/asm-arm/arch-ixp4xx/irqs.h | 10 ++ + 8 files changed, 296 insertions(+) + +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/Kconfig 2006-02-23 18:29:02.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/Kconfig 2006-02-23 18:29:11.000000000 +0100 +@@ -85,6 +85,14 @@ config MACH_NAS100D + NAS 100d device. For more information on this platform, + see http://www.nslu2-linux.org/wiki/NAS100d/HomePage + ++config MACH_DSMG600 ++ bool ++ prompt "D-Link DSM-G600" ++ help ++ Say 'Y' here if you want your kernel to support D-Link's ++ DSM-G600 device. For more information on this platform, ++ see http://www.nslu2-linux.org/ ++ + # + # Avila and IXDP share the same source for now. Will change in future + # +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/dsmg600-pci.c 2006-02-23 18:29:11.000000000 +0100 +@@ -0,0 +1,74 @@ ++/* ++ * DSM-G600 board-level PCI initialization ++ * ++ * Copyright (c) 2006 Tower Technologies ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * ++ * based on ixdp425-pci.c: ++ * Copyright (C) 2002 Intel Corporation. ++ * Copyright (C) 2003-2004 MontaVista Software, Inc. ++ * ++ * Maintainer: http://www.nslu2-linux.org/ ++ * ++ * 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/pci.h> ++#include <linux/init.h> ++ ++#include <asm/mach/pci.h> ++#include <asm/mach-types.h> ++ ++void __init dsmg600_pci_preinit(void) ++{ ++ set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW); ++ set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW); ++ set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW); ++ set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW); ++ set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW); ++ set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] = ++ { ++ { IRQ_DSMG600_PCI_INTE, -1, -1 }, ++ { IRQ_DSMG600_PCI_INTA, -1, -1 }, ++ { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD }, ++ { IRQ_DSMG600_PCI_INTF, -1, -1 }, ++ }; ++ ++ int irq = -1; ++ ++ if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV && ++ pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES) ++ irq = pci_irq_table[slot-1][pin-1]; ++ ++ return irq; ++} ++ ++struct hw_pci __initdata dsmg600_pci = { ++ .nr_controllers = 1, ++ .preinit = dsmg600_pci_preinit, ++ .swizzle = pci_std_swizzle, ++ .setup = ixp4xx_setup, ++ .scan = ixp4xx_scan_bus, ++ .map_irq = dsmg600_map_irq, ++}; ++ ++int __init dsmg600_pci_init(void) ++{ ++ if (machine_is_dsmg600()) ++ pci_common_init(&dsmg600_pci); ++ ++ return 0; ++} ++ ++subsys_initcall(dsmg600_pci_init); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/dsmg600-setup.c 2006-02-23 18:29:11.000000000 +0100 +@@ -0,0 +1,139 @@ ++/* ++ * DSM-G600 board-setup ++ * ++ * Copyright (c) 2006 Tower Technologies ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * ++ * based ixdp425-setup.c: ++ * Copyright (C) 2003-2004 MontaVista Software, Inc. ++ * ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * Maintainers: http://www.nslu2-linux.org/ ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/serial.h> ++#include <linux/serial_8250.h> ++ ++#include <asm/mach-types.h> ++#include <asm/mach/arch.h> ++#include <asm/mach/flash.h> ++ ++static struct flash_platform_data dsmg600_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource dsmg600_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device dsmg600_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev.platform_data = &dsmg600_flash_data, ++ .num_resources = 1, ++ .resource = &dsmg600_flash_resource, ++}; ++ ++static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = { ++ .sda_pin = DSMG600_SDA_PIN, ++ .scl_pin = DSMG600_SCL_PIN, ++}; ++ ++static struct platform_device dsmg600_i2c_controller = { ++ .name = "IXP4XX-I2C", ++ .id = 0, ++ .dev.platform_data = &dsmg600_i2c_gpio_pins, ++ .num_resources = 0, ++}; ++ ++static struct resource dsmg600_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port dsmg600_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { } ++}; ++ ++static struct platform_device dsmg600_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = dsmg600_uart_data, ++ .num_resources = 2, ++ .resource = dsmg600_uart_resources, ++}; ++ ++static struct platform_device *dsmg600_devices[] __initdata = { ++ &dsmg600_i2c_controller, ++ &dsmg600_flash, ++ &dsmg600_uart, ++}; ++ ++static void dsmg600_power_off(void) ++{ ++ /* enable the pwr cntl gpio */ ++// gpio_line_config(DSMG600_GPIO_PWROFF, IXP4XX_GPIO_OUT); ++ ++ /* poweroff */ ++// gpio_line_set(DSMG600_GPIO_PWROFF, IXP4XX_GPIO_HIGH); ++} ++ ++static void __init dsmg600_init(void) ++{ ++ /* The DSM-G600 has a 33MHz crystal on board - 1.01% different ++ * from the typical value. ++ */ ++ ++#ifndef FREQ ++ ixp4xx_set_board_tick_rate(66000000); ++#endif ++ ++ ixp4xx_sys_init(); ++ ++ dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ dsmg600_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ pm_power_off = dsmg600_power_off; ++ ++ platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); ++} ++ ++MACHINE_START(DSMG600, "D-Link DSM-G600") ++ /* Maintainer: www.nslu2-linux.org */ ++ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, ++ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, ++ .boot_params = 0x00000100, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .timer = &ixp4xx_timer, ++ .init_machine = dsmg600_init, ++MACHINE_END +--- linux-ixp4xx.orig/arch/arm/tools/mach-types 2006-02-23 18:29:02.000000000 +0100 ++++ linux-ixp4xx/arch/arm/tools/mach-types 2006-02-23 18:29:39.000000000 +0100 +@@ -969,3 +969,4 @@ mxc300_30ads MACH_MXC30030ADS MXC30030A + fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956 + dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957 + gesbc9312 MACH_GESBC9312 GESBC9312 958 ++dsmg600 MACH_DSMG600 DSMG600 964 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/dsmg600.h 2006-02-23 18:29:11.000000000 +0100 +@@ -0,0 +1,62 @@ ++/* ++ * DSM-G600 platform specific definitions ++ * ++ * Copyright (c) 2006 Tower Technologies ++ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * ++ * based on ixdp425.h: ++ * Copyright 2004 (c) MontaVista, Software, Inc. ++ * ++ * This file is licensed under the terms of the GNU General Public ++ * License version 2. This program is licensed "as is" without any ++ * warranty of any kind, whether express or implied. ++ */ ++ ++#ifndef __ASM_ARCH_HARDWARE_H__ ++#error "Do not include this directly, instead #include <asm/hardware.h>" ++#endif ++ ++#define DSMG600_SDA_PIN 5 ++#define DSMG600_SCL_PIN 4 ++ ++/* ++ * DSMG600 PCI IRQs ++ */ ++#define DSMG600_PCI_MAX_DEV 4 ++#define DSMG600_PCI_IRQ_LINES 3 ++ ++ ++/* PCI controller GPIO to IRQ pin mappings */ ++#define DSMG600_PCI_INTA_PIN 11 ++#define DSMG600_PCI_INTB_PIN 10 ++#define DSMG600_PCI_INTC_PIN 9 ++#define DSMG600_PCI_INTD_PIN 8 ++#define DSMG600_PCI_INTE_PIN 7 ++#define DSMG600_PCI_INTF_PIN 6 ++ ++/* GPIO */ ++ ++#define DSMG600_GPIO0 0 ++#define DSMG600_GPIO1 1 ++#define DSMG600_GPIO2 2 ++#define DSMG600_GPIO3 3 ++#define DSMG600_GPIO4 4 ++#define DSMG600_GPIO5 5 ++#define DSMG600_GPIO6 6 ++#define DSMG600_GPIO7 7 ++#define DSMG600_GPIO8 8 ++#define DSMG600_GPIO9 9 ++#define DSMG600_GPIO10 10 ++#define DSMG600_GPIO11 11 ++#define DSMG600_GPIO12 12 ++#define DSMG600_GPIO13 13 ++#define DSMG600_GPIO14 14 ++#define DSMG600_GPIO15 15 ++ ++#define DSMG600_GPIO_PWRBTN DSMG600_GPIO15 /* power */ ++#define DSMG600_GPIO_RSTBTN DSMG600_GPIO3 /* reset */ ++ ++#define DSMG600_IRQ_PWRBTN IRQ_IXP4XX_GPIO15 ++#define DSMG600_IRQ_RSTBTN IRQ_IXP4XX_GPIO3 ++ ++#define DSMG600_GPIO_PWROFF DSMG600_GPIO2 /* power off */ +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/Makefile 2006-02-23 18:29:02.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/Makefile 2006-02-23 18:29:11.000000000 +0100 +@@ -10,4 +10,5 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote- + obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o + obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o + obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o ++obj-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o dsmg600-setup.o + +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-23 18:29:02.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-23 18:29:11.000000000 +0100 +@@ -46,5 +46,6 @@ extern unsigned int processor_id; + #include "prpmc1100.h" + #include "nslu2.h" + #include "nas100d.h" ++#include "dsmg600.h" + + #endif /* _ASM_ARCH_HARDWARE_H */ +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-23 18:29:02.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-23 18:29:11.000000000 +0100 +@@ -109,4 +109,14 @@ + #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 + #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 + ++/* ++ * D-Link DSM-G600 board IRQs ++ */ ++#define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11 ++#define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10 ++#define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9 ++#define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8 ++#define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 ++#define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 ++ + #endif diff --git a/packages/linux/ixp4xx-kernel/2.6.16/80-nas100d-fix-i2c.patch b/packages/linux/ixp4xx-kernel/2.6.16/80-nas100d-fix-i2c.patch deleted file mode 100644 index 6610cc0872..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/80-nas100d-fix-i2c.patch +++ /dev/null @@ -1,16 +0,0 @@ - include/asm-arm/arch-ixp4xx/nas100d.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- linux-nslu2.orig/include/asm-arm/arch-ixp4xx/nas100d.h 2006-02-06 20:37:38.000000000 +0100 -+++ linux-nslu2/include/asm-arm/arch-ixp4xx/nas100d.h 2006-02-09 14:33:49.000000000 +0100 -@@ -19,8 +19,8 @@ - #error "Do not include this directly, instead #include <asm/hardware.h>" - #endif - --#define NAS100D_SDA_PIN 6 --#define NAS100D_SCL_PIN 5 -+#define NAS100D_SDA_PIN 5 -+#define NAS100D_SCL_PIN 6 - - /* - * NAS100D PCI IRQs diff --git a/packages/linux/ixp4xx-kernel/2.6.16/81-nslu2-power.patch b/packages/linux/ixp4xx-kernel/2.6.16/81-nslu2-power.patch deleted file mode 100644 index eaa490ee01..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/81-nslu2-power.patch +++ /dev/null @@ -1,15 +0,0 @@ - arch/arm/mach-ixp4xx/nslu2-power.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-power.c 2006-02-06 20:37:01.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-power.c 2006-02-06 22:34:46.000000000 +0100 -@@ -77,6 +77,9 @@ static int __init nslu2_power_init(void) - - static void __exit nslu2_power_exit(void) - { -+ if (!(machine_is_nslu2())) -+ return; -+ - free_irq(NSLU2_RB_IRQ, NULL); - free_irq(NSLU2_PB_IRQ, NULL); - } diff --git a/packages/linux/ixp4xx-kernel/2.6.16/85-timer.patch b/packages/linux/ixp4xx-kernel/2.6.16/85-timer.patch index 3ee670f1e9..83951c2574 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/85-timer.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/85-timer.patch @@ -4,9 +4,9 @@ include/asm-arm/arch-ixp4xx/timex.h | 23 +++-- 4 files changed, 176 insertions(+), 22 deletions(-) ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/common.c 2006-02-06 20:37:01.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/common.c 2006-02-06 22:34:55.000000000 +0100 -@@ -241,36 +241,165 @@ void __init ixp4xx_init_irq(void) +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/common.c 2006-02-23 18:27:49.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/common.c 2006-02-23 18:30:49.000000000 +0100 +@@ -247,36 +247,165 @@ void __init ixp4xx_init_irq(void) * IXP4xx timer tick * We use OS timer1 on the CPU for the timer tick and the timestamp * counter as a source of real clock ticks to account for missed jiffies. @@ -181,7 +181,7 @@ write_sequnlock(&xtime_lock); -@@ -283,17 +412,30 @@ static struct irqaction ixp4xx_timer_irq +@@ -289,17 +418,30 @@ static struct irqaction ixp4xx_timer_irq .handler = ixp4xx_timer_interrupt, }; @@ -214,13 +214,13 @@ /* Connect the interrupt handler and enable the interrupt */ setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq); -@@ -356,4 +498,3 @@ void __init ixp4xx_sys_init(void) +@@ -362,4 +504,3 @@ void __init ixp4xx_sys_init(void) printk("IXP4xx: Using %luMiB expansion bus window size\n", ixp4xx_exp_bus_size >> 20); } - ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:31:04.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:34:55.000000000 +0100 +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:27:49.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:30:49.000000000 +0100 @@ -119,6 +119,11 @@ static void nslu2_power_off(void) static void __init nslu2_init(void) @@ -232,9 +232,9 @@ + ixp4xx_sys_init(); - pm_power_off = nslu2_power_off; ---- linux-nslu2.orig/include/asm-arm/arch-ixp4xx/nslu2.h 2006-02-06 20:37:38.000000000 +0100 -+++ linux-nslu2/include/asm-arm/arch-ixp4xx/nslu2.h 2006-02-06 22:34:55.000000000 +0100 + nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/nslu2.h 2006-02-23 18:27:12.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/nslu2.h 2006-02-23 18:30:49.000000000 +0100 @@ -35,11 +35,6 @@ #define NSLU2_PCI_INTD_PIN 8 @@ -247,8 +247,8 @@ /* GPIO */ #define NSLU2_GPIO0 0 ---- linux-nslu2.orig/include/asm-arm/arch-ixp4xx/timex.h 2006-01-25 19:12:27.000000000 +0100 -+++ linux-nslu2/include/asm-arm/arch-ixp4xx/timex.h 2006-02-06 22:34:55.000000000 +0100 +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/timex.h 2006-02-23 18:27:12.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/timex.h 2006-02-23 18:30:49.000000000 +0100 @@ -6,10 +6,23 @@ #include <asm/hardware.h> diff --git a/packages/linux/ixp4xx-kernel/2.6.16/91-maclist.patch b/packages/linux/ixp4xx-kernel/2.6.16/91-maclist.patch index 3915c50cb7..34579183d0 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/91-maclist.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/91-maclist.patch @@ -1,38 +1,59 @@ - drivers/net/Kconfig | 15 ++ +Ethernet MAC repository. + +Some ethernet controllers have no built-in way of obtaining an +appropriate Ethernet MAC address. Such controllers have to be +initialised in a board-specific way, depending on how the allocated +MAC is stored. The MAC repository provides a set of APIs and a +proc entry (/proc/net/maclist) to store MAC values from the board +so that such drivers can obtain a MAC address without board-specific +code. + +Signed-off-by: John Bowler <jbowler@acm.org> + +--- + drivers/net/Kconfig | 15 + drivers/net/Makefile | 1 - drivers/net/maclist.c | 314 ++++++++++++++++++++++++++++++++++++++++++++++++++ - include/net/maclist.h | 23 +++ - 4 files changed, 353 insertions(+) + drivers/net/maclist.c | 465 ++++++++++++++++++++++++++++++++++++++++++++++++++ + include/net/maclist.h | 49 +++++ + 4 files changed, 530 insertions(+) ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/include/net/maclist.h 2006-02-06 22:35:23.000000000 +0100 -@@ -0,0 +1,23 @@ -+#ifndef _MACLIST_H -+#define _MACLIST_H 1 -+/* -+ * Interfaces to the MAC repository -+ */ -+/* -+ * Add a single entry, returns 0 on success else an error -+ * code. Must *not* be called from an interrupt handler. -+ */ -+extern int maclist_add(const u8 id_to_add[6]); -+ -+/* -+ * Return the current entry count (valid in any context). -+ */ -+extern int maclist_count(void); -+ -+/* -+ * Return the ID from the n'th entry (valid in any context), -+ * returns 0 on success, -EINVAL if 'n' is out of range. -+ */ -+extern int maclist_read(u8 (*buffer_for_id)[6], int index_of_id_to_return); +--- linux-ixp4xx.orig/drivers/net/Kconfig 2006-02-23 18:27:12.000000000 +0100 ++++ linux-ixp4xx/drivers/net/Kconfig 2006-02-23 18:30:54.000000000 +0100 +@@ -177,6 +177,21 @@ config NET_ETHERNET + kernel: saying N will just cause the configurator to skip all + the questions about Ethernet network cards. If unsure, say N. + ++config MACLIST ++ tristate "Ethernet MAC repository" ++ depends on NET_ETHERNET ++ help ++ Some ethernet controllers have no built-in way of obtaining an ++ appropriate Ethernet MAC address. Such controllers have to be ++ initialised in a board-specific way, depending on how the allocated ++ MAC is stored. The MAC repository provides a set of APIs and a ++ proc entry (/proc/net/maclist) to store MAC values from the board ++ so that such drivers can obtain a MAC address without board-specific ++ code. You do not need to enable this device - it will be selected ++ automatically by any device which requires it. It is only useful ++ to enable it manually when building a device driver independently ++ of the kernel build. + -+#endif /*_MACLIST_H*/ + config MII + tristate "Generic Media Independent Interface device support" + depends on NET_ETHERNET +--- linux-ixp4xx.orig/drivers/net/Makefile 2006-02-23 18:27:12.000000000 +0100 ++++ linux-ixp4xx/drivers/net/Makefile 2006-02-23 18:30:54.000000000 +0100 +@@ -74,6 +74,7 @@ obj-$(CONFIG_RIONET) += rionet.o + # end link order section + # + ++obj-$(CONFIG_MACLIST) += maclist.o + obj-$(CONFIG_MII) += mii.o + obj-$(CONFIG_PHYLIB) += phy/ + --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/net/maclist.c 2006-02-06 22:35:23.000000000 +0100 -@@ -0,0 +1,314 @@ ++++ linux-ixp4xx/drivers/net/maclist.c 2006-02-23 18:30:54.000000000 +0100 +@@ -0,0 +1,465 @@ +/* + * drivers/net/maclist.c + * @@ -61,15 +82,70 @@ + * 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. -+ * ++ */ ++ ++/* + * External interfaces: + * Interfaces to linux kernel (and modules) -+ * maclist_add: add a single MAC ++ * maclist_add: add a single MAC, sequenced with a single ++ * writer lock (reads may happen simultaneously ++ * because of the way the list is built) + * maclist_count: total number of MACs stored -+ * maclist_read: read a MAC 0..(maclist_count-1) ++ * maclist_read: read a MAC 0..(maclist_count-1). Call this ++ * to get a specific MAC. If the argument is ++ * a new key and all the allocaed MACs have been ++ * assigned a random but valid MAC will be return ++ * (and this will be stored for later retrieval ++ * under the given key.) ++ * ++ * Sequencing: ++ * The MAC ids must be added before any driver tries to use them ++ * (this is obvious isn't it?) This can be made to happen by ++ * sequencing the initcalls correctly. The module or kernel ++ * parameters have been handled before any init call happens. ++ * The important trick here is to ensure that the platform ++ * initialises any devices with MAC ids *before* any devices ++ * which might use them. ++ * ++ * When this code is a module any other module which adds a ++ * MAC should be modprobed before modules for ethernet ++ * devices. ++ * ++ * The failure case is 'soft' - the device will get a valid, but ++ * random, MAC and the real allocated MACs will never get used. ++ * This can be seen by looking at the list of ids in sysfs (there ++ * will be extra, random, ones after the allocated ones). ++ * ++ * Recommendations: ++ * For ethernet drivers which are known to be the sole driver on ++ * the board (without a built in MAC) and where the number of ++ * devices driven is known simply use an index 0..(n-1) as a ++ * key for each of the n devices. ++ * ++ * This is the common case, it works where one driver handles ++ * multiple devices so long as the total number of devices can ++ * be determined reliably. It is sufficient merely to maintain ++ * a global count of the number of devices initialised so far, ++ * just so long as the initialisation order is consistent. ++ * ++ * When the driver is generic and the board may be populated with ++ * other devices which allocate MACs from the maclist pool and ++ * use different drivers create a random key and compile this into ++ * the code. Use this as the base for all devices from the driver ++ * (using a global device count for this driver if necessary). ++ * ++ * With the second strategy the assignment of MACs will depend on ++ * the order of initialisation of the different drivers. To avoid ++ * this provide a kernel (or module) command line parameter to ++ * specify a base index and (optional) count for each driver or ++ * pass in a (struct resource) with the start and end of the keys ++ * to pass to maclist_read. Either method allows the higher levels ++ * (boot loader or machine description) to specify which MACs in ++ * the list to assign to each device. + */ +#include <linux/module.h> +#include <linux/moduleparam.h> ++#include <linux/spinlock.h> +#include <linux/etherdevice.h> +#include <linux/proc_fs.h> +#include <linux/errno.h> @@ -84,22 +160,27 @@ + +typedef struct maclist_entry { + struct maclist_entry *next; /* Linked list, first first */ ++ u32 key; /* count or key for this entry */ ++ u16 flags; + u8 id[6]; /* 6 byte Ethernet MAC */ +} maclist_entry_t; + -+/* Access to this list is possible at any time - entries in -+ * the list are never destroyed. Modification of the list is -+ * safe only from the init code (i.e. modification must be -+ * single threaded), but read from an interrupt at the same -+ * time is possible and safe. ++/* ++ * flag definitions + */ ++#define MACLIST_ALLOCATED 1 ++#define MACLIST_RANDOM 2 ++ ++/* Access to this list is protected by a standard rwlock_t. */ +static maclist_entry_t *maclist_list = 0; + ++static DEFINE_RWLOCK(maclist_lock); ++ +/* + * External interfaces. + * + * Add a single entry, returns 0 on success else an error -+ * code. Must be single threaded. ++ * code. Checks for invalid addresses. + */ +int maclist_add(const u8 new_id[6]) { + maclist_entry_t *new_entry, **tail; @@ -111,21 +192,27 @@ + new_entry = kmalloc(sizeof *new_entry, GFP_KERNEL); + if (new_entry == 0) + return -ENOMEM; -+ new_entry->next = 0; ++ new_entry->next = 0; ++ new_entry->key = 0; ++ new_entry->flags = 0; + memcpy(new_entry->id, new_id, sizeof new_entry->id); + + tail = &maclist_list; ++ ++ write_lock(&maclist_lock); + while (*tail != 0) + tail = &(*tail)->next; + *tail = new_entry; ++ write_unlock(&maclist_lock); ++ + return 0; +} +EXPORT_SYMBOL(maclist_add); + +/* -+ * Return the current entry count (valid in any context). ++ * Return the current entry count. + */ -+int maclist_count(void) { ++static int maclist_count_unlocked(void) { + maclist_entry_t *tail = maclist_list; + int count = 0; + @@ -136,27 +223,73 @@ + + return count; +} ++ ++int maclist_count(void) { ++ int count; ++ ++ read_lock(&maclist_lock); ++ count = maclist_count_unlocked(); ++ read_unlock(&maclist_lock); ++ ++ return count; ++} +EXPORT_SYMBOL(maclist_count); + +/* -+ * Return the ID from the n'th entry (valid in any context), -+ * returns 0 on success, -EINVAL if 'n' is out of range. ++ * Return the ID with the given key (the key is allocated ++ * to an entry if not found). + */ -+int maclist_read(u8 (*id)[6], int n) { -+ maclist_entry_t *entry = maclist_list; -+ -+ while (n > 0 && entry != 0) { -+ --n; -+ entry = entry->next; -+ } ++void maclist_read(u8 (*id)[6], u32 key) { ++ int count, index; ++ maclist_entry_t *entry, *entry_to_allocate; ++ ++ /* Do this under a write lock to avoid the SMP race ++ * where we find the key isn't assigned, drop the lock, ++ * have another CPU assign it, then assign it on this ++ * CPU too - very bad... ++ */ ++ write_lock(&maclist_lock); ++ count = maclist_count_unlocked(); ++ index = key % count; /* index of entry to allocate */ ++ entry_to_allocate = 0; ++ ++ entry = maclist_list; ++ while (entry != 0) { ++ if ((entry->flags & MACLIST_ALLOCATED) != 0) { ++ if (entry->key == key) { ++ /* Found it, use this entry. */ ++ entry_to_allocate = entry; ++ break; ++ } ++ } else if (entry_to_allocate == 0 || count <= index) { ++ /* The algorithm is to try for entry ++ * (key % count), but if this isn't possible ++ * return the prior unallocated entry. ++ */ ++ entry_to_allocate = entry; ++ } ++ ++ ++count; ++ entry = entry->next; ++ } + -+ if (n == 0 && entry != 0) { -+ memcpy(id, entry->id, sizeof *id); -+ return 0; ++ /* Use entry_to_allocate, allocating it if necessary. */ ++ if (entry_to_allocate != 0) { ++ if ((entry_to_allocate->flags & MACLIST_ALLOCATED) == 0) { ++ entry_to_allocate->key = key; ++ entry_to_allocate->flags |= MACLIST_ALLOCATED; ++ } ++ memcpy(id, entry_to_allocate->id, sizeof *id); ++ } ++ write_unlock(&maclist_lock); ++ ++ if (entry_to_allocate == 0) { ++ /* No unallocated entries. Make a new one and return it. */ ++ printk(KERN_INFO MACLIST_NAME ": adding random MAC for key 0x%x\n", key); ++ random_ether_addr(*id); ++ if (maclist_add(*id) == 0) ++ maclist_read(id, key); + } -+ -+ printk(KERN_ERR MACLIST_NAME ": id does not exist\n"); -+ return -EINVAL; +} +EXPORT_SYMBOL(maclist_read); + @@ -165,7 +298,7 @@ + * addresses, comma separated. (The parsing really should + * be somewhere central...) + */ -+static int __init maclist_setup(char *param) { ++static int __init maclist_setup(const char *param) { + int bytes = 0, seen_a_digit = 0; + u8 id[6]; + @@ -219,7 +352,7 @@ + + if (bytes >= 12) { + int rc = maclist_add(id); -+ if (rc) ++ if (unlikely(rc)) + return rc; + bytes = 0; + seen_a_digit = 0; @@ -233,10 +366,7 @@ + return 0; +} + -+/* -+ * procfs support, if compiled in. -+ */ -+#ifdef CONFIG_PROC_FS ++#if (defined CONFIG_PROC_FS) || (defined MODULE) +/* + * Character device read + */ @@ -264,8 +394,13 @@ + default: return ':'; + } +} ++#endif + +/* ++ * procfs support, if compiled in. ++ */ ++#ifdef CONFIG_PROC_FS ++/* + * The extensively undocumented proc_read_t callback is implemented here. + * Go look in fs/proc/generic.c: + * @@ -306,6 +441,49 @@ +#endif + +/* ++ * set works once, at init time (the param is set to 0444 below), ++ * get works any time. ++ */ ++static int param_set_maclist(const char *val, struct kernel_param *kp) ++{ ++ if (maclist_list == 0) ++ return maclist_setup(val); ++ ++ printk(KERN_ERR MACLIST_NAME ": call to set parameters too late\n"); ++ return -EINVAL; ++} ++ ++static int param_get_maclist(char *buffer, struct kernel_param *kp) ++{ ++#ifdef MODULE ++ off_t offset = 0; ++ ++ /* buffer is only 4k! */ ++ while (offset < 4096) { ++ int ch = maclist_getchar(offset++); ++ if (ch < 0) { ++ *buffer = 0; ++ return 0; ++ } ++ *buffer++ = ch; ++ } ++ ++ *--buffer = 0; ++ return -ENOMEM; ++#else ++ return -EINVAL; ++#endif ++} ++ ++/* ++ * module: the argument is ids=mac,mac,mac ++ * kernel command line: maclist.ids=mac,mac,mac ++ */ ++#define param_check_maclist(name, p) __param_check(name, p, maclist_entry_t*) ++module_param_named(ids, maclist_list, maclist, 0444); ++MODULE_PARM_DESC(ids, "comma separated list of MAC ids\n"); ++ ++/* + * Finally, the init/exit functions. + */ +static void __exit maclist_exit(void) @@ -314,8 +492,10 @@ + + remove_proc_entry(MACLIST_NAME, proc_net); + -+ list = maclist_list; -+ maclist_list = 0; ++ write_lock(&maclist_lock); ++ list = maclist_list; ++ maclist_list = 0; ++ write_unlock(&maclist_lock); + + while (list != 0) { + maclist_entry_t *head = list; @@ -324,14 +504,6 @@ + } +} + -+#ifdef MODULE -+static char ids[256]; -+module_param_string(ids, ids, sizeof ids, 0); -+MODULE_PARM_DESC(ids, "comma separated list of MAC ids\n"); -+#else -+__setup("maclist_ids=", maclist_setup); -+#endif -+ +static int __init maclist_init(void) +{ +# ifdef MODULE @@ -347,37 +519,55 @@ + +module_init(maclist_init); +module_exit(maclist_exit); ---- linux-nslu2.orig/drivers/net/Makefile 2006-02-06 22:35:18.000000000 +0100 -+++ linux-nslu2/drivers/net/Makefile 2006-02-06 22:35:23.000000000 +0100 -@@ -74,6 +74,7 @@ obj-$(CONFIG_RIONET) += rionet.o - # end link order section - # - -+obj-$(CONFIG_MACLIST) += maclist.o - obj-$(CONFIG_MII) += mii.o - obj-$(CONFIG_PHYLIB) += phy/ - ---- linux-nslu2.orig/drivers/net/Kconfig 2006-02-06 22:35:18.000000000 +0100 -+++ linux-nslu2/drivers/net/Kconfig 2006-02-06 22:35:23.000000000 +0100 -@@ -180,6 +180,21 @@ config NET_ETHERNET - kernel: saying N will just cause the configurator to skip all - the questions about Ethernet network cards. If unsure, say N. - -+config MACLIST -+ tristate "Ethernet MAC repository" -+ depends on NET_ETHERNET -+ help -+ Some ethernet controllers have no built-in way of obtaining an -+ appropriate Ethernet MAC address. Such controllers have to be -+ initialised in a board-specific way, depending on how the allocated -+ MAC is stored. The MAC repository provides a set of APIs and a -+ proc entry (/proc/net/maclist) to store MAC values from the board -+ so that such drivers can obtain a MAC address without board-specific -+ code. You do not need to enable this device - it will be selected -+ automatically by any device which requires it. It is only useful -+ to enable it manually when building a device driver independently -+ of the kernel build. +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/include/net/maclist.h 2006-02-23 18:30:54.000000000 +0100 +@@ -0,0 +1,49 @@ ++#ifndef _MACLIST_H ++#define _MACLIST_H 1 ++/* ++ * Interfaces to the MAC repository ++ * ++ * Copyright (C) 2005 John Bowler ++ * Author: John Bowler <jbowler@acm.org> ++ * Maintainers: http://www.nslu2-linux.org/ ++ * ++ * 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. ++ */ + - config MII - tristate "Generic Media Independent Interface device support" - depends on NET_ETHERNET ++/* ++ * Add a single entry, returns 0 on success else an error ++ * code. Allocates memory, claims and releases a write ++ * lock. ++ */ ++extern int maclist_add(const u8 id_to_add[6]); ++ ++/* ++ * Return the current entry count, claims and releases a ++ * read lock. ++ */ ++extern int maclist_count(void); ++ ++/* ++ * Return the ID from the given entry. Always succeeds. ++ * Claims and releases a write lock. ++ * ++ * If any entry has not been allocated for this key one ++ * is allocated. If there are no remaining unallocated ++ * entries a new one is created. ++ * ++ * If the value of the key is less than maclist_count() ++ * the entry indexed by the key (i.e. for key 'n' the ++ * n'th entry starting at 0) will be returned if available. ++ * Otherwise the entry to be returned will be unpredictable ++ * but consistent for a given value of maclist_count(). ++ */ ++extern void maclist_read(u8 (*buffer_for_id)[6], ++ u32 key_of_entry_to_return); ++ ++/* ++ * See the implementation in drivers/net/maclist.c for ++ * more information. ++ */ ++#endif /*_MACLIST_H*/ diff --git a/packages/linux/ixp4xx-kernel/2.6.16/92-nslu2-maclist.patch b/packages/linux/ixp4xx-kernel/2.6.16/92-nslu2-maclist.patch index f08efacb64..298a3d92bb 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/92-nslu2-maclist.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/92-nslu2-maclist.patch @@ -2,8 +2,8 @@ arch/arm/mach-ixp4xx/nslu2-setup.c | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/Kconfig 2006-02-06 22:35:26.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/Kconfig 2006-02-06 22:35:31.000000000 +0100 +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/Kconfig 2006-02-23 18:30:58.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/Kconfig 2006-02-23 18:31:00.000000000 +0100 @@ -11,8 +11,8 @@ comment "IXP4xx Platforms" # This entry is placed on top because otherwise it would have # been shown as a submenu. @@ -15,8 +15,8 @@ help Say 'Y' here if you want your kernel to support Linksys's NSLU2 NAS device. For more information on this platform, ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:34:55.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:35:31.000000000 +0100 +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:30:49.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:31:00.000000000 +0100 @@ -16,11 +16,14 @@ #include <linux/kernel.h> #include <linux/serial.h> @@ -81,4 +81,4 @@ + ixp4xx_sys_init(); - pm_power_off = nslu2_power_off; + nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/93-loft-maclist.patch b/packages/linux/ixp4xx-kernel/2.6.16/93-loft-maclist.patch deleted file mode 100644 index ffda1136ef..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/93-loft-maclist.patch +++ /dev/null @@ -1,96 +0,0 @@ -add loft support for setting the maclist from EEPROM - -Signed-off-by: John Bowler <jbowler@acm.org> - ---- linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 -@@ -14,6 +14,7 @@ - #include <linux/serial.h> - #include <linux/tty.h> - #include <linux/serial_8250.h> -+#include <linux/eeprom.h> - - #include <asm/types.h> - #include <asm/setup.h> -@@ -24,6 +25,8 @@ - #include <asm/mach/arch.h> - #include <asm/mach/flash.h> - -+#include <net/maclist.h> -+ - static struct flash_platform_data ixdp425_flash_data = { - .map_name = "cfi_probe", - .width = 2, -@@ -188,9 +191,62 @@ MACHINE_END - /* - * Loft is functionally equivalent to Avila except that it has a - * different number for the maximum PCI devices. The MACHINE -- * structure below is identical to Avila except for the comment. -+ * structure below is identical to Avila except for the and -+ * the use of a loft specific init. -+ * -+ * The loft init registers a notifier on the on-board EEPROM to -+ * detect the MAC addresses. -+ * NOTE: this probably works for all Gateworks Avila boards and -+ * maybe the ixdp425 too. - */ - #ifdef CONFIG_MACH_LOFT -+/* -+ * When the EEPROM is added the MAC address are read from it. -+ */ -+static void loft_eeprom_add(int address, int kind, struct kobject *kobj, -+ struct bin_attribute *eeprom_attr) { -+ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */ -+ if (address == 0x51) { -+ ssize_t retlen; -+ char data[12]; -+ -+ /* Two Macs, one at 0, the other at 6, maclist_add will -+ * complain if the ID is not a valid MAC. -+ */ -+ retlen = eeprom_attr->read(kobj, data, 0, sizeof data); -+ if (retlen >= 6) { -+ u8 mac[6]; -+ memcpy(mac, data+0, sizeof mac); -+ printk(KERN_INFO "LOFT MAC[0]: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", -+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); -+ maclist_add(mac); -+ } -+ if (retlen >= 12) { -+ u8 mac[6]; -+ memcpy(mac, data+6, sizeof mac); -+ printk(KERN_INFO "LOFT MAC[1]: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", -+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); -+ maclist_add(mac); -+ } -+ } -+} -+ -+static struct eeprom_notifier loft_eeprom_notifier = { -+ .add = loft_eeprom_add -+}; -+ -+static void __init loft_init(void) -+{ -+ /* The EEPROM has two ethernet MACs embedded in it which we need, -+ * that is all this notifier does. -+ */ -+ register_eeprom_user(&loft_eeprom_notifier); -+ -+ ixp4xx_sys_init(); -+ -+ platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); -+} -+ - MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") - /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */ - .phys_ram = PHYS_OFFSET, -@@ -200,7 +256,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc - .init_irq = ixp4xx_init_irq, - .timer = &ixp4xx_timer, - .boot_params = 0x0100, -- .init_machine = ixdp425_init, -+ .init_machine = loft_init, - MACHINE_END - #endif - diff --git a/packages/linux/ixp4xx-kernel/2.6.16/94-loft-setup.patch b/packages/linux/ixp4xx-kernel/2.6.16/94-loft-setup.patch index e84508b85b..62efa77495 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/94-loft-setup.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/94-loft-setup.patch @@ -1,20 +1,27 @@ - arch/arm/mach-ixp4xx/ixdp425-setup.c | 115 ++++++++++++++++++++++++++++++++++- - 1 file changed, 112 insertions(+), 3 deletions(-) ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c 2006-02-10 18:03:51.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/ixdp425-setup.c 2006-02-10 18:06:40.000000000 +0100 -@@ -15,6 +15,7 @@ +--- + arch/arm/mach-ixp4xx/ixdp425-setup.c | 145 +++++++++++++++++++++++++++++++++-- + 1 file changed, 140 insertions(+), 5 deletions(-) + +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/ixdp425-setup.c 2006-02-22 18:53:29.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/ixdp425-setup.c 2006-02-22 18:57:00.000000000 +0100 +@@ -15,7 +15,7 @@ #include <linux/tty.h> #include <linux/serial_8250.h> #include <linux/slab.h> +- +#include <linux/eeprom.h> - #include <asm/types.h> #include <asm/setup.h> -@@ -25,6 +26,10 @@ + #include <asm/memory.h> +@@ -25,6 +25,14 @@ #include <asm/mach/arch.h> #include <asm/mach/flash.h> ++#ifdef CONFIG_LEDS_CLASS ++#include <linux/leds.h> ++#endif ++ +#ifdef CONFIG_MACLIST +#include <net/maclist.h> +#endif @@ -22,11 +29,29 @@ static struct flash_platform_data ixdp425_flash_data = { .map_name = "cfi_probe", .width = 2, -@@ -176,17 +181,122 @@ MACHINE_START(AVILA, "Gateworks Avila Ne +@@ -176,22 +184,149 @@ MACHINE_START(AVILA, "Gateworks Avila Ne MACHINE_END #endif +#ifdef CONFIG_MACH_LOFT ++#ifdef CONFIG_LEDS_CLASS ++static struct resource loft_led_resources[] = { ++ { ++ .name = "ready", /* green led, also J8 pin 7 */ ++ .start = 3, /* FIXME use #define */ ++ .end = 3, ++ .flags = IXP4XX_GPIO_LOW, ++ }, ++}; ++ ++static struct platform_device loft_leds = { ++ .name = "IXP4XX-GPIO-LED", ++ .id = -1, ++ .num_resources = ARRAY_SIZE(loft_led_resources), ++ .resource = loft_led_resources, ++}; ++#endif ++ /* * Loft is functionally equivalent to Avila except that it has a * different number for the maximum PCI devices. The MACHINE @@ -77,6 +102,22 @@ +}; +#endif + ++static void __init loft_init(void) ++{ ++ ixdp425_init(); ++ ++#ifdef CONFIG_LEDS_CLASS ++ /* We don't care if this fails. */ ++ (void)platform_device_register(&loft_leds); ++#endif ++ /* The EEPROM has two ethernet MACs embedded in it which we need, ++ * that is all this notifier does. ++ */ ++#ifdef CONFIG_SENSORS_EEPROM ++ register_eeprom_user(&loft_eeprom_notifier); ++#endif ++} ++ +/* + * Loft bootstrap may pass in parameters, if these contain an + * ATAG_MEM and it appears valid (not the 16MByte one in the @@ -87,23 +128,15 @@ +static void __init loft_fixup(struct machine_desc *desc, + struct tag *tags, char **cmdline, struct meminfo *mi) +{ -+ char saved_command_line[COMMAND_LINE_SIZE]; -+ + /* Put Loft specific known-required-for-certain stuff here, leave + * a trailing space! + */ + static char loft_command_line[] = + "root=/dev/mtdblock2 rw rootfstype=jffs2 init=/linuxrc " -+ "rtc-ds1672.probe=0,0x68 "; -+ const int len = (sizeof loft_command_line) - 1; -+ int memtag = 0; ++ "rtc-ds1672.probe=0,0x68 " ++ CONFIG_CMDLINE; + -+ /* The EEPROM has two ethernet MACs embedded in it which we need, -+ * that is all this notifier does. -+ */ -+#ifdef CONFIG_SENSORS_EEPROM -+ register_eeprom_user(&loft_eeprom_notifier); -+#endif ++ int memtag = 0; + + /* The Loft typically has one bank of 64MByte memory. + * NOTE: setting nr_banks != 0 causes kernel/setup.c to remove @@ -132,10 +165,7 @@ + /* A command line in the ATAG list will override this one, + * as is intended. + */ -+ memcpy(saved_command_line, *cmdline, COMMAND_LINE_SIZE); -+ memcpy(*cmdline, loft_command_line, len); -+ memcpy(*cmdline + len, saved_command_line, COMMAND_LINE_SIZE - len); -+ *cmdline[COMMAND_LINE_SIZE-1] = 0; ++ strlcpy(*cmdline, loft_command_line, COMMAND_LINE_SIZE); +} + MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") @@ -147,8 +177,9 @@ .map_io = ixp4xx_map_io, .init_irq = ixp4xx_init_irq, .timer = &ixp4xx_timer, -@@ -194,4 +304,3 @@ MACHINE_START(LOFT, "Giant Shoulder Inc - .init_machine = ixdp425_init, + .boot_params = 0x0100, +- .init_machine = ixdp425_init, ++ .init_machine = loft_init, MACHINE_END #endif - diff --git a/packages/linux/ixp4xx-kernel/2.6.16/94-nas100d-setup.patch b/packages/linux/ixp4xx-kernel/2.6.16/94-nas100d-setup.patch index 15ddc44584..cdca7d2766 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/94-nas100d-setup.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/94-nas100d-setup.patch @@ -41,7 +41,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> + */ +static char nas100d_command_line[] __initdata = + "root=/dev/mtdblock2 rootfstype=jffs2 init=/linuxrc " -+ "rtc-pcf8563.force=0,0x51 " ++ "rtc-pcf8563.probe=0,0x51 " + CONFIG_CMDLINE; + +static void __init nas100d_fixup(struct machine_desc *desc, diff --git a/packages/linux/ixp4xx-kernel/2.6.16/94-nslu2-setup.patch b/packages/linux/ixp4xx-kernel/2.6.16/94-nslu2-setup.patch index 6a1c8b9783..3effbc7711 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/94-nslu2-setup.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/94-nslu2-setup.patch @@ -7,8 +7,8 @@ Signed-off-by: John Bowler <jbowler@acm.org> arch/arm/mach-ixp4xx/nslu2-setup.c | 45 ++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:35:31.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-06 22:43:44.000000000 +0100 +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:31:00.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-23 18:31:04.000000000 +0100 @@ -18,6 +18,8 @@ #include <linux/serial_8250.h> #include <linux/mtd/mtd.h> @@ -18,7 +18,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> -@@ -170,11 +172,52 @@ static void __init nslu2_init(void) +@@ -174,11 +176,52 @@ static void __init nslu2_init(void) platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); } diff --git a/packages/linux/ixp4xx-kernel/2.6.16/950-leds-timer.patch b/packages/linux/ixp4xx-kernel/2.6.16/950-leds-timer.patch deleted file mode 100644 index c44ef62ee7..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/950-leds-timer.patch +++ /dev/null @@ -1,151 +0,0 @@ -Fix for a bug in led-triggers.c plus an update to the -timer trigger code to allow for fractional frequency -values and to correct the evaluation of frequency so -that it is the actual frequency. - -Signed-off-by: John Bowler <jbowler@acm.org> - ---- linux-2.6.15/drivers/leds/led-triggers.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/drivers/leds/led-triggers.c 1970-01-01 00:00:00.000000000 +0000 -@@ -98,7 +98,7 @@ void led_trigger_event(struct led_trigge - if (!trigger) - return; - -- read_lock(&trigger->led_devs); -+ read_lock(&trigger->leddev_list_lock); - list_for_each(entry, &trigger->led_devs) { - struct led_device *led_dev; - -@@ -107,7 +107,7 @@ void led_trigger_event(struct led_trigge - led_set_brightness(led_dev, brightness); - write_unlock(&led_dev->lock); - } -- read_unlock(&trigger->led_devs); -+ read_unlock(&trigger->leddev_list_lock); - } - - /* Caller must ensure led_dev->lock held for write */ ---- linux-2.6.15/drivers/leds/ledtrig-timer.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/drivers/leds/ledtrig-timer.c 1970-01-01 00:00:00.000000000 +0000 -@@ -12,6 +12,7 @@ - */ - - #include <linux/config.h> -+#include <linux/ctype.h> - #include <linux/module.h> - #include <linux/kernel.h> - #include <linux/init.h> -@@ -61,21 +62,19 @@ static void led_timer_function(unsigned - static void led_timer_setdata(struct led_device *led_dev, unsigned long duty, unsigned long frequency) - { - struct timer_trig_data *timer_data = led_dev->trigger_data; -- signed long duty1; -- -- if (frequency > 500) -- frequency = 500; - - if (duty > 100) - duty = 100; - -- duty1 = duty - 50; -- - timer_data->duty = duty; - timer_data->frequency = frequency; - if (frequency != 0) { -- timer_data->delay_on = (50 - duty1) * 1000 / 50 / frequency; -- timer_data->delay_off = (50 + duty1) * 1000 / 50 / frequency; -+ timer_data->delay_on = duty * 10000U / frequency; -+ if (timer_data->delay_on == 0) -+ timer_data->delay_on = 1; -+ timer_data->delay_off = (100U-duty) * 10000U / frequency; -+ if (timer_data->delay_off == 0) -+ timer_data->delay_off = 1; - } - - mod_timer(&timer_data->timer, jiffies); -@@ -100,8 +99,8 @@ static ssize_t led_duty_store(struct cla - struct timer_trig_data *timer_data; - int ret = -EINVAL; - char *after; -- - unsigned long state = simple_strtoul(buf, &after, 10); -+ - if (after - buf > 0) { - ret = after - buf; - write_lock(&led_dev->lock); -@@ -118,32 +117,63 @@ static ssize_t led_frequency_show(struct - { - struct led_device *led_dev = dev->class_data; - struct timer_trig_data *timer_data; -+ unsigned long freq000; - - read_lock(&led_dev->lock); - timer_data = led_dev->trigger_data; -- sprintf(buf, "%lu\n", timer_data->frequency); -+ freq000 = timer_data->frequency; - read_unlock(&led_dev->lock); - -+ if (freq000 % 1000) -+ sprintf(buf, "%lu.%.3lu\n", freq000 / 1000, freq000 % 1000); -+ else -+ sprintf(buf, "%lu\n", freq000 / 1000); -+ - return strlen(buf) + 1; - } - - static ssize_t led_frequency_store(struct class_device *dev, const char *buf, size_t size) - { - struct led_device *led_dev = dev->class_data; -- struct timer_trig_data *timer_data; -- int ret = -EINVAL; -- char *after; -+ size_t rc = 0; -+ unsigned long freq000 = 0; -+ int have_digit = 0; -+ -+ while (rc < size && isspace(buf[rc])) -+ ++rc; -+ if (rc >= size) -+ return rc; -+ -+ /* number before decimal point */ -+ while (rc < size && isdigit(buf[rc])) -+ freq000 *= 10, freq000 += buf[rc++] - '0', have_digit = 1; -+ -+ if (rc < size && (buf[rc] == '.' || buf[rc] == ',')) { -+ int dp = 0; -+ ++rc; -+ while (rc < size && isdigit(buf[rc])) { -+ if (++dp <= 3) -+ freq000 *= 10, freq000 += buf[rc] - '0'; -+ ++rc; -+ have_digit = 1; -+ } -+ while (++dp <= 3) -+ freq000 *= 10; -+ } else -+ freq000 *= 1000; - -- unsigned long state = simple_strtoul(buf, &after, 10); -- if (after - buf > 0) { -- ret = after - buf; -- write_lock(&led_dev->lock); -- timer_data = led_dev->trigger_data; -- led_timer_setdata(led_dev, timer_data->duty, state); -- write_unlock(&led_dev->lock); -+ if (!have_digit) -+ return -EINVAL; -+ -+ write_lock(&led_dev->lock); -+ { -+ struct timer_trig_data *timer_data = led_dev->trigger_data; -+ led_timer_setdata(led_dev, timer_data->duty, freq000); - } -+ write_unlock(&led_dev->lock); - -- return ret; -+ -+ return rc; - } - - static CLASS_DEVICE_ATTR(duty, 0644, led_duty_show, led_duty_store); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/951-ixp4xx-leds-cpu-activity.patch b/packages/linux/ixp4xx-kernel/2.6.16/951-ixp4xx-leds-cpu-activity.patch index b6b3897005..92b03836d4 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/951-ixp4xx-leds-cpu-activity.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/951-ixp4xx-leds-cpu-activity.patch @@ -6,18 +6,25 @@ are idle. Signed-off-by: John Bowler <jbowler@acm.org> -diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/arch/arm/kernel/process.c linux-2.6.15.2/arch/arm/kernel/process.c ---- linux-2.6.15/arch/arm/kernel/process.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/kernel/process.c 1970-01-01 00:00:00.000000000 +0000 +--- + arch/arm/kernel/process.c | 11 + drivers/leds/Kconfig | 9 + drivers/leds/Makefile | 1 + drivers/leds/ledtrig-cpu.c | 501 +++++++++++++++++++++++++++++++++++++++++++++ + include/linux/leds.h | 9 + 5 files changed, 531 insertions(+) + +--- linux-ixp4xx.orig/arch/arm/kernel/process.c 2006-02-21 00:53:28.000000000 +0100 ++++ linux-ixp4xx/arch/arm/kernel/process.c 2006-02-21 01:03:33.000000000 +0100 @@ -27,6 +27,7 @@ #include <linux/kallsyms.h> #include <linux/init.h> #include <linux/cpu.h> +#include <linux/leds.h> - #include <asm/system.h> - #include <asm/io.h> -@@ -81,6 +82,12 @@ void (*pm_power_off)(void); + #include <asm/leds.h> + #include <asm/processor.h> +@@ -80,6 +81,12 @@ void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); /* @@ -30,7 +37,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/arch/arm/kernel/ * This is our default idle handler. We need to disable * interrupts here to ensure we don't miss a wakeup call. */ -@@ -121,8 +128,12 @@ void cpu_idle(void) +@@ -120,8 +127,12 @@ void cpu_idle(void) if (!idle) idle = default_idle; leds_event(led_idle_start); @@ -43,9 +50,8 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/arch/arm/kernel/ leds_event(led_idle_end); preempt_enable_no_resched(); schedule(); -diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/Kconfig linux-2.6.15.2/drivers/leds/Kconfig ---- linux-2.6.15/drivers/leds/Kconfig 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/drivers/leds/Kconfig 1970-01-01 00:00:00.000000000 +0000 +--- linux-ixp4xx.orig/drivers/leds/Kconfig 2006-02-21 00:58:36.000000000 +0100 ++++ linux-ixp4xx/drivers/leds/Kconfig 2006-02-21 01:03:33.000000000 +0100 @@ -66,5 +66,14 @@ config LEDS_TRIGGER_TIMER This allows LEDs to be controlled by a programmable timer via sysfs. If unsure, say Y. @@ -61,17 +67,15 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/Kco + endmenu -diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/Makefile linux-2.6.15.2/drivers/leds/Makefile ---- linux-2.6.15/drivers/leds/Makefile 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/drivers/leds/Makefile 1970-01-01 00:00:00.000000000 +0000 +--- linux-ixp4xx.orig/drivers/leds/Makefile 2006-02-21 00:58:36.000000000 +0100 ++++ linux-ixp4xx/drivers/leds/Makefile 2006-02-21 01:03:33.000000000 +0100 @@ -13,3 +13,4 @@ obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o # LED Triggers obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o +obj-$(CONFIG_LEDS_TRIGGER_CPU_ACTIVITY) += ledtrig-cpu.o -diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/ledtrig-cpu.c linux-2.6.15.2/drivers/leds/ledtrig-cpu.c ---- linux-2.6.15/drivers/leds/ledtrig-cpu.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/drivers/leds/ledtrig-cpu.c 1970-01-01 00:00:00.000000000 +0000 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/ledtrig-cpu.c 2006-02-21 01:08:57.000000000 +0100 @@ -0,0 +1,501 @@ +/* + * LEDs CPU activity trigger @@ -182,7 +186,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led + * have changed. Returns true if the LED is blinking. The argument + * is the blink state - the brightness of the blinking LED. + */ -+static int leds_cpu_trigger_led_state_change(struct led_device *led, ++static int leds_cpu_trigger_led_state_change(struct led_classdev *led, + int is_active, enum led_brightness brightness) +{ + int is_blinking = 0; @@ -218,7 +222,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led +static ssize_t leds_cpu_trigger_show_prop(struct class_device *dev, char *buf, + size_t where) +{ -+ struct led_device *led = dev->class_data; ++ struct led_classdev *led = dev->class_data; + cpu_trigger_led_state item = cpu_led_invalid, i; + char *next; + @@ -270,7 +274,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led +{ + size_t rc = 0; + cpu_trigger_led_state value = 0/*sic*/; -+ struct led_device *led; ++ struct led_classdev *led; + + /* ignore space characters before the value. */ + while (rc < size && isspace(buf[rc])) @@ -336,7 +340,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led + * Activate and deactivate are called on individual LEDs when the + * LED trigger property is changed. The LED write lock is held. + */ -+static void leds_cpu_trigger_activate(struct led_device *led) ++static void leds_cpu_trigger_activate(struct led_classdev *led) +{ + /* + * The initial setting of the trigger is simple CPU activity @@ -358,7 +362,7 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led + led_set_brightness(led, LED_FULL); +} + -+static void leds_cpu_trigger_deactivate(struct led_device *led) ++static void leds_cpu_trigger_deactivate(struct led_classdev *led) +{ + struct cpu_trigger_data *data = led->trigger_data; + if (likely(data != 0)) { @@ -422,9 +426,9 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led + leds_cpu_trigger_mark(data, now) ? LED_FULL : LED_OFF; + struct list_head *entry; + -+ list_for_each(entry, &data->trigger.led_devs) { -+ struct led_device *led = -+ list_entry(entry, struct led_device, trig_list); ++ list_for_each(entry, &data->trigger.led_cdevs) { ++ struct led_classdev *led = ++ list_entry(entry, struct led_classdev, trig_list); + + blinking |= leds_cpu_trigger_led_state_change(led, + active, brightness); @@ -574,9 +578,8 @@ diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/drivers/leds/led +MODULE_AUTHOR("John Bowler <jbowler@acm.org>"); +MODULE_DESCRIPTION("CPU activity LED trigger"); +MODULE_LICENSE("MIT"); -diff -rup linux-2.6.15.2/.pc/951-ixp4xx-leds-cpu-activity.patch/include/linux/leds.h linux-2.6.15.2/include/linux/leds.h ---- linux-2.6.15/include/linux/leds.h 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/include/linux/leds.h 1970-01-01 00:00:00.000000000 +0000 +--- linux-ixp4xx.orig/include/linux/leds.h 2006-02-21 00:54:33.000000000 +0100 ++++ linux-ixp4xx/include/linux/leds.h 2006-02-21 01:03:33.000000000 +0100 @@ -95,3 +95,12 @@ void led_trigger_event(struct led_trigge #define led_trigger_event(x, y) do {} while(0) diff --git a/packages/linux/ixp4xx-kernel/2.6.16/96-loft-leds.patch b/packages/linux/ixp4xx-kernel/2.6.16/96-loft-leds.patch deleted file mode 100644 index 60fcf52cbb..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/96-loft-leds.patch +++ /dev/null @@ -1,62 +0,0 @@ -NEW_LEDS support for the loft board - -Signed-off-by: John Bowler <jbowler@acm.org> - ---- linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 -@@ -15,6 +15,7 @@ - #include <linux/tty.h> - #include <linux/serial_8250.h> - #include <linux/eeprom.h> -+#include <linux/leds.h> - - #include <asm/types.h> - #include <asm/setup.h> -@@ -200,6 +201,29 @@ MACHINE_END - * maybe the ixdp425 too. - */ - #ifdef CONFIG_MACH_LOFT -+#ifdef CONFIG_LEDS_CLASS -+static struct resource loft_led_resources[] = { -+ { -+ .name = "ready", /* green led, also J8 pin 7 */ -+ .start = 3, -+ .end = 3, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+}; -+ -+static struct platform_device loft_leds = { -+ .name = "IXP4XX-GPIO-LED", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(loft_led_resources), -+ .resource = loft_led_resources, -+}; -+#endif -+ -+static struct platform_device *loft_devices[] __initdata = { -+ &ixdp425_i2c_controller, -+ &ixdp425_flash, -+}; -+ - /* - * When the EEPROM is added the MAC address are read from it. - */ -@@ -244,7 +268,16 @@ static void __init loft_init(void) - - ixp4xx_sys_init(); - -- platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); -+ /* Put the UART in first for debugging, don't care if it fails. */ -+ (void)platform_device_register(&ixdp425_uart); -+ -+ /* These should work... */ -+ platform_add_devices(loft_devices, ARRAY_SIZE(loft_devices)); -+ -+#ifdef CONFIG_LEDS_CLASS -+ /* We don't care if this fails. */ -+ (void)platform_device_register(&loft_leds); -+#endif - } - - MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") diff --git a/packages/linux/ixp4xx-kernel/2.6.16/96-nas100d-leds.patch b/packages/linux/ixp4xx-kernel/2.6.16/96-nas100d-leds.patch index 796ca87718..ceb4b8b2f8 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/96-nas100d-leds.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/96-nas100d-leds.patch @@ -1,10 +1,13 @@ NEW_LEDS support for the IOMega NAS100D Signed-off-by: John Bowler <jbowler@acm.org> -Signed-off-by: Rod Whitby <rod@whitby.id.au> ---- linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.15/arch/arm/mach-ixp4xx/nas100d-setup.c 1970-01-01 00:00:00.000000000 +0000 +--- + arch/arm/mach-ixp4xx/nas100d-setup.c | 43 ++++++++++++++++++++++++++++++++++- + 1 file changed, 42 insertions(+), 1 deletion(-) + +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2006-02-21 01:40:40.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/nas100d-setup.c 2006-02-21 01:53:48.000000000 +0100 @@ -16,6 +16,7 @@ #include <linux/serial.h> #include <linux/serial_8250.h> @@ -13,7 +16,7 @@ Signed-off-by: Rod Whitby <rod@whitby.id.au> #include <asm/setup.h> #include <asm/memory.h> -@@ -44,6 +45,36 @@ static struct platform_device nas100d_fl +@@ -42,6 +43,36 @@ static struct platform_device nas100d_fl .resource = &nas100d_flash_resource, }; @@ -32,7 +35,7 @@ Signed-off-by: Rod Whitby <rod@whitby.id.au> + .flags = IXP4XX_GPIO_LOW, + }, + { -+ .name = "disk", /* green flashing (off) and yellow (on) led */ ++ .name = "disk-1", /* yellow led */ + .start = 3, + .end = 3, + .flags = IXP4XX_GPIO_LOW, @@ -50,7 +53,7 @@ Signed-off-by: Rod Whitby <rod@whitby.id.au> static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { .sda_pin = NAS100D_SDA_PIN, .scl_pin = NAS100D_SCL_PIN, -@@ -102,7 +133,6 @@ static struct platform_device nas100d_ua +@@ -100,7 +131,6 @@ static struct platform_device nas100d_ua static struct platform_device *nas100d_devices[] __initdata = { &nas100d_i2c_controller, &nas100d_flash, @@ -58,7 +61,7 @@ Signed-off-by: Rod Whitby <rod@whitby.id.au> }; static void nas100d_power_off(void) -@@ -158,7 +188,18 @@ static void __init nas100d_init(void) +@@ -160,7 +190,18 @@ static void __init nas100d_init(void) pm_power_off = nas100d_power_off; diff --git a/packages/linux/ixp4xx-kernel/2.6.16/96-nslu2-leds.patch b/packages/linux/ixp4xx-kernel/2.6.16/96-nslu2-leds.patch index 83043d9c2d..6b3b8d7d39 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/96-nslu2-leds.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/96-nslu2-leds.patch @@ -5,8 +5,8 @@ Signed-off-by: John Bowler <jbowler@acm.org> arch/arm/mach-ixp4xx/nslu2-setup.c | 51 ++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) ---- linux-nslu2.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-01-23 02:13:58.000000000 +0100 -+++ linux-nslu2/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-01-23 02:14:51.000000000 +0100 +--- linux-ixp4xx.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-21 02:54:05.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/nslu2-setup.c 2006-02-21 02:54:05.000000000 +0100 @@ -17,6 +17,9 @@ #include <linux/serial.h> #include <linux/serial_8250.h> @@ -17,7 +17,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> #include <asm/setup.h> #include <asm/memory.h> -@@ -50,6 +53,42 @@ static struct ixp4xx_i2c_pins nslu2_i2c_ +@@ -48,6 +51,42 @@ static struct ixp4xx_i2c_pins nslu2_i2c_ .scl_pin = NSLU2_SCL_PIN, }; @@ -60,7 +60,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> static struct platform_device nslu2_i2c_controller = { .name = "IXP4XX-I2C", .id = 0, -@@ -109,7 +148,6 @@ static struct platform_device nslu2_uart +@@ -107,7 +146,6 @@ static struct platform_device nslu2_uart static struct platform_device *nslu2_devices[] __initdata = { &nslu2_i2c_controller, &nslu2_flash, @@ -68,7 +68,7 @@ Signed-off-by: John Bowler <jbowler@acm.org> &nslu2_beeper, }; -@@ -171,7 +209,18 @@ static void __init nslu2_init(void) +@@ -173,7 +211,18 @@ static void __init nslu2_init(void) pm_power_off = nslu2_power_off; diff --git a/packages/linux/ixp4xx-kernel/2.6.16/96-pata-ixp4xx.patch b/packages/linux/ixp4xx-kernel/2.6.16/96-pata-ixp4xx.patch new file mode 100644 index 0000000000..1c08150c45 --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/96-pata-ixp4xx.patch @@ -0,0 +1,299 @@ +--- + drivers/scsi/Kconfig | 11 +- + drivers/scsi/Makefile | 1 + drivers/scsi/libata-core.c | 4 + drivers/scsi/pata_ixp4xx.c | 242 +++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 255 insertions(+), 3 deletions(-) + +--- linux-ixp4xx.orig/drivers/scsi/Kconfig 2006-02-24 18:13:55.000000000 +0100 ++++ linux-ixp4xx/drivers/scsi/Kconfig 2006-02-24 18:50:19.000000000 +0100 +@@ -903,11 +903,20 @@ config SCSI_PATA_WINBOND + tristate "Winbond SL82C105 PATA support" + depends on SCSI_SATA && PCI + help +- This option enables support for SL82C105 PATA devices found in the ++ This option enables support for SL82C105 PATAll devices found in the + Netwinder and some other systems + + If unsure, say N. + ++config SCSI_PATA_IXP4XX ++ tristate "IXP4XX Compact FLash support" ++ depends on SCSI_SATA && PCI ++ help ++ This option enables support for a Compact Flash connected on ++ the ixp4xx expansion bus. ++ ++ If unsure, say N. ++ + + config SCSI_BUSLOGIC + tristate "BusLogic SCSI support" +--- linux-ixp4xx.orig/drivers/scsi/Makefile 2006-02-24 18:13:55.000000000 +0100 ++++ linux-ixp4xx/drivers/scsi/Makefile 2006-02-24 18:16:46.000000000 +0100 +@@ -174,6 +174,7 @@ obj-$(CONFIG_SCSI_PATA_VIA) += libata.o + obj-$(CONFIG_SCSI_PATA_WINBOND) += libata.o pata_sl82c105.o + obj-$(CONFIG_SCSI_ATA_GENERIC) += libata.o ata_generic.o + obj-$(CONFIG_SCSI_PATA_LEGACY) += libata.o pata_legacy.o ++obj-$(CONFIG_SCSI_PATA_IXP4XX) += libata.o pata_ixp4xx.o + + obj-$(CONFIG_ARM) += arm/ + +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/scsi/pata_ixp4xx.c 2006-02-24 18:43:02.000000000 +0100 +@@ -0,0 +1,242 @@ ++/* ++ * pata-ixp4xx.c - Legacy port PATA/SATA controller driver. ++ * Copyright (c) 2006 Tower Technologies ++ * ++ * An ATA driver to handle a Compact Flash connected ++ * to the ixp4xx expansion bus. ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/libata.h> ++#include <scsi/scsi_host.h> ++ ++#define DRV_NAME "ixp4xx" ++#define DRV_VERSION "0.0.2" ++ ++/* XXX remove when converting to platform driver */ ++#define IXP4XX_IDE_BASE IXP4XX_EXP_BUS_BASE(1) ++#define IXP4XX_IDE_IRQ IRQ_IXP4XX_GPIO12 ++#define IXP4XX_IDE_CONTROL 0x1e ++#define IXP4XX_IDE_INT 12 ++#define IXP4XX_IDE_CS1_BITS 0xbfff0043 ++#define IXP4XX_IDE_PIO_MASK 0x1f ++ ++#ifdef __ARMEB__ ++#define ixp4xx_writew(data,addr) writew(data,addr) ++#define ixp4xx_readw(addr) readw(addr) ++#else ++#define ixp4xx_writew(data,addr) writew(le16_to_cpu(data),addr) ++#define ixp4xx_readw(addr) cpu_to_le16(readw(addr)) ++#endif ++ ++static struct ata_host_set *ixp4xx_host; ++ ++static unsigned int ixp4xx_mode_filter(const struct ata_port *ap, ++ struct ata_device *adev, unsigned int mask, int shift) ++{ ++ if (shift != ATA_SHIFT_PIO) ++ return 0; ++ return mask; ++} ++ ++static void ixp4xx_set_mode(struct ata_port *ap) ++{ ++ int i; ++ ++ for (i = 0; i < ATA_MAX_DEVICES; i++) { ++ struct ata_device *dev = &ap->device[i]; ++ if (ata_dev_present(dev)) { ++ dev->pio_mode = XFER_PIO_0; ++ dev->xfer_mode = XFER_PIO_0; ++ dev->xfer_shift = ATA_SHIFT_PIO; ++ dev->flags |= ATA_DFLAG_PIO; ++ } ++ } ++} ++ ++static void ixp4xx_phy_reset(struct ata_port *ap) ++{ ++ ap->cbl = ATA_CBL_PATA40; ++ ata_port_probe(ap); ++ ata_bus_reset(ap); ++} ++ ++void ixp4xx_mmio_data_xfer(struct ata_port *ap, struct ata_device *adev, ++ unsigned char *buf, unsigned int buflen, int write_data) ++{ ++ unsigned int i; ++ unsigned int words = buflen >> 1; ++ u16 *buf16 = (u16 *) buf; ++ void __iomem *mmio = (void __iomem *)ap->ioaddr.data_addr; ++ ++ /* set the expansion bus in 16bit mode and restore ++ * 8 bit mode after the transaction. ++ */ ++ *IXP4XX_EXP_CS1 &= ~(0x00000001); ++ ++ /* Transfer multiple of 2 bytes */ ++ if (write_data) { ++ for (i = 0; i < words; i++) ++ writew(buf16[i], mmio); ++ } else { ++ for (i = 0; i < words; i++) ++ buf16[i] = readw(mmio); ++ } ++ ++ /* Transfer trailing 1 byte, if any. */ ++ if (unlikely(buflen & 0x01)) { ++ u16 align_buf[1] = { 0 }; ++ unsigned char *trailing_buf = buf + buflen - 1; ++ ++ if (write_data) { ++ memcpy(align_buf, trailing_buf, 1); ++ writew(le16_to_cpu(align_buf[0]), mmio); ++ } else { ++ align_buf[0] = cpu_to_le16(readw(mmio)); ++ memcpy(trailing_buf, align_buf, 1); ++ } ++ } ++ ++ *IXP4XX_EXP_CS1 |= 0x00000001; ++} ++ ++void ixp4xx_host_stop(struct ata_host_set *host_set) ++{ ++ ata_host_stop(host_set); ++ release_region(IXP4XX_IDE_BASE, 0x1000); ++} ++ ++static struct scsi_host_template ixp4xx_sht = { ++ .module = THIS_MODULE, ++ .name = DRV_NAME, ++ .ioctl = ata_scsi_ioctl, ++ .queuecommand = ata_scsi_queuecmd, ++ .eh_strategy_handler = ata_scsi_error, ++ .can_queue = ATA_DEF_QUEUE, ++ .this_id = ATA_SHT_THIS_ID, ++ .sg_tablesize = LIBATA_MAX_PRD, ++ .max_sectors = ATA_MAX_SECTORS, ++ .cmd_per_lun = ATA_SHT_CMD_PER_LUN, ++ .emulated = ATA_SHT_EMULATED, ++ .use_clustering = ATA_SHT_USE_CLUSTERING, ++ .proc_name = DRV_NAME, ++ .dma_boundary = ATA_DMA_BOUNDARY, ++ .slave_configure = ata_scsi_slave_config, ++ .bios_param = ata_std_bios_param, ++// .ordered_flush = 1, ++}; ++ ++static struct ata_port_operations ixp4xx_port_ops = { ++ .set_mode = ixp4xx_set_mode, ++ .mode_filter = ixp4xx_mode_filter, ++ ++ .port_disable = ata_port_disable, ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ ++ .qc_prep = ata_qc_prep, ++ .qc_issue = ata_qc_issue_prot, ++ .eng_timeout = ata_eng_timeout, ++ .data_xfer = ixp4xx_mmio_data_xfer, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ixp4xx_host_stop, ++ ++ .phy_reset = ixp4xx_phy_reset, ++}; ++ ++/* adjust the addresses to handle the address swizzling of the ++ * ixp4xx in little endian mode. ++ */ ++#ifndef __ARMEB__ ++void ixp4xx_fix_le_ports(struct ata_ioports *ioaddr) ++{ ++ ioaddr->data_addr ^= 0x02; ++ ioaddr->cmd_addr ^= 0x03; ++ ioaddr->altstatus_addr ^= 0x03; ++ ioaddr->ctl_addr ^= 0x03; ++ ioaddr->error_addr ^= 0x03; ++ ioaddr->feature_addr ^= 0x03; ++ ioaddr->nsect_addr ^= 0x03; ++ ioaddr->lbal_addr ^= 0x03; ++ ioaddr->lbam_addr ^= 0x03; ++ ioaddr->lbah_addr ^= 0x03; ++ ioaddr->device_addr ^= 0x03; ++ ioaddr->status_addr ^= 0x03; ++ ioaddr->command_addr ^= 0x03; ++} ++#endif ++ ++static __init int ixp4xx_init_one(unsigned long base, unsigned int irq) ++{ ++ int ret; ++ struct ata_probe_ent ae; ++ ++ memset(&ae, 0, sizeof(struct ata_probe_ent)); ++ INIT_LIST_HEAD(&ae.node); ++ ++ ae.mmio_base = ioremap(base, 0x1000); ++ if (ae.mmio_base == NULL) ++ return -ENOMEM; ++ ++ if (request_region(base, 0x1000, "pata_ixp4xx") == NULL) ++ return -EBUSY; ++ ++ ae.dev = NULL; ++ ae.port_ops = &ixp4xx_port_ops; ++ ae.sht = &ixp4xx_sht; ++ ae.n_ports = 1; ++ ae.pio_mask = IXP4XX_IDE_PIO_MASK; ++ ae.irq = irq; ++ ae.irq_flags = 0; ++ ae.host_flags = ATA_FLAG_IRQ_MASK | ATA_FLAG_MMIO; ++ ++ ae.port[0].cmd_addr = (unsigned long) ae.mmio_base; ++ ae.port[0].altstatus_addr = (unsigned long) ae.mmio_base + IXP4XX_IDE_CONTROL; ++ ae.port[0].ctl_addr = (unsigned long) ae.mmio_base + IXP4XX_IDE_CONTROL; ++ ata_std_ports(&ae.port[0]); ++ ++#ifndef __ARMEB__ ++ ixp4xx_fix_le_ports(&ae.port[0]); ++#endif ++ ret = ata_device_add(&ae); ++ if (ret == 0) ++ return -ENODEV; ++ ++ ixp4xx_host = ae.host_set; ++ return 0; ++} ++ ++static __init int ixp4xx_init(void) ++{ ++ gpio_line_config(IXP4XX_IDE_INT, IXP4XX_GPIO_IN | IXP4XX_GPIO_STYLE_ACTIVE_HIGH); ++ ++ *IXP4XX_EXP_CS1 |= IXP4XX_IDE_CS1_BITS; ++ ++ if (ixp4xx_init_one(IXP4XX_IDE_BASE, IXP4XX_IDE_INT) == 0) ++ return 0; ++ ++ return -ENODEV; ++} ++ ++static __exit void ixp4xx_exit(void) ++{ ++ if (ixp4xx_host) ++ ata_host_set_remove(ixp4xx_host); ++} ++ ++MODULE_AUTHOR("Alessandro Zummo"); ++MODULE_DESCRIPTION("low-level driver for ixp4xx CF/ATA"); ++MODULE_LICENSE("GPL"); ++MODULE_VERSION(DRV_VERSION); ++ ++module_init(ixp4xx_init); ++module_exit(ixp4xx_exit); +--- linux-ixp4xx.orig/drivers/scsi/libata-core.c 2006-02-24 18:13:55.000000000 +0100 ++++ linux-ixp4xx/drivers/scsi/libata-core.c 2006-02-24 18:16:46.000000000 +0100 +@@ -2513,8 +2513,8 @@ static void ata_dev_set_xfermode(struct + tf.nsect = dev->xfer_mode; + + if (ata_exec_internal(ap, dev, &tf, DMA_NONE, NULL, 0)) { +- printk(KERN_ERR "ata%u: failed to set xfermode, disabled\n", +- ap->id); ++ printk(KERN_ERR "ata%u: failed to set xfermode (0x%02x), disabled\n", ++ ap->id, dev->xfer_mode); + ata_port_disable(ap); + } + diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-buttons.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-buttons.patch new file mode 100644 index 0000000000..09129ac56a --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-buttons.patch @@ -0,0 +1,122 @@ +Index: linux-2.6.15/arch/arm/mach-ixp4xx/ds101-buttons.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/ds101-buttons.c 2006-02-23 08:40:28.000000000 +0100 +@@ -0,0 +1,117 @@ ++/* ++ * arch/arm/mach-ixp4xx/ds101-buttons.c ++ * ++ * DS101 Button driver ++ * ++ * 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/module.h> ++#include <linux/reboot.h> ++#include <linux/interrupt.h> ++#include <asm/mach-types.h> ++ ++extern void ctrl_alt_del(void); ++static int usbcopyb_irqcount = 0; ++static int resetb_irqcount = 0; ++static int powerb_irqcount = 0; ++ ++static irqreturn_t ds101_usbcopy_handler(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ usbcopyb_irqcount++; ++ if (usbcopyb_irqcount > 1) /* Init creates one IRQ. Ignore it */ ++ { ++ /* The GPIO line is shared between the button and the led. ++ * Make sure the GPIO is GPIO_OUT, so we don't recieve ++ * irqs from the led going on/off. Disable the irq just in ++ * case. ++ */ ++ gpio_line_config(DS101_USBCOPYB_IRQ, DS101_GPIO_OUT); ++ disable_irq(DS101_USBCOPYB_IRQ); ++ printk(KERN_INFO "Usbcopy\n"); ++ } ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t ds101_power_handler(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ powerb_irqcount++; ++ if (powerb_irqcount > 1) ++ { ++ /* Make the power led flash */ ++ gpio_line_set(DS101_POWER_LED, DS101_GPIO_HIGH); ++ ctrl_alt_del(); ++ } ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t ds101_reset_handler(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ resetb_irqcount++; ++ if (resetb_irqcount > 1) ++ { ++ machine_power_off(); ++ } ++ return IRQ_HANDLED; ++} ++ ++static int __init ds101_buttons_init(void) ++{ ++ if (!(machine_is_ds101())) ++ return 0; ++ printk(KERN_INFO "DiskStation DS101 button driver v0.2\n"); ++ gpio_line_config(DS101_POWERB_GPIO, (DS101_GPIO_IN|IRQT_FALLING)); ++ gpio_line_config(DS101_RESETB_GPIO, (DS101_GPIO_IN|IRQT_FALLING)); ++ gpio_line_config(DS101_USBCOPYB_GPIO, (DS101_GPIO_IN|IRQT_FALLING)); ++ set_irq_type(DS101_USBCOPYB_IRQ, IRQT_FALLING); ++ set_irq_type(DS101_POWERB_IRQ, IRQT_FALLING); ++ set_irq_type(DS101_RESETB_IRQ, IRQT_FALLING); ++ if (request_irq(DS101_USBCOPYB_IRQ, &ds101_usbcopy_handler, SA_INTERRUPT, ++ "DS101 USBCopy button", NULL) < 0) ++ { ++ printk(KERN_DEBUG "Could not get USBCopy button IRQ (%d)\n", ++ DS101_USBCOPYB_IRQ); ++ ++ return -EIO; ++ } ++ ++ if (request_irq(DS101_POWERB_IRQ, &ds101_power_handler, SA_INTERRUPT, ++ "DS101 Powerbutton", NULL) < 0) ++ { ++ printk(KERN_DEBUG "Could not get powerbutton IRQ (%d)\n", ++ DS101_POWERB_IRQ); ++ return -EIO; ++ } ++ ++ if (request_irq(DS101_RESETB_IRQ, &ds101_reset_handler, SA_INTERRUPT, ++ "DS101 Resetbutton", NULL) < 0) ++ { ++ printk(KERN_DEBUG "Could not get resetbutton IRQ (%d)\n", ++ DS101_RESETB_IRQ); ++ return -EIO; ++ } ++ return 0; ++} ++ ++static void __exit ds101_buttons_exit(void) ++{ ++ if (!(machine_is_ds101())) ++ return; ++ ++ disable_irq(DS101_USBCOPYB_IRQ); ++ disable_irq(DS101_POWERB_IRQ); ++ disable_irq(DS101_RESETB_IRQ); ++ free_irq(DS101_USBCOPYB_IRQ, NULL); ++ free_irq(DS101_POWERB_IRQ, NULL); ++ free_irq(DS101_RESETB_IRQ, NULL); ++} ++ ++module_init(ds101_buttons_init); ++module_exit(ds101_buttons_exit); ++ ++MODULE_AUTHOR("OEyvind Repvik <nail@nslu2-linux.org>"); ++MODULE_DESCRIPTION("DS101 Button driver"); ++MODULE_LICENSE("GPL"); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-doc.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-doc.patch new file mode 100644 index 0000000000..470c03ab56 --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-doc.patch @@ -0,0 +1,43 @@ +Index: linux-2.6.15/include/linux/mtd/doc2000.h +=================================================================== +--- linux-2.6.15.orig/include/linux/mtd/doc2000.h 2006-02-24 11:46:50.000000000 +0100 ++++ linux-2.6.15/include/linux/mtd/doc2000.h 2006-02-24 12:14:18.000000000 +0100 +@@ -73,14 +73,29 @@ + #define DoC_Mplus_Toggle 0x1046 + #define DoC_Mplus_DownloadStatus 0x1074 + #define DoC_Mplus_CtrlConfirm 0x1076 ++#ifdef CONFIG_MACH_DS101 ++#define DoC_Mplus_Power 0x1ffe ++#else + #define DoC_Mplus_Power 0x1fff ++#endif + + /* How to access the device? + * On ARM, it'll be mmap'd directly with 32-bit wide accesses. + * On PPC, it's mmap'd and 16-bit wide. ++ * On DS101 (an ARM device), some tricks are needed + * Others use readb/writeb + */ +-#if defined(__arm__) ++#ifdef CONFIG_MACH_DS101 ++#ifndef __ARMEB__ ++#define ReadDOC_(adr, reg) readw((unsigned long)(adr + reg) ^ 0x02) ++#define WriteDOC_(d, adr, reg) writew(d, (unsigned long)(adr + reg) ^ 0x02) ++#define DOC_IOREMAP_LEN 0x4000 ++#else ++#define ReadDOC_(adr, reg) swab16(readw((void __iomem *)(adr) + (reg))) ++#define WriteDOC_(d, adr, reg) writew(swab16(d), (void __iomem *)(adr) + (reg)) ++#define DOC_IOREMAP_LEN 0x4000 ++#endif ++#elif defined(__arm__) + #define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) + #define WriteDOC_(d, adr, reg) do{ *(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)) = (__u32)d; wmb();} while(0) + #define DOC_IOREMAP_LEN 0x8000 +@@ -92,7 +107,6 @@ + #define ReadDOC_(adr, reg) readb((void __iomem *)(adr) + (reg)) + #define WriteDOC_(d, adr, reg) writeb(d, (void __iomem *)(adr) + (reg)) + #define DOC_IOREMAP_LEN 0x2000 +- + #endif + + #if defined(__i386__) || defined(__x86_64__) diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-includes.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-includes.patch index d9a5f07494..3f94fab289 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-includes.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-includes.patch @@ -1,41 +1,15 @@ -diff -ruN linux-2.6.15.orig/include/asm-arm/arch-ixp4xx/hardware.h linux-2.6.15.new/include/asm-arm/arch-ixp4xx/hardware.h ---- linux-2.6.15.orig/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-11 02:58:47.000000000 +0100 -+++ linux-2.6.15.new/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-10 22:26:54.000000000 +0100 -@@ -46,5 +46,6 @@ - #include "prpmc1100.h" - #include "nslu2.h" - #include "nas100d.h" -+#include "ds101.h" + include/asm-arm/arch-ixp4xx/ds101.h | 87 +++++++++++++++++++++++++++++++++ + include/asm-arm/arch-ixp4xx/hardware.h | 1 + include/asm-arm/arch-ixp4xx/irqs.h | 7 ++ + 3 files changed, 95 insertions(+) - #endif /* _ASM_ARCH_HARDWARE_H */ -diff -ruN linux-2.6.15.orig/include/asm-arm/arch-ixp4xx/irqs.h linux-2.6.15.new/include/asm-arm/arch-ixp4xx/irqs.h ---- linux-2.6.15.orig/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-11 02:58:47.000000000 +0100 -+++ linux-2.6.15.new/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-10 22:56:11.000000000 +0100 -@@ -108,5 +108,12 @@ - #define IRQ_NAS100D_PCI_INTC IRQ_IXP4XX_GPIO9 - #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 - #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/ds101.h 2006-02-23 18:09:24.000000000 +0100 +@@ -0,0 +1,87 @@ +/* -+ * DS101 board IRQs -+ */ -+ -+#define IRQ_DS101_PCI_INTA IRQ_IXP4XX_GPIO11 -+#define IRQ_DS101_PCI_INTB IRQ_IXP4XX_GPIO10 -+#define IRQ_DS101_PCI_INTC IRQ_IXP4XX_GPIO9 - - #endif -diff -ruN linux-2.6.15.orig/include/asm-arm/arch/ds101.h linux-2.6.15.new/include/asm-arm/arch/ds101.h ---- linux-2.6.15.orig/include/asm-arm/arch-ixp4xx/ds101.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.15.new/include/asm-arm/arch-ixp4xx/ds101.h 2006-02-10 22:16:24.000000000 +0100 -@@ -0,0 +1,72 @@ -+/* -+ * include/asm-arm/arch-ixp4xx/ds101.h -+ * + * DS101 platform specific definitions + * -+ * Copyright (c) 2005 Tower Technologies -+ * -+ * Author: Alessandro Zummo <a.zummo@towertech.it> ++ * Author: Øyvind Repvik <nail@nslu2-linux.org> + * + * based on ixdp425.h: + * Copyright 2004 (c) MontaVista, Software, Inc. @@ -49,23 +23,37 @@ diff -ruN linux-2.6.15.orig/include/asm-arm/arch/ds101.h linux-2.6.15.new/includ +#error "Do not include this directly, instead #include <asm/hardware.h>" +#endif + -+#define DS101_SDA_PIN 1 -+#define DS101_SCL_PIN 0 ++#define DS101_SCL_PIN DS101_GPIO0 ++#define DS101_SDA_PIN DS101_GPIO1 ++#define DS101_GPIO_BUZZ DS101_GPIO2 ++#define DS101_POWER_LED DS101_GPIO3 ++#define DS101_USBCOPYB_GPIO DS101_GPIO4 ++#define DS101_USBCOPY_SOLID_LED DS101_GPIO4 /* The led and button share GPIO */ ++#define DS101_USBCOPY_BLINK_LED DS101_GPIO5 ++/* GPIO6 is unknown */ ++#define DS101_POWEROFF_GPIO DS101_GPIO7 ++#define DS101_POWERB_GPIO DS101_GPIO8 ++#define DS101_PCI_INTC_PIN DS101_GPIO9 ++#define DS101_PCI_INTB_PIN DS101_GPIO10 ++#define DS101_PCI_INTA_PIN DS101_GPIO11 ++#define DS101_RESETB_GPIO DS101_GPIO12 ++#define DS101_STATUSOK_LED DS101_GPIO14 ++#define DS101_STATUSBAD_LED DS101_GPIO15 + -+/* -+ * DS101 PCI IRQs -+ */ -+#define DS101_PCI_MAX_DEV 3 -+#define DS101_PCI_IRQ_LINES 3 ++#define DS101_PCI_MAX_DEV 2 ++#define DS101_PCI_IRQ_LINES 3 + ++#define DS101_POWERB_IRQ IRQ_IXP4XX_GPIO8 ++#define DS101_RESETB_IRQ IRQ_IXP4XX_GPIO12 ++#define DS101_USBCOPYB_IRQ IRQ_IXP4XX_GPIO4 + -+/* PCI controller GPIO to IRQ pin mappings */ -+#define DS101_PCI_INTA_PIN 11 -+#define DS101_PCI_INTB_PIN 10 -+#define DS101_PCI_INTC_PIN 9 -+// #define DS101_PCI_INTD_PIN 8 -+// #define DS101_PCI_INTE_PIN 7 ++#define DS101_GPIO_IN IXP4XX_GPIO_IN ++#define DS101_GPIO_OUT IXP4XX_GPIO_OUT ++#define DS101_GPIO_HIGH 1 ++#define DS101_GPIO_LOW 0 + ++#define DS101_GPIO_CLK0_ENABLE 0x100 ++#define DS101_GPIO_CLK1_ENABLE 0x1000000 +/* GPIO */ + +#define DS101_GPIO0 0 @@ -85,18 +73,48 @@ diff -ruN linux-2.6.15.orig/include/asm-arm/arch/ds101.h linux-2.6.15.new/includ +#define DS101_GPIO14 14 +#define DS101_GPIO15 15 + ++/* Stuff needed to setup the IXP expansion ++ * bus on the DS101 ++ */ + -+/* Buttons */ -+ -+#define DS101_PB_GPIO DS101_GPIO8 -+#define DS101_RB_GPIO DS101_GPIO12 -+#define DS101_PO_GPIO DS101_GPIO7 /* power off */ ++#define DS101_EXP_RECOVERY_T(x) (((x) & 15) << 16) ++#define DS101_EXP_HOLD_T(x) (((x) & 3) << 20) ++#define DS101_EXP_STROBE_T(x) (((x) & 15) << 22) ++#define DS101_EXP_SETUP_T(x) (((x) & 3) << 26) ++#define DS101_EXP_ADDR_T(x) (((x) & 3) << 28) + -+#define DS101_PB_IRQ IRQ_IXP4XX_GPIO8 -+#define DS101_RB_IRQ IRQ_IXP4XX_GPIO12 ++#define DS101_EXP_SZ_16M (15 << 10) ++#define DS101_EXP_WR_EN (1 << 1) ++#define DS101_EXP_BYTE_RD16 (1 << 6) ++#define DS101_EXP_CS_EN (1 << 31) + ++#define DS101_EXP_CS0_INIT (DS101_EXP_ADDR_T(1) | \ ++ DS101_EXP_SETUP_T(1) | DS101_EXP_STROBE_T(1) | \ ++ DS101_EXP_HOLD_T(1) | DS101_EXP_RECOVERY_T(1)| \ ++ DS101_EXP_SZ_16M | DS101_EXP_WR_EN | \ ++ DS101_EXP_BYTE_RD16 | DS101_EXP_CS_EN) +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-23 18:09:14.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/hardware.h 2006-02-23 18:09:48.000000000 +0100 +@@ -47,5 +47,6 @@ extern unsigned int processor_id; + #include "nslu2.h" + #include "nas100d.h" + #include "dsmg600.h" ++#include "ds101.h" + + #endif /* _ASM_ARCH_HARDWARE_H */ +--- linux-ixp4xx.orig/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-23 18:09:14.000000000 +0100 ++++ linux-ixp4xx/include/asm-arm/arch-ixp4xx/irqs.h 2006-02-23 18:09:24.000000000 +0100 +@@ -108,6 +108,13 @@ + #define IRQ_NAS100D_PCI_INTC IRQ_IXP4XX_GPIO9 + #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 + #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 +/* -+#define DS101_PB_BM (1L << DS101_PB_GPIO) -+#define DS101_PO_BM (1L << DS101_PO_GPIO) -+#define DS101_RB_BM (1L << DS101_RB_GPIO) -+*/ ++ * DS101 board IRQs ++ */ ++ ++#define IRQ_DS101_PCI_INTA IRQ_IXP4XX_GPIO11 ++#define IRQ_DS101_PCI_INTB IRQ_IXP4XX_GPIO10 ++#define IRQ_DS101_PCI_INTC IRQ_IXP4XX_GPIO9 + + /* + * D-Link DSM-G600 board IRQs diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-misc.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-misc.patch deleted file mode 100644 index ea5f91b45f..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-misc.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/Makefile linux-2.6.15.new/arch/arm/mach-ixp4xx/Makefile ---- linux-2.6.15.orig/arch/arm/mach-ixp4xx/Makefile 2006-02-11 02:57:58.000000000 +0100 -+++ linux-2.6.15.new/arch/arm/mach-ixp4xx/Makefile 2006-02-10 22:13:27.000000000 +0100 -@@ -10,4 +10,4 @@ - obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o gtwx5715-setup.o - obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o - obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o -- -+obj-$(CONFIG_MACH_DS101) += ds101-pci.o ds101-setup.o ds101-power.o -diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/Kconfig linux-2.6.15.new/arch/arm/mach-ixp4xx/Kconfig ---- linux-2.6.15.orig/arch/arm/mach-ixp4xx/Kconfig 2006-02-11 03:00:07.000000000 +0100 -+++ linux-2.6.15.new/arch/arm/mach-ixp4xx/Kconfig 2006-02-10 22:21:09.000000000 +0100 -@@ -86,6 +86,14 @@ - NAS 100d device. For more information on this platform, - see http://www.nslu2-linux.org/wiki/NAS100d/HomePage - -+config MACH_DS101 -+ bool -+ prompt "DS101" -+ help -+ Say 'Y' here if you want your kernel to support Synology's -+ DiskStation DS101(j) device. For more information on this -+ platform see http://www.nslu2-linux.org/wiki/DS101/HomePage -+ - # - # Avila and IXDP share the same source for now. Will change in future - # diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-pci.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-pci.patch index 8940bd63a6..48765e3017 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-pci.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-pci.patch @@ -1,10 +1,10 @@ -diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-pci.c linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-pci.c ---- linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-pci.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-pci.c 2006-02-10 22:31:00.000000000 +0100 -@@ -0,0 +1,69 @@ + arch/arm/mach-ixp4xx/ds101-pci.c | 66 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 66 insertions(+) + +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/arch/arm/mach-ixp4xx/ds101-pci.c 2006-02-21 02:02:34.000000000 +0100 +@@ -0,0 +1,66 @@ +/* -+ * arch/arm/mach-ixp4xx/ds101-pci.c -+ * + * DS101 board-level PCI initialization + * + * based on ixdp425-pci.c: @@ -40,8 +40,7 @@ diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-pci.c linux-2.6.15.new/ar + static int pci_irq_table[DS101_PCI_MAX_DEV][DS101_PCI_IRQ_LINES] = + { + { IRQ_DS101_PCI_INTA, -1, -1 }, -+ { IRQ_DS101_PCI_INTB, -1, -1 }, -+ { IRQ_DS101_PCI_INTC, -1, -1 }, ++ { IRQ_DS101_PCI_INTB, IRQ_DS101_PCI_INTB, IRQ_DS101_PCI_INTC }, + }; + + int irq = -1; diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-power.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-power.patch deleted file mode 100644 index 3c309f3536..0000000000 --- a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-power.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-power.c linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-power.c ---- linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-power.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-power.c 2006-02-10 23:54:40.000000000 +0100 -@@ -0,0 +1,71 @@ -+/* -+ * arch/arm/mach-ixp4xx/ds101-power.c -+ * -+ * DS101 Power/Reset driver -+ * -+ * Copyright (C) 2005 Tower Technologies -+ * -+ * based on ds101-io.c -+ * Copyright (C) 2004 Karen Spearel -+ * -+ * Author: Alessandro Zummo <a.zummo@towertech.it> -+ * Author: OEyvind Repvik <oyvind@repvik.org> -+ * Maintainers: http://www.nslu2-linux.org/ -+ * -+ * 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/module.h> -+#include <linux/reboot.h> -+#include <linux/interrupt.h> -+ -+#include <asm/mach-types.h> -+ -+extern void ctrl_alt_del(void); -+ -+static irqreturn_t ds101_reset_handler(int irq, void *dev_id, struct pt_regs *regs) -+{ -+ /* Signal init to do the ctrlaltdel action, this will bypass init if -+ * it hasn't started and do a kernel_restart. -+ */ -+ ctrl_alt_del(); -+ -+ return IRQ_HANDLED; -+} -+ -+static int __init ds101_power_init(void) -+{ -+ if (!(machine_is_ds101())) -+ return 0; -+ -+ set_irq_type(DS101_RB_IRQ, IRQT_LOW); -+ -+ if (request_irq(DS101_RB_IRQ, &ds101_reset_handler, -+ SA_INTERRUPT, "DS101 reset button", NULL) < 0) { -+ -+ printk(KERN_DEBUG "Reset Button IRQ %d not available\n", -+ DS101_RB_IRQ); -+ -+ return -EIO; -+ } -+ -+ return 0; -+} -+ -+static void __exit ds101_power_exit(void) -+{ -+ if (!(machine_is_ds101())) -+ return; -+ -+ free_irq(DS101_RB_IRQ, NULL); -+} -+ -+module_init(ds101_power_init); -+module_exit(ds101_power_exit); -+ -+MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); -+MODULE_DESCRIPTION("DS101 Power/Reset driver"); -+MODULE_LICENSE("GPL"); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-setup.patch b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-setup.patch index ac3f7d19c7..5c922d2934 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-setup.patch +++ b/packages/linux/ixp4xx-kernel/2.6.16/97-ds101-setup.patch @@ -1,11 +1,21 @@ -diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-setup.c linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-setup.c ---- linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-setup.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.15.new/arch/arm/mach-ixp4xx/ds101-setup.c 2006-02-11 02:17:35.000000000 +0100 -@@ -0,0 +1,284 @@ +Board setup code for the Synology DS101 platform + +Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> +Signed-off-by: Rod Whitby <rod@whitby.id.au> +Signed-off-by: OEyvind Repvik <oyvind@repvik.org> + + arch/arm/mach-ixp4xx/Kconfig | 8 + + arch/arm/mach-ixp4xx/Makefile | 2 + arch/arm/mach-ixp4xx/ds101-setup.c | 245 +++++++++++++++++++++++++++++++++++++ + 3 files changed, 254 insertions(+), 1 deletion(-) + +Index: linux-2.6.15/arch/arm/mach-ixp4xx/ds101-setup.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/ds101-setup.c 2006-02-24 12:37:01.000000000 +0100 +@@ -0,0 +1,245 @@ +/* -+ * arch/arm/mach-ixp4xx/ds101-setup.c -+ * -+ * DS 101 board-setup ++ * Synology DS101 board setup + * + * based ixdp425-setup.c: + * Copyright (C) 2003-2004 MontaVista Software, Inc. @@ -20,8 +30,8 @@ diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-setup.c linux-2.6.15.new/ +#include <linux/kernel.h> +#include <linux/serial.h> +#include <linux/serial_8250.h> -+#include <linux/mtd/mtd.h> +#include <linux/leds.h> ++#include <linux/pci.h> + +#include <asm/setup.h> +#include <asm/memory.h> @@ -29,260 +39,252 @@ diff -ruN linux-2.6.15.orig/arch/arm/mach-ixp4xx/ds101-setup.c linux-2.6.15.new/ +#include <asm/mach/arch.h> +#include <asm/mach/flash.h> + ++#ifdef CONFIG_MACLIST +#include <net/maclist.h> -+ -+static struct flash_platform_data ds101_flash_data = { -+ .map_name = "cfi_probe", -+ .width = 2, -+}; -+ -+static struct resource ds101_flash_resource = { -+ .flags = IORESOURCE_MEM, -+}; -+ -+static struct platform_device ds101_flash = { -+ .name = "IXP4XX-Flash", -+ .id = 0, -+ .dev.platform_data = &ds101_flash_data, -+ .num_resources = 1, -+ .resource = &ds101_flash_resource, -+}; ++#endif + +#ifdef CONFIG_LEDS_CLASS +static struct resource ds101_led_resources[] = { -+ { -+ .name = "power", /* blue power led */ -+ .start = 3, -+ .end = 3, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+ { -+ .name = "status-1", -+ .start = 14, -+ .end = 14, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+ { -+ .name = "status-2", -+ .start = 15, -+ .end = 15, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+ { -+ .name = "usb-1", /* The usb-copy-button led */ -+ .start = 5, -+ .end = 5, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+ { -+ .name = "usb-2", /* also the usb-copy-button led */ -+ .start = 4, -+ .end = 4, -+ .flags = IXP4XX_GPIO_LOW, -+ }, -+ { -+ .name = "test", -+ .start = 6, -+ .end = 6, -+ .flags = IXP4XX_GPIO_LOW, -+ }, ++ { ++ .name = "power", ++ .start = DS101_POWER_LED, ++ .end = DS101_POWER_LED, ++ .flags = IXP4XX_GPIO_LOW, ++ }, ++ { ++ .name = "usbcopy-solid", ++ .start = DS101_USBCOPY_SOLID_LED, ++ .end = DS101_USBCOPY_SOLID_LED, ++ .flags = IXP4XX_GPIO_LOW, ++ }, ++ { ++ .name = "usbcopy-blink", ++ .start = DS101_USBCOPY_BLINK_LED, ++ .end = DS101_USBCOPY_BLINK_LED, ++ .flags = IXP4XX_GPIO_LOW, ++ }, ++ { ++ .name = "status-ready", ++ .start = DS101_STATUSOK_LED, ++ .end = DS101_STATUSOK_LED, ++ .flags = IXP4XX_GPIO_LOW, ++ }, ++ { ++ .name = "status-error", ++ .start = DS101_STATUSBAD_LED, ++ .start = DS101_STATUSBAD_LED, ++ .flags = IXP4XX_GPIO_LOW, ++ } +}; + + +static struct platform_device ds101_leds = { -+ .name = "IXP4XX-GPIO-LED", -+ .id = -1, -+ .num_resources = ARRAY_SIZE(ds101_led_resources), -+ .resource = ds101_led_resources, ++ .name = "IXP4XX-GPIO-LED", ++ .id = -1, ++ .num_resources = ARRAY_SIZE(ds101_led_resources), ++ .resource = ds101_led_resources, +}; +#endif + +static struct ixp4xx_i2c_pins ds101_i2c_gpio_pins = { -+ .sda_pin = DS101_SDA_PIN, -+ .scl_pin = DS101_SCL_PIN, ++ .sda_pin = DS101_SDA_PIN, ++ .scl_pin = DS101_SCL_PIN, +}; + +static struct platform_device ds101_i2c_controller = { -+ .name = "IXP4XX-I2C", -+ .id = 0, -+ .dev.platform_data = &ds101_i2c_gpio_pins, -+ .num_resources = 0, ++ .name = "IXP4XX-I2C", ++ .id = 0, ++ .dev.platform_data = &ds101_i2c_gpio_pins, ++ .num_resources = 0, +}; + +static struct platform_device ds101_beeper = { -+ .name = "ixp4xx-beeper", -+ .id = 2, -+ .num_resources = 0, ++ .name = "ixp4xx-beeper", ++ .id = DS101_GPIO_BUZZ, ++ .num_resources = 0, +}; + +static struct resource ds101_uart_resources[] = { -+ { -+ .start = IXP4XX_UART1_BASE_PHYS, -+ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = IXP4XX_UART2_BASE_PHYS, -+ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, -+ .flags = IORESOURCE_MEM, -+ } ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } +}; + +static struct plat_serial8250_port ds101_uart_data[] = { -+ { -+ .mapbase = IXP4XX_UART1_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART1, -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { -+ .mapbase = IXP4XX_UART2_BASE_PHYS, -+ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, -+ .irq = IRQ_IXP4XX_UART2, -+ .flags = UPF_BOOT_AUTOCONF, -+ .iotype = UPIO_MEM, -+ .regshift = 2, -+ .uartclk = IXP4XX_UART_XTAL, -+ }, -+ { } ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { } +}; + +static struct platform_device ds101_uart = { -+ .name = "serial8250", -+ .id = PLAT8250_DEV_PLATFORM, -+ .dev.platform_data = ds101_uart_data, -+ .num_resources = 2, -+ .resource = ds101_uart_resources, ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = ds101_uart_data, ++ .num_resources = 2, ++ .resource = ds101_uart_resources, +}; + +static struct platform_device *ds101_devices[] __initdata = { -+ &ds101_i2c_controller, -+ &ds101_flash, -+ &ds101_beeper, ++ &ds101_i2c_controller, ++ &ds101_beeper, +}; + +static void ds101_power_off(void) +{ -+ /* This causes the box to drop the power and go dead. */ -+ -+ /* enable the pwr cntl gpio */ -+ gpio_line_config(DS101_PO_GPIO, IXP4XX_GPIO_OUT); -+ -+ /* do the deed */ -+ gpio_line_set(DS101_PO_GPIO, IXP4XX_GPIO_HIGH); ++ /* Simple, but effective */ ++ gpio_line_set(DS101_POWEROFF_GPIO, IXP4XX_GPIO_LOW); +} + -+/* -+ * When the RedBoot config partition is added the MAC address is read from -+ * it. -+ * FIXME: This isn't correct on the DS101! -+ */ -+static void ds101_flash_add(struct mtd_info *mtd) { -+ if (strcmp(mtd->name, "RedBoot config") == 0) { -+ size_t retlen; -+ u_char mac[6]; -+ -+ /* The MAC is at a known offset... */ -+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) { -+ printk(KERN_INFO "DS101 MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", -+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); -+ maclist_add(mac); -+ } else { -+ printk(KERN_ERR "DS101 MAC: read failed\n"); -+ } -+ } -+} -+ -+/* -+ * Nothing to do on remove at present. -+ */ -+static void ds101_flash_remove(struct mtd_info *mtd) { -+} ++static void ds101_gpio_setup(void) ++{ ++ /* Set up buzzer */ ++ gpio_line_config(DS101_GPIO_BUZZ, DS101_GPIO_OUT); ++ gpio_line_set(DS101_GPIO_BUZZ, DS101_GPIO_LOW); ++ ++ /* Set up power led */ ++ gpio_line_config(DS101_POWER_LED, DS101_GPIO_OUT); ++ gpio_line_set(DS101_POWER_LED, DS101_GPIO_LOW); ++ ++ /* Poweroff */ ++ gpio_line_config(DS101_POWEROFF_GPIO, DS101_GPIO_OUT); ++ gpio_line_set(DS101_POWEROFF_GPIO, DS101_GPIO_HIGH); ++ ++ /* Status leds */ ++ (*IXP4XX_GPIO_GPCLKR) = ((*IXP4XX_GPIO_GPCLKR) & ~DS101_GPIO_CLK0_ENABLE); ++ (*IXP4XX_GPIO_GPCLKR) = ((*IXP4XX_GPIO_GPCLKR) & ~DS101_GPIO_CLK1_ENABLE); ++ gpio_line_config(DS101_STATUSOK_LED, DS101_GPIO_OUT); ++ gpio_line_config(DS101_STATUSBAD_LED, DS101_GPIO_OUT); ++ gpio_line_set(DS101_STATUSOK_LED, DS101_GPIO_HIGH); ++ gpio_line_set(DS101_STATUSBAD_LED, DS101_GPIO_LOW); ++}; + -+static struct mtd_notifier ds101_flash_notifier = { -+ .add = ds101_flash_add, -+ .remove = ds101_flash_remove, ++static void ds101_cs0_setup(void) ++{ ++ *IXP4XX_EXP_CS0 = DS101_EXP_CS0_INIT; +}; + +static void __init ds101_init(void) +{ -+ /* The flash has an ethernet MAC embedded in it which we need, -+ * that is all this notifier does. -+ */ -+ register_mtd_user(&ds101_flash_notifier); -+ -+ ixp4xx_sys_init(); ++ ixp4xx_sys_init(); + -+ ds101_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); -+ ds101_flash_resource.end = -+ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ds101_cs0_setup(); /* Needed for DoC support */ ++ ds101_gpio_setup(); ++ pm_power_off = ds101_power_off; + -+ pm_power_off = ds101_power_off; ++ platform_add_devices(ds101_devices, ARRAY_SIZE(ds101_devices)); + -+ /* This is only useful on a modified machine, but it is valuable -+ * to have it first in order to see debug messages, and so that -+ * it does *not* get removed if platform_add_devices fails! -+ */ -+ (void)platform_device_register(&ds101_uart); -+ -+ platform_add_devices(ds101_devices, ARRAY_SIZE(ds101_devices)); ++ /* This is only useful on a modified machine, but it is valuable ++ * to have it first in order to see debug messages, and so that ++ * it does *not* get removed if platform_add_devices fails! ++ */ ++ (void)platform_device_register(&ds101_uart); + +#ifdef CONFIG_LEDS_CLASS -+ /* We don't care whether or not this works. */ -+ (void)platform_device_register(&ds101_leds); ++ /* We don't care whether or not this works. */ ++ (void)platform_device_register(&ds101_leds); +#endif +} + +/* + * DS101 bootstrap may pass in parameters, but we zap the mem -+ * settings to be safe (the box always has 64MByte at 0). The -+ * passed in command line can override this default, we prepend -+ * to the config'ed default. ++ * settings to be safe (DS101 always has 64MByte at 0, DS101J has ++ * 32MB). The passed in command line can override this default, we ++ * prepend to the config'ed default. + * + * NOTE: the startup sequence is: + * 1) Call the machine fixup + * 2) Parse the ATAG list, the ATAG_CMDLINE is copied in -+ * to default_command_line which is the value of *from ++ * to default_command_line which is the value of *from + * 3) Parse the command line in *from (*not* -+ * default_command_line unless they are the same!) ++ * default_command_line unless they are the same!) + * + * Setting mi->nr_banks causes (2) to 'squash' (set to ATAG_NONE) + * any ATAG_MEM tags, but mem= command line options cause nr_banks + * to be reset to 0 (on the first mem=) + */ ++ +static char ds101_command_line[] __initdata = -+ "root=/dev/sda1 rootfstype=ext3 init=/sbin/init " -+ CONFIG_CMDLINE; ++ "root=/dev/sda2 rootfstype=ext3 init=/sbin/init " ++ "rtc-rs5c372.probe=0,0x32 " ++ CONFIG_CMDLINE; + +static void __init ds101_fixup(struct machine_desc *desc, -+ struct tag *tags, char **cmdline, struct meminfo *mi) ++ struct tag *tags, char **cmdline, struct meminfo *mi) +{ -+ /* The DS101 has one bank of 64MByte memory. -+ * NOTE: setting nr_banks != 0 causes kernel/setup.c to remove -+ * the mem tags from the tag list. We need do nothing here! -+ */ -+ mi->nr_banks=1; -+ mi->bank[0].start = 0; -+ mi->bank[0].size = (64*1024*1024); -+ mi->bank[0].node = PHYS_TO_NID(0); -+ -+ /* A command line in the ATAG list will override this one, -+ * as is intended. -+ */ -+ strlcpy(*cmdline, ds101_command_line, COMMAND_LINE_SIZE); ++ /* The DS101 has one bank of 64MByte memory. ++ * NOTE: setting nr_banks != 0 causes kernel/setup.c to remove ++ * the mem tags from the tag list. We need do nothing here! ++ */ ++ mi->nr_banks=1; ++ mi->bank[0].start = 0; ++ mi->bank[0].size = (64*1024*1024); ++ mi->bank[0].node = PHYS_TO_NID(0); ++ /* A command line in the ATAG list will override this one, ++ * as is intended. ++ */ ++ strlcpy(*cmdline, ds101_command_line, COMMAND_LINE_SIZE); +} + +MACHINE_START(DS101, "Synology DiskStation DS101") -+ /* Maintainer: www.nslu2-linux.org */ -+ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, -+ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, -+ .boot_params = 0x00000100, -+ .fixup = ds101_fixup, -+ .map_io = ixp4xx_map_io, -+ .init_irq = ixp4xx_init_irq, -+ .timer = &ixp4xx_timer, -+ .init_machine = ds101_init, ++ /* Maintainer: www.nslu2-linux.org */ ++ .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS, ++ .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC, ++ .boot_params = 0x00000100, ++ .fixup = ds101_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .timer = &ixp4xx_timer, ++ .init_machine = ds101_init, +MACHINE_END +Index: linux-2.6.15/arch/arm/mach-ixp4xx/Kconfig +=================================================================== +--- linux-2.6.15.orig/arch/arm/mach-ixp4xx/Kconfig 2006-02-24 11:44:49.000000000 +0100 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/Kconfig 2006-02-24 11:44:49.000000000 +0100 +@@ -94,6 +94,14 @@ + DSM-G600 device. For more information on this platform, + see http://www.nslu2-linux.org/ + ++config MACH_DS101 ++ bool ++ prompt "DS101" ++ help ++ Say 'Y' here if you want your kernel to support Synology's ++ DiskStation DS101(j) device. For more information on this ++ platform see http://www.nslu2-linux.org/wiki/DS101/HomePage ++ + # + # Avila and IXDP share the same source for now. Will change in future + # +Index: linux-2.6.15/arch/arm/mach-ixp4xx/Makefile +=================================================================== +--- linux-2.6.15.orig/arch/arm/mach-ixp4xx/Makefile 2006-02-24 11:44:48.000000000 +0100 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/Makefile 2006-02-24 11:44:49.000000000 +0100 +@@ -11,4 +11,4 @@ + obj-$(CONFIG_MACH_NSLU2) += nslu2-pci.o nslu2-setup.o nslu2-power.o + obj-$(CONFIG_MACH_NAS100D) += nas100d-pci.o nas100d-setup.o nas100d-power.o + obj-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o dsmg600-setup.o +- ++obj-$(CONFIG_MACH_DS101) += ds101-pci.o ds101-setup.o ds101-buttons.o diff --git a/packages/linux/ixp4xx-kernel/2.6.16/defconfig b/packages/linux/ixp4xx-kernel/2.6.16/defconfig index 0862199528..014ff73135 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/defconfig +++ b/packages/linux/ixp4xx-kernel/2.6.16/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.16-rc2 -# Thu Feb 9 23:00:47 2006 +# Linux kernel version: 2.6.16-rc4-git7 +# Fri Feb 24 22:40:39 2006 # CONFIG_ARM=y CONFIG_MMU=y @@ -12,7 +12,6 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y # Code maturity level options # CONFIG_EXPERIMENTAL=y -CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 @@ -37,7 +36,7 @@ CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y -# CONFIG_BASE_FULL is not set +CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y @@ -47,7 +46,7 @@ CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set -CONFIG_BASE_SMALL=1 +CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set CONFIG_OBSOLETE_INTERMODULE=y @@ -124,6 +123,7 @@ CONFIG_ARCH_IXDP425=y CONFIG_ARCH_IXCDP1100=y # CONFIG_ARCH_PRPMC1100 is not set CONFIG_MACH_NAS100D=y +CONFIG_MACH_DSMG600=y CONFIG_MACH_DS101=y CONFIG_ARCH_IXDP4XX=y # CONFIG_MACH_GTWX5715 is not set @@ -220,6 +220,7 @@ CONFIG_NET=y # # Networking options # +# CONFIG_NETDEBUG is not set CONFIG_PACKET=m CONFIG_PACKET_MMAP=y CONFIG_UNIX=y @@ -470,7 +471,8 @@ CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set -# CONFIG_NFTL is not set +CONFIG_NFTL=y +CONFIG_NFTL_RW=y # CONFIG_INFTL is not set # CONFIG_RFD_FTL is not set @@ -504,7 +506,6 @@ CONFIG_MTD_CFI_UTIL=y # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set # CONFIG_MTD_OBSOLETE_CHIPS is not set -# CONFIG_MTD_XIP is not set # # Mapping drivers for chip access @@ -540,8 +541,9 @@ CONFIG_MTD_NAND=y CONFIG_MTD_NAND_VERIFY_WRITE=y CONFIG_MTD_NAND_IDS=y CONFIG_MTD_NAND_DISKONCHIP=y -# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set -CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0 +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y +CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0x50000000 +# CONFIG_MTD_NAND_DISKONCHIP_PROBE_HIGH is not set # CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set # CONFIG_MTD_NAND_NANDSIM is not set @@ -669,10 +671,12 @@ CONFIG_SCSI_PATA_ARTOP=y # CONFIG_SCSI_PATA_LEGACY is not set # CONFIG_SCSI_PATA_MPIIX is not set # CONFIG_SCSI_PATA_NETCELL is not set +# CONFIG_SCSI_PATA_NS87410 is not set # CONFIG_SCSI_PATA_OLDPIIX is not set # CONFIG_SCSI_PATA_OPTI is not set -# CONFIG_SCSI_PATA_PCMCIA is not set +# CONFIG_SCSI_PATA_PDC_OLD is not set # CONFIG_SCSI_PATA_QDI is not set +# CONFIG_SCSI_PATA_RADISYS is not set # CONFIG_SCSI_PATA_RZ1000 is not set # CONFIG_SCSI_PATA_SC1200 is not set # CONFIG_SCSI_PATA_SERVERWORKS is not set @@ -681,6 +685,7 @@ CONFIG_SCSI_PATA_ARTOP=y # CONFIG_SCSI_PATA_TRIFLEX is not set # CONFIG_SCSI_PATA_VIA is not set # CONFIG_SCSI_PATA_WINBOND is not set +CONFIG_SCSI_PATA_IXP4XX=y # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_IPS is not set @@ -917,7 +922,7 @@ CONFIG_INPUT_IXP4XX_BEEPER=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=2 -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 # CONFIG_SERIAL_8250_EXTENDED is not set # @@ -925,6 +930,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=1 # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=16 @@ -957,7 +963,6 @@ CONFIG_IXP4XX_WATCHDOG=y # # CONFIG_USBPCWATCHDOG is not set # CONFIG_NVRAM is not set -# CONFIG_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -1023,9 +1028,7 @@ CONFIG_SENSORS_EEPROM=y # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set -# CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set -# CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set @@ -1040,7 +1043,7 @@ CONFIG_SENSORS_EEPROM=y # # Hardware Monitoring support # -CONFIG_HWMON=y +CONFIG_HWMON=m # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set @@ -1050,6 +1053,7 @@ CONFIG_HWMON=y # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_F71805F is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_FSCPOS is not set # CONFIG_SENSORS_GL518SM is not set @@ -1077,6 +1081,7 @@ CONFIG_HWMON=y # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # CONFIG_SENSORS_W83627EHF is not set +CONFIG_SENSORS_AD741X=m # CONFIG_HWMON_DEBUG_CHIP is not set # @@ -1135,7 +1140,7 @@ CONFIG_VIDEO_CX88_ALSA=m # CONFIG_VIDEO_EM28XX is not set CONFIG_VIDEO_OVCAMCHIP=m # CONFIG_VIDEO_AUDIO_DECODER is not set -# CONFIG_VIDEO_DECODER is not set +CONFIG_VIDEO_DECODER=m # # Radio Adapters @@ -1277,7 +1282,7 @@ CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y -# CONFIG_USB_UHCI_HCD is not set +CONFIG_USB_UHCI_HCD=y # CONFIG_USB_SL811_HCD is not set # @@ -1469,6 +1474,7 @@ CONFIG_RTC_INTF_DEV=y CONFIG_RTC_DRV_X1205=y CONFIG_RTC_DRV_DS1672=y CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_RS5C372=y # CONFIG_RTC_DRV_TEST is not set # @@ -1596,7 +1602,7 @@ CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set -CONFIG_CODA_FS=m +# CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set diff --git a/packages/linux/ixp4xx-kernel/2.6.16/leds-class.patch b/packages/linux/ixp4xx-kernel/2.6.16/leds-class.patch new file mode 100644 index 0000000000..4eaab3070e --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.16/leds-class.patch @@ -0,0 +1,1835 @@ +Add the foundations of a new LEDs subsystem. This patch adds a class +which presents LED devices within sysfs and allows their brightness to +be controlled. + +Signed-off-by: Richard Purdie <rpurdie@rpsys.net> + +--- + arch/arm/Kconfig | 2 + arch/arm/mach-pxa/corgi.c | 10 + + arch/arm/mach-pxa/spitz.c | 10 + + arch/arm/mach-pxa/tosa.c | 9 + + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/ide/ide-disk.c | 17 ++ + drivers/leds/Kconfig | 70 +++++++++++ + drivers/leds/Makefile | 15 ++ + drivers/leds/led-class.c | 164 +++++++++++++++++++++++++++ + drivers/leds/led-core.c | 24 ++++ + drivers/leds/led-triggers.c | 236 ++++++++++++++++++++++++++++++++++++++++ + drivers/leds/leds-corgi.c | 121 ++++++++++++++++++++ + drivers/leds/leds-ixp4xx-gpio.c | 209 +++++++++++++++++++++++++++++++++++ + drivers/leds/leds-locomo.c | 91 +++++++++++++++ + drivers/leds/leds-spitz.c | 125 +++++++++++++++++++++ + drivers/leds/leds-tosa.c | 123 ++++++++++++++++++++ + drivers/leds/leds.h | 36 ++++++ + drivers/leds/ledtrig-timer.c | 205 ++++++++++++++++++++++++++++++++++ + drivers/mtd/nand/nand_base.c | 26 ++++ + include/linux/leds.h | 97 ++++++++++++++++ + 21 files changed, 1590 insertions(+), 3 deletions(-) + +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/Kconfig 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,70 @@ ++ ++menu "LED devices" ++ ++config NEW_LEDS ++ bool "LED Support" ++ help ++ Say Y to enable Linux LED support. This is not related to standard ++ keyboard LEDs which are controlled via the input system. ++ ++config LEDS_CLASS ++ tristate "LED Class Support" ++ depends NEW_LEDS ++ help ++ This option enables the led sysfs class in /sys/class/leds. You'll ++ need this to do anything useful with LEDs. If unsure, say N. ++ ++config LEDS_TRIGGERS ++ bool "LED Trigger support" ++ depends NEW_LEDS ++ help ++ This option enables trigger support for the leds class. ++ These triggers allow kernel events to drive the LEDs and can ++ be configured via sysfs. If unsure, say Y. ++ ++config LEDS_CORGI ++ tristate "LED Support for the Sharp SL-C7x0 series" ++ depends LEDS_CLASS && PXA_SHARP_C7xx ++ help ++ This option enables support for the LEDs on Sharp Zaurus ++ SL-C7x0 series (C700, C750, C760, C860). ++ ++config LEDS_LOCOMO ++ tristate "LED Support for Locomo device" ++ depends LEDS_CLASS && SHARP_LOCOMO ++ help ++ This option enables support for the LEDs on Sharp Locomo. ++ Zaurus models SL-5500 and SL-5600. ++ ++config LEDS_SPITZ ++ tristate "LED Support for the Sharp SL-Cxx00 series" ++ depends LEDS_CLASS && PXA_SHARP_Cxx00 ++ help ++ This option enables support for the LEDs on Sharp Zaurus ++ SL-Cxx00 series (C1000, C3000, C3100). ++ ++config LEDS_IXP4XX ++ tristate "LED Support for GPIO connected LEDs on IXP4XX processors" ++ depends LEDS_CLASS && ARCH_IXP4XX ++ help ++ This option enables support for the LEDs connected to GPIO ++ outputs of the Intel IXP4XX processors. To be useful the ++ particular board must have LEDs and they must be connected ++ to the GPIO lines. If unsure, say Y. ++ ++config LEDS_TOSA ++ tristate "LED Support for the Sharp SL-6000 series" ++ depends LEDS_CLASS && PXA_SHARPSL ++ help ++ This option enables support for the LEDs on Sharp Zaurus ++ SL-6000 series. ++ ++config LEDS_TRIGGER_TIMER ++ tristate "LED Timer Trigger" ++ depends LEDS_TRIGGERS ++ help ++ This allows LEDs to be controlled by a programmable timer ++ via sysfs. If unsure, say Y. ++ ++endmenu ++ +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/Makefile 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,15 @@ ++ ++# LED Core ++obj-$(CONFIG_NEW_LEDS) += led-core.o ++obj-$(CONFIG_LEDS_CLASS) += led-class.o ++obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o ++ ++# LED Platform Drivers ++obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o ++obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o ++obj-$(CONFIG_LEDS_SPITZ) += leds-spitz.o ++obj-$(CONFIG_LEDS_IXP4XX) += leds-ixp4xx-gpio.o ++obj-$(CONFIG_LEDS_TOSA) += leds-tosa.o ++ ++# LED Triggers ++obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/include/linux/leds.h 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,97 @@ ++/* ++ * Driver model for leds and led triggers ++ * ++ * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu> ++ * Copyright (C) 2005 Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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. ++ * ++ */ ++ ++struct device; ++struct class_device; ++/* ++ * LED Core ++ */ ++ ++enum led_brightness { ++ LED_OFF = 0, ++ LED_HALF = 127, ++ LED_FULL = 255, ++}; ++ ++struct led_classdev { ++ const char *name; ++ int brightness; ++ int flags; ++#define LED_SUSPENDED (1 << 0) ++ ++ /* A function to set the brightness of the led */ ++ void (*brightness_set)(struct led_classdev *led_cdev, enum led_brightness brightness); ++ ++ struct class_device *class_dev; ++ /* LED Device linked list */ ++ struct list_head node; ++ ++ /* Trigger data */ ++ char *default_trigger; ++#ifdef CONFIG_LEDS_TRIGGERS ++ struct led_trigger *trigger; ++ struct list_head trig_list; ++ void *trigger_data; ++#endif ++ ++ /* This protects the data in this structure */ ++ rwlock_t lock; ++}; ++ ++extern int led_classdev_register(struct device *parent, struct led_classdev *led_cdev); ++extern void led_classdev_unregister(struct led_classdev *led_cdev); ++extern void led_classdev_suspend(struct led_classdev *led_cdev); ++extern void led_classdev_resume(struct led_classdev *led_cdev); ++ ++ ++/* ++ * LED Triggers ++ */ ++#ifdef CONFIG_LEDS_TRIGGERS ++ ++#define TRIG_NAME_MAX 50 ++ ++struct led_trigger { ++ /* Trigger Properties */ ++ const char *name; ++ void (*activate)(struct led_classdev *led_cdev); ++ void (*deactivate)(struct led_classdev *led_cdev); ++ ++ /* LEDs under control by this trigger (for simple triggers) */ ++ rwlock_t leddev_list_lock; ++ struct list_head led_cdevs; ++ ++ /* Link to next registered trigger */ ++ struct list_head next_trig; ++}; ++ ++/* Registration functions for complex triggers */ ++int led_trigger_register(struct led_trigger *trigger); ++void led_trigger_unregister(struct led_trigger *trigger); ++ ++/* Registration functions for simple triggers */ ++#define INIT_LED_TRIGGER(x) static struct led_trigger *x; ++#define INIT_LED_TRIGGER_GLOBAL(x) struct led_trigger *x; ++void led_trigger_register_simple(const char *name, struct led_trigger **trigger); ++void led_trigger_unregister_simple(struct led_trigger *trigger); ++void led_trigger_event(struct led_trigger *trigger, enum led_brightness event); ++ ++#else ++ ++/* Triggers aren't active - null macros */ ++#define INIT_LED_TRIGGER(x) ++#define INIT_LED_TRIGGER_GLOBAL(x) ++#define led_trigger_register_simple(x, y) do {} while(0) ++#define led_trigger_unregister_simple(x) do {} while(0) ++#define led_trigger_event(x, y) do {} while(0) ++ ++#endif +--- linux-ixp4xx.orig/arch/arm/Kconfig 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/arch/arm/Kconfig 2006-02-23 18:17:40.000000000 +0100 +@@ -807,6 +807,8 @@ source "drivers/misc/Kconfig" + + source "drivers/mfd/Kconfig" + ++source "drivers/leds/Kconfig" ++ + source "drivers/media/Kconfig" + + source "drivers/video/Kconfig" +--- linux-ixp4xx.orig/drivers/Makefile 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/drivers/Makefile 2006-02-23 18:17:40.000000000 +0100 +@@ -68,6 +68,7 @@ obj-$(CONFIG_MCA) += mca/ + obj-$(CONFIG_EISA) += eisa/ + obj-$(CONFIG_CPU_FREQ) += cpufreq/ + obj-$(CONFIG_MMC) += mmc/ ++obj-$(CONFIG_NEW_LEDS) += leds/ + obj-$(CONFIG_INFINIBAND) += infiniband/ + obj-$(CONFIG_SGI_SN) += sn/ + obj-y += firmware/ +--- linux-ixp4xx.orig/drivers/Kconfig 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/drivers/Kconfig 2006-02-23 18:17:40.000000000 +0100 +@@ -64,6 +64,8 @@ source "drivers/usb/Kconfig" + + source "drivers/mmc/Kconfig" + ++source "drivers/leds/Kconfig" ++ + source "drivers/infiniband/Kconfig" + + source "drivers/sn/Kconfig" +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds.h 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,36 @@ ++/* ++ * LED Core ++ * ++ * Copyright 2005 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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. ++ * ++ */ ++ ++/* led_cdev->lock must be held as write */ ++static inline void led_set_brightness(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value > LED_FULL) ++ value = LED_FULL; ++ led_cdev->brightness = value; ++ if (!(led_cdev->flags & LED_SUSPENDED)) ++ led_cdev->brightness_set(led_cdev, value); ++} ++ ++extern rwlock_t leds_list_lock; ++extern struct list_head leds_list; ++ ++#ifdef CONFIG_LEDS_TRIGGERS ++void led_trigger_set_default(struct led_classdev *led_cdev); ++void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger); ++#else ++#define led_trigger_set_default(x) do {} while(0) ++#define led_trigger_set(x, y) do {} while(0) ++#endif ++ ++ssize_t led_trigger_store(struct class_device *dev, const char *buf, size_t count); ++ssize_t led_trigger_show(struct class_device *dev, char *buf); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/led-class.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,164 @@ ++/* ++ * LED Class Core ++ * ++ * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu> ++ * Copyright (C) 2005-2006 Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/module.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/list.h> ++#include <linux/spinlock.h> ++#include <linux/device.h> ++#include <linux/sysdev.h> ++#include <linux/timer.h> ++#include <linux/err.h> ++#include <linux/leds.h> ++#include "leds.h" ++ ++static struct class *leds_class; ++ ++static ssize_t led_brightness_show(struct class_device *dev, char *buf) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ ssize_t ret = 0; ++ ++ /* no lock needed for this */ ++ sprintf(buf, "%u\n", led_cdev->brightness); ++ ret = strlen(buf) + 1; ++ ++ return ret; ++} ++ ++static ssize_t led_brightness_store(struct class_device *dev, const char *buf, size_t size) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ ssize_t ret = -EINVAL; ++ char *after; ++ ++ unsigned long state = simple_strtoul(buf, &after, 10); ++ if (after - buf > 0) { ++ ret = after - buf; ++ write_lock(&led_cdev->lock); ++ led_set_brightness(led_cdev, state); ++ write_unlock(&led_cdev->lock); ++ } ++ ++ return ret; ++} ++ ++static CLASS_DEVICE_ATTR(brightness, 0644, led_brightness_show, led_brightness_store); ++ ++#ifdef CONFIG_LEDS_TRIGGERS ++static CLASS_DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store); ++#endif ++ ++/** ++ * led_classdev_suspend - suspend an led_classdev. ++ * @led_cdev: the led_classdev to suspend. ++ */ ++void led_classdev_suspend(struct led_classdev *led_cdev) ++{ ++ write_lock(&led_cdev->lock); ++ led_cdev->flags |= LED_SUSPENDED; ++ led_cdev->brightness_set(led_cdev, 0); ++ write_unlock(&led_cdev->lock); ++} ++ ++/** ++ * led_classdev_resume - resume an led_classdev. ++ * @led_cdev: the led_classdev to resume. ++ */ ++void led_classdev_resume(struct led_classdev *led_cdev) ++{ ++ write_lock(&led_cdev->lock); ++ led_cdev->flags &= ~LED_SUSPENDED; ++ led_cdev->brightness_set(led_cdev, led_cdev->brightness); ++ write_unlock(&led_cdev->lock); ++} ++ ++/** ++ * led_classdev_register - register a new object of led_classdev class. ++ * @dev: The device to register. ++ * @led_cdev: the led_classdev structure for this device. ++ */ ++int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) ++{ ++ led_cdev->class_dev = class_device_create(leds_class, NULL, 0, parent, "%s", led_cdev->name); ++ if (unlikely(IS_ERR(led_cdev->class_dev))) ++ return PTR_ERR(led_cdev->class_dev); ++ ++ rwlock_init(&led_cdev->lock); ++ led_cdev->class_dev->class_data = led_cdev; ++ ++ /* register the attributes */ ++ class_device_create_file(led_cdev->class_dev, &class_device_attr_brightness); ++#ifdef CONFIG_LEDS_TRIGGERS ++ class_device_create_file(led_cdev->class_dev, &class_device_attr_trigger); ++#endif ++ ++ /* add to the list of leds */ ++ write_lock(&leds_list_lock); ++ list_add_tail(&led_cdev->node, &leds_list); ++ write_unlock(&leds_list_lock); ++ ++ led_trigger_set_default(led_cdev); ++ ++ printk(KERN_INFO "Registered led device: %s\n", led_cdev->class_dev->class_id); ++ ++ return 0; ++} ++ ++/** ++ * led_classdev_unregister - unregisters a object of led_properties class. ++ * @led_cdev: the led device to unreigister ++ * ++ * Unregisters a previously registered via led_classdev_register object. ++ */ ++void led_classdev_unregister(struct led_classdev *led_cdev) ++{ ++ class_device_remove_file(led_cdev->class_dev, &class_device_attr_brightness); ++#ifdef CONFIG_LEDS_TRIGGERS ++ class_device_remove_file(led_cdev->class_dev, &class_device_attr_trigger); ++#endif ++ ++ if (led_cdev->trigger) ++ led_trigger_set(led_cdev, NULL); ++ ++ class_device_unregister(led_cdev->class_dev); ++ ++ write_lock(&leds_list_lock); ++ list_del(&led_cdev->node); ++ write_unlock(&leds_list_lock); ++} ++ ++EXPORT_SYMBOL_GPL(led_classdev_suspend); ++EXPORT_SYMBOL_GPL(led_classdev_resume); ++EXPORT_SYMBOL_GPL(led_classdev_register); ++EXPORT_SYMBOL_GPL(led_classdev_unregister); ++ ++static int __init leds_init(void) ++{ ++ leds_class = class_create(THIS_MODULE, "leds"); ++ if (IS_ERR(leds_class)) ++ return PTR_ERR(leds_class); ++ return 0; ++} ++ ++static void __exit leds_exit(void) ++{ ++ class_destroy(leds_class); ++} ++ ++subsys_initcall(leds_init); ++module_exit(leds_exit); ++ ++MODULE_AUTHOR("John Lenz, Richard Purdie"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("LED Class Interface"); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/led-core.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,24 @@ ++/* ++ * LED Class Core ++ * ++ * Copyright 2005-2006 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/kernel.h> ++#include <linux/list.h> ++#include <linux/module.h> ++#include <linux/spinlock.h> ++#include <linux/leds.h> ++#include "leds.h" ++ ++rwlock_t leds_list_lock = RW_LOCK_UNLOCKED; ++LIST_HEAD(leds_list); ++ ++EXPORT_SYMBOL_GPL(leds_list); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/led-triggers.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,236 @@ ++/* ++ * LED Triggers Core ++ * ++ * Copyright 2005-2006 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/module.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/list.h> ++#include <linux/spinlock.h> ++#include <linux/device.h> ++#include <linux/sysdev.h> ++#include <linux/timer.h> ++#include <linux/leds.h> ++#include "leds.h" ++ ++static rwlock_t triggers_list_lock = RW_LOCK_UNLOCKED; ++static LIST_HEAD(trigger_list); ++ ++ssize_t led_trigger_store(struct class_device *dev, const char *buf, size_t count) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ char trigger_name[TRIG_NAME_MAX]; ++ struct led_trigger *trig; ++ size_t len; ++ ++ trigger_name[sizeof(trigger_name) - 1] = '\0'; ++ strncpy(trigger_name, buf, sizeof(trigger_name) - 1); ++ len = strlen(trigger_name); ++ ++ if (len && trigger_name[len - 1] == '\n') ++ trigger_name[len - 1] = '\0'; ++ ++ if (!strcmp(trigger_name, "none")) { ++ write_lock(&led_cdev->lock); ++ led_trigger_set(led_cdev, NULL); ++ write_unlock(&led_cdev->lock); ++ return count; ++ } ++ ++ read_lock(&triggers_list_lock); ++ list_for_each_entry(trig, &trigger_list, next_trig) { ++ if (!strcmp(trigger_name, trig->name)) { ++ write_lock(&led_cdev->lock); ++ led_trigger_set(led_cdev, trig); ++ write_unlock(&led_cdev->lock); ++ ++ read_unlock(&triggers_list_lock); ++ return count; ++ } ++ } ++ read_unlock(&triggers_list_lock); ++ ++ return -EINVAL; ++} ++ ++ ++ssize_t led_trigger_show(struct class_device *dev, char *buf) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ struct led_trigger *trig; ++ int len = 0; ++ ++ read_lock(&led_cdev->lock); ++ ++ if (!led_cdev->trigger) ++ len += sprintf(buf+len, "[none] "); ++ else ++ len += sprintf(buf+len, "none "); ++ ++ read_lock(&triggers_list_lock); ++ list_for_each_entry(trig, &trigger_list, next_trig) { ++ if (led_cdev->trigger && !strcmp(led_cdev->trigger->name, trig->name)) ++ len += sprintf(buf+len, "[%s] ", trig->name); ++ else ++ len += sprintf(buf+len, "%s ", trig->name); ++ } ++ read_unlock(&triggers_list_lock); ++ read_unlock(&led_cdev->lock); ++ ++ len += sprintf(len+buf, "\n"); ++ return len; ++} ++ ++void led_trigger_event(struct led_trigger *trigger, enum led_brightness brightness) ++{ ++ struct list_head *entry; ++ ++ if (!trigger) ++ return; ++ ++ read_lock(&trigger->leddev_list_lock); ++ list_for_each(entry, &trigger->led_cdevs) { ++ struct led_classdev *led_cdev; ++ ++ led_cdev = list_entry(entry, struct led_classdev, trig_list); ++ write_lock(&led_cdev->lock); ++ led_set_brightness(led_cdev, brightness); ++ write_unlock(&led_cdev->lock); ++ } ++ read_unlock(&trigger->leddev_list_lock); ++} ++ ++/* Caller must ensure led_cdev->lock held for write */ ++void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger) ++{ ++ /* Remove any existing trigger */ ++ if (led_cdev->trigger) { ++ write_lock(&led_cdev->trigger->leddev_list_lock); ++ list_del(&led_cdev->trig_list); ++ write_unlock(&led_cdev->trigger->leddev_list_lock); ++ if (led_cdev->trigger->deactivate) ++ led_cdev->trigger->deactivate(led_cdev); ++ ++ } ++ if (trigger) { ++ write_lock(&trigger->leddev_list_lock); ++ list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs); ++ write_unlock(&trigger->leddev_list_lock); ++ if (trigger->activate) ++ trigger->activate(led_cdev); ++ } ++ led_cdev->trigger = trigger; ++} ++ ++void led_trigger_set_default(struct led_classdev *led_cdev) ++{ ++ struct led_trigger *trig; ++ ++ if (!led_cdev->default_trigger) ++ return; ++ ++ write_lock(&led_cdev->lock); ++ read_lock(&triggers_list_lock); ++ list_for_each_entry(trig, &trigger_list, next_trig) { ++ if (!strcmp(led_cdev->default_trigger, trig->name)) ++ led_trigger_set(led_cdev, trig); ++ } ++ read_unlock(&triggers_list_lock); ++ write_unlock(&led_cdev->lock); ++} ++ ++int led_trigger_register(struct led_trigger *trigger) ++{ ++ struct led_classdev *led_cdev; ++ ++ rwlock_init(&trigger->leddev_list_lock); ++ INIT_LIST_HEAD(&trigger->led_cdevs); ++ ++ /* Add to the list of led triggers */ ++ write_lock(&triggers_list_lock); ++ list_add_tail(&trigger->next_trig, &trigger_list); ++ write_unlock(&triggers_list_lock); ++ ++ /* Register with any LEDs that have this as a default trigger */ ++ read_lock(&leds_list); ++ list_for_each_entry(led_cdev, &leds_list, node) { ++ write_lock(&led_cdev->lock); ++ if (!led_cdev->trigger && led_cdev->default_trigger && ++ !strcmp(led_cdev->default_trigger, trigger->name)) ++ led_trigger_set(led_cdev, trigger); ++ write_unlock(&led_cdev->lock); ++ } ++ read_unlock(&leds_list); ++ ++ return 0; ++} ++ ++void led_trigger_register_simple(const char *name, struct led_trigger **tp) ++{ ++ struct led_trigger *trigger; ++ ++ trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); ++ ++ if (trigger) { ++ trigger->name = name; ++ led_trigger_register(trigger); ++ } ++ *tp = trigger; ++} ++ ++ ++void led_trigger_unregister(struct led_trigger *trigger) ++{ ++ struct led_classdev *led_cdev; ++ ++ /* Remove from the list of led triggers */ ++ write_lock(&triggers_list_lock); ++ list_del(&trigger->next_trig); ++ write_unlock(&triggers_list_lock); ++ ++ /* Remove anyone actively using this trigger */ ++ read_lock(&leds_list); ++ list_for_each_entry(led_cdev, &leds_list, node) { ++ write_lock(&led_cdev->lock); ++ if (led_cdev->trigger == trigger) ++ led_trigger_set(led_cdev, NULL); ++ write_unlock(&led_cdev->lock); ++ } ++ read_unlock(&leds_list); ++} ++ ++void led_trigger_unregister_simple(struct led_trigger *trigger) ++{ ++ led_trigger_unregister(trigger); ++ kfree(trigger); ++} ++ ++/* Used by LED Class */ ++EXPORT_SYMBOL_GPL(led_trigger_set); ++EXPORT_SYMBOL_GPL(led_trigger_set_default); ++EXPORT_SYMBOL_GPL(led_trigger_show); ++EXPORT_SYMBOL_GPL(led_trigger_store); ++ ++/* LED Trigger Interface */ ++EXPORT_SYMBOL_GPL(led_trigger_register); ++EXPORT_SYMBOL_GPL(led_trigger_unregister); ++ ++/* Simple LED Tigger Interface */ ++EXPORT_SYMBOL_GPL(led_trigger_register_simple); ++EXPORT_SYMBOL_GPL(led_trigger_unregister_simple); ++EXPORT_SYMBOL_GPL(led_trigger_event); ++ ++MODULE_AUTHOR("Richard Purdie"); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("LED Triggers Core"); ++ +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/ledtrig-timer.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,205 @@ ++/* ++ * LED Kernel Timer Trigger ++ * ++ * Copyright 2005-2006 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/module.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/list.h> ++#include <linux/spinlock.h> ++#include <linux/device.h> ++#include <linux/sysdev.h> ++#include <linux/timer.h> ++#include <linux/leds.h> ++#include "leds.h" ++ ++struct timer_trig_data { ++ unsigned long duty; /* duty cycle, as a percentage */ ++ unsigned long frequency; /* frequency of blinking, in Hz */ ++ unsigned long delay_on; /* milliseconds on */ ++ unsigned long delay_off; /* milliseconds off */ ++ struct timer_list timer; ++}; ++ ++static void led_timer_function(unsigned long data) ++{ ++ struct led_classdev *led_cdev = (struct led_classdev *) data; ++ struct timer_trig_data *timer_data = led_cdev->trigger_data; ++ unsigned long brightness = LED_OFF; ++ unsigned long delay = timer_data->delay_off; ++ ++ write_lock(&led_cdev->lock); ++ ++ if (!timer_data->frequency) { ++ led_set_brightness(led_cdev, LED_OFF); ++ write_unlock(&led_cdev->lock); ++ return; ++ } ++ ++ if (!led_cdev->brightness) { ++ brightness = LED_FULL; ++ delay = timer_data->delay_on; ++ } ++ ++ led_set_brightness(led_cdev, brightness); ++ ++ mod_timer(&timer_data->timer, jiffies + msecs_to_jiffies(delay)); ++ write_unlock(&led_cdev->lock); ++} ++ ++/* led_cdev write lock needs to be held */ ++static int led_timer_setdata(struct led_classdev *led_cdev, unsigned long duty, unsigned long frequency) ++{ ++ struct timer_trig_data *timer_data = led_cdev->trigger_data; ++ ++ if (frequency > 500) ++ return -EINVAL; ++ ++ if (duty > 100) ++ return -EINVAL; ++ ++ timer_data->duty = duty; ++ timer_data->frequency = frequency; ++ if (frequency != 0) { ++ timer_data->delay_on = duty * 1000 / 50 / frequency / 2; ++ timer_data->delay_off = (100 - duty) * 1000 / 50 / frequency / 2; ++ } ++ ++ mod_timer(&timer_data->timer, jiffies + 1); ++ ++ return 0; ++} ++ ++static ssize_t led_duty_show(struct class_device *dev, char *buf) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ struct timer_trig_data *timer_data; ++ ++ read_lock(&led_cdev->lock); ++ timer_data = led_cdev->trigger_data; ++ sprintf(buf, "%lu\n", timer_data->duty); ++ read_unlock(&led_cdev->lock); ++ ++ return strlen(buf) + 1; ++} ++ ++static ssize_t led_duty_store(struct class_device *dev, const char *buf, size_t size) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ struct timer_trig_data *timer_data; ++ int ret = -EINVAL; ++ char *after; ++ ++ unsigned long state = simple_strtoul(buf, &after, 10); ++ if (after - buf > 0) { ++ write_lock(&led_cdev->lock); ++ timer_data = led_cdev->trigger_data; ++ ret = led_timer_setdata(led_cdev, state, timer_data->frequency); ++ if (!ret) ++ ret = after - buf; ++ write_unlock(&led_cdev->lock); ++ } ++ ++ return ret; ++} ++ ++ ++static ssize_t led_frequency_show(struct class_device *dev, char *buf) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ struct timer_trig_data *timer_data; ++ ++ read_lock(&led_cdev->lock); ++ timer_data = led_cdev->trigger_data; ++ sprintf(buf, "%lu\n", timer_data->frequency); ++ read_unlock(&led_cdev->lock); ++ ++ return strlen(buf) + 1; ++} ++ ++static ssize_t led_frequency_store(struct class_device *dev, const char *buf, size_t size) ++{ ++ struct led_classdev *led_cdev = dev->class_data; ++ struct timer_trig_data *timer_data; ++ int ret = -EINVAL; ++ char *after; ++ ++ unsigned long state = simple_strtoul(buf, &after, 10); ++ if (after - buf > 0) { ++ write_lock(&led_cdev->lock); ++ timer_data = led_cdev->trigger_data; ++ ret = led_timer_setdata(led_cdev, timer_data->duty, state); ++ if (!ret) ++ ret = after - buf; ++ write_unlock(&led_cdev->lock); ++ } ++ ++ return ret; ++} ++ ++static CLASS_DEVICE_ATTR(duty, 0644, led_duty_show, led_duty_store); ++static CLASS_DEVICE_ATTR(frequency, 0644, led_frequency_show, led_frequency_store); ++ ++static void timer_trig_activate(struct led_classdev *led_cdev) ++{ ++ struct timer_trig_data *timer_data; ++ ++ timer_data = kzalloc(sizeof(struct timer_trig_data), GFP_KERNEL); ++ if (!timer_data) ++ return; ++ ++ led_cdev->trigger_data = timer_data; ++ ++ init_timer(&timer_data->timer); ++ timer_data->timer.function = led_timer_function; ++ timer_data->timer.data = (unsigned long) led_cdev; ++ ++ timer_data->duty = 50; ++ ++ class_device_create_file(led_cdev->class_dev, &class_device_attr_duty); ++ class_device_create_file(led_cdev->class_dev, &class_device_attr_frequency); ++} ++ ++static void timer_trig_deactivate(struct led_classdev *led_cdev) ++{ ++ struct timer_trig_data *timer_data = led_cdev->trigger_data; ++ if (timer_data) { ++ class_device_remove_file(led_cdev->class_dev, &class_device_attr_duty); ++ class_device_remove_file(led_cdev->class_dev, &class_device_attr_frequency); ++ del_timer_sync(&timer_data->timer); ++ kfree(timer_data); ++ } ++} ++ ++static struct led_trigger timer_led_trigger = { ++ .name = "timer", ++ .activate = timer_trig_activate, ++ .deactivate = timer_trig_deactivate, ++}; ++ ++static int __init timer_trig_init(void) ++{ ++ return led_trigger_register(&timer_led_trigger); ++} ++ ++static void __exit timer_trig_exit (void) ++{ ++ led_trigger_unregister(&timer_led_trigger); ++} ++ ++module_init(timer_trig_init); ++module_exit(timer_trig_exit); ++ ++MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>"); ++MODULE_DESCRIPTION("Timer LED trigger"); ++MODULE_LICENSE("GPL"); +--- linux-ixp4xx.orig/arch/arm/mach-pxa/corgi.c 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-pxa/corgi.c 2006-02-23 18:17:40.000000000 +0100 +@@ -165,6 +165,15 @@ static struct platform_device corgikbd_d + + + /* ++ * Corgi LEDs ++ */ ++static struct platform_device corgiled_device = { ++ .name = "corgi-led", ++ .id = -1, ++}; ++ ++ ++/* + * Corgi Touch Screen Device + */ + static struct resource corgits_resources[] = { +@@ -298,6 +307,7 @@ static struct platform_device *devices[] + &corgikbd_device, + &corgibl_device, + &corgits_device, ++ &corgiled_device, + }; + + static void __init corgi_init(void) +--- linux-ixp4xx.orig/arch/arm/mach-pxa/spitz.c 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-pxa/spitz.c 2006-02-23 18:17:40.000000000 +0100 +@@ -243,6 +243,15 @@ static struct platform_device spitzkbd_d + + + /* ++ * Spitz LEDs ++ */ ++static struct platform_device spitzled_device = { ++ .name = "spitz-led", ++ .id = -1, ++}; ++ ++ ++/* + * Spitz Touch Screen Device + */ + static struct resource spitzts_resources[] = { +@@ -419,6 +428,7 @@ static struct platform_device *devices[] + &spitzkbd_device, + &spitzts_device, + &spitzbl_device, ++ &spitzled_device, + }; + + static void __init common_init(void) +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds-corgi.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,121 @@ ++/* ++ * LED Triggers Core ++ * ++ * Copyright 2005-2006 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/kernel.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/leds.h> ++#include <asm/mach-types.h> ++#include <asm/arch/corgi.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/pxa-regs.h> ++#include <asm/hardware/scoop.h> ++ ++static void corgiled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ GPSR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); ++ else ++ GPCR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); ++} ++ ++static void corgiled_green_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN); ++ else ++ reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN); ++} ++ ++static struct led_classdev corgi_amber_led = { ++ .name = "corgi:amber", ++ .default_trigger = "sharpsl-charge", ++ .brightness_set = corgiled_amber_set, ++}; ++ ++static struct led_classdev corgi_green_led = { ++ .name = "corgi:green", ++ .default_trigger = "nand-disk", ++ .brightness_set = corgiled_green_set, ++}; ++ ++#ifdef CONFIG_PM ++static int corgiled_suspend(struct platform_device *dev, pm_message_t state) ++{ ++#ifdef CONFIG_LEDS_TRIGGERS ++ if (corgi_amber_led.trigger && strcmp(corgi_amber_led.trigger->name, "sharpsl-charge")) ++#endif ++ led_classdev_suspend(&corgi_amber_led); ++ led_classdev_suspend(&corgi_green_led); ++ return 0; ++} ++ ++static int corgiled_resume(struct platform_device *dev) ++{ ++ led_classdev_resume(&corgi_amber_led); ++ led_classdev_resume(&corgi_green_led); ++ return 0; ++} ++#endif ++ ++static int corgiled_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = led_classdev_register(&pdev->dev, &corgi_amber_led); ++ if (ret < 0) ++ return ret; ++ ++ ret = led_classdev_register(&pdev->dev, &corgi_green_led); ++ if (ret < 0) ++ led_classdev_unregister(&corgi_amber_led); ++ ++ return ret; ++} ++ ++static int corgiled_remove(struct platform_device *pdev) ++{ ++ led_classdev_unregister(&corgi_amber_led); ++ led_classdev_unregister(&corgi_green_led); ++ return 0; ++} ++ ++static struct platform_driver corgiled_driver = { ++ .probe = corgiled_probe, ++ .remove = corgiled_remove, ++#ifdef CONFIG_PM ++ .suspend = corgiled_suspend, ++ .resume = corgiled_resume, ++#endif ++ .driver = { ++ .name = "corgi-led", ++ }, ++}; ++ ++static int __devinit corgiled_init(void) ++{ ++ return platform_driver_register(&corgiled_driver); ++} ++ ++static void corgiled_exit(void) ++{ ++ platform_driver_unregister(&corgiled_driver); ++} ++ ++module_init(corgiled_init); ++module_exit(corgiled_exit); ++ ++MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>"); ++MODULE_DESCRIPTION("Corgi LED driver"); ++MODULE_LICENSE("GPL"); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds-spitz.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,125 @@ ++/* ++ * LED Triggers Core ++ * ++ * Copyright 2005-2006 Openedhand Ltd. ++ * ++ * Author: Richard Purdie <rpurdie@openedhand.com> ++ * ++ * 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/kernel.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/leds.h> ++#include <asm/hardware/scoop.h> ++#include <asm/mach-types.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/pxa-regs.h> ++#include <asm/arch/spitz.h> ++ ++static void spitzled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); ++ else ++ reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); ++} ++ ++static void spitzled_green_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN); ++ else ++ reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN); ++} ++ ++static struct led_classdev spitz_amber_led = { ++ .name = "spitz:amber", ++ .default_trigger = "sharpsl-charge", ++ .brightness_set = spitzled_amber_set, ++}; ++ ++static struct led_classdev spitz_green_led = { ++ .name = "spitz:green", ++ .default_trigger = "ide-disk", ++ .brightness_set = spitzled_green_set, ++}; ++ ++#ifdef CONFIG_PM ++static int spitzled_suspend(struct platform_device *dev, pm_message_t state) ++{ ++#ifdef CONFIG_LEDS_TRIGGERS ++ if (spitz_amber_led.trigger && strcmp(spitz_amber_led.trigger->name, "sharpsl-charge")) ++#endif ++ led_classdev_suspend(&spitz_amber_led); ++ led_classdev_suspend(&spitz_green_led); ++ return 0; ++} ++ ++static int spitzled_resume(struct platform_device *dev) ++{ ++ led_classdev_resume(&spitz_amber_led); ++ led_classdev_resume(&spitz_green_led); ++ return 0; ++} ++#endif ++ ++static int spitzled_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ if (machine_is_akita()) ++ spitz_green_led.default_trigger = "nand-disk"; ++ ++ ret = led_classdev_register(&pdev->dev, &spitz_amber_led); ++ if (ret < 0) ++ return ret; ++ ++ ret = led_classdev_register(&pdev->dev, &spitz_green_led); ++ if (ret < 0) ++ led_classdev_unregister(&spitz_amber_led); ++ ++ return ret; ++} ++ ++static int spitzled_remove(struct platform_device *pdev) ++{ ++ led_classdev_unregister(&spitz_amber_led); ++ led_classdev_unregister(&spitz_green_led); ++ ++ return 0; ++} ++ ++static struct platform_driver spitzled_driver = { ++ .probe = spitzled_probe, ++ .remove = spitzled_remove, ++#ifdef CONFIG_PM ++ .suspend = spitzled_suspend, ++ .resume = spitzled_resume, ++#endif ++ .driver = { ++ .name = "spitz-led", ++ }, ++}; ++ ++static int __devinit spitzled_init(void) ++{ ++ return platform_driver_register(&spitzled_driver); ++} ++ ++static void spitzled_exit(void) ++{ ++ platform_driver_unregister(&spitzled_driver); ++} ++ ++module_init(spitzled_init); ++module_exit(spitzled_exit); ++ ++MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>"); ++MODULE_DESCRIPTION("Spitz LED driver"); ++MODULE_LICENSE("GPL"); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds-locomo.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,91 @@ ++/* ++ * linux/drivers/leds/locomo.c ++ * ++ * Copyright (C) 2005 John Lenz <lenz@cs.wisc.edu> ++ * ++ * 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/kernel.h> ++#include <linux/init.h> ++#include <linux/device.h> ++#include <linux/leds.h> ++ ++#include <asm/hardware.h> ++#include <asm/hardware/locomo.h> ++ ++static void locomoled_brightness_set(struct led_classdev *led_cdev, enum led_brightness value, int offset) ++{ ++ struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->class_dev->dev); ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ if (value) ++ locomo_writel(LOCOMO_LPT_TOFH, locomo_dev->mapbase + offset); ++ else ++ locomo_writel(LOCOMO_LPT_TOFL, locomo_dev->mapbase + offset); ++ local_irq_restore(flags); ++} ++ ++static void locomoled_brightness_set0(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ locomoled_brightness_set(led_cdev, value, LOCOMO_LPT0); ++} ++ ++static void locomoled_brightness_set1(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ locomoled_brightness_set(led_cdev, value, LOCOMO_LPT1); ++} ++ ++static struct led_classdev locomo_led0 = { ++ .name = "locomo:amber", ++ .brightness_set = locomoled_brightness_set0, ++}; ++ ++static struct led_classdev locomo_led1 = { ++ .name = "locomo:green", ++ .brightness_set = locomoled_brightness_set1, ++}; ++ ++static int locomoled_probe(struct locomo_dev *ldev) ++{ ++ int ret; ++ ++ ret = led_classdev_register(&ldev->dev, &locomo_led0); ++ if (ret < 0) ++ return ret; ++ ++ ret = led_classdev_register(&ldev->dev, &locomo_led1); ++ if (ret < 0) ++ led_classdev_unregister(&locomo_led0); ++ ++ return ret; ++} ++ ++static int locomoled_remove(struct locomo_dev *dev) ++{ ++ led_classdev_unregister(&locomo_led0); ++ led_classdev_unregister(&locomo_led1); ++ return 0; ++} ++ ++static struct locomo_driver locomoled_driver = { ++ .drv = { ++ .name = "locomoled" ++ }, ++ .devid = LOCOMO_DEVID_LED, ++ .probe = locomoled_probe, ++ .remove = locomoled_remove, ++}; ++ ++static int __init locomoled_init(void) { ++ return locomo_driver_register(&locomoled_driver); ++} ++module_init(locomoled_init); ++ ++MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>"); ++MODULE_DESCRIPTION("Locomo LED driver"); ++MODULE_LICENSE("GPL"); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds-ixp4xx-gpio.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,209 @@ ++/* ++ * IXP4XX GPIO driver LED driver ++ * ++ * Author: John Bowler <jbowler@acm.org> ++ * ++ * Copyright (c) 2006 John Bowler ++ * ++ * Permission is hereby granted, free of charge, to any ++ * person obtaining a copy of this software and associated ++ * documentation files (the "Software"), to deal in the ++ * Software without restriction, including without ++ * limitation the rights to use, copy, modify, merge, ++ * publish, distribute, sublicense, and/or sell copies of ++ * the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the ++ * following conditions: ++ * ++ * The above copyright notice and this permission notice ++ * shall be included in all copies or substantial portions ++ * of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++ * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++ * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++#include <linux/config.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/spinlock.h> ++#include <linux/leds.h> ++#include <asm/arch/hardware.h> ++ ++extern spinlock_t gpio_lock; ++ ++/* Up to 16 gpio lines are possible. */ ++#define GPIO_MAX 16 ++static struct ixp4xxgpioled_device { ++ struct led_classdev ancestor; ++ int flags; ++} ixp4xxgpioled_devices[GPIO_MAX]; ++ ++void ixp4xxgpioled_brightness_set(struct led_classdev *pled, enum led_brightness value) ++{ ++ const struct ixp4xxgpioled_device *const ixp4xx_dev = ++ container_of(pled, struct ixp4xxgpioled_device, ancestor); ++ const u32 gpio_pin = ixp4xx_dev - ixp4xxgpioled_devices; ++ ++ if (gpio_pin < GPIO_MAX && ixp4xx_dev->ancestor.name != 0) { ++ /* Set or clear the 'gpio_pin' bit according to the style ++ * and the required setting (value > 0 == on) ++ */ ++ const int gpio_value = ++ (value > 0) == (ixp4xx_dev->flags != IXP4XX_GPIO_LOW) ? ++ IXP4XX_GPIO_HIGH : IXP4XX_GPIO_LOW; ++ ++ { ++ unsigned long flags; ++ spin_lock_irqsave(&gpio_lock, flags); ++ gpio_line_set(gpio_pin, gpio_value); ++ spin_unlock_irqrestore(&gpio_lock, flags); ++ } ++ } ++} ++ ++/* LEDs are described in resources, the following iterates over the valid ++ * LED resources. ++ */ ++#define for_all_leds(i, pdev) \ ++ for (i=0; i<pdev->num_resources; ++i) \ ++ if (pdev->resource[i].start < GPIO_MAX && \ ++ pdev->resource[i].name != 0) ++ ++/* The following applies 'operation' to each LED from the given platform, ++ * the function always returns 0 to allow tail call elimination. ++ */ ++static int apply_to_all_leds(struct platform_device *pdev, ++ void (*operation)(struct led_classdev *pled)) { ++ int i; ++ for_all_leds(i, pdev) ++ operation(&ixp4xxgpioled_devices[pdev->resource[i].start].ancestor); ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int ixp4xxgpioled_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ return apply_to_all_leds(pdev, led_classdev_suspend); ++} ++ ++static int ixp4xxgpioled_resume(struct platform_device *pdev) ++{ ++ return apply_to_all_leds(pdev, led_classdev_resume); ++} ++#endif ++ ++static void ixp4xxgpioled_remove_one_led(struct led_classdev *pled) { ++ led_classdev_unregister(pled); ++ pled->name = 0; ++} ++ ++static int ixp4xxgpioled_remove(struct platform_device *pdev) ++{ ++ return apply_to_all_leds(pdev, ixp4xxgpioled_remove_one_led); ++} ++ ++static int ixp4xxgpioled_probe(struct platform_device *pdev) ++{ ++ /* The board level has to tell the driver where the ++ * LEDs are connected - there is no way to find out ++ * electrically. It must also say whether the GPIO ++ * lines are active high or active low. ++ * ++ * To do this read the num_resources (the number of ++ * LEDs) and the struct resource (the data for each ++ * LED). The name comes from the resource, and it ++ * isn't copied. ++ */ ++ int i; ++ for_all_leds(i, pdev) { ++ const u8 gpio_pin = pdev->resource[i].start; ++ int rc; ++ ++ if (ixp4xxgpioled_devices[gpio_pin].ancestor.name == 0) { ++ unsigned long flags; ++ ++ spin_lock_irqsave(&gpio_lock, flags); ++ gpio_line_config(gpio_pin, IXP4XX_GPIO_OUT); ++ /* The config can, apparently, reset the state, ++ * I suspect the gpio line may be an input and ++ * the config may cause the line to be latched, ++ * so the setting depends on how the LED is ++ * connected to the line (which affects how it ++ * floats if not driven). ++ */ ++ gpio_line_set(gpio_pin, IXP4XX_GPIO_HIGH); ++ spin_unlock_irqrestore(&gpio_lock, flags); ++ ++ ixp4xxgpioled_devices[gpio_pin].flags = ++ pdev->resource[i].flags & IORESOURCE_BITS; ++ ++ ixp4xxgpioled_devices[gpio_pin].ancestor.name = ++ pdev->resource[i].name; ++ ++ /* This is how a board manufacturer makes the LED ++ * come on on reset - the GPIO line will be high, so ++ * make the LED light when the line is low... ++ */ ++ if (ixp4xxgpioled_devices[gpio_pin].flags != IXP4XX_GPIO_LOW) ++ ixp4xxgpioled_devices[gpio_pin].ancestor.brightness = 100; ++ else ++ ixp4xxgpioled_devices[gpio_pin].ancestor.brightness = 0; ++ ++ ixp4xxgpioled_devices[gpio_pin].ancestor.flags = 0; ++ ++ ixp4xxgpioled_devices[gpio_pin].ancestor.brightness_set = ++ ixp4xxgpioled_brightness_set; ++ ++ ixp4xxgpioled_devices[gpio_pin].ancestor.default_trigger = 0; ++ } ++ ++ rc = led_classdev_register(&pdev->dev, ++ &ixp4xxgpioled_devices[gpio_pin].ancestor); ++ if (rc < 0) { ++ ixp4xxgpioled_devices[gpio_pin].ancestor.name = 0; ++ ixp4xxgpioled_remove(pdev); ++ return rc; ++ } ++ } ++ ++ return 0; ++} ++ ++static struct platform_driver ixp4xxgpioled_driver = { ++ .probe = ixp4xxgpioled_probe, ++ .remove = ixp4xxgpioled_remove, ++#ifdef CONFIG_PM ++ .suspend = ixp4xxgpioled_suspend, ++ .resume = ixp4xxgpioled_resume, ++#endif ++ .driver = { ++ .name = "IXP4XX-GPIO-LED", ++ }, ++}; ++ ++static int __devinit ixp4xxgpioled_init(void) ++{ ++ return platform_driver_register(&ixp4xxgpioled_driver); ++} ++ ++static void ixp4xxgpioled_exit(void) ++{ ++ platform_driver_unregister(&ixp4xxgpioled_driver); ++} ++ ++module_init(ixp4xxgpioled_init); ++module_exit(ixp4xxgpioled_exit); ++ ++MODULE_AUTHOR("John Bowler <jbowler@acm.org>"); ++MODULE_DESCRIPTION("IXP4XX GPIO LED driver"); ++MODULE_LICENSE("MIT"); +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-ixp4xx/drivers/leds/leds-tosa.c 2006-02-23 18:17:40.000000000 +0100 +@@ -0,0 +1,123 @@ ++/* ++ * LED Triggers Core ++ * ++ * Copyright 2005 Dirk Opfer ++ * ++ * Author: Dirk Opfer <Dirk@Opfer-Online.de> ++ * based on spitz.c ++ * ++ * 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/kernel.h> ++#include <linux/init.h> ++#include <linux/platform_device.h> ++#include <linux/leds.h> ++#include <asm/hardware/scoop.h> ++#include <asm/mach-types.h> ++#include <asm/arch/hardware.h> ++#include <asm/arch/pxa-regs.h> ++#include <asm/arch/tosa.h> ++ ++static void tosaled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ set_scoop_gpio(&tosascoop_jc_device.dev, TOSA_SCOOP_JC_CHRG_ERR_LED); ++ else ++ reset_scoop_gpio(&tosascoop_jc_device.dev, TOSA_SCOOP_JC_CHRG_ERR_LED); ++} ++ ++static void tosaled_green_set(struct led_classdev *led_cdev, enum led_brightness value) ++{ ++ if (value) ++ set_scoop_gpio(&tosascoop_jc_device.dev, TOSA_SCOOP_JC_NOTE_LED); ++ else ++ reset_scoop_gpio(&tosascoop_jc_device.dev, TOSA_SCOOP_JC_NOTE_LED); ++} ++ ++static struct led_classdev tosa_amber_led = { ++ .name = "tosa:amber", ++ .default_trigger = "sharpsl-charge", ++ .brightness_set = tosaled_amber_set, ++}; ++ ++static struct led_classdev tosa_green_led = { ++ .name = "tosa:green", ++ .default_trigger = "nand-disk", ++ .brightness_set = tosaled_green_set, ++}; ++ ++#ifdef CONFIG_PM ++static int tosaled_suspend(struct platform_device *dev, pm_message_t state) ++{ ++#ifdef CONFIG_LEDS_TRIGGERS ++ if (tosa_amber_led.trigger && strcmp(tosa_amber_led.trigger->name, "sharpsl-charge")) ++#endif ++ led_classdev_suspend(&tosa_amber_led); ++ led_classdev_suspend(&tosa_green_led); ++ return 0; ++} ++ ++static int tosaled_resume(struct platform_device *dev) ++{ ++ led_classdev_resume(&tosa_amber_led); ++ led_classdev_resume(&tosa_green_led); ++ return 0; ++} ++#endif ++ ++static int tosaled_probe(struct platform_device *pdev) ++{ ++ int ret; ++ ++ ret = led_classdev_register(&pdev->dev, &tosa_amber_led); ++ if (ret < 0) ++ return ret; ++ ++ ret = led_classdev_register(&pdev->dev, &tosa_green_led); ++ if (ret < 0) ++ led_classdev_unregister(&tosa_amber_led); ++ ++ return ret; ++} ++ ++static int tosaled_remove(struct platform_device *pdev) ++{ ++ led_classdev_unregister(&tosa_amber_led); ++ led_classdev_unregister(&tosa_green_led); ++ ++ return 0; ++} ++ ++static struct platform_driver tosaled_driver = { ++ .probe = tosaled_probe, ++ .remove = tosaled_remove, ++#ifdef CONFIG_PM ++ .suspend = tosaled_suspend, ++ .resume = tosaled_resume, ++#endif ++ .driver = { ++ .name = "tosa-led", ++ }, ++}; ++ ++static int __devinit tosaled_init(void) ++{ ++ return platform_driver_register(&tosaled_driver); ++} ++ ++static void tosaled_exit(void) ++{ ++ platform_driver_unregister(&tosaled_driver); ++} ++ ++module_init(tosaled_init); ++module_exit(tosaled_exit); ++ ++MODULE_AUTHOR("Dirk Opfer <Dirk@Opfer-Online.de>"); ++MODULE_DESCRIPTION("Tosa LED driver"); ++MODULE_LICENSE("GPL"); +--- linux-ixp4xx.orig/arch/arm/mach-pxa/tosa.c 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/arch/arm/mach-pxa/tosa.c 2006-02-23 18:17:40.000000000 +0100 +@@ -252,10 +252,19 @@ static struct platform_device tosakbd_de + .id = -1, + }; + ++/* ++ * Tosa LEDs ++ */ ++static struct platform_device tosaled_device = { ++ .name = "tosa-led", ++ .id = -1, ++}; ++ + static struct platform_device *devices[] __initdata = { + &tosascoop_device, + &tosascoop_jc_device, + &tosakbd_device, ++ &tosaled_device, + }; + + static void __init tosa_init(void) +--- linux-ixp4xx.orig/drivers/ide/ide-disk.c 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/drivers/ide/ide-disk.c 2006-02-23 18:17:40.000000000 +0100 +@@ -60,6 +60,7 @@ + #include <linux/genhd.h> + #include <linux/slab.h> + #include <linux/delay.h> ++#include <linux/leds.h> + + #define _IDE_DISK + +@@ -80,6 +81,8 @@ struct ide_disk_obj { + + static DECLARE_MUTEX(idedisk_ref_sem); + ++INIT_LED_TRIGGER(ide_led_trigger); ++ + #define to_ide_disk(obj) container_of(obj, struct ide_disk_obj, kref) + + #define ide_disk_g(disk) \ +@@ -312,10 +315,12 @@ static ide_startstop_t ide_do_rw_disk (i + + if (!blk_fs_request(rq)) { + blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command"); +- ide_end_request(drive, 0, 0); ++ ide_end_rw_disk(drive, 0, 0); + return ide_stopped; + } + ++ led_trigger_event(ide_led_trigger, LED_FULL); ++ + pr_debug("%s: %sing: block=%llu, sectors=%lu, buffer=0x%08lx\n", + drive->name, rq_data_dir(rq) == READ ? "read" : "writ", + (unsigned long long)block, rq->nr_sectors, +@@ -327,6 +332,12 @@ static ide_startstop_t ide_do_rw_disk (i + return __ide_do_rw_disk(drive, rq, block); + } + ++static int ide_end_rw_disk(ide_drive_t *drive, int uptodate, int nr_sectors) ++{ ++ led_trigger_event(ide_led_trigger, LED_OFF); ++ ide_end_request(drive, uptodate, nr_sectors); ++} ++ + /* + * Queries for true maximum capacity of the drive. + * Returns maximum LBA address (> 0) of the drive, 0 if failed. +@@ -1063,7 +1074,7 @@ static ide_driver_t idedisk_driver = { + .media = ide_disk, + .supports_dsc_overlap = 0, + .do_request = ide_do_rw_disk, +- .end_request = ide_end_request, ++ .end_request = ide_end_rw_disk, + .error = __ide_error, + .abort = __ide_abort, + .proc = idedisk_proc, +@@ -1236,11 +1247,13 @@ failed: + + static void __exit idedisk_exit (void) + { ++ led_trigger_unregister_simple(ide_led_trigger); + driver_unregister(&idedisk_driver.gen_driver); + } + + static int __init idedisk_init(void) + { ++ led_trigger_register_simple("ide-disk", &ide_led_trigger); + return driver_register(&idedisk_driver.gen_driver); + } + +--- linux-ixp4xx.orig/drivers/mtd/nand/nand_base.c 2006-02-23 18:13:35.000000000 +0100 ++++ linux-ixp4xx/drivers/mtd/nand/nand_base.c 2006-02-23 18:17:40.000000000 +0100 +@@ -80,6 +80,7 @@ + #include <linux/mtd/compatmac.h> + #include <linux/interrupt.h> + #include <linux/bitops.h> ++#include <linux/leds.h> + #include <asm/io.h> + + #ifdef CONFIG_MTD_PARTITIONS +@@ -515,6 +516,8 @@ static int nand_block_checkbad (struct m + return nand_isbad_bbt (mtd, ofs, allowbbt); + } + ++INIT_LED_TRIGGER(nand_led_trigger); ++ + /* + * Wait for the ready pin, after a command + * The timeout is catched later. +@@ -524,12 +527,14 @@ static void nand_wait_ready(struct mtd_i + struct nand_chip *this = mtd->priv; + unsigned long timeo = jiffies + 2; + ++ led_trigger_event(nand_led_trigger, LED_FULL); + /* wait until command is processed or timeout occures */ + do { + if (this->dev_ready(mtd)) +- return; ++ break; + touch_softlockup_watchdog(); + } while (time_before(jiffies, timeo)); ++ led_trigger_event(nand_led_trigger, LED_OFF); + } + + /** +@@ -817,6 +822,8 @@ static int nand_wait(struct mtd_info *mt + else + timeo += (HZ * 20) / 1000; + ++ led_trigger_event(nand_led_trigger, LED_FULL); ++ + /* Apply this short delay always to ensure that we do wait tWB in + * any case on any machine. */ + ndelay (100); +@@ -840,6 +847,8 @@ static int nand_wait(struct mtd_info *mt + } + cond_resched(); + } ++ led_trigger_event(nand_led_trigger, LED_OFF); ++ + status = (int) this->read_byte(mtd); + return status; + } +@@ -2724,6 +2733,21 @@ void nand_release (struct mtd_info *mtd) + EXPORT_SYMBOL_GPL (nand_scan); + EXPORT_SYMBOL_GPL (nand_release); + ++ ++static int __init nand_base_init(void) ++{ ++ led_trigger_register_simple("nand-disk", &nand_led_trigger); ++ return 0; ++} ++ ++static void nand_base_exit(void) ++{ ++ led_trigger_unregister_simple(nand_led_trigger); ++} ++ ++module_init(nand_base_init); ++module_exit(nand_base_exit); ++ + MODULE_LICENSE ("GPL"); + MODULE_AUTHOR ("Steven J. Hill <sjhill@realitydiluted.com>, Thomas Gleixner <tglx@linutronix.de>"); + MODULE_DESCRIPTION ("Generic NAND flash driver code"); diff --git a/packages/linux/ixp4xx-kernel/2.6.16/05-patch-2.6.16-rc2-ide2 b/packages/linux/ixp4xx-kernel/2.6.16/patch-2.6.16-rc4-ide2 index 3ea46331f6..ea23ff47d3 100644 --- a/packages/linux/ixp4xx-kernel/2.6.16/05-patch-2.6.16-rc2-ide2 +++ b/packages/linux/ixp4xx-kernel/2.6.16/patch-2.6.16-rc4-ide2 @@ -1,6 +1,6 @@ -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/arch/i386/pci/fixup.c linux-2.6.16-rc2/arch/i386/pci/fixup.c ---- linux.vanilla-2.6.16-rc2/arch/i386/pci/fixup.c 2006-02-06 12:21:33.000000000 +0000 -+++ linux-2.6.16-rc2/arch/i386/pci/fixup.c 2006-02-01 14:49:17.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/arch/i386/pci/fixup.c linux-2.6.16-rc4/arch/i386/pci/fixup.c +--- linux.vanilla-2.6.16-rc4/arch/i386/pci/fixup.c 2006-02-20 11:22:15.000000000 +0000 ++++ linux-2.6.16-rc4/arch/i386/pci/fixup.c 2006-02-01 14:49:17.000000000 +0000 @@ -74,52 +74,6 @@ } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810); @@ -54,22 +54,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 static void __devinit pci_fixup_latency(struct pci_dev *d) { /* -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/cdrom/cdrom.c linux-2.6.16-rc2/drivers/cdrom/cdrom.c ---- linux.vanilla-2.6.16-rc2/drivers/cdrom/cdrom.c 2006-02-06 12:21:34.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/cdrom/cdrom.c 2006-01-17 16:34:19.000000000 +0000 -@@ -1131,7 +1131,8 @@ - This ensures that the drive gets unlocked after a mount fails. This - is a goto to avoid bloating the driver with redundant code. */ - clean_up_and_return: -- cdinfo(CD_OPEN, "open failed.\n"); -+ /* Don't log this, its a perfectly normal user occurence */ -+ /* cdinfo(CD_WARNING, "open failed.\n"); */ - if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) { - cdo->lock_door(cdi, 0); - cdinfo(CD_OPEN, "door unlocked.\n"); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/pci/probe.c linux-2.6.16-rc2/drivers/pci/probe.c ---- linux.vanilla-2.6.16-rc2/drivers/pci/probe.c 2006-02-06 12:21:35.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/pci/probe.c 2006-02-01 15:56:28.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/pci/probe.c linux-2.6.16-rc4/drivers/pci/probe.c +--- linux.vanilla-2.6.16-rc4/drivers/pci/probe.c 2006-02-20 11:22:17.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/pci/probe.c 2006-02-01 15:56:28.000000000 +0000 @@ -627,6 +627,7 @@ static int pci_setup_device(struct pci_dev * dev) { @@ -110,21 +97,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 break; case PCI_HEADER_TYPE_BRIDGE: /* bridge header */ -@@ -687,6 +713,10 @@ - dev->class = PCI_CLASS_NOT_DEFINED; - } - -+ /* BIOS enabled, so assume there is a good reason */ -+ pci_read_config_word(dev, PCI_COMMAND, &cmd); -+ if(cmd & PCI_COMMAND_MASTER) -+ dev->is_enabled = 1; - /* We found a fine healthy device, go go go... */ - return 0; - } -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/ata_generic.c linux-2.6.16-rc2/drivers/scsi/ata_generic.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/ata_generic.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/ata_generic.c 2006-02-07 13:47:27.337665568 +0000 -@@ -0,0 +1,242 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/ata_generic.c linux-2.6.16-rc4/drivers/scsi/ata_generic.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/ata_generic.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/ata_generic.c 2006-02-16 15:35:41.000000000 +0000 +@@ -0,0 +1,241 @@ +/* + * ata_generic.c - Generic PATA/SATA controller driver. + * Copyright 2005 Red Hat Inc <alan@redhat.com>, all rights reserved. @@ -198,7 +174,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* FIXME: at some point in the future this should become + a library helper which reads the disk modes from the + disk as well */ -+ if(dma_enabled & (1 << (5 + i))) { ++ if (dma_enabled & (1 << (5 + i))) { + dev->xfer_mode = XFER_MW_DMA_0; + dev->xfer_shift = ATA_SHIFT_MWDMA; + dev->flags &= ~ATA_DFLAG_PIO; @@ -323,7 +299,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +} + +static struct pci_device_id pata_generic[] = { -+ { PCI_DEVICE(PCI_VENDOR_ID_NS,PCI_DEVICE_ID_NS_87410),}, + { PCI_DEVICE(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), }, + { PCI_DEVICE(PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), }, + { PCI_DEVICE(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F), }, @@ -367,9 +342,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(pata_generic_init); +module_exit(pata_generic_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/ata_piix.c linux-2.6.16-rc2/drivers/scsi/ata_piix.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/ata_piix.c 2006-02-06 12:21:35.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/ata_piix.c 2006-02-06 12:28:58.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/ata_piix.c linux-2.6.16-rc4/drivers/scsi/ata_piix.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/ata_piix.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/ata_piix.c 2006-02-20 20:06:17.000000000 +0000 @@ -91,9 +91,10 @@ #include <linux/device.h> #include <scsi/scsi_host.h> @@ -378,7 +353,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 #define DRV_NAME "ata_piix" -#define DRV_VERSION "1.05" -+#define DRV_VERSION "1.05-ac1" ++#define DRV_VERSION "1.05-ac7" enum { PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ @@ -522,7 +497,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, -@@ -259,13 +356,9 @@ +@@ -253,47 +350,39 @@ + }; + + static struct ata_port_info piix_port_info[] = { +- /* ich5_pata */ ++ /* ich5_pata: 0*/ + { + .sht = &piix_sht, .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST | PIIX_FLAG_CHECKINTR, .pio_mask = 0x1f, /* pio0-4 */ @@ -531,13 +513,28 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 -#else - .mwdma_mask = 0x00, /* mwdma broken */ -#endif - .udma_mask = 0x3f, /* udma0-5 */ +- .udma_mask = 0x3f, /* udma0-5 */ - .port_ops = &piix_pata_ops, ++ .udma_mask = ATA_UDMA6, + .port_ops = &ich_pata_ops, }, - /* ich5_sata */ -@@ -284,11 +377,7 @@ +- /* ich5_sata */ ++ /* ich5_sata: 1 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | + PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ +- .udma_mask = 0x7f, /* udma0-6 */ ++ .udma_mask = ATA_UDMA6, + .port_ops = &piix_sata_ops, + }, + +- /* piix4_pata */ ++ /* piix4_pata: 2 */ + { .sht = &piix_sht, .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, .pio_mask = 0x1f, /* pio0-4 */ @@ -549,62 +546,86 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .udma_mask = ATA_UDMA_MASK_40C, .port_ops = &piix_pata_ops, }, -@@ -316,6 +405,116 @@ - .udma_mask = 0x7f, /* udma0-6 */ + +- /* ich6_sata */ ++ /* ich6_sata: 3 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | +@@ -301,11 +390,11 @@ + ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ +- .udma_mask = 0x7f, /* udma0-6 */ ++ .udma_mask = ATA_UDMA6, + .port_ops = &piix_sata_ops, + }, + +- /* ich6_sata_ahci */ ++ /* ich6_sata_ahci: 4 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_SRST | +@@ -313,9 +402,119 @@ + ATA_FLAG_SLAVE_POSS | PIIX_FLAG_AHCI, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ +- .udma_mask = 0x7f, /* udma0-6 */ ++ .udma_mask = ATA_UDMA6, .port_ops = &piix_sata_ops, }, + -+ /* ich0_pata */ ++ /* ich0_pata: 5 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* MWDMA0 is broken on chip */ -+ .udma_mask = 0x07, /* UDMA33 only */ ++ .udma_mask = ATA_UDMA4, + .port_ops = &ich_pata_ops, + }, + -+ /* ich2_pata */ ++ /* ich2_pata: 6 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* MWDMA0 is broken on chip */ -+ .udma_mask = 0x1f, /* UDMA100 */ ++ .udma_mask = ATA_UDMA5, + .port_ops = &ich_pata_ops, + }, + -+ /* ich3_pata */ ++ /* ich3_pata: 7 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* MWDMA0 is broken on chip */ -+ .udma_mask = 0x1f, /* UDMA100 */ ++ .udma_mask = ATA_UDMA5, + .port_ops = &ich_pata_ops, + }, + -+ /* ich4_pata */ ++ /* ich4_pata: 8 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x1f, /* UDMA100 */ ++ .udma_mask = ATA_UDMA5, + .port_ops = &ich_pata_ops, + }, + -+ /* cich_pata */ ++ /* cich_pata: 9 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x1f, /* UDMA100 */ ++ .udma_mask = ATA_UDMA5, + .port_ops = &ich_pata_ops, + }, + -+ /* piix3_pata */ ++ /* piix3_pata: 10 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, @@ -614,53 +635,53 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .port_ops = &piix_pata_ops, + }, + -+ /* esb_pata */ ++ /* esb_pata: 11 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x1f, /* UDMA100 */ ++ .udma_mask = ATA_UDMA5, + .port_ops = &piix_pata_ops, + }, + -+ /* ich_pata */ ++ /* ich_pata: 12 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x07, /* UDMA66 */ ++ .udma_mask = ATA_UDMA4, /* UDMA66 */ + .port_ops = &ich_pata_ops, + }, + -+ /* ich6_pata */ ++ /* ich6_pata: 13 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x3f, /* UDMA133 */ ++ .udma_mask = ATA_UDMA6, /* UDMA133 */ + .port_ops = &ich_pata_ops, + }, + -+ /* ich7_pata */ ++ /* ich7_pata: 14 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x3f, /* UDMA133 */ ++ .udma_mask = ATA_UDMA6, + .port_ops = &ich_pata_ops, + }, + -+ /* esb2_pata */ ++ /* esb2_pata: 15 */ + { + .sht = &piix_sht, + .host_flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, + .pio_mask = 0x1f, /* pio 0-4 */ + .mwdma_mask = 0x06, /* Check: maybe 0x07 */ -+ .udma_mask = 0x1f, /* UDMA100 -- CHECKME --*/ ++ .udma_mask = ATA_UDMA5, + .port_ops = &ich_pata_ops, + }, }; @@ -784,7 +805,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Ensure the UDMA bit is off - it will be turned back on if + UDMA is selected */ + -+ if(ap->udma_mask) { ++ if (ap->udma_mask) { + pci_read_config_byte(dev, 0x48, &udma_enable); + udma_enable &= ~(1 << (2 * ap->hard_port_no + adev->devno)); + pci_write_config_byte(dev, 0x48, udma_enable); @@ -873,7 +894,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 - pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); + unsigned int udma = adev->dma_mode - XFER_UDMA_0; + u16 udma_timing; -+ u32 ideconf; ++ u16 ideconf; + int u_clock, u_speed; + + /* @@ -899,14 +920,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + udma_timing |= u_speed << (4 * devid); + pci_write_config_word(dev, 0x4A, udma_timing); + -+ if(isich) { ++ if (isich) { + /* Select a 33/66/100Mhz clock */ -+ pci_read_config_dword(dev, 0x54, &ideconf); ++ pci_read_config_word(dev, 0x54, &ideconf); + ideconf &= ~(0x1001 << devid); + ideconf |= u_clock << devid; + /* For ICH or later we should set bit 10 for better + performance (WR_PingPong_En) */ -+ pci_write_config_dword(dev, 0x54, ideconf); ++ pci_write_config_word(dev, 0x54, ideconf); } - if ((reg4a & a_speed) != u_speed) - pci_write_config_word(dev, 0x4a, (reg4a & ~a_speed) | u_speed); @@ -966,7 +987,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_word(dev, master_port, master_data); } + /* Don't scribble on 0x48 if the controller does not support UDMA */ -+ if(ap->udma_mask) ++ if (ap->udma_mask) + pci_write_config_byte(dev, 0x48, udma_enable); +} + @@ -1003,10 +1024,30 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 } #define AHCI_PCI_BAR 5 -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/Kconfig linux-2.6.16-rc2/drivers/scsi/Kconfig ---- linux.vanilla-2.6.16-rc2/drivers/scsi/Kconfig 2006-02-06 12:21:35.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/Kconfig 2006-02-07 13:48:49.000000000 +0000 -@@ -599,6 +599,289 @@ +@@ -646,15 +967,15 @@ + pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); + pci_read_config_word(pdev, 0x41, &cfg); + /* Only on the original revision: IDE DMA can hang */ +- if(rev == 0x00) ++ if (rev == 0x00) + no_piix_dma = 1; + /* On all revisions below 5 PXB bus lock must be disabled for IDE */ +- else if(cfg & (1<<14) && rev < 5) ++ else if (cfg & (1<<14) && rev < 5) + no_piix_dma = 2; + } +- if(no_piix_dma) ++ if (no_piix_dma) + dev_printk(KERN_WARNING, &ata_dev->dev, "450NX errata present, disabling IDE DMA.\n"); +- if(no_piix_dma == 2) ++ if (no_piix_dma == 2) + dev_printk(KERN_WARNING, &ata_dev->dev, "A BIOS update may resolve this.\n"); + return no_piix_dma; + } +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/Kconfig linux-2.6.16-rc4/drivers/scsi/Kconfig +--- linux.vanilla-2.6.16-rc4/drivers/scsi/Kconfig 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/Kconfig 2006-02-20 17:27:24.000000000 +0000 +@@ -599,6 +599,316 @@ depends on IDE=y && !BLK_DEV_IDE_SATA && (SCSI_SATA_AHCI || SCSI_ATA_PIIX) default y @@ -1190,11 +1231,20 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + If unsure, say N. + ++config SCSI_PATA_NS87410 ++ tristate "Nat Semi NS87410 PATA support (Experimental)" ++ depends on SCSI_SATA && PCI ++ help ++ This option enables support for the National Semiconductor ++ NS87410 PCI-IDE controller. ++ ++ If unsure, say N. ++ +config SCSI_PATA_OLDPIIX + tristate "Intel PATA old PIIX support (Raving Lunatic)" + depends on SCSI_SATA && PCI && EXPERIMENTAL + help -+ This option enables support for old(?) PIIX PATA support. ++ This option enables support for early PIIX PATA interfaces. + + If unsure, say N. + @@ -1209,19 +1259,37 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +config SCSI_PATA_PCMCIA + tristate "PCMCIA PATA support (Raving Lunatic)" -+ depends on SCSI_SATA ++ depends on SCSI_SATA && PCMCIA + help + This option enables support for PCMCIA ATA interfaces, including + compact flash card adapters via the new ATA layer. + + If unsure, say N. + ++config SCSI_PATA_PDC_OLD ++ tristate "Older Promise PATA controller support (Raving Lunatic)" ++ depends on SCSI_SATA && PCI && EXPERIMENTAL ++ help ++ This option enables support for the Promise 20246, 20262, 20263, ++ 20265 and 20267 adapters. ++ ++ If unsure, say N. ++ +config SCSI_PATA_QDI + tristate "QDI VLB PATA support" + depends on SCSI_SATA + help + Support for QDI 6500 and 6580 PATA controllers on VESA local bus. + ++config SCSI_PATA_RADISYS ++ tristate "RADISYS 82600 PATA support (Raving Lunatic)" ++ depends on SCSI_SATA && PCI && EXPERIMENTAL ++ help ++ This option enables support for the RADISYS 82600 ++ PATA controllers via the new ATA layer ++ ++ If unsure, say N. ++ +config SCSI_PATA_RZ1000 + tristate "PC Tech RZ1000 PATA support" + depends on SCSI_SATA && PCI @@ -1296,9 +1364,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 config SCSI_BUSLOGIC tristate "BusLogic SCSI support" depends on (PCI || ISA || MCA) && SCSI && ISA_DMA_API -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/libata-core.c linux-2.6.16-rc2/drivers/scsi/libata-core.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/libata-core.c 2006-02-06 12:21:35.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/libata-core.c 2006-02-07 11:23:41.765951784 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/libata-core.c linux-2.6.16-rc4/drivers/scsi/libata-core.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/libata-core.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/libata-core.c 2006-02-23 13:37:47.358092040 +0000 @@ -68,9 +68,10 @@ static void ata_dev_init_params(struct ata_port *ap, struct ata_device *dev); static void ata_set_mode(struct ata_port *ap); @@ -1311,15 +1379,15 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 u8 *xfer_mode_out, unsigned int *xfer_shift_out); static void __ata_qc_complete(struct ata_queued_cmd *qc); -@@ -614,7 +615,7 @@ - } else if (lba48 && (qc->ap->flags & ATA_FLAG_PIO_LBA48)) { - /* Unable to use DMA due to host limitation */ - tf->protocol = ATA_PROT_PIO; -- index = dev->multi_count ? 0 : 4; -+ index = dev->multi_count ? 0 : 8; - } else { - tf->protocol = ATA_PROT_DMA; - index = 16; +@@ -78,7 +79,7 @@ + static unsigned int ata_unique_id = 1; + static struct workqueue_struct *ata_wq; + +-int atapi_enabled = 0; ++int atapi_enabled = 1; + module_param(atapi_enabled, int, 0444); + MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); + @@ -1205,6 +1206,48 @@ return 0; } @@ -1392,7 +1460,33 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 } /* ATAPI-specific feature tests */ -@@ -1497,7 +1547,11 @@ +@@ -1485,10 +1535,24 @@ + ap->ops->phy_reset(ap); + if (ap->flags & ATA_FLAG_PORT_DISABLED) + goto err_out; ++ ++ /* The reset means we are in PIO 0, but the controller may not ++ yet be correctly set up and may have old BIOS settings, or just ++ no settings at all. Set all the devices to PIO 0 */ ++ ++ for (i = 0; i < ATA_MAX_DEVICES; i++) ++ ap->device[i].pio_mode = XFER_PIO_0; + + for (i = 0; i < ATA_MAX_DEVICES; i++) { ++ struct ata_device *adev = & ap->device[i]; ++ ++ /* Set up the controller on this port for PIO 0. We must not ++ send the drive speed setting commands at this point */ ++ if (ap->ops->set_piomode) ++ ap->ops->set_piomode(ap, adev); ++ + ata_dev_identify(ap, i); +- if (ata_dev_present(&ap->device[i])) { ++ if (ata_dev_present(adev)) { + found = 1; + ata_dev_config(ap,i); + } +@@ -1497,7 +1561,11 @@ if ((!found) || (ap->flags & ATA_FLAG_PORT_DISABLED)) goto err_out_disable; @@ -1405,7 +1499,31 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 if (ap->flags & ATA_FLAG_PORT_DISABLED) goto err_out_disable; -@@ -1824,16 +1878,19 @@ +@@ -1612,6 +1680,23 @@ + } + + /** ++ * ata_dev_pair - return other device on cable ++ * @ap: port ++ * @adev: device ++ * ++ * Obtain the other device on the same cable, or if none is ++ * present NULL is returned ++ */ ++ ++struct ata_device *ata_dev_pair(struct ata_port *ap, struct ata_device *adev) ++{ ++ struct ata_device *pair = &ap->device[1 - adev->devno]; ++ if (!ata_dev_present(pair)) ++ return NULL; ++ return pair; ++} ++ ++/** + * ata_port_disable - Disable port. + * @ap: Port to be disabled. + * +@@ -1824,16 +1909,19 @@ ap->id, dev->devno, xfer_mode_str[idx]); } @@ -1429,7 +1547,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 return -1; } -@@ -1843,34 +1900,24 @@ +@@ -1843,34 +1931,24 @@ DPRINTK("base 0x%x xfer_mode 0x%x mask 0x%x x %d\n", (int)base, (int)xfer_mode, mask, x); @@ -1477,7 +1595,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 } } -@@ -1886,32 +1933,64 @@ +@@ -1886,32 +1964,64 @@ */ static void ata_set_mode(struct ata_port *ap) { @@ -1521,12 +1639,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + rc = ata_host_set_pio(ap, adev); + if (rc) + goto err_out; -+ -+ /* step 2: if that xfer mode isn't PIO, set host DMA timings */ -+ if (xfer_shift[i] != ATA_SHIFT_PIO) { -+ ata_host_set_dma(ap, adev, xfer_mode[i], xfer_shift[i]); -+ used_dma = 1; -+ } - /* step 3: if that xfer mode isn't PIO, set host DMA timings */ - if (xfer_shift != ATA_SHIFT_PIO) @@ -1535,6 +1647,12 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 - /* step 4: update devices' xfer mode */ - ata_dev_set_mode(ap, &ap->device[0]); - ata_dev_set_mode(ap, &ap->device[1]); ++ /* step 2: if that xfer mode isn't PIO, set host DMA timings */ ++ if (xfer_shift[i] != ATA_SHIFT_PIO) { ++ ata_host_set_dma(ap, adev, xfer_mode[i], xfer_shift[i]); ++ used_dma = 1; ++ } ++ + /* In some cases the DMA mode will cause the driver to + update the pio mode to match chip limits. */ + @@ -1560,7 +1678,118 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 if (ap->ops->post_set_mode) ap->ops->post_set_mode(ap); -@@ -2256,76 +2335,57 @@ +@@ -2200,132 +2310,126 @@ + } + + static const char * const ata_dma_blacklist [] = { +- "WDC AC11000H", +- "WDC AC22100H", +- "WDC AC32500H", +- "WDC AC33100H", +- "WDC AC31600H", +- "WDC AC32100H", +- "WDC AC23200L", +- "Compaq CRD-8241B", +- "CRD-8400B", +- "CRD-8480B", +- "CRD-8482B", +- "CRD-84", +- "SanDisk SDP3B", +- "SanDisk SDP3B-64", +- "SANYO CD-ROM CRD", +- "HITACHI CDR-8", +- "HITACHI CDR-8335", +- "HITACHI CDR-8435", +- "Toshiba CD-ROM XM-6202B", +- "TOSHIBA CD-ROM XM-1702BC", +- "CD-532E-A", +- "E-IDE CD-ROM CR-840", +- "CD-ROM Drive/F5A", +- "WPI CDD-820", +- "SAMSUNG CD-ROM SC-148C", +- "SAMSUNG CD-ROM SC", +- "SanDisk SDP3B-64", +- "ATAPI CD-ROM DRIVE 40X MAXIMUM", +- "_NEC DV5800A", ++ "WDC AC11000H", NULL, ++ "WDC AC22100H", NULL, ++ "WDC AC32500H", NULL, ++ "WDC AC33100H", NULL, ++ "WDC AC31600H", NULL, ++ "WDC AC32100H", "24.09P07", ++ "WDC AC23200L", "21.10N21", ++ "Compaq CRD-8241B", NULL, ++ "CRD-8400B", NULL, ++ "CRD-8480B", NULL, ++ "CRD-8482B", NULL, ++ "CRD-84", NULL, ++ "SanDisk SDP3B", NULL, ++ "SanDisk SDP3B-64", NULL, ++ "SANYO CD-ROM CRD", NULL, ++ "HITACHI CDR-8", NULL, ++ "HITACHI CDR-8335", NULL, ++ "HITACHI CDR-8435", NULL, ++ "Toshiba CD-ROM XM-6202B", NULL, ++ "TOSHIBA CD-ROM XM-1702BC", NULL, ++ "CD-532E-A", NULL, ++ "E-IDE CD-ROM CR-840", NULL, ++ "CD-ROM Drive/F5A", NULL, ++ "WPI CDD-820", NULL, ++ "SAMSUNG CD-ROM SC-148C", NULL, ++ "SAMSUNG CD-ROM SC", NULL, ++ "SanDisk SDP3B-64", NULL, ++ "ATAPI CD-ROM DRIVE 40X MAXIMUM",NULL, ++ "_NEC DV5800A", NULL, ++ "SAMSUNG CD-ROM SN-124", "N001" + }; + +-static int ata_dma_blacklisted(const struct ata_device *dev) ++static int ata_strim(char *s, size_t len) + { +- unsigned char model_num[40]; +- char *s; +- unsigned int len; +- int i; +- +- ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, +- sizeof(model_num)); +- s = &model_num[0]; +- len = strnlen(s, sizeof(model_num)); ++ len = strnlen(s, len); + + /* ATAPI specifies that empty space is blank-filled; remove blanks */ + while ((len > 0) && (s[len - 1] == ' ')) { + len--; + s[len] = 0; + } ++ return len; ++} + +- for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i++) +- if (!strncmp(ata_dma_blacklist[i], s, len)) +- return 1; ++static int ata_dma_blacklisted(const struct ata_device *dev) ++{ ++ unsigned char model_num[40]; ++ unsigned char model_rev[16]; ++ unsigned int nlen, rlen; ++ int i; + ++ ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, ++ sizeof(model_num)); ++ ata_dev_id_string(dev->id, model_rev, ATA_ID_FW_REV_OFS, ++ sizeof(model_rev)); ++ nlen = ata_strim(model_num, sizeof(model_num)); ++ rlen = ata_strim(model_rev, sizeof(model_rev)); ++ ++ for (i = 0; i < ARRAY_SIZE(ata_dma_blacklist); i += 2) { ++ if (!strncmp(ata_dma_blacklist[i], model_num, nlen)) { ++ if (ata_dma_blacklist[i+1] == NULL) ++ return 1; ++ if (!strncmp(ata_dma_blacklist[i], model_rev, rlen)) ++ return 1; ++ } ++ } return 0; } @@ -1614,6 +1843,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + mask = 0; + ata_pr_blacklisted(ap, adev); } ++ /* 40 pin cable enforcement */ ++ if (ap->cbl == ATA_CBL_PATA40) ++ mask &= ~ATA_UDMA_MASK_40C; } else if (shift == ATA_SHIFT_MWDMA) { mask = ap->mwdma_mask; @@ -1658,11 +1890,12 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 } - } - else { -+ } else if (shift != ATA_SHIFT_PIO) { - mask = 0xffffffff; /* shut up compiler warning */ - BUG(); - } - +- mask = 0xffffffff; /* shut up compiler warning */ +- BUG(); +- } +- ++ } else if (shift != ATA_SHIFT_PIO) ++ panic("gmm:bad shift"); /* BUG confuses the compiler */ + /* + * Allow the controller to see the proposed mode and + * device data to do any custom filtering rules. @@ -1672,7 +1905,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 return mask; } -@@ -2345,6 +2405,7 @@ +@@ -2345,6 +2449,7 @@ /** * ata_choose_xfer_mode - attempt to find best transfer mode * @ap: Port for which an xfer mode will be selected @@ -1680,7 +1913,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 * @xfer_mode_out: (output) SET FEATURES - XFER MODE code * @xfer_shift_out: (output) bit shift that selects this mode * -@@ -2359,6 +2420,7 @@ +@@ -2359,6 +2464,7 @@ */ static int ata_choose_xfer_mode(const struct ata_port *ap, @@ -1688,7 +1921,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 u8 *xfer_mode_out, unsigned int *xfer_shift_out) { -@@ -2367,7 +2429,7 @@ +@@ -2367,7 +2473,7 @@ for (i = 0; i < ARRAY_SIZE(xfer_mode_classes); i++) { shift = xfer_mode_classes[i].shift; @@ -1697,22 +1930,41 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 x = fgb(mask); if (x >= 0) { -@@ -3010,7 +3072,7 @@ +@@ -3000,6 +3106,7 @@ + /** + * ata_mmio_data_xfer - Transfer data by MMIO + * @ap: port to read/write ++ * @adev: device to target + * @buf: data buffer + * @buflen: buffer length + * @write_data: read/write +@@ -3010,8 +3117,8 @@ * Inherited from caller. */ -static void ata_mmio_data_xfer(struct ata_port *ap, unsigned char *buf, -+void ata_mmio_data_xfer(struct ata_port *ap, unsigned char *buf, - unsigned int buflen, int write_data) +- unsigned int buflen, int write_data) ++void ata_mmio_data_xfer(struct ata_port *ap, struct ata_device *adev, ++ unsigned char *buf, unsigned int buflen, int write_data) { unsigned int i; -@@ -3055,11 +3117,11 @@ + unsigned int words = buflen >> 1; +@@ -3045,6 +3152,7 @@ + /** + * ata_pio_data_xfer - Transfer data by PIO + * @ap: port to read/write ++ * @adev: device to target + * @buf: data buffer + * @buflen: buffer length + * @write_data: read/write +@@ -3055,11 +3163,11 @@ * Inherited from caller. */ -static void ata_pio_data_xfer(struct ata_port *ap, unsigned char *buf, -+void ata_pio_data_xfer(struct ata_port *ap, unsigned char *buf, - unsigned int buflen, int write_data) +- unsigned int buflen, int write_data) ++void ata_pio_data_xfer(struct ata_port *ap, struct ata_device *adev, ++ unsigned char *buf, unsigned int buflen, int write_data) { unsigned int words = buflen >> 1; - @@ -1720,13 +1972,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 /* Transfer multiple of 2 bytes */ if (write_data) outsw(ap->ioaddr.data_addr, buf, words); -@@ -3082,36 +3144,53 @@ +@@ -3082,36 +3190,55 @@ } /** - * ata_data_xfer - Transfer data from/to the data register. + * ata_pio_data_xfer_noirq - Transfer data from/to the data register. * @ap: port to read/write ++ * @adev: device to target * @buf: data buffer * @buflen: buffer length * @do_write: read/write @@ -1741,8 +1994,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 */ -static void ata_data_xfer(struct ata_port *ap, unsigned char *buf, -+void ata_pio_data_xfer_noirq(struct ata_port *ap, unsigned char *buf, - unsigned int buflen, int do_write) +- unsigned int buflen, int do_write) ++void ata_pio_data_xfer_noirq(struct ata_port *ap, struct ata_device *adev, ++ unsigned char *buf, unsigned int buflen, int do_write) { /* Make the crap hardware pay the costs not the good stuff */ - if (unlikely(ap->flags & ATA_FLAG_IRQ_MASK)) { @@ -1761,13 +2015,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 - } + unsigned long flags; + local_irq_save(flags); -+ ata_pio_data_xfer(ap, buf, buflen, do_write); ++ ata_pio_data_xfer(ap, adev, buf, buflen, do_write); + local_irq_restore(flags); +} + +/** + * ata_mmio_data_xfer_noirq - Transfer data from/to the data register. + * @ap: address to read/write ++ * @adev: device to target + * @buf: data buffer + * @buflen: buffer length + * @do_write: read/write @@ -1780,45 +2035,45 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * Inherited from caller. + */ + -+void ata_mmio_data_xfer_noirq(struct ata_port *ap, unsigned char *buf, -+ unsigned int buflen, int do_write) ++void ata_mmio_data_xfer_noirq(struct ata_port *ap, struct ata_device *adev, ++ unsigned char *buf, unsigned int buflen, int do_write) +{ + /* Make the crap hardware pay the costs not the good stuff */ + unsigned long flags; + local_irq_save(flags); -+ ata_mmio_data_xfer(ap, buf, buflen, do_write); ++ ata_mmio_data_xfer(ap, adev, buf, buflen, do_write); + local_irq_restore(flags); } /** -@@ -3157,7 +3236,7 @@ +@@ -3157,7 +3284,7 @@ /* do the actual data transfer */ do_write = (qc->tf.flags & ATA_TFLAG_WRITE); - ata_data_xfer(ap, buf, ATA_SECT_SIZE, do_write); -+ ap->ops->data_xfer(ap, buf, ATA_SECT_SIZE, do_write); ++ ap->ops->data_xfer(ap, qc->dev, buf, ATA_SECT_SIZE, do_write); kunmap(page); } -@@ -3204,7 +3283,7 @@ +@@ -3204,7 +3331,7 @@ ap->id, bytes); for (i = 0; i < words; i++) - ata_data_xfer(ap, (unsigned char*)pad_buf, 2, do_write); -+ ap->ops->data_xfer(ap, (unsigned char*)pad_buf, 2, do_write); ++ ap->ops->data_xfer(ap, qc->dev, (unsigned char*)pad_buf, 2, do_write); ap->hsm_task_state = HSM_ST_LAST; return; -@@ -3239,7 +3318,7 @@ +@@ -3239,7 +3366,7 @@ DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read"); /* do the actual data transfer */ - ata_data_xfer(ap, buf, count, do_write); -+ ap->ops->data_xfer(ap, buf, count, do_write); ++ ap->ops->data_xfer(ap, qc->dev, buf, count, do_write); kunmap(page); -@@ -3947,14 +4026,15 @@ +@@ -3948,14 +4075,15 @@ void ata_bmdma_irq_clear(struct ata_port *ap) { @@ -1842,22 +2097,22 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 } -@@ -4193,12 +4273,12 @@ +@@ -4194,12 +4322,12 @@ */ spin_lock_irqsave(&ap->host_set->lock, flags); ap->flags &= ~ATA_FLAG_NOINTR; - ata_data_xfer(ap, qc->cdb, ap->cdb_len, 1); -+ ap->ops->data_xfer(ap, qc->cdb, ap->cdb_len, 1); ++ ap->ops->data_xfer(ap, qc->dev, qc->cdb, ap->cdb_len, 1); if (qc->tf.protocol == ATA_PROT_ATAPI_DMA) ap->ops->bmdma_start(qc); /* initiate bmdma */ spin_unlock_irqrestore(&ap->host_set->lock, flags); } else { - ata_data_xfer(ap, qc->cdb, ap->cdb_len, 1); -+ ap->ops->data_xfer(ap, qc->cdb, ap->cdb_len, 1); ++ ap->ops->data_xfer(ap, qc->dev, qc->cdb, ap->cdb_len, 1); /* PIO commands are handled by polling */ ap->hsm_task_state = HSM_ST; -@@ -4504,7 +4584,7 @@ +@@ -4505,7 +4633,7 @@ * Number of ports registered. Zero on error (no ports registered). */ @@ -1866,7 +2121,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 { unsigned int count = 0, i; struct device *dev = ent->dev; -@@ -4524,6 +4604,9 @@ +@@ -4525,6 +4653,9 @@ host_set->mmio_base = ent->mmio_base; host_set->private_data = ent->private_data; host_set->ops = ent->port_ops; @@ -1876,7 +2131,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 /* register each port bound to this device */ for (i = 0; i < ent->n_ports; i++) { -@@ -4535,6 +4618,14 @@ +@@ -4536,6 +4667,14 @@ goto err_out; host_set->ports[i] = ap; @@ -1891,7 +2146,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 xfer_mode_mask =(ap->udma_mask << ATA_SHIFT_UDMA) | (ap->mwdma_mask << ATA_SHIFT_MWDMA) | (ap->pio_mask << ATA_SHIFT_PIO); -@@ -4551,6 +4642,7 @@ +@@ -4552,6 +4691,7 @@ ent->irq); ata_chk_status(ap); @@ -1899,7 +2154,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 host_set->ops->irq_clear(ap); count++; } -@@ -4604,7 +4696,8 @@ +@@ -4605,7 +4745,8 @@ ata_scsi_scan_host(ap); } @@ -1909,7 +2164,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 VPRINTK("EXIT, returning %u\n", ent->n_ports); return ent->n_ports; /* success */ -@@ -4778,6 +4871,7 @@ +@@ -4779,6 +4920,7 @@ { struct ata_probe_ent *probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port[0]); @@ -1917,7 +2172,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 int p = 0; if (!probe_ent) -@@ -4792,7 +4886,13 @@ +@@ -4793,7 +4935,13 @@ probe_ent->port[p].altstatus_addr = probe_ent->port[p].ctl_addr = pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS; @@ -1932,7 +2187,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 ata_std_ports(&probe_ent->port[p]); p++; } -@@ -4802,7 +4902,14 @@ +@@ -4803,7 +4951,14 @@ probe_ent->port[p].altstatus_addr = probe_ent->port[p].ctl_addr = pci_resource_start(pdev, 3) | ATA_PCI_CTL_OFS; @@ -1948,7 +2203,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 ata_std_ports(&probe_ent->port[p]); p++; } -@@ -4814,6 +4921,7 @@ +@@ -4815,6 +4970,7 @@ static struct ata_probe_ent *ata_pci_init_legacy_port(struct pci_dev *pdev, struct ata_port_info *port, int port_num) { struct ata_probe_ent *probe_ent; @@ -1956,7 +2211,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 probe_ent = ata_probe_ent_alloc(pci_dev_to_dev(pdev), port); if (!probe_ent) -@@ -4839,7 +4947,13 @@ +@@ -4840,7 +4996,13 @@ probe_ent->port[0].ctl_addr = 0x376; break; } @@ -1971,7 +2226,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 ata_std_ports(&probe_ent->port[0]); return probe_ent; } -@@ -5080,6 +5194,33 @@ +@@ -5081,6 +5243,33 @@ pci_set_master(pdev); return 0; } @@ -2005,7 +2260,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 #endif /* CONFIG_PCI */ -@@ -5157,6 +5298,10 @@ +@@ -5158,6 +5347,10 @@ EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear); EXPORT_SYMBOL_GPL(ata_bmdma_status); EXPORT_SYMBOL_GPL(ata_bmdma_stop); @@ -2016,7 +2271,15 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 EXPORT_SYMBOL_GPL(ata_port_probe); EXPORT_SYMBOL_GPL(sata_phy_reset); EXPORT_SYMBOL_GPL(__sata_phy_reset); -@@ -5186,6 +5331,8 @@ +@@ -5175,6 +5368,7 @@ + EXPORT_SYMBOL_GPL(ata_dev_config); + EXPORT_SYMBOL_GPL(ata_scsi_simulate); + ++EXPORT_SYMBOL_GPL(ata_dev_pair); + EXPORT_SYMBOL_GPL(ata_pio_need_iordy); + EXPORT_SYMBOL_GPL(ata_timing_compute); + EXPORT_SYMBOL_GPL(ata_timing_merge); +@@ -5187,6 +5381,8 @@ EXPORT_SYMBOL_GPL(ata_pci_remove_one); EXPORT_SYMBOL_GPL(ata_pci_device_suspend); EXPORT_SYMBOL_GPL(ata_pci_device_resume); @@ -2025,10 +2288,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 #endif /* CONFIG_PCI */ EXPORT_SYMBOL_GPL(ata_device_suspend); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/Makefile linux-2.6.16-rc2/drivers/scsi/Makefile ---- linux.vanilla-2.6.16-rc2/drivers/scsi/Makefile 2006-02-06 12:21:35.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/Makefile 2006-02-07 13:49:19.944546720 +0000 -@@ -139,6 +139,39 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/Makefile linux-2.6.16-rc4/drivers/scsi/Makefile +--- linux.vanilla-2.6.16-rc4/drivers/scsi/Makefile 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/Makefile 2006-02-17 18:20:44.000000000 +0000 +@@ -139,6 +139,42 @@ obj-$(CONFIG_SCSI_SATA_MV) += libata.o sata_mv.o obj-$(CONFIG_SCSI_PDC_ADMA) += libata.o pdc_adma.o @@ -2050,10 +2313,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +obj-$(CONFIG_SCSI_PATA_IT821X) += libata.o pata_it821x.o +obj-$(CONFIG_SCSI_PATA_MPIIX) += libata.o pata_mpiix.o +obj-$(CONFIG_SCSI_PATA_NETCELL) += libata.o pata_netcell.o ++obj-$(CONFIG_SCSI_PATA_NS87410) += libata.o pata_ns87410.o +obj-$(CONFIG_SCSI_PATA_OLDPIIX) += libata.o pata_oldpiix.o +obj-$(CONFIG_SCSI_PATA_OPTI) += libata.o pata_opti.o +obj-$(CONFIG_SCSI_PATA_PCMCIA) += libata.o pata_pcmcia.o ++obj-$(CONFIG_SCSI_PATA_PDC_OLD) += libata.o pata_pdc202xx_old.o +obj-$(CONFIG_SCSI_PATA_QDI) += libata.o pata_qdi.o ++obj-$(CONFIG_SCSI_PATA_RADISYS) += libata.o pata_radisys.o +obj-$(CONFIG_SCSI_PATA_RZ1000) += libata.o pata_rz1000.o +obj-$(CONFIG_SCSI_PATA_SERVERWORKS) += libata.o pata_serverworks.o +obj-$(CONFIG_SCSI_PATA_SC1200) += libata.o pata_sc1200.o @@ -2068,10 +2334,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 obj-$(CONFIG_ARM) += arm/ obj-$(CONFIG_CHR_DEV_ST) += st.o -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_ali.c linux-2.6.16-rc2/drivers/scsi/pata_ali.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_ali.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_ali.c 2006-02-07 13:41:31.570750360 +0000 -@@ -0,0 +1,602 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_ali.c linux-2.6.16-rc4/drivers/scsi/pata_ali.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_ali.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_ali.c 2006-02-20 12:28:04.000000000 +0000 +@@ -0,0 +1,606 @@ +/* + * ata-ali.c - ALI 15x3 PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -2110,7 +2376,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "ali" -+#define DRV_VERSION "0.1.1" ++#define DRV_VERSION "0.2.2" + +/** + * ali_c2_cable_detect - cable detection @@ -2127,13 +2393,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + implement the detect logic */ + + /* Fujitsu P2000 */ -+ if(pdev->subsystem_vendor == 0x10CF && pdev->subsystem_device == 0x10AF) ++ if (pdev->subsystem_vendor == 0x10CF && pdev->subsystem_device == 0x10AF) + return ATA_CBL_PATA80; + + /* Host view cable detect 0x4A bit 0 primary bit 1 secondary + Bit set for 40 pin */ + pci_read_config_byte(pdev, 0x4A, &ata66); -+ if(ata66 & (1 << ap->hard_port_no)) ++ if (ata66 & (1 << ap->hard_port_no)) + return ATA_CBL_PATA40; + else + return ATA_CBL_PATA80; @@ -2192,14 +2458,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +{ + char model_num[40]; + /* No DMA on CD for now */ -+ if(adev->class != ATA_DEV_ATA && shift != ATA_SHIFT_PIO) ++ if (adev->class != ATA_DEV_ATA && shift != ATA_SHIFT_PIO) + return 0; + -+ if(shift != ATA_SHIFT_UDMA) ++ if (shift != ATA_SHIFT_UDMA) + return mask; + + ata_dev_id_string(adev->id, model_num, ATA_ID_PROD_OFS, sizeof(model_num)); -+ if(strstr(model_num, "WDC")) ++ if (strstr(model_num, "WDC")) + return 0; + return mask; +} @@ -2226,8 +2492,8 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + is on. The FIFO must not be used for ATAPI. We preserve + BIOS set thresholds */ + pci_read_config_byte(pdev, pio_fifo, &fifo); -+ fifo &= (0x0C << shift); -+ if(on) ++ fifo &= ~(0x0C << shift); ++ if (on) + fifo |= (0x04 << shift); + pci_write_config_byte(pdev, pio_fifo, fifo); +} @@ -2248,13 +2514,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +static void ali_program_modes(struct ata_port *ap, struct ata_device *adev, u8 cmd, u8 data, u8 ultra) +{ + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); -+ int cbt = 0x59 + 4 * ap->hard_port_no; -+ int drwt = 0x5A + 4 * ap->hard_port_no + adev->devno; -+ int udmat = 0x56 + ap->hard_port_no; ++ int cbt = 0x59 + 4 * ap->hard_port_no; /* Command timing */ ++ int drwt = 0x5A + 4 * ap->hard_port_no + adev->devno; /* R/W timing */ ++ int udmat = 0x56 + ap->hard_port_no; /* UDMA timing */ + int shift = 4 * adev->devno; + u8 udma; + -+ if(ultra == 0) { ++ if (ultra == 0) { ++ /* FIXME: We ought to set up pcas not rely on the BIOS */ + /* Load the command block timing register */ + pci_write_config_byte(pdev, cbt, cmd); + @@ -2267,7 +2534,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + udma &= ~(0x0F << shift); + udma |= ultra << shift; + pci_write_config_byte(pdev, udmat, udma); -+ +} + +/** @@ -2281,7 +2547,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static void ali_set_piomode(struct ata_port *ap, struct ata_device *adev) +{ -+ struct ata_device *pair = &ap->device[1-adev->devno]; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + int pio = adev->pio_mode - XFER_PIO_0; + int cmdpio = pio; + @@ -2289,17 +2555,17 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + static u8 cmd_block_timing[5] = { 0x0A, 0x03, 0x01, 0x33, 0x31 }; + static u8 data_block_timing[5] = { 0x88, 0x58, 0x44, 0x33, 0x31 }; + -+ if(adev->class != ATA_DEV_ATA) ++ if (adev->class != ATA_DEV_ATA) + ali_fifo_control(ap, adev, 0); + + /* Command timing is shared, so pick the best we can use */ -+ if(ata_dev_present(pair)) ++ if (pair) + cmdpio = min(pair->pio_mode, adev->pio_mode) - XFER_PIO_0; + + ali_program_modes(ap, adev, cmd_block_timing[cmdpio], + data_block_timing[pio], 0); + -+ if(adev->class == ATA_DEV_ATA) ++ if (adev->class == ATA_DEV_ATA) + ali_fifo_control(ap, adev, 1); + +} @@ -2316,7 +2582,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +{ + static u8 udma_timing[7] = { 0xC, 0xB, 0xA, 0x9, 0x8, 0xF, 0xD }; + -+ if(adev->dma_mode >= XFER_UDMA_0) { ++ if (adev->dma_mode >= XFER_UDMA_0) { + ali_program_modes(ap, adev, 0, 0, udma_timing[adev->dma_mode - XFER_UDMA_0]); + } else { + /* MWDMA is not yet supported */ @@ -2338,6 +2604,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static void ali_lock_sectors(struct ata_port *ap, struct ata_device *adev) +{ ++ if(ap->host->max_sectors > 255) { ++ ap->host->max_sectors = 255; ++ ap->host->hostt->max_sectors = 255; ++ } + adev->flags |= ATA_DFLAG_LOCK_SECTORS; +} + @@ -2578,7 +2848,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * mode data. + */ + -+ if(rev < 0x20) { ++ if (rev < 0x20) { + port_info[0] = port_info[1] = &info_early; + } else if (rev < 0xC2) { + /* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */ @@ -2596,30 +2866,30 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } else + port_info[0] = port_info[1] = &info_c5; + -+ if(rev >= 0xC2) { ++ if (rev >= 0xC2) { + /* Enable cable detection logic */ + pci_read_config_byte(pdev, 0x4B, &tmp); + pci_write_config_byte(pdev, 0x4B, tmp | 0x08); + } + -+ north = pci_get_slot(0, PCI_DEVFN(0,0)); ++ north = pci_get_slot(pdev->bus, PCI_DEVFN(0,0)); + isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); + -+ if(north && north->vendor == PCI_VENDOR_ID_AL) { ++ if (north && north->vendor == PCI_VENDOR_ID_AL) { + /* Configure the ALi bridge logic. For non ALi rely on BIOS. + Set the south bridge enable bit */ + pci_read_config_byte(isa_bridge, 0x79, &tmp); -+ if(rev == 0xC2) ++ if (rev == 0xC2) + pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); -+ else if(rev > 0xC2) ++ else if (rev > 0xC2) + pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); + } + -+ if(rev >= 0x20) { -+ if(rev < 0xC2) { ++ if (rev >= 0x20) { ++ if (rev < 0xC2) { + /* Are we paired with a UDMA capable chip */ + pci_read_config_byte(isa_bridge, 0x5E, &tmp); -+ if((tmp & 0x1E) == 0x12) ++ if ((tmp & 0x1E) == 0x12) + port_info[0] = port_info[1] = &info_20_udma; + } + /* @@ -2628,7 +2898,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * via 0x54/55. + */ + pci_read_config_byte(pdev, 0x53, &tmp); -+ if(rev == 0x20) ++ if (rev == 0x20) + tmp &= ~0x02; + tmp |= 0x01; + pci_write_config_byte(pdev, 0x53, tmp); @@ -2674,10 +2944,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(ali_init); +module_exit(ali_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_amd.c linux-2.6.16-rc2/drivers/scsi/pata_amd.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_amd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_amd.c 2006-01-30 15:07:32.000000000 +0000 -@@ -0,0 +1,651 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_amd.c linux-2.6.16-rc4/drivers/scsi/pata_amd.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_amd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_amd.c 2006-02-16 15:37:39.000000000 +0000 +@@ -0,0 +1,650 @@ +/* + * pata_amd.c - AMD PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -2707,7 +2977,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_amd" -+#define DRV_VERSION "0.1.2" ++#define DRV_VERSION "0.1.3" + +/** + * timing_setup - shared timing computation and load @@ -2730,8 +3000,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + }; + + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); -+ /* Should libata have an ata_peer() function */ -+ struct ata_device *peer = &ap->device[1-adev->devno]; ++ struct ata_device *peer = ata_dev_pair(ap, adev); + int dn = ap->hard_port_no * 2 + adev->devno; + struct ata_timing at, apeer; + int T, UT; @@ -2746,9 +3015,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + return; + } + -+ if (ata_dev_present(peer)) { ++ if (peer) { + /* This may be over conservative */ -+ if(peer->dma_mode) { ++ if (peer->dma_mode) { + ata_timing_compute(peer, peer->dma_mode, &apeer, T, UT); + ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT); + } @@ -3329,9 +3598,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(amd_init); +module_exit(amd_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_artop.c linux-2.6.16-rc2/drivers/scsi/pata_artop.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_artop.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_artop.c 2006-02-07 13:41:48.130232936 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_artop.c linux-2.6.16-rc4/drivers/scsi/pata_artop.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_artop.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_artop.c 2006-02-07 13:41:48.000000000 +0000 @@ -0,0 +1,497 @@ +/* + * pata_artop.c - ARTOP ATA controller driver @@ -3830,9 +4099,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +MODULE_DEVICE_TABLE(pci, artop_pci_tbl); +MODULE_VERSION(DRV_VERSION); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_atiixp.c linux-2.6.16-rc2/drivers/scsi/pata_atiixp.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_atiixp.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_atiixp.c 2006-02-07 13:42:02.706017080 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_atiixp.c linux-2.6.16-rc4/drivers/scsi/pata_atiixp.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_atiixp.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_atiixp.c 2006-02-07 13:42:02.000000000 +0000 @@ -0,0 +1,299 @@ +/* + * pata_atiixp.c - ATI PATA for new ATA layer @@ -4133,9 +4402,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(atiixp_init); +module_exit(atiixp_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cmd64x.c linux-2.6.16-rc2/drivers/scsi/pata_cmd64x.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cmd64x.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_cmd64x.c 2006-02-07 13:42:18.251653784 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cmd64x.c linux-2.6.16-rc4/drivers/scsi/pata_cmd64x.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cmd64x.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_cmd64x.c 2006-02-16 15:34:39.000000000 +0000 @@ -0,0 +1,486 @@ +/* + * pata_cmd64x.c - ATI PATA for new ATA layer @@ -4172,7 +4441,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_cmd64x" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.1.1" + +/* + * CMD64x specific registers definition. @@ -4232,7 +4501,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* Check cable detect bits */ + pci_read_config_byte(pdev, BMIDECSR, &r); -+ if(r & (1 << ap->hard_port_no)) ++ if (r & (1 << ap->hard_port_no)) + ap->cbl = ATA_CBL_PATA80; + else + ap->cbl = ATA_CBL_PATA40; @@ -4278,10 +4547,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + if (ap->hard_port_no) { + /* Slave has shared address setup */ -+ struct ata_device *pair = &ap->device[adev->devno ^ 1]; -+ struct ata_timing tp; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + -+ if(ata_dev_present(pair)) { ++ if (pair) { ++ struct ata_timing tp; + ata_timing_compute(pair, pair->pio_mode, &tp, T, 0); + ata_timing_merge(&t, &tp, &t, ATA_TIMING_SETUP); + } @@ -4564,10 +4833,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + if (pdev->device == PCI_DEVICE_ID_CMD_646) { + /* Does UDMA work ? */ -+ if(class_rev > 4) ++ if (class_rev > 4) + info = &cmd_info[2]; + /* Early rev with other problems ? */ -+ else if(class_rev == 1) ++ else if (class_rev == 1) + info = &cmd_info[3]; + } + @@ -4623,9 +4892,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(cmd64x_init); +module_exit(cmd64x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5520.c linux-2.6.16-rc2/drivers/scsi/pata_cs5520.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5520.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_cs5520.c 2006-02-07 13:42:34.495184392 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5520.c linux-2.6.16-rc4/drivers/scsi/pata_cs5520.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5520.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_cs5520.c 2006-02-20 13:17:11.000000000 +0000 @@ -0,0 +1,322 @@ +/* + * IDE tuning and bus mastering support for the CS5510/CS5520 @@ -4670,7 +4939,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "cs5520" -+#define DRV_VERSION "0.3" ++#define DRV_VERSION "0.4" + +struct pio_clocks +{ @@ -4747,7 +5016,8 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static void cs5520_set_dmamode(struct ata_port *ap, struct ata_device *adev) +{ -+ cs5520_set_timings(ap, adev, adev->dma_mode); ++ static const int dma_xlate[3] = { XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 }; ++ cs5520_set_timings(ap, adev, dma_xlate[adev->dma_mode]); + cs5520_enable_dma(ap, adev); +} + @@ -4767,7 +5037,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + cs5520_set_timings(ap, adev, adev->pio_mode); +} + -+ +static struct scsi_host_template cs5520_sht = { + .module = THIS_MODULE, + .name = DRV_NAME, @@ -4826,25 +5095,25 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_read_config_byte(dev, 0x60, &pcicfg); + + /* Check if the ATA ports are enabled */ -+ if((pcicfg & 3) == 0) ++ if ((pcicfg & 3) == 0) + return -ENODEV; + -+ if((pcicfg & 0x40) == 0) { ++ if ((pcicfg & 0x40) == 0) { + printk(KERN_WARNING DRV_NAME ": DMA mode disabled. Enabling.\n"); + pci_write_config_byte(dev, 0x60, pcicfg | 0x40); + } + + /* Perform set up for DMA */ -+ if(pci_enable_device_bars(dev, 1<<2)) { ++ if (pci_enable_device_bars(dev, 1<<2)) { + printk(KERN_ERR DRV_NAME ": unable to configure BAR2.\n"); + return -ENODEV; + } + pci_set_master(dev); -+ if(pci_set_dma_mask(dev, DMA_32BIT_MASK)) { ++ if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) { + printk(KERN_ERR DRV_NAME ": unable to configure DMA mask.\n"); + return -ENODEV; + } -+ if(pci_set_consistent_dma_mask(dev, DMA_32BIT_MASK)) { ++ if (pci_set_consistent_dma_mask(dev, DMA_32BIT_MASK)) { + printk(KERN_ERR DRV_NAME ": unable to configure consistent DMA mask.\n"); + return -ENODEV; + } @@ -4885,11 +5154,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + ata_std_ports(&probe[1].port[0]); + + /* Now add the ports that are active */ -+ if(pcicfg & 1) ++ if (pcicfg & 1) + ports += ata_device_add(&probe[0]); -+ if(pcicfg & 2) ++ if (pcicfg & 2) + ports += ata_device_add(&probe[1]); -+ if(ports) ++ if (ports) + return 0; + return -ENODEV; +} @@ -4949,10 +5218,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +module_init(cs5520_init); +module_exit(cs5520_exit); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5530.c linux-2.6.16-rc2/drivers/scsi/pata_cs5530.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5530.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_cs5530.c 2006-02-07 13:42:42.392983744 +0000 -@@ -0,0 +1,313 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5530.c linux-2.6.16-rc4/drivers/scsi/pata_cs5530.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5530.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_cs5530.c 2006-02-21 16:44:52.000000000 +0000 +@@ -0,0 +1,371 @@ +/* + * pata-cs5530.c - CS5530 PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -4987,9 +5256,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/delay.h> +#include <scsi/scsi_host.h> +#include <linux/libata.h> ++#include <linux/dmi.h> + +#define DRV_NAME "cs5530" -+#define DRV_VERSION "0.2" ++#define DRV_VERSION "0.4" + +/** + * cs5530_set_piomode - PIO setup @@ -5015,7 +5285,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + format = (tuning & 0x80000000UL) ? 1 : 0; + + /* Now load the right timing register */ -+ if(adev->devno) ++ if (adev->devno) + base += 0x08; + + outl(cs5530_pio_timings[format][adev->pio_mode - XFER_PIO_0], base); @@ -5027,11 +5297,8 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * @adev: Device being configured + * + * We cannot mix MWDMA and UDMA without reloading timings each switch -+ * master to slave. We should implement the switch but for now we follow -+ * the old IDE driver and just avoid setting such combinations. -+ * -+ * This will come up once the SATA core grows up and develops proper -+ * timing code. ++ * master to slave. We track the last DMA setup in order to minimise ++ * reloads. + */ + +static void cs5530_set_dmamode(struct ata_port *ap, struct ata_device *adev) @@ -5061,10 +5328,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + /* Merge in the PIO format bit */ + timing |= (tuning & 0x80000000UL); -+ if(adev->devno == 0) /* Master */ ++ if (adev->devno == 0) /* Master */ + outl(timing, base + 0x04); + else { -+ if(timing & 0x00100000) ++ if (timing & 0x00100000) + tuning |= 0x00100000; /* UDMA for both */ + else + tuning &= ~0x00100000; /* MWDMA for both */ @@ -5076,6 +5343,38 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + reg = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); + reg |= (1 << (5 + adev->devno)); + outb(reg, ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); ++ ++ /* Remember the last DMA setup we did */ ++ ++ ap->private_data = adev; ++} ++ ++/** ++ * cs5530_qc_issue_prot - command issue ++ * @qc: command pending ++ * ++ * Called when the libata layer is about to issue a command. We wrap ++ * this interface so that we can load the correct ATA timings if ++ * neccessary. Specifically we have a problem that there is only ++ * one MWDMA/UDMA bit. ++ */ ++ ++static int cs5530_qc_issue_prot(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ struct ata_device *prev = ap->private_data; ++ ++ /* See if the DMA settings could be wrong */ ++ if (adev->dma_mode != 0 && adev != prev && prev != NULL) { ++ /* Maybe, but do the channels match MWDMA/UDMA ? */ ++ if ((adev->dma_mode >= XFER_UDMA_0 && prev->dma_mode < XFER_UDMA_0) || ++ (adev->dma_mode < XFER_UDMA_0 && prev->dma_mode >= XFER_UDMA_0)) ++ /* Switch the mode bits */ ++ cs5530_set_dmamode(ap, adev); ++ } ++ ++ return ata_qc_issue_prot(qc); +} + +static struct scsi_host_template cs5530_sht = { @@ -5099,8 +5398,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +}; + +static struct ata_port_operations cs5530_port_ops = { -+/* .set_mode = cs5530_set_mode, FIXME - for master/slave */ -+ + .port_disable = ata_port_disable, + .set_piomode = cs5530_set_piomode, + .set_dmamode = cs5530_set_dmamode, @@ -5117,7 +5414,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .bmdma_status = ata_bmdma_status, + + .qc_prep = ata_qc_prep, -+ .qc_issue = ata_qc_issue_prot, ++ .qc_issue = cs5530_qc_issue_prot, + .eng_timeout = ata_eng_timeout, + .data_xfer = ata_pio_data_xfer, + @@ -5129,6 +5426,26 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .host_stop = ata_host_stop +}; + ++static struct dmi_system_id __initdata palmax_dmi_table[] = { ++ { ++ .ident = "Palmax PD1100", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Cyrix"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Caddis"), ++ }, ++ }, ++ { } ++}; ++ ++static int cs5530_is_palmax(void) ++{ ++ if (dmi_check_system(palmax_dmi_table)) { ++ printk(KERN_INFO "Palmax PD1100: Disabling DMA on docking port.\n"); ++ return 1; ++ } ++ return 0; ++} ++ +/** + * cs5530_init_one - Initialise a CS5530 + * @dev: PCI device @@ -5151,6 +5468,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .udma_mask = 0x07, + .port_ops = &cs5530_port_ops + }; ++ /* The docking connector doesn't do UDMA, and it seems not MWDMA */ ++ static struct ata_port_info info_palmax_secondary = { ++ .sht = &cs5530_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS, ++ .pio_mask = 0x1f, ++ .port_ops = &cs5530_port_ops ++ }; + static struct ata_port_info *port_info[2] = { &info, &info }; + + dev = NULL; @@ -5223,13 +5547,16 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_dev_put(master_0); + pci_dev_put(cs5530_0); + ++ if (cs5530_is_palmax()) ++ port_info[1] = &info_palmax_secondary; ++ + /* Now kick off ATA set up */ + return ata_pci_init_one(dev, port_info, 2); + +fail_put: -+ if(master_0) ++ if (master_0) + pci_dev_put(master_0); -+ if(cs5530_0) ++ if (cs5530_0) + pci_dev_put(cs5530_0); + return -ENODEV; +} @@ -5266,10 +5593,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(cs5530_init); +module_exit(cs5530_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5535.c linux-2.6.16-rc2/drivers/scsi/pata_cs5535.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cs5535.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_cs5535.c 2006-02-07 13:42:50.000000000 +0000 -@@ -0,0 +1,294 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5535.c linux-2.6.16-rc4/drivers/scsi/pata_cs5535.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cs5535.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_cs5535.c 2006-02-16 15:37:21.000000000 +0000 +@@ -0,0 +1,286 @@ +/* + * pata-cs5535.c - CS5535 PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -5311,7 +5638,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <asm/msr.h> + +#define DRV_NAME "cs5535" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2.1" + +/* + * The Geode (Aka Athlon GX now) uses an internal MSR based @@ -5355,7 +5682,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + + pci_read_config_byte(pdev, CS5535_CABLE_DETECT, &cable); -+ if(cable & 1) ++ if (cable & 1) + return ATA_CBL_PATA80; + else + return ATA_CBL_PATA40; @@ -5392,26 +5719,24 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 + }; + u32 reg, dummy; -+ struct ata_device *pair = &ap->device[1 - adev->devno]; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + + int mode = adev->pio_mode - XFER_PIO_0; -+ int pairmode = pair->pio_mode - XFER_PIO_0; + int cmdmode = mode; + + /* Command timing has to be for the lowest of the pair of devices */ -+ if(pair->class != ATA_DEV_NONE && pair->pio_mode) ++ if (pair) { ++ int pairmode = pair->pio_mode - XFER_PIO_0; + cmdmode = min(mode, pairmode); -+ ++ /* Write the other drive timing register if it changed */ ++ if (cmdmode < pairmode) ++ wrmsr(ATAC_CH0D0_PIO + 2 * pair->devno, ++ pio_cmd_timings[cmdmode] << 16 | pio_timings[pairmode], 0); ++ } + /* Write the drive timing register */ + wrmsr(ATAC_CH0D0_PIO + 2 * adev->devno, + pio_cmd_timings[cmdmode] << 16 | pio_timings[mode], 0); + -+ /* Write the other drive timing register if it changed */ -+ -+ if(cmdmode < pairmode) -+ wrmsr(ATAC_CH0D0_PIO + 2 * pair->devno, -+ pio_cmd_timings[cmdmode] << 16 | pio_timings[pairmode], 0); -+ + /* Set the PIO "format 1" bit in the DMA timing register */ + rdmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg, dummy); + wrmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg | 0x80000000UL, 0); @@ -5422,12 +5747,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * @ap: ATA interface + * @adev: Device being configured + * -+ * We cannot mix MWDMA and UDMA without reloading timings each switch -+ * master to slave. We should implement the switch but for now we follow -+ * the old IDE driver and just avoid setting such combinations. -+ * -+ * This will come up once the SATA core grows up and develops proper -+ * timing code. + */ + +static void cs5535_set_dmamode(struct ata_port *ap, struct ata_device *adev) @@ -5439,7 +5758,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + rdmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg, dummy); + reg &= 0x80000000UL; -+ if(mode >= XFER_UDMA_0) ++ if (mode >= XFER_UDMA_0) + reg |= udma_timings[mode - XFER_UDMA_0]; + else + reg |= mwdma_timings[mode - XFER_MW_DMA_0]; @@ -5524,10 +5843,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Check the BIOS set the initial timing clock. If not set the + timings for PIO0 */ + rdmsr(ATAC_CH0D0_PIO, timings, dummy); -+ if(CS5535_BAD_PIO(timings)) ++ if (CS5535_BAD_PIO(timings)) + wrmsr(ATAC_CH0D0_PIO, 0xF7F4F7F4UL, 0); + rdmsr(ATAC_CH0D1_PIO, timings, dummy); -+ if(CS5535_BAD_PIO(timings)) ++ if (CS5535_BAD_PIO(timings)) + wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0); + return ata_pci_init_one(dev, ports, 1); +} @@ -5564,9 +5883,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(cs5535_init); +module_exit(cs5535_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cypress.c linux-2.6.16-rc2/drivers/scsi/pata_cypress.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_cypress.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_cypress.c 2006-02-07 13:43:01.234119456 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cypress.c linux-2.6.16-rc4/drivers/scsi/pata_cypress.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_cypress.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_cypress.c 2006-02-16 15:37:46.000000000 +0000 @@ -0,0 +1,215 @@ +/* + */ @@ -5637,7 +5956,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + time_16 = FIT(t.recover, 0, 15) | (FIT(t.active, 0, 15) << 4); + time_8 = FIT(t.act8b, 0, 15) | (FIT(t.rec8b, 0, 15) << 4); + -+ if(adev->devno == 0) { ++ if (adev->devno == 0) { + pci_read_config_dword(pdev, CY82_IDE_ADDRSETUP, &addr); + + addr &= ~0x0F; /* Mask bits */ @@ -5745,7 +6064,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Devfn 1 is the ATA primary. The secondary is magic and on devfn2. For the + moment we don't handle the secondary. FIXME */ + -+ if(PCI_FUNC(pdev->devfn) != 1) ++ if (PCI_FUNC(pdev->devfn) != 1) + return -ENODEV; + + return ata_pci_init_one(pdev, port_info, 1); @@ -5783,9 +6102,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(cy82c693_init); +module_exit(cy82c693_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_efar.c linux-2.6.16-rc2/drivers/scsi/pata_efar.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_efar.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_efar.c 2006-02-07 13:41:17.978816648 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_efar.c linux-2.6.16-rc4/drivers/scsi/pata_efar.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_efar.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_efar.c 2006-02-16 15:37:53.000000000 +0000 @@ -0,0 +1,341 @@ +/* + * pata_efar.c - EFAR PIIX clone controller driver @@ -5901,7 +6220,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* Enable PPE, IE and TIME as appropriate */ + -+ if(adev->devno == 0) { ++ if (adev->devno == 0) { + idetm_data &= 0xCCF0; + idetm_data |= control; + idetm_data |= (timings[pio][0] << 12) | @@ -6128,9 +6447,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +MODULE_DEVICE_TABLE(pci, efar_pci_tbl); +MODULE_VERSION(DRV_VERSION); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt34x.c linux-2.6.16-rc2/drivers/scsi/pata_hpt34x.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt34x.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_hpt34x.c 2006-02-07 13:40:32.684702400 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt34x.c linux-2.6.16-rc4/drivers/scsi/pata_hpt34x.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt34x.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_hpt34x.c 2006-02-16 15:38:47.000000000 +0000 @@ -0,0 +1,206 @@ +#include <linux/kernel.h> +#include <linux/module.h> @@ -6209,7 +6528,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + r1 |= (mode_num << (3 * dn)); + r2 &= ~(0x11 << dn); /* Clear MWDMA and UDMA bits */ + -+ if(adev->dma_mode >= XFER_UDMA_0) ++ if (adev->dma_mode >= XFER_UDMA_0) + r2 |= 0x01 << dn; /* Ultra mode */ + else + r2 |= 0x10 << dn; /* MWDMA */ @@ -6297,7 +6616,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_word(dev, 0x80, 0x00); + /* Check if it is a 343 or a 363. 363 has COMMAND_MEMORY set */ + pci_read_config_word(dev, PCI_COMMAND, &cmd); -+ if(cmd & PCI_COMMAND_MEMORY) ++ if (cmd & PCI_COMMAND_MEMORY) + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0); + else + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); @@ -6338,10 +6657,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(hpt34x_init); +module_exit(hpt34x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt366.c linux-2.6.16-rc2/drivers/scsi/pata_hpt366.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt366.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_hpt366.c 2006-02-07 13:40:40.000000000 +0000 -@@ -0,0 +1,392 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt366.c linux-2.6.16-rc4/drivers/scsi/pata_hpt366.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt366.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_hpt366.c 2006-02-16 15:45:36.000000000 +0000 +@@ -0,0 +1,479 @@ +/* + * Libata driver for the highpoint 366 and 368 UDMA66 ATA controllers. + * @@ -6355,8 +6674,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * + * + * TODO -+ * Filters if neccessary -+ * PLL mode ++ * Maybe PLL mode + * Look into engine reset on timeout errors. Should not be + * required. + */ @@ -6372,7 +6690,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "hpt36x" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2" + +struct hpt_clock { + u8 xfer_speed; @@ -6459,6 +6777,93 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + { 0, 0x01208585 } +}; + ++static const char *bad_ata33[] = { ++ "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2", ++ "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", ++ "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", ++ "Maxtor 90510D4", ++ "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", ++ "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", ++ "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", ++ NULL ++}; ++ ++static const char *bad_ata66_4[] = { ++ "IBM-DTLA-307075", ++ "IBM-DTLA-307060", ++ "IBM-DTLA-307045", ++ "IBM-DTLA-307030", ++ "IBM-DTLA-307020", ++ "IBM-DTLA-307015", ++ "IBM-DTLA-305040", ++ "IBM-DTLA-305030", ++ "IBM-DTLA-305020", ++ "IC35L010AVER07-0", ++ "IC35L020AVER07-0", ++ "IC35L030AVER07-0", ++ "IC35L040AVER07-0", ++ "IC35L060AVER07-0", ++ "WDC AC310200R", ++ NULL ++}; ++ ++static const char *bad_ata66_3[] = { ++ "WDC AC310200R", ++ NULL ++}; ++ ++static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) ++{ ++ unsigned char model_num[40]; ++ char *s; ++ unsigned int len; ++ int i = 0; ++ ++ ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, ++ sizeof(model_num)); ++ s = &model_num[0]; ++ len = strnlen(s, sizeof(model_num)); ++ ++ /* ATAPI specifies that empty space is blank-filled; remove blanks */ ++ while ((len > 0) && (s[len - 1] == ' ')) { ++ len--; ++ s[len] = 0; ++ } ++ ++ while(list[i] != NULL) { ++ if (!strncmp(list[i], s, len)) { ++ printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", ++ modestr, list[i]); ++ return 1; ++ } ++ i++; ++ } ++ return 0; ++} ++ ++/** ++ * hpt366_filter - mode selection filter ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Block UDMA on devices that cause trouble with this controller. ++ */ ++ ++static unsigned int hpt366_filter(const struct ata_port *ap, struct ata_device *adev, unsigned int mask, int shift) ++{ ++ if (shift != ATA_SHIFT_UDMA) ++ return mask; ++ if (adev->class != ATA_DEV_ATA) ++ return mask; ++ if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) ++ return 0; ++ if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3)) ++ return mask & 0x07; ++ if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4)) ++ return mask & 0x0F; ++ return mask; ++} ++ +/** + * hpt36x_find_mode - reset the hpt36x bus + * @ap: ATA port @@ -6473,7 +6878,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct hpt_clock *clocks = ap->host_set->private_data; + + while(clocks->xfer_speed) { -+ if(clocks->xfer_speed == speed) ++ if (clocks->xfer_speed == speed) + return clocks->timing; + clocks++; + } @@ -6493,7 +6898,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + + pci_read_config_byte(pdev, 0x5A, &ata66); -+ if(ata66 & (1 << ap->hard_port_no)) ++ if (ata66 & (1 << ap->hard_port_no)) + ap->cbl = ATA_CBL_PATA40; + else + ap->cbl = ATA_CBL_PATA80; @@ -6523,7 +6928,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* Fast interrupt prediction disable, hold off interrupt disable */ + pci_read_config_byte(pdev, addr2, &fast); -+ if(fast & 0x80) { ++ if (fast & 0x80) { + fast &= ~0x80; + pci_write_config_byte(pdev, addr2, fast); + } @@ -6558,7 +6963,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* Fast interrupt prediction disable, hold off interrupt disable */ + pci_read_config_byte(pdev, addr2, &fast); -+ if(fast & 0x80) { ++ if (fast & 0x80) { + fast &= ~0x80; + pci_write_config_byte(pdev, addr2, fast); + } @@ -6599,6 +7004,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .port_disable = ata_port_disable, + .set_piomode = hpt366_set_piomode, + .set_dmamode = hpt366_set_dmamode, ++ .mode_filter = hpt366_filter, + + .tf_load = ata_tf_load, + .tf_read = ata_tf_read, @@ -6671,7 +7077,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* May be a later chip in disguise. Check */ + /* Newer chips are in the HPT36x driver. Ignore them */ -+ if(class_rev > 2) ++ if (class_rev > 2) + return -ENODEV; + + pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); @@ -6734,10 +7140,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(hpt36x_init); +module_exit(hpt36x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt37x.c linux-2.6.16-rc2/drivers/scsi/pata_hpt37x.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt37x.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_hpt37x.c 2006-02-07 13:40:49.417158680 +0000 -@@ -0,0 +1,1089 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt37x.c linux-2.6.16-rc4/drivers/scsi/pata_hpt37x.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt37x.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_hpt37x.c 2006-02-16 15:45:27.000000000 +0000 +@@ -0,0 +1,1232 @@ +/* + * Libata driver for the highpoint 37x and 30x UDMA66 ATA controllers. + * @@ -6750,9 +7156,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * Portions Copyright (C) 2003 Red Hat Inc + * + * TODO -+ * Filters if neccessary + * PLL mode -+ * Investigate if we need DPLL switching on the 370 + * Look into engine reset on timeout errors. Should not be + * required. + */ @@ -6767,7 +7171,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "hpt37x" -+#define DRV_VERSION "0.1.2" ++#define DRV_VERSION "0.2" + +struct hpt_clock { + u8 xfer_speed; @@ -7081,12 +7485,111 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct hpt_clock *clocks = ap->host_set->private_data; + + while(clocks->xfer_speed) { -+ if(clocks->xfer_speed == speed) ++ if (clocks->xfer_speed == speed) + return clocks->timing; + clocks++; + } + BUG(); +} ++ ++static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, const char *list[]) ++{ ++ unsigned char model_num[40]; ++ char *s; ++ unsigned int len; ++ int i = 0; ++ ++ ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS, ++ sizeof(model_num)); ++ s = &model_num[0]; ++ len = strnlen(s, sizeof(model_num)); ++ ++ /* ATAPI specifies that empty space is blank-filled; remove blanks */ ++ while ((len > 0) && (s[len - 1] == ' ')) { ++ len--; ++ s[len] = 0; ++ } ++ ++ while(list[i] != NULL) { ++ if (!strncmp(list[i], s, len)) { ++ printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", ++ modestr, list[i]); ++ return 1; ++ } ++ i++; ++ } ++ return 0; ++} ++ ++static const char *bad_ata33[] = { ++ "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2", ++ "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", ++ "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", ++ "Maxtor 90510D4", ++ "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", ++ "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", ++ "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", ++ NULL ++}; ++ ++static const char *bad_ata100_5[] = { ++ "IBM-DTLA-307075", ++ "IBM-DTLA-307060", ++ "IBM-DTLA-307045", ++ "IBM-DTLA-307030", ++ "IBM-DTLA-307020", ++ "IBM-DTLA-307015", ++ "IBM-DTLA-305040", ++ "IBM-DTLA-305030", ++ "IBM-DTLA-305020", ++ "IC35L010AVER07-0", ++ "IC35L020AVER07-0", ++ "IC35L030AVER07-0", ++ "IC35L040AVER07-0", ++ "IC35L060AVER07-0", ++ "WDC AC310200R", ++ NULL ++}; ++ ++/** ++ * hpt370_filter - mode selection filter ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Block UDMA on devices that cause trouble with this controller. ++ */ ++ ++static unsigned int hpt370_filter(const struct ata_port *ap, struct ata_device *adev, unsigned int mask, int shift) ++{ ++ if (shift != ATA_SHIFT_UDMA) ++ return mask; ++ if (adev->class != ATA_DEV_ATA) ++ return mask; ++ if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) ++ return mask & 0x1F; ++ if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) ++ return mask & 0x1F; ++ return mask; ++} ++ ++/** ++ * hpt370a_filter - mode selection filter ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Block UDMA on devices that cause trouble with this controller. ++ */ ++ ++static unsigned int hpt370a_filter(const struct ata_port *ap, struct ata_device *adev, unsigned int mask, int shift) ++{ ++ if (shift != ATA_SHIFT_UDMA) ++ return mask; ++ if (adev->class != ATA_DEV_ATA) ++ return mask; ++ if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) ++ return mask & 0x1F; ++ return mask; ++} + +/** + * hpt37x_phy_reset - reset the hpt37x bus @@ -7107,7 +7610,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Restore state */ + pci_write_config_byte(pdev, 0x5B, scr2); + -+ if(ata66 & (1 << ap->hard_port_no)) ++ if (ata66 & (1 << ap->hard_port_no)) + ap->cbl = ATA_CBL_PATA40; + else + ap->cbl = ATA_CBL_PATA80; @@ -7138,7 +7641,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + -+ if(!(PCI_FUNC(pdev->devfn) & 1)) { ++ if (!(PCI_FUNC(pdev->devfn) & 1)) { + hpt37x_phy_reset(ap); + return; + } @@ -7155,7 +7658,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_word(pdev, 0x52, mcr3); + pci_write_config_word(pdev, 0x56, mcr6); + -+ if(ata66 & (1 << ap->hard_port_no)) ++ if (ata66 & (1 << ap->hard_port_no)) + ap->cbl = ATA_CBL_PATA40; + else + ap->cbl = ATA_CBL_PATA80; @@ -7269,11 +7772,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 dma_cmd; + unsigned long bmdma = ap->ioaddr.bmdma_addr; + -+ if(dma_stat & 0x01) { ++ if (dma_stat & 0x01) { + udelay(20); + dma_stat = inb(bmdma + 2); + } -+ if(dma_stat & 0x01) { ++ if (dma_stat & 0x01) { + /* Clear the engine */ + pci_write_config_byte(pdev, 0x50 + 4 * ap->hard_port_no, 0x37); + udelay(10); @@ -7374,7 +7877,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_byte(pdev, 0x6A, &bwsr_stat); + pci_read_config_byte(pdev, mscreg, &msc_stat); -+ if(bwsr_stat & (1 << ap->hard_port_no)) ++ if (bwsr_stat & (1 << ap->hard_port_no)) + pci_write_config_byte(pdev, mscreg, msc_stat | 0x30); + ata_bmdma_stop(qc); +} @@ -7401,13 +7904,50 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +}; + +/* -+ * Configuration for HPT370, HPT370A ++ * Configuration for HPT370 + */ + +static struct ata_port_operations hpt370_port_ops = { + .port_disable = ata_port_disable, + .set_piomode = hpt370_set_piomode, + .set_dmamode = hpt370_set_dmamode, ++ .mode_filter = hpt370_filter, ++ ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ ++ .phy_reset = hpt37x_phy_reset, ++ ++ .bmdma_setup = ata_bmdma_setup, ++ .bmdma_start = hpt370_bmdma_start, ++ .bmdma_stop = hpt370_bmdma_stop, ++ .bmdma_status = ata_bmdma_status, ++ ++ .qc_prep = ata_qc_prep, ++ .qc_issue = ata_qc_issue_prot, ++ .eng_timeout = ata_eng_timeout, ++ .data_xfer = ata_pio_data_xfer, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ata_host_stop ++}; ++ ++/* ++ * Configuration for HPT370A. Close to 370 but less filters ++ */ ++ ++static struct ata_port_operations hpt370a_port_ops = { ++ .port_disable = ata_port_disable, ++ .set_piomode = hpt370_set_piomode, ++ .set_dmamode = hpt370_set_dmamode, ++ .mode_filter = hpt370a_filter, + + .tf_load = ata_tf_load, + .tf_read = ata_tf_read, @@ -7517,11 +8057,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +static int hpt37x_clock_slot(unsigned int freq, unsigned int base) +{ + unsigned int f = (base * freq) / 192; /* Mhz */ -+ if(f < 40) ++ if (f < 40) + return 0; /* 33Mhz slot */ -+ if(f < 45) ++ if (f < 45) + return 1; /* 40Mhz slot */ -+ if(f < 55) ++ if (f < 55) + return 2; /* 50Mhz slot */ + return 3; /* 60Mhz slot */ +} @@ -7543,12 +8083,12 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + for(tries = 0; tries < 0x5000; tries++) { + udelay(50); + pci_read_config_byte(dev, 0x5b, ®5b); -+ if(reg5b & 0x80) { ++ if (reg5b & 0x80) { + /* See if it stays set */ + for(tries = 0; tries < 0x1000; tries ++) { + pci_read_config_byte(dev, 0x5b, ®5b); + /* Failed ? */ -+ if((reg5b & 0x80) == 0) ++ if ((reg5b & 0x80) == 0) + return 0; + } + /* Turn off tuning, we have the DPLL set */ @@ -7594,7 +8134,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) +{ -+ /* HPT370 and HPT370A - UDMA100 */ ++ /* HPT370 - UDMA100 */ + static struct ata_port_info info_hpt370 = { + .sht = &hpt37x_sht, + .host_flags = ATA_FLAG_SLAVE_POSS, @@ -7603,6 +8143,15 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .udma_mask = 0x3f, + .port_ops = &hpt370_port_ops + }; ++ /* HPT370A - UDMA100 */ ++ static struct ata_port_info info_hpt370a = { ++ .sht = &hpt37x_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS, ++ .pio_mask = 0x1f, ++ .mwdma_mask = 0x07, ++ .udma_mask = 0x3f, ++ .port_ops = &hpt370a_port_ops ++ }; + /* HPT371, 372 and friends - UDMA133 */ + static struct ata_port_info info_hpt372 = { + .sht = &hpt37x_sht, @@ -7645,13 +8194,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xFF; + -+ if(dev->device == PCI_DEVICE_ID_TTI_HPT366) { ++ if (dev->device == PCI_DEVICE_ID_TTI_HPT366) { + /* May be a later chip in disguise. Check */ + /* Older chips are in the HPT366 driver. Ignore them */ -+ if(class_rev < 3) ++ if (class_rev < 3) + return -ENODEV; + /* N series chips have their own driver. Ignore */ -+ if(class_rev == 6) ++ if (class_rev == 6) + return -ENODEV; + + switch(class_rev) { @@ -7660,7 +8209,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + chip_table = &hpt370; + break; + case 4: -+ port = &info_hpt370; ++ port = &info_hpt370a; + chip_table = &hpt370a; + break; + case 5: @@ -7675,14 +8224,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + switch(dev->device) { + case PCI_DEVICE_ID_TTI_HPT372: + /* 372N if rev >= 2*/ -+ if(class_rev >= 2) ++ if (class_rev >= 2) + return -ENODEV; + port = &info_hpt372; + chip_table = &hpt372a; + break; + case PCI_DEVICE_ID_TTI_HPT302: + /* 302N if rev > 1 */ -+ if(class_rev > 1) ++ if (class_rev > 1) + return -ENODEV; + port = &info_hpt372; + /* Check this */ @@ -7722,7 +8271,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_byte(dev, 0x5b, 0x23); + + pci_read_config_dword(dev, 0x70, &freq); -+ if((freq >> 12) != 0xABCDE) { ++ if ((freq >> 12) != 0xABCDE) { + int i; + u8 sr; + u32 total = 0; @@ -7745,7 +8294,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + */ + + clock_slot = hpt37x_clock_slot(freq, chip_table->base); -+ if(chip_table->clocks[clock_slot] == NULL) { ++ if (chip_table->clocks[clock_slot] == NULL) { + /* + * We need to try PLL mode instead + */ @@ -7754,16 +8303,16 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + int adjust; + + for(adjust = 0; adjust < 8; adjust++) { -+ if(hpt37x_calibrate_dpll(dev)) ++ if (hpt37x_calibrate_dpll(dev)) + break; + /* See if it'll settle at a fractionally different clock */ -+ if((adjust & 3) == 3) { ++ if ((adjust & 3) == 3) { + f_low --; + f_high ++; + } + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); + } -+ if(adjust == 8) { ++ if (adjust == 8) { + printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); + return -ENODEV; + } @@ -7778,9 +8327,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * if UDMA133 is available. + */ + -+ if(clock_slot == 2 && chip_table == &hpt372) { /* 50Mhz */ ++ if (clock_slot == 2 && chip_table == &hpt372) { /* 50Mhz */ + printk(KERN_WARNING "pata_hpt37x: No UDMA133 support available with 50MHz bus clock.\n"); -+ if(port == &info_hpt372) ++ if (port == &info_hpt372) + port = &info_hpt372_50; + else BUG(); + } @@ -7827,9 +8376,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(hpt37x_init); +module_exit(hpt37x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt3x2n.c linux-2.6.16-rc2/drivers/scsi/pata_hpt3x2n.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_hpt3x2n.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_hpt3x2n.c 2006-02-07 13:50:40.927235480 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt3x2n.c linux-2.6.16-rc4/drivers/scsi/pata_hpt3x2n.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_hpt3x2n.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_hpt3x2n.c 2006-02-16 15:36:58.000000000 +0000 @@ -0,0 +1,580 @@ +/* + * Libata driver for the highpoint 372N and 302N UDMA66 ATA controllers. @@ -7939,7 +8488,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct hpt_clock *clocks = hpt3x2n_clocks; + + while(clocks->xfer_speed) { -+ if(clocks->xfer_speed == speed) ++ if (clocks->xfer_speed == speed) + return clocks->timing; + clocks++; + } @@ -7965,7 +8514,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Restore state */ + pci_write_config_byte(pdev, 0x5B, scr2); + -+ if(ata66 & (1 << ap->hard_port_no)) ++ if (ata66 & (1 << ap->hard_port_no)) + ap->cbl = ATA_CBL_PATA40; + else + ap->cbl = ATA_CBL_PATA80; @@ -8059,7 +8608,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_byte(pdev, 0x6A, &bwsr_stat); + pci_read_config_byte(pdev, mscreg, &msc_stat); -+ if(bwsr_stat & (1 << ap->hard_port_no)) ++ if (bwsr_stat & (1 << ap->hard_port_no)) + pci_write_config_byte(pdev, mscreg, msc_stat | 0x30); + ata_bmdma_stop(qc); +} @@ -8111,7 +8660,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct ata_host_set *host = ap->host_set; + struct ata_port *pair = host->ports[ap->hard_port_no ^ 1]; + -+ if(pair->hsm_task_state == HSM_ST_IDLE) ++ if (pair->hsm_task_state == HSM_ST_IDLE) + return 1; + return 0; +} @@ -8133,10 +8682,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct ata_port *ap = qc->ap; + int flags = (long)ap->host_set->private_data; + -+ if(hpt3x2n_pair_idle(ap)) { ++ if (hpt3x2n_pair_idle(ap)) { + int dpll = hpt3x2n_use_dpll(ap, (tf->flags & ATA_TFLAG_WRITE)); -+ if((flags & USE_DPLL) != dpll) { -+ if(dpll == 1) ++ if ((flags & USE_DPLL) != dpll) { ++ if (dpll == 1) + hpt3x2n_set_clock(ap, 0x21); + else + hpt3x2n_set_clock(ap, 0x23); @@ -8216,12 +8765,12 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + for(tries = 0; tries < 0x5000; tries++) { + udelay(50); + pci_read_config_byte(dev, 0x5b, ®5b); -+ if(reg5b & 0x80) { ++ if (reg5b & 0x80) { + /* See if it stays set */ + for(tries = 0; tries < 0x1000; tries ++) { + pci_read_config_byte(dev, 0x5b, ®5b); + /* Failed ? */ -+ if((reg5b & 0x80) == 0) ++ if ((reg5b & 0x80) == 0) + return 0; + } + /* Turn off tuning, we have the DPLL set */ @@ -8240,7 +8789,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u32 fcnt; + + pci_read_config_dword(pdev, 0x70/*CHECKME*/, &fcnt); -+ if((fcnt >> 12) != 0xABCDE) { ++ if ((fcnt >> 12) != 0xABCDE) { + printk(KERN_WARNING "hpt3xn: BIOS clock data not set.\n"); + return 33; /* Not BIOS set */ + } @@ -8249,11 +8798,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + freq = (fcnt * 77) / 192; + + /* Clamp to bands */ -+ if(freq < 40) ++ if (freq < 40) + return 33; -+ if(freq < 45) ++ if (freq < 45) + return 40; -+ if(freq < 55) ++ if (freq < 55) + return 50; + return 66; +} @@ -8314,16 +8863,16 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + switch(dev->device) { + case PCI_DEVICE_ID_TTI_HPT366: -+ if(class_rev < 6) ++ if (class_rev < 6) + return -ENODEV; + break; + case PCI_DEVICE_ID_TTI_HPT372: + /* 372N if rev >= 1*/ -+ if(class_rev == 0) ++ if (class_rev == 0) + return -ENODEV; + break; + case PCI_DEVICE_ID_TTI_HPT302: -+ if(class_rev < 2) ++ if (class_rev < 2) + return -ENODEV; + break; + case PCI_DEVICE_ID_TTI_HPT372N: @@ -8358,17 +8907,17 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* Unlike the 37x we don't try jiggling the frequency */ + for(adjust = 0; adjust < 8; adjust++) { -+ if(hpt3xn_calibrate_dpll(dev)) ++ if (hpt3xn_calibrate_dpll(dev)) + break; + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); + } -+ if(adjust == 8) ++ if (adjust == 8) + printk(KERN_WARNING "hpt3xn: DPLL did not stabilize.\n"); + + /* Set our private data up. We only need a few flags so we use + it directly */ + port->private_data = NULL; -+ if(pci_mhz > 60) ++ if (pci_mhz > 60) + port->private_data = (void *)PCI66; + + /* Now kick off ATA set up */ @@ -8411,9 +8960,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(hpt3x2n_init); +module_exit(hpt3x2n_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_isapnp.c linux-2.6.16-rc2/drivers/scsi/pata_isapnp.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_isapnp.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_isapnp.c 2006-01-21 16:52:31.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_isapnp.c linux-2.6.16-rc4/drivers/scsi/pata_isapnp.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_isapnp.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_isapnp.c 2006-01-21 16:52:31.000000000 +0000 @@ -0,0 +1,151 @@ + +/* @@ -8566,9 +9115,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(isapnp_init); +module_exit(isapnp_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_it8172.c linux-2.6.16-rc2/drivers/scsi/pata_it8172.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_it8172.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_it8172.c 2006-02-07 13:40:09.935160856 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_it8172.c linux-2.6.16-rc4/drivers/scsi/pata_it8172.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_it8172.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_it8172.c 2006-02-16 15:39:11.000000000 +0000 @@ -0,0 +1,280 @@ +/* + * pata_it8172.c - IT8172 PATA for new ATA layer @@ -8672,14 +9221,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + */ + + reg40 |= 0x4000; -+ if(adev->devno) { ++ if (adev->devno) { + reg40 |= 0xC006; -+ if(pio > 1) ++ if (pio > 1) + /* Enable prefetch and IORDY sample-point */ + reg40 |= 0x0060; + } else { + reg40 |= 0xC060; -+ if(pio > 1) ++ if (pio > 1) + /* Enable prefetch and IORDY sample-point */ + reg40 |= 0x0006; + } @@ -8733,7 +9282,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + reg4a &= ~(3 << (4 * dn)); + -+ if(adev->dma_mode >= XFER_UDMA_0) { ++ if (adev->dma_mode >= XFER_UDMA_0) { + reg48 |= 1 << dn; +#ifdef UDMA_TIMING_SET + reg4a |= ((adev->dma_mode - XFER_UDMA_0) << (4 * dn)); @@ -8850,10 +9399,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(it8172_init); +module_exit(it8172_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_it821x.c linux-2.6.16-rc2/drivers/scsi/pata_it821x.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_it821x.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_it821x.c 2006-02-07 13:41:20.868377368 +0000 -@@ -0,0 +1,741 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_it821x.c linux-2.6.16-rc4/drivers/scsi/pata_it821x.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_it821x.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_it821x.c 2006-02-20 12:27:55.000000000 +0000 +@@ -0,0 +1,743 @@ +/* + * ata-it821x.c - IT821x PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -8936,7 +9485,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + +#define DRV_NAME "it821x" -+#define DRV_VERSION "0.2" ++#define DRV_VERSION "0.2.1" + +struct it821x_dev +{ @@ -9002,7 +9551,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 conf; + + /* Program PIO/MWDMA timing bits */ -+ if(itdev->clock_mode == ATA_66) ++ if (itdev->clock_mode == ATA_66) + conf = timing >> 8; + else + conf = timing & 0xFF; @@ -9031,11 +9580,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 conf; + + /* Program UDMA timing bits */ -+ if(itdev->clock_mode == ATA_66) ++ if (itdev->clock_mode == ATA_66) + conf = timing >> 8; + else + conf = timing & 0xFF; -+ if(itdev->timing10 == 0) ++ if (itdev->timing10 == 0) + pci_write_config_byte(pdev, 0x56 + 4 * channel + unit, conf); + else { + /* Early revision must be programmed for both together */ @@ -9058,14 +9607,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + struct it821x_dev *itdev = ap->private_data; + u8 unit = adev->devno; -+ struct ata_device *pair = &ap->device[1-unit]; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + + int clock, altclock; + u8 v; + int sel = 0; + + /* Look for the most wanted clocking */ -+ if(itdev->want[0][0] > itdev->want[1][0]) { ++ if (itdev->want[0][0] > itdev->want[1][0]) { + clock = itdev->want[0][1]; + altclock = itdev->want[1][1]; + } else { @@ -9074,18 +9623,18 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + + /* Master doesn't care does the slave ? */ -+ if(clock == ATA_ANY) ++ if (clock == ATA_ANY) + clock = altclock; + + /* Nobody cares - keep the same clock */ -+ if(clock == ATA_ANY) ++ if (clock == ATA_ANY) + return; + /* No change */ -+ if(clock == itdev->clock_mode) ++ if (clock == itdev->clock_mode) + return; + + /* Load this into the controller ? */ -+ if(clock == ATA_66) ++ if (clock == ATA_66) + itdev->clock_mode = ATA_66; + else { + itdev->clock_mode = ATA_50; @@ -9100,7 +9649,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * Reprogram the UDMA/PIO of the pair drive for the switch + * MWDMA will be dealt with by the dma switcher + */ -+ if(pair && itdev->udma[1-unit] != UDMA_OFF) { ++ if (pair && itdev->udma[1-unit] != UDMA_OFF) { + it821x_program_udma(ap, pair, itdev->udma[1-unit]); + it821x_program(ap, pair, itdev->pio[1-unit]); + } @@ -9108,7 +9657,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * Reprogram the UDMA/PIO of our drive for the switch. + * MWDMA will be dealt with by the dma switcher + */ -+ if(itdev->udma[unit] != UDMA_OFF) { ++ if (itdev->udma[unit] != UDMA_OFF) { + it821x_program_udma(ap, adev, itdev->udma[unit]); + it821x_program(ap, adev, itdev->pio[unit]); + } @@ -9166,19 +9715,19 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + int unit = adev->devno; + u8 conf; + -+ if(adev->dma_mode >= XFER_UDMA_0) { ++ if (adev->dma_mode >= XFER_UDMA_0) { + int mode_wanted = adev->dma_mode - XFER_UDMA_0; + + itdev->want[unit][1] = udma_want[mode_wanted]; + itdev->want[unit][0] = 3; /* UDMA is high priority */ + itdev->mwdma[unit] = MWDMA_OFF; + itdev->udma[unit] = udma[mode_wanted]; -+ if(mode_wanted >= 5) ++ if (mode_wanted >= 5) + itdev->udma[unit] |= 0x8080; /* UDMA 5/6 select on */ + + /* UDMA on. Again revision 0x10 must do the pair */ + pci_read_config_byte(pdev, 0x50, &conf); -+ if(itdev->timing10) ++ if (itdev->timing10) + conf &= channel ? 0x9F: 0xE7; + else + conf &= ~ (1 << (3 + 2 * channel + unit)); @@ -9195,7 +9744,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* UDMA bits off - Revision 0x10 do them in pairs */ + pci_read_config_byte(pdev, 0x50, &conf); -+ if(itdev->timing10) ++ if (itdev->timing10) + conf |= channel ? 0x60: 0x18; + else + conf |= 1 << (3 + 2 * channel + unit); @@ -9220,9 +9769,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct it821x_dev *itdev = ap->private_data; + int unit = adev->devno; + -+ if(itdev->mwdma[unit] != MWDMA_OFF) ++ if (itdev->mwdma[unit] != MWDMA_OFF) + it821x_program(ap, adev, itdev->mwdma[unit]); -+ else if(itdev->udma[unit] != UDMA_OFF && itdev->timing10) ++ else if (itdev->udma[unit] != UDMA_OFF && itdev->timing10) + it821x_program_udma(ap, adev, itdev->udma[unit]); + ata_bmdma_start(qc); +} @@ -9244,7 +9793,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + int unit = adev->devno; + + ata_bmdma_stop(qc); -+ if(itdev->mwdma[unit] != MWDMA_OFF) ++ if (itdev->mwdma[unit] != MWDMA_OFF) + it821x_program(ap, adev, itdev->pio[unit]); +} + @@ -9260,7 +9809,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +void it821x_passthru_dev_select(struct ata_port *ap, unsigned int device) +{ + struct it821x_dev *itdev = ap->private_data; -+ if(itdev && device != itdev->last_device) { ++ if (itdev && device != itdev->last_device) { + struct ata_device *adev = &ap->device[device]; + it821x_program(ap, adev, itdev->pio[adev->devno]); + itdev->last_device = device; @@ -9308,7 +9857,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + dev->dma_mode = XFER_MW_DMA_0; + /* We do need the right mode information for DMA or PIO + and this comes from the current configuration flags */ -+ if(dma_enabled & (1 << (5 + i))) { ++ if (dma_enabled & (1 << (5 + i))) { + dev->xfer_mode = XFER_MW_DMA_0; + dev->xfer_shift = ATA_SHIFT_MWDMA; + dev->flags &= ~ATA_DFLAG_PIO; @@ -9319,6 +9868,8 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + /* Keep sector count safe (LBA48 counts blow the + brains of the firmware) */ ++ ++ /* Do we need a dev_config method ? */ + dev->flags |= ATA_DFLAG_LOCK_SECTORS; + } + } @@ -9338,10 +9889,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct it821x_dev *itdev = ap->private_data; + + /* No ATAPI DMA in smart mode */ -+ if(itdev->smart) ++ if (itdev->smart) + return -EOPNOTSUPP; + /* No ATAPI DMA on rev 10 */ -+ if(itdev->timing10) ++ if (itdev->timing10) + return -EOPNOTSUPP; + /* Cool */ + return 0; @@ -9365,11 +9916,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 conf; + + int ret = ata_port_start(ap); -+ if(ret < 0) ++ if (ret < 0) + return ret; + + ap->private_data = kmalloc(sizeof(struct it821x_dev), GFP_KERNEL); -+ if(ap->private_data == NULL) { ++ if (ap->private_data == NULL) { + ata_port_stop(ap); + return -ENOMEM; + } @@ -9379,7 +9930,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_byte(pdev, 0x50, &conf); + -+ if(conf & 1) { ++ if (conf & 1) { + itdev->smart = 1; + /* Long I/O's although allowed in LBA48 space cause the + onboard firmware to enter the twighlight zone */ @@ -9396,10 +9947,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + itdev->last_device = -1; + + pci_read_config_byte(pdev, PCI_REVISION_ID, &conf); -+ if(conf == 0x10) { ++ if (conf == 0x10) { + itdev->timing10 = 1; + /* Need to disable ATAPI DMA for this case */ -+ if(!itdev->smart) ++ if (!itdev->smart) + printk(KERN_WARNING DRV_NAME": Revision 0x10, workarounds activated.\n"); + } + @@ -9550,7 +10101,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + conf &= 1; + + printk(KERN_INFO DRV_NAME ": controller in %s mode.\n", mode[conf]); -+ if(conf == 0) ++ if (conf == 0) + port_info[0] = port_info[1] = &info_passthru; + else + port_info[0] = port_info[1] = &info_smart; @@ -9595,10 +10146,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(it821x_init); +module_exit(it821x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_legacy.c linux-2.6.16-rc2/drivers/scsi/pata_legacy.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_legacy.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_legacy.c 2006-02-07 11:44:14.578535784 +0000 -@@ -0,0 +1,668 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_legacy.c linux-2.6.16-rc4/drivers/scsi/pata_legacy.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_legacy.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_legacy.c 2006-02-16 15:33:52.000000000 +0000 +@@ -0,0 +1,672 @@ + +/* + * pata-legacy.c - Legacy port PATA/SATA controller driver. @@ -9618,7 +10169,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "legacy" -+#define DRV_VERSION "0.3" ++#define DRV_VERSION "0.3.1" + +#define NR_HOST 6 + @@ -9741,36 +10292,40 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +} + -+static void pdc_data_xfer_vlb(struct ata_port *ap, unsigned char *buf, unsigned int buflen, int write_data) ++static void pdc_data_xfer_vlb(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, unsigned int buflen, int write_data) +{ + int slop = buflen & 3; + unsigned long flags; -+ -+ local_irq_save(flags); + -+ /* Perform the 32bit I/O synchronization sequence */ -+ inb(ap->ioaddr.nsect_addr); -+ inb(ap->ioaddr.nsect_addr); -+ inb(ap->ioaddr.nsect_addr); -+ -+ /* Now the data */ ++ if (ata_id_has_dword_io(adev->id)) { ++ local_irq_save(flags); + -+ if (write_data) -+ outsl(ap->ioaddr.data_addr, buf, buflen >> 2); -+ else -+ insl(ap->ioaddr.data_addr, buf, buflen >> 2); ++ /* Perform the 32bit I/O synchronization sequence */ ++ inb(ap->ioaddr.nsect_addr); ++ inb(ap->ioaddr.nsect_addr); ++ inb(ap->ioaddr.nsect_addr); + -+ if (unlikely(slop)) { -+ u32 pad; -+ if (write_data) { -+ memcpy(&pad, buf + buflen - slop, slop); -+ outl(le32_to_cpu(pad), ap->ioaddr.data_addr); -+ } else { -+ pad = cpu_to_le16(inl(ap->ioaddr.data_addr)); -+ memcpy(buf + buflen - slop, &pad, slop); ++ /* Now the data */ ++ ++ if (write_data) ++ outsl(ap->ioaddr.data_addr, buf, buflen >> 2); ++ else ++ insl(ap->ioaddr.data_addr, buf, buflen >> 2); ++ ++ if (unlikely(slop)) { ++ u32 pad; ++ if (write_data) { ++ memcpy(&pad, buf + buflen - slop, slop); ++ outl(le32_to_cpu(pad), ap->ioaddr.data_addr); ++ } else { ++ pad = cpu_to_le16(inl(ap->ioaddr.data_addr)); ++ memcpy(buf + buflen - slop, &pad, slop); ++ } + } ++ local_irq_restore(flags); + } -+ local_irq_restore(flags); ++ else ++ ata_pio_data_xfer_noirq(ap, adev, buf, buflen, write_data); +} + +static struct ata_port_operations pdc20230_port_ops = { @@ -9809,7 +10364,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct ata_timing t; + + /* Get the timing data in cycles. For now play safe at 50Mhz */ -+ ata_timing_compute(adev, adev->pio_mode, &t, 50000, 1000); ++ ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000); + + active = FIT(t.active, 2, 15); + recover = FIT(t.recover, 4, 15); @@ -9861,7 +10416,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct ata_timing t; + + /* Get the timing data in cycles. For now play safe at 50Mhz */ -+ ata_timing_compute(adev, adev->pio_mode, &t, 50000, 1000); ++ ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000); + + active = FIT(t.active, 2, 15); + recover = FIT(t.recover, 2, 16); @@ -9876,7 +10431,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + if (adev->class != ATA_DEV_ATA) { + u8 rconf = inb(0x3E6); -+ if(rconf & 0x24) { ++ if (rconf & 0x24) { + rconf &= ~ 0x24; + outb(rconf, 0x3E6); + } @@ -9917,7 +10472,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +{ + u8 active, recover, setup; + struct ata_timing t; -+ struct ata_device *pair = &ap->device[adev->devno ^ 1]; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + int clock; + int khz[4] = { 50000, 40000, 33000, 25000 }; + u8 rc; @@ -9927,13 +10482,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + inb(ap->ioaddr.error_addr); + + /* Read VLB clock strapping */ -+ clock = khz[inb(ap->ioaddr.lbah_addr) & 0x03]; ++ clock = 1000000000 / khz[inb(ap->ioaddr.lbah_addr) & 0x03]; + + /* Get the timing data in cycles */ + ata_timing_compute(adev, adev->pio_mode, &t, clock, 1000); + + /* Setup timing is shared */ -+ if (ata_dev_present(pair)) { ++ if (pair) { + struct ata_timing tp; + ata_timing_compute(pair, pair->pio_mode, &tp, clock, 1000); + @@ -10054,7 +10609,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + outb(0x55, 0x1F2); + inb(0x1F2); + inb(0x1F2); -+ if(inb(0x1F2) == 0x00) { ++ if (inb(0x1F2) == 0x00) { + printk(KERN_INFO "PDC20230-B VLB ATA controller detected.\n"); + } + } @@ -10267,9 +10822,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +module_init(legacy_init); +module_exit(legacy_exit); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_mpiix.c linux-2.6.16-rc2/drivers/scsi/pata_mpiix.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_mpiix.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_mpiix.c 2006-01-21 16:55:12.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_mpiix.c linux-2.6.16-rc4/drivers/scsi/pata_mpiix.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_mpiix.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_mpiix.c 2006-02-16 15:38:41.000000000 +0000 @@ -0,0 +1,303 @@ +/* + * pata_mpiix.c - Intel MPIIX PATA for new ATA layer @@ -10517,7 +11072,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Now add the port that is active */ + enabled = (idetim & 0x4000) ? 1 : 0; + -+ if(ata_device_add(&probe[enabled])) ++ if (ata_device_add(&probe[enabled])) + return 0; + return -ENODEV; +} @@ -10574,10 +11129,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(mpiix_init); +module_exit(mpiix_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_netcell.c linux-2.6.16-rc2/drivers/scsi/pata_netcell.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_netcell.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_netcell.c 2006-02-07 13:48:27.721485832 +0000 -@@ -0,0 +1,178 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_netcell.c linux-2.6.16-rc4/drivers/scsi/pata_netcell.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_netcell.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_netcell.c 2006-02-08 14:05:57.000000000 +0000 +@@ -0,0 +1,176 @@ +/* + * pata_netcell.c - Netcell PATA driver + * @@ -10620,8 +11175,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static void netcell_phy_reset(struct ata_port *ap) +{ -+ /* If you have enable bits for devices ... , if not delete */ -+ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + ap->cbl = netcell_cable_detect(ap); + ata_port_probe(ap); + ata_bus_reset(ap); @@ -10756,9 +11309,226 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +MODULE_DEVICE_TABLE(pci, netcell_pci_tbl); +MODULE_VERSION(DRV_VERSION); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_oldpiix.c linux-2.6.16-rc2/drivers/scsi/pata_oldpiix.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_oldpiix.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_oldpiix.c 2006-01-21 16:55:29.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_ns87410.c linux-2.6.16-rc4/drivers/scsi/pata_ns87410.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_ns87410.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_ns87410.c 2006-02-15 15:05:43.000000000 +0000 +@@ -0,0 +1,213 @@ ++/* ++ * pata_ns87410.c - National Semiconductor 87410 PATA for new ATA layer ++ * (C) 2006 Red Hat Inc ++ * Alan Cox <alan@redhat.com> ++ * ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/pci.h> ++#include <linux/init.h> ++#include <linux/blkdev.h> ++#include <linux/delay.h> ++#include <scsi/scsi_host.h> ++#include <linux/libata.h> ++ ++#define DRV_NAME "pata_ns87410" ++#define DRV_VERSION "0.1" ++ ++/** ++ * ns87410_phy_reset - probe reset ++ * @ap: ATA port ++ * ++ * Perform the ATA probe and bus reset sequence plus specific handling ++ * for this hardware. The MPIIX has the enable bits in a different place ++ * to PIIX4 and friends. As a pure PIO device it has no cable detect ++ */ ++ ++static void ns87410_phy_reset(struct ata_port *ap) ++{ ++ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); ++ static const struct pci_bits ns87410_enable_bits[] = { ++ { 0x43, 1, 0x08, 0x08 }, ++ { 0x47, 1, 0x08, 0x08 } ++ }; ++ ++ if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->hard_port_no])) { ++ ata_port_disable(ap); ++ printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id); ++ return; ++ } ++ ap->cbl = ATA_CBL_PATA40; ++ ata_port_probe(ap); ++ ata_bus_reset(ap); ++} ++ ++/** ++ * ns87410_set_piomode - set initial PIO mode data ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Program timing data. This is kept per channel not per device, ++ * and only affects the data port. ++ */ ++ ++static void ns87410_set_piomode(struct ata_port *ap, struct ata_device *adev) ++{ ++ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); ++ int port = 0x40 + 4 * ap->hard_port_no; ++ u8 idetcr, idefr; ++ struct ata_timing at; ++ ++ static const u8 activebits[15] = { ++ 0, 1, 2, 3, 4, ++ 5, 5, 6, 6, 6, ++ 6, 7, 7, 7, 7 ++ }; ++ ++ static const u8 recoverbits[12] = { ++ 0, 1, 2, 3, 4, 5, 6, 6, 7, 7, 7, 7 ++ }; ++ ++ pci_read_config_byte(pdev, port + 3, &idefr); ++ ++ if (ata_pio_need_iordy(adev)) ++ idefr |= 0x04; /* IORDY enable */ ++ else ++ idefr &= ~0x04; ++ ++ if (ata_timing_compute(adev, adev->pio_mode, &at, 30303, 1) < 0) { ++ dev_printk(KERN_ERR, &pdev->dev, "unknown mode %d.\n", adev->pio_mode); ++ return; ++ } ++ ++ at.active = FIT(at.active, 2, 16) - 2; ++ at.setup = FIT(at.setup, 1, 4) - 1; ++ at.recover = FIT(at.recover, 1, 12) - 1; ++ ++ idetcr = (at.setup << 6) | (recoverbits[at.recover] << 3) | activebits[at.active]; ++ ++ pci_write_config_byte(pdev, port, idetcr); ++ pci_write_config_byte(pdev, port + 3, idefr); ++ /* We use ap->private_data as a pointer to the device currently ++ loaded for timing */ ++ ap->private_data = adev; ++} ++ ++/** ++ * ns87410_qc_issue_prot - command issue ++ * @qc: command pending ++ * ++ * Called when the libata layer is about to issue a command. We wrap ++ * this interface so that we can load the correct ATA timings if ++ * neccessary. Our logic also clears TIME0/TIME1 for the other device so ++ * that, even if we get this wrong, cycles to the other device will ++ * be made PIO0. ++ */ ++ ++static int ns87410_qc_issue_prot(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ ++ /* If modes have been configured and the channel data is not loaded ++ then load it. We have to check if pio_mode is set as the core code ++ does not set adev->pio_mode to XFER_PIO_0 while probing as would be ++ logical */ ++ ++ if (adev->pio_mode && adev != ap->private_data) ++ ns87410_set_piomode(ap, adev); ++ ++ return ata_qc_issue_prot(qc); ++} ++ ++static struct scsi_host_template ns87410_sht = { ++ .module = THIS_MODULE, ++ .name = DRV_NAME, ++ .ioctl = ata_scsi_ioctl, ++ .queuecommand = ata_scsi_queuecmd, ++ .eh_strategy_handler = ata_scsi_error, ++ .can_queue = ATA_DEF_QUEUE, ++ .this_id = ATA_SHT_THIS_ID, ++ .sg_tablesize = LIBATA_MAX_PRD, ++ .max_sectors = ATA_MAX_SECTORS, ++ .cmd_per_lun = ATA_SHT_CMD_PER_LUN, ++ .emulated = ATA_SHT_EMULATED, ++ .use_clustering = ATA_SHT_USE_CLUSTERING, ++ .proc_name = DRV_NAME, ++ .dma_boundary = ATA_DMA_BOUNDARY, ++ .slave_configure = ata_scsi_slave_config, ++ .bios_param = ata_std_bios_param, ++// .ordered_flush = 1, ++}; ++ ++static struct ata_port_operations ns87410_port_ops = { ++ .port_disable = ata_port_disable, ++ .set_piomode = ns87410_set_piomode, ++ ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ ++ .phy_reset = ns87410_phy_reset, ++ ++ .qc_prep = ata_qc_prep, ++ .qc_issue = ns87410_qc_issue_prot, ++ .eng_timeout = ata_eng_timeout, ++ .data_xfer = ata_pio_data_xfer, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ata_host_stop ++}; ++ ++static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id) ++{ ++ static struct ata_port_info info = { ++ .sht = &ns87410_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, ++ .pio_mask = 0x0F, ++ .port_ops = &ns87410_port_ops ++ }; ++ static struct ata_port_info *port_info[2] = {&info, &info}; ++ return ata_pci_init_one(dev, port_info, 2); ++} ++ ++static const struct pci_device_id ns87410[] = { ++ { PCI_DEVICE(0x100B, 0xD001), }, ++ { 0, }, ++}; ++ ++static struct pci_driver ns87410_pci_driver = { ++ .name = DRV_NAME, ++ .id_table = ns87410, ++ .probe = ns87410_init_one, ++ .remove = ata_pci_remove_one ++}; ++ ++static int __init ns87410_init(void) ++{ ++ return pci_register_driver(&ns87410_pci_driver); ++} ++ ++ ++static void __exit ns87410_exit(void) ++{ ++ pci_unregister_driver(&ns87410_pci_driver); ++} ++ ++ ++MODULE_AUTHOR("Alan Cox"); ++MODULE_DESCRIPTION("low-level driver for Nat Semi 87410"); ++MODULE_LICENSE("GPL"); ++MODULE_DEVICE_TABLE(pci, ns87410); ++MODULE_VERSION(DRV_VERSION); ++ ++module_init(ns87410_init); ++module_exit(ns87410_exit); +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_oldpiix.c linux-2.6.16-rc4/drivers/scsi/pata_oldpiix.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_oldpiix.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_oldpiix.c 2006-01-21 16:55:29.000000000 +0000 @@ -0,0 +1,327 @@ +/* + * pata_oldpiix.c - Intel PATA/SATA controllers @@ -11087,9 +11857,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +MODULE_DEVICE_TABLE(pci, oldpiix_pci_tbl); +MODULE_VERSION(DRV_VERSION); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_opti.c linux-2.6.16-rc2/drivers/scsi/pata_opti.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_opti.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_opti.c 2006-01-21 16:55:42.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_opti.c linux-2.6.16-rc4/drivers/scsi/pata_opti.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_opti.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_opti.c 2006-02-16 15:38:28.000000000 +0000 @@ -0,0 +1,268 @@ +/* + * pata_opti.c - ATI PATA for new ATA layer @@ -11121,7 +11891,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_opti" -+#define DRV_VERSION "0.1.1" ++#define DRV_VERSION "0.1.2" + +enum { + READ_REG = 0, /* index of Read cycle timing register */ @@ -11217,7 +11987,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static void opti_set_piomode(struct ata_port *ap, struct ata_device *adev) +{ -+ struct ata_device *pair = &ap->device[1 - adev->devno]; ++ struct ata_device *pair = ata_dev_pair(ap, adev); + int clock; + int pio = adev->pio_mode - XFER_PIO_0; + unsigned long regio = ap->ioaddr.cmd_addr; @@ -11242,10 +12012,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + */ + + addr = addr_timing[clock][pio]; -+ if (ata_dev_present(pair)) { ++ if (pair) { + /* Hardware constraint */ + u8 pair_addr = addr_timing[clock][pair->pio_mode - XFER_PIO_0]; -+ if(pair_addr > addr) ++ if (pair_addr > addr) + addr = pair_addr; + } + @@ -11359,9 +12129,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(opti_init); +module_exit(opti_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_pcmcia.c linux-2.6.16-rc2/drivers/scsi/pata_pcmcia.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_pcmcia.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_pcmcia.c 2006-01-21 16:55:56.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pcmcia.c linux-2.6.16-rc4/drivers/scsi/pata_pcmcia.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pcmcia.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_pcmcia.c 2006-02-20 17:26:30.000000000 +0000 @@ -0,0 +1,406 @@ +/* + * pata-pcmcia.c - PCMCIA PATA controller driver. @@ -11742,7 +12512,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static struct pcmcia_driver pcmcia_driver = { + .owner = THIS_MODULE, -+ .drv { ++ .drv = { + .name = DRV_NAME, + }, + .id_table = pcmcia_devices, @@ -11769,9 +12539,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(pcmcia_init); +module_exit(pcmcia_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_pdc2027x.c linux-2.6.16-rc2/drivers/scsi/pata_pdc2027x.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_pdc2027x.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_pdc2027x.c 2006-01-21 16:56:47.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pdc2027x.c linux-2.6.16-rc4/drivers/scsi/pata_pdc2027x.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pdc2027x.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_pdc2027x.c 2006-01-21 16:56:47.000000000 +0000 @@ -0,0 +1,857 @@ +/* + * Promise PATA TX2/TX4/TX2000/133 IDE driver for pdc20268 to pdc20277. @@ -12630,10 +13400,442 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(pdc2027x_init); +module_exit(pdc2027x_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_qdi.c linux-2.6.16-rc2/drivers/scsi/pata_qdi.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_qdi.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_qdi.c 2006-01-21 20:43:47.000000000 +0000 -@@ -0,0 +1,367 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pdc202xx_old.c linux-2.6.16-rc4/drivers/scsi/pata_pdc202xx_old.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_pdc202xx_old.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_pdc202xx_old.c 2006-02-20 13:19:57.000000000 +0000 +@@ -0,0 +1,428 @@ ++/* ++ * pata_pdc202xx_old.c - SL82C105 PATA for new ATA layer ++ * (C) 2005 Red Hat Inc ++ * Alan Cox <alan@redhat.com> ++ * ++ * Based in part on linux/drivers/ide/pci/pdc202xx_old.c ++ * ++ * Initial revision ++ * ++ * TODO: ++ * Channel interlock/reset on both required ? ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/pci.h> ++#include <linux/init.h> ++#include <linux/blkdev.h> ++#include <linux/delay.h> ++#include <scsi/scsi_host.h> ++#include <linux/libata.h> ++ ++#define DRV_NAME "pata_pdc202xx_old" ++#define DRV_VERSION "0.1.2" ++ ++static void pdc2024x_phy_reset(struct ata_port *ap) ++{ ++ ap->cbl = ATA_CBL_PATA40; ++ ata_port_probe(ap); ++ ata_bus_reset(ap); ++} ++ ++ ++static void pdc2026x_phy_reset(struct ata_port *ap) ++{ ++ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); ++ u16 cis; ++ ++ pci_read_config_word(pdev, 0x50, &cis); ++ if (cis & (1 << (10 + ap->hard_port_no))) ++ ap->cbl = ATA_CBL_PATA80; ++ else ++ ap->cbl = ATA_CBL_PATA40; ++ ata_port_probe(ap); ++ ata_bus_reset(ap); ++} ++ ++ ++/** ++ * pdc_configure_piomode - set chip PIO timing ++ * @ap: ATA interface ++ * @adev: ATA device ++ * @pio: PIO mode ++ * ++ * Called to do the PIO mode setup. Our timing registers are shared ++ * so a configure_dmamode call will undo any work we do here and vice ++ * versa ++ */ ++ ++static void pdc_configure_piomode(struct ata_port *ap, struct ata_device *adev, int pio) ++{ ++ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); ++ int port = 0x60 + 4 * ap->hard_port_no + 2 * adev->devno; ++ static u16 pio_timing[5] = { ++ 0x0913, 0x050C , 0x0308, 0x0206, 0x0104 ++ }; ++ u8 r_ap, r_bp; ++ ++ /* FIFO, IORDY ? */ ++ pci_read_config_byte(pdev, port, &r_ap); ++ pci_read_config_byte(pdev, port + 1, &r_bp); ++ r_ap &= ~0x0F; ++ r_bp &= ~0x07; ++ r_ap |= (pio_timing[pio] >> 8); ++ r_bp |= (pio_timing[pio] & 0xFF); ++ pci_write_config_byte(pdev, port, r_ap); ++ pci_write_config_byte(pdev, port + 1, r_bp); ++} ++ ++/** ++ * pdc_set_piomode - set initial PIO mode data ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Called to do the PIO mode setup. Our timing registers are shared ++ * but we want to set the PIO timing by default. ++ */ ++ ++static void pdc_set_piomode(struct ata_port *ap, struct ata_device *adev) ++{ ++ pdc_configure_piomode(ap, adev, adev->pio_mode - XFER_PIO_0); ++} ++ ++/** ++ * pdc_configure_dmamode - set DMA mode in chip ++ * @ap: ATA interface ++ * @adev: ATA device ++ * ++ * Load DMA cycle times into the chip ready for a DMA transfer ++ * to occur. ++ */ ++ ++static void pdc_set_dmamode(struct ata_port *ap, struct ata_device *adev) ++{ ++ struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); ++ int port = 0x60 + 4 * ap->hard_port_no + 2 * adev->devno; ++ static u8 udma_timing[6][2] = { ++ { 0x60, 0x03 }, /* 33 Mhz Clock */ ++ { 0x40, 0x02 }, ++ { 0x20, 0x01 }, ++ { 0x40, 0x02 }, /* 66 Mhz Clock */ ++ { 0x20, 0x01 }, ++ { 0x20, 0x01 } ++ }; ++ u8 r_bp, r_cp; ++ ++ pci_read_config_byte(pdev, port + 1, &r_bp); ++ pci_read_config_byte(pdev, port + 2, &r_cp); ++ ++ r_bp &= ~0xF0; ++ r_cp &= ~0x0F; ++ ++ if (adev->dma_mode >= XFER_UDMA_0) { ++ int speed = adev->dma_mode - XFER_UDMA_0; ++ r_bp |= udma_timing[speed][0]; ++ r_cp |= udma_timing[speed][1]; ++ ++ } else { ++ int speed = adev->dma_mode - XFER_MW_DMA_0; ++ r_bp |= 0x60; ++ r_cp |= (5 - speed); ++ } ++ pci_write_config_byte(pdev, port + 1, r_bp); ++ pci_write_config_byte(pdev, port + 2, r_cp); ++ ++} ++ ++/** ++ * pdc2026x_reset_engine - Reset the DMA engine ++ * @ap: ATA interface ++ * ++ * Reset the 2026x DMA engine. This is not something we want to do, ++ * and we need to figure out how to serialize this across dual channel ++ * devices if it is neccessary. ++ * ++ * FIXME: Do we need to reset the other interface too ? ++ */ ++ ++static void pdc2026x_reset_engine(struct ata_port *ap) ++{ ++ unsigned long ctrl = ap->host_set->ports[0]->ioaddr.bmdma_addr + 0x1F; ++ ++ u8 val = inb(ctrl); ++ outb(val | 0x10, ctrl); ++ mdelay(100); ++ outb(val & ~0x10, ctrl); ++ mdelay(2000); /* Check - seems to be overkill, plus if needed ++ redo locking */ ++ /* Need to fix up speed info at this point */ ++} ++ ++/** ++ * pdc2026x_bmdma_start - DMA engine begin ++ * @qc: ATA command ++ * ++ * In UDMA3 or higher we have to clock switch for the duration of the ++ * DMA transfer sequence. ++ */ ++ ++static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ int sel66 = ap->hard_port_no ? 0x08: 0x02; ++ /* The clock bits are in the same register for both channels */ ++ unsigned long clock = ap->host_set->ports[0]->ioaddr.bmdma_addr + 0x11; ++ ++ /* Check we keep host_set level locking here */ ++ if (adev->dma_mode >= XFER_UDMA_2) ++ outb(inb(clock) | sel66, clock); ++ else ++ outb(inb(clock) & ~sel66, clock); ++ /* The DMA clocks may have been trashed by a reset. FIXME: make conditional ++ and move to qc_issue ? */ ++ pdc_set_dmamode(ap, qc->dev); ++ /* Activate DMA */ ++ ata_bmdma_start(qc); ++} ++ ++/** ++ * pdc2026x_bmdma_end - DMA engine stop ++ * @qc: ATA command ++ * ++ * After a DMA completes we need to put the clock back to 33MHz for ++ * PIO timings. ++ */ ++ ++static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ int sel66 = ap->hard_port_no ? 0x08: 0x02; ++ /* The clock bits are in the same register for both channels */ ++ unsigned long clock = ap->host_set->ports[0]->ioaddr.bmdma_addr + 0x11; ++ ++ /* FIXME: Review LBA48 code in ide/pci driver */ ++ ata_bmdma_stop(qc); ++ /* Check we keep host_set level locking here */ ++ /* Flip back to 33Mhz for PIO */ ++ if (adev->dma_mode >= XFER_UDMA_2) ++ outb(inb(clock) & ~sel66, clock); ++} ++ ++/** ++ * pdc2026x_eng_timeout - command timeout ++ * @qc: command that timed out ++ * ++ * When the PDC2026x times out hit the controller over the head ++ * with a hammer before continuing. The reset unfortunately also ++ * resets the timing registers so we must reprogram these. ++ */ ++ ++static void pdc2026x_eng_timeout(struct ata_port *ap) ++{ ++ int i; ++ ++ /* Perform libata side housekeeping */ ++ ata_eng_timeout(ap); ++ ++ /* Reset the controller */ ++ pdc2026x_reset_engine(ap); ++ ++ /* Reprogram the device timings */ ++ for (i = 0; i < 2; i++) { ++ struct ata_device *adev = &ap->device[i]; ++ if (ata_dev_present(adev)) { ++ pdc_set_piomode(ap, adev); ++ if (adev->dma_mode) ++ pdc_set_dmamode(ap, adev); ++ } ++ } ++} ++ ++/** ++ * pdc2026x_dev_config - device setup hook ++ * @ap: ATA port ++ * @adev: newly found device ++ * ++ * Perform chip specific early setup. We need to lock the transfer ++ * sizes to 8bit to avoid making the state engine on the 2026x cards ++ * barf. ++ */ ++ ++static void pdc2026x_dev_config(struct ata_port *ap, struct ata_device *adev) ++{ ++ /* We cannot blindly set 256 as the core code may already ++ have picked a lower limit */ ++ ++ if(ap->host->max_sectors > 256) { ++ ap->host->max_sectors = 256; ++ ap->host->hostt->max_sectors = 256; ++ } ++ adev->flags |= ATA_DFLAG_LOCK_SECTORS; ++} ++ ++static struct scsi_host_template pdc_sht = { ++ .module = THIS_MODULE, ++ .name = DRV_NAME, ++ .ioctl = ata_scsi_ioctl, ++ .queuecommand = ata_scsi_queuecmd, ++ .eh_strategy_handler = ata_scsi_error, ++ .can_queue = ATA_DEF_QUEUE, ++ .this_id = ATA_SHT_THIS_ID, ++ .sg_tablesize = LIBATA_MAX_PRD, ++ .max_sectors = ATA_MAX_SECTORS, ++ .cmd_per_lun = ATA_SHT_CMD_PER_LUN, ++ .emulated = ATA_SHT_EMULATED, ++ .use_clustering = ATA_SHT_USE_CLUSTERING, ++ .proc_name = DRV_NAME, ++ .dma_boundary = ATA_DMA_BOUNDARY, ++ .slave_configure = ata_scsi_slave_config, ++ .bios_param = ata_std_bios_param, ++// .ordered_flush = 1, ++}; ++ ++static struct ata_port_operations pdc2024x_port_ops = { ++ .port_disable = ata_port_disable, ++ .set_piomode = pdc_set_piomode, ++ .set_dmamode = pdc_set_dmamode, ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ ++ .phy_reset = pdc2024x_phy_reset, ++ ++ .bmdma_setup = ata_bmdma_setup, ++ .bmdma_start = ata_bmdma_start, ++ .bmdma_stop = ata_bmdma_stop, ++ .bmdma_status = ata_bmdma_status, ++ ++ .qc_prep = ata_qc_prep, ++ .qc_issue = ata_qc_issue_prot, ++ .eng_timeout = ata_eng_timeout, ++ .data_xfer = ata_pio_data_xfer, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ata_host_stop ++}; ++ ++static struct ata_port_operations pdc2026x_port_ops = { ++ .port_disable = ata_port_disable, ++ .set_piomode = pdc_set_piomode, ++ .set_dmamode = pdc_set_dmamode, ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ .dev_config = pdc2026x_dev_config, ++ ++ .phy_reset = pdc2026x_phy_reset, ++ ++ .bmdma_setup = ata_bmdma_setup, ++ .bmdma_start = pdc2026x_bmdma_start, ++ .bmdma_stop = pdc2026x_bmdma_stop, ++ .bmdma_status = ata_bmdma_status, ++ ++ .qc_prep = ata_qc_prep, ++ .qc_issue = ata_qc_issue_prot, ++ .eng_timeout = pdc2026x_eng_timeout, ++ .data_xfer = ata_pio_data_xfer, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ata_host_stop ++}; ++ ++static int pdc_init_one(struct pci_dev *dev, const struct pci_device_id *id) ++{ ++ static struct ata_port_info info[3] = { ++ { ++ .sht = &pdc_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, ++ .pio_mask = 0x1f, ++ .mwdma_mask = 0x07, ++ .udma_mask = ATA_UDMA2, ++ .port_ops = &pdc2024x_port_ops ++ }, ++ { ++ .sht = &pdc_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, ++ .pio_mask = 0x1f, ++ .mwdma_mask = 0x07, ++ .udma_mask = ATA_UDMA4, ++ .port_ops = &pdc2026x_port_ops ++ }, ++ { ++ .sht = &pdc_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, ++ .pio_mask = 0x1f, ++ .mwdma_mask = 0x07, ++ .udma_mask = ATA_UDMA5, ++ .port_ops = &pdc2026x_port_ops ++ } ++ ++ }; ++ static struct ata_port_info *port_info[2]; ++ ++ port_info[0] = port_info[1] = &info[id->driver_data]; ++ ++ if (dev->device == PCI_DEVICE_ID_PROMISE_20265) { ++ struct pci_dev *bridge = dev->bus->self; ++ /* Don't grab anything behind a Promise I2O RAID */ ++ if (bridge && bridge->vendor == PCI_VENDOR_ID_INTEL) { ++ if( bridge->device == PCI_DEVICE_ID_INTEL_I960) ++ return -ENODEV; ++ if( bridge->device == PCI_DEVICE_ID_INTEL_I960RM) ++ return -ENODEV; ++ } ++ } ++ return ata_pci_init_one(dev, port_info, 2); ++} ++ ++static struct pci_device_id pdc[] = { ++ { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, ++ { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, ++ { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, ++ { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, ++ { PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, ++ { 0, }, ++}; ++ ++static struct pci_driver pdc_pci_driver = { ++ .name = DRV_NAME, ++ .id_table = pdc, ++ .probe = pdc_init_one, ++ .remove = ata_pci_remove_one ++}; ++ ++static int __init pdc_init(void) ++{ ++ return pci_register_driver(&pdc_pci_driver); ++} ++ ++ ++static void __exit pdc_exit(void) ++{ ++ pci_unregister_driver(&pdc_pci_driver); ++} ++ ++ ++MODULE_AUTHOR("Alan Cox"); ++MODULE_DESCRIPTION("low-level driver for Promise 2024x and 20262-20267"); ++MODULE_LICENSE("GPL"); ++MODULE_DEVICE_TABLE(pci, pdc); ++MODULE_VERSION(DRV_VERSION); ++ ++module_init(pdc_init); ++module_exit(pdc_exit); +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_qdi.c linux-2.6.16-rc4/drivers/scsi/pata_qdi.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_qdi.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_qdi.c 2006-02-15 15:08:22.000000000 +0000 +@@ -0,0 +1,370 @@ +/* + * pata_qdi.c - QDI VLB ATA controllers + * (C) 2006 Red Hat <alan@redhat.com> @@ -12660,7 +13862,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_qdi" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2" + +#define NR_HOST 4 /* Two 6580s */ + @@ -12684,7 +13886,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 timing; + + /* Get the timing data in cycles */ -+ ata_timing_compute(adev, adev->pio_mode, &t, 33000, 1000); ++ ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); + + if (qdi->fast) { + active = 8 - FIT(t.active, 1, 8); @@ -12708,7 +13910,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 timing; + + /* Get the timing data in cycles */ -+ ata_timing_compute(adev, adev->pio_mode, &t, 33, 1000); ++ ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); + + if (qdi->fast) { + active = 8 - FIT(t.active, 1, 8); @@ -12751,25 +13953,28 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + return ata_qc_issue_prot(qc); +} + -+static void qdi_data_xfer(struct ata_port *ap, unsigned char *buf, unsigned int buflen, int write_data) ++static void qdi_data_xfer(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, unsigned int buflen, int write_data) +{ + int slop = buflen & 3; + -+ if (write_data) -+ outsl(ap->ioaddr.data_addr, buf, buflen >> 2); -+ else -+ insl(ap->ioaddr.data_addr, buf, buflen >> 2); ++ if (ata_id_has_dword_io(adev->id)) { ++ if (write_data) ++ outsl(ap->ioaddr.data_addr, buf, buflen >> 2); ++ else ++ insl(ap->ioaddr.data_addr, buf, buflen >> 2); + -+ if (unlikely(slop)) { -+ u32 pad; -+ if (write_data) { -+ memcpy(&pad, buf + buflen - slop, slop); -+ outl(le32_to_cpu(pad), ap->ioaddr.data_addr); -+ } else { -+ pad = cpu_to_le16(inl(ap->ioaddr.data_addr)); -+ memcpy(buf + buflen - slop, &pad, slop); ++ if (unlikely(slop)) { ++ u32 pad; ++ if (write_data) { ++ memcpy(&pad, buf + buflen - slop, slop); ++ outl(le32_to_cpu(pad), ap->ioaddr.data_addr); ++ } else { ++ pad = cpu_to_le16(inl(ap->ioaddr.data_addr)); ++ memcpy(buf + buflen - slop, &pad, slop); ++ } + } -+ } ++ } else ++ ata_pio_data_xfer(ap, adev, buf, buflen, write_data); +} + +static struct scsi_host_template qdi_sht = { @@ -13001,9 +14206,334 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +module_init(qdi_init); +module_exit(qdi_exit); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_rz1000.c linux-2.6.16-rc2/drivers/scsi/pata_rz1000.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_rz1000.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_rz1000.c 2006-02-07 13:37:54.369769928 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_radisys.c linux-2.6.16-rc4/drivers/scsi/pata_radisys.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_radisys.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_radisys.c 2006-02-17 15:31:12.000000000 +0000 +@@ -0,0 +1,321 @@ ++/* ++ * pata_radisys.c - Intel PATA/SATA controllers ++ * ++ * (C) 2006 Red Hat <alan@redhat.com> ++ * ++ * Some parts based on ata_piix.c by Jeff Garzik and others. ++ * ++ * A PIIX relative, this device has a single ATA channel and no ++ * slave timings, SITRE or PPE. In that sense it is a close relative ++ * of the original PIIX. It does however support UDMA 33/66 per channel ++ * although no other modes/timings. Also lacking is 32bit I/O on the ATA ++ * port. ++ */ ++ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/pci.h> ++#include <linux/init.h> ++#include <linux/blkdev.h> ++#include <linux/delay.h> ++#include <linux/device.h> ++#include <scsi/scsi_host.h> ++#include <linux/libata.h> ++#include <linux/ata.h> ++ ++#define DRV_NAME "pata_radisys" ++#define DRV_VERSION "0.2" ++ ++/** ++ * radisys_pata_phy_reset - Probe specified port on PATA host controller ++ * @ap: Port to probe ++ * ++ * LOCKING: ++ * None (inherited from caller). ++ */ ++ ++static void radisys_pata_phy_reset(struct ata_port *ap) ++{ ++ ap->cbl = ATA_CBL_PATA80; ++ ata_port_probe(ap); ++ ata_bus_reset(ap); ++} ++ ++/** ++ * radisys_set_piomode - Initialize host controller PATA PIO timings ++ * @ap: Port whose timings we are configuring ++ * @adev: um ++ * ++ * Set PIO mode for device, in host controller PCI config space. ++ * ++ * LOCKING: ++ * None (inherited from caller). ++ */ ++ ++static void radisys_set_piomode (struct ata_port *ap, struct ata_device *adev) ++{ ++ unsigned int pio = adev->pio_mode - XFER_PIO_0; ++ struct pci_dev *dev = to_pci_dev(ap->host_set->dev); ++ u16 idetm_data; ++ int control = 0; ++ ++ /* ++ * See Intel Document 298600-004 for the timing programing rules ++ * for PIIX/ICH. Note that the early PIIX does not have the slave ++ * timing port at 0x44. The Radisys is a relative of the PIIX ++ * but not the same so be careful. ++ */ ++ ++ static const /* ISP RTC */ ++ u8 timings[][2] = { { 0, 0 }, /* Check me */ ++ { 0, 0 }, ++ { 1, 1 }, ++ { 2, 2 }, ++ { 3, 3 }, }; ++ ++ if (pio > 0) ++ control |= 1; /* TIME1 enable */ ++ if (ata_pio_need_iordy(adev)) ++ control |= 2; /* IE IORDY */ ++ ++ pci_read_config_word(dev, 0x40, &idetm_data); ++ ++ /* Enable IE and TIME as appropriate. Clear the other ++ drive timing bits */ ++ idetm_data &= 0xCCCC; ++ idetm_data |= (control << (4 * adev->devno)); ++ idetm_data |= (timings[pio][0] << 12) | ++ (timings[pio][1] << 8); ++ pci_write_config_word(dev, 0x40, idetm_data); ++ ++ /* Track which port is configured */ ++ ap->private_data = adev; ++} ++ ++/** ++ * radisys_set_dmamode - Initialize host controller PATA DMA timings ++ * @ap: Port whose timings we are configuring ++ * @adev: Device to program ++ * @isich: True if the device is an ICH and has IOCFG registers ++ * ++ * Set MWDMA mode for device, in host controller PCI config space. ++ * ++ * LOCKING: ++ * None (inherited from caller). ++ */ ++ ++static void radisys_set_dmamode (struct ata_port *ap, struct ata_device *adev) ++{ ++ struct pci_dev *dev = to_pci_dev(ap->host_set->dev); ++ u16 idetm_data; ++ u8 udma_enable; ++ ++ static const /* ISP RTC */ ++ u8 timings[][2] = { { 0, 0 }, ++ { 0, 0 }, ++ { 1, 1 }, ++ { 2, 2 }, ++ { 3, 3 }, }; ++ ++ /* ++ * MWDMA is driven by the PIO timings. We must also enable ++ * IORDY unconditionally. ++ */ ++ ++ pci_read_config_word(dev, 0x40, &idetm_data); ++ pci_read_config_byte(dev, 0x48, &udma_enable); ++ ++ if (adev->dma_mode < XFER_UDMA_0) { ++ unsigned int mwdma = adev->dma_mode - XFER_MW_DMA_0; ++ const unsigned int needed_pio[3] = { ++ XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 ++ }; ++ int pio = needed_pio[mwdma] - XFER_PIO_0; ++ int control = 3; /* IORDY|TIME0 */ ++ ++ /* If the drive MWDMA is faster than it can do PIO then ++ we must force PIO0 for PIO cycles. */ ++ ++ if (adev->pio_mode < needed_pio[mwdma]) ++ control = 1; ++ ++ /* Mask out the relevant control and timing bits we will load. Also ++ clear the other drive TIME register as a precaution */ ++ ++ idetm_data &= 0xCCCC; ++ idetm_data |= control << (4 * adev->devno); ++ idetm_data |= (timings[pio][0] << 12) | (timings[pio][1] << 8); ++ ++ udma_enable &= ~(1 << adev->devno); ++ } else { ++ u8 udma_mode; ++ ++ /* UDMA66 on. It isn't clear from the documentation whether ++ UDMA 33 and 66 are switchable via register 0x4A */ ++ ++ pci_read_config_byte(dev, 0x4A, &udma_mode); ++ ++ if (adev->xfer_mode == XFER_UDMA_2) ++ udma_mode &= ~ (1 << adev->devno); ++ else /* UDMA 4 */ ++ udma_mode |= (1 << adev->devno); ++ ++ pci_write_config_byte(dev, 0x4A, udma_mode); ++ ++ udma_enable |= (1 << adev->devno); ++ } ++ pci_write_config_word(dev, 0x40, idetm_data); ++ pci_write_config_byte(dev, 0x48, udma_enable); ++ ++ /* Track which port is configured */ ++ ap->private_data = adev; ++} ++ ++/** ++ * radisys_qc_issue_prot - command issue ++ * @qc: command pending ++ * ++ * Called when the libata layer is about to issue a command. We wrap ++ * this interface so that we can load the correct ATA timings if ++ * neccessary. Our logic also clears TIME0/TIME1 for the other device so ++ * that, even if we get this wrong, cycles to the other device will ++ * be made PIO0. ++ */ ++ ++static int radisys_qc_issue_prot(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ ++ if (adev != ap->private_data) { ++ /* UDMA timing is not shared */ ++ if (adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode) ++ radisys_set_dmamode(ap, adev); ++ else if (adev->pio_mode) ++ radisys_set_piomode(ap, adev); ++ } ++ } ++ return ata_qc_issue_prot(qc); ++} ++ ++ ++static struct scsi_host_template radisys_sht = { ++ .module = THIS_MODULE, ++ .name = DRV_NAME, ++ .ioctl = ata_scsi_ioctl, ++ .queuecommand = ata_scsi_queuecmd, ++ .eh_strategy_handler = ata_scsi_error, ++ .can_queue = ATA_DEF_QUEUE, ++ .this_id = ATA_SHT_THIS_ID, ++ .sg_tablesize = LIBATA_MAX_PRD, ++ .max_sectors = ATA_MAX_SECTORS, ++ .cmd_per_lun = ATA_SHT_CMD_PER_LUN, ++ .emulated = ATA_SHT_EMULATED, ++ .use_clustering = ATA_SHT_USE_CLUSTERING, ++ .proc_name = DRV_NAME, ++ .dma_boundary = ATA_DMA_BOUNDARY, ++ .slave_configure = ata_scsi_slave_config, ++ .bios_param = ata_std_bios_param, ++// .ordered_flush = 1, ++}; ++ ++static const struct ata_port_operations radisys_pata_ops = { ++ .port_disable = ata_port_disable, ++ .set_piomode = radisys_set_piomode, ++ .set_dmamode = radisys_set_dmamode, ++ ++ .tf_load = ata_tf_load, ++ .tf_read = ata_tf_read, ++ .check_status = ata_check_status, ++ .exec_command = ata_exec_command, ++ .dev_select = ata_std_dev_select, ++ ++ .phy_reset = radisys_pata_phy_reset, ++ ++ .bmdma_setup = ata_bmdma_setup, ++ .bmdma_start = ata_bmdma_start, ++ .bmdma_stop = ata_bmdma_stop, ++ .bmdma_status = ata_bmdma_status, ++ .qc_prep = ata_qc_prep, ++ .qc_issue = radisys_qc_issue_prot, ++ .data_xfer = ata_pio_data_xfer, ++ ++ .eng_timeout = ata_eng_timeout, ++ ++ .irq_handler = ata_interrupt, ++ .irq_clear = ata_bmdma_irq_clear, ++ ++ .port_start = ata_port_start, ++ .port_stop = ata_port_stop, ++ .host_stop = ata_host_stop, ++}; ++ ++ ++/** ++ * radisys_init_one - Register PIIX ATA PCI device with kernel services ++ * @pdev: PCI device to register ++ * @ent: Entry in radisys_pci_tbl matching with @pdev ++ * ++ * Called from kernel PCI layer. We probe for combined mode (sigh), ++ * and then hand over control to libata, for it to do the rest. ++ * ++ * LOCKING: ++ * Inherited from PCI layer (may sleep). ++ * ++ * RETURNS: ++ * Zero on success, or -ERRNO value. ++ */ ++ ++static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ++{ ++ static int printed_version; ++ static struct ata_port_info info = { ++ .sht = &radisys_sht, ++ .host_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, ++ .pio_mask = 0x1f, /* pio0-4 */ ++ .mwdma_mask = 0x07, /* mwdma1-2 */ ++ .udma_mask = 0x14, /* UDMA33/66 only */ ++ .port_ops = &radisys_pata_ops, ++ }; ++ static struct ata_port_info *port_info[2] = { &info, &info }; ++ ++ if (!printed_version++) ++ dev_printk(KERN_DEBUG, &pdev->dev, ++ "version " DRV_VERSION "\n"); ++ ++ return ata_pci_init_one(pdev, port_info, 2); ++} ++ ++static const struct pci_device_id radisys_pci_tbl[] = { ++ { 0x1331, 0x8201, PCI_ANY_ID, PCI_ANY_ID, }, ++ { } /* terminate list */ ++}; ++ ++static struct pci_driver radisys_pci_driver = { ++ .name = DRV_NAME, ++ .id_table = radisys_pci_tbl, ++ .probe = radisys_init_one, ++ .remove = ata_pci_remove_one, ++}; ++ ++static int __init radisys_init(void) ++{ ++ return pci_register_driver(&radisys_pci_driver); ++} ++ ++static void __exit radisys_exit(void) ++{ ++ pci_unregister_driver(&radisys_pci_driver); ++} ++ ++ ++module_init(radisys_init); ++module_exit(radisys_exit); ++ ++MODULE_AUTHOR("Alan Cox"); ++MODULE_DESCRIPTION("SCSI low-level driver for Radisys R82600 controllers"); ++MODULE_LICENSE("GPL"); ++MODULE_DEVICE_TABLE(pci, radisys_pci_tbl); ++MODULE_VERSION(DRV_VERSION); ++ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_rz1000.c linux-2.6.16-rc4/drivers/scsi/pata_rz1000.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_rz1000.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_rz1000.c 2006-02-16 15:38:18.000000000 +0000 @@ -0,0 +1,183 @@ +/* + * RZ1000/1001 driver based upon @@ -13139,10 +14669,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); + + /* Be exceptionally paranoid as we must be sure to apply the fix */ -+ if(pci_read_config_word(pdev, 0x40, ®) != 0) ++ if (pci_read_config_word(pdev, 0x40, ®) != 0) + goto fail; + reg &= 0xDFFF; -+ if(pci_write_config_word(pdev, 0x40, reg) != 0) ++ if (pci_write_config_word(pdev, 0x40, reg) != 0) + goto fail; + printk(KERN_INFO DRV_NAME ": disabled chipset readahead.\n"); + @@ -13188,10 +14718,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +module_init(rz1000_init); +module_exit(rz1000_exit); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sc1200.c linux-2.6.16-rc2/drivers/scsi/pata_sc1200.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sc1200.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_sc1200.c 2006-02-07 13:39:25.938849312 +0000 -@@ -0,0 +1,264 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sc1200.c linux-2.6.16-rc4/drivers/scsi/pata_sc1200.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sc1200.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_sc1200.c 2006-02-16 15:46:11.000000000 +0000 +@@ -0,0 +1,286 @@ +/* + * New ATA layer SC1200 driver Alan Cox <alan@redhat.com> + * @@ -13234,7 +14764,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "sc1200" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2" + +#define SC1200_REV_A 0x00 +#define SC1200_REV_B1 0x01 @@ -13256,7 +14786,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u8 silicon_rev = inb(0x903D); + u16 pci_clock; + -+ if(chip_id == 0x04 && silicon_rev < SC1200_REV_B1) ++ if (chip_id == 0x04 && silicon_rev < SC1200_REV_B1) + return 0; /* 33 MHz mode */ + + /* Clock generator configuration 0x901E its 8/9 are the PCI clocking @@ -13265,7 +14795,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_clock = inw(0x901E); + pci_clock >>= 8; + pci_clock &= 0x03; -+ if(pci_clock == 3) ++ if (pci_clock == 3) + pci_clock = 0; + return pci_clock; +} @@ -13305,11 +14835,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * @adev: Device being configured + * + * We cannot mix MWDMA and UDMA without reloading timings each switch -+ * master to slave. We should implement the switch but for now we follow -+ * the old IDE driver and just avoid setting such combinations. -+ * -+ * This will come up once the SATA core grows up and develops proper -+ * timing code. ++ * master to slave. + */ + +static void sc1200_set_dmamode(struct ata_port *ap, struct ata_device *adev) @@ -13332,12 +14858,12 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + int mode = adev->dma_mode; + u32 format; + -+ if(mode >= XFER_UDMA_0) ++ if (mode >= XFER_UDMA_0) + format = udma_timing[clock][mode - XFER_UDMA_0]; + else + format = mwdma_timing[clock][mode - XFER_MW_DMA_0]; + -+ if(adev->devno == 0) { ++ if (adev->devno == 0) { + u32 timings; + + pci_read_config_dword(pdev, reg + 4, &timings); @@ -13348,6 +14874,34 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_dword(pdev, reg + 12, format); +} + ++/** ++ * sc1200_qc_issue_prot - command issue ++ * @qc: command pending ++ * ++ * Called when the libata layer is about to issue a command. We wrap ++ * this interface so that we can load the correct ATA timings if ++ * neccessary. Specifically we have a problem that there is only ++ * one MWDMA/UDMA bit. ++ */ ++ ++static int sc1200_qc_issue_prot(struct ata_queued_cmd *qc) ++{ ++ struct ata_port *ap = qc->ap; ++ struct ata_device *adev = qc->dev; ++ struct ata_device *prev = ap->private_data; ++ ++ /* See if the DMA settings could be wrong */ ++ if (adev->dma_mode != 0 && adev != prev && prev != NULL) { ++ /* Maybe, but do the channels match MWDMA/UDMA ? */ ++ if ((adev->dma_mode >= XFER_UDMA_0 && prev->dma_mode < XFER_UDMA_0) || ++ (adev->dma_mode < XFER_UDMA_0 && prev->dma_mode >= XFER_UDMA_0)) ++ /* Switch the mode bits */ ++ sc1200_set_dmamode(ap, adev); ++ } ++ ++ return ata_qc_issue_prot(qc); ++} ++ +static struct scsi_host_template sc1200_sht = { + .module = THIS_MODULE, + .name = DRV_NAME, @@ -13369,8 +14923,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +}; + +static struct ata_port_operations sc1200_port_ops = { -+/* .set_mode = sc1200_set_mode, FIXME - for master/slave */ -+ + .port_disable = ata_port_disable, + .set_piomode = sc1200_set_piomode, + .set_dmamode = sc1200_set_dmamode, @@ -13387,7 +14939,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + .bmdma_status = ata_bmdma_status, + + .qc_prep = ata_qc_prep, -+ .qc_issue = ata_qc_issue_prot, ++ .qc_issue = sc1200_qc_issue_prot, + .eng_timeout = ata_eng_timeout, + .data_xfer = ata_pio_data_xfer, + @@ -13456,10 +15008,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(sc1200_init); +module_exit(sc1200_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_serverworks.c linux-2.6.16-rc2/drivers/scsi/pata_serverworks.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_serverworks.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_serverworks.c 2006-02-07 13:38:36.921301112 +0000 -@@ -0,0 +1,591 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_serverworks.c linux-2.6.16-rc4/drivers/scsi/pata_serverworks.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_serverworks.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_serverworks.c 2006-02-16 15:37:31.000000000 +0000 +@@ -0,0 +1,586 @@ +/* + * ata-serverworks.c - Serverworks PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -13611,7 +15163,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + struct sv_cable_table *cb = cable_detect; + + while(cb->device) { -+ if(cb->device == pdev->device && ++ if (cb->device == pdev->device && + (cb->subvendor == pdev->subsystem_vendor || + cb->subvendor == PCI_ANY_ID)) { + return cb->cable_detect(ap); @@ -13662,9 +15214,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +static unsigned int serverworks_osb4_filter(const struct ata_port *ap, struct ata_device *adev, unsigned int mask, int shift) +{ -+ if(shift != ATA_SHIFT_UDMA) ++ if (shift != ATA_SHIFT_UDMA) + return mask; -+ if(adev->class == ATA_DEV_ATA) ++ if (adev->class == ATA_DEV_ATA) + return 0; + return mask; +} @@ -13685,9 +15237,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + int len, i; + + /* Disk, UDMA */ -+ if(shift != ATA_SHIFT_UDMA) ++ if (shift != ATA_SHIFT_UDMA) + return mask; -+ if(adev->class != ATA_DEV_ATA) ++ if (adev->class != ATA_DEV_ATA) + return mask; + + /* Actually do need to check */ @@ -13729,7 +15281,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* The OSB4 just requires the timing but the CSB series want the + mode number as well */ -+ if(serverworks_is_csb(pdev)) { ++ if (serverworks_is_csb(pdev)) { + pci_read_config_word(pdev, 0x4A, &csb5_pio); + csb5_pio &= ~(0x0F << devbits); + pci_write_config_byte(pdev, 0x4A, csb5_pio | (pio << devbits)); @@ -13757,7 +15309,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_byte(pdev, 0x54, &ultra_cfg); + -+ if(adev->dma_mode >= XFER_UDMA_0) { ++ if (adev->dma_mode >= XFER_UDMA_0) { + pci_write_config_byte(pdev, 0x44 + offset, 0x20); + + pci_read_config_byte(pdev, 0x56 + ap->hard_port_no, &ultra); @@ -13863,7 +15415,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + if (isa_dev) { + pci_read_config_dword(isa_dev, 0x64, ®); + reg &= ~0x00002000; /* disable 600ns interrupt mask */ -+ if(!(reg & 0x00004000)) ++ if (!(reg & 0x00004000)) + printk(KERN_DEBUG DRV_NAME ": UDMA not BIOS enabled.\n"); + reg |= 0x00004000; /* enable UDMA/33 support */ + pci_write_config_dword(isa_dev, 0x64, reg); @@ -13895,11 +15447,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_write_config_dword(findev, 0x4C, reg4c); + pci_dev_put(findev); + } -+#if 0 -+FIXME -+ outb_p(0x06, 0x0c00); -+ dev->irq = inb_p(0x0c01); -+#endif + } else { + struct pci_dev * findev = NULL; + u8 reg41 = 0; @@ -13987,7 +15534,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* OSB4 : South Bridge and IDE */ + if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { + /* Select non UDMA capable OSB4 if we can't do fixups */ -+ if( serverworks_fixup_osb4(pdev) < 0) ++ if ( serverworks_fixup_osb4(pdev) < 0) + devinfo = &info[1]; + } + /* setup CSB5/CSB6 : South Bridge and IDE option RAID */ @@ -13997,11 +15544,11 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + /* If the returned btr is the newer revision then + select the right info block */ -+ if(serverworks_fixup_csb(pdev) == 3) ++ if (serverworks_fixup_csb(pdev) == 3) + devinfo = &info[3]; + + /* Is this the 3rd channel CSB6 IDE ? */ -+ if(pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) ++ if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) + ports = 1; + } + /* setup HT1000E */ @@ -14051,10 +15598,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(serverworks_init); +module_exit(serverworks_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sil680.c linux-2.6.16-rc2/drivers/scsi/pata_sil680.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sil680.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_sil680.c 2006-01-21 17:04:00.000000000 +0000 -@@ -0,0 +1,362 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sil680.c linux-2.6.16-rc4/drivers/scsi/pata_sil680.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sil680.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_sil680.c 2006-02-16 15:28:00.000000000 +0000 +@@ -0,0 +1,368 @@ +/* + * pata_sil680.c - SIL680 PATA for new ATA layer + * (C) 2005 Red Hat Inc @@ -14078,7 +15625,6 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * TODO + * If we know all our devices are LBA28 (or LBA28 sized) we could use + * the command fifo mode. -+ * Mode filters for shared PIO + */ + +#include <linux/kernel.h> @@ -14091,7 +15637,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_sil680" -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2.1" + +/** + * sil680_selreg - return register base @@ -14143,7 +15689,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + unsigned long addr = sil680_selreg(ap, 0); + u8 ata66; + pci_read_config_byte(pdev, addr, &ata66); -+ if(ata66 & 1) ++ if (ata66 & 1) + return ATA_CBL_PATA80; + else + return ATA_CBL_PATA40; @@ -14182,8 +15728,8 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * @adev: ATA device + * + * Program the SIL680 registers for PIO mode. Note that the task speed -+ * registers are shared between the devices so once the speed filters are -+ * in we must pick the lowest mode or switch. ++ * registers are shared between the devices so we must pick the lowest ++ * mode for command work. + */ + +static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev) @@ -14195,14 +15741,22 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + unsigned long addr = sil680_seldev(ap, adev, 0x04); + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); + int pio = adev->pio_mode - XFER_PIO_0; ++ int lowest_pio = pio; + u16 reg; ++ ++ struct ata_device *pair = ata_dev_pair(ap, adev); + ++ if (pair != NULL) { ++ if (adev->pio_mode > pair->pio_mode) ++ lowest_pio = pair->pio_mode - XFER_PIO_0; ++ } ++ + pci_write_config_word(pdev, addr, speed_p[pio]); -+ pci_write_config_word(pdev, tfaddr, speed_t[pio]); ++ pci_write_config_word(pdev, tfaddr, speed_t[lowest_pio]); + + pci_read_config_word(pdev, tfaddr-2, ®); + reg &= ~0x0200; /* Clear IORDY */ -+ if(pio > 2) ++ if (ata_pio_need_iordy(adev)) + reg |= 0x0200; /* Enable IORDY */ + pci_write_config_word(pdev, tfaddr-2, reg); +} @@ -14214,8 +15768,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + * + * Program the MWDMA/UDMA modes for the sil680 k + * chipset. The MWDMA mode values are pulled from a lookup table -+ * while the chipset uses mode number for UDMA. We don't yet handle -+ * the shared pio speed stuff in full. FIXME ++ * while the chipset uses mode number for UDMA. + */ + +static void sil680_set_dmamode(struct ata_port *ap, struct ata_device *adev) @@ -14246,7 +15799,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Extract scsc */ + scsc = (scsc & 0x30) ? 1: 0; + -+ if(adev->dma_mode >= XFER_UDMA_0) { ++ if (adev->dma_mode >= XFER_UDMA_0) { + multi = 0x10C1; + ultra |= ultra_table[scsc][adev->dma_mode - XFER_UDMA_0]; + mode |= (0x03 << port_shift); @@ -14360,7 +15913,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + + pci_read_config_byte(pdev, 0x8A, &tmpbyte); -+ if((tmpbyte & 0x30) == 0) ++ if ((tmpbyte & 0x30) == 0) + port_info[0] = port_info[1] = &info_slow; + + pci_write_config_byte(pdev, 0xA1, 0x72); @@ -14417,9 +15970,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(sil680_init); +module_exit(sil680_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sis.c linux-2.6.16-rc2/drivers/scsi/pata_sis.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sis.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_sis.c 2006-02-07 13:38:21.080709248 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sis.c linux-2.6.16-rc4/drivers/scsi/pata_sis.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sis.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_sis.c 2006-02-16 15:36:13.000000000 +0000 @@ -0,0 +1,982 @@ +/* + * pata_sis.c - SiS ATA driver @@ -14480,7 +16033,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + u16 tmp; + + pci_read_config_word(pdev, 0x50 + 2 * ap->hard_port_no, &tmp); -+ if(tmp & 0x8000) ++ if (tmp & 0x8000) + return ATA_CBL_PATA40; + return ATA_CBL_PATA80; +} @@ -14527,7 +16080,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_byte(pdev, 0x48, &tmp); + tmp >>= ap->hard_port_no; -+ if(tmp & 0x10) ++ if (tmp & 0x10) + return ATA_CBL_PATA40; + return ATA_CBL_PATA80; +} @@ -14608,7 +16161,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + reg4b &= ~mask; + + /* Enable for ATA (disk) only */ -+ if(adev->class == ATA_DEV_ATA) ++ if (adev->class == ATA_DEV_ATA) + reg4b |= mask; + pci_write_config_byte(pdev, 0x4B, reg4b); +} @@ -14714,14 +16267,14 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + sis_set_fifo(ap, adev); + + pci_read_config_dword(pdev, 0x54, ®54); -+ if(reg54 & 0x40000000) ++ if (reg54 & 0x40000000) + port = 0x70; + port += 8 * ap->hard_port_no + 4 * adev->devno; + + pci_read_config_dword(pdev, port, &t1); + t1 &= 0xC0C00FFF; /* Mask out timing */ + -+ if(t1 & 0x08) /* 100 or 133 ? */ ++ if (t1 & 0x08) /* 100 or 133 ? */ + t1 |= timing133[speed]; + else + t1 |= timing100[speed]; @@ -14755,7 +16308,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_word(pdev, drive_pci, &timing); + -+ if(adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode < XFER_UDMA_0) { + /* bits 3-0 hold recovery timing bits 8-10 active timing and + the higer bits are dependant on the device */ + timing &= ~ 0x870F; @@ -14794,7 +16347,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_word(pdev, drive_pci, &timing); + -+ if(adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode < XFER_UDMA_0) { + /* bits 3-0 hold recovery timing bits 8-10 active timing and + the higer bits are dependant on the device, bit 15 udma */ + timing &= ~ 0x870F; @@ -14831,7 +16384,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_word(pdev, drive_pci, &timing); + -+ if(adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode < XFER_UDMA_0) { + /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ + } else { + /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ @@ -14866,7 +16419,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + pci_read_config_word(pdev, drive_pci, &timing); + -+ if(adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode < XFER_UDMA_0) { + /* NOT SUPPORTED YET: NEED DATA SHEET. DITTO IN OLD DRIVER */ + } else { + /* Bit 15 is UDMA on/off, bit 12-14 are cycle time */ @@ -14903,13 +16456,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + const u32 timing_u133[] = { 0x9F0, 0x6A0, 0x470, 0x250, 0x230, 0x220, 0x210 }; + + pci_read_config_dword(pdev, 0x54, ®54); -+ if(reg54 & 0x40000000) ++ if (reg54 & 0x40000000) + port = 0x70; + port += 8 * ap->hard_port_no + 4 * adev->devno; + + pci_read_config_dword(pdev, port, &t1); + -+ if(adev->dma_mode < XFER_UDMA_0) { ++ if (adev->dma_mode < XFER_UDMA_0) { + t1 &= ~0x00000004; + /* FIXME: need data sheet to add MWDMA here. Also lacking on + ide/pci driver */ @@ -14918,7 +16471,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* if & 8 no UDMA133 - need info for ... */ + t1 &= ~0x00000FF0; + t1 |= 0x00000004; -+ if(t1 & 0x08) ++ if (t1 & 0x08) + t1 |= timing_u133[speed]; + else + t1 |= timing_u100[speed]; @@ -15161,10 +16714,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + if (sis->info == &sis_info133) { + pci_read_config_word(pdev, 0x50, ®w); -+ if(regw & 0x08) ++ if (regw & 0x08) + pci_write_config_word(pdev, 0x50, regw & ~0x08); + pci_read_config_word(pdev, 0x52, ®w); -+ if(regw & 0x08) ++ if (regw & 0x08) + pci_write_config_word(pdev, 0x52, regw & ~0x08); + return; + } @@ -15286,7 +16839,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + if (chipset->device == 0x630) { /* SIS630 */ + u8 host_rev; + pci_read_config_byte(host, PCI_REVISION_ID, &host_rev); -+ if(host_rev >= 0x30) /* 630 ET */ ++ if (host_rev >= 0x30) /* 630 ET */ + chipset = &sis100_early; + } + break; @@ -15325,7 +16878,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + } + + /* Further check */ -+ if(chipset == NULL) { ++ if (chipset == NULL) { + struct pci_dev *lpc_bridge; + u16 trueid; + u8 prefctl; @@ -15341,13 +16894,13 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + switch(trueid) { + case 0x5517: + lpc_bridge = pci_get_slot(0x00, 0x10); /* Bus 0 Dev 2 Fn 0 */ -+ if(lpc_bridge == NULL) ++ if (lpc_bridge == NULL) + break; + pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev); + pci_read_config_byte(pdev, 0x49, &prefctl); + pci_dev_put(lpc_bridge); + -+ if(sbrev == 0x10 && (prefctl & 0x80)) { ++ if (sbrev == 0x10 && (prefctl & 0x80)) { + chipset = &sis133_early; + break; + } @@ -15403,9 +16956,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +MODULE_DEVICE_TABLE(pci, sis_pci_tbl); +MODULE_VERSION(DRV_VERSION); + -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sl82c105.c linux-2.6.16-rc2/drivers/scsi/pata_sl82c105.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_sl82c105.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_sl82c105.c 2006-01-21 17:05:02.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sl82c105.c linux-2.6.16-rc4/drivers/scsi/pata_sl82c105.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_sl82c105.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_sl82c105.c 2006-02-16 15:36:32.000000000 +0000 @@ -0,0 +1,376 @@ +/* + * pata_sl82c105.c - SL82C105 PATA for new ATA layer @@ -15734,7 +17287,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + + rev = sl82c105_bridge_revision(dev); + -+ if(rev == -1) ++ if (rev == -1) + dev_printk(KERN_WARNING, &dev->dev, "pata_sl82c105: Unable to find bridge, disabling DMA.\n"); + else if (rev <= 5) + dev_printk(KERN_WARNING, &dev->dev, "pata_sl82c105: Early bridge revision, no DMA available.\n"); @@ -15783,9 +17336,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(sl82c105_init); +module_exit(sl82c105_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_triflex.c linux-2.6.16-rc2/drivers/scsi/pata_triflex.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_triflex.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_triflex.c 2006-01-21 17:05:13.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_triflex.c linux-2.6.16-rc4/drivers/scsi/pata_triflex.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_triflex.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_triflex.c 2006-02-16 15:36:23.000000000 +0000 @@ -0,0 +1,268 @@ +/* + * pata_triflex.c - Compaq PATA for new ATA layer @@ -15904,7 +17457,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + triflex_timing &= ~ (0xFFFF << (16 * is_slave)); + triflex_timing |= (timing << (16 * is_slave)); + -+ if(triflex_timing != old_triflex_timing) ++ if (triflex_timing != old_triflex_timing) + pci_write_config_dword(pdev, channel_offset, triflex_timing); +} + @@ -16055,9 +17608,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(triflex_init); +module_exit(triflex_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/pata_via.c linux-2.6.16-rc2/drivers/scsi/pata_via.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/pata_via.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16-rc2/drivers/scsi/pata_via.c 2006-01-21 17:06:09.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pata_via.c linux-2.6.16-rc4/drivers/scsi/pata_via.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pata_via.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-2.6.16-rc4/drivers/scsi/pata_via.c 2006-02-16 15:28:17.000000000 +0000 @@ -0,0 +1,547 @@ +/* + * pata_via.c - VIA PATA for new ATA layer @@ -16121,7 +17674,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +#include <linux/libata.h> + +#define DRV_NAME "pata_via" -+#define DRV_VERSION "0.1.3" ++#define DRV_VERSION "0.1.4" + +/* + * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx @@ -16193,7 +17746,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_read_config_dword(pdev, 0x50, &ata66); + /* Check both the drive cable reporting bits, we might not have + two drives */ -+ if(ata66 & (0x1010 << (16 * ap->hard_port_no))) ++ if (ata66 & (0x1010 << (16 * ap->hard_port_no))) + return ATA_CBL_PATA80; + else + return ATA_CBL_PATA40; @@ -16245,7 +17798,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 +static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mode, int tdiv, int set_ast, int udma_type) +{ + struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); -+ struct ata_device *peer = &ap->device[1 - adev->devno]; ++ struct ata_device *peer = ata_dev_pair(ap, adev); + struct ata_timing t, p; + static int via_clock = 33000; /* Bus clock in kHZ - ought to be tunable one day */ + unsigned long T = 1000000000 / via_clock; @@ -16259,19 +17812,19 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + ata_timing_compute(adev, adev->pio_mode, &t, T, UT); + + /* We share 8bit timing so we must merge the constraints */ -+ if(ata_dev_present(peer)) { -+ if(peer->pio_mode) { ++ if (peer) { ++ if (peer->pio_mode) { + ata_timing_compute(peer, peer->pio_mode, &p, T, UT); + ata_timing_merge(&p, &t, &t, ATA_TIMING_8BIT); + } -+ if(peer->dma_mode) { ++ if (peer->dma_mode) { + ata_timing_compute(peer, peer->dma_mode, &p, T, UT); + ata_timing_merge(&p, &t, &t, ATA_TIMING_8BIT); + } + } + + /* Address setup is programmable but breaks on UDMA133 setups */ -+ if(set_ast) { ++ if (set_ast) { + u8 setup; /* 2 bits per drive */ + int shift = 2 * offset; + @@ -16306,7 +17859,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + break; + } + /* Set UDMA unless device is not UDMA capable */ -+ if(udma_type) ++ if (udma_type) + pci_write_config_byte(pdev, 0x50 + offset, ut); +} + @@ -16508,7 +18061,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* 0x40 low bits indicate enabled channels */ + pci_read_config_byte(pdev, 0x40 , &enable); + enable &= 3; -+ if(enable == 0) { ++ if (enable == 0) { + pci_dev_put(isa); + return -ENODEV; + } @@ -16521,7 +18074,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + pci_read_config_byte(pdev, 0x43, &fifo); + + /* Clear PREQ# until DDACK# for errata */ -+ if(config->flags & VIA_BAD_PREQ) ++ if (config->flags & VIA_BAD_PREQ) + fifo &= 0x7F; + else + fifo &= 0x9f; @@ -16532,7 +18085,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + /* Clock set up */ + switch(config->flags & VIA_UDMA) { + case VIA_UDMA_NONE: -+ if(config->flags & VIA_NO_UNMASK) ++ if (config->flags & VIA_NO_UNMASK) + type = &via_mwdma_info_borked; + else + type = &via_mwdma_info; @@ -16559,7 +18112,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + break; + } + -+ if(config->flags & VIA_BAD_CLK66) { ++ if (config->flags & VIA_BAD_CLK66) { + /* Disable the 66MHz clock on problem devices */ + pci_read_config_dword(pdev, 0x50, &timing); + timing &= ~0x80008; @@ -16606,9 +18159,21 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 + +module_init(via_init); +module_exit(via_exit); -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_mv.c linux-2.6.16-rc2/drivers/scsi/sata_mv.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_mv.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_mv.c 2006-01-21 17:07:20.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/pdc_adma.c linux-2.6.16-rc4/drivers/scsi/pdc_adma.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/pdc_adma.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/pdc_adma.c 2006-02-23 13:15:50.480287896 +0000 +@@ -322,7 +322,7 @@ + = (pFLAGS & pEND) ? 0 : cpu_to_le32(pp->pkt_dma + i + 4); + i += 4; + +- VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", nelem, ++ VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", i/4, + (unsigned long)addr, len); + } + return i; +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_mv.c linux-2.6.16-rc4/drivers/scsi/sata_mv.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_mv.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_mv.c 2006-02-20 11:28:03.000000000 +0000 @@ -389,6 +389,7 @@ .qc_prep = mv_qc_prep, @@ -16625,9 +18190,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = mv_eng_timeout, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_nv.c linux-2.6.16-rc2/drivers/scsi/sata_nv.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_nv.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_nv.c 2006-01-21 17:08:58.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_nv.c linux-2.6.16-rc4/drivers/scsi/sata_nv.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_nv.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_nv.c 2006-01-21 17:08:58.000000000 +0000 @@ -258,6 +258,7 @@ .qc_prep = ata_qc_prep, .qc_issue = ata_qc_issue_prot, @@ -16636,9 +18201,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .irq_handler = nv_interrupt, .irq_clear = ata_bmdma_irq_clear, .scr_read = nv_scr_read, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_promise.c linux-2.6.16-rc2/drivers/scsi/sata_promise.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_promise.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_promise.c 2006-02-06 12:36:12.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_promise.c linux-2.6.16-rc4/drivers/scsi/sata_promise.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_promise.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_promise.c 2006-02-06 12:36:12.000000000 +0000 @@ -130,6 +130,7 @@ .qc_prep = pdc_qc_prep, .qc_issue = pdc_qc_issue_prot, @@ -16655,9 +18220,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = pdc_eng_timeout, .irq_handler = pdc_interrupt, .irq_clear = pdc_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_qstor.c linux-2.6.16-rc2/drivers/scsi/sata_qstor.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_qstor.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_qstor.c 2006-01-21 17:09:57.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_qstor.c linux-2.6.16-rc4/drivers/scsi/sata_qstor.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_qstor.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_qstor.c 2006-01-21 17:09:57.000000000 +0000 @@ -158,6 +158,7 @@ .phy_reset = qs_phy_reset, .qc_prep = qs_qc_prep, @@ -16666,9 +18231,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = qs_eng_timeout, .irq_handler = qs_intr, .irq_clear = qs_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sil24.c linux-2.6.16-rc2/drivers/scsi/sata_sil24.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sil24.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_sil24.c 2006-01-21 17:10:52.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sil24.c linux-2.6.16-rc4/drivers/scsi/sata_sil24.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sil24.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_sil24.c 2006-01-21 17:10:52.000000000 +0000 @@ -309,6 +309,7 @@ .qc_prep = sil24_qc_prep, @@ -16677,9 +18242,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = sil24_eng_timeout, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sil.c linux-2.6.16-rc2/drivers/scsi/sata_sil.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sil.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_sil.c 2006-01-21 17:11:06.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sil.c linux-2.6.16-rc4/drivers/scsi/sata_sil.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sil.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_sil.c 2006-02-14 17:23:28.000000000 +0000 @@ -165,6 +165,7 @@ .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, @@ -16688,9 +18253,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .irq_clear = ata_bmdma_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sis.c linux-2.6.16-rc2/drivers/scsi/sata_sis.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sis.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_sis.c 2006-01-21 17:11:23.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sis.c linux-2.6.16-rc4/drivers/scsi/sata_sis.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sis.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_sis.c 2006-01-21 17:11:23.000000000 +0000 @@ -115,6 +115,7 @@ .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, @@ -16699,9 +18264,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .irq_clear = ata_bmdma_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_svw.c linux-2.6.16-rc2/drivers/scsi/sata_svw.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_svw.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_svw.c 2006-02-06 12:30:23.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_svw.c linux-2.6.16-rc4/drivers/scsi/sata_svw.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_svw.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_svw.c 2006-02-06 12:30:23.000000000 +0000 @@ -320,6 +320,7 @@ .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, @@ -16710,9 +18275,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, .irq_handler = ata_interrupt, .irq_clear = ata_bmdma_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sx4.c linux-2.6.16-rc2/drivers/scsi/sata_sx4.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_sx4.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_sx4.c 2006-01-21 17:12:01.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sx4.c linux-2.6.16-rc4/drivers/scsi/sata_sx4.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_sx4.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_sx4.c 2006-01-21 17:12:01.000000000 +0000 @@ -206,6 +206,7 @@ .phy_reset = pdc_20621_phy_reset, .qc_prep = pdc20621_qc_prep, @@ -16721,9 +18286,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = pdc_eng_timeout, .irq_handler = pdc20621_interrupt, .irq_clear = pdc20621_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_uli.c linux-2.6.16-rc2/drivers/scsi/sata_uli.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_uli.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_uli.c 2006-01-21 17:12:24.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_uli.c linux-2.6.16-rc4/drivers/scsi/sata_uli.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_uli.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_uli.c 2006-01-21 17:12:24.000000000 +0000 @@ -106,6 +106,7 @@ .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, @@ -16732,9 +18297,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_via.c linux-2.6.16-rc2/drivers/scsi/sata_via.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_via.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_via.c 2006-01-21 17:12:51.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_via.c linux-2.6.16-rc4/drivers/scsi/sata_via.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_via.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_via.c 2006-01-21 17:12:51.000000000 +0000 @@ -126,6 +126,7 @@ .qc_prep = ata_qc_prep, @@ -16743,10 +18308,10 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/drivers/scsi/sata_vsc.c linux-2.6.16-rc2/drivers/scsi/sata_vsc.c ---- linux.vanilla-2.6.16-rc2/drivers/scsi/sata_vsc.c 2006-02-06 12:21:40.000000000 +0000 -+++ linux-2.6.16-rc2/drivers/scsi/sata_vsc.c 2006-01-21 17:13:14.000000000 +0000 -@@ -252,6 +252,7 @@ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/drivers/scsi/sata_vsc.c linux-2.6.16-rc4/drivers/scsi/sata_vsc.c +--- linux.vanilla-2.6.16-rc4/drivers/scsi/sata_vsc.c 2006-02-20 11:22:25.000000000 +0000 ++++ linux-2.6.16-rc4/drivers/scsi/sata_vsc.c 2006-02-20 11:28:11.000000000 +0000 +@@ -280,6 +280,7 @@ .bmdma_status = ata_bmdma_status, .qc_prep = ata_qc_prep, .qc_issue = ata_qc_issue_prot, @@ -16754,9 +18319,9 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 .eng_timeout = ata_eng_timeout, .irq_handler = vsc_sata_interrupt, .irq_clear = ata_bmdma_irq_clear, -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/include/linux/ata.h linux-2.6.16-rc2/include/linux/ata.h ---- linux.vanilla-2.6.16-rc2/include/linux/ata.h 2006-02-06 12:21:42.000000000 +0000 -+++ linux-2.6.16-rc2/include/linux/ata.h 2006-02-07 11:30:07.000000000 +0000 +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/include/linux/ata.h linux-2.6.16-rc4/include/linux/ata.h +--- linux.vanilla-2.6.16-rc4/include/linux/ata.h 2006-02-20 11:22:26.000000000 +0000 ++++ linux-2.6.16-rc4/include/linux/ata.h 2006-02-15 14:39:41.000000000 +0000 @@ -134,6 +134,8 @@ ATA_CMD_PIO_READ_EXT = 0x24, ATA_CMD_PIO_WRITE = 0x30, @@ -16766,7 +18331,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 ATA_CMD_READ_MULTI = 0xC4, ATA_CMD_READ_MULTI_EXT = 0x29, ATA_CMD_WRITE_MULTI = 0xC5, -@@ -247,13 +249,16 @@ +@@ -247,18 +249,22 @@ }; #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) @@ -16783,9 +18348,24 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) -diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.16-rc2/include/linux/libata.h linux-2.6.16-rc2/include/linux/libata.h ---- linux.vanilla-2.6.16-rc2/include/linux/libata.h 2006-02-06 12:21:42.000000000 +0000 -+++ linux-2.6.16-rc2/include/linux/libata.h 2006-02-06 18:45:03.000000000 +0000 + #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) + #define ata_id_removeable(id) ((id)[0] & (1 << 7)) ++#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) + #define ata_id_u32(id,n) \ + (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) + #define ata_id_u64(id,n) \ +diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc4/include/linux/libata.h linux-2.6.16-rc4/include/linux/libata.h +--- linux.vanilla-2.6.16-rc4/include/linux/libata.h 2006-02-20 11:22:26.000000000 +0000 ++++ linux-2.6.16-rc4/include/linux/libata.h 2006-02-23 13:28:56.634774248 +0000 +@@ -41,7 +41,7 @@ + #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ + #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ + #undef ATA_NDEBUG /* define to disable quick runtime checks */ +-#undef ATA_ENABLE_PATA /* define to enable PATA support in some ++#define ATA_ENABLE_PATA /* define to enable PATA support in some + * low-level drivers */ + #undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ + @@ -101,6 +101,7 @@ ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ @@ -16852,7 +18432,7 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 void (*bmdma_setup) (struct ata_queued_cmd *qc); void (*bmdma_start) (struct ata_queued_cmd *qc); + -+ void (*data_xfer) (struct ata_port *, unsigned char *, unsigned int, int); ++ void (*data_xfer) (struct ata_port *, struct ata_device *, unsigned char *, unsigned int, int); void (*qc_prep) (struct ata_queued_cmd *qc); int (*qc_issue) (struct ata_queued_cmd *qc); @@ -16871,15 +18451,24 @@ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6 extern void ata_bmdma_irq_clear(struct ata_port *ap); extern void ata_qc_complete(struct ata_queued_cmd *qc); extern void ata_eng_timeout(struct ata_port *ap); -+extern void ata_mmio_data_xfer(struct ata_port *ap, unsigned char *buf, ++extern void ata_mmio_data_xfer(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, + unsigned int buflen, int write_data); -+extern void ata_pio_data_xfer(struct ata_port *ap, unsigned char *buf, ++extern void ata_pio_data_xfer(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, + unsigned int buflen, int write_data); -+extern void ata_mmio_data_xfer_noirq(struct ata_port *ap, unsigned char *buf, ++extern void ata_mmio_data_xfer_noirq(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, + unsigned int buflen, int do_write); -+extern void ata_pio_data_xfer_noirq(struct ata_port *ap, unsigned char *buf, ++extern void ata_pio_data_xfer_noirq(struct ata_port *ap, struct ata_device *adev, unsigned char *buf, + unsigned int buflen, int do_write); + extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); +@@ -498,6 +521,8 @@ + struct block_device *bdev, + sector_t capacity, int geom[]); + extern int ata_scsi_slave_config(struct scsi_device *sdev); ++extern struct ata_device *ata_dev_pair(struct ata_port *ap, ++ struct ata_device *adev); + + /* + * Timing helpers diff --git a/packages/linux/ixp4xx-kernel_2.6.16-rc2.bb b/packages/linux/ixp4xx-kernel_2.6.16-rc4-git9.bb index a034fca982..e47f20a7ab 100644 --- a/packages/linux/ixp4xx-kernel_2.6.16-rc2.bb +++ b/packages/linux/ixp4xx-kernel_2.6.16-rc4-git9.bb @@ -3,62 +3,48 @@ # Increment PR_CONFIG for changes to the ixp4xx-kernel specific # defconfig (do *NOT* increment anything in here for changes # to other kernel configs!) -PR_CONFIG = "2" +PR_CONFIG = "0" # # Increment the number below (i.e. the digits after PR) when # making changes within this file or for changes to the patches # applied to the kernel. -PR = "r3.${PR_CONFIG}" +PR = "r0.${PR_CONFIG}" include ixp4xx-kernel.inc -RPSRC = "http://www.rpsys.net/openzaurus/patches" +# RPSRC = "http://www.rpsys.net/openzaurus/patches" # IXP4XX_PATCHES - full list of patches to apply IXP4XX_PATCHES = "" -IXP4XX_PATCHES += "file://05-patch-2.6.16-rc2-ide2;patch=1" +IXP4XX_PATCHES += "file://patch-2.6.16-rc4-ide2;patch=1" +IXP4XX_PATCHES += "file://leds-class.patch;patch=1" IXP4XX_PATCHES += "file://06-remove-extraversion.patch;patch=1" IXP4XX_PATCHES += "file://10-mtdpart-redboot-fis-byteswap.patch;patch=1" -IXP4XX_PATCHES += "file://10-nslu2-fix-flash.patch;patch=1" IXP4XX_PATCHES += "file://11-mtdpart-redboot-config-byteswap.patch;patch=1" IXP4XX_PATCHES += "file://15-jffs2-endian-config.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_core-r11.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_triggers-r9.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_trig_timer-r4.patch;patch=1" -# IXP4XX_PATCHES += "${RPSRC}/led_trig_sharpsl_pm-r4a.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_zaurus-r8.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_locomo-r5.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_ixp4xx-r0.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_tosa-r3.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_ide-r2.patch;patch=1" -IXP4XX_PATCHES += "${RPSRC}/led_nand-r2.patch;patch=1" -IXP4XX_PATCHES += "file://950-leds-timer.patch;patch=1" IXP4XX_PATCHES += "file://951-ixp4xx-leds-cpu-activity.patch;patch=1" IXP4XX_PATCHES += "file://40-rtc-class.patch;patch=1" IXP4XX_PATCHES += "file://45-eeprom-notifier.patch;patch=1" IXP4XX_PATCHES += "file://48-setup-byteswap-cmdline.patch;patch=1" -IXP4XX_PATCHES += "file://61-ixp4xx-beeper-irq.patch;patch=1" -IXP4XX_PATCHES += "file://61-nslu2-beeper.patch;patch=1" +IXP4XX_PATCHES += "file://50-i2c-bus-ixp4xx-hwmon.patch;patch=1" +IXP4XX_PATCHES += "file://50-hwmon-ad741x.patch;patch=1" IXP4XX_PATCHES += "file://65-loft-config.patch;patch=1" -IXP4XX_PATCHES += "file://80-nas100d-fix-i2c.patch;patch=1" -IXP4XX_PATCHES += "file://81-nslu2-power.patch;patch=1" +IXP4XX_PATCHES += "file://70-artop-latency.patch;patch=1" +IXP4XX_PATCHES += "file://75-dsmg600.patch;patch=1" IXP4XX_PATCHES += "file://82-nas100d-power.patch;patch=1" IXP4XX_PATCHES += "file://85-timer.patch;patch=1" IXP4XX_PATCHES += "file://91-maclist.patch;patch=1" IXP4XX_PATCHES += "file://92-nas100d-maclist.patch;patch=1" IXP4XX_PATCHES += "file://92-nslu2-maclist.patch;patch=1" -# 93-loft-maclist is still required, but does not apply cleanly. -# IXP4XX_PATCHES += "file://93-loft-maclist.patch;patch=1" IXP4XX_PATCHES += "file://94-nas100d-setup.patch;patch=1" IXP4XX_PATCHES += "file://94-nslu2-setup.patch;patch=1" IXP4XX_PATCHES += "file://94-loft-setup.patch;patch=1" -# 96-loft-leds is still required, but does not apply cleanly. -# IXP4XX_PATCHES += "file://96-loft-leds.patch;patch=1" +IXP4XX_PATCHES += "file://96-pata-ixp4xx.patch;patch=1" IXP4XX_PATCHES += "file://96-nas100d-leds.patch;patch=1" IXP4XX_PATCHES += "file://96-nslu2-leds.patch;patch=1" +IXP4XX_PATCHES += "file://97-ds101-setup.patch;patch=1" IXP4XX_PATCHES += "file://97-ds101-includes.patch;patch=1" -IXP4XX_PATCHES += "file://97-ds101-misc.patch;patch=1" IXP4XX_PATCHES += "file://97-ds101-pci.patch;patch=1" -IXP4XX_PATCHES += "file://97-ds101-power.patch;patch=1" -IXP4XX_PATCHES += "file://97-ds101-setup.patch;patch=1" +IXP4XX_PATCHES += "file://97-ds101-buttons.patch;patch=1" +IXP4XX_PATCHES += "file://97-ds101-doc.patch;patch=1" diff --git a/packages/linux/linux-jlime-sh3_2.6.11.bb b/packages/linux/linux-jlime-sh3_2.6.11.bb index f77de8ab9e..b646c1a3b8 100644 --- a/packages/linux/linux-jlime-sh3_2.6.11.bb +++ b/packages/linux/linux-jlime-sh3_2.6.11.bb @@ -19,6 +19,6 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} install -m 0644 arch/$(ARCH)/boot/$(KERNEL_IMAGETYPE) $(DEPLOY_DIR)/images/$(KERNEL_IMAGETYPE) } diff --git a/packages/linux/linux-mtx-1_2.4.27.bb b/packages/linux/linux-mtx-1_2.4.27.bb index 31015634cc..cce3b3c30c 100644 --- a/packages/linux/linux-mtx-1_2.4.27.bb +++ b/packages/linux/linux-mtx-1_2.4.27.bb @@ -70,10 +70,10 @@ fi FILES_kernel += " /tmp" do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/mips/zboot/images/mtx-1.flash.bin ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.flash.bin - install -m 0644 arch/mips/zboot/images/mtx-1.flash.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.flash.srec - install -m 0644 arch/mips/zboot/images/mtx-1.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.ram.srec + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/mips/zboot/images/mtx-1.flash.bin ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.flash.bin + install -m 0644 arch/mips/zboot/images/mtx-1.flash.srec ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.flash.srec + install -m 0644 arch/mips/zboot/images/mtx-1.srec ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.ram.srec } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-omap-2.6_2.6.9-omap1.bb b/packages/linux/linux-omap-2.6_2.6.9-omap1.bb index adaf84f1cc..5cb4a439b1 100644 --- a/packages/linux/linux-omap-2.6_2.6.9-omap1.bb +++ b/packages/linux/linux-omap-2.6_2.6.9-omap1.bb @@ -25,8 +25,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-omap1_2.6.12-rc2.bb b/packages/linux/linux-omap1_2.6.12-rc2.bb index e3dc282017..133fe9ac2c 100644 --- a/packages/linux/linux-omap1_2.6.12-rc2.bb +++ b/packages/linux/linux-omap1_2.6.12-rc2.bb @@ -32,12 +32,12 @@ do_configure_prepend() { } do_deploy_omap5912osk() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} arm-linux-objcopy -O binary -R .note -R .comment -S arch/arm/boot/compressed/vmlinux ${DEPLOY_DIR}/linux.bin gzip -f -9 ${DEPLOY_DIR}/linux.bin mkimage -A arm -O linux -T kernel -C gzip -a 0x10c08000 -e 0x10c08000 -n "OE" -d ${DEPLOY_DIR}/linux.bin.gz ${DEPLOY_DIR}/uImage_bb.cc cp ${DEPLOY_DIR}/uImage_bb.cc /tftpboot -# install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin +# install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin } diff --git a/packages/linux/linux-openzaurus-2.6.15/defconfig-qemuarm b/packages/linux/linux-openzaurus-2.6.15/defconfig-qemuarm new file mode 100644 index 0000000000..0f5e611cb9 --- /dev/null +++ b/packages/linux/linux-openzaurus-2.6.15/defconfig-qemuarm @@ -0,0 +1,935 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.15 +# Thu Feb 23 16:29:38 2006 +# +CONFIG_ARM=y +CONFIG_MMU=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_HOTPLUG=y +CONFIG_KOBJECT_UEVENT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set +CONFIG_BASE_SMALL=0 + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_KMOD=y + +# +# Block layer +# + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +CONFIG_DEFAULT_AS=y +# CONFIG_DEFAULT_DEADLINE is not set +# CONFIG_DEFAULT_CFQ is not set +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="anticipatory" + +# +# System Type +# +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +CONFIG_ARCH_INTEGRATOR=y +# CONFIG_ARCH_IOP3XX is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_IMX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_AAEC2000 is not set + +# +# Integrator Options +# +# CONFIG_ARCH_INTEGRATOR_AP is not set +CONFIG_ARCH_INTEGRATOR_CP=y +CONFIG_ARCH_CINTEGRATOR=y + +# +# Processor Type +# +CONFIG_CPU_32=y +# CONFIG_CPU_ARM720T is not set +# CONFIG_CPU_ARM920T is not set +# CONFIG_CPU_ARM922T is not set +CONFIG_CPU_ARM926T=y +# CONFIG_CPU_ARM1020 is not set +# CONFIG_CPU_ARM1022 is not set +CONFIG_CPU_ARM1026=y +# CONFIG_CPU_V6 is not set +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WBI=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +CONFIG_ICST525=y + +# +# Bus support +# +CONFIG_ARM_AMBA=y +CONFIG_ISA_DMA_API=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +# CONFIG_PREEMPT is not set +# CONFIG_NO_IDLE_HZ is not set +# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPLIT_PTLOCK_CPUS=4096 +CONFIG_LEDS=y +CONFIG_LEDS_TIMER=y +CONFIG_LEDS_CPU=y +CONFIG_ALIGNMENT_TRAP=y + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="console=ttyAMA0 console=tty1 user_debug=31" +# CONFIG_XIP_KERNEL is not set + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_TABLE=y +# CONFIG_CPU_FREQ_DEBUG is not set +CONFIG_CPU_FREQ_STAT=y +# CONFIG_CPU_FREQ_STAT_DETAILS is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_INTEGRATOR=y + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set +CONFIG_VFP=y + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set +# CONFIG_ARTHUR is not set + +# +# Power management options +# +CONFIG_PM=y +CONFIG_PM_LEGACY=y +# CONFIG_PM_DEBUG is not set +# CONFIG_APM is not set + +# +# Networking +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_BIC=y +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# DCCP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_DCCP is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK 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 + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_IEEE80211 is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set +# CONFIG_DEBUG_DRIVER is not set + +# +# Connector - unified userspace <-> kernelspace linker +# +# CONFIG_CONNECTOR is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_AFS_PARTS=y + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set +# CONFIG_INFTL is not set +# CONFIG_RFD_FTL 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=y +CONFIG_MTD_CFI_NOSWAP=y +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_OTP is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_XIP is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +# CONFIG_MTD_PLATRAM is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set +# CONFIG_MTD_BLOCK2MTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set +# CONFIG_MTD_DOC2001PLUS is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set + +# +# OneNAND Flash Device Drivers +# +# CONFIG_MTD_ONENAND is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# + +# +# I2O device support +# + +# +# Network device support +# +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# PHY device support +# +# CONFIG_PHYLIB is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +CONFIG_SMC91X=y +# CONFIG_DM9000 is not set + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# + +# +# Token Ring devices +# + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN 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_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set +# CONFIG_INPUT_POWER is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYBOARD_NEWTON is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_UINPUT is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +# CONFIG_SERIO_SERPORT is not set +CONFIG_SERIO_AMBAKMI=y +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT 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_AMBA_PL010 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_RAW_DRIVER is not set + +# +# TPM devices +# +# CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Hardware Monitoring support +# +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# + +# +# Multi-Function Devices +# + +# +# LED devices +# +# CONFIG_NEW_LEDS is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +CONFIG_FB=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_MACMODES is not set +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +CONFIG_FB_ARMCLCD=y +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_VIRTUAL is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Logo configuration +# +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_MONO=y +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +CONFIG_USB_ARCH_HAS_HCD=y +# CONFIG_USB_ARCH_HAS_OHCI is not set +# CONFIG_USB is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# Real Time Clock +# +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y + +# +# RTC drivers +# +# CONFIG_RTC_DRV_TEST is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +CONFIG_INOTIFY=y +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y +# CONFIG_RELAYFS_FS is not set + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +CONFIG_JFFS2_FS_WRITEBUFFER=y +# CONFIG_JFFS2_SUMMARY is not set +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set +CONFIG_JFFS2_ZLIB=y +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_CRAMFS=y +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +# CONFIG_NFSD_TCP is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +CONFIG_SMB_FS=y +# CONFIG_SMB_NLS_DEFAULT is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_9P_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 + +# +# Native Language Support +# +CONFIG_NLS=y +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_ASCII 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 + +# +# Profiling support +# +CONFIG_PROFILING=y +CONFIG_OPROFILE=m + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_DEBUG_KERNEL=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_DETECT_SOFTLOCKUP=y +# CONFIG_SCHEDSTATS is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set +# CONFIG_DEBUG_KOBJECT is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_FS is not set +# CONFIG_DEBUG_VM is not set +CONFIG_FRAME_POINTER=y +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_DEBUG_USER is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_ERRORS=y +# CONFIG_DEBUG_LL is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Hardware crypto devices +# + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff --git a/packages/linux/linux-openzaurus.inc b/packages/linux/linux-openzaurus.inc index 8403965269..c0b01616ac 100644 --- a/packages/linux/linux-openzaurus.inc +++ b/packages/linux/linux-openzaurus.inc @@ -115,8 +115,8 @@ do_compile_append() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-openzaurus_2.6.15.bb b/packages/linux/linux-openzaurus_2.6.15.bb index cfd02bb25c..360bce4d87 100644 --- a/packages/linux/linux-openzaurus_2.6.15.bb +++ b/packages/linux/linux-openzaurus_2.6.15.bb @@ -1,6 +1,6 @@ include linux-openzaurus.inc -PR = "r6" +PR = "r10" # Handy URLs # git://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git \ @@ -64,16 +64,18 @@ SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.15.tar.bz2 \ ${RPSRC}/pxa_cf_initorder_hack-r1.patch;patch=1 \ ${RPSRC}/usb_pxa27x_udc-r0.patch;patch=1 \ ${RPSRC}/usb_add_epalloc-r1.patch;patch=1 \ - ${RPSRC}/alsa/alsa-soc-0.9.patch;patch=1 \ - ${RPSRC}/alsa/alsa-soc-0.9-0.10rc1.patch;patch=1 \ - ${RPSRC}/alsa_soc_rpupdate7-r2.patch;patch=1 \ - ${RPSRC}/alsa_akita_fix-r0.patch;patch=1 \ + ${RPSRC}/alsa/asoc-0.10rc2.diff.bz2;patch=1 \ + ${RPSRC}/alsa/asoc-v0.10rc2-rc3.patch;patch=1 \ + ${RPSRC}/misc_fix1-r0.patch;patch=1 \ ${RPSRC}/zaurus_keyboard_tweak-r0.patch;patch=1 \ ${RPSRC}/corgi_bl_cleanup-r2.patch;patch=1 \ ${RPSRC}/corgi_bl_generic-r2.patch;patch=1 \ ${RPSRC}/pxafb_tweaks-r0.patch;patch=1 \ ${RPSRC}/pm_changes-r0.patch;patch=1 \ ${RPSRC}/sharpsl_pm-do-r2.patch;patch=1 \ + ${RPSRC}/headphone_switch-r3.patch;patch=1 \ + ${RPSRC}/backport_i2c_asoc_fix-r0.patch;patch=1 \ + ${RPSRC}/integrator_rtc-r0.patch;patch=1 \ ${DOSRC}/kexec-arm-r0.patch;patch=1 \ file://add-oz-release-string.patch;patch=1 \ file://pxa-serial-hack.patch;patch=1 \ @@ -86,6 +88,7 @@ SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.15.tar.bz2 \ file://defconfig-collie \ file://defconfig-poodle \ file://defconfig-cxx00 \ + file://defconfig-qemuarm \ file://defconfig-tosa " # Disabled until I find the reason this gives issues with cdc_subset diff --git a/packages/linux/linux-sun4cdm_2.4.26.bb b/packages/linux/linux-sun4cdm_2.4.26.bb index 5075523179..d91b952787 100644 --- a/packages/linux/linux-sun4cdm_2.4.26.bb +++ b/packages/linux/linux-sun4cdm_2.4.26.bb @@ -23,8 +23,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - elftoaout -o ${DEPLOY_DIR}/images/linux-aout-${DATETIME} ${KERNEL_IMAGETYPE} + install -d ${DEPLOY_DIR_IMAGE} + elftoaout -o ${DEPLOY_DIR_IMAGE}/linux-aout-${DATETIME} ${KERNEL_IMAGETYPE} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-wrt_2.4.20.bb b/packages/linux/linux-wrt_2.4.20.bb index 9eb3218f6e..8e49ffa2c2 100644 --- a/packages/linux/linux-wrt_2.4.20.bb +++ b/packages/linux/linux-wrt_2.4.20.bb @@ -50,8 +50,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PACKAGE_ARCH}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PACKAGE_ARCH}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-wrt_2.4.30.bb b/packages/linux/linux-wrt_2.4.30.bb index efcd20df9b..0d9229c5d8 100644 --- a/packages/linux/linux-wrt_2.4.30.bb +++ b/packages/linux/linux-wrt_2.4.30.bb @@ -103,9 +103,9 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} cat ${KERNEL_OUTPUT} | lzma e -si -so -eos > \ - ${DEPLOY_DIR}/images/wrt-kernel-${PV}.lzma + ${DEPLOY_DIR_IMAGE}/wrt-kernel-${PV}.lzma } do_deploy[dirs] = "${S}" diff --git a/packages/linux/linux-xxs1500_2.4.21.bb b/packages/linux/linux-xxs1500_2.4.21.bb index e4f7fac776..4754b17046 100644 --- a/packages/linux/linux-xxs1500_2.4.21.bb +++ b/packages/linux/linux-xxs1500_2.4.21.bb @@ -27,8 +27,8 @@ do_configure_prepend() { FILES_kernel += " /tmp" do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR}/images/${MACHINE}-${KV}-${KERNEL_IMAGETYPE}-${DATETIME} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 ${KERNEL_OUTPUT} ${DEPLOY_DIR_IMAGE}/${MACHINE}-${KV}-${KERNEL_IMAGETYPE}-${DATETIME} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/mainstone-kernel_2.6.11.bb b/packages/linux/mainstone-kernel_2.6.11.bb index 2a4d168ac0..12422c96de 100644 --- a/packages/linux/mainstone-kernel_2.6.11.bb +++ b/packages/linux/mainstone-kernel_2.6.11.bb @@ -28,8 +28,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/nslu2-kernel.inc b/packages/linux/nslu2-kernel.inc index d30bcf77ce..b4c675264a 100644 --- a/packages/linux/nslu2-kernel.inc +++ b/packages/linux/nslu2-kernel.inc @@ -251,8 +251,8 @@ do_install_append() { do_deploy[dirs] = "${S}" do_deploy() { - install -d ${DEPLOY_DIR}/images - redboot_fixup '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${N2K_SUFFIX}' + install -d ${DEPLOY_DIR_IMAGE} + redboot_fixup '${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${N2K_SUFFIX}' } addtask deploy before do_build after do_compile diff --git a/packages/linux/nslu2-linksys-kernel_2.4.22.bb b/packages/linux/nslu2-linksys-kernel_2.4.22.bb index 0e2ea3e804..40bceb373e 100644 --- a/packages/linux/nslu2-linksys-kernel_2.4.22.bb +++ b/packages/linux/nslu2-linksys-kernel_2.4.22.bb @@ -42,8 +42,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${KERNEL_SUFFIX} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${KERNEL_SUFFIX} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/openzaurus-pxa27x_2.4.20-rmk2-embedix20050602.bb b/packages/linux/openzaurus-pxa27x_2.4.20-rmk2-embedix20050602.bb index e5574dd35b..d9addd968a 100644 --- a/packages/linux/openzaurus-pxa27x_2.4.20-rmk2-embedix20050602.bb +++ b/packages/linux/openzaurus-pxa27x_2.4.20-rmk2-embedix20050602.bb @@ -91,8 +91,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${PACKAGE_ARCH}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${PACKAGE_ARCH}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/openzaurus-pxa_2.4.18-rmk7-pxa3-embedix20031107.inc b/packages/linux/openzaurus-pxa_2.4.18-rmk7-pxa3-embedix20031107.inc index d8c87d9f02..4c8b43121d 100644 --- a/packages/linux/openzaurus-pxa_2.4.18-rmk7-pxa3-embedix20031107.inc +++ b/packages/linux/openzaurus-pxa_2.4.18-rmk7-pxa3-embedix20031107.inc @@ -105,8 +105,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/openzaurus-sa_2.4.18-rmk7-pxa3-embedix20030509.bb b/packages/linux/openzaurus-sa_2.4.18-rmk7-pxa3-embedix20030509.bb index 0c3ca93fa1..f600acbaed 100644 --- a/packages/linux/openzaurus-sa_2.4.18-rmk7-pxa3-embedix20030509.bb +++ b/packages/linux/openzaurus-sa_2.4.18-rmk7-pxa3-embedix20030509.bb @@ -91,9 +91,9 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images + install -d ${DEPLOY_DIR_IMAGE} install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} \ - ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${MACHINE}-${COLLIE_MEMORY_SIZE}-${COLLIE_RAMDISK_SIZE}-${DATETIME}.bin + ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${COLLIE_MEMORY_SIZE}-${COLLIE_RAMDISK_SIZE}-${DATETIME}.bin } do_deploy[dirs] = "${S}" diff --git a/packages/linux/triton-kernel_2.6.11.bb b/packages/linux/triton-kernel_2.6.11.bb index 5e95d969d1..6fc575c2b0 100644 --- a/packages/linux/triton-kernel_2.6.11.bb +++ b/packages/linux/triton-kernel_2.6.11.bb @@ -29,8 +29,8 @@ do_configure_prepend() { } do_deploy() { - install -d ${DEPLOY_DIR}/images - install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${KERNEL_SUFFIX} + install -d ${DEPLOY_DIR_IMAGE} + install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${KERNEL_SUFFIX} } do_deploy[dirs] = "${S}" diff --git a/packages/linux/unslung-kernel/defconfig b/packages/linux/unslung-kernel/defconfig index 52864f46f6..027dbfb80b 100644 --- a/packages/linux/unslung-kernel/defconfig +++ b/packages/linux/unslung-kernel/defconfig @@ -334,7 +334,7 @@ CONFIG_MTD_IXP425=y # 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=y +CONFIG_BLK_DEV_LOOP=m # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=16384 @@ -513,6 +513,11 @@ CONFIG_TUN=m CONFIG_ETHERTAP=m # +# Netconsole support +# +CONFIG_NETCONSOLE=m + +# # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y @@ -900,8 +905,8 @@ CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_CRAMFS is not set CONFIG_TMPFS=y CONFIG_RAMFS=y -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y # CONFIG_ZISOFS is not set # CONFIG_JFS_FS is not set # CONFIG_JFS_DEBUG is not set @@ -1182,7 +1187,7 @@ CONFIG_USB_SERIAL_VISOR=m # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_EDGEPORT_TI is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set +CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_MCT_U232=m # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set diff --git a/packages/linux/unslung-kernel/netconsole.patch b/packages/linux/unslung-kernel/netconsole.patch new file mode 100644 index 0000000000..c54f4d160e --- /dev/null +++ b/packages/linux/unslung-kernel/netconsole.patch @@ -0,0 +1,383 @@ +diff -Naur linux-2.4.22/drivers/net/Config.in.orig linux-2.4.22/drivers/net/Config.in +--- linux-2.4.22/drivers/net/Config.in.orig 2006-02-26 11:49:28.000000000 -0600 ++++ linux-2.4.22/drivers/net/Config.in 2006-02-26 11:40:31.000000000 -0600 +@@ -338,6 +338,8 @@ + dep_tristate ' SysKonnect FDDI PCI support' CONFIG_SKFP $CONFIG_PCI + fi + ++dep_tristate 'Network logging support' CONFIG_NETCONSOLE ++ + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + if [ "$CONFIG_INET" = "y" ]; then + bool 'HIPPI driver support (EXPERIMENTAL)' CONFIG_HIPPI +diff -Naur linux-2.4.22/drivers/net/Makefile.orig linux-2.4.22/drivers/net/Makefile +--- linux-2.4.22/drivers/net/Makefile.orig 2006-02-26 11:49:45.000000000 -0600 ++++ linux-2.4.22/drivers/net/Makefile 2006-02-26 11:38:58.000000000 -0600 +@@ -272,6 +272,8 @@ + obj-y += ../acorn/net/acorn-net.o + endif + ++obj-$(CONFIG_NETCONSOLE) += netconsole.o ++ + # + # HIPPI adapters + # +diff -Naur linux-2.4.22/drivers/net/netconsole.c.orig linux-2.4.22/drivers/net/netconsole.c +--- linux-2.4.22/drivers/net/netconsole.c.orig 1969-12-31 18:00:00.000000000 -0600 ++++ linux-2.4.22/drivers/net/netconsole.c 2006-02-26 16:16:23.000000000 -0600 +@@ -0,0 +1,342 @@ ++/* linux/drivers/net/netconsole.c ++ * ++ * Copyright (C) 2001 Ingo Molnar <mingo@redhat.com> ++ * ++ * This file contains the implementation of an IRQ-safe, crash-safe ++ * kernel console implementation that outputs kernel messages to the ++ * network. ++ * ++ * Modification history: ++ * ++ * 2001-09-17 started by Ingo Molnar. ++ * 2006-02-26 very minor modifications to suit the NSLU2 w/Unslung -- Mike Westerhof. ++ */ ++ ++/**************************************************************** ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ * ++ ****************************************************************/ ++ ++#include <net/tcp.h> ++#include <net/udp.h> ++#include <linux/mm.h> ++#include <linux/tty.h> ++#include <linux/init.h> ++#include <linux/module.h> ++#include <asm/unaligned.h> ++#include <linux/console.h> ++#include <linux/smp_lock.h> ++#include <linux/netdevice.h> ++#include <linux/tty_driver.h> ++#include <linux/etherdevice.h> ++ ++static struct net_device *netconsole_dev; ++static u16 source_port, target_port; ++static u32 source_ip, target_ip; ++static unsigned char daddr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} ; ++ ++#define NETCONSOLE_VERSION 0x01 ++#define HEADER_LEN 5 ++ ++#define MAX_UDP_CHUNK 1460 ++#define MAX_PRINT_CHUNK (MAX_UDP_CHUNK-HEADER_LEN) ++ ++/* ++ * We maintain a small pool of fully-sized skbs, ++ * to make sure the message gets out even in ++ * extreme OOM situations. ++ */ ++#define MAX_NETCONSOLE_SKBS 32 ++ ++static spinlock_t netconsole_lock = SPIN_LOCK_UNLOCKED; ++static int nr_netconsole_skbs; ++static struct sk_buff *netconsole_skbs; ++ ++#define MAX_SKB_SIZE \ ++ (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ ++ sizeof(struct iphdr) + sizeof(struct ethhdr)) ++ ++static void __refill_netconsole_skbs(void) ++{ ++ struct sk_buff *skb; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&netconsole_lock, flags); ++ while (nr_netconsole_skbs < MAX_NETCONSOLE_SKBS) { ++ skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC); ++ if (!skb) ++ break; ++ if (netconsole_skbs) ++ skb->next = netconsole_skbs; ++ else ++ skb->next = NULL; ++ netconsole_skbs = skb; ++ nr_netconsole_skbs++; ++ } ++ spin_unlock_irqrestore(&netconsole_lock, flags); ++} ++ ++static struct sk_buff * get_netconsole_skb(void) ++{ ++ struct sk_buff *skb; ++ ++ unsigned long flags; ++ ++ spin_lock_irqsave(&netconsole_lock, flags); ++ skb = netconsole_skbs; ++ if (skb) ++ netconsole_skbs = skb->next; ++ skb->next = NULL; ++ nr_netconsole_skbs--; ++ spin_unlock_irqrestore(&netconsole_lock, flags); ++ ++ return skb; ++} ++ ++static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED; ++static unsigned int offset; ++ ++static void send_netconsole_skb(struct net_device *dev, const char *msg, unsigned int msg_len) ++{ ++ int total_len, eth_len, ip_len, udp_len; ++ unsigned long flags; ++ struct sk_buff *skb; ++ struct udphdr *udph; ++ struct iphdr *iph; ++ struct ethhdr *eth; ++ ++ udp_len = msg_len + HEADER_LEN + sizeof(*udph); ++ ip_len = eth_len = udp_len + sizeof(*iph); ++ total_len = eth_len + ETH_HLEN; ++ ++ if (nr_netconsole_skbs < MAX_NETCONSOLE_SKBS) ++ __refill_netconsole_skbs(); ++ ++ skb = alloc_skb(total_len, GFP_ATOMIC); ++ if (!skb) { ++ skb = get_netconsole_skb(); ++ if (!skb) ++ /* tough! */ ++ return; ++ } ++ ++ atomic_set(&skb->users, 1); ++ skb_reserve(skb, total_len - msg_len - HEADER_LEN); ++ skb->data[0] = NETCONSOLE_VERSION; ++ ++ spin_lock_irqsave(&sequence_lock, flags); ++ put_unaligned(htonl(offset), (u32 *) (skb->data + 1)); ++ offset += msg_len; ++ spin_unlock_irqrestore(&sequence_lock, flags); ++ ++ memcpy(skb->data + HEADER_LEN, msg, msg_len); ++ skb->len += msg_len + HEADER_LEN; ++ ++ udph = (struct udphdr *) skb_push(skb, sizeof(*udph)); ++ udph->source = source_port; ++ udph->dest = target_port; ++ udph->len = htons(udp_len); ++ udph->check = 0; ++ ++ iph = (struct iphdr *)skb_push(skb, sizeof(*iph)); ++ ++ iph->version = 4; ++ iph->ihl = 5; ++ iph->tos = 0; ++ iph->tot_len = htons(ip_len); ++ iph->id = 0; ++ iph->frag_off = 0; ++ iph->ttl = 64; ++ iph->protocol = IPPROTO_UDP; ++ iph->check = 0; ++ iph->saddr = source_ip; ++ iph->daddr = target_ip; ++ iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); ++ ++ eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); ++ ++ eth->h_proto = htons(ETH_P_IP); ++ memcpy(eth->h_source, dev->dev_addr, dev->addr_len); ++ memcpy(eth->h_dest, daddr, dev->addr_len); ++ ++repeat: ++ spin_lock(&dev->xmit_lock); ++ dev->xmit_lock_owner = smp_processor_id(); ++ ++ if (netif_queue_stopped(dev)) { ++ dev->xmit_lock_owner = -1; ++ spin_unlock(&dev->xmit_lock); ++ ++ dev->poll_controller(dev); ++ goto repeat; ++ } ++ ++ dev->hard_start_xmit(skb, dev); ++ ++ dev->xmit_lock_owner = -1; ++ spin_unlock(&dev->xmit_lock); ++} ++ ++static void write_netconsole_msg(struct console *con, const char *msg, unsigned int msg_len) ++{ ++ int len, left; ++ struct net_device *dev; ++ ++ dev = netconsole_dev; ++ if (!dev) ++ return; ++ ++ if (dev->poll_controller && netif_running(dev)) { ++ unsigned long flags; ++ ++ __save_flags(flags); ++ __cli(); ++ left = msg_len; ++repeat: ++ if (left > MAX_PRINT_CHUNK) ++ len = MAX_PRINT_CHUNK; ++ else ++ len = left; ++ send_netconsole_skb(dev, msg, len); ++ msg += len; ++ left -= len; ++ if (left) ++ goto repeat; ++ __restore_flags(flags); ++ } ++} ++ ++static char *dev; ++static int target_eth_byte0 = 255; ++static int target_eth_byte1 = 255; ++static int target_eth_byte2 = 255; ++static int target_eth_byte3 = 255; ++static int target_eth_byte4 = 255; ++static int target_eth_byte5 = 255; ++ ++MODULE_AUTHOR("Ingo Molnar <mingo@redhat.com>"); ++MODULE_DESCRIPTION("kernel network console implementation"); ++MODULE_LICENSE("GPL"); ++MODULE_PARM(target_ip, "i"); ++MODULE_PARM(target_eth_byte0, "i"); ++MODULE_PARM(target_eth_byte1, "i"); ++MODULE_PARM(target_eth_byte2, "i"); ++MODULE_PARM(target_eth_byte3, "i"); ++MODULE_PARM(target_eth_byte4, "i"); ++MODULE_PARM(target_eth_byte5, "i"); ++MODULE_PARM(source_port, "h"); ++MODULE_PARM(target_port, "h"); ++MODULE_PARM(dev, "s"); ++ ++static struct console netconsole = ++ { flags: CON_ENABLED, write: write_netconsole_msg }; ++ ++static int init_netconsole(void) ++{ ++ struct net_device *ndev = NULL; ++ struct in_device *in_dev; ++ ++ // Set some reasonable defaults, at least for the NSLU2 device ++ if (!target_port) ++ target_port = 6666; ++ if (!source_port) ++ source_port = 6666; ++ if (!dev) ++ dev = "ixp0"; ++ ++ printk(KERN_INFO "netconsole: using network device <%s>\n", dev); ++ // this will be valid once the device goes up. ++ if (dev) ++ ndev = dev_get_by_name(dev); ++ if (!ndev) { ++ printk(KERN_ERR "netconsole: network device %s does not exist, aborting.\n", dev); ++ return -1; ++ } ++ if (!ndev->poll_controller) { ++ printk(KERN_ERR "netconsole: %s's network driver does not implement netlogging yet, aborting.\n", dev); ++ return -1; ++ } ++ in_dev = in_dev_get(ndev); ++ if (!in_dev) { ++ printk(KERN_ERR "netconsole: network device %s is not an IP protocol device, aborting.\n", dev); ++ return -1; ++ } ++ source_ip = ntohl(in_dev->ifa_list->ifa_local); ++ if (!source_ip) { ++ printk(KERN_ERR "netconsole: network device %s has no local address, aborting.\n", dev); ++ return -1; ++ } ++ source_ip = htonl(source_ip); ++#define IP(x) ((char *)&source_ip)[x] ++ printk(KERN_INFO "netconsole: using source IP %i.%i.%i.%i\n", ++ IP(0), IP(1), IP(2), IP(3)); ++#undef IP ++ if (!target_ip) { ++ printk(KERN_ERR "netconsole: target_ip parameter not specified, aborting.\n"); ++ return -1; ++ } ++ target_ip = htonl(target_ip); ++#define IP(x) ((char *)&target_ip)[x] ++ printk(KERN_INFO "netconsole: using target IP %i.%i.%i.%i\n", ++ IP(0), IP(1), IP(2), IP(3)); ++#undef IP ++ if (!source_port) { ++ printk(KERN_ERR "netconsole: source_port parameter not specified, aborting.\n"); ++ return -1; ++ } ++ printk(KERN_INFO "netconsole: using source UDP port: %i\n", source_port); ++ source_port = htons(source_port); ++ if (!target_port) { ++ printk(KERN_ERR "netconsole: target_port parameter not specified, aborting.\n"); ++ return -1; ++ } ++ printk(KERN_INFO "netconsole: using target UDP port: %i\n", target_port); ++ target_port = htons(target_port); ++ ++ daddr[0] = target_eth_byte0; ++ daddr[1] = target_eth_byte1; ++ daddr[2] = target_eth_byte2; ++ daddr[3] = target_eth_byte3; ++ daddr[4] = target_eth_byte4; ++ daddr[5] = target_eth_byte5; ++ ++ if ((daddr[0] & daddr[1] & daddr[2] & daddr[3] & daddr[4] & daddr[5]) == 255) ++ printk(KERN_INFO "netconsole: using broadcast ethernet frames to send packets.\n"); ++ else ++ printk(KERN_INFO "netconsole: using target ethernet address %02x:%02x:%02x:%02x:%02x:%02x.\n", daddr[0], daddr[1], daddr[2], daddr[3], daddr[4], daddr[5]); ++ ++ netconsole_dev = ndev; ++#define STARTUP_MSG "[...network console startup...]\n" ++ write_netconsole_msg(NULL, STARTUP_MSG, strlen(STARTUP_MSG)); ++ ++ register_console(&netconsole); ++ printk(KERN_INFO "netconsole: network logging started up successfully!\n"); ++ return 0; ++} ++ ++static void cleanup_netconsole(void) ++{ ++ printk(KERN_INFO "netconsole: network logging shut down.\n"); ++ unregister_console(&netconsole); ++ ++#define SHUTDOWN_MSG "[...network console shutdown...]\n" ++ write_netconsole_msg(NULL, SHUTDOWN_MSG, strlen(SHUTDOWN_MSG)); ++ netconsole_dev = NULL; ++} ++ ++module_init(init_netconsole); ++module_exit(cleanup_netconsole); ++ ++int dummy = MAX_SKB_SIZE; +diff -Naur linux-2.4.22/include/linux/netdevice.h.orig linux-2.4.22/include/linux/netdevice.h +--- linux-2.4.22/include/linux/netdevice.h.orig 2006-02-26 11:50:24.000000000 -0600 ++++ linux-2.4.22/include/linux/netdevice.h 2006-02-26 11:37:14.000000000 -0600 +@@ -428,6 +428,9 @@ + int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); + int (*accept_fastpath)(struct net_device *, struct dst_entry*); + ++#define HAVE_POLL_CONTROLLER ++ void (*poll_controller)(struct net_device *dev); ++ + /* open/release and usage marking */ + struct module *owner; + diff --git a/packages/linux/unslung-kernel_2.4.22.l2.3r63.bb b/packages/linux/unslung-kernel_2.4.22.l2.3r63.bb index 170651afab..b8d3c13a32 100644 --- a/packages/linux/unslung-kernel_2.4.22.l2.3r63.bb +++ b/packages/linux/unslung-kernel_2.4.22.l2.3r63.bb @@ -4,7 +4,7 @@ include nslu2-linksys-kernel_2.4.22.bb DESCRIPTION = "Unslung kernel for the Linksys NSLU2 device" MAINTAINER = "NSLU2 Linux <www.nlsu2-linux.org>" -PR = "r8" +PR = "r10" KERNEL_SUFFIX = "unslung" @@ -25,6 +25,7 @@ SRC_URI += "file://linux-kernel-R25_to_R29.patch;patch=1 \ file://ppp_mppe.patch;patch=1 \ file://nfs-blocksize.patch;patch=1 \ file://pl2303.patch;patch=1 \ + file://netconsole.patch;patch=1 \ ${UNSLUNG_KERNEL_EXTRA_SRC_URI}" FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/unslung-kernel', '${FILE_DIRNAME}/nslu2-linksys-kernel-2.4.22', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}" |