diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/Documentation/arm/Setup linux-arm-2.4-ds/Documentation/arm/Setup --- linux-arm-2.4-ds.orig/Documentation/arm/Setup 2003-05-06 08:31:35.000000000 +0100 +++ linux-arm-2.4-ds/Documentation/arm/Setup 2003-04-09 11:37:33.000000000 +0100 @@ -115,7 +115,7 @@ mem_fclk_21285 The speed of the external oscillator to the 21285 (footbridge), - which control's the speed of the memory bus, timer & serial port. + which controls the speed of the memory bus, timer & serial port. Depending upon the speed of the cpu its value can be between 0-66 MHz. If no params are passed or a value of zero is passed, then a value of 50 Mhz is the default on 21285 architectures. diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/Makefile linux-arm-2.4-ds/Makefile --- linux-arm-2.4-ds.orig/Makefile 2003-12-12 16:49:12.000000000 +0000 +++ linux-arm-2.4-ds/Makefile 2004-01-02 15:59:52.000000000 +0000 @@ -1,7 +1,8 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 21 -EXTRAVERSION =-rmk1-ds3 +#EXTRAVERSION =-rmk1-ds3-pn1 +EXTRAVERSION =-iyonix KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) @@ -21,7 +22,7 @@ HOSTCC = gcc HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -CROSS_COMPILE = /opt/montavista/devkit/arm/xscale_le/bin/xscale_le- +CROSS_COMPILE = /usr/local/arm/3.3.1/bin/arm-linux- # # Include the make variables (CC, etc...) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/Makefile linux-arm-2.4-ds/arch/arm/Makefile --- linux-arm-2.4-ds.orig/arch/arm/Makefile 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/Makefile 2003-10-26 17:44:25.000000000 +0000 @@ -16,7 +16,7 @@ CFLAGS :=$(CFLAGS:-fomit-frame-pointer=-mapcs -mno-sched-prolog) endif -CFLAGS :=$(CFLAGS:-O2=-Os) +#CFLAGS :=$(CFLAGS:-O2=-Os) ifeq ($(CONFIG_DEBUG_INFO),y) CFLAGS +=-g @@ -208,7 +208,7 @@ export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT OBJCOPYFLAGS -# Only set INCDIR if its not already defined above +# Only set INCDIR if it's not already defined above # Grr, ?= doesn't work as all the other assignment operators do. Make bug? ifeq ($(origin INCDIR), undefined) INCDIR :=$(MACHINE) @@ -259,6 +259,11 @@ DRIVERS +=drivers/acorn/char/acorn-char.o endif +ifeq ($(CONFIG_ARCH_IYONIX),y) +#SUBDIRS +=drivers/acorn/char +#DRIVERS +=drivers/acorn/char/acorn-char.o +endif + MAKEBOOT =$(MAKE) -C arch/$(ARCH)/boot MAKETOOLS =$(MAKE) -C arch/$(ARCH)/tools diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/boot/Makefile linux-arm-2.4-ds/arch/arm/boot/Makefile --- linux-arm-2.4-ds.orig/arch/arm/boot/Makefile 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/boot/Makefile 2003-10-03 12:59:43.000000000 +0100 @@ -141,6 +141,12 @@ ZRELADDR = 0x1c008000 endif +ifeq ($(CONFIG_ARCH_IYONIX),y) +ZRELADDR = 0xc0008000 +PARAMS_PHYS = 0xc0000100 +INITRD_PHYS = 0xc8000000 +endif + # # We now have a PIC decompressor implementation. Decompressors running # from RAM should not define ZTEXTADDR. Decompressors running directly diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/boot/compressed/head-xscale.S linux-arm-2.4-ds/arch/arm/boot/compressed/head-xscale.S --- linux-arm-2.4-ds.orig/arch/arm/boot/compressed/head-xscale.S 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/boot/compressed/head-xscale.S 2003-10-03 12:59:43.000000000 +0100 @@ -39,10 +39,12 @@ @ TODO: Move this to bootloader! @ #ifdef CONFIG_ARCH_IOP321 - @ Make up for RedBoots memory map +#ifndef CONFIG_ARCH_IYONIX + @ Make up for RedBoot's memory map @ New redboot will fix this... orr pc, pc, #0xa0000000 nop +#endif #ifdef CONFIG_ARCH_IQ80321 mov r7, #MACH_TYPE_IQ80321 diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/boot/compressed/misc.c linux-arm-2.4-ds/arch/arm/boot/compressed/misc.c --- linux-arm-2.4-ds.orig/arch/arm/boot/compressed/misc.c 2003-05-06 08:31:37.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/boot/compressed/misc.c 2003-10-26 17:43:55.000000000 +0000 @@ -29,6 +29,12 @@ #define __ptr_t void * +#ifdef CONFIG_IOP321_DMA_MEMCPY +#ifdef memcpy +#undef memcpy +#endif +#endif + /* * Optimised C version of memzero for the ARM. */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/config.in linux-arm-2.4-ds/arch/arm/config.in --- linux-arm-2.4-ds.orig/arch/arm/config.in 2003-12-10 10:44:59.000000000 +0000 +++ linux-arm-2.4-ds/arch/arm/config.in 2003-12-12 17:04:22.000000000 +0000 @@ -155,8 +155,9 @@ mainmenu_option next_comment comment 'IOP3xx Implementation Options' choice 'IOP3xx System Type' \ - "IQ80310 CONFIG_ARCH_IQ80310\ - IQ80321 CONFIG_ARCH_IQ80321\ + "IQ80310 CONFIG_ARCH_IQ80310 \ + IQ80321 CONFIG_ARCH_IQ80321 \ + IYONIX CONFIG_ARCH_IYONIX \ IQ31244 CONFIG_ARCH_IQ31244" IQ80310 # Which IOP variants are we supporting? @@ -166,14 +167,23 @@ define_bool CONFIG_ARCH_IOP310 n fi - if [ "$CONFIG_ARCH_IQ80321" = "y" -o "$CONFIG_ARCH_IQ31244" = "y" ]; then + if [ "$CONFIG_ARCH_IQ80321" = "y" -o "$CONFIG_ARCH_IQ31244" = "y" -o \ + "$CONFIG_ARCH_IYONIX" = "y" ]; then define_bool CONFIG_ARCH_IOP321 y else define_bool CONFIG_ARCH_IOP321 n fi comment 'IOP3xx Chipset Features' - dep_bool 'Support IOP3xx AAU RAID Acceleration (EXPERIMENTAL)' CONFIG_IOP3XX_AAU + dep_bool 'Support IOP3xx AAU RAID Acceleration (EXPERIMENTAL)' CONFIG_IOP3XX_AAU $CONFIG_EXPERIMENTAL + dep_bool 'Support IOP321 DMA (EXPERIMENTAL)' CONFIG_IOP321_DMA $CONFIG_EXPERIMENTAL + if [ "$CONFIG_IOP321_DMA" = "y" ]; then + dep_bool 'Support IOP321 DMA memcpy (EXPERIMENTAL)' CONFIG_IOP321_DMA_MEMCPY $CONFIG_EXPERIMENTAL + dep_bool 'Support IOP321 DMA copy_to_user (EXPERIMENTAL)' CONFIG_IOP321_DMA_COPYTOUSER $CONFIG_EXPERIMENTAL + dep_bool 'Support IOP321 DMA copy_from_user (EXPERIMENTAL)' CONFIG_IOP321_DMA_COPYFROMUSER $CONFIG_EXPERIMENTAL + dep_bool 'Support IOP321 DMA TCP TX (EXPERIMENTAL)' CONFIG_TCP_DMA_TX $CONFIG_EXPERIMENTAL + fi + endmenu fi @@ -740,7 +750,8 @@ # Select the keyboard type for this architecture. if [ "$CONFIG_FOOTBRIDGE_HOST" = "y" -o \ "$CONFIG_ARCH_CLPS7500" = "y" -o \ - "$CONFIG_ARCH_SHARK" = "y" ]; then + "$CONFIG_ARCH_SHARK" = "y" -o \ + "$CONFIG_ARCH_IYONIX" = "y" ]; then define_bool CONFIG_PC_KEYB y fi if [ "$CONFIG_ARCH_INTEGRATOR" = "y" ]; then @@ -760,7 +771,8 @@ "$CONFIG_ARCH_CLPS7500" = "y" -o \ "$CONFIG_ARCH_P720T" = "y" -o \ "$CONFIG_ARCH_ANAKIN" = "y" -o \ - "$CONFIG_ARCH_MX1ADS" = "y" ]; then + "$CONFIG_ARCH_MX1ADS" = "y" -o \ + "$CONFIG_ARCH_IYONIX" = "y" ]; then define_bool CONFIG_PC_KEYMAP y fi if [ "$CONFIG_ARCH_ACORN" != "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a "$CONFIG_ARCH_RISCSTATION" != "y" ]; then diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/def-configs/iq80310 linux-arm-2.4-ds/arch/arm/def-configs/iq80310 --- linux-arm-2.4-ds.orig/arch/arm/def-configs/iq80310 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/def-configs/iq80310 2003-10-26 17:44:15.000000000 +0000 @@ -180,6 +180,7 @@ # CONFIG_XSCALE_PMU_TIMER is not set # CONFIG_XSCALE_CACHE_ERRATA is not set # CONFIG_XSCALE_BDI2000 is not set +CONFIG_XSCLAE_XBIT=y # CONFIG_DISCONTIGMEM is not set # CONFIG_CPU_BIG_ENDIAN is not set diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/def-configs/iyonix linux-arm-2.4-ds/arch/arm/def-configs/iyonix --- linux-arm-2.4-ds.orig/arch/arm/def-configs/iyonix 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/def-configs/iyonix 2004-01-06 12:09:07.000000000 +0000 @@ -0,0 +1,1223 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_ARM=y +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_GENERIC_BUST_SPINLOCK is not set +# CONFIG_GENERIC_ISA_DMA is not set + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_ADVANCED_OPTIONS=y +# CONFIG_OBSOLETE is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_ADIFCC is not set +# CONFIG_ARCH_ANAKIN is not set +# CONFIG_ARCH_ARCA5K is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_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=y +# CONFIG_ARCH_IXP425 is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_OMAHA is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_MX1ADS is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_RISCSTATION is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_AT91RM9200 is not set + +# +# Archimedes/A5000 Implementations +# + +# +# Archimedes/A5000 Implementations (select only ONE) +# +# CONFIG_ARCH_ARC is not set +# CONFIG_ARCH_A5K is not set + +# +# Footbridge Implementations +# +# CONFIG_ARCH_CATS is not set +# CONFIG_ARCH_PERSONAL_SERVER is not set +# CONFIG_ARCH_EBSA285_ADDIN is not set +# CONFIG_ARCH_EBSA285_HOST is not set +# CONFIG_ARCH_NETWINDER is not set + +# +# SA11x0 Implementations +# +# CONFIG_SA1100_ACCELENT is not set +# CONFIG_SA1100_ASSABET is not set +# CONFIG_ASSABET_NEPONSET is not set +# CONFIG_SA1100_ADSAGC is not set +# CONFIG_SA1100_ADSBITSY is not set +# CONFIG_SA1100_ADSBITSYPLUS is not set +# CONFIG_SA1100_BRUTUS is not set +# CONFIG_SA1100_CEP is not set +# CONFIG_SA1100_CERF is not set +# CONFIG_SA1100_H3100 is not set +# CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set +# CONFIG_SA1100_H3XXX is not set +# CONFIG_H3600_SLEEVE is not set +# CONFIG_SA1100_EXTENEX1 is not set +# CONFIG_SA1100_FLEXANET is not set +# CONFIG_SA1100_FREEBIRD is not set +# CONFIG_SA1100_FRODO is not set +# CONFIG_SA1100_GRAPHICSCLIENT is not set +# CONFIG_SA1100_GRAPHICSMASTER is not set +# CONFIG_SA1100_HACKKIT is not set +# CONFIG_SA1100_BADGE4 is not set +# CONFIG_SA1100_JORNADA720 is not set +# CONFIG_SA1100_HUW_WEBPANEL is not set +# CONFIG_SA1100_ITSY is not set +# CONFIG_SA1100_LART is not set +# CONFIG_SA1100_NANOENGINE is not set +# CONFIG_SA1100_OMNIMETER is not set +# CONFIG_SA1100_PANGOLIN is not set +# CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_PT_SYSTEM3 is not set +# CONFIG_SA1100_SHANNON is not set +# CONFIG_SA1100_SHERMAN is not set +# CONFIG_SA1100_SIMPAD is not set +# CONFIG_SA1100_SIMPUTER is not set +# CONFIG_SA1100_PFS168 is not set +# CONFIG_SA1100_VICTOR is not set +# CONFIG_SA1100_XP860 is not set +# CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_USB is not set +# CONFIG_SA1100_USB_NETLINK is not set +# CONFIG_SA1100_USB_CHAR is not set +# CONFIG_SA1100_SSP is not set + +# +# AT91RM9200 Implementations +# +# CONFIG_ARCH_AT91RM9200DK is not set + +# +# IOP3xx Implementation Options +# +# CONFIG_ARCH_IQ80310 is not set +# CONFIG_ARCH_IQ80321 is not set +CONFIG_ARCH_IYONIX=y +# CONFIG_ARCH_IQ31244 is not set +# CONFIG_ARCH_IOP310 is not set +CONFIG_ARCH_IOP321=y + +# +# IOP3xx Chipset Features +# +# CONFIG_IOP3XX_AAU is not set +CONFIG_IOP321_DMA=y +CONFIG_IOP321_DMA_MEMCPY=y +# CONFIG_IOP321_DMA_COPYTOUSER is not set +CONFIG_IOP321_DMA_COPYFROMUSER=y +CONFIG_TCP_DMA_TX=y + +# +# CLPS711X/EP721X Implementations +# +# CONFIG_ARCH_AUTCPU12 is not set +# CONFIG_ARCH_CDB89712 is not set +# CONFIG_ARCH_CLEP7312 is not set +# CONFIG_ARCH_EDB7211 is not set +# CONFIG_ARCH_FORTUNET is not set +# CONFIG_ARCH_GUIDEA07 is not set +# CONFIG_ARCH_P720T is not set +# CONFIG_ARCH_EP7211 is not set +# CONFIG_ARCH_EP7212 is not set +# CONFIG_ARCH_ACORN is not set +# CONFIG_FOOTBRIDGE is not set +# CONFIG_FOOTBRIDGE_HOST is not set +# CONFIG_FOOTBRIDGE_ADDIN is not set + +# +# Processor Type +# +CONFIG_CPU_32=y +# CONFIG_CPU_26 is not set +# CONFIG_CPU_ARM610 is not set +# CONFIG_CPU_ARM710 is not set +# CONFIG_CPU_ARM720T is not set +# CONFIG_CPU_ARM920T is not set +# CONFIG_CPU_ARM922T is not set +# CONFIG_PLD is not set +# CONFIG_CPU_ARM926T is not set +# CONFIG_CPU_ARM1020 is not set +# CONFIG_CPU_ARM1026 is not set +# CONFIG_CPU_SA110 is not set +# CONFIG_CPU_SA1100 is not set +# CONFIG_CPU_32v3 is not set +# CONFIG_CPU_32v4 is not set +CONFIG_CPU_32v5=y +CONFIG_CPU_XSCALE=y +CONFIG_ARM_THUMB=y + +# +# Processor Features +# +# CONFIG_XSCALE_PMU_TIMER is not set +# CONFIG_XSCALE_CACHE_ERRATA is not set +# CONFIG_XSCALE_BDI2000 is not set +CONFIG_XSCALE_XBIT=y +# CONFIG_DISCONTIGMEM is not set +# CONFIG_CPU_BIG_ENDIAN is not set + +# +# General setup +# +CONFIG_PCI=y +CONFIG_PCI_AUTOCONFIG=y +# CONFIG_ISA is not set +# CONFIG_ISA_DMA is not set +# CONFIG_KERNEL_START_BOOL is not set +CONFIG_KERNEL_START=0xc0000000 +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_PCI_NAMES=y +# CONFIG_HOTPLUG is not set +# CONFIG_PCMCIA is not set +CONFIG_NET=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y + +# +# At least one math emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +# CONFIG_BINFMT_AOUT is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_PM is not set +# CONFIG_ARTHUR is not set +CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200" +CONFIG_ALIGNMENT_TRAP=y + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_STATS is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +CONFIG_NETFILTER=y +# CONFIG_NETFILTER_DEBUG is not set +CONFIG_FILTER=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +# 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_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set + +# +# IP: Netfilter Configuration +# +CONFIG_IP_NF_CONNTRACK=y +# CONFIG_IP_NF_FTP is not set +# CONFIG_IP_NF_AMANDA is not set +# CONFIG_IP_NF_TFTP is not set +# CONFIG_IP_NF_IRC is not set +# CONFIG_IP_NF_QUEUE is not set +CONFIG_IP_NF_IPTABLES=y +# CONFIG_IP_NF_MATCH_LIMIT is not set +# CONFIG_IP_NF_MATCH_MAC is not set +# CONFIG_IP_NF_MATCH_PKTTYPE is not set +# CONFIG_IP_NF_MATCH_MARK is not set +CONFIG_IP_NF_MATCH_MULTIPORT=y +# CONFIG_IP_NF_MATCH_TOS is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_DSCP is not set +# CONFIG_IP_NF_MATCH_AH_ESP is not set +# CONFIG_IP_NF_MATCH_LENGTH is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_MATCH_TCPMSS is not set +# CONFIG_IP_NF_MATCH_HELPER is not set +# CONFIG_IP_NF_MATCH_STATE is not set +# CONFIG_IP_NF_MATCH_CONNTRACK is not set +# CONFIG_IP_NF_MATCH_UNCLEAN is not set +# CONFIG_IP_NF_MATCH_OWNER is not set +# CONFIG_IP_NF_FILTER is not set +CONFIG_IP_NF_NAT=y +CONFIG_IP_NF_NAT_NEEDED=y +CONFIG_IP_NF_TARGET_MASQUERADE=y +# CONFIG_IP_NF_TARGET_REDIRECT is not set +CONFIG_IP_NF_NAT_LOCAL=y +# CONFIG_IP_NF_NAT_SNMP_BASIC is not set +# CONFIG_IP_NF_MANGLE is not set +CONFIG_IP_NF_TARGET_LOG=y +# CONFIG_IP_NF_TARGET_ULOG is not set +# CONFIG_IP_NF_TARGET_TCPMSS is not set +# CONFIG_IP_NF_ARPTABLES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set + +# +# +# +# CONFIG_IPX is not set +# CONFIG_ATALK is not set + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +CONFIG_BRIDGE=y +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_ARM_AM79C961A is not set +# CONFIG_ARM_CIRRUS is not set +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_APRICOT is not set +# CONFIG_CS89x0 is not set +# CONFIG_TULIP is not set +# CONFIG_DE4X5 is not set +# CONFIG_DGRS is not set +# CONFIG_DM9102 is not set +# CONFIG_EEPRO100 is not set +# CONFIG_EEPRO100_PIO is not set +# CONFIG_E100 is not set +# CONFIG_LNE390 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set +CONFIG_8139TOO=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_8139_OLD_RX_RESET is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_SUNDANCE_MMIO is not set +# CONFIG_TLAN is not set +# CONFIG_TC35815 is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_RHINE_MMIO is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +CONFIG_E1000=y +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +CONFIG_PPP=y +# CONFIG_PPP_MULTILINK is not set +CONFIG_PPP_FILTER=y +CONFIG_PPP_ASYNC=y +# CONFIG_PPP_SYNC_TTY is not set +CONFIG_PPP_DEFLATE=y +CONFIG_PPP_BSDCOMP=y +# CONFIG_PPPOE is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ATA/ATAPI/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y + +# +# Please see Documentation/ide.txt for help/info on IDE drives +# +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +# CONFIG_BLK_DEV_IDECS is not set +CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +CONFIG_BLK_DEV_IDESCSI=y +# CONFIG_IDE_TASK_IOCTL is not set + +# +# IDE chipset support/bugfixes +# +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set +CONFIG_IDEPCI_SHARE_IRQ=y +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +CONFIG_IDEDMA_PCI_AUTO=y +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_ADMA100 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +CONFIG_BLK_DEV_ALI15X3=y +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_IDE_CHIPSETS is not set +CONFIG_IDEDMA_AUTO=y +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +CONFIG_BLK_DEV_IDE_MODES=y +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +# CONFIG_BLK_DEV_SD is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +CONFIG_CHR_DEV_SG=y + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set +# CONFIG_I2O_PCI is not set +# CONFIG_I2O_BLOCK is not set +# CONFIG_I2O_LAN is not set +# CONFIG_I2O_SCSI is not set +# CONFIG_I2O_PROC is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Input core support +# +CONFIG_INPUT=y +CONFIG_INPUT_KEYBDEV=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_MX1TS is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_SERIAL=y +# CONFIG_SERIAL_CONSOLE is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_ANAKIN is not set +# CONFIG_SERIAL_ANAKIN_CONSOLE is not set +# CONFIG_SERIAL_AMBA is not set +# CONFIG_SERIAL_AMBA_CONSOLE is not set +# CONFIG_SERIAL_CLPS711X is not set +# CONFIG_SERIAL_CLPS711X_CONSOLE is not set +# CONFIG_SERIAL_21285 is not set +# CONFIG_SERIAL_21285_OLD is not set +# CONFIG_SERIAL_21285_CONSOLE is not set +# CONFIG_SERIAL_UART00 is not set +# CONFIG_SERIAL_UART00_CONSOLE is not set +# CONFIG_SERIAL_SA1100 is not set +# CONFIG_SERIAL_SA1100_CONSOLE is not set +# CONFIG_SERIAL_OMAHA is not set +# CONFIG_SERIAL_OMAHA_CONSOLE is not set +# CONFIG_SERIAL_AT91 is not set +# CONFIG_SERIAL_AT91_CONSOLE is not set +# CONFIG_SERIAL_8250 is not set +# CONFIG_SERIAL_8250_CONSOLE is not set +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_SHARE_IRQ is not set +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +# CONFIG_SERIAL_8250_MULTIPORT is not set +# CONFIG_SERIAL_8250_HUB6 is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 +# CONFIG_IXP2000_SLAVE is not set + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_IOP3XX=y +# CONFIG_I2C_CHARDEV is not set +# CONFIG_I2C_PROC is not set +CONFIG_I2C_DS1307=y +# CONFIG_PCF8549C_NVRAM is not set + +# +# L3 serial bus support +# +# CONFIG_L3 is not set +# CONFIG_L3_ALGOBIT is not set +# CONFIG_L3_BIT_SA1100_GPIO is not set + +# +# Other L3 adapters +# +# CONFIG_L3_SA1111 is not set +# CONFIG_BIT_SA1100_GPIO is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_INPUT_NS558 is not set +# CONFIG_INPUT_LIGHTNING is not set +# CONFIG_INPUT_PCIGAME is not set +# CONFIG_INPUT_CS461X is not set +# CONFIG_INPUT_EMU10K1 is not set +# CONFIG_INPUT_SERIO is not set +# CONFIG_INPUT_SERPORT is not set + +# +# Joysticks +# +# CONFIG_INPUT_ANALOG is not set +# CONFIG_INPUT_A3D is not set +# CONFIG_INPUT_ADI is not set +# CONFIG_INPUT_COBRA is not set +# CONFIG_INPUT_GF2K is not set +# CONFIG_INPUT_GRIP is not set +# CONFIG_INPUT_INTERACT is not set +# CONFIG_INPUT_TMDC is not set +# CONFIG_INPUT_SIDEWINDER is not set +# CONFIG_INPUT_IFORCE_USB is not set +# CONFIG_INPUT_IFORCE_232 is not set +# CONFIG_INPUT_WARRIOR is not set +# CONFIG_INPUT_MAGELLAN is not set +# CONFIG_INPUT_SPACEORB is not set +# CONFIG_INPUT_SPACEBALL is not set +# CONFIG_INPUT_STINGER is not set +# CONFIG_INPUT_DB9 is not set +# CONFIG_INPUT_GAMECON is not set +# CONFIG_INPUT_TURBOGRAFX is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 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 + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# Multimedia devices +# +CONFIG_VIDEO_DEV=y + +# +# Video For Linux +# +CONFIG_VIDEO_PROC_FS=y +# CONFIG_I2C_PARPORT is not set + +# +# Video Adapters +# +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_PMS is not set +# CONFIG_VIDEO_CPIA is not set +# CONFIG_VIDEO_SAA5249 is not set +# CONFIG_TUNER_3036 is not set +# CONFIG_VIDEO_STRADIS is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIDEO_ZORAN_BUZ is not set +# CONFIG_VIDEO_ZORAN_DC10 is not set +# CONFIG_VIDEO_ZORAN_LML33 is not set +# CONFIG_VIDEO_ZR36120 is not set +# CONFIG_VIDEO_MEYE is not set +# CONFIG_VIDEO_CYBERPRO is not set + +# +# Radio Adapters +# +# CONFIG_RADIO_GEMTEK_PCI is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_MAESTRO is not set +# CONFIG_RADIO_MIROPCM20 is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +CONFIG_AUTOFS_FS=y +CONFIG_AUTOFS4_FS=y +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +CONFIG_ADFS_FS=y +CONFIG_ADFS_FS_RW=y +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=y +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_ROOT_NFS=y +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +# CONFIG_NFSD_TCP is not set +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=y +# CONFIG_SMB_NLS_DEFAULT is not set +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +CONFIG_ACORN_PARTITION=y +# CONFIG_ACORN_PARTITION_EESOX is not set +# CONFIG_ACORN_PARTITION_ICS is not set +CONFIG_ACORN_PARTITION_ADFS=y +# CONFIG_ACORN_PARTITION_POWERTEC is not set +# CONFIG_ACORN_PARTITION_RISCIX is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Console drivers +# +CONFIG_PC_KEYB=y +CONFIG_PC_KEYMAP=y +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +CONFIG_FB=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_FB_RIVA=y +# CONFIG_FB_CLGEN is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_ACORN is not set +# CONFIG_FB_ANAKIN is not set +# CONFIG_FB_CLPS711X is not set +# CONFIG_FB_SA1100 is not set +# CONFIG_FB_DBMX1 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_INTEL is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_VIRTUAL is not set +CONFIG_FBCON_ADVANCED=y +# CONFIG_FBCON_MFB is not set +# CONFIG_FBCON_CFB2 is not set +# CONFIG_FBCON_CFB4 is not set +CONFIG_FBCON_CFB8=y +CONFIG_FBCON_CFB16=y +# CONFIG_FBCON_CFB24 is not set +CONFIG_FBCON_CFB32=y +# CONFIG_FBCON_AFB is not set +# CONFIG_FBCON_ILBM is not set +# CONFIG_FBCON_IPLAN2P2 is not set +# CONFIG_FBCON_IPLAN2P4 is not set +# CONFIG_FBCON_IPLAN2P8 is not set +# CONFIG_FBCON_MAC is not set +# CONFIG_FBCON_VGA_PLANES is not set +# CONFIG_FBCON_VGA is not set +# CONFIG_FBCON_HGA is not set +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set +# CONFIG_FBCON_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y + +# +# Sound +# +CONFIG_SOUND=y +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +CONFIG_SOUND_TRIDENT=y +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +# CONFIG_SOUND_OSS is not set +# CONFIG_SOUND_VIDC is not set +# CONFIG_SOUND_WAVEARTIST is not set +# CONFIG_SOUND_TVMIXER is not set + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set +# CONFIG_MCP_SA1100 is not set +# CONFIG_MCP_UCB1200 is not set +# CONFIG_MCP_UCB1200_AUDIO is not set +# CONFIG_MCP_UCB1200_TS is not set + +# +# USB support +# +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set + +# +# Miscellaneous USB options +# +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +CONFIG_USB_OHCI=y +# CONFIG_USB_OHCI_SA1111 is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_AUDIO is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_MIDI is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y + +# +# USB Human Interface Devices (HID) +# +CONFIG_USB_HID=y +CONFIG_USB_HIDINPUT=y +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set + +# +# USB Imaging devices +# +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +CONFIG_USB_SCANNER=y +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set + +# +# USB Multimedia devices +# +# CONFIG_USB_IBMCAM is not set +# CONFIG_USB_KONICAWC is not set +# CONFIG_USB_OV511 is not set +# CONFIG_USB_PWC is not set +# CONFIG_USB_SE401 is not set +# CONFIG_USB_STV680 is not set +# CONFIG_USB_VICAM is not set +# CONFIG_USB_DSBR is not set +# CONFIG_USB_DABUSB is not set + +# +# USB Network adaptors +# +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set + +# +# USB port drivers +# +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_BRLVGER is not set +# CONFIG_USB_LCD is not set + +# +# Bluetooth support +# +# CONFIG_BLUEZ is not set + +# +# Kernel hacking +# +# CONFIG_FRAME_POINTER is not set +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +# CONFIG_NO_PGT_CACHE is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SLAB is not set +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_ERRORS=y +CONFIG_DEBUG_LL=y +# CONFIG_DEBUG_DC21285_PORT is not set +# CONFIG_DEBUG_CLPS711X_UART2 is not set + +# +# Library routines +# +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/defconfig linux-arm-2.4-ds/arch/arm/defconfig --- linux-arm-2.4-ds.orig/arch/arm/defconfig 2003-05-06 08:31:37.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/defconfig 2003-10-26 17:44:15.000000000 +0000 @@ -503,7 +503,7 @@ # # Kernel hacking # -CONFIG_FRAME_POINTER=y +# CONFIG_FRAME_POINTER is not set CONFIG_DEBUG_ERRORS=y CONFIG_DEBUG_USER=y # CONFIG_DEBUG_INFO is not set diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/Makefile linux-arm-2.4-ds/arch/arm/kernel/Makefile --- linux-arm-2.4-ds.orig/arch/arm/kernel/Makefile 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/Makefile 2003-12-31 13:34:02.000000000 +0000 @@ -13,7 +13,7 @@ AFLAGS_head-armv.o := -DTEXTADDR=$(TEXTADDR) AFLAGS_head-armo.o := -DTEXTADDR=$(TEXTADDR) -# This is depreciated. +# This is deprecated. O_OBJS_arc = dma-arc.o oldlatches.o O_OBJS_rpc = dma-rpc.o O_OBJS_footbridge = dma-footbridge.o isa.o @@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_ACORN) += ecard.o fiq.o time-acorn.o obj-$(CONFIG_ARCH_CLPS7500) += time-acorn.o obj-$(CONFIG_ARCH_RISCSTATION) += time-acorn.o +#obj-$(CONFIG_ARCH_IYONIX) += ecard.o obj-$(CONFIG_DEBUG_LL) += debug-$(PROCESSOR).o obj-$(CONFIG_MODULES) += armksyms.o obj-$(CONFIG_ARTHUR) += arthur.o diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/armksyms.c linux-arm-2.4-ds/arch/arm/kernel/armksyms.c --- linux-arm-2.4-ds.orig/arch/arm/kernel/armksyms.c 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/armksyms.c 2003-10-26 17:44:15.000000000 +0000 @@ -279,3 +279,9 @@ EXPORT_SYMBOL_NOVERS(__up_wakeup); EXPORT_SYMBOL(get_wchan); + +#ifdef CONFIG_IOP321_DMA_MEMCPY +EXPORT_SYMBOL(asm_memcpy); +EXPORT_SYMBOL(iop_memcpy); +EXPORT_SYMBOL(dma_memcpy); +#endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/bios32.c linux-arm-2.4-ds/arch/arm/kernel/bios32.c --- linux-arm-2.4-ds.orig/arch/arm/kernel/bios32.c 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/bios32.c 2003-10-26 17:44:15.000000000 +0000 @@ -468,6 +468,7 @@ extern struct hw_pci ixp1200_pci; extern struct hw_pci iq80310_pci; extern struct hw_pci iq80321_pci; +extern struct hw_pci iyonix_pci; extern struct hw_pci iq31244_pci; extern struct hw_pci brh_pci; extern struct hw_pci ixdp425_pci; @@ -539,6 +540,14 @@ hw = &iq80321_pci; break; } + if(machine_is_iyonix()) { + hw = &iyonix_pci; + break; + } + if(machine_is_iq31244()) { + hw = &iq31244_pci; + break; + } if(machine_is_iq31244()) { hw = &iq31244_pci; break; diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/calls.S linux-arm-2.4-ds/arch/arm/kernel/calls.S --- linux-arm-2.4-ds.orig/arch/arm/kernel/calls.S 2003-05-06 08:31:37.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/calls.S 2003-10-26 17:44:19.000000000 +0000 @@ -253,7 +253,7 @@ .long SYMBOL_NAME(sys_ni_syscall) /* lremovexattr */ .long SYMBOL_NAME(sys_ni_syscall) /* fremovexattr */ .long SYMBOL_NAME(sys_tkill) - .long SYMBOL_NAME(sys_ni_syscall) /* sendfile64 */ + .long SYMBOL_NAME(sys_sendfile64) /* sendfile64 */ /* 240 */ .long SYMBOL_NAME(sys_ni_syscall) /* futex */ .long SYMBOL_NAME(sys_ni_syscall) /* sched_setaffinity */ .long SYMBOL_NAME(sys_ni_syscall) /* sched_getaffinity */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/debug-armv.S linux-arm-2.4-ds/arch/arm/kernel/debug-armv.S --- linux-arm-2.4-ds.orig/arch/arm/kernel/debug-armv.S 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/debug-armv.S 2003-10-03 12:59:43.000000000 +0100 @@ -466,6 +466,12 @@ orr \rx, \rx, #0x00810000 #elif defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) orr \rx, \rx, #0x00800000 +#elif defined(CONFIG_ARCH_IYONIX) + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x90000000 @ physical + movne \rx, #0xf0000000 @ virtual + orr \rx, \rx, #0x000003f8 #else #error Unknown IOP3XX implementation #endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/irq.c linux-arm-2.4-ds/arch/arm/kernel/irq.c --- linux-arm-2.4-ds.orig/arch/arm/kernel/irq.c 2003-10-03 13:50:15.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/irq.c 2003-10-03 12:59:43.000000000 +0100 @@ -217,13 +217,13 @@ desc->triggered = 1; /* - * Acknowledge and clear the IRQ, but (if its + * Acknowledge and clear the IRQ, but (if it's * a level-based IRQ, don't mask it) */ desc->mask_ack(irq); /* - * If we're currently running this IRQ, or its disabled, + * If we're currently running this IRQ, or it's disabled, * we shouldn't process the IRQ. Instead, turn on the * hardware masks. */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/kernel/xscale-time.c linux-arm-2.4-ds/arch/arm/kernel/xscale-time.c --- linux-arm-2.4-ds.orig/arch/arm/kernel/xscale-time.c 2003-05-06 08:31:38.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/kernel/xscale-time.c 2003-04-09 11:37:36.000000000 +0100 @@ -112,7 +112,7 @@ /* * Need to do this b/c going to IDLE mode on XScale causes - * the PMU to idle also, which means we loose the timer tick! + * the PMU to idle also, which means we lose the timer tick! */ disable_hlt(); diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/lib/memcpy.S linux-arm-2.4-ds/arch/arm/lib/memcpy.S --- linux-arm-2.4-ds.orig/arch/arm/lib/memcpy.S 2003-05-06 08:31:38.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/lib/memcpy.S 2003-10-26 17:44:24.000000000 +0000 @@ -29,6 +29,9 @@ * Prototype: void memcpy(void *to,const void *from,unsigned long n); * ARM3: cant use memcopy here!!! */ +#ifdef CONFIG_IOP321_DMA_MEMCPY +ENTRY(asm_memcpy) +#endif ENTRY(memcpy) ENTRY(memmove) ENTER diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/Makefile linux-arm-2.4-ds/arch/arm/mach-iop3xx/Makefile --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/Makefile 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/Makefile 2003-10-26 17:44:25.000000000 +0000 @@ -28,6 +28,7 @@ obj-$(CONFIG_ARCH_IQ80321) += iq80321-pci.o +obj-$(CONFIG_ARCH_IYONIX) += iyonix-pci.o obj-$(CONFIG_ARCH_IQ31244) += iq31244-pci.o ifeq ($(CONFIG_ARCH_IQ80310),y) @@ -37,7 +38,8 @@ endif obj-$(CONFIG_IOP3XX_AAU) += aau.o -obj-$(CONFIG_IOP3XX_DMA) += dma.o +#obj-$(CONFIG_IOP3XX_DMA) += dma.o +obj-$(CONFIG_IOP321_DMA) += iop321-dma.o obj-$(CONFIG_IOP3XX_MU) += message.o obj-$(CONFIG_IOP3XX_PMON) += pmon.o diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/arch.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/arch.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/arch.c 2003-10-03 13:50:16.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/arch.c 2003-10-03 12:59:43.000000000 +0100 @@ -33,6 +33,11 @@ extern void iop321_init_irq(void); #endif +#ifdef CONFIG_ARCH_IYONIX +extern void iyonix_map_io(void); +extern void iop321_init_irq(void); +#endif + #ifdef CONFIG_ARCH_IQ80310 MACHINE_START(IQ80310, "Cyclone IQ80310") MAINTAINER("MontaVista Software Inc.") @@ -62,3 +67,14 @@ INITIRQ(iop321_init_irq) MACHINE_END #endif + +#ifdef CONFIG_ARCH_IYONIX +MACHINE_START(IYONIX, "Iyonix") + MAINTAINER("Peter Naulls") + BOOT_MEM(0xc0000000, 0x90000000, 0xf0000000) + BOOT_PARAMS(0xc0000100) + MAPIO(iyonix_map_io) + INITIRQ(iop321_init_irq) +MACHINE_END +#endif + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-dma.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-dma.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-dma.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-dma.c 2003-10-26 17:44:24.000000000 +0000 @@ -0,0 +1,1257 @@ +/************************************************************************** + * + * arch/arm/mach-iop3xx/iop321-dma.c + * + * Support functions for the Intel 80321 DMA channels. + * + * Authors: Dave Jiang (dave.jiang@intel.com) + * Carl Staelin (staelin@hpli69.hpli.hpl.hp.com) + * Deepak Saxena + * David A. Griego (david.a.griego@intel.com) + * + * Copyright (C) 2003 MontaVista Software, Inc. + * Copyright (C) 2003 Intel Corporation + * Copyright (C) 2003 Hewlett Packard + * + * 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. + * + * + * + * History: (02/13/2003, DJ) Initial Creation + * (02/27/2003, DJ) Integrated Carl's DMA code + * (04/17/2003, DJ) Kernel memcpy seems to be working now + * Reiserfs seems to act funny, ext2/3 works + * fine + * (04/17/2003, DS) Major cleanup, full testing of boundary cases + * (04/18/2003, DS) Added support for user PCI mappings + * (06/04/2003, DJ) Merged in fixes from Deepak + * + *************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * pick up local definitions + */ +#include +#include "iop321-dma.h" + +#ifndef EXPORT_SYMTAB +#define EXPORT_SYMTAB +#include +#endif + +#undef DEBUG +//#define DEBUG +#ifdef DEBUG + #define DPRINTK(s, args...) printk("321_DMA: " s, ## args) +#else + #define DPRINTK(s, args...) +#endif + +/* globals */ +iop321_dma_t dma_chan[2]; /* DMA channels */ +int iop_memcpy = 0; + +/* static prototypes */ +static int iop321_dma_chaininit(iop321_dma_t * dma); +static void iop321_dma_isr(int, void *, struct pt_regs *); +ssize_t iop321_dma_cpy(void *src, int size, void *dest, int wait); + +static struct proc_dir_entry *dma_proc_entry; +static int dma_hit, dma_miss, align_src, align_dst, align_len; + +static int dma_read_proc(char *, char **, off_t, int, int *, void *); + +static int dma_read_proc(char *buf, char **start, off_t offset, int len, + int *eof, void *data) +{ + len = 0; + + len += sprintf(buf + len, "Number of DMA Hits: %d\n", dma_hit); + len += sprintf(buf + len, "Number of DMA Misses: %d\n", dma_miss); + len += sprintf(buf + len, " UnAligned Source: %d\n", align_src); + len += sprintf(buf + len, " UnAligned Dst: %d\n", align_dst); + len += sprintf(buf + len, " UnAligned Len: %d\n", align_len); + + return len; +} + + +static inline u32 page_offset(u32 virt) +{ + return virt & (PAGE_SIZE - 1); +} + +static inline u32 page_remainder(u32 virt) +{ + return PAGE_SIZE - page_offset(virt); +} + +static inline u32 page_base(u32 virt) +{ + return(virt & ~(PAGE_SIZE - 1)); +} + +static inline int is_user(u32 virt) +{ + return(virt < PAGE_OFFSET); +} + +static inline int is_kernel_static(u32 virt) +{ + return((virt >= PAGE_OFFSET) && (virt < (unsigned long)high_memory)); +} + +static inline int is_kernel_vmalloc(u32 virt) +{ + return(virt >= VMALLOC_START && virt <= VMALLOC_END); +} + +/* + * map a kernel virtual address or kernel logical address to a phys address + */ +static inline u32 physical_address(u32 virt) +{ + pgd_t *pgdp; + pmd_t *pmdp; + pte_t *ptep; + + /* kernel static-mapped address */ + if(is_kernel_static(virt)) + return __pa((u32) virt); + + /* non-vmalloc so walk page tables */ + if(is_user(virt)) + { + pgdp = pgd_offset(current->mm, virt); + } + else + { + pgdp = pgd_offset_k(virt); + } + if(pgd_none(*pgdp) || pgd_bad(*pgdp)) + return 0; + + /* get pointer to page middle directory */ + pmdp = pmd_offset(pgdp, virt); + if(pmd_none(*pmdp) || pmd_bad(*pmdp)) + return 0; + + /* get the PTE pointer */ + ptep = pte_offset(pmdp, virt); + if(!ptep) + return 0; + + return(page_base(pte_val(*ptep)) | + page_offset(virt & (PAGE_SIZE - 1))); +} + +static void iop321_dma_isr(int irq, void *dev_id, struct pt_regs *regs) +{ + iop321_dma_t *dma = (iop321_dma_t *) dev_id; + u32 csr = 0; + sw_dma_t *sw_desc = NULL; + + csr = *(dma->regs.CSR); + // I'm only handling DMA channel 0 interrupts + if(!(csr & (DMA_CSR_DONE_MASK | DMA_CSR_ERR_MASK))) + { + return; + } + // Does not support more than DMA chaining of multiple processes yet */ + spin_lock(&dma->process_lock); + sw_desc = list_entry(dma->process_q.next, sw_dma_t, link); + sw_desc->status = csr; + sw_desc->complete = 1; + spin_unlock(&dma->process_lock); + + wake_up_interruptible(&dma->wait); + + // clear interrupts + *(dma->regs.CSR) |= csr; +} + +int iop321_dma_init(void) +{ + int i; + int ctr; + sw_dma_t *sw_desc = NULL; + void *desc = NULL; + int err = 0; + + printk(KERN_INFO + "Intel 80321 DMA Copyright(c) 2003 Intel Corporation\n"); + DPRINTK("Initializing...\n"); + + for(ctr = 0; ctr < MAX_IOP321_DMA_CHANNEL; ctr++) + { + /* init free stack */ + INIT_LIST_HEAD(&dma_chan[ctr].free_q); + INIT_LIST_HEAD(&dma_chan[ctr].process_q); + /* init free stack spinlock */ + spin_lock_init(&dma_chan[ctr].free_lock); + spin_lock_init(&dma_chan[ctr].process_lock); + spin_lock_init(&dma_chan[ctr].chan_lock); + sema_init(&dma_chan[ctr].chan_sem, 1); + + init_waitqueue_head(&dma_chan[ctr].wait); + /* pre-alloc DMA descriptors */ + for(i = 0; i < MAX_DMA_DESC; i++) + { + /* + * we keep track of original address before alignment + * adjust so we can free it later + */ + sw_desc = kmalloc(sizeof (sw_dma_t), GFP_KERNEL); + sw_desc->dma_virt = desc = + kmalloc((sizeof (dma_desc_t) + 0x20), GFP_KERNEL); + memset(desc, 0, sizeof (dma_desc_t) + 0x20); + + /* + * hardware descriptors must be aligned on an + * 8-word boundary + */ + desc = + (dma_desc_t *) (((u32) desc & 0xffffffe0) + 0x20); + // get the physical address + sw_desc->dma_phys = (u32) virt_to_phys(desc); + // remap it to non-cached + sw_desc->dma_desc = + (dma_desc_t *) ioremap(sw_desc->dma_phys, + sizeof (dma_desc_t)); + + /* put the descriptors on the free stack */ + spin_lock_irq(&dma_chan[ctr].free_lock); + list_add(&sw_desc->link, &dma_chan[ctr].free_q); + spin_unlock_irq(&dma_chan[ctr].free_lock); + } + + } + // setting DMA channel 0 + dma_chan[0].regs.CCR = IOP321_DMA0_CCR; + dma_chan[0].regs.CSR = IOP321_DMA0_CSR; + dma_chan[0].regs.DAR = IOP321_DMA0_DAR; + dma_chan[0].regs.NDAR = IOP321_DMA0_NDAR; + dma_chan[0].regs.PADR = IOP321_DMA0_PADR; + dma_chan[0].regs.PUADR = IOP321_DMA0_PUADR; + dma_chan[0].regs.LADR = IOP321_DMA0_LADR; + dma_chan[0].regs.BCR = IOP321_DMA0_BCR; + dma_chan[0].regs.DCR = IOP321_DMA0_DCR; + + /* set the IRQ */ + dma_chan[0].irq.EOT = IRQ_IOP321_DMA0_EOT; + dma_chan[0].irq.EOC = IRQ_IOP321_DMA0_EOC; + dma_chan[0].irq.ERR = IRQ_IOP321_DMA0_ERR; + + // setting DMA channel 1 + dma_chan[1].regs.CCR = IOP321_DMA1_CCR; + dma_chan[1].regs.CSR = IOP321_DMA1_CSR; + dma_chan[1].regs.DAR = IOP321_DMA1_DAR; + dma_chan[1].regs.NDAR = IOP321_DMA1_NDAR; + dma_chan[1].regs.PADR = IOP321_DMA1_PADR; + dma_chan[1].regs.PUADR = IOP321_DMA1_PUADR; + dma_chan[1].regs.LADR = IOP321_DMA1_LADR; + dma_chan[1].regs.BCR = IOP321_DMA1_BCR; + dma_chan[1].regs.DCR = IOP321_DMA1_DCR; + + /* set the IRQ */ + dma_chan[1].irq.EOT = IRQ_IOP321_DMA1_EOT; + dma_chan[1].irq.EOC = IRQ_IOP321_DMA1_EOC; + dma_chan[1].irq.ERR = IRQ_IOP321_DMA1_ERR; + + for(ctr = 0; ctr < MAX_IOP321_DMA_CHANNEL; ctr++) + { + + /* clear DMA channel control register */ + + *(dma_chan[ctr].regs.CCR) = DMA_CCR_CLEAR; + *(dma_chan[ctr].regs.CSR) |= + (DMA_CSR_DONE_MASK | DMA_CSR_ERR_MASK); + *(dma_chan[ctr].regs.NDAR) = 0; + + err = + request_irq(dma_chan[ctr].irq.EOT, iop321_dma_isr, + SA_INTERRUPT, dma_chan[ctr].device_id, + (void *) &dma_chan[ctr]); + if(err < 0) + { + printk(KERN_ERR "%s: unable to request IRQ %d for " + "DMA channel %d: %d\n", dma_chan[ctr].device_id, + dma_chan[ctr].irq.EOT, 0, err); + return -EBUSY; + } + + err = + request_irq(dma_chan[ctr].irq.EOC, iop321_dma_isr, + SA_INTERRUPT, dma_chan[ctr].device_id, + (void *) &dma_chan[ctr]); + if(err < 0) + { + printk(KERN_ERR "%s: unable to request IRQ %d for " + "DMA channel %d: %d\n", dma_chan[ctr].device_id, + dma_chan[ctr].irq.EOC, 0, err); + return -EBUSY; + } + + err = + request_irq(dma_chan[ctr].irq.ERR, iop321_dma_isr, + SA_INTERRUPT, dma_chan[ctr].device_id, + (void *) &dma_chan[ctr]); + if(err < 0) + { + printk(KERN_ERR "%s: unable to request IRQ %d for " + "DMA channel %d: %d\n", dma_chan[ctr].device_id, + dma_chan[ctr].irq.ERR, 0, err); + return -EBUSY; + } + + err = iop321_dma_chaininit(&dma_chan[ctr]); + if(err < 0) + { + printk(KERN_ERR "unable to setup chaining\n"); + return -EIO; + } + } + +#ifdef CONFIG_PROC_FS + dma_proc_entry = create_proc_entry("dma_copy", S_IFREG | S_IRUGO, 0); + dma_proc_entry->read_proc = dma_read_proc; + dma_proc_entry->write_proc = NULL; + dma_proc_entry->nlink = 1; +#endif + + iop_memcpy = 1; + DPRINTK("DMA init Done!\n"); + + return 0; +} /* end of iop321_dma_init() */ + +void iop321_dma_exit(void) +{ + sw_dma_t *sw_desc = NULL; + int ctr; + + for(ctr = 0; ctr < MAX_IOP321_DMA_CHANNEL; ctr++) + { + + while(!list_empty(&dma_chan[ctr].free_q)) + { + sw_desc = + list_entry(dma_chan[ctr].free_q.next, sw_dma_t, + link); + list_del(&sw_desc->link); + iounmap(sw_desc->dma_desc); + kfree(sw_desc->dma_virt); + kfree((void *) sw_desc); + } + + while(!list_empty(&dma_chan[ctr].process_q)) + { + sw_desc = + list_entry(dma_chan[ctr].process_q.next, sw_dma_t, + link); + list_del(&sw_desc->link); + iounmap(sw_desc->dma_desc); + kfree(sw_desc->dma_virt); + kfree((void *) sw_desc); + } + + // get rid of the last dangle descriptor + sw_desc = dma_chan[ctr].last_desc; + iounmap(sw_desc->dma_desc); + kfree(sw_desc->dma_virt); + kfree((void *) sw_desc); + + free_irq(dma_chan[ctr].irq.EOC, (void *) &dma_chan[ctr]); + free_irq(dma_chan[ctr].irq.EOT, (void *) &dma_chan[ctr]); + free_irq(dma_chan[ctr].irq.ERR, (void *) &dma_chan[ctr]); + } +} + +static int iop321_dma_chaininit(iop321_dma_t * dma) +{ + int flags = 0; + sw_dma_t *sw_desc = NULL; + u32 csr = 0; + + if(down_interruptible(&dma->chan_sem)) + { + return 0; + } + + spin_lock_irqsave(&dma->free_lock, flags); + + if(!list_empty(&dma->free_q)) + { + sw_desc = list_entry(dma->free_q.next, sw_dma_t, link); + list_del(&sw_desc->link); + } + else + { + // This should NEVER happen. We need to increase the amount + // of descriptors if that is the case + // XXX TODO: put in something nice later to handle this! + spin_unlock_irqrestore(&dma->free_lock, flags); + + //spin_unlock_irqrestore(&dma->chan_lock, cflags); + up(&dma->chan_sem); + DPRINTK(KERN_ERR "out of DMA descriptors! Increase!\n"); + BUG(); + return -ENOMEM; + } + spin_unlock_irqrestore(&dma->free_lock, flags); + + DPRINTK("soft DMA desc acquired"); + + // Setting byte count to 0 doesn't do anything except loading the + // descriptor + sw_desc->dma_desc->BC = 0; + sw_desc->dma_desc->DC = DMA_DCR_MTM; + sw_desc->dma_desc->NDAR = 0; + sw_desc->next = NULL; + + spin_lock_irqsave(&dma->process_lock, flags); + list_add(&sw_desc->link, &dma->process_q); + spin_unlock_irqrestore(&dma->process_lock, flags); + + // Do DMA stuff + *(dma->regs.CSR) |= (DMA_CSR_DONE_MASK | DMA_CSR_ERR_MASK); + *(dma->regs.NDAR) = sw_desc->dma_phys; + *(dma->regs.CCR) = DMA_CCR_CHANNEL_ENABLE; + + DPRINTK("we are polling"); + csr = *(dma->regs.CSR); + while(csr & DMA_CSR_CH_ACTIVE) + { + csr = *(dma->regs.CSR); + } + + DPRINTK("removing from processing queue"); + spin_lock_irqsave(&dma->process_lock, flags); + list_del(&sw_desc->link); + spin_unlock_irqrestore(&dma->process_lock, flags); + + // check to see if DMA failed + if(!(csr & DMA_CSR_ERR_MASK)) + { + dma->last_desc = sw_desc; + } + else + { + dma->last_desc = NULL; + sw_desc->status = 0; + sw_desc->complete = 0; + spin_lock_irqsave(&dma->free_lock, flags); + list_add_tail(&sw_desc->link, &dma->free_q); + spin_unlock_irqrestore(&dma->free_lock, flags); + + up(&dma->chan_sem); + return -EIO; + } + + DPRINTK("releasing sem"); + // spin_unlock_irqrestore(&dma->chan_lock, cflags); + up(&dma->chan_sem); + return 0; +} /* end of iop321_dma_chaininit() */ + +/*=======================================================================*/ +/* Procedure: dma_memcpy() */ +/* */ +/* Description: DMA-based in-kernel memcpy. */ +/* */ +/* Parameters: to: destination address */ +/* from: source address */ +/* n: number of bytes to transfer */ +/* */ +/* Returns: void*: to */ +/* */ +/* Notes/Assumptions: */ +/* Assumes that kernel physical memory is contiguous, i.e., */ +/* the physical addresses of contiguous virtual addresses */ +/* are also contiguous. */ +/* Assumes that kernel memory doesn't get paged. */ +/* Needs to be able to handle overlapping regions */ +/* correctly. */ +/* */ +/* History: Carl Staelin 1/27/03 Initial Creation */ +/* Dave Jiang 2/22/03 Attempted to DMA chaining */ +/*=======================================================================*/ +void * dma_memcpy(void *to, const void *from, __kernel_size_t n) +{ + iop321_dma_t *dma; + sw_dma_t *sw_desc = NULL; + int cflags = 0; + u32 csr = 0; + u32 unaligned_to, unaligned_from; + void *orig_to = to; + u32 to_pa, from_pa; + + DPRINTK("dma_memcpy(0x%x, 0x%x, %lu): entering\n", (u32) to, (u32) from, + (unsigned long) n); + + if(!(is_kernel_static((u32) to) && is_kernel_static((u32) from))) + { + DPRINTK("dma_memcpy(0x%x, 0x%x, %lu): falling back to memcpy\n", + (u32) to, (u32) from, (unsigned long) n); + return asm_memcpy(to, from, n); + } + + /* + * We can only handled completely cache-aligned transactions + * with the DMA engine. Source and Dst must be cache-line + * aligned AND the length must be a multiple of the cache-line. + */ + + to_pa = physical_address((u32) to); + from_pa = physical_address((u32) from); + + if(((to_pa + n > from_pa) && (to_pa < from_pa)) || + ((from_pa < to_pa) && (from_pa + n > to_pa))) + { + DPRINTK + ("overlapping copy region (0x%x, 0x%x, %lu), falling back\n", + to_pa, from_pa, (unsigned long) n); + return asm_memcpy(to, from, n); + } + /* + * Ok, start addr is not cache line-aligned, so we need to make it so. + */ + unaligned_to = (u32) to & 31; + unaligned_from = (u32) from & 31;; + if(unaligned_to | unaligned_from) + { + if(unaligned_from > unaligned_to) + { + asm_memcpy(to, from, 32 - unaligned_to); + (u32) to += 32 - unaligned_to; + (u32) from += 32 - unaligned_to; + n -= 32 - unaligned_to; + } + else + { + asm_memcpy(to, from, 32 - unaligned_from); + (u32) to += 32 - unaligned_from; + (u32) from += 32 - unaligned_from; + n -= 32 - unaligned_from; + } + } + + /* + * Ok, we're aligned at the top, now let's check the end + * of the buffer and align that. After this we should have + * a block that is a multiple of cache line size. + */ + unaligned_to = ((u32) to + n) & 31; + unaligned_from = ((u32) from + n) & 31;; + if(unaligned_to | unaligned_from) + { + if(unaligned_to > unaligned_from) + { + u32 tmp_to = (u32) to + n - unaligned_to; + u32 tmp_from = (u32) from + n - unaligned_to; + + asm_memcpy((void *) tmp_to, (void *) tmp_from, + unaligned_to); + + n -= unaligned_to; + } + else + { + u32 tmp_to = (u32) to + n - unaligned_from; + u32 tmp_from = (u32) from + n - unaligned_from; + + asm_memcpy((void *) tmp_to, (void *) tmp_from, + unaligned_from); + + n -= unaligned_from; + } + } + + /* + * OK! We should now be fully aligned on both ends. + */ + dma = &dma_chan[0]; + if(spin_is_locked(&dma->chan_lock)) + { + dma = &dma_chan[1]; + } + + spin_lock_irqsave(&dma->chan_lock, cflags); + + if(!list_empty(&dma->free_q)) + { + sw_desc = list_entry(dma->free_q.next, sw_dma_t, link); + list_del(&sw_desc->link); + } + else + { + // This should NEVER happen. We need to increase the amount + // of descriptors if that is the case + // XXX TODO: put in something nice later to handle this! + + spin_unlock_irqrestore(&dma->chan_lock, cflags); + DPRINTK(KERN_ERR "out of DMA descriptors! Increase!\n"); + return asm_memcpy(to, from, n); + } + + /* Ensure that the cache is clean */ + cpu_dcache_clean_range((unsigned long) from, (unsigned long) from + n); + cpu_dcache_invalidate_range((unsigned long) to, (unsigned long) to + n); + + sw_desc->dma_desc->LADR = physical_address((u32) to); + sw_desc->dma_desc->PADR = physical_address((u32) from); + sw_desc->dma_desc->PUADR = 0; + sw_desc->buf_size = sw_desc->dma_desc->BC = n; + sw_desc->dma_desc->DC = DMA_DCR_MTM; + + // Set last NDAR to NULL + sw_desc->next = NULL; + sw_desc->dma_desc->NDAR = 0; + + dma->last_desc->dma_desc->NDAR = sw_desc->dma_phys; + *(dma->regs.CCR) = DMA_CCR_CHANNEL_ENABLE | DMA_CCR_CHAIN_RESUME; + + csr = *(dma->regs.CSR); + while(csr & DMA_CSR_CH_ACTIVE) + { + udelay(1); + csr = *(dma->regs.CSR); + } + + // put the last in the free queue + dma->last_desc->status = 0; + dma->last_desc->complete = 0; + dma->last_desc->next = 0; + list_add_tail(&dma->last_desc->link, &dma->free_q); + + // hookup the new last descriptor for chaining + sw_desc->status = 0; + sw_desc->complete = 0; + dma->last_desc = sw_desc; + + // check to see if DMA failed + if(csr & DMA_CSR_ERR_MASK) + { + *(dma->regs.CSR) |= (DMA_CSR_DONE_MASK | DMA_CSR_ERR_MASK); + spin_unlock_irqrestore(&dma->chan_lock, cflags); + printk(KERN_ERR "%s: DMA engine error\n", __func__); + BUG(); + } + + spin_unlock_irqrestore(&dma->chan_lock, cflags); + dma_hit++; + + return orig_to; +} + +/*=======================================================================*/ +/* Procedure: dma_copy_to_user() */ +/* */ +/* Description: DMA-based copy_to_user. */ +/* */ +/* Parameters: to: destination address */ +/* from: source address */ +/* n: number of bytes to transfer */ +/* */ +/* Returns: unsigned long: number of bytes NOT copied */ +/* */ +/* Notes/Assumptions: */ +/* Assumes that kernel physical memory is contiguous, i.e., */ +/* the physical addresses of contiguous virtual addresses */ +/* are also contiguous. */ +/* Assumes that kernel memory doesn't get paged. */ +/* Assumes that to/from memory regions cannot overlap */ +/* */ +/* History: Carl Staelin 1/27/03 Initial Creation */ +/* Dave Jiang 2/22/03 Attemped to DMA chaining */ +/* (data corrupt with full chain) */ +/* back to Carl's way for now */ +/*=======================================================================*/ +unsigned long dma_copy_to_user(void *to, const void *from, unsigned long n) +{ + u32 chunk; + u32 from_chunk; + u32 to_chunk; + u32 to_pa = 0; + iop321_dma_t *dma; + sw_dma_t *sw_desc = NULL; + int cflags = 0; + u32 csr = 0; + u32 unaligned_to, unaligned_from; + void *u, *k; + + DPRINTK("dma_copy_to_user(%#10x, 0x%#10x, %lu): entering\n", (u32) to, + (u32) from, n); +#if 1 + if(((u32)to > PAGE_OFFSET) && ((u32)from > PAGE_OFFSET)) + { + DPRINTK("dma_copy_to_user(0x%x, 0x%x, %lu): kernel memcpy\n", + (u32) to, (u32) from, (unsigned long) n); + memcpy(to, from, n); + return 0; + } +#endif + + to_pa = physical_address((u32) to); + DPRINTK(" physaddr(to) = %#010x\n", to_pa); + + /* + * We _only_ support mem -> mem and mem -> pci copies + */ + if(to_pa < PHYS_OFFSET && + ((to_pa < IOP321_PCI_LOWER_MEM) || (to_pa > IOP321_PCI_UPPER_MEM))) + { + return __arch_copy_to_user(to, from, n); + } + + /* + * Walk the address range forcing page faults. We must do writes + * instead of reads in case we have COW pages and need to get + * them re-mapped to a new address range. + */ + for(u = to, k = from ; u < to + n; u += PAGE_SIZE, k += PAGE_SIZE) + put_user(*(char *)k, (char *)u); + + /* lock page tables */ + spin_lock_irqsave(¤t->mm->page_table_lock, cflags); + + /* + * Ok, start addr is not cache line-aligned, so we need to make it so. + */ + unaligned_to = (u32)to & 31; + unaligned_from = (u32)from & 31;; + if(unaligned_to | unaligned_from) + { + DPRINTK("Fixing up starting address\n"); + if(unaligned_from > unaligned_to) + { + DPRINTK("unaligned_from larger, copying %d bytes\n", + 32 - unaligned_to); + __arch_copy_to_user(to, from, 32 - unaligned_to); + (u32)to += (32 - unaligned_to); + (u32)from += (32 - unaligned_to); + n -= (32 - unaligned_to); + } + else + { + DPRINTK("unaligned_to larger, copying %d bytes\n", + 32 - unaligned_from); + __arch_copy_to_user(to, from, 32 - unaligned_from); + (u32)to += (32 - unaligned_from); + (u32)from += (32 - unaligned_from); + n -= (32 - unaligned_from); + } + } + + /* + * Ok, we're aligned at the top, now let's check the end + * of the buffer and align that. After this we should have + * a block that is a multiple of cache line size. + */ + unaligned_to = ((u32)to + n) & 31; + unaligned_from = ((u32)from + n) & 31;; + if(unaligned_to | unaligned_from) + { + DPRINTK("Fixing ending alignment\n"); + if(unaligned_to > unaligned_from) + { + u32 tmp_to = (u32)to + (n - unaligned_to); + u32 tmp_from = (u32)from + (n - unaligned_to); + + DPRINTK("unaligned_to: Copying %d bytes\n", + unaligned_to); + + __arch_copy_to_user((void *)tmp_to, (void *)tmp_from, unaligned_to); + + n -= unaligned_to; + } + else + { + u32 tmp_to = (u32)to + (n - unaligned_from); + u32 tmp_from = (u32)from + (n - unaligned_from); + + DPRINTK("unaligned_from: Copying %d bytes\n", + unaligned_from); + + __arch_copy_to_user((void *) tmp_to, (void *) tmp_from, + unaligned_from); + + n -= unaligned_from; + } + } + + /* + * OK! We should now be fully aligned on both ends. + */ + DPRINTK("Done fixup...to: %#010x from: %#010x len: %d\n", to, from, n); + dma = &dma_chan[0]; + down_interruptible(&dma->chan_sem); + + // TODO: !THIS DOES NOT MAP THE PAGES IN! + + from_chunk = 0; + to_chunk = 0; + + DPRINTK("USING DMA: %#010x, %#010x, %d\n", to, from, n); + + while(n > 0) + { + if(from_chunk == 0) + { + /* kernel logical address ==> contiguous */ + if(is_kernel_static((u32)from)) + { + from_chunk = n; + } + else + { + /* virtual address */ + from_chunk = page_remainder((u32)from); + } + } + + if(to_chunk == 0) + { + to_chunk = page_remainder((u32)to); + to_pa = physical_address(page_base((u32)to)); + + /* + * This should NOT happen... + */ + if(!to_pa) + { + DPRINTK + ("dma_copy_to_user: no physical address for 0x%x, falling back! **** \n", + (u32) to); + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + return __arch_copy_to_user(to, from, n); + } + } + chunk = ((to_chunk < from_chunk) ? to_chunk : from_chunk); + if(n < chunk) + { + chunk = n; + } + + if(chunk == 0) + { + break; + } + + /* + * Ensure that the cache is clean: + * - from range must be cleaned + * - to range must be invalidated + */ + cpu_dcache_clean_range((u32)from, (u32)from + chunk); + cpu_dcache_invalidate_range((u32)to, (u32)to + chunk); + + /* + * TODO: Since we don't chain or anything fancy, we're + * don't need the overhead of the list. Just write directly + * to the register and then wait on the interrupt. + */ + if(!list_empty(&dma->free_q)) + { + sw_desc = list_entry(dma->free_q.next, sw_dma_t, link); + list_del(&sw_desc->link); + } + else + { + // This should NEVER happen. We need to increase the amount + // of descriptors if that is the case + // XXX TODO: put in something nice later to handle this! + + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + DPRINTK(KERN_ERR "out of DMA descriptors! Increase!\n"); + BUG(); + return n; + } + + // to_pa = physical_address(to); + + /* + * Is this a mem -> mem or mem -> PCI copy? + */ + sw_desc->virt_src = from; + sw_desc->virt_dest = NULL; /* don't have it */ + sw_desc->dma_desc->PUADR = 0; + sw_desc->dma_desc->NDAR = 0; + + if(to_pa >= PHYS_OFFSET) + { + DPRINTK(" Mem->Mem\n"); + sw_desc->dma_desc->LADR = sw_desc->phys_dest = + to_pa + page_offset((u32)to); + sw_desc->dma_desc->PADR = sw_desc->phys_src = + physical_address((u32)from); + sw_desc->buf_size = sw_desc->dma_desc->BC = chunk; + sw_desc->dma_desc->DC = DMA_DCR_MTM; + } + else + { + DPRINTK(" Mem->PCI\n"); + sw_desc->dma_desc->PADR = sw_desc->phys_dest = + to_pa + page_offset((u32)to); + sw_desc->dma_desc->LADR = sw_desc->phys_src = + physical_address((u32)from); + sw_desc->buf_size = sw_desc->dma_desc->BC = chunk; + sw_desc->dma_desc->DC = DMA_DCR_PCI_MWI; + } + + // Set last NDAR to NULL + sw_desc->next = NULL; + + dma->last_desc->dma_desc->NDAR = sw_desc->dma_phys; + *(dma->regs.CCR) = DMA_CCR_CHANNEL_ENABLE | DMA_CCR_CHAIN_RESUME; + + // do some work while waiting + from += chunk; + to += chunk; + n -= chunk; + to_chunk -= chunk; + from_chunk -= chunk; + + // busy wait on channel until done + csr = *(dma->regs.CSR); + while(csr & DMA_CSR_CH_ACTIVE) + { + udelay(1); + csr = *(dma->regs.CSR); + } + + // put the last in the free queue + dma->last_desc->status = 0; + dma->last_desc->complete = 0; + dma->last_desc->next = 0; + list_add_tail(&dma->last_desc->link, &dma->free_q); + + // hookup the new last descriptor for chaining + sw_desc->status = 0; + sw_desc->complete = 0; + dma->last_desc = sw_desc; + + // check to see if DMA failed...if so, we die + // since something is VERY wrong. + if(csr & DMA_CSR_ERR_MASK) + { + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + BUG(); + } + } + + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + dma_hit++; + + DPRINTK("dma_copy_to_user(0x%x, 0x%x, %lu): exiting\n", (u32) to, + (u32) from, n); + return n; +} + +/*=======================================================================*/ +/* Procedure: dma_copy_from_user() */ +/* */ +/* Description: DMA-based copy_from_user. */ +/* */ +/* Parameters: to: destination address */ +/* from: source address */ +/* n: number of bytes to transfer */ +/* */ +/* Returns: unsigned long: number of bytes NOT copied */ +/* */ +/* Notes/Assumptions: */ +/* Assumes that kernel virtual memory is contiguous, i.e., */ +/* the physical addresses of contiguous virtual addresses */ +/* are also contiguous. */ +/* Assumes that kernel memory doesn't get paged. */ +/* Assumes that to/from memory regions cannot overlap */ +/* XXX this one doesn't quite work right yet */ +/* */ +/* History: Carl Staelin 1/27/03 Initial Creation */ +/* Dave Jiang 2/22/03 Attempted to DMA chaining */ +/*=======================================================================*/ +unsigned long dma_copy_from_user(void *to, const void *from, unsigned long n) +{ + u32 chunk; + u32 from_chunk; + u32 from_pa = 0; + u32 to_chunk; + iop321_dma_t *dma; + sw_dma_t *sw_desc = NULL; + u32 csr = 0; + int cflags = 0; + u32 unaligned_to, unaligned_from; + void *u; + volatile char f; + + DPRINTK("dma_copy_from_user(0x%x, 0x%x, %lu): entering\n", (u32) to, + (u32) from, n); +#if 1 + if(((u32)to > PAGE_OFFSET) && ((u32)from > PAGE_OFFSET)) + { + DPRINTK("dma_copy_from_user(0x%x, 0x%x, %lu): kernel memcpy\n", + (u32) to, (u32) from, (unsigned long) n); + memcpy(to, from, n); + return 0; + } +#endif + from_pa = physical_address((u32) to); + DPRINTK(" physaddr(from) = %#010x\n", from_pa); + + /* + * We _only_ support mem -> mem and mem -> pci copies + */ + if((from_pa < PHYS_OFFSET) && ((from_pa < IOP321_PCI_LOWER_MEM) + || (from_pa > IOP321_PCI_UPPER_MEM))) + { + return __arch_copy_from_user(to, from, n); + } + + for(u = from; (u32)u < (u32)from + n; u += PAGE_SIZE) + get_user(f, (char *)u); + + /* Lock page table */ + spin_lock_irqsave(¤t->mm->page_table_lock, cflags); + + /* + * Ok, start addr is not cache line-aligned, so we need to make it so. + */ + unaligned_to = (u32)to & 31; + unaligned_from = (u32)from & 31;; + if(unaligned_to | unaligned_from) + { + if(unaligned_from > unaligned_to) + { + __arch_copy_from_user(to, from, 32 - unaligned_to); + (u32) to += 32 - unaligned_to; + (u32) from += 32 - unaligned_to; + n -= 32 - unaligned_to; + } + else + { + __arch_copy_from_user(to, from, 32 - unaligned_from); + (u32)to += 32 - unaligned_from; + (u32)from += 32 - unaligned_from; + n -= 32 - unaligned_from; + } + } + + /* + * Ok, we're aligned at the top, now let's check the end + * of the buffer and align that. After this we should have + * a block that is a multiple of cache line size. + */ + unaligned_to = ((u32) to + n) & 31; + unaligned_from = ((u32) from + n) & 31;; + if(unaligned_to | unaligned_from) + { + if(unaligned_to > unaligned_from) + { + u32 tmp_to = (u32)to + (n - unaligned_to); + u32 tmp_from = (u32)from + (n - unaligned_to); + + __arch_copy_from_user((void *)tmp_to, (void *)tmp_from, + unaligned_to); + + n -= unaligned_to; + } + else + { + u32 tmp_to = (u32) to + n - unaligned_from; + u32 tmp_from = (u32) from + n - unaligned_from; + + __arch_copy_from_user((void *) tmp_to, (void *) tmp_from, + unaligned_from); + + n -= unaligned_from; + } + } + + /* + * OK! We should now be fully aligned on both ends. + */ + + dma = &dma_chan[1]; + down_interruptible(&dma->chan_sem); + + from_chunk = 0; + to_chunk = 0; + + while(n > 0) + { + if(from_chunk == 0) + { + from_chunk = page_remainder((u32) from); + from_pa = physical_address(page_base((u32) from)); + if(!from_pa) + { + DPRINTK("dma_copy_from_user: no physical address for 0x%x," + " falling back! **** \n", (u32) from); + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + return __arch_copy_from_user(to, from, n); + } + } + + if(to_chunk == 0) + { + /* kernel logical address ==> contiguous */ + if(is_kernel_static((u32) to)) + { + to_chunk = n; + } + else + { + /* kernel virtual address */ + to_chunk = page_remainder((u32) to); + } + } + + chunk = ((to_chunk < from_chunk) ? to_chunk : from_chunk); + if(n < chunk) + { + chunk = n; + } + if(chunk == 0) + { + break; + } + + /* + * Ensure that the cache is clean: + * - from range is cleaned in map_user_kiobuf() + * - to range must be invalidated + */ + cpu_dcache_clean_range((u32) from, (u32) from + chunk); + cpu_dcache_invalidate_range((u32) to, (u32) to + chunk); + + DPRINTK("dma_copy_from_user(0x%x, 0x%x, %lu): to_chunk=%d, " + "from_chunk=%d, chunk=%d\n", (u32) to, (u32) from, + n, to_chunk, from_chunk, chunk); + + if(!list_empty(&dma->free_q)) + { + sw_desc = list_entry(dma->free_q.next, sw_dma_t, link); + list_del(&sw_desc->link); + } + else + { + // This should NEVER happen. We need to increase the amount + // of descriptors if that is the case + // XXX TODO: put in something nice later to handle this! + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + DPRINTK(KERN_ERR "out of DMA descriptors! Increase!\n"); + BUG(); + return n; + } + + // Set last NDAR to NULL + sw_desc->next = NULL; + sw_desc->dma_desc->NDAR = 0; + sw_desc->dma_desc->PUADR = 0; + sw_desc->buf_size = sw_desc->dma_desc->BC = chunk; + + /* Is this mem -> mem or mem -> PCI? */ + if(from_pa >= PHYS_OFFSET) + { + sw_desc->dma_desc->LADR = sw_desc->phys_dest = + physical_address((u32)to); + sw_desc->dma_desc->PADR = sw_desc->phys_src = + from_pa + page_offset((u32)from); + sw_desc->dma_desc->DC = DMA_DCR_MTM; + } + else + { + sw_desc->dma_desc->LADR = sw_desc->phys_dest = + physical_address((u32)to); + sw_desc->dma_desc->PADR = sw_desc->phys_src = + from_pa + page_offset((u32)from); + sw_desc->dma_desc->DC = DMA_DCR_PCI_MRM; + } + + dma->last_desc->dma_desc->NDAR = sw_desc->dma_phys; + *(dma->regs.CCR) = DMA_CCR_CHANNEL_ENABLE | DMA_CCR_CHAIN_RESUME; + + /* do as much work as possible here, after starting DMA */ + from += chunk; + to += chunk; + n -= chunk; + to_chunk -= chunk; + from_chunk -= chunk; + + // busy wait on channel until done + csr = *(dma->regs.CSR); + while(csr & DMA_CSR_CH_ACTIVE) + { + udelay(1); + csr = *(dma->regs.CSR); + } + + // put the last in the free queue + dma->last_desc->status = 0; + dma->last_desc->complete = 0; + dma->last_desc->next = 0; + list_add_tail(&dma->last_desc->link, &dma->free_q); + + // hookup the new last descriptor for chaining + sw_desc->status = 0; + sw_desc->complete = 0; + dma->last_desc = sw_desc; + + /* + * If the DMA failed, the user has screwed up + * and he needs to debug his code. + */ + if(csr & DMA_CSR_ERR_MASK) + { + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + BUG(); + } + } + + up(&dma->chan_sem); + spin_unlock_irqrestore(¤t->mm->page_table_lock, cflags); + dma_hit++; + + return n; +} + +module_init(iop321_dma_init); +module_exit(iop321_dma_exit); +MODULE_LICENSE(GPL); + +//EXPORT_SYMBOL(iop_memcpy); +//EXPORT_SYMBOL(dma_memcpy); +EXPORT_SYMBOL(dma_copy_to_user); +EXPORT_SYMBOL(dma_copy_from_user); diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-dma.h linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-dma.h --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-dma.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-dma.h 2003-10-26 17:44:24.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * Private Definitions for IOP321 DMA + * + * Author: Dave Jiang (dave.jiang@intel.com) + * Copyright (C) 2002 Intel Corporation + * + * 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. + * + */ + +#ifndef _321DMA_PRIVATE_H_ +#define _321DMA_PRIVATE_H_ + +#define DEFAULT_DMA_IRQ_THRESH 10 + +#define DMA_DESC_SIZE 24 + +#define DMA_CCR_CLEAR 0x00000000 +#define DMA_CCR_CHANNEL_ENABLE 0x00000001 +#define DMA_CCR_CHAIN_RESUME 0x00000002 + +#define DMA_CSR_PCIX_SPLIT_ERROR 0x00000002 +#define DMA_CSR_PCI_TGT_ABORT 0x00000004 +#define DMA_CSR_PCI_MST_ABORT 0x00000008 +#define DMA_CSR_INT_MST_ABORT 0x00000020 +#define DMA_CSR_EOC_INT 0x00000100 +#define DMA_CSR_EOT_INT 0x00000200 +#define DMA_CSR_CH_ACTIVE 0x00000400 +#define DMA_CSR_DONE_MASK (DMA_CSR_EOC_INT | DMA_CSR_EOT_INT) + +#define DMA_CSR_ERR_MASK (DMA_CSR_PCIX_SPLIT_ERROR | \ + DMA_CSR_PCI_TGT_ABORT | \ + DMA_CSR_PCI_MST_ABORT | \ + DMA_CSR_INT_MST_ABORT) + +/* + * DMA Descriptor + */ +#pragma pack(1) +typedef struct _dma_desc { + u32 NDAR; /* next descriptor adress */ + u32 PADR; /* PCI address */ + u32 PUADR; /* upper PCI address */ + u32 LADR; /* local address */ + u32 BC; /* byte count */ + u32 DC; /* descriptor control */ +} dma_desc_t; +#pragma pack() + +/* + * DMA Software Descriptor + */ +typedef struct _sw_dma sw_dma_t; + +struct _sw_dma { + struct list_head link; + dma_desc_t *dma_desc; /* DMA descriptor pointer */ + void *dma_virt; /* unaligned virtual dma addr */ + u32 dma_phys; /* aligned DMA physical */ + u32 status; + void *virt_src; /* virt source */ + void *virt_dest; /* virt destination */ + u32 phys_src; /* physical/bus address of src */ + u32 phys_dest; /* Physical/bus address of dest */ + u32 buf_size; + sw_dma_t *next; + int complete; + wait_queue_head_t wait; +}; + +/* + * DMA control register structure + */ +#pragma pack(1) +typedef struct _dma_regs { + volatile u32 *CCR; /* channel control register */ + volatile u32 *CSR; /* channel status register */ + volatile u32 *DAR; /* descriptor address register */ + volatile u32 *NDAR; /* next descriptor address register */ + volatile u32 *PADR; /* PCI address register */ + volatile u32 *PUADR; /* upper PCI address register */ + volatile u32 *LADR; /* local address register */ + volatile u32 *BCR; /* byte count register */ + volatile u32 *DCR; /* descriptor control register */ +} dma_regs_t; +#pragma pack() + +/* + * DMA channel structure. + */ + +typedef struct _dmac_ctrl_t { + spinlock_t chan_lock; + struct semaphore chan_sem; + struct list_head process_q; + struct list_head free_q; + spinlock_t chain_lock; + spinlock_t process_lock; /* process queue lock */ + spinlock_t free_lock; /* hold queue lock */ + struct { + int EOT; + int EOC; + int ERR; + } irq; + const char *device_id; /* Device name */ + dma_regs_t regs; + sw_dma_t *last_desc; + wait_queue_head_t wait; +} iop321_dma_t; + +#define SW_ENTRY(list) list_entry((list.next), sw_dma_t, link) + +#endif + /*EOF*/ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-irq.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-irq.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-irq.c 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-irq.c 2003-12-23 05:41:38.000000000 +0000 @@ -22,46 +22,136 @@ #include #include #include +#include #include + static u32 iop321_mask = 0; -static void + +#ifdef CONFIG_ARCH_IYONIX + +#include + +static unsigned char master_mask = 0xff; +static unsigned char slave_mask = 0xff; + +#endif + + +static void iop321_irq_mask (unsigned int irq) { - - iop321_mask &= ~(1 << (irq - IOP321_IRQ_OFS)); +#ifdef CONFIG_ARCH_IYONIX + if (irq < 32) { + iop321_mask &= ~(1 << (irq - IOP321_IRQ_OFS)); + intctl_write(iop321_mask); - intctl_write(iop321_mask); + } else if (irq >= 32 && irq < 40) { + master_mask |= (1 << (irq & 7)); + + outb(master_mask, IYONIX_IO_MasterMask); + + } else if (irq >= 40 && irq < 48) { + slave_mask |= (1 << (irq & 7)); + + outb(slave_mask, IYONIX_IO_SlaveMask); + + } else if (irq >= 48 && irq < 56) { + int mask = iomd_readb(IOMD_IRQMASKA); + + iomd_writeb(mask & ~(1 << (irq & 7)), IOMD_IRQMASKA); + iomd_readb(IOMD_IRQMASKA); + + } else if (irq >= 56 && irq < 64) { + int mask = iomd_readb(IOMD_IRQMASKB); + + iomd_writeb(mask & ~(1 << (irq & 7)), IOMD_IRQMASKB); + iomd_readb(IOMD_IRQMASKB); + + } else { + printk("iop321_irq_mask: Unhandled IRQ mask: %d\n", irq); + } +#else + iop321_mask &= ~(1 << (irq - IOP321_IRQ_OFS)); + intctl_write(iop321_mask); +#endif } + static void iop321_irq_unmask (unsigned int irq) { - iop321_mask |= (1 << (irq - IOP321_IRQ_OFS)); +#ifdef CONFIG_ARCH_IYONIX + if (irq < 32) { + iop321_mask |= (1 << (irq - IOP321_IRQ_OFS)); + intctl_write(iop321_mask); + + } else if (irq >= 32 && irq < 40) { + master_mask &= ~(1 << (irq & 7)); + + outb(master_mask, IYONIX_IO_MasterMask); + + iop321_irq_unmask(IRQ_IOP321_XINT1); + iop321_irq_unmask(IRQ_IYONIX_SuperIO); + + } else if (irq >= 40 && irq < 48) { + slave_mask &= ~(1 << (irq & 7)); + + outb(slave_mask, IYONIX_IO_SlaveMask); + + iop321_irq_unmask(IRQ_IOP321_XINT1); + iop321_irq_unmask(IRQ_IYONIX_SuperIO); + iop321_irq_unmask(IRQ_IYONIX_SlavePIC); + + } else if (irq >= 48 && irq < 56) { + int mask = iomd_readb(IOMD_IRQMASKA); + iomd_writeb(mask | (1 << (irq & 7)), IOMD_IRQMASKA); + iomd_readb(IOMD_IRQMASKA); + + } else if (irq >= 56 && irq < 64) { + int mask = iomd_readb(IOMD_IRQMASKB); + + iomd_writeb(mask | (1 << (irq & 7)), IOMD_IRQMASKB); + iomd_readb(IOMD_IRQMASKB); + + } else { + printk("unhandled IRQ unmask: %d\n", irq); + } +#else + iop321_mask |= (1 << (irq - IOP321_IRQ_OFS)); intctl_write(iop321_mask); +#endif } + +#ifdef CONFIG_ARCH_IYONIX +void iyonix_init_irq(void); +#endif + void __init iop321_init_irq(void) { - int i; + int interrupt; - intctl_write(0); // disable all interrupts - intstr_write(0); // treat all as IRQ + intctl_write(0); /* Disable all interrupts */ + intstr_write(0); /* Treat all as IRQ */ - // all interrupts are inputs to chip - if(machine_is_iq80321() || machine_is_iq31244()) - *IOP321_PCIIRSR = 0x0f; + /* All interrupts are inputs to chip */ + if(machine_is_iq80321() || machine_is_iq31244() || machine_is_iyonix()) + *IOP321_PCIIRSR = 0x0f; - for(i = IOP321_IRQ_OFS; i < NR_IOP321_IRQS; i++) + for(interrupt = IOP321_IRQ_OFS; interrupt < NR_IOP321_IRQS; interrupt++) { - irq_desc[i].valid = 1; - irq_desc[i].probe_ok = 1; - irq_desc[i].mask_ack = iop321_irq_mask; - irq_desc[i].mask = iop321_irq_mask; - irq_desc[i].unmask = iop321_irq_unmask; + irq_desc[interrupt].valid = 1; + irq_desc[interrupt].probe_ok = 1; + irq_desc[interrupt].mask_ack = iop321_irq_mask; + irq_desc[interrupt].mask = iop321_irq_mask; + irq_desc[interrupt].unmask = iop321_irq_unmask; } + + if (machine_is_iyonix()) + iyonix_init_irq(); } diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-pci.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-pci.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iop321-pci.c 2003-10-03 13:50:16.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/iop321-pci.c 2003-10-03 12:59:43.000000000 +0100 @@ -30,7 +30,7 @@ #include #include -// #define DEBUG +#undef DEBUG #ifdef DEBUG #define DBG(x...) printk(x) @@ -43,8 +43,9 @@ void iop321_init(void) { DBG("PCI: Intel 80321 PCI init code.\n"); + DBG("\tATU: IOP321_PDSCR=0x%04x\n", *IOP321_PDSCR); DBG("\tATU: IOP321_ATUCMD=0x%04x\n", *IOP321_ATUCMD); - DBG("\tATU: IOP321_OMWTVR0=0x%04x, IOP321_OIOWTVR=0x%04x\n", + DBG("\tATU: IOP321_OMWTVR0=0x%04x, IOP321_OIOWTVR=0x%04x\n", *IOP321_OMWTVR0, *IOP321_OIOWTVR); DBG("\tATU: IOP321_ATUCR=0x%08x\n", *IOP321_ATUCR); @@ -69,7 +70,7 @@ volatile u32 *pdata; struct pci_controller *hose; - DBG("\tPCI: config_setup of bus %d\n", dev->bus->number); +// DBG("\tPCI: config_setup of bus %d\n", dev->bus->number); /* * Get appropriate cfga/cfgd values from hose @@ -103,7 +104,7 @@ * This routine checks the status of the last configuration cycle. If an error * was detected it returns a 1, else it returns a 0. The errors being checked * are parity, master abort, target abort (master and target). These types of - * errors occure during a config cycle where there is no device, like during + * errors occur during a config cycle where there is no device, like during * the discovery stage. */ static int iop321_pci_config_cleanup(u8 bus) @@ -121,14 +122,14 @@ status = *IOP321_ATUSR; if (status & 0xF900) { - DBG("\t\t\tPCI: P0 - status = 0x%08x\n", status); +// DBG("\t\t\tPCI: P0 - status = 0x%08x\n", status); err = 1; *IOP321_ATUSR = status & 0xF900; } status = *IOP321_ATUISR; if (status & 0x679F) { - DBG("\t\t\tPCI: P1 - status = 0x%08x\n", status); +// DBG("\t\t\tPCI: P1 - status = 0x%08x\n", status); err = 1; *IOP321_ATUISR = status & 0x679f; } @@ -281,7 +282,7 @@ }; /* - * When a PCI device does not exist during config cycles, the 80200 gets a + * When a PCI device does not exist during config cycles, the 80321 gets a * bus error instead of returning 0xffffffff. This handler simply returns. */ int @@ -293,7 +294,6 @@ */ if (fsr & (1 << 10)) regs->ARM_pc += 4; - return 0; } diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iyonix-pci.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/iyonix-pci.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/iyonix-pci.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/iyonix-pci.c 2003-12-23 10:21:08.000000000 +0000 @@ -0,0 +1,287 @@ +/* + * arch/arm/mach-iop3xx/iyonix-pci.c + * + * PCI support for the Castle IYONIX + * + * Author: Peter Naulls with additions from John Ballance + * Copyright (C) 2003 Peter Naulls + * Based on IQ80321 PCI support by Rory Bolt + * + * 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 +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define DEBUG +#ifdef DEBUG +#define DBG(x...) printk(x) +#else +#define DBG(x...) +#endif + +static struct pci_controller *hose = NULL; + + +void __init +iyonix_init(void *sysdata) +{ + struct pci_bus *bus; + struct resource *mem = + kmalloc(sizeof(struct resource), GFP_KERNEL); + + if(!mem) + printk(KERN_ERR "Could not allocate PCI resource\n"); + else + memset(mem, 0, sizeof(struct resource)); + + + /* Enable ATU with direct Addressing Enable */ + *IOP321_ATUCR |= (1 << 7) | (1 << 1); + + /* Set the outbound window tranlsation window 0 */ + *IOP321_OMWTVR0 = 0; + *IOP321_OUMWTVR0 = 0; + + /* Outbound I/O window translation */ + *IOP321_OIOWTVR = 0; + + *IOP321_ATUCMD = 0x146; /* SERR|PARITY|MASTER|MEMORY */ + *IOP321_APMCSR = 3; /* PM D3 HOT */ + + /* IOP321 default setup */ + iop321_init(); + + hose = pcibios_alloc_controller(); + + if (!hose) + panic("Could not allocate PCI hose"); + + hose->first_busno = (*IOP321_PCIXSR >> 8) & 0xff; + + if (hose->first_busno == 0xff) + hose->first_busno = 0; + + hose->last_busno = 0xff; + hose->cfg_addr = (unsigned int *)IOP321_OCCAR; + hose->cfg_data = (unsigned char *)IOP321_OCCDR; + hose->io_space.start = IOP321_PCI_LOWER_IO; + hose->io_space.end = IOP321_PCI_UPPER_IO; + + hose->mem_space.start = IOP321_PCI_LOWER_MEM; + hose->mem_space.end = IOP321_PCI_UPPER_MEM; + + { + unsigned char status; + + /* Disable 1st USB on Southbridge */ + early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x53, 0x40); + early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x52, 0x00); + + /* Disable 2nd USB on Southbridge */ + early_read_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x7e, &status); + early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x7e, status & ~0x80); + + /* Disable Modem */ + early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x77, 1 << 6); + + /* Enable 2nd UART */ + + outb(0x51, IYONIX_IO_Config); /* Southbridge configuration key */ + outb(0x23, IYONIX_IO_Config); + + outb(0x07, IYONIX_IO_ConfigIndex); + outb(0x05, IYONIX_IO_ConfigData); /* Device 5, UART 2 */ + + outb(0x30, IYONIX_IO_ConfigIndex); + outb(0x01, IYONIX_IO_ConfigData); /* Enable bit */ + + outb(0x70, IYONIX_IO_ConfigIndex); + outb(0x10, IYONIX_IO_ConfigData); /* IRQ 42 (10) */ + +// early_read_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x30, &status); +// early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x30, status | 1); + + outb(0xbb, IYONIX_IO_Config); /* Leave configuration */ + + /* Disable SCI */ + early_write_config_byte(hose, 1, PCI_DEVFN(2, 0), 0x78, 1 << 7); + } + + /* Autoconfig the hose */ + hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); + + if(mem) + { + mem->flags = IORESOURCE_MEM; + mem->name = "IOP321 ATU"; + allocate_resource(&iomem_resource, mem, + IOP321_PCI_WINDOW_SIZE, + IOP321_PCI_LOWER_MEM, + 0xffffffff, + IOP321_PCI_LOWER_MEM + & 0xff000000, + NULL, NULL); + } + + /* Scan the hose */ + bus = pci_scan_bus(hose->first_busno, &iop321_ops, sysdata); + +} + +static inline int __init +iyonix_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) +{ + /* Otherwise uses XINT0 - XINT3 */ + static char pci_irq_table[6][4] = + { + /* + * PCI IDSEL/INTPIN->XINT LINE + * 0 1 2 3 + */ + {0, 1, 2, 3}, /* Ethernet */ + {0, 0, 0, 0}, /* Reserved */ + {2, 3, 0, 1}, /* SK601 wide PCB edge slot 0 */ + {3, 0, 1, 2}, /* SK600 wide slot 1 */ + {0, 1, 2, 3}, /* SK501 narrow slot 2 */ + {1, 2, 3, 0}, /* SK500 narrow slot 3 */ + }; + + /* Mapping of devices on Southbridge to created interrupt numbers */ + if (dev->vendor == PCI_VENDOR_ID_AL) + { + switch (dev->device) + { + case PCI_DEVICE_ID_AL_M1533: return IRQ_IYONIX_SuperIO; /* Southbridge */ + case PCI_DEVICE_ID_AL_M5229: return IRQ_IYONIX_ATA1; /* ATA */ + case PCI_DEVICE_ID_AL_M5237: return (pin & 1) ? + IRQ_IYONIX_USB2: /* OpenHCI */ + IRQ_IYONIX_USB1; /* OpenHCI */ + case PCI_DEVICE_ID_AL_M5257: return IRQ_IYONIX_Modem; /* SW Modem (disabled) */ + case PCI_DEVICE_ID_AL_M5451: return IRQ_IYONIX_AC97; /* AC97 controller */ + case PCI_DEVICE_ID_AL_M7101: return IRQ_IYONIX_SCI; /* PMU */ + /* Any other ALi devices will be in PCI slots, and will use XINT0 - XINT3 */ + } + } + + return pci_irq_table[idsel - 4][pin - 1] + IRQ_IOP321_XINT0; +} + +struct hw_pci iyonix_pci __initdata = { + init: iyonix_init, + swizzle: common_swizzle, + map_irq: iyonix_map_irq, +}; + + +extern void do_IRQ(int, struct pt_regs *); + + + +static void iyonix_pci_irq_demux(int irq, void *dev_id, + struct pt_regs *regs) +{ + unsigned char bitcount; + unsigned char iomd; + + /* Check if irq is in IOMD IRQA area */ + // bit 2 == Floppy index pulse (latched IRQ) */ + if (iomd_readb(IOMD_IRQSTATA) & iomd_readb(IOMD_IRQMASKA) & (1 << 2)) + { + do_IRQ(IRQ_IYONIX_FlpIndex, regs); + } + else + { + /* Check if irq is in IOMD IRQB area + bit 0 == Expansion card FIQ interrupt + bit 2 == SuperIO chip interrupt + bit 5 == Expansion card IRQ interrupt */ + iomd = iomd_readb(IOMD_IRQSTATB) & + iomd_readb(IOMD_IRQMASKB) & + ((1 << 0) | (1 << 2) | (1 << 5)); + + if (iomd & (1 << 0)) { + do_IRQ(IRQ_IYONIX_PFIQ, regs); + } + + if (iomd & (1 << 2)) { + if ((bitcount = inb(IYONIX_IO_MasterPIC))) { + asm volatile("clz %0,%1":"=r" (bitcount) : "r" (bitcount)); + irq = 31 - bitcount + IRQ_IYONIX_MasterDev; + + if (irq == IRQ_IYONIX_SlavePIC) { + bitcount = inb(IYONIX_IO_SlavePIC); + asm volatile("clz %0,%1":"=r" (bitcount) : "r" (bitcount)); + irq = 31 - bitcount + IRQ_IYONIX_SlaveDev; + } + + if (irq > 32) + do_IRQ(irq, regs); + else + printk("rogue IRQ: %d\n", irq); + } + } + + if (iomd & (1 << 5)) { + do_IRQ(IRQ_IYONIX_Podule, regs); + } + } +} + +static struct irqaction iyonix_pci_irq = { + name: "Iyonix glue logic", + handler: iyonix_pci_irq_demux, + flags: SA_SHIRQ +}; + + +void __init iyonix_init_irq(void) +{ + /* Disable IOMD interrupts */ + iomd_writeb(0, IOMD_IRQMASKA); + iomd_writeb(0, IOMD_IRQMASKB); + + iomd_writeb(0, IOMD_FIQMASK); + iomd_writeb(0, IOMD_DMAMASK); + + /* PIC setup */ + outb(0x11, IYONIX_IO_MasterPIC); + outb(0x00, IYONIX_IO_MasterMask); /* IRQ number */ + outb(0x04, IYONIX_IO_MasterMask); /* Slave on Ch2 */ + outb(0x01, IYONIX_IO_MasterMask); /* x86 */ + outb(0xff, IYONIX_IO_MasterMask); /* Mask Everything */ + + outb(0x11, IYONIX_IO_SlavePIC); + outb(0x00, IYONIX_IO_SlaveMask); /* IRQ number */ + outb(0x02, IYONIX_IO_SlaveMask); /* Slave on Ch1 */ + outb(0x01, IYONIX_IO_SlaveMask); /* x86 */ + outb(0xff, IYONIX_IO_SlaveMask); /* Mask Everything */ + + outb(0x7a, IYONIX_IO_MasterPICLevel); /* level sensitive for USB & ATA */ + + setup_arm_irq(IRQ_IOP321_XINT1, &iyonix_pci_irq); +} + + + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/mm-321.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/mm-321.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/mm-321.c 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/mm-321.c 2003-12-31 13:52:32.000000000 +0000 @@ -31,10 +31,12 @@ /* virtual physical length domain r w c b */ /* mem mapped registers */ - { 0xfff00000, 0xffffe000, 0x00002000, DOMAIN_IO, 0, 1, 0, 0}, + { IOP321_VIRT_MEM_BASE, IOP321_PHY_MEM_BASE, 0x00002000, DOMAIN_IO, 0, 1, 0, 0}, +#ifndef CONFIG_ARCH_IYONIX /* PCI IO space */ - { 0xfe000000, 0x90000000, 0x00020000, DOMAIN_IO, 0, 1, 0, 0}, + { 0xfe000000, 0x90000000, 0x00020000, DOMAIN_IO, 0, 1, 0, 0}, +#endif LAST_DESC }; @@ -65,3 +67,34 @@ } #endif // CONFIG_ARCH_IQ80321 || CONFIG_ARCH_IQ31244 + +#ifdef CONFIG_ARCH_IYONIX + +/* + * Mappings for Iyonix + */ +static struct map_desc iyonix_io_desc[] __initdata = { + /* virtual physical length domain r w c b */ + + /* On-board devices */ + { PCIO_BASE, PCIO_START, PCIO_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + /* IOMD */ + { IO_BASE, IO_START, IO_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + /* Podule space */ +// { EASI_BASE, EASI_START, EASI_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + /* Flash ROM for E1000 MAC */ + { FLASH_BASE, FLASH_START, FLASH_SIZE, DOMAIN_IO, 0, 1, 0, 0 }, + LAST_DESC +}; + + +void __init iyonix_map_io(void) +{ + iop321_map_io(); + + iotable_init(iyonix_io_desc); +} +#endif /* CONFIG_ARCH_IYONIX */ + + + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/pci-auto.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/pci-auto.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/pci-auto.c 2003-05-06 08:31:38.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/pci-auto.c 2003-07-28 11:48:24.000000000 +0100 @@ -21,7 +21,7 @@ #include #include -// #define DEBUG +#undef DEBUG #ifdef DEBUG #define DBG(x...) printk(x) @@ -29,8 +29,8 @@ #define DBG(x...) #endif /* DEBUG */ -static int pciauto_upper_iospc; -static int pciauto_upper_memspc; +static u32 pciauto_upper_iospc; +static u32 pciauto_upper_memspc; void pciauto_setup_bars(struct pci_controller *hose, int current_bus, @@ -45,6 +45,19 @@ DBG("PCI Autoconfig: Found Bus %d, Device %d, Function %d\n", current_bus, PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn) ); + early_read_config_dword(hose, + current_bus, + pci_devfn, + PCI_ROM_ADDRESS, + &bar_response); + if (bar_response) { + early_write_config_dword(hose, + current_bus, + pci_devfn, + PCI_ROM_ADDRESS, + PCI_ROM_ADDRESS_ENABLE | 0x10000); + } + for (bar = PCI_BASE_ADDRESS_0; bar <= bar_limit; bar+=4) { /* Tickle the BAR and get the response */ @@ -63,6 +76,14 @@ if (!bar_response) continue; + /* + * Workaround for a BAR that doesn't use its upper word, + * like the ALi 1535D+ PCI DC-97 Controller Modem (M5457). + * bdl + */ + if (!(bar_response & 0xffff0000)) + bar_response |= 0xffff0000; + /* Check the BAR type and set our address mask */ if (bar_response & PCI_BASE_ADDRESS_SPACE) { @@ -126,6 +147,8 @@ int *iosave, int *memsave) { +// pciauto_upper_iospc = 0x90008000; + /* Configure bus number registers */ early_write_config_byte(hose, current_bus, @@ -199,7 +222,7 @@ PCI_MEMORY_BASE, pciauto_upper_memspc >> 16); - /* Allocate 1MB for pre-fretch */ + /* Allocate 1MB for pre-fetch */ early_write_config_word(hose, current_bus, pci_devfn, @@ -220,11 +243,18 @@ pciauto_upper_iospc -= 0x1000; DBG("PCI Autoconfig: Bridge %d. IO_FILTER = %#010x..%#010x\n", - current_bus, + current_bus, (pciauto_upper_iospc & 0x0000f000) >> 8, pciauto_upper_iospc >> 16); - early_write_config_byte(hose, + /* This issue needs work for Iyonix. Configuring the Southbridge and + P2P needs to done carefully, otherwise we lose our I/O + in the Southbridge (specifically, the UART). For now, + we simply don't bother to configure the P2P bridge + except to move it. This leaves devices on the far side of the + bridge not properly configured */ + +/* early_write_config_byte(hose, current_bus, pci_devfn, PCI_IO_BASE, @@ -233,8 +263,19 @@ current_bus, pci_devfn, PCI_IO_BASE_UPPER16, - pciauto_upper_iospc >> 16); - + pciauto_upper_iospc >> 16); */ + + /* Move the bridge and the PCI I/O offset at the same time, so we + retain the serial port */ +/* early_write_config_word(hose, + current_bus, + pci_devfn, + PCI_IO_BASE_UPPER16, + 0x90000000 >> 16); + + *IOP321_OIOWTVR = 0x90000000;*/ + + /* Enable memory and I/O accesses, enable bus master */ early_read_config_dword(hose, current_bus, @@ -272,8 +313,9 @@ for (pci_devfn=0; pci_devfn<0xff; pci_devfn++) { /* Skip our host bridge */ - if ( (current_bus == hose->first_busno) && (pci_devfn == 0) ) + if ( (current_bus == hose->first_busno) && (pci_devfn == 0) ) { continue; + } if (PCI_FUNC(pci_devfn) && !found_multi) continue; @@ -295,10 +337,18 @@ PCI_VENDOR_ID, &vid); - DBG("Vendor id %#06x\n", vid); if (vid != 0xffff) { + DBG("Vendor id %#06x\n", vid); + + early_read_config_word(hose, + current_bus, + pci_devfn, + PCI_DEVICE_ID, + &vid); + DBG("Device id %#06x\n", vid); + early_read_config_dword(hose, current_bus, pci_devfn, @@ -308,6 +358,7 @@ int iosave, memsave; DBG("PCI Autoconfig: Found P2P bridge, device %d\n", PCI_SLOT(pci_devfn)); + /* Allocate PCI I/O and/or memory space */ pciauto_setup_bars(hose, current_bus, diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/pci.c linux-arm-2.4-ds/arch/arm/mach-iop3xx/pci.c --- linux-arm-2.4-ds.orig/arch/arm/mach-iop3xx/pci.c 2003-05-06 08:31:38.000000000 +0100 +++ linux-arm-2.4-ds/arch/arm/mach-iop3xx/pci.c 2003-07-28 11:49:44.000000000 +0100 @@ -24,7 +24,7 @@ #include #include -#define DEBUG +#undef DEBUG #ifdef DEBUG #define DBG(x...) printk(x) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/conf.vars linux-arm-2.4-ds/conf.vars --- linux-arm-2.4-ds.orig/conf.vars 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/conf.vars 2004-01-02 15:59:12.000000000 +0000 @@ -0,0 +1,25 @@ +VERSION = 2 +PATCHLEVEL = 4 +SUBLEVEL = 21 +EXTRAVERSION = -iyonix +ARCH = arm +KPKG_ARCH = arm +HOSTCC = gcc +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +CROSS_COMPILE = /usr/local/arm/3.3.1/bin/arm-linux- +AS = /usr/local/arm/3.3.1/bin/arm-linux-as +LD = /usr/local/arm/3.3.1/bin/arm-linux-ld +CC = /usr/local/arm/3.3.1/bin/arm-linux-gcc +CPP = /usr/local/arm/3.3.1/bin/arm-linux-gcc -E +AR = /usr/local/arm/3.3.1/bin/arm-linux-ar +NM = /usr/local/arm/3.3.1/bin/arm-linux-nm +STRIP = /usr/local/arm/3.3.1/bin/arm-linux-strip +OBJCOPY = /usr/local/arm/3.3.1/bin/arm-linux-objcopy +OBJDUMP = /usr/local/arm/3.3.1/bin/arm-linux-objdump +MAKE = /usr/bin/make +GENKSYMS = /sbin/genksyms +CFLAGS = -D__KERNEL__ -I$(TOPDIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -mshort-load-bytes -msoft-float -Uarm +AFLAGS = -D__ASSEMBLY__ -D__KERNEL__ -I$(TOPDIR)/include -mapcs-32 -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -msoft-float +MODFLAGS = -DMODULE +do_parallel = +fast_dep = diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/debian/buildinfo linux-arm-2.4-ds/debian/buildinfo --- linux-arm-2.4-ds.orig/debian/buildinfo 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/debian/buildinfo 2004-01-02 16:09:19.000000000 +0000 @@ -0,0 +1,16 @@ +gcc-3.3.2-1 +gcc-2.95-2.95.4-19 +gcc-3.2-base-3.2.3-9 +gcc-3.3-3.3.3-0pre0.1 +gcc-3.3-base-3.3.3-0pre0.1 +perl-5.8.2-2 +dpkg-1.10.18 +libc6-2.3.2.ds1-10 +libc6-dev-2.3.2.ds1-10 +binutils-2.14.90.0.7-3 +make-3.80-4 +dpkg-dev-1.10.18 +this was built on a machine with the kernel: +Linux woof 2.6.0-test11 #4 Tue Dec 2 21:04:30 GMT 2003 i686 GNU/Linux +using the compiler: +gcc version 3.3.2 20030820 (prerelease) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/debian/changelog linux-arm-2.4-ds/debian/changelog --- linux-arm-2.4-ds.orig/debian/changelog 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/debian/changelog 2004-01-02 15:59:10.000000000 +0000 @@ -0,0 +1,451 @@ +kernel-source-2.4.21-iyonix (2.4.21) unstable; urgency=low + + * Added support for netwinders + * Modified modules support to not assume everything in /usr/src/modules + is a directory. + + -- Manoj Srivastava Wed, 25 Nov 1998 01:39:43 -0600 + +kernel-source-0.34 (1.01) unstable; urgency=low + + * This is a major change in the source/header packages. In architectures + different from i386, `kernel-headers-*' and `kernel-source-*' are + incompatible. This also has an effect on libc6-dev, which depends on + kernel-headers-2.0.3x | kernel-source-2.0.3x, which is only true on + i386 architectures. One possible solution would be to make libc6-dev + depend on kernel-headers-2.0.32, but that won't work because + kernel-source provides kernel-headers. In fact, since kernel-headers + are arch dependent, but kernel-source is arch: all, kernel-source-* + should not provide kernel-header* at all. + + Once kernel source stops providing kernel-header*, and libc6-dev + depends on kernel-headers-2.0.32 and links /usr/include/{linux,asm} to + /usr/src/kernel-headers-2.0.32 (nor /usr/src/linux-2.0.32) things + would work again in a Multi arch compatible fashion. + + Hence, now kernel-source-* packages compiled with this kernel-package + shall not provide any sort of kernel-headers. For the sake of + backwards compatibility, /usr/src/linux-$version symlinks are still + being provided (as people may upload newer kernels while keeping an + older libc6-dev around, which depends on /usr/src/linux-2.0.32. + + However, I have been badgered enough about this that I shall remove + the /usr/src/linux-$version symlinks at some point. This version no + longer registers stuff in /usr/src/.linux-versions, and is no longer + as paranoid about /usr/src/linux; but it does not outright remove + those files either, so as not to cause people with older kernels + having a problem during removal.As soon as it is deemed permissible, + we shall get less paranoid about /usr/src/linux-$version as well. + * closes: Bug#18277 + + -- Manoj Srivastava Wed, 18 Feb 1998 16:44:31 -0600 + +kernel-source-0.33 (1.01) unstable; urgency=low + + * Added SUBARCH, which is used to distinguish Amiga, Atari, Macintosh, + etc. kernels for Debian/m68k, and may well be required for the alpha, + from what I hear. Unlike the FLAVOURS variable, which affects + everything it can lay its grubby hands on (kernel image, headers, + source, doc package versions, and where the modules are looked for + under /lib/modules), this only affects the naming of the kernel-image + as the source and doc packages are architecture independent and the + kernel-headers do not vary from one sub-architecture to the + next. These changes are courtesy of James Troup + + -- Manoj Srivastava Mon, 16 Feb 1998 16:47:08 -0600 + +kernel-source-0.32 (1.01) unstable; urgency=low + + * Ensure that the /usr/src/linux and /usr/src/linux- links + always exist, no matter what. Apparently, upgrading from + kernel-source-2.0.32_2.0.32-1 to kernel-source-2.0.32_2.0.32-3 does + not create /usr/src/linux-, which breaks libc6-dev. + * Toned down the language about LILO, so as not to startle new sparc users + + -- Manoj Srivastava Thu, 12 Feb 1998 21:56:50 -0600 + +kernel-source-0.31 (1.01) unstable; urgency=low + + * Added ARCH to make called, this allows for cross compiling kernels + (added on a request by James Troup ) + * Make kernel-headers arch: any, so we can indeed have different headers + for different architectures. + * m68k can now handle vmlinuz, so reverse that behaviour in the rules + file. AFAIK m68k still uses zImage. + * Improvements to /usr/doc/kernel-patch/MultiArch.gz, based on + suggestions by James Troup / + + -- Manoj Srivastava Mon, 9 Feb 1998 17:11:05 -0600 + +kernel-source-0.30 (1.01) unstable; urgency=low + + * Redid the Headers README file + * Added a rationale to the LinkPolicy document. So far, it detailed + *what* Debian did. Now, it also says *why* we do it. + + -- Manoj Srivastava Thu, 29 Jan 1998 19:13:58 -0600 + +kernel-source-0.29 (1.01) unstable; urgency=low + + * Important changes for kernel-source-* and kernel-header-* packages: now + kernel-source-* packages also provide the exact kernel-header-* (libc6 + need only depend on kernel-header-* now. + * The kernel-header-* and kernel-source-* packages now also maitain the + /usr/src/linux-X.YY.ZZ links (in addition to the /usr/src/linux links) + This is used in the libc6 package. + + -- Manoj Srivastava Sat, 13 Dec 1997 12:46:47 -0600 + + +kernel-source-0.28 (1.01) unstable; urgency=low + + * Fixed a typo where we tried to dd /vmlinuz-2.0.32 rather than the + correct /boot/vmlinuz-2.0.32 in image.postinst. How come this glaring + an error has gone unreported until now? + + -- Manoj Srivastava Fri, 23 Jan 1998 14:36:34 -0600 + +kernel-source-0.27 (1.01) unstable; urgency=low + + * Fixed Typo in kernel rules that put all modules into block (this + is more of a thinko/cut and paste error. fixes: Bug#16697,Bug#16702 + * No longer a fatal error if there is no /vmlinuz (or + equivalent). fixes: Bug#16899 + * Added language to the abort on /usr/src/linux not being a + link. + * Documented the fact that if you re-run make-kpkg with a different + revision number, you have to reconfigure the kernel. + fixes: Bug#16968 + * ignore obsolete fdformat in favour of superformat. + * Changed the kernel rules file not break on the sound modules of + 2.1.70+ kernels (I think it is a bug in the kernel Makefile, but this + fix make make-kpkg handle the problem and be more robust). + * Modified image.postinst to also cater to people on whose architecture + the image is not called vmlinuz but something else (like vmlinux, for + example). closes:Bug#16258 + * Made the postrm's also know about the kernel versrion, not just the + postinst. (Sorry). closes:Bug#15920 + * Changed include.postrm to be more careful about removing the symbolic + link /usr/src/linux-X.Y.Z. Keep track if there is another package + installed that could provide the link. + + -- Manoj Srivastava Wed, 21 Jan 1998 03:27:35 -0600 + +kernel-source-0.26 (1.01) unstable; urgency=low + + * Added HAM modules to the module we know about, these were introduced + in 2.1.70. + + -- Manoj Srivastava Tue, 9 Dec 1997 23:27:04 -0600 + +kernel-source-0.25 (1.01) unstable; urgency=low + + * Ignore unmounted devices while looking for a root file system. Much + thanks to Thomas Kocourek for noticing + this. + * Make sure that the copyright file for the kernel-doc package is not + compressed. closes:Bug#14403,Bug#14405 + * Added internal utility kpkg-vercheck to test the validity of the + package version. + + -- Manoj Srivastava Mon, 10 Nov 1997 10:37:08 -0600 + +kernel-source-0.24 (1.01) unstable; urgency=low + + * Install the README.headers in the right place for the source + package. closes:Bug#14552. + * Handle the new NLS_MODULES that have appeared in the newest 2.1.6x + kernels. closes:Bug#14527. + + -- Manoj Srivastava Wed, 5 Nov 1997 23:30:48 -0600 + +kernel-source-0.23 (1.-0) unstable; urgency=low + + * Added README.headers to the kernel-source package as well, since the + information _is_ relevant to compiling kernels. Since kernel source + packages have higher visibility than kernel header packages, this may + help avoid some FAQs from being asked. + * Changed image postinst not to use the obsolete -d option to + superformat. Removed extra spaces from the exec option, so that it is + more likely to work. Noticed by Joost Kooij + * Note that the proposed two level versioning scheme fails if standard + kernels use epochs. Further note that one may introduce epochs even in + custom kernels. + + -- Manoj Srivastava Thu, 23 Oct 1997 12:19:51 -0500 + +kernel-source-0.22 (1.01) unstable; urgency=low + + * Handle obsolete /System.map and /System.old links left around by older + kernel-package packages. All the programs that look at the information + in the map files (including top, ps, and klogd) also will look at + /boot/System.map-, we just need to ensure that that file is + present, and no longer require the symbolic link. + Actually, having the symbolic link in / is technically detrimental + (apart from cluttering up /); many programs, though looking in /boot, + still allow /System.map to override. If you use LILO to choose between + multiple kernels, then the /System.map symbolic link only applies to + one such kernel, for all other choices the symbols loaded will be + wrong. Not having the symbolic links at all prevents this. + Therefore, the new image.postinst file shall offer to remove the + symbolic links in /. This should fix BUG#13359 + + -- Manoj Srivastava Fri, 26 Sep 1997 10:44:39 -0500 + +kernel-source-0.21 (1.01) unstable; urgency=low + + * Fixed handling of modules.dep in the image.postinst. We do not attempt + to recreate a modules.dep, since the man page admits the file so + created may be incorrect. We warn the installer that there maybe + problems loading modules into the kernel until reboot iff the version + being installed is the same as the version currently running. + + -- Manoj Srivastava Tue, 16 Sep 1997 15:07:02 -0500 + +kernel-source-0.20 (1.01) unstable; urgency=low + + * No longer create a System.map symlink in /, since that may confuse + klogd when choosing kernel images using LILO. Since top, ps, and klogd + look at /boot/System.map-, we just need to make sure that + file is present. This makes us friendlier to multiple images of the + same kernel version. + * No longer redirect output to a file in /tmp for security reasons (we + use a log file in /var/log instead). This fixes BUG#11765, + BUG#11766 and BUG#11847 + * Added support for different flavours of the same kernel version for + people who need them. This is based on the ideas and work of Bill + Mitchell and Noel Maddy . + This should make us fully compliant to having multiple flavours of the + same kernel version. + * Added dependencies to targets in rules. Now things should work as + expected if one edits a .config file. + * Fixed destination for the Buildinfo file. This fixes BUG#11884. + + -- Manoj Srivastava Mon, 4 Aug 1997 13:03:51 -0500 + +kernel-source-0.19 (1.01) unstable; urgency=low + + * All kernel packages produced now list the version of kernel-package + used in the file /usr/doc/Buildinfo. + * The image prerm will allow you to remove an running kernel image and + hose your system. You will be warned. (under protest). + * Fixed typo in control file for kernel-doc description. This fixes + Bug#11568. + + -- Manoj Srivastava Tue, 29 Jul 1997 17:47:41 -0500 + +kernel-source-0.18 (1.01) unstable; urgency=low + + * No longer carries around an extra uncompressed kernel image, and does + not anymore create /boot/psdatabase-X.X.XX. The psdatabase file does + not seem to be required anymore. + + -- Manoj Srivastava Wed, 18 Jun 1997 13:05:33 -0500 + +kernel-source-0.17 (1.01) unstable; urgency=low + + * Added patches to support m68k from "Frank Neumann" + . + * Added patched to support sparcs from Eric Delaunay + + + -- Manoj Srivastava Mon, 2 Jun 1997 15:17:59 -0500 + +kernel-source-0.16 (1.01) unstable; urgency=low + + * Moved config to /boot, where it arguably should have gone to in the + first place. The /boot directory contains other information pertinent + to the kernel, such as the System.map file, and the psdatabase. The + information about exactly what was configured into the kernel was + missing, and it can get quite critical on some machines. Also, the + config file may serve as a base for compiling the next kernel. This + file is not really a configuration file (not when packaged as part of + the kernel-image package), hence it does not belong in /etc (no amout + of changing this file will have any affet on system behaviour). + + -- Manoj Srivastava Wed, 21 May 1997 01:44:17 -0500 + +kernel-source-0.15 (1.01) unstable; urgency=low + + * Kernel-image and kernel-doc now suggest each other. + * Also recognize powerpc as a synonym for ppc in determining whether + we use zImage or bzImage by default. + * Fixed up some typos in documentation + * Added rules target kernel_doc. This fixes BUG#9138 + * Also install .config file under /usr/doc. This fixes BUG#9298 + + -- Manoj Srivastava Fri, 2 May 1997 14:34:51 -0500 + +kernel-source-0.14 (1.01) unstable; urgency=low + + * No longer install text files in the modules directory, since depmod + in modutils-2.1.34 fails when it finds a non-ELF file in modules + directory. This fixes Bug#9243. + + -- Manoj Srivastava Wed, 30 Apr 1997 15:24:51 -0500 + +kernel-source-0.13 (1.01) unstable; urgency=low + + * Really add in all the changes sent in by Herbert Xu. The changes are: + * Changed to source package name back to kernel-source-2.4.21-iyonix again. + * Changed the installs to be without -o root -g root since it is no + longer useful as the chowns are done before the packages are built. It + also means that if it is used in targets like stamp-configure which may + be run by anyone it won't not generate an error. + * Made rules file generate the control file. + * Fixed some typos in chown commands while generating the header + packages. + + -- Manoj Srivastava Mon, 21 Apr 1997 15:12:19 -0500 + + kernel-source-0.12 (1.01) unstable; urgency=low + + * Forgot to mention that the source package for the kernel packages + (produced by make-kpkg buildpackage, for example) has been changed to + not contain the kernel version as part of the name (all the deb files + produced have not changed), so we now get kernel-image-xxx_yy_zz.deb, + kernel-source-xxx_yy_zz.deb, and kernel-headers-xxx_yy_zz.deb, along + with kernel-source.tar.gz and kernel-source_yy.diff.gz + * Added changes from the kernel packages maintainer (this is the + kernel-packages maintainer speaking, Herbert Xu handles the kernel + image, headers, and source packages at the moment). + + -- Manoj Srivastava Sun, 13 Apr 1997 00:03:36 -0500 + + kernel-source-0.11 (1.01) unstable; urgency=low + + * set umask to copy the kernel source files untainted by package creators + umask. + * set umask to copy the kernel header files untainted by package creators + umask. + + -- Manoj Srivastava Tuesday, 1 Apr 1997 11:04:42 -0600 + + kernel-source-0.10 (1.01) unstable; urgency=low + + * image postinst no longer aborts when the user gives up on formatting a + floppy, but is offered a choice to proceed with a preformatted floppy. + * Fixed spelling errors in kernel image postinst + * Offer to user superformat if it exists. + * Tested boot floppy creation. + * Tested on 2.0.29, 2.1.29, and 2.1.30 + * Mention setfdprm in postinst if fail to format floppy. + * Fix a typo in code determining which floppy drive to use + * Allow leading whitespace in responses + + -- Manoj Srivastava Sun, 23 Mar 1997 22:53:13 -0600 + +kernel-source-0.9 (1.01) unstable; urgency=low + + n Stupid @#$%$%@! vi changed Feb to February in the changelog messing up + gencontrol. + + -- Manoj Srivastava Mon, 17 Feb 1997 19:29:02 -0600 + +kernel-source-0.8 (1.01) unstable; urgency=low + + * Removed extra root checks + * Added error messages to failed root check + + -- Manoj Srivastava Thursday, 13 February 1997 14:47:06 -0600 + +kernel-source-0.7 (1.01) unstable; urgency=low + + * Fixed kernel rules file so that one does not depend on the existence of modules + + -- Manoj Srivastava Tuesday, 28 January 1997 22:15:27 -0600 + +kernel-source-0.6 (1.01) unstable; urgency=low + + * changed priority of kernel-source package to optional + * changed priority of kernel-image package to optional + + -- Manoj Srivastava Fri, 22 Nov 1996 11:02:31 -0600 + + +kernel-source-0.5 (1.01) unstable; urgency=low + + * kernel-source-X.XX now no longer recommends bin86, since bin86 is only + available intel platforms. It now merely mentions it in the + description. + + -- Manoj Srivastava Thu, 7 Nov 1996 22:17:47 -0600 + +kernel-source-0.4 (1.01) unstable; urgency=low + + * kernel-source-X.XX now recommends bin86, which fixes Bug#4443 + * Added short, succinct (and potentially dangerous) instructions on + compiling kernels at the top of the README file. This fixes Bug#4445. + + -- Manoj Srivastava Wed, 6 Nov 1996 23:59:47 -0600 + +kernel-source-0.3 (1.01) unstable; urgency=low + + * Changed everything to new packaging standards. + * Major re-organization. + * Added explanation for kernel-headers-X.XX (and why we need this + package inspite of having headers in libc5-dev) + * Added README files for all packages (the old README files became + copyright files). + * Added target for buildpackage (wich needed a hack in the target clean + so as not to remove the ./debian directory prematurely) + + -- Manoj Srivastava Tue, 5 Nov 1996 22:42:12 -0600 + +kernel-source-0.2 (1.01) unstable; urgency=low + + * Made image.postinst more polite. + * Also enabled kernel-{source,image,headers} targets in kernel.rules + * Changed make-kpkg to also accept the new targets. + * Fixed typo in man page. + * The man page says it is an administrators man page rather than a + programmers man page. + * Recommended libc-dev for kernel-source and kernel-package + * source suggests ncurses3.0-dev, tk40-dev and the description explains + you could use make menuconfig rather than plain old make config if you + had these packages. + * Fixed typo in the rules for modules in /usr/src/modules/ directory + * Made the rules for such modules ignore errors (since they are not + really a part of this package, error there should not halt this build + (or so people seem to want it) + * Look for modules in the kernel config file (or the default config file + if the user has not supplied a config file), and only make modules and + install them if modules have been configured in the config file. This + could be tested better. + * Fixed the make-kpkg.8 man page so that it now does not seem to mandate + a source and diff file for additional modules installed under the + directory /usr/src/modules/ (whether these files are produced is at + the discretion of the maintainer of that modules package. + * Make configure depend on stamp-configure which in turn depends on + .config Hopefully, this will remake the image target if one changes + the config file Hopefully, this will not cause the image target to + build needlessly. + + -- Manoj Srivastava + +kernel-source-0.1 (1.01) unstable; urgency=low + + * Changed the scripts to refer to /usr/bin/perl rather than /bin/perl. + * Added an extended description to the image control file. + * Added a note that the dist target requires a PGP key. + * Fixed a typo (missing DEBDIR) in debian.rules. + * Fixed the targets expected by make-kpkg (kernel_image rather than + kernel-image, etc). + * In image.postinst, made arguments to system be a single argument if + the arguments contain shell meta-characters, (this way perl passes + them to sh -c). + * Made make-kpkg accept non floats as revision numbers, to facilitate + local names. + * Fixed silly bug in makefloppy in image.postinst. + * Fixed the extended description of the kernel-package package. + * Updated the image postinst to install the mbr, if it exists, and to + activate the root partition, and to not overwrite the mbr (oops). + * Changed maintainer email address to debian.org (I'll be in a state of + flux soon) + + + -- Manoj Srivastava + +Local variables: +mode: debian-changelog +End: diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/debian/control linux-arm-2.4-ds/debian/control --- linux-arm-2.4-ds.orig/debian/control 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/debian/control 2004-01-02 15:59:10.000000000 +0000 @@ -0,0 +1,80 @@ +Source: kernel-source-2.4.21-iyonix +Section: devel +Priority: optional +Maintainer: Peter Naulls +Standards-Version: 3.5.9.0 + +Package: kernel-headers-2.4.21-iyonix +Architecture: any +Section: devel +Priority: optional +Provides: kernel-headers, kernel-headers-2.4 +Description: Header files related to Linux kernel version 2.4.21-iyonix + This package provides kernel header files for version 2.4.21-iyonix, for sites + that want the latest kernel headers. Please read + /usr/share/doc/kernel-headers-2.4.21-iyonix/debian.README.gz for details + +Package: kernel-source-2.4.21-iyonix +Architecture: all +Section: devel +Priority: optional +Provides: kernel-source, kernel-source-2.4 +Depends: binutils, bzip2 +Recommends: libc-dev, gcc, make +Suggests: libncurses-dev | ncurses-dev, kernel-package +Description: Linux kernel source for version 2.4.21-iyonix + This package provides the source code for the Linux kernel version 2.4.21-iyonix. + . + You may configure the kernel to your setup by typing "make config" + and following instructions, but you could get ncursesX.X-dev and try + "make menuconfig" for a jazzier, and easier to use interface. There + are options to use QT or GNOME based configuration interfaces, but they + need additional packages to be installed. Also, please read the detailed + documentation in the file + /usr/share/doc/kernel-source-2.4.21-iyonix/README.headers.gz. + . + If you wish to use this package to create a custom Linux kernel, then + it is suggested that you investigate the package kernel-package, + which has been designed to ease the task of creating kernel image + packages. + +Package: kernel-image-2.4.21-iyonix +Architecture: arm +Section: base +Priority: optional +Provides: kernel-image, kernel-image-2.4 +Depends: coreutils | fileutils (>= 4.0) +Suggests: fdutils, kernel-doc-2.4.21-iyonix | kernel-source-2.4.21-iyonix +Description: Linux kernel binary image for version 2.4.21-iyonix. + This package contains the Linux kernel image for version 2.4.21-iyonix, + the corresponding System.map file, and the modules built by the + packager. It also contains scripts that try to ensure that the + system is not left in a unbootable state after an update. + . + If you wish to update a bootdisk, or to use a bootloader to make + installing and using the image easier, we suggest you install the latest + fdutils (for formatting a floppy to be used as boot disk), and LILO, for a + powerful bootloader. Of course, both these are optional. + . + Kernel image packages are generally produced using kernel-package, + and it is suggested that you install that package if you wish to + create a custom kernel from the sources. Please look at kernel-img.conf(5), + and /usr/share/doc/kernel-package/README.gz from the package kernel-package + for details on how to tailor the installation of this or any other kernel + image package + +Package: kernel-doc-2.4.21-iyonix +Architecture: all +Section: doc +Priority: optional +Provides: kernel-doc-2.4 +Suggests: kernel-image-2.4.21-iyonix +Description: Linux kernel specific documentation for version 2.4.21-iyonix. + This package provides various Readme's in the 2.4.21-iyonix kernel + Documentation/ subdirectory: these typically contain kernel-specific + installation notes for some drivers. for example. Please see + /usr/share/doc/kernel-doc-X.X.XX/Documentation/00-INDEX for a list of + contents. Please also read the Changes file, as it contains + information about the problems which may result by upgrading your + kernel. + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/debian/files linux-arm-2.4-ds/debian/files --- linux-arm-2.4-ds.orig/debian/files 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/debian/files 2004-01-02 16:09:29.000000000 +0000 @@ -0,0 +1 @@ +kernel-image-2.4.21-iyonix_2.4.21_arm.deb base optional diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/debian/rules linux-arm-2.4-ds/debian/rules --- linux-arm-2.4-ds.orig/debian/rules 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/debian/rules 2003-12-11 06:07:17.000000000 +0000 @@ -0,0 +1,2153 @@ +#! /usr/bin/make -f +############################ -*- Mode: Makefile -*- ########################### +## debian.rules --- +## Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu ) +## Created On : Sat Apr 27 06:36:31 1996 +## Created On Node : melkor.pilgrim.umass.edu +## Last Modified By : Manoj Srivastava +## Last Modified On : Wed Dec 10 23:55:54 2003 +## Last Machine Used: glaurung.green-gryphon.com +## Update Count : 653 +## Status : Unknown, Use with caution! +## HISTORY : +## Description : +## $Id: rules,v 1.227 2003/10/07 16:24:20 srivasta Exp $ +############################################################################### + +ifdef KPKG_ARCH + ifneq ($(strip $(KPKG_ARCH)),um) + ha:=-a$(KPKG_ARCH) + endif +endif + +DPKG_ARCH := dpkg-architecture +# set the dpkg-architecture vars +export DEB_BUILD_ARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_ARCH) +export DEB_BUILD_GNU_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_CPU) +export DEB_BUILD_GNU_TYPE := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_TYPE) +export DEB_HOST_ARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_ARCH) +export DEB_HOST_GNU_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_CPU) +export DEB_HOST_GNU_SYSTEM := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_SYSTEM) +export DEB_HOST_GNU_TYPE := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_SYSTEM:= $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_SYSTEM) + +# +# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \ +# sed 's/^Version: *//') +# + +# The version of kernel-package this belongs to +kpkg_version := 8.077 + +# The maintainer information. +maintainer = Herbert Xu +email= herbert@greathan.apana.org.au + +pgp=$(maintainer) + + +# Package specific stuff +# decide if image is meant to be in /boot rather than / +link_in_boot := +# Can we use symlinks? +no_symlink := +# If so, where is the real file (usually, vmlinuz-X.X.X is real, and +# vmlinuz is the link, this variable reverses it. +reverse_symlink := + +# The version numbers for kernel-image, kernel-headers and +# kernel-source are deduced from the Makefile (see below, +# and footnote 1 for details) + +# Whether to look for and install kernel patches by default. +# Be very careful if you do this. +patch_the_kernel := AUTO + +# do not create libc headers by default +make_libc_headers := NO + +# run make clean after build +do_clean := YES + +# install uncompressed kernel ELF-image (for oprofile) +int_install_vmlinux := NO + +# what kernel config target to run in our configure target. +config_target := oldconfig + + +# The default architecture (all if architecture independent) +CROSS_ARG:= + +ifdef KPKG_ARCH + architecture:=$(KPKG_ARCH) +else + #architecture:=$(shell CC=$(HOSTCC) dpkg --print-gnu-build-architecture) + architecture:=$(DEB_HOST_ARCH) +endif + +ifndef CROSS_COMPILE + ifneq ($(strip $(KPKG_ARCH)),um) + ifneq ($(strip $(architecture)),$(strip $(DEB_BUILD_ARCH))) + KERNEL_CROSS:=$(architecture)-$(strip $(DEB_HOST_GNU_SYSTEM))- + endif + endif +else + KERNEL_CROSS:=$(CROSS_COMPILE)- +endif + +ifneq ($(strip $(KERNEL_CROSS)),) + CROSS_ARG:=CROSS_COMPILE=$(KERNEL_CROSS) +endif + +KERNEL_ARCH:=$(architecture) +DEBCONFIG = $(CONFDIR)/config +IMAGEDIR=/boot +INT_IMAGE_DESTDIR=debian/tmp-image$(IMAGEDIR) + + +VERSION =$(shell egrep '^VERSION +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL =$(shell egrep '^PATCHLEVEL +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL =$(shell egrep '^SUBLEVEL +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +EXTRA_VERSION =$(shell egrep '^EXTRAVERSION +=' Makefile 2>/dev/null | \ + sed -e 's/EXTRAVERSION *= *\([^ \t]*\)/\1/') +HAVE_NEW_MODLIB =$(shell egrep '\(INSTALL_MOD_PATH\)' Makefile 2>/dev/null ) + +ifneq ($(strip $(EXTRA_VERSION)),) +HAS_ILLEGAL_EXTRA_VERSION =$(shell \ + perl -e '$$i="$(EXTRA_VERSION)"; $$i !~ m/^[a-z\d\.\-\+]+$$/o && print YES;') + ifneq ($(strip $(HAS_ILLEGAL_EXTRA_VERSION)),) + $(error Error: The EXTRAVERSION may only contain lowercase alphanumerics \ + and the characters - + . The current value is: $(EXTRA_VERSION). Aborting.) + endif +endif + +###################################################################### +### Architecture specific stuff ### +###################################################################### +# Each architecture has the following specified for it +# (a) The kernel image type (i.e. zImage or bzImage) +# (b) The dependency on a loader, if any +# (c) The name of the loader +# (d) The name of the documentation file for the loader +# (e) The build target +# (f) The location of the kernelimage source +# (g) The location of the kernelimage destination +# (h) The name of the arch specific configuration file +# Some architectures has sub architectures + +### m68k +ifeq ($(strip $(architecture)),m68k) + ifeq (,$(findstring /$(KPKG_SUBARCH)/,/amiga/atari/mac/mvme147/mvme16x/bvme6000/)) + GUESS_SUBARCH:=$(shell awk '/Model/ { print $$2}' /proc/hardware) + ifneq (,$(findstring Motorola,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=$(shell awk '/Model/ { print $$3}' /proc/hardware) + ifneq (,$(findstring MVME147,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=mvme147 + else + KPKG_SUBARCH:=mvme16x + endif + else + ifneq (,$(findstring BVME,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=bvme6000 + else + ifneq (,$(findstring Amiga,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=amiga + else + ifneq (,$(findstring Atari,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=atari + else + ifneq (,$(findstring Mac,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=mac + endif + endif + endif + endif + endif + endif + NEED_DIRECT_GZIP_IMAGE=NO + kimage := zImage + target = $(kimage) + kimagesrc = vmlinux.gz + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.$(KPKG_SUBARCH) + ifneq (,$(findstring $(KPKG_SUBARCH),mvme147 mvme16x bvme6000)) + loaderdep=vmelilo + loader=vmelilo + loaderdoc=VmeliloDefault + else + loaderdep= + loader=lilo + loaderdoc= + endif +endif + +### ARM +ifeq ($(strip $(architecture)),arm) + GUESS_SUBARCH:='netwinder' + + ifneq (,$(findstring $(KPKG_SUBARCH),netwinder)) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + kimage := zImage + target = Image + kimagesrc = arch/$(KERNEL_ARCH)/boot/Image + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + loaderdep= + loader=nettrom + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + DEBCONFIG= $(CONFDIR)/config.netwinder + else + kimage := zImage + target = zImage + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = arch/$(KERNEL_ARCH)/boot/zImage + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.arm + endif +endif + +### PowerPC +ifneq ($(strip $(filter ppc powerpc,$(architecture))),) + ifeq ($(DEB_BUILD_ARCH),powerpc) + # This is only meaningful when building on a PowerPC + ifeq ($(GUESS_SUBARCH),) + GUESS_SUBARCH:=$(shell awk '/machine/ { print $$3}' /proc/cpuinfo) + ifneq (,$(findstring Power,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=pmac + else + ifneq (,$(findstring iMac,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=pmac + endif + endif + else + GUESS_SUBARCH:=pmac + endif + endif + + ifeq (,$(findstring $(KPKG_SUBARCH),apus prpmc chrp mbx pmac prep Amiga APUs CHRP MBX PReP chrp-rs6k )) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + endif + + KERNEL_ARCH:=ppc + + ifneq (,$(findstring $(KPKG_SUBARCH),APUs apus Amiga)) + KPKG_SUBARCH:=apus + loader := NoLoader + kimage := vmapus.gz + target = zImage + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/boot/images ]; then \ + echo arch/$(KERNEL_ARCH)/boot/images/vmapus.gz ; else \ + echo arch/$(KERNEL_ARCH)/boot/$(kimage) ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.apus + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),chrp-rs6k)) + KPKG_SUBARCH:=chrp-rs6k + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/chrpboot ]; then \ + echo arch/$(KERNEL_ARCH)/chrpboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).chrp-rs6k ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.chrp + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),CHRP chrp)) + KPKG_SUBARCH:=chrp + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/chrpboot ]; then \ + echo arch/$(KERNEL_ARCH)/chrpboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).chrp ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.chrp + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),PRPMC prpmc)) + KPKG_SUBARCH:=prpmc + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = arch/$(KERNEL_ARCH)/boot/images/zImage.pplus + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),MBX mbx)) + KPKG_SUBARCH:=mbx + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/mbxboot ]; then \ + echo arch/$(KERNEL_ARCH)/mbxboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/zvmlinux.embedded; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.mbx + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),pmac)) + KPKG_SUBARCH:=pmac + target := zImage + ifeq ($(DEB_BUILD_ARCH),powerpc) + # This is only meaningful when building on a PowerPC + ifneq (,$(shell grep NewWorld /proc/cpuinfo)) + loaderdep=yaboot + loader=yaboot + #loaderdoc= + else + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + endif + else + loaderdep=yaboot + loader=yaboot + endif + kimagesrc = vmlinux + kimage := vmlinux + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + HAVE_COFF_IMAGE = YES + coffsrc = $(shell if [ -d arch/$(KERNEL_ARCH)/coffboot ]; then \ + echo arch/$(KERNEL_ARCH)/coffboot/$(kimage).coff ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).coff ; fi) + coffdest=$(INT_IMAGE_DESTDIR)/vmlinux.coff-$(version) + DEBCONFIG = $(CONFDIR)/config.pmac + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),PReP prep)) + KPKG_SUBARCH:=prep + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/boot/images ]; then \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).prep ; else \ + echo arch/$(KERNEL_ARCH)/boot/$(kimage) ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.prep + endif + +endif + + +##### Alpha +ifeq ($(strip $(architecture)),alpha) +kimage := vmlinuz +loaderdep= +loader=milo +loaderdoc= +target = boot +kimagesrc = arch/$(KERNEL_ARCH)/boot/vmlinux.gz +kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) +DEBCONFIG = $(CONFDIR)/config.alpha +endif + + +##### Sparc +ifeq ($(strip $(architecture)),sparc) + kimage := vmlinuz + loaderdep = silo + loader = silo + loaderdoc=SiloDefault + NEED_DIRECT_GZIP_IMAGE = YES + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.sparc + ARCH_IN_NAME = YES + + ifeq (,$(KPKG_SUBARCH)) + ifeq (sparc64,$(strip $(shell uname -m))) + KPKG_SUBARCH = sparc64 + else + KPKG_SUBARCH = sparc32 + endif + endif + + ifneq (,$(filter sparc64%,$(KPKG_SUBARCH))) + KERNEL_ARCH = sparc64 + else + ifneq (,$(filter sparc%,$(KPKG_SUBARCH))) + KERNEL_ARCH = sparc + else + KERNEL_ARCH = $(strip $(shell uname -m)) + endif + endif + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = image + kimagesrc = arch/$(KERNEL_ARCH)/boot/image + else + target = vmlinux + kimagesrc = vmlinux + endif +endif + + +##### i386 and such +ifeq ($(strip $(architecture)),i386) + # sub archs can be i386 i486 i586 i686 + GUESS_SUBARCH:=$(shell if test -f .config; then \ + perl -nle '/^CONFIG_M(.86)=y/ && print "$$1"' .config;\ + else \ + uname -m;\ + fi) + ifeq (,$(findstring $(KPKG_SUBARCH),i386 i486 i586 i686)) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + endif + kimage := bzImage + loaderdep=lilo (>= 19.1) | grub + loader=lilo + loaderdoc=LiloDefault + target = $(kimage) + kimagesrc = $(strip arch/$(KERNEL_ARCH)/boot/$(kimage)) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + kelfimagesrc = vmlinux + kelfimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) +endif + +##### S/390 +ifeq ($(strip $(architecture)),s390) + kimage := zimage + loaderdep=zipl + loader=zipl + loaderdoc= + target = image + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip arch/$(KERNEL_ARCH)/boot/$(target)) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### hppa +ifeq ($(strip $(architecture)),hppa) + kimage := vmlinux + loaderdep=palo + loader=palo + loaderdoc= + target=$(kimage) + NEED_DIRECT_GZIP_IMAGE=NO + # Override arch name because hppa uses arch/parisc not arch/hppa + KERNEL_ARCH := parisc + kimagesrc=$(kimage) + kimagedest=$(INT_IMAGE_DESTDIR)/vmlinux-$(version) + # This doesn't seem to work, but the other archs do it... + DEBCONFIG=$(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### ia64 +ifeq ($(strip $(architecture)),ia64) + kimage := vmlinuz + loaderdep=elilo + loader=elilo + loaderdoc= + target=compressed + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc=vmlinux.gz + kimagedest=$(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG=$(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### mips +ifeq ($(strip $(architecture)),mips) + kimage := vmlinux + loaderdep=arcboot + loader=arcboot + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip vmlinux) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = + else + target = boot + endif + + ifneq (,$(filter mips64%,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif + ifneq (,$(filter %-64,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif +endif + +##### mipsel +ifeq ($(strip $(architecture)),mipsel) + kimage := vmlinux + loaderdep=delo + loader=delo + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip vmlinux) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + KERNEL_ARCH= mips + #HAVE_COFF_IMAGE = YES + #coffsrc = $(strip arch/$(KERNEL_ARCH)/boot/vmlinux.ecoff) + #coffdest=$(INT_IMAGE_DESTDIR)/vmlinux.ecoff-$(version) + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = + else + target = boot + endif + + ifneq (,$(filter mips64el%,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif + ifneq (,$(filter %-64,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif +endif + +ifeq ($(strip $(architecture)),um) + kimage := linux + target = linux + loaderdep= + loaderdoc= +endif +###################################################################### +###################################################################### + +ifneq ($(strip $(loaderdep)),) + int_loaderdep := $(loaderdep), +else + int_loaderdep := +endif + + + +# The following variable is used to simplify the process of making +# diffs and orig targets, Please set it if AND ONLY IF no patches +# have been applied to the upstream source, in other words, we have +# just added debian* files. If any patches were applied, please +# leave it empty + +# NO_SRC_CHANGES = +NO_SRC_CHANGES = YES + + +# NOTE: FLAVOUR is now obsolete +# If you want to have more than one kernel configuration per kernel +# version, set FLAVOUR in the top level kernel Makefile *before* +# invoking make-kpkg -- it will be appended to UTS_RELEASE in +# version.h (separated by a hyphen). This affects everything -- the +# names and versions of the image, source, headers, and doc packages, +# and where the modules are searched for in /lib/modules. + +ifdef FLAVOUR +# uhm - should check if we really have a Makefile capable of Flavours? +endif + +FLAVOUR:=$(shell grep ^FLAVOUR Makefile 2>/dev/null | \ + perl -ple 's/FLAVOUR[\s:=]+//g') + +ifeq ($(strip $(FLAVOUR_SEP)),) +FLAVOUR_SEP:= + +endif + +ifneq ($(strip $(FLAVOUR)),) +INT_FLAV := $(FLAVOUR_SEP)$(FLAVOUR) +FLAV_ARG := FLAVOUR=$(FLAVOUR) +else +INT_FLAV := +FLAV_ARG := +endif + +## This is the replacement for FLAVOUR +EXTRAVERSION =$(strip $(EXTRA_VERSION)) +ifneq ($(strip $(APPEND_TO_VERSION)),) +iatv := $(strip $(APPEND_TO_VERSION)) +EXTRAV_ARG := EXTRAVERSION=${EXTRA_VERSION}${iatv} +else +iatv := +EXTRAV_ARG := +endif + +UTS_RELEASE_VERSION=$(shell if [ -f include/linux/version.h ]; then \ + grep 'define UTS_RELEASE' include/linux/version.h | \ + perl -nle 'm/^\s*\#define\s+UTS_RELEASE\s+("?)(\S+)\1/g && print $$2;';\ + else echo "" ; \ + fi) + +version = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(iatv)$(INT_FLAV) + +# KPKG_SUBARCH is used to distinguish Amiga, Atari, Macintosh, etc. kernels +# for Debian/m68k. INT_SUBARCH is used in the names of the image file +# produced. It only affects the naming of the kernel-image as the +# source and doc packages are architecture independent and the +# kernel-headers do not vary from one sub-architecture to the next. + +# This is the default +INT_SUBARCH := + +ifneq ($(strip $(ARCH_IN_NAME)),) +ifneq ($(strip $(KPKG_SUBARCH)),) +INT_SUBARCH := -$(KPKG_SUBARCH) +endif +endif + + + +# The name of the package (for example, `emacs'). +package := kernel-source-$(version) +h_package := kernel-headers-$(version) +i_package := kernel-image-$(version)$(INT_SUBARCH) +d_package := kernel-doc-$(version) +l_package := libc-kheaders + +SOURCE_TOP:= debian/tmp-source +HEADER_TOP:= debian/tmp-headers +IMAGE_TOP := debian/tmp-image +DOC_TOP := debian/tmp-doc + +SOURCE_DOC:= $(SOURCE_TOP)/usr/share/doc/$(package) +HEADER_DOC:= $(HEADER_TOP)/usr/share/doc/$(h_package) +IMAGE_DOC := $(IMAGE_TOP)/usr/share/doc/$(i_package) +DOC_DOC := $(DOC_TOP)/usr/share/doc/$(d_package) + +SOURCE_SRC:= $(SOURCE_TOP)/usr/src/$(package) +HEADER_SRC:= $(HEADER_TOP)/usr/src/$(h_package) + + + +FILES_TO_CLEAN = modules/modversions.h modules/ksyms.ver debian/files \ + conf.vars scripts/cramfs/cramfsck scripts/cramfs/mkcramfs \ + applied_patches debian/buildinfo +STAMPS_TO_CLEAN = stamp-build stamp-configure stamp-source stamp-image \ + stamp-headers stamp-src stamp-diff stamp-doc \ + stamp-buildpackage stamp-libc-kheaders stamp-debian \ + stamp-patch stamp-kernel-configure +DIRS_TO_CLEAN = $(SOURCE_TOP) $(HEADER_TOP) $(IMAGE_TOP) $(DOC_TOP) + +CONFLOC :=$(shell if test -f ~/.kernel-pkg.conf; then\ + echo ~/.kernel-pkg.conf; \ + else \ + echo /etc/kernel-pkg.conf; \ + fi) +LIBLOC :=/usr/share/kernel-package + +ifeq ($(strip $(MODULE_LOC)),) +MODULE_LOC =/usr/src/modules +endif + +DEBDIR = $(LIBLOC) +DEBDIR_NAME = $(shell basename $(DEBDIR)) + +ifeq ($(strip $(VERSIONED_PATCH_DIR)),) +VERSIONED_PATCH_DIR = $(shell if [ -d \ +/usr/src/kernel-patches/$(architecture)/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ + ]; then echo \ +/usr/src/kernel-patches/$(architecture)/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \ + fi) +endif + +ifeq ($(strip $(VERSIONED_ALL_PATCH_DIR)),) +VERSIONED_ALL_PATCH_DIR = $(shell if [ -d \ +/usr/src/kernel-patches/all/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ + ]; then echo \ +/usr/src/kernel-patches/all/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \ + fi) +endif + +ifeq ($(strip $(PATCH_DIR)),) +PATCH_DIR = $(shell if [ -d /usr/src/kernel-patches/$(architecture)/ ];\ + then echo /usr/src/kernel-patches/$(architecture); \ + fi) +endif + +ifeq ($(strip $(ALL_PATCH_DIR)),) +ALL_PATCH_DIR = $(shell if [ -d /usr/src/kernel-patches/all/ ]; \ + then echo /usr/src/kernel-patches/all/ ;\ + fi) +endif + +VERSIONED_ALL_PATCH_APPLY = $(VERSIONED_ALL_PATCH_DIR)/apply +VERSIONED_ALL_PATCH_UNPATCH = $(VERSIONED_ALL_PATCH_DIR)/unpatch + +VERSIONED_DIR_PATCH_APPLY = $(VERSIONED_PATCH_DIR)/apply +VERSIONED_DIR_PATCH_UNPATCH = $(VERSIONED_PATCH_DIR)/unpatch + +ALL_PATCH_APPLY = $(ALL_PATCH_DIR)/apply +ALL_PATCH_UNPATCH = $(ALL_PATCH_DIR)/unpatch + +DIR_PATCH_APPLY = $(PATCH_DIR)/apply +DIR_PATCH_UNPATCH = $(PATCH_DIR)/unpatch + +# The destination of all .deb files +# (suggested by Rob Browning ) +DEB_DEST := .. +SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +INSTALL_MOD_PATH=$(SRCTOP)/$(IMAGE_TOP) +KPKG_DEST_DIR ?= $(SRCTOP)/.. + +install_file= install -p -o root -g root -m 644 +install_program= install -p -o root -g root -m 755 +make_directory= install -p -d -o root -g root -m 755 +deb_rule = $(MAKE) -f $(DEBDIR)/rules + +# Include any site specific overrides here. +-include $(CONFLOC) + +# Over ride the config file from the environment/command line +ifneq ($(strip $(KPKG_MAINTAINER)),) +maintainer=$(KPKG_MAINTAINER) +endif + +ifneq ($(strip $(KPKG_EMAIL)),) +email=$(KPKG_EMAIL) +endif + +# This should be a name to feed the modules build for pgp signature, +# since we the maintainer would be different there. +ifneq ($(strip $(PGP_SIGNATURE)),) +pgp=$(PGP_SIGNATURE) +endif + +ifneq ($(strip $(EXTRA_DOCS)),) +extra_docs = $(EXTRA_DOCS) +endif + +ifneq ($(strip $(extra_docs)),) +HAVE_EXTRA_DOCS:=$(shell if [ -e $(extra_docs) ]; then echo YES; fi) +endif + +ifneq ($(strip $(DEBIAN_REVISION_MANDATORY)),) +debian_revision_mandatory:=$(DEBIAN_REVISION_MANDATORY) +endif + + +ifneq ($(strip $(install_vmlinux)),) +int_install_vmlinux:=$(install_vmlinux) +endif + +ifneq ($(strip $(KPKG_FOLLOW_SYMLINKS_IN_SRC)),) +int_follow_symlinks_in_src=YES +else +ifneq ($(strip $(kpkg_follow_symlinks_in_src)),) +int_follow_symlinks_in_src=YES +endif +endif + + + + + +# The Debian revision +ifneq ($(strip $(DEBIAN_REVISION)),) +HAS_CHANGELOG := $(shell \ + if test -f debian/changelog -a \( -f stamp-debian -o -f debian/official \);\ + then echo YES;\ + else echo NO; fi; ) +else +HAS_CHANGELOG := $(shell if test -f debian/changelog; then echo YES;\ + else echo NO; fi; ) +endif +# If there is a changelog file, it overrides. The only exception is +# when there is no stamp-config, and there is no debian/official, +# *AND* there is a DEBIAN_REVISION, in which case the DEBIAN_REVISION +# over rides (since we are going to replace the changelog file soon +# anyway. Else, use the commandline or env var setting. Or else +# default to 10.00.Custom, unless the human has requested that the +# revision is mandatory, in which case we raise an error + +ifeq ($(strip $(HAS_CHANGELOG)),YES) +debian := $(shell if test -f debian/changelog; then \ + perl -nle 'print /\((\S+)\)/; exit 0' debian/changelog;\ + fi; ) +else +ifneq ($(strip $(DEBIAN_REVISION)),) +debian := $(DEBIAN_REVISION) +else +ifeq ($(strip $(debian)),) +ifneq ($(strip $(debian_revision_mandatory)),) +$(error A Debian revision is mandatory, but none was provided) +else +debian := 10.00.Custom +endif +endif +endif +endif + +AM_OFFICIAL := $(shell if [ -f debian/official ]; then echo YES; fi ) + +# Hmm. The version that we have computed *MUST* match the one that is in the +# changelog. +ifeq ($(strip $(HAS_CHANGELOG)),YES) +saved_version := $(shell if test -f debian/changelog; then \ + perl -nle 'print /^kernel-source-(\S+)/; exit 0' \ + debian/changelog;\ + fi; ) +ifneq ($(strip $(saved_version)),) +ifneq ($(strip $(saved_version)),$(strip $(version))) +HAVE_VERSION_MISMATCH=YES +endif +endif +endif + + +ifneq ($(strip $(DELETE_BUILD_LINK)),) +delete_build_link := YES +else +ifeq ($(strip $(delete_build_link)),) +delete_build_link := $(shell if test -f debian/official; then echo YES;\ + else echo NO; fi; ) +endif +endif + +ifneq ($(strip $(IMAGE_IN_BOOT)),) +link_in_boot := $(IMAGE_IN_BOOT) +endif + +ifneq ($(strip $(LINK_IN_BOOT)),) +link_in_boot := $(LINK_IN_BOOT) +endif + +ifneq ($(strip $(NO_SYMLINK)),) +no_symlink := $(NO_SYMLINK) +endif + +ifneq ($(strip $(REVERSE_SYMLINK)),) +reverse_symlink := $(REVERSE_SYMLINK) +endif + +ifneq ($(strip $(IMAGE_TYPE)),) +kimage = $(IMAGE_TYPE) +endif + +ifneq ($(strip $(PATCH_THE_KERNEL)),) +patch_the_kernel = $(PATCH_THE_KERNEL) +endif + +ifneq ($(strip $(KPKG_SELECTED_PATCHES)),) +ifeq ($(strip $(patch_the_kernel)),NO) +patch_the_kernel = NO +else +ifeq ($(strip $(patch_the_kernel)),no) +patch_the_kernel = NO +else +patch_the_kernel = YES +endif +endif +endif + + +ifeq ($(strip $(patch_the_kernel)),yes) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),Yes) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),YEs) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yEs) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yES) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yeS) +patch_the_kernel = YES +endif + + + +ifneq ($(strip $(CONFIG_TARGET)),) +config_target := $(CONFIG_TARGET) +have_new_config_target := YES +endif + +# If config_target doesn't end in `config' then reset it to `oldconfig'. +ifneq ($(patsubst %config,config,$(strip $(config_target))),config) +config_target := oldconfig +have_new_config_target := +endif + +ifneq ($(strip $(USE_SAVED_CONFIG)),) +use_saved_config = $(USE_SAVED_CONFIG) +endif + +#ifeq ($(origin var),command line) +#$(warn You are setting an internal var from the cmdline. Use at your own risk) +#endif +#you can automated it a bit more with $(foreach) and $(if) + +###ROOT_COMMAND +ifneq ($(strip $(ROOT_CMD)),) +int_root_cmd := -r$(strip $(ROOT_CMD)) +else +# well, ROOT_CMD is not set yet +ifneq ($(strip $(root_cmd)),) + +# Try and set ROOT_CMD from root_cmd +int_dummy_root := $(root_cmd) +ifneq ($(strip $(findstring -us, $(int_dummy_root))),) +int_dummy_root := $(subst -us,, $(strip $(int_dummy_root))) +endif +ifneq ($(strip $(findstring -uc, $(int_dummy_root))),) +int_dummy_root := $(subst -uc,, $(strip $(int_dummy_root))) +endif + + +ifneq ($(strip $(findstring -r, $(int_dummy_root))),) +ROOT_CMD := $(patsubst -r%, %, $(filter -r%, $(strip $(int_dummy_root)))) +else +ROOT_CMD := $(strip $(root_cmd)) +endif + + +ifeq ($(strip $(findstring -r, $(root_cmd))),) +int_root_cmd := -r$(strip $(root_cmd)) +else +int_root_cmd := $(root_cmd) +endif +endif +endif + +ifneq ($(strip $(UNSIGN_SOURCE)),) +int_root_cmd := $(int_root_cmd) -us +endif + +ifneq ($(strip $(UNSIGN_CHANGELOG)),) +int_root_cmd := $(int_root_cmd) -uc +endif + +# make sure that root_cmd and int_root_cmd are the same +ifneq ($(strip $(int_root_cmd)),) +root_cmd := $(int_root_cmd) +endif + +int_am_root := $(shell [ $$(id -u) -eq 0 ] && echo "YES" ) +int_get_root := $(shell [ $$(id -u) -ne 0 ] && echo "$(ROOT_CMD)" ) + + +ifneq ($(strip $(CLEAN_SOURCE)),) +do_clean = $(CLEAN_SOURCE) +endif + +ifneq ($(strip $(CONCURRENCY_LEVEL)),) +do_parallel = -j$(CONCURRENCY_LEVEL) + +# Well, I wish there was something better than guessing by version number +CAN_DO_DEP_FAST=$(shell if [ $(VERSION) -lt 2 ]; then echo ''; \ + elif [ $(VERSION) -gt 2 ]; then echo YES; \ + elif [ $(PATCHLEVEL) -lt 4 ]; then echo ''; \ + else echo YES; \ + fi) +ifneq ($(strip $(CAN_DO_DEP_FAST)),) +fast_dep= -j$(CONCURRENCY_LEVEL) +endif + +endif + +ifneq ($(strip $(SOURCE_CLEAN_HOOK)),) +source_clean_hook=$(SOURCE_CLEAN_HOOK) +endif +ifneq ($(strip $(HEADER_CLEAN_HOOK)),) +header_clean_hook=$(HEADER_CLEAN_HOOK) +endif +ifneq ($(strip $(DOC_CLEAN_HOOK)),) +doc_clean_hook=$(DOC_CLEAN_HOOK) +endif + +ifneq ($(strip $(INITRD)),) +initrddep := initrd-tools (>= 0.1.48), # there is a space here +else +initrddep := +endif + +ifeq ($(strip $(CONFDIR)),) +ifeq ($(strip $(patch_the_kernel)),YES) +CONFDIR = $(PATCH_DIR) +else +ifeq ($(strip $(patch_the_kernel)),yes) +CONFDIR = $(PATCH_DIR) +else +CONFDIR = $(DEBDIR)/Config +endif +endif +endif + +# The file which has local configuration +CONFIG_FILE := $(shell if test -e .config ; then \ + echo .config; \ + elif test -e $(DEBCONFIG) ; then \ + echo $(DEBCONFIG); \ + elif test -e $(CONFDIR)/config ; then \ + echo $(CONFDIR)/config ; \ + elif test -e $(DEBDIR)/config ; then \ + echo $(DEBDIR)/config ; \ + elif test -e /boot/config-$(version) ; then \ + echo /boot/config-$(version) ; \ + elif test -e /boot/config-$$(uname -r) ; then \ + echo /boot/config-$$(uname -r) ; \ + else echo /dev/null ; \ + fi) + + +# See if we are being run in the kernel directory +IN_KERNEL_DIR := $(shell if test -d drivers -a -d kernel -a -d fs -a \ + -d include/linux ; then \ + echo YES; \ + fi ) + +IN_KERNEL_HEADERS=$(shell if [ -f kernel-headers.revision ]; then \ + cat kernel-headers.revision; \ + else echo "" ; \ + fi) + +ifeq ($(strip $(IN_KERNEL_DIR)),) +ifneq ($(strip $(IN_KERNEL_HEADERS)),) +version=$(UTS_RELEASE_VERSION) +debian=$(IN_KERNEL_HEADERS) +endif +endif + + +# Deal with modules issues + +# define MODULES_ENABLED if appropriate +ifneq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) +MODULES_ENABLED := YES +endif + +# accept both space separated list of modules, as well as comma +# separated ones +comma:= , +empty:= +space:= $(empty) $(empty) +valid_modules:= + +# See what modules we are talking about +ifeq ($(strip $(MODULES_ENABLED)),YES) +ifneq ($(strip $(KPKG_SELECTED_MODULES)),) +canonical_modules=$(subst $(comma),$(space),$(KPKG_SELECTED_MODULES)) +else +canonical_modules=$(shell test -e $(MODULE_LOC) && \ + find $(MODULE_LOC) -follow -maxdepth 1 -type d -print |\ + egrep -v '^$(MODULE_LOC)$$') +endif + + +# Now, if we have any modules at all, they are in canonical_modules +ifneq ($(strip $(canonical_modules)),) + +# modules can have the full path, or just the name of the module. We +# make all the modules ahve absolute paths by fleshing them out. +path_modules :=$(filter /%, $(canonical_modules)) +no_path_modules:=$(filter-out /%, $(canonical_modules)) +fleshed_out :=$(foreach mod,$(no_path_modules),$(MODULE_LOC)/$(mod)) + +# Hmmph. recreate the canonical modules; now everything has a full +# path name. + +canonical_modules:=$(path_modules) $(fleshed_out) +# test to see if the dir names are real +valid_modules = $(shell for dir in $(canonical_modules); do \ + if [ -d $$dir ] && [ -x $$dir/debian/rules ]; then \ + echo $$dir; \ + fi; \ + done) + + +endif +endif + +ifeq ($(strip $(patch_the_kernel)),YES) + +# Well then. Let us see if we want to select the patches we apply. +ifneq ($(strip $(KPKG_SELECTED_PATCHES)),) +canonical_patches=$(subst $(comma),$(space),$(KPKG_SELECTED_PATCHES)) + +ifneq ($(strip $(canonical_patches)),) +# test to see if the patches exist +temp_valid_patches = $(shell for name in $(canonical_patches); do \ + if [ -x $(VERSIONED_DIR_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_APPLY)/$$name; \ + elif [ -x $(VERSIONED_ALL_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_APPLY)/$$name; \ + elif [ -x $(DIR_PATCH_APPLY)/$$name -a \ + -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_APPLY)/$$name; \ + elif [ -x $(ALL_PATCH_APPLY)/$$name -a \ + -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_APPLY)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) + +temp_patch_not_found = $(filter %.error, $(temp_valid_patches)) +patch_not_found = $(subst .error,,$(temp_patch_not_found)) +ifneq ($(strip $(patch_not_found)),) +$(error Could not find patch for $(patch_not_found)) +endif + +valid_patches = $(filter-out %.error, $(temp_valid_patches)) + +ifeq ($(strip $(valid_patches)),) +$(error Could not find patch scripts for $(canonical_patches)) +endif + + + +canonical_unpatches = $(shell new=""; \ + for name in $(canonical_patches); do \ + new="$$name $$new"; \ + done; \ + echo $$new;) + +temp_valid_unpatches = $(shell for name in $(canonical_unpatches); do \ + if [ -x $(VERSIONED_DIR_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_UNPATCH)/$$name;\ + elif [ -x $(VERSIONED_ALL_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_UNPATCH)/$$name;\ + elif [ -x $(DIR_PATCH_APPLY)/$$name -a \ + -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_UNPATCH)/$$name; \ + elif [ -x $(ALL_PATCH_APPLY)/$$name -a \ + -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_UNPATCH)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) +temp_unpatch_not_found = $(filter %.error, $(temp_valid_unpatches)) +unpatch_not_found = $(subst .error,,$(temp_unpatch_not_found)) +ifneq ($(strip $(unpatch_not_found)),) +$(error Could not find unpatch for $(unpatch_not_found)) +endif + +valid_unpatches = $(filter-out %.error, $(temp_valid_unpatches)) + +ifeq ($(strip $(valid_unpatches)),) +$(error Could not find un-patch scripts for $(canonical_unpatches)) +endif + + +endif +endif +endif + +old_applied_patches=$(shell if [ -f applied_patches ]; then \ + cat applied_patches; \ + else \ + echo ''; \ + fi ) + +ifeq ($(strip $(valid_unpatches)),) +ifneq ($(strip $(old_applied_patches)),) +old_unpatches=$(shell new=""; \ + for name in $(notdir $(old_applied_patches)); do \ + new="$$name $$new"; \ + done; \ + echo $$new;) +temp_old_unpatches = $(shell for name in $(old_unpatches); do \ + if [ -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_UNPATCH)/$$name;\ + elif [ -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_UNPATCH)/$$name;\ + elif [ -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_UNPATCH)/$$name; \ + elif [ -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_UNPATCH)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) +temp_old_unpatch_not_found = $(filter %.error, $(temp_old_unpatches)) +old_unpatch_not_found = $(subst .error,,$(temp_unpatch_not_found)) +valid_unpatches = $(filter-out %.error, $(temp_old_unpatches)) +endif +endif + +# See if the version numbers are valid +HAVE_VALID_PACKAGE_VERSION := $(shell \ + if test -x $(DEBDIR)/kpkg-vercheck; then \ + $(DEBDIR)/kpkg-vercheck $(debian) ; \ + else \ + echo "Could not find $(DEBDIR)/kpkg-vercheck" ; \ + fi ) + +TAR_COMPRESSION := $(shell \ + if tar --help | grep -- \-\-bzip2 >/dev/null; then \ + echo --bzip2; \ + else \ + echo --gzip; \ + fi ) +TAR_SUFFIX := $(shell \ + if tar --help | grep -- \-\-bzip2 >/dev/null; then \ + echo bz2; \ + else \ + echo gz; \ + fi ) + +STOP_FOR_BIN86 = NO +CONTROL=$(DEBDIR)/Control +ifeq ($(strip $(architecture)),i386) +NEED_BIN86 := $(shell if dpkg --compare-versions \ + $(VERSION).$(PATCHLEVEL) lt 2.4 >/dev/null 2>&1; \ + then echo YES; fi) +ifeq ($(strip $(NEED_BIN86)),YES) +CONTROL=$(DEBDIR)/Control.bin86 +HAVE_BIN86 := $(shell if test -x /usr/bin/as86; then echo YES; \ + else echo NO; fi ) +ifeq ($(strip $(HAVE_BIN86)),NO) +STOP_FOR_BIN86 = YES +endif +endif +endif + +# Bug out if the version number id not all lowercase +lc_version = $(shell echo $(version) | tr A-Z a-z) +ifneq ($(strip $(version)),$(strip $(lc_version))) +$(error Error. The version number $(strip $(version)) is not all \ + lowercase. Since the version ends up in the package name of the \ + kernel image package, this is a Debian policy violation, and \ + the packaging system shall refuse to package the image. ) +endif + +ifeq (,$(strip $(kimagedest))) +$(error Error. I do not know where the kernel image goes to [kimagedest undefined]\ + The usual case for this is that I could not determine which arch or subarch \ + tihs machine belongs to. Please specify a subarch, and try again.) +endif +ifeq (,$(strip $(kimagesrc))) +$(error Error. I do not know where the kernel image goes to [kimagesrc undefined]\ + The usual case for this is that I could not determine which arch or subarch \ + tihs machine belongs to. Please specify a subarch, and try again.) +endif + +# export variables +export root_cmd FLAVOUR INT_SUBARCH APPEND_TO_VERSION UNSIGN_CHANGELOG \ + UNSIGN_SOURCE ROOT_CMD MODULE_LOC EXTRAVERSION ALL_PATCH_DIR \ + ALL_PATCH_APPLY ALL_PATCH_UNPATCH DIR_PATCH_UNPATCH \ + DIR_PATCH_APPLY VERSIONED_PATCH_DIR VERSIONED_ALL_PATCH_UNPATCH \ + VERSIONED_ALL_PATCH_APPLY VERSIONED_DIR_PATCH_UNPATCH \ + VERSIONED_DIR_PATCH_APPLY KPKG_SELECTED_PATCHES \ + KPKG_SELECTED_MODULES CONCURRENCY_LEVEL + + +ifeq ($(strip $(IN_KERNEL_DIR)),) +# Hah! Not in kernel directory!! +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage \ +libc_kheaders libc-kheaders stamp-libc-kheaders kernel-image-deb debian: + @echo "You should invoke this command from the top level directory of" + @echo "a linux kernel source directory tree, and as far as I can tell," + @echo "the current directory:" + @echo " $(SRCTOP)" + @echo "is not a top level linux kernel source directory. " + @echo "" + @echo " (If I am wrong then kernel-packages and the linux kernel" + @echo " are so out sync that you'd better get the latest versions" + @echo " of the kernel-package package and the Linux sources)" + @echo "" + @echo "Please change directory to wherever linux kernel sources" + @echo "reside and try again." +else +ifneq ($(strip $(HAVE_VALID_PACKAGE_VERSION)),YES) +# Hah! Bogus version number +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage kernel-image-deb \ +debian: + @echo "Problems ecountered with the version number $(debian)." + @echo "$(HAVE_VALID_PACKAGE_VERSION)" + @echo "" + @echo "Please re-read the README file and try again." +else +ifeq ($(strip $(STOP_FOR__BIN86)),YES) +# Hah! we need bin 86, but it aint here +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage kernel-image-deb \ +debian: + @echo "You Need to install the package bin86 before you can " + @echo "compile the kernel on this machine" + @echo "" + @echo "Please install bin86 and try again." +else +all build: debian configure stamp-build +stamp-build: +# Builds the binary package. +# debian.config contains the current idea of what the image should +# have. +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif +ifneq ($(strip $(UTS_RELEASE_VERSION)), $(strip $(version))) + @echo "The UTS Release version in include/linux/version.h" + @echo " \"$(strip $(UTS_RELEASE_VERSION))\" " + @echo "does not match current version " + @echo " \"$(strip $(version))\" " + @echo "Reconfiguring." + touch Makefile +endif + -test -f stamp-configure || $(deb_rule) configure + $(MAKE) $(do_parallel) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \ + $(CROSS_ARG) $(target) +ifneq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + $(MAKE) $(do_parallel) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \ + $(CROSS_ARG) modules +endif + COLUMNS=150 dpkg -l 'gcc*' perl dpkg 'libc6*' binutils ldso make dpkg-dev |\ + awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > debian/buildinfo + @echo this was built on a machine with the kernel: >> debian/buildinfo + uname -a >> debian/buildinfo + echo using the compiler: >> debian/buildinfo + grep LINUX_COMPILER include/linux/compile.h | \ + sed -e 's/.*LINUX_COMPILER "//' -e 's/"$$//' >> debian/buildinfo + echo done > $@ + +buildpackage: clean stamp-buildpackage +stamp-buildpackage: configure +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + test -f stamp-configure || $(deb_rule) configure + echo 'Building Package' > stamp-building +ifneq ($(strip $(root_cmd)),) + dpkg-buildpackage -nc $(strip $(root_cmd)) -m"$(maintainer) <$(email)>" -k"$(pgp)" +else + dpkg-buildpackage -nc -m"$(maintainer) <$(email)>" -k"$(pgp)" +endif + rm -f stamp-building + echo done > $@ + +# stamp-debian and stamp-configure used to be a single target. Now +# they are split - the reason is that arch-indep packages need to be +# built before arch-dep packages, and make-kpkg tries to do 'make +# config' for both cases. This used to work because the .config file +# resided with kernel-source, but now that it is in kernel-patch, it +# breaks down. I think the cleanest way out of this is to only deal +# with config files when necessary, and thus the split. Herbert Xu +debian: stamp-debian +stamp-debian: +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + @test -f $(DEBDIR)/rules || \ + echo Error: Could not find $(DEBDIR)/rules + -test ! -f stamp-debian && test ! -f debian/official && \ + rm -rf ./debian && mkdir ./debian +ifeq ($(strip $(patch_the_kernel)),YES) + -test -f applied_patches && rm -f applied_patches +ifneq ($(strip $(valid_patches)),) + -for patch in $(valid_patches) ; do \ + if test -x $$patch; then \ + if $$patch; then \ + echo "Patch $$patch processed fine"; \ + echo "$(notdir $$patch)" >> applied_patches; \ + else \ + echo "Patch $(notdir $$patch) failed."; \ + echo "Hit return to Continue"; \ + read ans; \ + fi; \ + fi; \ + done + echo done > stamp-patch +else + if [ -n "$(VERSIONED_PATCH_DIR)" -a \ + -d $(VERSIONED_DIR_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(VERSIONED_DIR_PATCH_APPLY); \ + (cd $(VERSIONED_DIR_PATCH_APPLY); ls -1) >> \ + applied_patches; \ + echo done > stamp-patch; \ + else \ + true; \ + fi + if [ -n "$(VERSIONED_ALL_PATCH_DIR)" -a \ + -d $(VERSIONED_ALL_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(VERSIONED_ALL_PATCH_APPLY); \ + (cd $(VERSIONED_ALL_PATCH_APPLY); ls -1) >> \ + applied_patches; \ + echo done > stamp-patch; \ + else \ + true; \ + fi + if [ -n "$(PATCH_DIR)" -a \ + -d $(DIR_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(DIR_PATCH_APPLY); \ + (cd $(DIR_PATCH_APPLY); ls -1) >> applied_patches;\ + else \ + true; \ + fi + if [ -n "$(ALL_PATCH_DIR)" -a \ + -d $(ALL_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(ALL_PATCH_APPLY); \ + (cd $(ALL_PATCH_APPLY); ls -1) >> applied_patches;\ + echo done > stamp-patch; \ + else \ + true; \ + fi +endif +endif + -test ! -f stamp-debian -a \ + ! \( -f debian/official -a -f debian/control \) && \ + sed -e 's/=V/$(version)/g' -e 's/=D/$(debian)/g' \ + -e 's/=A/$(architecture)/g' -e 's/=SA/$(INT_SUBARCH)/g' \ + -e 's/=L/$(int_loaderdep) /g' -e 's/=I/$(initrddep)/g' \ + -e 's/=CV/$(VERSION).$(PATCHLEVEL)/g' \ + -e 's/=M/$(maintainer) <$(email)>/g' \ + $(CONTROL)> debian/control + -test ! -f stamp-debian && test ! -f debian/official && \ + sed -e 's/=V/$(version)/g' -e 's/=D/$(debian)/g' \ + -e 's/=A/$(architecture)/g' -e 's/=M/$(maintainer) <$(email)>/g' \ + $(DEBDIR)/changelog > debian/changelog + -test ! -f debian/rules && \ + install -p -m 755 $(DEBDIR)/rules debian/rules + echo done > $@ + +# We could always do $(MAKE) -n -p dummy | grep ^CC >> .mak here if we cared +ifeq ($(strip $(INCLUDE_KERNEL_MAKEFILE)),yes) +include Makefile +conf_vars: + @echo Please ignore the warning about overriding and ignoring targets above. + @echo These are harmless. They are only invoked in a part of the process + @echo that tries to snarf variable values for the conf.vars file. + @echo "VERSION = $(VERSION)" > .mak + @echo "PATCHLEVEL = $(PATCHLEVEL)" >> .mak + @echo "SUBLEVEL = $(SUBLEVEL)" >> .mak + @echo "EXTRAVERSION = $(EXTRAVERSION)" >> .mak +ifneq ($(strip $(iatv)),) + @echo "APPEND_TO_VERSION = $(iatv)" >> .mak +endif + @echo "ARCH = $(ARCH)" >> .mak + @echo "KPKG_ARCH = $(KPKG_ARCH)" >> .mak + @echo "HOSTCC = $(HOSTCC)" >> .mak + @echo "HOSTCFLAGS = $(HOSTCFLAGS)" >> .mak + @echo "CROSS_COMPILE = $(CROSS_COMPILE)" >> .mak + @echo "AS = $(AS)" >> .mak + @echo "LD = $(LD)" >> .mak + @echo "CC = $(CC)" >> .mak + @echo "CPP = $(CPP)" >> .mak + @echo "AR = $(AR)" >> .mak + @echo "NM = $(NM)" >> .mak + @echo "STRIP = $(STRIP)" >> .mak + @echo "OBJCOPY = $(OBJCOPY)" >> .mak + @echo "OBJDUMP = $(OBJDUMP)" >> .mak + @echo "MAKE = $(MAKE)" >> .mak + @echo "GENKSYMS = $(GENKSYMS)" >> .mak + @echo "CFLAGS = $(CFLAGS)" >> .mak + @echo "AFLAGS = $(AFLAGS)" >> .mak + @echo "MODFLAGS = $(MODFLAGS)" >> .mak + @echo "do_parallel = $(do_parallel)" >> .mak + @echo "fast_dep = $(fast_dep)" >> .mak + @sed -e 's%$(TOPDIR)%$$(TOPDIR)%g' .mak > conf.vars + @rm -f .mak +else +conf.vars: Makefile + $(MAKE) -f debian/rules INCLUDE_KERNEL_MAKEFILE=yes conf_vars +endif + +dummy_do_dep: + +$(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) $(CROSS_ARG) \ + ARCH=$(KERNEL_ARCH) $(fast_dep) dep + +stamp-kernel-configure: stamp-debian .config + $(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) $(CROSS_ARG) \ + ARCH=$(KERNEL_ARCH) $(config_target) +ifeq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 ]; then \ + echo new;fi),) + +$(MAKE) -f ./debian/rules dummy_do_dep + $(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) $(CROSS_ARG) \ + ARCH=$(KERNEL_ARCH) clean +else + $(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) $(CROSS_ARG) \ + ARCH=$(KERNEL_ARCH) prepare +endif + echo done > $@ + +configure: debian .config stamp-configure +stamp-configure: stamp-debian .config conf.vars stamp-kernel-configure + echo done > $@ + + + +.config: +ifneq ($(strip $(use_saved_config)),NO) + test -f .config || test ! -f .config.save || \ + cp -pf .config.save .config +endif + test -f .config || test ! -f $(CONFIG_FILE) || \ + cp -pf $(CONFIG_FILE) .config + test -f .config || test ! -f $(DEBDIR)/config || \ + cp -pf $(DEBDIR)/config .config +ifeq ($(strip $(have_new_config_target)),) + test -f .config || (echo "*** Need a config file .config" && false) +endif +# if $(have_new_config_target) is set, then we need not have a .config +# file at this point + +clean: +ifeq ($(strip $(int_am_root)),) +ifeq ($(strip $(int_get_root)),) + @echo "You may need root privileges - some parts may fail" +endif + $(int_get_root) $(deb_rule) real_stamp_clean +else + $(deb_rule) real_stamp_clean +endif + +# Perhaps a list of patches should be dumped to a file on patching? so we +# only unpatch what we have applied? That would be changed, though saner, +# behaviour +real_stamp_clean: + test ! -f .config || cp -pf .config config.precious + -test -f Makefile && \ + $(MAKE) $(FLAV_ARG) $(EXTRAV_ARG) ARCH=$(KERNEL_ARCH) distclean + test ! -f config.precious || mv -f config.precious .config +ifeq ($(strip $(patch_the_kernel)),YES) + $(deb_rule) unpatch_now +endif +ifeq ($(strip $(NO_UNPATCH_BY_DEFAULT)),) + test ! -f stamp-patch || $(deb_rule) unpatch_now +endif + -test -f stamp-building || test -f debian/official || rm -rf debian + rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN) + rm -rf $(DIRS_TO_CLEAN) + + +unpatch_now: +ifneq ($(strip $(valid_unpatches)),) + -for patch in $(valid_unpatches) ; do \ + if test -x $$patch; then \ + if $$patch; then \ + echo "Removed Patch $$patch "; \ + else \ + echo "Patch $$patch failed."; \ + echo "Hit return to Continue"; \ + read ans; \ + fi; \ + fi; \ + done + rm -f stamp-patch +else + if [ -n "$(VERSIONED_PATCH_DIR)" -a \ + -d $(VERSIONED_DIR_PATCH_UNPATCH) ]; then \ + run-parts --report $(VERSIONED_DIR_PATCH_UNPATCH); \ + else \ + true; \ + fi + if [ -n "$(VERSIONED_ALL_PATCH_DIR)" -a \ + -d $(VERSIONED_ALL_PATCH_UNPATCH) ]; then \ + run-parts --report $(VERSIONED_ALL_PATCH_UNPATCH); \ + else \ + true; \ + fi + if [ -n "$(PATCH_DIR)" -a \ + -d $(DIR_PATCH_UNPATCH) ]; then \ + run-parts --report $(DIR_PATCH_UNPATCH); \ + else \ + true; \ + fi + if [ -n "$(ALL_PATCH_DIR)" -a \ + -d $(ALL_PATCH_UNPATCH) ]; then \ + run-parts --report $(ALL_PATCH_UNPATCH); \ + else \ + true; \ + fi + rm -f stamp-patch +endif + + +binary: binary-indep binary-arch +binary-indep: kernel_source kernel_doc +binary-arch: kernel_image kernel_headers + + +kernel-source kernel_source: stamp-source +stamp-source: stamp-debian +ifeq ($(strip $(int_am_root)),) +ifeq ($(strip $(int_get_root)),) + @echo need root privileges; exit 1 +else + $(int_get_root) $(deb_rule) real_stamp_source +endif +else + $(deb_rule) real_stamp_source +endif + +real_stamp_source: +ifeq ($(strip $(architecture)),um) + echo done > stamp-source +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + test -f stamp-debian || $(deb_rule) debian + rm -rf $(SOURCE_TOP) + $(make_directory) $(SOURCE_TOP)/DEBIAN + $(make_directory) $(SOURCE_SRC) + $(make_directory) $(SOURCE_DOC) + sed -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \ + $(DEBDIR)/include.postinst > $(SOURCE_TOP)/DEBIAN/postinst + chmod 755 $(SOURCE_TOP)/DEBIAN/postinst + $(install_file) debian/changelog $(SOURCE_DOC)/changelog + gzip -9qf $(SOURCE_DOC)/changelog + $(install_file) $(DEBDIR)/README $(SOURCE_DOC)/debian.README + gzip -9qf $(SOURCE_DOC)/debian.README + $(install_file) $(DEBDIR)/README.grub $(SOURCE_DOC)/README.grub + gzip -9qf $(SOURCE_DOC)/README.grub + $(install_file) $(DEBDIR)/README.headers $(SOURCE_DOC)/README.headers + gzip -9qf $(SOURCE_DOC)/README.headers + $(install_file) $(DEBDIR)/README.tecra $(SOURCE_DOC)/README.tecra + gzip -9qf $(SOURCE_DOC)/README.tecra + $(install_file) $(DEBDIR)/README.modules $(SOURCE_DOC)/README.modules + gzip -9qf $(SOURCE_DOC)/README.modules + $(install_file) $(DEBDIR)/sample.module.control \ + $(SOURCE_DOC)/sample.module.control + gzip -9qf $(SOURCE_DOC)/sample.module.control + $(install_file) README $(SOURCE_DOC)/README + gzip -9qf $(SOURCE_DOC)/README + $(install_file) $(DEBDIR)/Flavours $(SOURCE_DOC)/Flavours + gzip -9qf $(SOURCE_DOC)/Flavours + $(install_file) $(DEBDIR)/Rationale $(SOURCE_DOC)/Rationale + gzip -9qf $(SOURCE_DOC)/Rationale + $(install_file) $(DEBDIR)/copyright.source $(SOURCE_DOC)/copyright + echo "This was produced by kernel-package version $(kpkg_version)." > \ + $(SOURCE_DOC)/Buildinfo +ifneq ($(strip $(int_follow_symlinks_in_src)),) + -tar cfh - `echo * | sed -e 's/ debian//g' -e 's/\.deb//g' ` \ + | (cd $(SOURCE_SRC); umask 000; tar xpsf -) + (cd $(SOURCE_SRC)/include; rm -rf asm ; ) +else + -tar cf - `echo * | sed -e 's/ debian//g' -e 's/\.deb//g' ` \ + | (cd $(SOURCE_SRC); umask 000; tar xspf -) + (cd $(SOURCE_SRC)/include; rm -f asm ; ) +endif + (cd $(SOURCE_SRC); \ + $(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) distclean) + (cd $(SOURCE_SRC); rm -f stamp-building $(STAMPS_TO_CLEAN)) + (cd $(SOURCE_SRC); \ + [ ! -d scripts/cramfs ] || make -C scripts/cramfs distclean ; ) + if test -f debian/official -a -f debian/README.Debian ; then \ + $(install_file) debian/README.Debian $(SOURCE_SRC)/README.Debian ; \ + $(install_file) debian/README.Debian $(SOURCE_DOC)/README.Debian ; \ + gzip -9qf $(SOURCE_DOC)/README.Debian;\ + else \ + sed -e 's/=V/$(version)/g' -e 's/=A/$(architecture)/g' \ + $(DEBDIR)/README.source > $(SOURCE_SRC)/README.Debian ; \ + fi + if test -f README.Debian ; then \ + $(install_file) README.Debian $(SOURCE_DOC)/README.Debian.1st; \ + gzip -9qf $(SOURCE_DOC)/README.Debian.1st;\ + fi +ifneq ($(strip $(source_clean_hook)),) + (cd $(SOURCE_SRC); \ + test -x $(source_clean_hook) && $(source_clean_hook)) +endif + chmod -R og=rX $(SOURCE_TOP) + chown -R root:root $(SOURCE_TOP) + (cd $(SOURCE_TOP)/usr/src/; \ + tar $(TAR_COMPRESSION) -cf $(package).tar.$(TAR_SUFFIX) $(package);\ + rm -rf $(package);) + dpkg-gencontrol -isp -p$(package) -P$(SOURCE_TOP)/ + chmod -R og=rX $(SOURCE_TOP) + chown -R root:root $(SOURCE_TOP) + dpkg --build $(SOURCE_TOP) $(DEB_DEST) + rm -f -r $(SOURCE_TOP) + echo done > stamp-source +endif + +libc-kheaders libc_kheaders: stamp-libc-kheaders +stamp-libc-kheaders: configure + @echo This target is now obsolete. + + +kernel-headers kernel_headers: stamp-headers +stamp-headers: configure +ifeq ($(strip $(int_am_root)),) +ifeq ($(strip $(int_get_root)),) + @echo need root privileges; exit 1 +else + $(int_get_root) $(deb_rule) real_stamp_headers +endif +else + $(deb_rule) real_stamp_headers +endif + +real_stamp_headers: +ifeq ($(strip $(architecture)),um) + echo done > stamp-headers +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif +ifneq ($(strip $(UTS_RELEASE_VERSION)),$(strip $(version))) + @echo "The UTS Release version in include/linux/version.h $(UTS_RELEASE_VERSION) does not match current version $(version), reconfiguring" + touch Makefile +endif + test -f stamp-configure || $(deb_rule) configure + rm -rf $(HEADER_TOP) + $(make_directory) $(HEADER_TOP)/DEBIAN + $(make_directory) $(HEADER_SRC) + $(make_directory) $(HEADER_DOC) + sed -e 's/=P/$(h_package)/g' -e 's/=V/$(version)/g' \ + $(DEBDIR)/include.postinst > $(HEADER_TOP)/DEBIAN/postinst + chmod 755 $(HEADER_TOP)/DEBIAN/postinst + $(install_file) $(DEBDIR)/copyright.headers $(HEADER_DOC)/copyright + $(install_file) debian/changelog $(HEADER_DOC)/changelog + gzip -9qf $(HEADER_DOC)/changelog + $(install_file) $(DEBDIR)/README.headers $(HEADER_DOC)/debian.README + gzip -9qf $(HEADER_DOC)/debian.README + $(install_file) .config $(HEADER_DOC)/config-$(version) + $(install_file) conf.vars $(HEADER_DOC)/conf.vars + gzip -9qf $(HEADER_DOC)/config-$(version) + gzip -9qf $(HEADER_DOC)/conf.vars + $(install_file) CREDITS $(HEADER_DOC)/ + gzip -9qf $(HEADER_DOC)/CREDITS + $(install_file) MAINTAINERS $(HEADER_DOC)/ + gzip -9qf $(HEADER_DOC)/MAINTAINERS + $(install_file) REPORTING-BUGS $(HEADER_DOC)/ + gzip -9qf $(HEADER_DOC)/REPORTING-BUGS + $(install_file) README $(HEADER_DOC)/ + gzip -9qf $(HEADER_DOC)/README + if test -f debian/official -a -f debian/README.Debian ; then \ + $(install_file) debian/README.Debian $(HEADER_DOC)/README.Debian ; \ + gzip -9qf $(HEADER_DOC)/README.Debian ; \ + $(install_file) README.Debian $(HEADER_DOC)/README.Debian;\ + gzip -9qf $(HEADER_DOC)/README.Debian;\ + fi + if test -f README.Debian ; then \ + $(install_file) README.Debian $(HEADER_DOC)/README.Debian.1st;\ + gzip -9qf $(HEADER_DOC)/README.Debian.1st;\ + fi + echo "This was produced by kernel-package version $(kpkg_version)." > \ + $(HEADER_DOC)/Buildinfo + chmod 0644 $(HEADER_DOC)/Buildinfo + $(install_file) Makefile $(HEADER_SRC) +ifneq ($(strip $(int_follow_symlinks_in_src)),) + -tar cfh - include | (cd $(HEADER_SRC); umask 000; tar xsf -) + (cd $(HEADER_SRC)/include; rm -rf asm; ln -s asm-$(KERNEL_ARCH) asm) +else + -tar cf - include | (cd $(HEADER_SRC); umask 000; tar xsf -) + (cd $(HEADER_SRC)/include; rm -f asm; ln -s asm-$(KERNEL_ARCH) asm) +endif + $(install_file) .config $(HEADER_SRC)/.config + echo $(debian) > $(HEADER_SRC)/kernel-headers.revision +ifneq ($(strip $(header_clean_hook)),) + (cd $(HEADER_SRC); \ + test -x $(header_clean_hook) && $(header_clean_hook)) +endif + dpkg-gencontrol -DArchitecture=$(architecture) -isp \ + -p$(h_package) -P$(HEADER_TOP)/ + chown -R root:root $(HEADER_TOP) + chmod -R og=rX $(HEADER_TOP) + dpkg --build $(HEADER_TOP) $(DEB_DEST) + rm -rf $(HEADER_TOP) + echo done > stamp-headers +endif + +kernel-doc kernel_doc: stamp-doc +stamp-doc: stamp-debian +ifeq ($(strip $(int_am_root)),) +ifeq ($(strip $(int_get_root)),) + @echo need root privileges; exit 1 +else + $(int_get_root) $(deb_rule) real_stamp_doc +endif +else + $(deb_rule) real_stamp_doc +endif + +real_stamp_doc: +ifeq ($(strip $(architecture)),um) + echo done > stamp-doc +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + test -f stamp-debian || $(deb_rule) debian + rm -rf $(DOC_TOP) + $(make_directory) $(DOC_TOP)/DEBIAN + $(make_directory) $(DOC_DOC) + $(install_file) debian/changelog $(DOC_DOC)/changelog + $(install_file) $(DEBDIR)/README.doc $(DOC_DOC)/README.Debian + echo "This was produced by kernel-package version $(kpkg_version)." > \ + $(DOC_DOC)/Buildinfo + chmod 0644 $(DOC_DOC)/Buildinfo + if test -f debian/official -a -f debian/README.Debian ; then \ + $(install_file) debian/README.Debian $(DOC_DOC)/README.Debian;\ + fi + if test -f README.Debian ; then \ + $(install_file) README.Debian $(DOC_DOC)/README.Debian.1st;\ + fi +ifneq ($(strip $(shell if [ -x /usr/bin/db2html ]; then echo YSE; fi)),) + $(MAKE) mandocs htmldocs +endif + -tar cf - Documentation | (cd $(DOC_DOC); umask 000; tar xsf -) +ifneq ($(strip $(doc_clean_hook)),) + (cd $(DOC_DOC); \ + test -x $(doc_clean_hook) && $(doc_clean_hook)) +endif + -gzip -9qfr $(DOC_DOC) + -find $(DOC_DOC) -type f -name \*.gz -perm +111 -exec gunzip {} \; + $(install_file) $(DEBDIR)/copyright.doc $(DOC_DOC)/copyright + sed -e 's/=P/$(d_package)/g' -e 's/=V/$(version)/g' \ + $(DEBDIR)/include.postinst > $(DOC_TOP)/DEBIAN/postinst + chmod 755 $(DOC_TOP)/DEBIAN/postinst + dpkg-gencontrol -isp -p$(d_package) -P$(DOC_TOP)/ + chmod -R og=rX $(DOC_TOP) + chown -R root:root $(DOC_TOP) + dpkg --build $(DOC_TOP) $(DEB_DEST) + rm -rf $(DOC_TOP) + echo done > stamp-doc +endif + +kernel-image kernel_image: stamp-image +stamp-image: configure build kernel-image-deb +# % make config +# % make-kpkg build +# % sudo make -f debian/rules kernel-image-deb +# seems to create a working .deb with a kernel that gives the correct +# user name (as opposed to root@...) +kernel-image-deb: +ifeq ($(strip $(int_am_root)),) +ifeq ($(strip $(int_get_root)),) + @echo need root privileges; exit 1 +else + $(int_get_root) $(deb_rule) real_stamp_image +endif +else + $(deb_rule) real_stamp_image +endif + +real_stamp_image: +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif +ifneq ($(strip $(UTS_RELEASE_VERSION)),$(strip $(version))) + @echo "The UTS Release version in include/linux/version.h $(UTS_RELEASE_VERSION) does not match current version $(version), reconfiguring." + touch Makefile +endif + rm -f -r ./$(IMAGE_TOP) ./$(IMAGE_TOP).deb + test -f stamp-configure || $(deb_rule) configure + test -f stamp-build || $(deb_rule) build + $(make_directory) $(IMAGE_TOP)/DEBIAN + $(make_directory) $(IMAGE_TOP)/$(IMAGEDIR) + $(make_directory) $(IMAGE_DOC) + sed -e 's/=V/$(version)/g' -e 's/=B/$(link_in_boot)/g' \ + -e 's/=S/$(no_symlink)/g' -e 's/=R/$(reverse_symlink)/g' \ + -e 's/=K/$(kimage)/g' -e 's/=L/$(loader)/g' \ + -e 's/=I/$(INITRD)/g' -e 's,=D,$(IMAGEDIR),g' \ + -e 's@=M@$(MKIMAGE)@g' -e 's/=OF/$(AM_OFFICIAL)/g' \ + $(DEBDIR)/image.postinst > $(IMAGE_TOP)/DEBIAN/postinst + chmod 755 $(IMAGE_TOP)/DEBIAN/postinst + sed -e 's/=V/$(version)/g' -e 's/=B/$(link_in_boot)/g' \ + -e 's/=S/$(no_symlink)/g' -e 's/=R/$(reverse_symlink)/g' \ + -e 's/=K/$(kimage)/g' -e 's/=L/$(loader)/g' \ + -e 's/=I/$(INITRD)/g' -e 's,=D,$(IMAGEDIR),g' \ + -e 's@=M@$(MKIMAGE)@g' -e 's/=OF/$(AM_OFFICIAL)/g' \ + $(DEBDIR)/image.postrm > $(IMAGE_TOP)/DEBIAN/postrm + chmod 755 $(IMAGE_TOP)/DEBIAN/postrm + sed -e 's/=V/$(version)/g' -e 's/=L/$(loader)/g' \ + -e 's/=I/$(INITRD)/g' -e 's/=OF/$(AM_OFFICIAL)/g' \ + -e 's@=M@$(MKIMAGE)@g' \ + $(DEBDIR)/image.preinst > $(IMAGE_TOP)/DEBIAN/preinst + chmod 755 $(IMAGE_TOP)/DEBIAN/preinst + sed -e 's/=V/$(version)/g' -e 's/=L/$(loader)/g' \ + -e 's@=M@$(MKIMAGE)@g' -e 's/=OF/$(AM_OFFICIAL)/g' \ + $(DEBDIR)/image.prerm > $(IMAGE_TOP)/DEBIAN/prerm + chmod 755 $(IMAGE_TOP)/DEBIAN/prerm + $(install_file) Documentation/Changes $(IMAGE_DOC)/ + gzip -9qf $(IMAGE_DOC)/Changes + $(install_file) debian/changelog $(IMAGE_DOC)/changelog + gzip -9qf $(IMAGE_DOC)/changelog +ifdef loaderdoc + $(install_file) $(DEBDIR)/$(loaderdoc) $(IMAGE_DOC)/$(loaderdoc) + gzip -9qf $(IMAGE_DOC)/$(loaderdoc) +endif + $(install_file) $(DEBDIR)/README.image $(IMAGE_DOC)/debian.README + gzip -9qf $(IMAGE_DOC)/debian.README + $(install_file) $(DEBDIR)/copyright.image $(IMAGE_DOC)/copyright + echo "This was produced by kernel-package version $(kpkg_version)." > \ + $(IMAGE_DOC)/Buildinfo + chmod 0644 $(IMAGE_DOC)/Buildinfo + $(install_file) .config $(INT_IMAGE_DESTDIR)/config-$(version) + $(install_file) conf.vars $(IMAGE_DOC)/conf.vars + gzip -9qf $(IMAGE_DOC)/conf.vars + $(install_file) debian/buildinfo $(IMAGE_DOC)/buildinfo + gzip -9qf $(IMAGE_DOC)/buildinfo + if test -f debian/official -a -f debian/README.Debian ; then \ + $(install_file) debian/README.Debian $(IMAGE_DOC)/README.Debian ; \ + gzip -9qf $(IMAGE_DOC)/README.Debian;\ + fi + if test -f README.Debian ; then \ + $(install_file) README.Debian $(IMAGE_DOC)/README.Debian.1st;\ + gzip -9qf $(IMAGE_DOC)/README.Debian.1st;\ + fi +ifeq ($(strip $(HAVE_EXTRA_DOCS)),YES) + $(install_file) $(extra_docs) $(IMAGE_DOC)/ +endif +ifneq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) +ifeq ($(strip $(HAVE_NEW_MODLIB)),) + $(mod_inst_cmds) +else +# could have also said DEPMOD=/bin/true instead of moving files +ifneq ($(strip $(KERNEL_CROSS)),) + mv System.map System.precious +endif + $(MAKE) $(EXTRAV_ARG) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) \ + $(CROSS_ARG) ARCH=$(KERNEL_ARCH) modules_install +ifneq ($(strip $(KERNEL_CROSS)),) + mv System.precious System.map +endif +endif + -depmod -q -FSystem.map -b $(IMAGE_TOP) $(version) +endif + if test -d $(SRCTOP)/debian/image.d ; then \ + IMAGE_TOP=$(IMAGE_TOP) version=$(version) \ + run-parts --verbose $(SRCTOP)/debian/image.d ; \ + fi + if [ -x debian/post-install ]; then \ + IMAGE_TOP=$(IMAGE_TOP) version=$(version) debian/post-install;\ + fi +ifeq ($(strip $(NEED_DIRECT_GZIP_IMAGE)),YES) + gzip -9vc $(kimagesrc) > $(kimagedest) +else + cp $(kimagesrc) $(kimagedest) +endif + chmod 644 $(kimagedest) +ifeq ($(strip $(HAVE_COFF_IMAGE)),YES) + cp $(coffsrc) $(coffdest) + chmod 644 $(coffdest) +endif +ifeq ($(strip $(int_install_vmlinux)),YES) +ifneq ($(strip $(kelfimagesrc)),) + cp $(kelfimagesrc) $(kelfimagedest) + chmod 644 $(kelfimagedest) +endif +endif + test ! -s applied_patches || cp applied_patches \ + $(INT_IMAGE_DESTDIR)/patches-$(version) + test ! -s applied_patches || chmod 644 \ + $(INT_IMAGE_DESTDIR)/patches-$(version) + test ! -f System.map || cp System.map \ + $(INT_IMAGE_DESTDIR)/System.map-$(version) + test ! -f System.map || chmod 644 \ + $(INT_IMAGE_DESTDIR)/System.map-$(version) +ifeq ($(strip $(delete_build_link)),YES) + rm -f $(IMAGE_TOP)/lib/modules/$(version)/build +endif + dpkg-gencontrol -DArchitecture=$(architecture) -isp \ + -p$(i_package) -P$(IMAGE_TOP)/ + chmod -R og=rX $(IMAGE_TOP) + chown -R root:root $(IMAGE_TOP) + dpkg --build $(IMAGE_TOP) $(DEB_DEST) + rm -f -r $(IMAGE_TOP) +ifeq ($(strip $(do_clean)),YES) + $(MAKE) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \ + clean + rm -f stamp-build +endif + echo done > stamp-image + +# This for STOP_FOR_BIN86 +endif + +# This endif is for HAVE_VALID_PACKAGE_VERSION +endif + +#This endif is for IN_KERNEL_DIR +endif + + +# only generate module image packages +modules-image modules_image: configure +ifeq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + @echo Modules not configured, so not making $@ +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + -for module in $(valid_modules) ; do \ + if test -d $$module; then \ + (cd $$module; \ + if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \ + KMAINT="$(pgp)" KEMAIL="$(email)" \ + KPKG_DEST_DIR="$(KPKG_DEST_DIR)" \ + KPKG_MAINTAINER="$(maintainer)" \ + KDREV="$(debian)" kdist_image; then \ + echo "Module $$module processed fine"; \ + else \ + echo "Module $$module failed."; \ + echo "Hit return to Continue"; \ + read ans; \ + fi; \ + ); \ + fi; \ + done +endif + +# generate the modules packages and sign them +modules: configure +ifeq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + @echo Modules not configured, so not making $@ +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + -for module in $(valid_modules) ; do \ + if test -d $$module; then \ + (cd $$module; \ + if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \ + KMAINT="$(pgp)" KEMAIL="$(email)" \ + KPKG_DEST_DIR="$(KPKG_DEST_DIR)" \ + KPKG_MAINTAINER="$(maintainer)" \ + ARCH=$(KERNEL_ARCH) \ + KDREV="$(debian)" kdist; then \ + echo "Module $$module processed fine"; \ + else \ + echo "Module $$module failed."; \ + echo "Hit return to Continue?"; \ + read ans; \ + fi; \ + ); \ + fi; \ + done +endif + +# configure the modules packages +modules-config modules_config: configure +ifeq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + @echo Modules not configured, so not making $@ +else +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + -for module in $(valid_modules) ; do \ + if test -d $$module; then \ + (cd $$module; \ + if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \ + KMAINT="$(pgp)" KEMAIL="$(email)" \ + KPKG_DEST_DIR="$(KPKG_DEST_DIR)" \ + KPKG_MAINTAINER="$(maintainer)" \ + ARCH=$(KERNEL_ARCH) \ + KDREV="$(debian)" kdist_configure; then\ + echo "Module $$module configured fine"; \ + else \ + echo "Module $$module failed to configure"; \ + echo "Hit return to Continue?"; \ + read ans; \ + fi; \ + ); \ + fi; \ + done +endif + +modules-clean modules_clean: .config +ifeq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + @echo Modules not configured, so not making $@ +else + -for module in $(MODULE_LOC)/* ; do \ + if test -d $$module; then \ + (cd $$module; \ + if ./debian/rules KVERS="$(version)" KSRC="$(SRCTOP)" \ + KMAINT="$(pgp)" KEMAIL="$(email)" \ + KPKG_DEST_DIR="$(KPKG_DEST_DIR)" \ + KPKG_MAINTAINER="$(maintainer)" \ + ARCH=$(KERNEL_ARCH) \ + KDREV="$(debian)" kdist_clean; then \ + echo "Module $$module cleaned"; \ + else \ + echo "Module $$module failed to clean up"; \ + echo "Hit return to Continue?"; \ + read ans; \ + fi; \ + ); \ + fi; \ + done +endif + + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +define mod_inst_cmds + @( \ + MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(version); \ + cd modules; \ + MODULES=""; \ + inst_mod() { These="`cat $$1`"; MODULES="$$MODULES $$These"; \ + mkdir -p $$MODLIB/$$2; cp $$These $$MODLIB/$$2; \ + echo Installing modules under $$MODLIB/$$2; \ + }; \ + \ + if [ -f BLOCK_MODULES ]; then inst_mod BLOCK_MODULES block; fi; \ + if [ -f NET_MODULES ]; then inst_mod NET_MODULES net; fi; \ + if [ -f IPV4_MODULES ]; then inst_mod IPV4_MODULES ipv4; fi; \ + if [ -f IPV6_MODULES ]; then inst_mod IPV6_MODULES ipv6; fi; \ + if [ -f ATM_MODULES ]; then inst_mod ATM_MODULES atm; fi; \ + if [ -f SCSI_MODULES ]; then inst_mod SCSI_MODULES scsi; fi; \ + if [ -f FS_MODULES ]; then inst_mod FS_MODULES fs; fi; \ + if [ -f NLS_MODULES ]; then inst_mod NLS_MODULES fs; fi; \ + if [ -f CDROM_MODULES ]; then inst_mod CDROM_MODULES cdrom; fi; \ + if [ -f HAM_MODULES ]; then inst_mod HAM_MODULES net; fi; \ + if [ -f SOUND_MODULES ]; then inst_mod SOUND_MODULES sound; fi; \ + if [ -f VIDEO_MODULES ]; then inst_mod VIDEO_MODULES video; fi; \ + if [ -f FC4_MODULES ]; then inst_mod FC4_MODULES fc4; fi; \ + if [ -f IRDA_MODULES ]; then inst_mod IRDA_MODULES net; fi; \ + if [ -f USB_MODULES ]; then inst_mod USB_MODULES usb; fi; \ + if [ -f SK98LIN_MODULES ]; then inst_mod SK98LIN_MODULES net; fi; \ + if [ -f SKFP_MODULES ]; then inst_mod SKFP_MODULES net; fi; \ + if [ -f IEEE1394_MODULES ]; then inst_mod IEEE1394_MODULES ieee1394; fi;\ + if [ -f PCMCIA_MODULES ]; then inst_mod PCMCIA_MODULES pcmcia; fi; \ + if [ -f PCMCIA_NET_MODULES ]; then inst_mod PCMCIA_NET_MODULES pcmcia; fi; \ + if [ -f PCMCIA_CHAR_MODULES ]; then inst_mod PCMCIA_CHAR_MODULES pcmcia; fi; \ + if [ -f PCMCIA_SCSI_MODULES ]; then inst_mod PCMCIA_SCSI_MODULES pcmcia; fi; \ + \ + for f in *.o; do [ -r $$f ] && echo $$f; done > .allmods; \ + echo $$MODULES | tr ' ' '\n' | sort | comm -23 .allmods - > .misc; \ + if [ -s .misc ]; then inst_mod .misc misc; fi; \ + rm -f .misc .allmods; \ + ) +endef + +# 2.0.38 2.2.12 2.3.1 +# BLOCK_MODULES X X X +# NET_MODULES X X X +# IPV4_MODULES X X X +# IPV6_MODULES X X +# ATM_MODULES X +# SCSI_MODULES X X X +# FS_MODULES X X X +# NLS_MODULES X X +# CDROM_MODULES X X X +# HAM_MODULES X X +# SOUND_MODULES X X +# VIDEO_MODULES X X +# FC4_MODULES X X +# IRDA_MODULES X X +# USB_MODULES X + +.PHONY: binary binary-arch binary-indep clean debian modules modules_image diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/do-kpkg linux-arm-2.4-ds/do-kpkg --- linux-arm-2.4-ds.orig/do-kpkg 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/do-kpkg 2004-01-02 16:11:53.000000000 +0000 @@ -0,0 +1 @@ +PATH=$PATH:/usr/local/arm/3.3.1/bin fakeroot make-kpkg --arch arm --revision 2.4.21 kernel_image diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/char/ds1307.c linux-arm-2.4-ds/drivers/char/ds1307.c --- linux-arm-2.4-ds.orig/drivers/char/ds1307.c 2003-05-06 08:32:06.000000000 +0100 +++ linux-arm-2.4-ds/drivers/char/ds1307.c 2003-12-24 16:45:12.000000000 +0000 @@ -91,10 +91,10 @@ ds1307_readram( char *buf, int len) { unsigned long flags; - unsigned char ad[1] = { 0 }; + unsigned char ad = 0; int ret; struct i2c_msg msgs[2] = { - { ds1307_i2c_client->addr , 0, 1, ad }, + { ds1307_i2c_client->addr , 0, 1, &ad }, { ds1307_i2c_client->addr , I2C_M_RD, len, buf } }; spin_lock_irqsave(&ds1307_rtc_lock, flags); diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/char/ds1307.h linux-arm-2.4-ds/drivers/char/ds1307.h --- linux-arm-2.4-ds.orig/drivers/char/ds1307.h 2003-05-06 08:32:06.000000000 +0100 +++ linux-arm-2.4-ds/drivers/char/ds1307.h 2004-01-02 16:00:55.000000000 +0000 @@ -11,7 +11,8 @@ #ifndef DS1307_H #define DS1307_H -#if defined(CONFIG_PXA_EMERSON_SBC) || defined(CONFIG_PXA_CERF_BOARD) +#if defined(CONFIG_PXA_EMERSON_SBC) || defined(CONFIG_PXA_CERF_BOARD) || \ + defined(CONFIG_ARCH_IYONIX) #define DS1307_I2C_SLAVE_ADDR 0x68 #else #define DS1307_I2C_SLAVE_ADDR 0xffff diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/i2c/Makefile linux-arm-2.4-ds/drivers/i2c/Makefile --- linux-arm-2.4-ds.orig/drivers/i2c/Makefile 2003-11-09 16:27:42.000000000 +0000 +++ linux-arm-2.4-ds/drivers/i2c/Makefile 2003-10-15 23:08:20.000000000 +0100 @@ -5,7 +5,7 @@ O_TARGET := i2c.o export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \ - i2c-algo-ite.o i2c-proc.o + i2c-algo-ite.o i2c-algo-iop321.o i2c-proc.o # Init order: core, chardev, bit adapters, pcf adapters diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/i2c/i2c-algo-iop321.c linux-arm-2.4-ds/drivers/i2c/i2c-algo-iop321.c --- linux-arm-2.4-ds.orig/drivers/i2c/i2c-algo-iop321.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/drivers/i2c/i2c-algo-iop321.c 2003-07-24 17:32:53.000000000 +0100 @@ -0,0 +1,192 @@ +/* + * drivers/i2c/i2c-algo-iop321.c + * + * Driver for the Intel IOP321 i2c bus + * + * Author: Peter Naulls + * + * Copyright 2003 Peter Naulls + * + * 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 +#include +#include +#include + +#include +#include + +#include +#include + +typedef struct transfer { + char *start; + char *end; + char *current; + unsigned int bytes; +} transfer; + +transfer block[2]; + + +/* Description: Prepares the controller for a transaction (clearing status + * registers, data buffers, etc), and then calls either iic_readbytes or + * iic_sendbytes to do the actual transaction. + * + * still to be done: Before we issue a transaction, we should + * verify that the bus is not busy or in some unknown state. + */ +static int iop321_xfer(struct i2c_adapter *i2c_adap, + struct i2c_msg msgs[], + int num) { + struct i2c_msg *pmsg = &msgs[0]; + int len = pmsg->len; + char *data = pmsg->buf; + int ret = 0; + int status; + int a2; + char *ip; + unsigned long flags; + + printk("iic_xfer: %x %x %d\n", data[0], data[1], len); + + return -EIO; + + local_irq_save(flags); + + if (!block[0].start) { + block[0].start = data; + } else { + ret = -EBUSY; + } + + local_irq_restore(flags); + + if (ret) + return ret; + + block[0].current = pmsg->buf; + + a2 -= 1; + ip = data + a2 * 12; + + block[0].end = ip; + block[0].bytes = 0; + + *IOP321_IIC_IDBR0 = *data; + *IOP321_IIC_ISR0 = *IOP321_IIC_ISR0; + + status = *IOP321_IIC_ICR0; + status |= IOP321_ICR_TransmitIE | IOP321_ICR_ReceiveIE | + IOP321_ICR_BusErrorIE | IOP321_ICR_SCLEnable | + IOP321_ICR_Transfer | IOP321_ICR_Stop; + + status &= ~(IOP321_ICR_ArbLossIE | IOP321_ICR_Abort | + IOP321_ICR_Nack | IOP321_ICR_Stop); + + if (!((int *)block[0].start)[2]) { + + } + *IOP321_IIC_ICR0 = status; +} + + +static int algo_control(struct i2c_adapter *adapter, + unsigned int cmd, unsigned long arg) +{ + return 0; +} + + + +static u32 iop321_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C; +} + + +static struct i2c_algorithm iop321_algo = { + "IOP321 IIC algorithm", + I2C_ALGO_IOP321, + iop321_xfer, /* master_xfer */ + NULL, /* smbus_xfer */ + NULL, /* slave_xmit */ + NULL, /* slave_recv */ + algo_control, /* ioctl */ + iop321_func, /* functionality */ +}; + + + +int i2c_iop321_add_bus(struct i2c_adapter *adap) +{ +// int i, status; + struct i2c_algo_iop321_data *iop321_adap = adap->algo_data; + + printk("i2c-algo-iop321.o: hw routines for %s registered.\n", + adap->name); + + /* Register new adapter to i2c module */ + + adap->id |= iop321_algo.id; + adap->algo = &iop321_algo; + + adap->timeout = 100; /* default values, should */ + adap->retries = 3; /* be replaced by defines */ + + MOD_INC_USE_COUNT; + + /* Initialise the bus */ + *IOP321_GPOD &= 0x0f; + + /* Reset */ + *IOP321_IIC_ICR0 = IOP321_ICR_Reset; + *IOP321_IIC_ICR1 = IOP321_ICR_Reset; + + /* All Ints */ + *IOP321_IIC_ISR0 = IOP321_ISR_AllInts; + *IOP321_IIC_ISR1 = IOP321_ISR_AllInts; + + /* Enable */ + *IOP321_IIC_ICR0 = IOP321_ICR_Enable; + *IOP321_IIC_ICR1 = IOP321_ICR_Enable; + + i2c_add_adapter(adap); + + /* scan bus */ +// i2c_start(iop321_adap); + return 0; +} + + +int i2c_iop321_del_bus(struct i2c_adapter *adap) +{ + int res; + if ((res = i2c_del_adapter(adap)) < 0) + return res; + printk("i2c-algo-iop321.o: adapter unregistered: %s\n",adap->name); + + MOD_DEC_USE_COUNT; + return 0; +} + +static int __init i2c_algo_iop321_init (void) +{ + printk("i2c-algo-iop321.o: i2c IOP321 algorithm module\n"); + return 0; +} + +EXPORT_SYMBOL(i2c_iop321_add_bus); +EXPORT_SYMBOL(i2c_iop321_del_bus); + +MODULE_AUTHOR("Peter Naulls "); +MODULE_DESCRIPTION("I2C-Bus IOP321 algorithm"); +MODULE_LICENSE("GPL"); + +module_init(i2c_algo_iop321_init); + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/ide/ide-probe.c linux-arm-2.4-ds/drivers/ide/ide-probe.c --- linux-arm-2.4-ds.orig/drivers/ide/ide-probe.c 2003-10-03 13:50:34.000000000 +0100 +++ linux-arm-2.4-ds/drivers/ide/ide-probe.c 2003-12-24 16:52:50.000000000 +0000 @@ -56,6 +56,7 @@ #include #include +#undef DEBUG /** * generic_id - add a generic drive id * @drive: drive to make an ID block for @@ -459,8 +460,11 @@ ide_delay_50ms(); SELECT_DRIVE(drive); ide_delay_50ms(); +//printk("1: %d %d %d\n", 0 /*hwif->INB(IDE_SELECT_REG)*/, drive->select.all, drive->present); if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) { +//printk("2\n"); if (drive->select.b.unit != 0) { +//printk("3\n"); /* exit with drive0 selected */ SELECT_DRIVE(&hwif->drives[0]); /* allow BUSY_STAT to assert & clear */ @@ -469,6 +473,7 @@ /* no i/f present: mmm.. this should be a 4 -ml */ return 3; } +//printk("4\n"); if (OK_STAT((hwif->INB(IDE_STATUS_REG)), READY_STAT, BUSY_STAT) || drive->present || cmd == WIN_PIDENTIFY) { diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/ide/pci/alim15x3.c linux-arm-2.4-ds/drivers/ide/pci/alim15x3.c --- linux-arm-2.4-ds.orig/drivers/ide/pci/alim15x3.c 2003-10-03 13:50:35.000000000 +0100 +++ linux-arm-2.4-ds/drivers/ide/pci/alim15x3.c 2003-10-16 09:09:34.000000000 +0100 @@ -43,6 +43,10 @@ #include "ide_modes.h" #include "alim15x3.h" +#ifdef CONFIG_ARCH_IYONIX +#include +#endif + /* * ALi devices are not plug in. Otherwise these static values would * need to go. They ought to go away anyway @@ -483,7 +487,6 @@ return (ide_config_drive_speed(drive, speed)); } - /** * config_chipset_for_dma - set up DMA mode * @drive: drive to configure for @@ -836,6 +839,10 @@ hwif->irq = irq; } +#ifdef CONFIG_ARCH_IYONIX + hwif->irq = (hwif->channel ? IRQ_IYONIX_ATA2 : IRQ_IYONIX_ATA1); +#endif + init_hwif_common_ali15x3(hwif); } diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/media/Makefile linux-arm-2.4-ds/drivers/media/Makefile --- linux-arm-2.4-ds.orig/drivers/media/Makefile 2003-05-06 08:32:20.000000000 +0100 +++ linux-arm-2.4-ds/drivers/media/Makefile 2003-04-09 11:37:38.000000000 +0100 @@ -9,8 +9,8 @@ # parent makes.. # -subdir-y := video radio -mod-subdirs := video radio +#subdir-y := video radio +#mod-subdirs := video radio O_TARGET := media.o obj-y := $(join $(subdir-y),$(subdir-y:%=/%.o)) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/mtd/maps/iop3xx.c linux-arm-2.4-ds/drivers/mtd/maps/iop3xx.c --- linux-arm-2.4-ds.orig/drivers/mtd/maps/iop3xx.c 2003-12-10 10:44:59.000000000 +0000 +++ linux-arm-2.4-ds/drivers/mtd/maps/iop3xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,226 +0,0 @@ -/* - * $Id: iop3xx.c,v 1.9 2002/01/01 22:45:02 rmk Exp $ - * - * Mapping for the Intel IOP3xx based platforms - * - * Author: Nicolas Pitre - * Copyright: (C) 2001-2003 MontaVista Software Inc. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define WINDOW_SIZE 8*1024*1024 -#ifdef CONFIG_ARCH_IOP321 -#define WINDOW_ADDR 0xf0000000 -#else -#define WINDOW_ADDR 0x00000000 -#endif - -#ifdef CONFIG_ARCH_IQ31244 - #define BUSWIDTH 2 // RevC board has 16bit flash bus -#else - #define BUSWIDTH 1 -#endif - -static struct mtd_info *mymtd; -static struct resource *mtd_resource; - -static __u8 iop3xx_read8(struct map_info *map, unsigned long ofs) -{ - return *(__u8 *)(map->map_priv_1 + ofs); -} - -static __u16 iop3xx_read16(struct map_info *map, unsigned long ofs) -{ - return *(__u16 *)(map->map_priv_1 + ofs); -} - -static __u32 iop3xx_read32(struct map_info *map, unsigned long ofs) -{ - return *(__u32 *)(map->map_priv_1 + ofs); -} - -static void iop3xx_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len) -{ - memcpy(to, (void *)(map->map_priv_1 + from), len); -} - -static void iop3xx_write8(struct map_info *map, __u8 d, unsigned long adr) -{ - *(__u8 *)(map->map_priv_1 + adr) = d; -} - -static void iop3xx_write16(struct map_info *map, __u16 d, unsigned long adr) -{ - *(__u16 *)(map->map_priv_1 + adr) = d; -} - -static void iop3xx_write32(struct map_info *map, __u32 d, unsigned long adr) -{ - *(__u32 *)(map->map_priv_1 + adr) = d; -} - -static void iop3xx_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len) -{ - memcpy((void *)(map->map_priv_1 + to), from, len); -} - -static struct map_info iop3xx_map = { - .name = "IOP3xx Flash", - .size = WINDOW_SIZE, - .buswidth = BUSWIDTH, - .read8 = iop3xx_read8, - .read16 = iop3xx_read16, - .read32 = iop3xx_read32, - .copy_from = iop3xx_copy_from, - .write8 = iop3xx_write8, - .write16 = iop3xx_write16, - .write32 = iop3xx_write32, - .copy_to = iop3xx_copy_to, -}; - -static struct mtd_partition iop3xx_partitions[4] = { - { - name: "Firmware", - size: 0x00080000, - offset: 0, - mask_flags: MTD_WRITEABLE /* force read-only */ - },{ - name: "Kernel", - size: 0x000a0000, - offset: 0x00080000, - },{ - name: "Filesystem", - size: 0x00600000, - offset: 0x00120000 - },{ - name: "RedBoot", - size: 0x000e0000, - offset: 0x00720000, - mask_flags: MTD_WRITEABLE - } -}; - -#define NB_OF(x) (sizeof(x)/sizeof(x[0])) - -static struct mtd_info *mymtd; -static struct mtd_partition *parsed_parts; - -extern int parse_redboot_partitions(struct mtd_info *master, struct mtd_partition **pparts); - -static void cleanup_iop3xx(void) -{ - if (mymtd) { - del_mtd_partitions(mymtd); - map_destroy(mymtd); - if (parsed_parts) - kfree(parsed_parts); - } - if (iop3xx_map.map_priv_1) - iounmap((void *)iop3xx_map.map_priv_1); - if (mtd_resource) - release_mem_region(WINDOW_ADDR, iop3xx_map.size); - - if (parsed_parts) - kfree(parsed_parts); -} - -static int __init init_iop3xx(void) -{ - struct mtd_partition *parts; - int nb_parts = 0; - int parsed_nr_parts = 0; - char *part_type = "static"; - unsigned long window_addr; - int res; - - if(iop_is_310()) - window_addr = 0x0; - else if(iop_is_321()) - window_addr = 0xf0000000; - - mtd_resource = - request_mem_region(window_addr, iop3xx_map.size, "IOP3xx Flash"); - if (!mtd_resource) { - printk(KERN_ERR - "iop3xx flash: Could not request mem region.\n"); - res = -ENOMEM; - goto Error; - } - - iop3xx_map.map_priv_1 = (unsigned long)ioremap(window_addr, WINDOW_SIZE); - if (!iop3xx_map.map_priv_1) { - printk("Failed to ioremap\n"); - return -EIO; - } - mymtd = do_map_probe("cfi_probe", &iop3xx_map); - if (!mymtd) { - iounmap((void *)iop3xx_map.map_priv_1); - return -ENXIO; - } - mymtd->owner = THIS_MODULE; - -#if 0 -#ifdef CONFIG_MTD_REDBOOT_PARTS - if (parsed_nr_parts == 0) { - int ret = parse_redboot_partitions(mymtd, &parsed_parts); - - if (ret > 0) { - part_type = "RedBoot"; - parsed_nr_parts = ret; - } - } -#endif - - if (parsed_nr_parts > 0) { - parts = parsed_parts; - nb_parts = parsed_nr_parts; - } else { - parts = iop3xx_partitions; - nb_parts = NB_OF(iop3xx_partitions); - } - printk(KERN_NOTICE "Using %s partition definition\n", part_type); - add_mtd_partitions(mymtd, parts, nb_parts); -#endif - - if (parsed_nr_parts > 0) - res = add_mtd_partitions(mymtd, parsed_parts, parsed_nr_parts); - else { - printk("IOP3xx Flash: Using static MTD partitions.\n"); - res = add_mtd_partitions(mymtd, iop3xx_partitions, - NB_OF(iop3xx_partitions)); - } - if (res) - goto Error; - - return res; - -Error: - cleanup_iop3xx(); - return res; -} - -module_init(init_iop3xx); -module_exit(cleanup_iop3xx); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Nicolas Pitre "); -MODULE_DESCRIPTION("MTD map driver for Intel IOP3xx based boards"); - diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/net/e1000/e1000_main.c linux-arm-2.4-ds/drivers/net/e1000/e1000_main.c --- linux-arm-2.4-ds.orig/drivers/net/e1000/e1000_main.c 2003-10-03 13:50:48.000000000 +0100 +++ linux-arm-2.4-ds/drivers/net/e1000/e1000_main.c 2003-10-26 17:32:15.000000000 +0000 @@ -450,6 +450,7 @@ /* make sure the EEPROM is good */ +#ifndef CONFIG_ARCH_IYONIX if(e1000_validate_eeprom_checksum(&adapter->hw) < 0) { printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n"); goto err_eeprom; @@ -458,6 +459,9 @@ /* copy the MAC address out of the EEPROM */ e1000_read_mac_addr(&adapter->hw); +#else + memcpy(adapter->hw.mac_addr, ((char *)adapter->hw.hw_addr) + 0x40, 6); +#endif memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); if(!is_valid_ether_addr(netdev->dev_addr)) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/pci/pci.c linux-arm-2.4-ds/drivers/pci/pci.c --- linux-arm-2.4-ds.orig/drivers/pci/pci.c 2003-10-03 13:50:52.000000000 +0100 +++ linux-arm-2.4-ds/drivers/pci/pci.c 2003-10-03 13:00:16.000000000 +0100 @@ -1350,8 +1350,8 @@ */ if (!pass) return max; - pci_read_config_word(dev, PCI_COMMAND, &cr); - pci_write_config_word(dev, PCI_COMMAND, 0x0000); +// pci_read_config_word(dev, PCI_COMMAND, &cr); +// pci_write_config_word(dev, PCI_COMMAND, 0x0000); pci_write_config_word(dev, PCI_STATUS, 0xffff); child = pci_add_new_bus(bus, dev, ++max); @@ -1379,7 +1379,7 @@ */ child->subordinate = max; pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max); - pci_write_config_word(dev, PCI_COMMAND, cr); +// pci_write_config_word(dev, PCI_COMMAND, cr); } sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number); return max; diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/sound/trident.c linux-arm-2.4-ds/drivers/sound/trident.c --- linux-arm-2.4-ds.orig/drivers/sound/trident.c 2003-10-03 13:51:01.000000000 +0100 +++ linux-arm-2.4-ds/drivers/sound/trident.c 2003-12-24 16:33:08.000000000 +0000 @@ -486,6 +486,7 @@ int chan_nums); static void ali_free_other_states_resources(struct trident_state *state); +#define DEBUG /* save registers for ALi Power Management */ static struct ali_saved_registers { @@ -4308,8 +4309,8 @@ } unregister_sound_dsp(card->dev_audio); - if(card->joystick) - pcigame_detach(card->joystick); +// if(card->joystick) +// pcigame_detach(card->joystick); kfree(card); diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/usb/Makefile linux-arm-2.4-ds/drivers/usb/Makefile --- linux-arm-2.4-ds.orig/drivers/usb/Makefile 2003-10-03 13:51:01.000000000 +0100 +++ linux-arm-2.4-ds/drivers/usb/Makefile 2003-10-15 23:44:34.000000000 +0100 @@ -77,7 +77,7 @@ obj-y += host/usb-ohci.o host/usb-ohci-pci.o endif subdir-$(CONFIG_USB_OHCI_SA1111)+= host -ifeq ($(CONFIG_USB_OHCI),y) +ifeq ($(CONFIG_USB_OHCI_SA1111),y) obj-y += host/usb-ohci.o host/usb-ohci-sa1111.o endif subdir-$(CONFIG_USB_OHCI_AT91) += host diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/usb/host/ehci-hcd.c linux-arm-2.4-ds/drivers/usb/host/ehci-hcd.c --- linux-arm-2.4-ds.orig/drivers/usb/host/ehci-hcd.c 2003-10-03 13:51:02.000000000 +0100 +++ linux-arm-2.4-ds/drivers/usb/host/ehci-hcd.c 2003-10-15 23:54:12.000000000 +0100 @@ -31,6 +31,7 @@ #include #include #include +#include #ifdef CONFIG_USB_DEBUG #define DEBUG diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci-pci.c linux-arm-2.4-ds/drivers/usb/host/usb-ohci-pci.c --- linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci-pci.c 2003-10-03 13:51:03.000000000 +0100 +++ linux-arm-2.4-ds/drivers/usb/host/usb-ohci-pci.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,436 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include /* for in_interrupt() */ -#undef DEBUG -#include - -#include "usb-ohci.h" - -#ifdef CONFIG_PMAC_PBOOK -#include -#include -#include -#ifndef CONFIG_PM -#define CONFIG_PM -#endif -#endif - - -/*-------------------------------------------------------------------------*/ - -/* Increment the module usage count, start the control thread and - * return success. */ - -static struct pci_driver ohci_pci_driver; -extern spinlock_t usb_ed_lock; -int __devinit -hc_add_ohci(struct pci_dev *dev, int irq, void *membase, unsigned long flags, - const char *name, const char *slot_name); -extern void hc_remove_ohci(ohci_t *ohci); - -static int __devinit -hc_found_ohci (struct pci_dev *dev, int irq, - void *mem_base, const struct pci_device_id *id) -{ - unsigned long flags = id->driver_data; - - printk(KERN_INFO __FILE__ ": usb-%s, %s\n", dev->slot_name, dev->name); - - /* Check for NSC87560. We have to look at the bridge (fn1) to identify - the USB (fn2). This quirk might apply to more or even all NSC stuff - I don't know.. */ - - if(dev->vendor == PCI_VENDOR_ID_NS) - { - struct pci_dev *fn1 = pci_find_slot(dev->bus->number, PCI_DEVFN(PCI_SLOT(dev->devfn), 1)); - if(fn1 && fn1->vendor == PCI_VENDOR_ID_NS && fn1->device == PCI_DEVICE_ID_NS_87560_LIO) - flags |= OHCI_QUIRK_SUCKYIO; - - } - - if (flags & OHCI_QUIRK_SUCKYIO) - printk (KERN_INFO __FILE__ ": Using NSC SuperIO setup\n"); - if (flags & OHCI_QUIRK_AMD756) - printk (KERN_INFO __FILE__ ": AMD756 erratum 4 workaround\n"); - - return hc_add_ohci(dev, irq, mem_base, flags, - ohci_pci_driver.name, dev->slot_name); -} - -/*-------------------------------------------------------------------------*/ - -#ifdef CONFIG_PM - -/* controller died; cleanup debris, then restart */ -/* must not be called from interrupt context */ - -static void hc_restart (ohci_t *ohci) -{ - int temp; - int i; - - if (ohci->pci_latency) - pci_write_config_byte (ohci->ohci_dev, PCI_LATENCY_TIMER, ohci->pci_latency); - - ohci->disabled = 1; - ohci->sleeping = 0; - if (ohci->bus->root_hub) - usb_disconnect (&ohci->bus->root_hub); - - /* empty the interrupt branches */ - for (i = 0; i < NUM_INTS; i++) ohci->ohci_int_load[i] = 0; - for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table[i] = 0; - - /* no EDs to remove */ - ohci->ed_rm_list [0] = NULL; - ohci->ed_rm_list [1] = NULL; - - /* empty control and bulk lists */ - ohci->ed_isotail = NULL; - ohci->ed_controltail = NULL; - ohci->ed_bulktail = NULL; - - if ((temp = hc_reset (ohci)) < 0 || (temp = hc_start (ohci)) < 0) { - err ("can't restart usb-%s, %d", ohci->ohci_dev->slot_name, temp); - } else - dbg ("restart usb-%s completed", ohci->ohci_dev->slot_name); -} - -#endif /* CONFIG_PM */ - -/*-------------------------------------------------------------------------*/ - -/* configured so that an OHCI device is always provided */ -/* always called with process context; sleeping is OK */ - -static int __devinit -ohci_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) -{ - unsigned long mem_resource, mem_len; - void *mem_base; - int status; - - if (pci_enable_device(dev) < 0) - return -ENODEV; - - if (!dev->irq) { - err("found OHCI device with no IRQ assigned. check BIOS settings!"); - pci_disable_device (dev); - return -ENODEV; - } - - /* we read its hardware registers as memory */ - mem_resource = pci_resource_start(dev, 0); - mem_len = pci_resource_len(dev, 0); - if (!request_mem_region (mem_resource, mem_len, ohci_pci_driver.name)) { - dbg ("controller already in use"); - pci_disable_device (dev); - return -EBUSY; - } - - mem_base = ioremap_nocache (mem_resource, mem_len); - if (!mem_base) { - err("Error mapping OHCI memory"); - release_mem_region (mem_resource, mem_len); - pci_disable_device (dev); - return -EFAULT; - } - - /* controller writes into our memory */ - pci_set_master (dev); - - status = hc_found_ohci (dev, dev->irq, mem_base, id); - if (status < 0) { - iounmap (mem_base); - release_mem_region (mem_resource, mem_len); - pci_disable_device (dev); - } - return status; -} - -/*-------------------------------------------------------------------------*/ - -/* may be called from interrupt context [interface spec] */ -/* may be called without controller present */ -/* may be called with controller, bus, and devices active */ - -static void __devexit -ohci_pci_remove (struct pci_dev *dev) -{ - ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); - - dbg ("remove %s controller usb-%s%s%s", - hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS), - dev->slot_name, - ohci->disabled ? " (disabled)" : "", - in_interrupt () ? " in interrupt" : "" - ); - - hc_remove_ohci(ohci); - - release_mem_region (pci_resource_start (dev, 0), pci_resource_len (dev, 0)); - pci_disable_device (dev); -} - - -#ifdef CONFIG_PM - -/*-------------------------------------------------------------------------*/ - -static int -ohci_pci_suspend (struct pci_dev *dev, u32 state) -{ - ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); - unsigned long flags; - u16 cmd; - - if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) { - dbg ("can't suspend usb-%s (state is %s)", dev->slot_name, - hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS)); - return -EIO; - } - - /* act as if usb suspend can always be used */ - info ("USB suspend: usb-%s", dev->slot_name); - ohci->sleeping = 1; - - /* First stop processing */ - spin_lock_irqsave (&usb_ed_lock, flags); - ohci->hc_control &= ~(OHCI_CTRL_PLE|OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_IE); - writel (ohci->hc_control, &ohci->regs->control); - writel (OHCI_INTR_SF, &ohci->regs->intrstatus); - (void) readl (&ohci->regs->intrstatus); - spin_unlock_irqrestore (&usb_ed_lock, flags); - - /* Wait a frame or two */ - mdelay(1); - if (!readl (&ohci->regs->intrstatus) & OHCI_INTR_SF) - mdelay (1); - -#ifdef CONFIG_PMAC_PBOOK - if (_machine == _MACH_Pmac) - disable_irq (ohci->irq); - /* else, 2.4 assumes shared irqs -- don't disable */ -#endif - /* Enable remote wakeup */ - writel (readl(&ohci->regs->intrenable) | OHCI_INTR_RD, &ohci->regs->intrenable); - - /* Suspend chip and let things settle down a bit */ - ohci->hc_control = OHCI_USB_SUSPEND; - writel (ohci->hc_control, &ohci->regs->control); - (void) readl (&ohci->regs->control); - mdelay (500); /* No schedule here ! */ - switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) { - case OHCI_USB_RESET: - dbg("Bus in reset phase ???"); - break; - case OHCI_USB_RESUME: - dbg("Bus in resume phase ???"); - break; - case OHCI_USB_OPER: - dbg("Bus in operational phase ???"); - break; - case OHCI_USB_SUSPEND: - dbg("Bus suspended"); - break; - } - /* In some rare situations, Apple's OHCI have happily trashed - * memory during sleep. We disable it's bus master bit during - * suspend - */ - pci_read_config_word (dev, PCI_COMMAND, &cmd); - cmd &= ~PCI_COMMAND_MASTER; - pci_write_config_word (dev, PCI_COMMAND, cmd); -#ifdef CONFIG_PMAC_PBOOK - { - struct device_node *of_node; - - /* Disable USB PAD & cell clock */ - of_node = pci_device_to_OF_node (ohci->ohci_dev); - if (of_node) - pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0); - } -#endif - return 0; -} - -/*-------------------------------------------------------------------------*/ - -static int -ohci_pci_resume (struct pci_dev *dev) -{ - ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); - int temp; - unsigned long flags; - - /* guard against multiple resumes */ - atomic_inc (&ohci->resume_count); - if (atomic_read (&ohci->resume_count) != 1) { - err ("concurrent PCI resumes for usb-%s", dev->slot_name); - atomic_dec (&ohci->resume_count); - return 0; - } - -#ifdef CONFIG_PMAC_PBOOK - { - struct device_node *of_node; - - /* Re-enable USB PAD & cell clock */ - of_node = pci_device_to_OF_node (ohci->ohci_dev); - if (of_node) - pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 1); - } -#endif - - /* did we suspend, or were we powered off? */ - ohci->hc_control = readl (&ohci->regs->control); - temp = ohci->hc_control & OHCI_CTRL_HCFS; - -#ifdef DEBUG - /* the registers may look crazy here */ - ohci_dump_status (ohci); -#endif - - /* Re-enable bus mastering */ - pci_set_master(ohci->ohci_dev); - - switch (temp) { - - case OHCI_USB_RESET: // lost power - info ("USB restart: usb-%s", dev->slot_name); - hc_restart (ohci); - break; - - case OHCI_USB_SUSPEND: // host wakeup - case OHCI_USB_RESUME: // remote wakeup - info ("USB continue: usb-%s from %s wakeup", dev->slot_name, - (temp == OHCI_USB_SUSPEND) - ? "host" : "remote"); - ohci->hc_control = OHCI_USB_RESUME; - writel (ohci->hc_control, &ohci->regs->control); - (void) readl (&ohci->regs->control); - mdelay (20); /* no schedule here ! */ - /* Some controllers (lucent) need a longer delay here */ - mdelay (15); - temp = readl (&ohci->regs->control); - temp = ohci->hc_control & OHCI_CTRL_HCFS; - if (temp != OHCI_USB_RESUME) { - err ("controller usb-%s won't resume", dev->slot_name); - ohci->disabled = 1; - return -EIO; - } - - /* Some chips likes being resumed first */ - writel (OHCI_USB_OPER, &ohci->regs->control); - (void) readl (&ohci->regs->control); - mdelay (3); - - /* Then re-enable operations */ - spin_lock_irqsave (&usb_ed_lock, flags); - ohci->disabled = 0; - ohci->sleeping = 0; - ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER; - if (!ohci->ed_rm_list[0] && !ohci->ed_rm_list[1]) { - if (ohci->ed_controltail) - ohci->hc_control |= OHCI_CTRL_CLE; - if (ohci->ed_bulktail) - ohci->hc_control |= OHCI_CTRL_BLE; - } - writel (ohci->hc_control, &ohci->regs->control); - writel (OHCI_INTR_SF, &ohci->regs->intrstatus); - writel (OHCI_INTR_SF, &ohci->regs->intrenable); - /* Check for a pending done list */ - writel (OHCI_INTR_WDH, &ohci->regs->intrdisable); - (void) readl (&ohci->regs->intrdisable); - spin_unlock_irqrestore (&usb_ed_lock, flags); -#ifdef CONFIG_PMAC_PBOOK - if (_machine == _MACH_Pmac) - enable_irq (ohci->irq); -#endif - if (ohci->hcca->done_head) - dl_done_list (ohci, dl_reverse_done_list (ohci)); - writel (OHCI_INTR_WDH, &ohci->regs->intrenable); - writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */ - writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */ - break; - - default: - warn ("odd PCI resume for usb-%s", dev->slot_name); - } - - /* controller is operational, extra resumes are harmless */ - atomic_dec (&ohci->resume_count); - - return 0; -} - -#endif /* CONFIG_PM */ - - -/*-------------------------------------------------------------------------*/ - -static const struct pci_device_id __devinitdata ohci_pci_ids [] = { { - - /* - * AMD-756 [Viper] USB has a serious erratum when used with - * lowspeed devices like mice. - */ - vendor: 0x1022, - device: 0x740c, - subvendor: PCI_ANY_ID, - subdevice: PCI_ANY_ID, - - driver_data: OHCI_QUIRK_AMD756, - -} , { - - /* handle any USB OHCI controller */ - class: ((PCI_CLASS_SERIAL_USB << 8) | 0x10), - class_mask: ~0, - - /* no matter who makes it */ - vendor: PCI_ANY_ID, - device: PCI_ANY_ID, - subvendor: PCI_ANY_ID, - subdevice: PCI_ANY_ID, - - }, { /* end: all zeroes */ } -}; - -MODULE_DEVICE_TABLE (pci, ohci_pci_ids); - -static struct pci_driver ohci_pci_driver = { - name: "usb-ohci", - id_table: &ohci_pci_ids [0], - - probe: ohci_pci_probe, - remove: __devexit_p(ohci_pci_remove), - -#ifdef CONFIG_PM - suspend: ohci_pci_suspend, - resume: ohci_pci_resume, -#endif /* PM */ -}; - - -/*-------------------------------------------------------------------------*/ - -static int __init ohci_hcd_init (void) -{ - return pci_module_init (&ohci_pci_driver); -} - -/*-------------------------------------------------------------------------*/ - -static void __exit ohci_hcd_cleanup (void) -{ - pci_unregister_driver (&ohci_pci_driver); -} - -module_init (ohci_hcd_init); -module_exit (ohci_hcd_cleanup); - diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci-pci.c.old linux-arm-2.4-ds/drivers/usb/host/usb-ohci-pci.c.old --- linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci-pci.c.old 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/drivers/usb/host/usb-ohci-pci.c.old 2003-10-03 13:00:29.000000000 +0100 @@ -0,0 +1,448 @@ +#include +#include +#include +#include +#include +#include +#include /* for in_interrupt() */ +#define DEBUG +#include + +#include "usb-ohci.h" + +#ifdef CONFIG_PMAC_PBOOK +#include +#include +#include +#ifndef CONFIG_PM +#define CONFIG_PM +#endif +#endif + + +/*-------------------------------------------------------------------------*/ + +/* Increment the module usage count, start the control thread and + * return success. */ + +static struct pci_driver ohci_pci_driver; +extern spinlock_t usb_ed_lock; +int __devinit +hc_add_ohci(struct pci_dev *dev, int irq, void *membase, unsigned long flags, + const char *name, const char *slot_name); +extern void hc_remove_ohci(ohci_t *ohci); + +static int __devinit +hc_found_ohci (struct pci_dev *dev, int irq, + void *mem_base, const struct pci_device_id *id) +{ + unsigned long flags = id->driver_data; + + printk(KERN_INFO __FILE__ ": usb-%s, %s\n", dev->slot_name, dev->name); + + /* Check for NSC87560. We have to look at the bridge (fn1) to identify + the USB (fn2). This quirk might apply to more or even all NSC stuff + I don't know.. */ + + if(dev->vendor == PCI_VENDOR_ID_NS) + { + struct pci_dev *fn1 = pci_find_slot(dev->bus->number, PCI_DEVFN(PCI_SLOT(dev->devfn), 1)); + if(fn1 && fn1->vendor == PCI_VENDOR_ID_NS && fn1->device == PCI_DEVICE_ID_NS_87560_LIO) + flags |= OHCI_QUIRK_SUCKYIO; + + } + + if (flags & OHCI_QUIRK_SUCKYIO) + printk (KERN_INFO __FILE__ ": Using NSC SuperIO setup\n"); + if (flags & OHCI_QUIRK_AMD756) + printk (KERN_INFO __FILE__ ": AMD756 erratum 4 workaround\n"); + + return hc_add_ohci(dev, irq, mem_base, flags, + ohci_pci_driver.name, dev->slot_name); +} + +/*-------------------------------------------------------------------------*/ + +#ifdef CONFIG_PM + +/* controller died; cleanup debris, then restart */ +/* must not be called from interrupt context */ + +static void hc_restart (ohci_t *ohci) +{ + int temp; + int i; + + if (ohci->pci_latency) + pci_write_config_byte (ohci->ohci_dev, PCI_LATENCY_TIMER, ohci->pci_latency); + + ohci->disabled = 1; + ohci->sleeping = 0; + if (ohci->bus->root_hub) + usb_disconnect (&ohci->bus->root_hub); + + /* empty the interrupt branches */ + for (i = 0; i < NUM_INTS; i++) ohci->ohci_int_load[i] = 0; + for (i = 0; i < NUM_INTS; i++) ohci->hcca->int_table[i] = 0; + + /* no EDs to remove */ + ohci->ed_rm_list [0] = NULL; + ohci->ed_rm_list [1] = NULL; + + /* empty control and bulk lists */ + ohci->ed_isotail = NULL; + ohci->ed_controltail = NULL; + ohci->ed_bulktail = NULL; + + if ((temp = hc_reset (ohci)) < 0 || (temp = hc_start (ohci)) < 0) { + err ("can't restart usb-%s, %d", ohci->ohci_dev->slot_name, temp); + } else + dbg ("restart usb-%s completed", ohci->ohci_dev->slot_name); +} + +#endif /* CONFIG_PM */ + +/*-------------------------------------------------------------------------*/ + +/* configured so that an OHCI device is always provided */ +/* always called with process context; sleeping is OK */ + +static int __devinit +ohci_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) +{ + unsigned long mem_resource, mem_len; + void *mem_base; + int status; + + if (pci_enable_device(dev) < 0) + return -ENODEV; + + if (!dev->irq) { + err("found OHCI device with no IRQ assigned. check BIOS settings!"); + pci_disable_device (dev); + return -ENODEV; + } + + /* we read its hardware registers as memory */ + mem_resource = pci_resource_start(dev, 0); + mem_len = pci_resource_len(dev, 0); + if (!request_mem_region (mem_resource, mem_len, ohci_pci_driver.name)) { + dbg ("controller already in use"); + pci_disable_device (dev); + return -EBUSY; + } + + mem_base = ioremap_nocache (mem_resource, mem_len); + if (!mem_base) { + err("Error mapping OHCI memory"); + release_mem_region (mem_resource, mem_len); + pci_disable_device (dev); + return -EFAULT; + } + + /* controller writes into our memory */ + pci_set_master (dev); + + status = hc_found_ohci (dev, dev->irq, mem_base, id); + if (status < 0) { + iounmap (mem_base); + release_mem_region (mem_resource, mem_len); + pci_disable_device (dev); + } + return status; +} + +/*-------------------------------------------------------------------------*/ + +/* may be called from interrupt context [interface spec] */ +/* may be called without controller present */ +/* may be called with controller, bus, and devices active */ + +static void /*__devexit*/ +ohci_pci_remove (struct pci_dev *dev) +{ + ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); + + printk("USB remove\n"); +/* + dbg ("remove %s controller usb-%s%s%s", + hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS), + dev->slot_name, + ohci->disabled ? " (disabled)" : "", + in_interrupt () ? " in interrupt" : "" + );*/ + + hc_remove_ohci(ohci); + + release_mem_region (pci_resource_start (dev, 0), pci_resource_len (dev, 0)); + pci_disable_device (dev); +} + + +#ifdef CONFIG_PM + +/*-------------------------------------------------------------------------*/ + +static int +ohci_pci_suspend (struct pci_dev *dev, u32 state) +{ + ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); + unsigned long flags; + u16 cmd; + + if ((ohci->hc_control & OHCI_CTRL_HCFS) != OHCI_USB_OPER) { + dbg ("can't suspend usb-%s (state is %s)", dev->slot_name, + hcfs2string (ohci->hc_control & OHCI_CTRL_HCFS)); + return -EIO; + } + + /* act as if usb suspend can always be used */ + info ("USB suspend: usb-%s", dev->slot_name); + ohci->sleeping = 1; + + /* First stop processing */ + spin_lock_irqsave (&usb_ed_lock, flags); + ohci->hc_control &= ~(OHCI_CTRL_PLE|OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_IE); + writel (ohci->hc_control, &ohci->regs->control); + writel (OHCI_INTR_SF, &ohci->regs->intrstatus); + (void) readl (&ohci->regs->intrstatus); + spin_unlock_irqrestore (&usb_ed_lock, flags); + + /* Wait a frame or two */ + mdelay(1); + if (!readl (&ohci->regs->intrstatus) & OHCI_INTR_SF) + mdelay (1); + +#ifdef CONFIG_PMAC_PBOOK + if (_machine == _MACH_Pmac) + disable_irq (ohci->irq); + /* else, 2.4 assumes shared irqs -- don't disable */ +#endif + /* Enable remote wakeup */ + writel (readl(&ohci->regs->intrenable) | OHCI_INTR_RD, &ohci->regs->intrenable); + + /* Suspend chip and let things settle down a bit */ + ohci->hc_control = OHCI_USB_SUSPEND; + writel (ohci->hc_control, &ohci->regs->control); + (void) readl (&ohci->regs->control); + mdelay (500); /* No schedule here ! */ + switch (readl (&ohci->regs->control) & OHCI_CTRL_HCFS) { + case OHCI_USB_RESET: + dbg("Bus in reset phase ???"); + break; + case OHCI_USB_RESUME: + dbg("Bus in resume phase ???"); + break; + case OHCI_USB_OPER: + dbg("Bus in operational phase ???"); + break; + case OHCI_USB_SUSPEND: + dbg("Bus suspended"); + break; + } + /* In some rare situations, Apple's OHCI have happily trashed + * memory during sleep. We disable its bus master bit during + * suspend + */ + pci_read_config_word (dev, PCI_COMMAND, &cmd); + cmd &= ~PCI_COMMAND_MASTER; + pci_write_config_word (dev, PCI_COMMAND, cmd); +#ifdef CONFIG_PMAC_PBOOK + { + struct device_node *of_node; + + /* Disable USB PAD & cell clock */ + of_node = pci_device_to_OF_node (ohci->ohci_dev); + if (of_node) + pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0); + } +#endif + return 0; +} + +/*-------------------------------------------------------------------------*/ + +static int +ohci_pci_resume (struct pci_dev *dev) +{ + ohci_t *ohci = (ohci_t *) pci_get_drvdata(dev); + int temp; + unsigned long flags; + + /* guard against multiple resumes */ + atomic_inc (&ohci->resume_count); + if (atomic_read (&ohci->resume_count) != 1) { + err ("concurrent PCI resumes for usb-%s", dev->slot_name); + atomic_dec (&ohci->resume_count); + return 0; + } + +#ifdef CONFIG_PMAC_PBOOK + { + struct device_node *of_node; + + /* Re-enable USB PAD & cell clock */ + of_node = pci_device_to_OF_node (ohci->ohci_dev); + if (of_node) + pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 1); + } +#endif + + /* did we suspend, or were we powered off? */ + ohci->hc_control = readl (&ohci->regs->control); + temp = ohci->hc_control & OHCI_CTRL_HCFS; + +#ifdef DEBUG + /* the registers may look crazy here */ + ohci_dump_status (ohci); +#endif + + /* Re-enable bus mastering */ + pci_set_master(ohci->ohci_dev); + + switch (temp) { + + case OHCI_USB_RESET: // lost power + info ("USB restart: usb-%s", dev->slot_name); + hc_restart (ohci); + break; + + case OHCI_USB_SUSPEND: // host wakeup + case OHCI_USB_RESUME: // remote wakeup + info ("USB continue: usb-%s from %s wakeup", dev->slot_name, + (temp == OHCI_USB_SUSPEND) + ? "host" : "remote"); + ohci->hc_control = OHCI_USB_RESUME; + writel (ohci->hc_control, &ohci->regs->control); + (void) readl (&ohci->regs->control); + mdelay (20); /* no schedule here ! */ + /* Some controllers (lucent) need a longer delay here */ + mdelay (15); + temp = readl (&ohci->regs->control); + temp = ohci->hc_control & OHCI_CTRL_HCFS; + if (temp != OHCI_USB_RESUME) { + err ("controller usb-%s won't resume", dev->slot_name); + ohci->disabled = 1; + return -EIO; + } + + /* Some chips likes being resumed first */ + writel (OHCI_USB_OPER, &ohci->regs->control); + (void) readl (&ohci->regs->control); + mdelay (3); + + /* Then re-enable operations */ + spin_lock_irqsave (&usb_ed_lock, flags); + ohci->disabled = 0; + ohci->sleeping = 0; + ohci->hc_control = OHCI_CONTROL_INIT | OHCI_USB_OPER; + if (!ohci->ed_rm_list[0] && !ohci->ed_rm_list[1]) { + if (ohci->ed_controltail) + ohci->hc_control |= OHCI_CTRL_CLE; + if (ohci->ed_bulktail) + ohci->hc_control |= OHCI_CTRL_BLE; + } + writel (ohci->hc_control, &ohci->regs->control); + writel (OHCI_INTR_SF, &ohci->regs->intrstatus); + writel (OHCI_INTR_SF, &ohci->regs->intrenable); + /* Check for a pending done list */ + writel (OHCI_INTR_WDH, &ohci->regs->intrdisable); + (void) readl (&ohci->regs->intrdisable); + spin_unlock_irqrestore (&usb_ed_lock, flags); +#ifdef CONFIG_PMAC_PBOOK + if (_machine == _MACH_Pmac) + enable_irq (ohci->irq); +#endif + if (ohci->hcca->done_head) + dl_done_list (ohci, dl_reverse_done_list (ohci)); + writel (OHCI_INTR_WDH, &ohci->regs->intrenable); + writel (OHCI_BLF, &ohci->regs->cmdstatus); /* start bulk list */ + writel (OHCI_CLF, &ohci->regs->cmdstatus); /* start Control list */ + break; + + default: + warn ("odd PCI resume for usb-%s", dev->slot_name); + } + + /* controller is operational, extra resumes are harmless */ + atomic_dec (&ohci->resume_count); + + return 0; +} + +#endif /* CONFIG_PM */ + + +/*-------------------------------------------------------------------------*/ + +static const struct pci_device_id __devinitdata ohci_pci_ids [] = { { + + /* + * AMD-756 [Viper] USB has a serious erratum when used with + * lowspeed devices like mice. + */ + vendor: 0x1022, + device: 0x740c, + subvendor: PCI_ANY_ID, + subdevice: PCI_ANY_ID, + + driver_data: OHCI_QUIRK_AMD756, + +} , { + + /* handle any USB OHCI controller */ + class: ((PCI_CLASS_SERIAL_USB << 8) | 0x10), + class_mask: ~0, + + /* no matter who makes it */ + vendor: PCI_ANY_ID, + device: PCI_ANY_ID, + subvendor: PCI_ANY_ID, + subdevice: PCI_ANY_ID, + + }, { /* end: all zeroes */ } +}; + +MODULE_DEVICE_TABLE (pci, ohci_pci_ids); + +static struct pci_driver ohci_pci_driver = { + name: "usb-ohci", + id_table: &ohci_pci_ids [0], + + probe: ohci_pci_probe, + remove: /*__devexit_p(*/ohci_pci_remove/*)*/, + +#ifdef CONFIG_PM + suspend: ohci_pci_suspend, + resume: ohci_pci_resume, +#endif /* PM */ +}; + + +/*-------------------------------------------------------------------------*/ + +static int __init ohci_hcd_init (void) +{ + return pci_module_init (&ohci_pci_driver); +} + +/*-------------------------------------------------------------------------*/ + +static void __exit ohci_hcd_cleanup (void) +{ + pci_unregister_driver (&ohci_pci_driver); +} + +module_init (ohci_hcd_init); +module_exit (ohci_hcd_cleanup); + + +#ifdef CONFIG_ARCH_IYONIX + +void iyonix_ohci_cleanup(void) +{ + pci_unregister_driver (&ohci_pci_driver); +} + +#endif + diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci.c linux-arm-2.4-ds/drivers/usb/host/usb-ohci.c --- linux-arm-2.4-ds.orig/drivers/usb/host/usb-ohci.c 2003-10-03 13:51:03.000000000 +0100 +++ linux-arm-2.4-ds/drivers/usb/host/usb-ohci.c 2003-12-24 16:52:08.000000000 +0000 @@ -3,7 +3,7 @@ * * (C) Copyright 1999 Roman Weissgaerber * (C) Copyright 2000-2001 David Brownell - * + * * [ Initialisation is based on Linus' ] * [ uhci code and gregs ohci fragments ] * [ (C) Copyright 1999 Linus Torvalds ] @@ -724,7 +724,7 @@ #ifdef DEBUG urb_print (urb, "UNLINK", 1); -#endif +#endif /* handle a request to the virtual root hub */ if (usb_pipedevice (urb->pipe) == ohci->rh.devnum) @@ -1085,15 +1085,15 @@ ed_p = & ((dma_to_ed (ohci, le32_to_cpup (ed_p)))->hwNextED); } - } + } } -/* unlink an ed from one of the HC chains. +/* unlink an ed from one of the HC chains. * just the link to the ed is unlinked. * the link from the ed still points to another operational ed or 0 * so the HC can eventually finish the processing of the unlinked ed */ -static int ep_unlink (ohci_t * ohci, ed_t * ed) +static int ep_unlink (ohci_t * ohci, ed_t * ed) { int i; @@ -1116,7 +1116,7 @@ (dma_to_ed (ohci, le32_to_cpup (&ed->hwNextED)))->ed_prev = ed->ed_prev; } break; - + case PIPE_BULK: if (ed->ed_prev == NULL) { if (!ed->hwNextED) { @@ -1288,7 +1288,7 @@ { volatile td_t * td, * td_pt; urb_priv_t * urb_priv = urb->hcpriv; - + if (index >= urb_priv->length) { err("internal OHCI error: TD index > length"); return; @@ -1558,7 +1558,7 @@ /*-------------------------------------------------------------------------*/ -/* there are some pending requests to remove +/* there are some pending requests to remove * - some of the eds (if ed->state & ED_DEL (set by sohci_free_dev) * - some URBs/TDs if urb_priv->state == URB_DEL */ @@ -1603,7 +1603,7 @@ if (ed->state & ED_DEL) { /* set by sohci_free_dev */ struct ohci_device * dev = usb_to_ohci (ohci->dev[edINFO & 0x7F]); td_free (ohci, tdTailP); /* free dummy td */ - ed->hwINFO = cpu_to_le32 (OHCI_ED_SKIP); + ed->hwINFO = cpu_to_le32 (OHCI_ED_SKIP); ed->state = ED_NEW; hash_free_ed(ohci, ed); /* if all eds are removed wake up sohci_free_dev */ @@ -2188,7 +2188,7 @@ /* Tell the controller where the control and bulk lists are * The lists are empty now. */ - + writel (0, &ohci->regs->ed_controlhead); writel (0, &ohci->regs->ed_bulkhead); @@ -2410,7 +2410,7 @@ ohci->bus->hcpriv = (void *) ohci; return ohci; -} +} /*-------------------------------------------------------------------------*/ @@ -2476,7 +2476,7 @@ printk(KERN_INFO __FILE__ ": USB OHCI at membase 0x%lx, IRQ %s\n", (unsigned long) mem_base, bufp); - ohci = hc_alloc_ohci (dev, mem_base); + ohci = hc_alloc_ohci (dev, mem_base); if (!ohci) { return -ENOMEM; } @@ -2503,7 +2503,7 @@ hc_release_ohci (ohci); return -EBUSY; } - ohci->irq = irq; + ohci->irq = irq; if (hc_start (ohci) < 0) { err ("can't start usb-%s", ohci->slot_name); @@ -2520,7 +2520,7 @@ /* * Host bus independent remove one OHCI host controller. */ -void __devexit hc_remove_ohci(ohci_t *ohci) +void /*__devexit*/ hc_remove_ohci(ohci_t *ohci) { #ifdef DEBUG ohci_dump (ohci, 1); diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/video/riva/fbdev.c linux-arm-2.4-ds/drivers/video/riva/fbdev.c --- linux-arm-2.4-ds.orig/drivers/video/riva/fbdev.c 2003-10-03 13:51:05.000000000 +0100 +++ linux-arm-2.4-ds/drivers/video/riva/fbdev.c 2003-12-13 17:47:50.000000000 +0000 @@ -759,9 +759,15 @@ unsigned char green, unsigned char blue) { VGA_WR08(chip->PDIO, 0x3c8, regnum); +#ifdef CONFIG_ARCH_IYONIX + VGA_WR08(chip->PDIO, 0x3c9, blue); + VGA_WR08(chip->PDIO, 0x3c9, green); + VGA_WR08(chip->PDIO, 0x3c9, red); +#else VGA_WR08(chip->PDIO, 0x3c9, red); VGA_WR08(chip->PDIO, 0x3c9, green); VGA_WR08(chip->PDIO, 0x3c9, blue); +#endif } /** @@ -952,7 +958,7 @@ newmode.crtc[0x12] = Set8Bits (vDisplay); newmode.crtc[0x13] = ((width / 8) * ((bpp + 1) / 8)) & 0xFF; newmode.crtc[0x15] = Set8Bits (vBlankStart); - newmode.crtc[0x16] = Set8Bits (vBlankEnd); + newmode.crtc[0x16] = Set8Bits (vBlankEnd + 1); newmode.ext.bpp = bpp; newmode.ext.width = width; @@ -1239,9 +1245,15 @@ if (regno >= riva_get_cmap_len(&rivainfo->currcon_display->var)) return 1; +#ifdef CONFIG_ARCH_IYONIX + *blue = rivainfo->palette[regno].red; + *green = rivainfo->palette[regno].green; + *red = rivainfo->palette[regno].blue; +#else *red = rivainfo->palette[regno].red; *green = rivainfo->palette[regno].green; *blue = rivainfo->palette[regno].blue; +#endif *transp = 0; return 0; @@ -1291,9 +1303,15 @@ if (regno >= riva_get_cmap_len(&p->var)) return -EINVAL; +#ifdef CONFIG_ARCH_IYONIX + rivainfo->palette[regno].blue = red; + rivainfo->palette[regno].green = green; + rivainfo->palette[regno].red = blue; +#else rivainfo->palette[regno].red = red; rivainfo->palette[regno].green = green; rivainfo->palette[regno].blue = blue; +#endif if (p->var.grayscale) { /* gray = 0.30*R + 0.59*G + 0.11*B */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/drivers/video/riva.new/Makefile linux-arm-2.4-ds/drivers/video/riva.new/Makefile --- linux-arm-2.4-ds.orig/drivers/video/riva.new/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/drivers/video/riva.new/Makefile 2003-04-09 11:36:17.000000000 +0100 @@ -0,0 +1,15 @@ +# +# Makefile for the Riva framebuffer driver +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... + +O_TARGET := rivafb.o + +obj-y := fbdev.o riva_hw.o accel.o +obj-m := $(O_TARGET) + +include $(TOPDIR)/Rules.make diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/fs/adfs/dir.c linux-arm-2.4-ds/fs/adfs/dir.c --- linux-arm-2.4-ds.orig/fs/adfs/dir.c 2003-05-06 08:32:56.000000000 +0100 +++ linux-arm-2.4-ds/fs/adfs/dir.c 2003-12-31 13:57:32.000000000 +0000 @@ -162,7 +162,7 @@ /* * Currently unable to fill in the rest of 'obj', * but this is better than nothing. We need to - * ascend one level to find it's parent. + * ascend one level to find its parent. */ obj->name_len = 0; obj->file_id = obj->parent_id; diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/fs/adfs/dir_fplus.c linux-arm-2.4-ds/fs/adfs/dir_fplus.c --- linux-arm-2.4-ds.orig/fs/adfs/dir_fplus.c 2003-05-06 08:32:56.000000000 +0100 +++ linux-arm-2.4-ds/fs/adfs/dir_fplus.c 2003-12-31 14:44:16.000000000 +0000 @@ -154,6 +154,12 @@ if (obj->name[i] == '/') obj->name[i] = '.'; + if (!(obj->attr & ADFS_NDA_DIRECTORY) && obj->name_len < ADFS_MAX_NAME_LEN - 4 && + (obj->loadaddr >> 20) == 0xfff) { + sprintf(obj->name + obj->name_len, ",%03x", (obj->loadaddr >> 8) & 0xfff); + obj->name_len += 4; + } + dir->pos += 1; ret = 0; out: diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/fs/adfs/inode.c linux-arm-2.4-ds/fs/adfs/inode.c --- linux-arm-2.4-ds.orig/fs/adfs/inode.c 2003-05-06 08:32:56.000000000 +0100 +++ linux-arm-2.4-ds/fs/adfs/inode.c 2003-12-31 15:53:32.000000000 +0000 @@ -45,6 +45,7 @@ return 0; } /* don't support allocation of blocks yet */ +// adfs_error(inode->i_sb, "no new block: %d\n", block); return -EIO; abort_negative: diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/hardware.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/hardware.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/hardware.h 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/hardware.h 2004-01-02 16:00:07.000000000 +0000 @@ -7,7 +7,9 @@ #include +#ifndef CONFIG_ARCH_IYONIX #define PCIO_BASE 0x6e000000 +#endif #ifndef __ASSEMBLY__ extern unsigned int processor_id; @@ -39,12 +41,16 @@ #define iop_is_310() (0) -#endif +#endif /* CONFIG_ARCH_IOP321 */ + + #ifdef CONFIG_ARCH_IOP321 -#define PCIBIOS_MIN_IO 0x90000000 -#define PCIBIOS_MIN_MEM 0x80000000 +//#define PCIBIOS_MIN_IO 0x90000000 +//#define PCIBIOS_MIN_MEM 0x80000000 +#define PCIBIOS_MIN_IO 0x00001000 +#define PCIBIOS_MIN_MEM 0x00010000 #include "iop321.h" @@ -52,6 +58,60 @@ #include "iq80321.h" #endif +#ifdef CONFIG_ARCH_IYONIX + +/* Hardware addresses of major areas. + * *_START is the physical address + * *_SIZE is the size of the region + * *_BASE is the virtual address + */ + +/* IO Addresses */ +#define PCIO_START 0x90000000 +#define PCIO_SIZE 0x00010000 +#define PCIO_BASE 0xf0000000 + +/* DRAM */ +#define RAM_START 0xc0000000 +#define RAM_SIZE 0x20000000 /* 512MB */ + +/* EASI podule space on Iyonix, as per RiscPCs */ +#define EASI_START 0xa8000000 /* EASI I/O */ +#define EASI_SIZE 0x08000000 /* 128MB */ +#define EASI_BASE 0xe8000000 + +/* Flash for E1000 MAC */ +#define FLASH_START 0xa3000000 +#define FLASH_SIZE 0x00001000 +#define FLASH_BASE 0xe8000000 + +/* Legacy IOMD space */ +#define IO_START 0xa3200000 /* IOMD */ +#define IO_SIZE 0x00200000 /* 2MB */ +#define IO_BASE 0xf1000000 + +#define IOMD_BASE IO_BASE + + +/* IO Registers in PCI Space */ +#define IYONIX_IO_MasterPIC 0x0020 +#define IYONIX_IO_MasterMask 0x0021 +#define IYONIX_IO_SlavePIC 0x00a0 +#define IYONIX_IO_SlaveMask 0x00a1 +#define IYONIX_IO_UART2 0x03e8 +#define IYONIX_IO_Config 0x03f0 +#define IYONIX_IO_ConfigIndex 0x03f0 +#define IYONIX_IO_ConfigData 0x03f1 +#define IYONIX_IO_FDC 0x03f0 +#define IYONIX_IO_UART1 0x03f8 +#define IYONIX_IO_MasterPICLevel 0x04d0 +#define IYONIX_IO_SlavePICLevel 0x04d1 + + + +#endif /* CONFIG_ARCH_IYONIX */ + + #ifndef __ASSEMBLY__ #define iop_is_321() ((processor_id & 0xfffff7e0) == 0x69052420) #endif @@ -60,6 +120,6 @@ #define iop_is_321() (0) -#endif +#endif /* CONFIG_ARCH_IOP321 */ -#endif /* _ASM_Arch_hardwARE_H */ +#endif /* _ASM_AARCH_HARDWARE_H */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/io.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/io.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/io.h 2003-05-06 08:33:07.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/io.h 2003-06-08 16:49:06.000000000 +0100 @@ -94,6 +94,29 @@ : : "r" (value), "r" (a)); } + + +extern __inline__ unsigned int __arch_base_getb(unsigned int base, + unsigned int offset) +{ + unsigned int value; + __asm__ __volatile__( + "ldrb %0, [%1, %2] @ getb" + : "=&r" (value) : "r" (base), "Ir" (offset)); + return value; +} + + + +extern __inline__ void __arch_base_putb(unsigned int value, unsigned int base, + unsigned int offset) +{ + __asm__ __volatile__( + "strb %0, [%1, %2] @ putb" + : : "r" (value), "r" (base), "Ir" (offset)); +} + + #define __arch_ioremap __ioremap #define __arch_iounmap __iounmap diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321-dma.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321-dma.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321-dma.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321-dma.h 2003-10-26 17:44:26.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * linux/include/asm-arm/arch-iop3xx/iop321-dma.h + * + * Copyright (C) 2002 Intel Corp. + * + * 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. + */ + +#ifndef _IOP321_DMA_H_P +#define _IOP321_DMA_H_P + +/* 2 DMA on primary PCI and 1 on secondary for 80310 */ +#define MAX_IOP321_DMA_CHANNEL 2 +#define MAX_DMA_DESC 64 /*128 */ + +#define DMA_FREE 0x0 +#define DMA_ACTIVE 0x1 +#define DMA_COMPLETE 0x2 +#define DMA_ERROR 0x4 + +/* + * Make the generic DMA bits go away since we don't use it + */ +#define MAX_DMA_CHANNELS 0 + +#define MAX_DMA_ADDRESS 0xffffffff + +#define DMA_POLL 0x0 +#define DMA_INTERRUPT 0x1 + +#define DMA_DCR_MTM 0x00000040 /* memory to memory transfer */ +#define DMA_DCR_DAC 0x00000020 /* Dual Addr Cycle Enab */ +#define DMA_DCR_IE 0x00000010 /* Interrupt Enable */ +#define DMA_DCR_PCI_IOR 0x00000002 /* I/O Read */ +#define DMA_DCR_PCI_IOW 0x00000003 /* I/O Write */ +#define DMA_DCR_PCI_MR 0x00000006 /* Memory Read */ +#define DMA_DCR_PCI_MW 0x00000007 /* Memory Write */ +#define DMA_DCR_PCI_CR 0x0000000A /* Configuration Read */ +#define DMA_DCR_PCI_CW 0x0000000B /* Configuration Write */ +#define DMA_DCR_PCI_MRM 0x0000000C /* Memory Read Multiple */ +#define DMA_DCR_PCI_MRL 0x0000000E /* Memory Read Line */ +#define DMA_DCR_PCI_MWI 0x0000000F /* Mem Write and Inval */ + + +//extern iop321_dma_t dma_chan[2]; +extern int iop_memcpy; +/* function prototypes */ +void * dma_memcpy(void * to, const void* from, __kernel_size_t n); +unsigned long dma_copy_to_user(void* to, const void* from, unsigned long n); +unsigned long dma_copy_from_user(void* to, const void* from, unsigned long n); + +#endif /* _ASM_ARCH_DMA_H_P */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321-irqs.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321-irqs.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321-irqs.h 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321-irqs.h 2004-01-02 16:00:57.000000000 +0000 @@ -55,8 +55,17 @@ #define IRQ_IOP321_XINT3 IOP321_IRQ(30) #define IRQ_IOP321_HPI IOP321_IRQ(31) +#ifdef CONFIG_ARCH_IYONIX + +#define NR_IOP321_IRQS (IOP321_IRQ(63) + 1) + +#else + #define NR_IOP321_IRQS (IOP321_IRQ(31) + 1) +#endif // CONFIG_ARCH_IYONIX + + #define NR_IRQS NR_IOP321_IRQS @@ -78,9 +87,11 @@ #define IRQ_IQ80321_INTC IRQ_IOP321_XINT2 #define IRQ_IQ80321_INTD IRQ_IOP321_XINT3 -/* + +/* * Interrupts available on the IQ31244 board */ + /* * On board devices */ @@ -100,6 +111,44 @@ #define IRQ_IQ31244_INTC IRQ_IOP321_XINT2 #define IRQ_IQ31244_INTD IRQ_IOP321_XINT3 + +/* + * Interrupts available on the IYONIX + */ + +/* + * Manufactured IRQs by IRQ demultiplexer + */ + +#define IRQ_IYONIX_MasterDev IOP321_IRQ(32) +#define IRQ_IYONIX_AC97 IOP321_IRQ(33) +#define IRQ_IYONIX_SlavePIC IOP321_IRQ(34) +#define IRQ_IYONIX_ATA1 IOP321_IRQ(35) +#define IRQ_IYONIX_ATA2 IOP321_IRQ(36) +#define IRQ_IYONIX_USB1 IOP321_IRQ(37) +#define IRQ_IYONIX_USB2 IOP321_IRQ(38) +#define IRQ_IYONIX_FDC IOP321_IRQ(39) + +#define IRQ_IYONIX_SlaveDev IOP321_IRQ(40) +#define IRQ_IYONIX_UART1 IOP321_IRQ(41) +#define IRQ_IYONIX_UART2 IOP321_IRQ(42) +#define IRQ_IYONIX_Modem IOP321_IRQ(43) +#define IRQ_IYONIX_SCI IOP321_IRQ(44) + +#define IRQ_IYONIX_FlpIndex IOP321_IRQ(50) +#define IRQ_IYONIX_PFIQ IOP321_IRQ(56) +#define IRQ_IYONIX_SuperIO IOP321_IRQ(58) +#define IRQ_IYONIX_Podule IOP321_IRQ(61) + +/* + * PCI interrupts + */ +#define IRQ_IYONIX_INTA IRQ_IOP321_XINT0 +#define IRQ_IYONIX_INTB IRQ_IOP321_XINT1 +#define IRQ_IYONIX_INTC IRQ_IOP321_XINT2 +#define IRQ_IYONIX_INTD IRQ_IOP321_XINT3 + + #define XSCALE_PMU_IRQ IRQ_IOP321_CORE_PMU #endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iop321.h 2003-11-09 16:27:42.000000000 +0000 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iop321.h 2004-01-02 16:00:57.000000000 +0000 @@ -21,6 +21,25 @@ /* * IOP321 I/O and Mem space regions for PCI autoconfiguration */ + + +#ifdef CONFIG_ARCH_IYONIX + +/* Iyonix uses direct addressing. The 64MB ATU windows aren't + big enough for the graphics card, which requires a 128MB + window */ + +#define IOP321_PCI_LOWER_IO 0x00000000 +#define IOP321_PCI_UPPER_IO 0x0000ffff +#define IOP321_PCI_LOWER_MEM 0x00000000 +#define IOP321_PCI_UPPER_MEM 0x7fffffff + +#define IOP321_PCI_WINDOW_SIZE 0x80000000 + +#else + +/* Other architectures use the ATU windows */ + #define IOP321_PCI_LOWER_IO 0x90000000 #define IOP321_PCI_UPPER_IO 0x9000ffff #define IOP321_PCI_LOWER_MEM 0x80000000 @@ -28,6 +47,9 @@ #define IOP321_PCI_WINDOW_SIZE 64 * 0x100000 +#endif + + /* * IOP321 chipset registers */ @@ -128,7 +150,8 @@ /* Peripheral performance monitoring unit 0x00000700 through 0x00077F */ /* Internal arbitration unit 0x00000780 through 0x0007BF */ -/* GPIO */ +/* General Purpose I/O */ +#define IOP321_DEVICEID (volatile u32 *)IOP321_REG_ADDR(0x000007c0) #define IOP321_GPOE (volatile u32 *)IOP321_REG_ADDR(0x000007c4) #define IOP321_GPID (volatile u32 *)IOP321_REG_ADDR(0x000007c8) #define IOP321_GPOD (volatile u32 *)IOP321_REG_ADDR(0x000007cc) @@ -166,6 +189,7 @@ #define _intctl_write(val) asm volatile("mcr p6,0,%0,c0,c0,0"::"r" (val)) #define intstr_read(val) asm volatile("mrc p6,0,%0,c4,c0,0":"=r" (val)) #define _intstr_write(val) asm volatile("mcr p6,0,%0,c4,c0,0"::"r" (val)) +#define intsrc_read(val) asm volatile("mrc p6,0,%0,c8,c0,0":"=r" (val)) static inline void intctl_write(u32 val) { _intctl_write(val); } static inline void intstr_write(u32 val) { _intstr_write(val); } @@ -186,6 +210,7 @@ #define IOP321_AAU_EDCR2 (volatile u32 *)IOP321_REG_ADDR(0x00000884) /* SSP serial port unit 0x00001600 - 0x0000167F */ + /* I2C bus interface unit 0x00001680 - 0x000016FF */ #define IOP321_I2C_ICR0 (volatile u32 *)IOP321_REG_ADDR(0x00001680) #define IOP321_I2C_ICR1 (volatile u32 *)IOP321_REG_ADDR(0x000016a0) diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iq31244.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iq31244.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/iq31244.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/iq31244.h 2003-10-26 17:44:26.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * linux/include/asm/arch-iop321/iq80321.h + * + * Intel IQ-31244 evaluation board registers + */ + +#ifndef _IQ31244_H_ +#define _IQ31244_H_ + +#include "iq80321.h" + +/* I2C Device Addresses */ + +#define IQ31244_I2C_MEMCONF 0x10100000 +#define IQ31244_I2C_TEMPSENSE0 0x10010000 +#define IQ31244_I2C_TEMPSENSE1 0x10010010 +#define IQ31244_I2C_RTC ` 0x11010000 + +#endif // _IQ31244_H_ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/keyboard.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/keyboard.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/keyboard.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/keyboard.h 2004-01-02 16:00:52.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * linux/include/asm-arm/arch-rpc/keyboard.h + * + * Copyright (C) 1998-2001 Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include +#include +#include +#include + +#ifdef CONFIG_ARCH_IYONIX + +#define kbd_enable_irq() do { } while (0) +#define kbd_disable_irq() do { } while (0) + + +extern int pckbd_setkeycode(unsigned int scancode, unsigned int keycode); +extern int pckbd_getkeycode(unsigned int scancode); +extern int pckbd_translate(unsigned char scancode, unsigned char *keycode, + char raw_mode); +extern char pckbd_unexpected_up(unsigned char keycode); +extern void pckbd_leds(unsigned char leds); +extern void pckbd_init_hw(void); +extern unsigned char pckbd_sysrq_xlate[128]; + +static inline void kbd_init_hw(void) +{ + k_setkeycode = pckbd_setkeycode; + k_getkeycode = pckbd_getkeycode; + k_translate = pckbd_translate; + k_unexpected_up = pckbd_unexpected_up; + k_leds = pckbd_leds; +#ifdef CONFIG_MAGIC_SYSRQ + k_sysrq_key = 0x54; + k_sysrq_xlate = pckbd_sysrq_xlate; +#endif + pckbd_init_hw(); +} + + + +/* + * PC Keyboard specifics + */ + +/* resource allocation */ +#define kbd_request_region() +#define kbd_request_irq(handler) + +/* How to access the keyboard macros on this platform. */ +#define kbd_read_input() 0 +#define kbd_read_status() 0 +#define kbd_write_output(val) +#define kbd_write_command(val) + +/* Some stoneage hardware needs delays after some operations. */ +#define kbd_pause() do { } while(0) + + +#endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/memory.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/memory.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/memory.h 2003-05-06 08:33:08.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/memory.h 2004-01-02 15:59:58.000000000 +0000 @@ -20,7 +20,11 @@ /* * Physical DRAM offset. */ +#ifdef CONFIG_ARCH_IYONIX +#define PHYS_OFFSET (0xc0000000UL) +#else #define PHYS_OFFSET (0xa0000000UL) +#endif /* * physical vs virtual ram conversion diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/serial.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/serial.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/serial.h 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/serial.h 2004-01-02 16:00:49.000000000 +0000 @@ -37,7 +37,7 @@ flags: STD_COM_FLAGS, \ iomem_base: 0xfe800000, \ io_type: SERIAL_IO_MEM \ - } /* ttyS0 */ + } /* ttyS1 */ #endif // CONFIG_ARCH_IQ80310 @@ -56,5 +56,29 @@ } /* ttyS0 */ #endif + +#ifdef CONFIG_ARCH_IYONIX + +#define RS_TABLE_SIZE 2 + +#define STD_SERIAL_PORT_DEFNS \ + { \ + magic: 0, \ + baud_base: BASE_BAUD, \ + port: IYONIX_IO_UART1, \ + irq: IRQ_IYONIX_UART1, \ + flags: STD_COM_FLAGS, \ + io_type: SERIAL_IO_PORT \ + }, /* ttyS0 */ \ + { \ + magic: 0, \ + baud_base: BASE_BAUD, \ + port: IYONIX_IO_UART2, \ + irq: IRQ_IYONIX_UART2, \ + flags: STD_COM_FLAGS, \ + io_type: SERIAL_IO_PORT \ + } /* ttyS1 */ +#endif // CONFIG_ARCH_IYONIX + #define EXTRA_SERIAL_PORT_DEFNS diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/system.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/system.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/system.h 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/system.h 2004-01-02 16:08:41.000000000 +0000 @@ -11,6 +11,10 @@ #include #include +#ifdef CONFIG_ARCH_IYONIX +#include +#endif + static inline void arch_idle(void) { cpu_do_idle(); @@ -19,8 +23,50 @@ static inline void arch_reset(char mode) { +#ifdef CONFIG_ARCH_IYONIX + /* Ensure USB is reset, otherwise it will not work when + we reboot to RISC OS */ + { + extern void iyonix_ohci_cleanup(void); + struct pci_dev *dev = NULL; + +// printk("calling cleanup"); + iyonix_ohci_cleanup(); + +// while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) { +// if ((dev->class >> 8) == PCI_CLASS_SERIAL_USB) { +// unsigned long mem_resource, mem_len; +// int *mem_base; +// +// pci_enable_device(dev); +// mem_resource = pci_resource_start(dev, 0); +// mem_len = pci_resource_len(dev, 0); +// if (!request_mem_region (mem_resource, mem_len, "USB")) { +// printk("didn't claim region\n"); +// } else { +// int address; +// +// mem_base = ioremap_nocache (mem_resource, mem_len); +// +// for (address = 0; address < 6; address++) { +// printk("%p ", mem_base[address]); +// } +// +// printk("MIE: %x\n", mem_base[3]); +// mem_base[1] = 0; // Reset +// mem_base[5] = 1 << 31; // MIE +// +// iounmap (mem_base); +// release_mem_region (mem_resource, mem_len); +// } +// pci_disable_device(dev); +// } +// } + } +#endif + #ifdef CONFIG_ARCH_IOP321 - if (machine_is_iq80321() || machine_is_iq31244()) + if (machine_is_iq80321() || machine_is_iq31244() || machine_is_iyonix()) *IOP321_PCSR = 0x30; #endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/uncompress.h linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/uncompress.h --- linux-arm-2.4-ds.orig/include/asm-arm/arch-iop3xx/uncompress.h 2003-07-21 17:45:14.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/arch-iop3xx/uncompress.h 2003-08-06 11:38:58.000000000 +0100 @@ -8,12 +8,16 @@ #define UART_BASE ((volatile unsigned char *)0xfe810000) #elif defined(CONFIG_ARCH_IQ80321) || defined (CONFIG_ARCH_IQ31244) #define UART_BASE ((volatile unsigned char *)0xfe800000) +#elif defined(CONFIG_ARCH_IYONIX) +#define UART_BASE ((volatile unsigned char *)0x900003f8) #endif static __inline__ void putc(char c) { +#ifndef CONFIG_ARCH_IYONIX while ((UART_BASE[5] & 0x60) != 0x60); UART_BASE[0] = c; +#endif } /* diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/dma.h linux-arm-2.4-ds/include/asm-arm/dma.h --- linux-arm-2.4-ds.orig/include/asm-arm/dma.h 2003-10-12 22:41:37.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/dma.h 2004-01-02 16:00:20.000000000 +0000 @@ -8,7 +8,12 @@ #include #include #include + +#ifdef CONFIG_IOP321_DMA +#include +#else #include +#endif /* * DMA modes diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/proc-armv/uaccess.h linux-arm-2.4-ds/include/asm-arm/proc-armv/uaccess.h --- linux-arm-2.4-ds.orig/include/asm-arm/proc-armv/uaccess.h 2003-05-06 08:33:09.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/proc-armv/uaccess.h 2004-01-02 15:59:58.000000000 +0000 @@ -158,3 +158,16 @@ extern unsigned long __arch_strnlen_user(const char *s, long n); #define __do_strnlen_user(s,n,res) \ (res) = __arch_strnlen_user(s,n) + +#ifdef CONFIG_IOP321_DMA_COPYFROMUSER +extern unsigned long dma_copy_from_user(void* to, const void* from, unsigned long n); +#undef __do_copy_from_user +#define __do_copy_from_user(to,from,n) \ + (n) = (((n) < 768) ? __arch_copy_from_user(to,from,n) : dma_copy_from_user(to,from,n)) +#endif +#ifdef CONFIG_IOP321_DMA_COPYTOUSER +extern unsigned long dma_copy_to_user(void* to, const void* from, unsigned long n); +#undef __do_copy_to_user +#define __do_copy_to_user(to,from,n) \ + (n) = (((n) < 768) ? __arch_copy_to_user(to,from,n) : dma_copy_to_user(to,from,n)) +#endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/asm-arm/string.h linux-arm-2.4-ds/include/asm-arm/string.h --- linux-arm-2.4-ds.orig/include/asm-arm/string.h 2003-05-06 08:33:01.000000000 +0100 +++ linux-arm-2.4-ds/include/asm-arm/string.h 2004-01-02 15:59:58.000000000 +0000 @@ -40,4 +40,22 @@ #define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); }) +#ifdef CONFIG_IOP321_DMA_MEMCPY +extern int iop_memcpy; +extern void * dma_memcpy(void *, const void*, __kernel_size_t); +extern void * asm_memcpy(void *, const void *, __kernel_size_t); + +static inline void * xscale_memcpy(void * dest, const void * src, + size_t n) +{ + if ((n < 768) || !iop_memcpy) + return asm_memcpy(dest, src, n); + return dma_memcpy(dest, src, n); +} + +#define memcpy(a, b, c) xscale_memcpy(a, b, c) +// Still need to support memmove and check overlapping regions +// #define memmove(a, b, c) xscale_memcpy(a, b, c) +#endif /* CONFIG_IOP321_DMA_MEMCPY */ + #endif diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/linux/i2c-algo-iop321.h linux-arm-2.4-ds/include/linux/i2c-algo-iop321.h --- linux-arm-2.4-ds.orig/include/linux/i2c-algo-iop321.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/include/linux/i2c-algo-iop321.h 2003-10-03 13:18:51.000000000 +0100 @@ -0,0 +1,40 @@ +/* + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* ------------------------------------------------------------------------- */ + +#ifndef I2C_ALGO_IOP321_H +#define I2C_ALGO_IOP321_H 1 + +/* --- Defines for iop321-adapters ------------------------------------ */ +#include + +//struct i2c_algo_pcf_data { +// void *data; /* private data for lolevel routines */ +// void (*setpcf) (void *data, int ctl, int val); +// int (*getpcf) (void *data, int ctl); +// int (*getown) (void *data); +// int (*getclock) (void *data); +// void (*waitforpin) (void); +// +// /* local settings */ +// int udelay; +// int mdelay; +// int timeout; +//}; + +int i2c_iop321_add_bus(struct i2c_adapter *); +int i2c_iop321_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_IOP321_H */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/linux/i2c-id.h linux-arm-2.4-ds/include/linux/i2c-id.h --- linux-arm-2.4-ds.orig/include/linux/i2c-id.h 2003-11-09 16:27:42.000000000 +0000 +++ linux-arm-2.4-ds/include/linux/i2c-id.h 2003-10-15 23:08:20.000000000 +0100 @@ -95,7 +95,7 @@ #define I2C_DRIVERID_ADV717x 48 /* ADV 7175/7176 video encoder */ #define I2C_DRIVERID_ZR36067 49 /* Zoran 36067 video encoder */ #define I2C_DRIVERID_ZR36120 50 /* Zoran 36120 video encoder */ -#define I2C_DRIVERID_24LC32A 51 /* Microchip 24LC32A 32k EEPROM */ +#define I2C_DRIVERID_24LC32A 51 /* Microchip 24LC32A 32k EEPROM */ #define I2C_DRIVERID_M41ST85W 52 /* ST M41ST85W RTC */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/linux/i2c.h linux-arm-2.4-ds/include/linux/i2c.h --- linux-arm-2.4-ds.orig/include/linux/i2c.h 2003-10-12 22:41:53.000000000 +0100 +++ linux-arm-2.4-ds/include/linux/i2c.h 2004-01-02 16:00:55.000000000 +0000 @@ -205,7 +205,7 @@ char name[32]; /* textual description */ unsigned int id; - /* If an adapter algorithm can't to I2C-level access, set master_xfer + /* If an adapter algorithm can't do I2C-level access, set master_xfer to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated using common I2C messages */ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/include/linux/pci_ids.h linux-arm-2.4-ds/include/linux/pci_ids.h --- linux-arm-2.4-ds.orig/include/linux/pci_ids.h 2003-10-03 13:51:17.000000000 +0100 +++ linux-arm-2.4-ds/include/linux/pci_ids.h 2003-10-03 13:00:45.000000000 +0100 @@ -868,6 +868,7 @@ #define PCI_DEVICE_ID_AL_M5219 0x5219 #define PCI_DEVICE_ID_AL_M5229 0x5229 #define PCI_DEVICE_ID_AL_M5237 0x5237 +#define PCI_DEVICE_ID_AL_M5257 0x5257 #define PCI_DEVICE_ID_AL_M5243 0x5243 #define PCI_DEVICE_ID_AL_M5451 0x5451 #define PCI_DEVICE_ID_AL_M7101 0x7101 Binary files linux-arm-2.4-ds.orig/linux-2.4-iyonix.tar.b2 and linux-arm-2.4-ds/linux-2.4-iyonix.tar.b2 differ diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/net/ipv4/tcp.c linux-arm-2.4-ds/net/ipv4/tcp.c --- linux-arm-2.4-ds.orig/net/ipv4/tcp.c 2003-10-03 13:51:20.000000000 +0100 +++ linux-arm-2.4-ds/net/ipv4/tcp.c 2003-10-26 17:44:29.000000000 +0000 @@ -963,6 +963,33 @@ int err = 0; unsigned int csum; +#ifdef CONFIG_TCP_DMA_TX + extern int iop_memcpy; + if(iop_memcpy) + { + copy_from_user(page_address(page)+off, from, copy); + skb->ip_summed = CHECKSUM_HW; + skb->len += copy; + skb->data_len += copy; + skb->truesize += copy; + sk->wmem_queued += copy; + sk->forward_alloc -= copy; + } + else + { + csum = csum_and_copy_from_user(from, page_address(page)+off, + copy, 0, &err); + if (!err) { + if (skb->ip_summed == CHECKSUM_NONE) + skb->csum = csum_block_add(skb->csum, csum, skb->len); + skb->len += copy; + skb->data_len += copy; + skb->truesize += copy; + sk->wmem_queued += copy; + sk->forward_alloc -= copy; + } + } +#else csum = csum_and_copy_from_user(from, page_address(page)+off, copy, 0, &err); if (!err) { @@ -974,6 +1001,7 @@ sk->wmem_queued += copy; sk->forward_alloc -= copy; } +#endif return err; } @@ -1083,8 +1111,24 @@ /* We have some space in skb head. Superb! */ if (copy > skb_tailroom(skb)) copy = skb_tailroom(skb); +#ifndef CONFIG_TCP_DMA_TX if ((err = skb_add_data(skb, from, copy)) != 0) goto do_fault; +#else + { + extern int iop_memcpy; + if(iop_memcpy) + { + copy_from_user(skb_put(skb, copy), from, copy); + skb->ip_summed = CHECKSUM_HW; + } + else + { + if ((err = skb_add_data(skb, from, copy)) != 0) + goto do_fault; + } + } +#endif } else { int merge = 0; int i = skb_shinfo(skb)->nr_frags; diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/stamp-configure linux-arm-2.4-ds/stamp-configure --- linux-arm-2.4-ds.orig/stamp-configure 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/stamp-configure 2004-01-02 15:59:51.000000000 +0000 @@ -0,0 +1 @@ +done diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/stamp-debian linux-arm-2.4-ds/stamp-debian --- linux-arm-2.4-ds.orig/stamp-debian 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/stamp-debian 2004-01-02 15:59:10.000000000 +0000 @@ -0,0 +1 @@ +done diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/stamp-image linux-arm-2.4-ds/stamp-image --- linux-arm-2.4-ds.orig/stamp-image 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/stamp-image 2004-01-02 16:09:30.000000000 +0000 @@ -0,0 +1 @@ +done diff --exclude BitKeeper --exclude ChangeSet --exclude SCCS -urN linux-arm-2.4-ds.orig/stamp-kernel-configure linux-arm-2.4-ds/stamp-kernel-configure --- linux-arm-2.4-ds.orig/stamp-kernel-configure 1970-01-01 01:00:00.000000000 +0100 +++ linux-arm-2.4-ds/stamp-kernel-configure 2004-01-02 15:59:51.000000000 +0000 @@ -0,0 +1 @@ +done