diff -ruN linux-2.6.0-test7-rmk1/Makefile linux-2.6.0-test7-rmk1-cerf1/Makefile --- linux-2.6.0-test7-rmk1/Makefile 2003-10-18 15:34:44.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/Makefile 2003-10-18 16:19:38.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 0 -EXTRAVERSION = -test7-rmk1 +EXTRAVERSION = -test7-rmk1-cerf1 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -ruN linux-2.6.0-test7-rmk1/arch/arm/configs/cerfcube_defconfig linux-2.6.0-test7-rmk1-cerf1/arch/arm/configs/cerfcube_defconfig --- linux-2.6.0-test7-rmk1/arch/arm/configs/cerfcube_defconfig 2003-10-08 12:24:00.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/configs/cerfcube_defconfig 2003-10-18 18:35:38.000000000 -0700 @@ -2,66 +2,94 @@ # 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_MMU=y CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set # # Code maturity level options # CONFIG_EXPERIMENTAL=y -# CONFIG_OBSOLETE is not set +CONFIG_CLEAN_COMPILE=y +CONFIG_STANDALONE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_SYSCTL=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_IKCONFIG is not set +# CONFIG_EMBEDDED is not set +CONFIG_KALLSYMS=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y # # Loadable module support # CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set -# CONFIG_KMOD is not set +CONFIG_KMOD=y # # System Type # +# CONFIG_ARCH_ADIFCC is not set # CONFIG_ARCH_ANAKIN is not set -# CONFIG_ARCH_ARCA5K is not set # CONFIG_ARCH_CLPS7500 is not set # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set +# CONFIG_ARCH_PXA is not set # CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP3XX is not set # CONFIG_ARCH_L7200 is not set # CONFIG_ARCH_RPC is not set CONFIG_ARCH_SA1100=y # CONFIG_ARCH_SHARK is not set # -# Archimedes/A5000 Implementations +# CLPS711X/EP721X Implementations # # -# Archimedes/A5000 Implementations (select only ONE) +# Epxa10db # -# 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 + +# +# IOP3xx Implementation Options +# +# CONFIG_ARCH_IOP310 is not set +# CONFIG_ARCH_IOP321 is not set + +# +# IOP3xx Chipset Features +# + +# +# Intel PXA250/210 Implementations +# # # SA11x0 Implementations # # CONFIG_SA1100_ASSABET is not set -# CONFIG_ASSABET_NEPONSET is not set # CONFIG_SA1100_ADSBITSY is not set # CONFIG_SA1100_BRUTUS is not set CONFIG_SA1100_CERF=y @@ -69,13 +97,17 @@ CONFIG_SA1100_CERF_FLASH_16MB=y # CONFIG_SA1100_CERF_FLASH_32MB is not set # CONFIG_SA1100_CERF_CPLD is not set +# CONFIG_SA1100_H3100 is not set # CONFIG_SA1100_H3600 is not set +# CONFIG_SA1100_H3800 is not set # CONFIG_SA1100_EXTENEX1 is not set # CONFIG_SA1100_FLEXANET is not set # CONFIG_SA1100_FREEBIRD is not set # CONFIG_SA1100_GRAPHICSCLIENT is not set # CONFIG_SA1100_GRAPHICSMASTER is not set +# CONFIG_SA1100_BADGE4 is not set # CONFIG_SA1100_JORNADA720 is not set +# CONFIG_SA1100_HACKKIT is not set # CONFIG_SA1100_HUW_WEBPANEL is not set # CONFIG_SA1100_ITSY is not set # CONFIG_SA1100_LART is not set @@ -83,84 +115,81 @@ # CONFIG_SA1100_OMNIMETER is not set # CONFIG_SA1100_PANGOLIN is not set # CONFIG_SA1100_PLEB is not set +# CONFIG_SA1100_PT_SYSTEM3 is not set +# CONFIG_SA1100_SHANNON is not set # CONFIG_SA1100_SHERMAN is not set # CONFIG_SA1100_SIMPAD is not set # CONFIG_SA1100_PFS168 is not set # CONFIG_SA1100_VICTOR is not set # CONFIG_SA1100_XP860 is not set # CONFIG_SA1100_YOPY is not set +# CONFIG_SA1100_STORK is not set +# CONFIG_SA1100_SSP is not set CONFIG_SA1100_USB=y CONFIG_SA1100_USB_NETLINK=y -CONFIG_SA1100_USB_CHAR=y +# CONFIG_SA1100_USB_CHAR is not set # -# CLPS711X/EP721X Implementations +# Processor Type # -# CONFIG_ARCH_CDB89712 is not set -# CONFIG_ARCH_CLEP7312 is not set -# CONFIG_ARCH_EDB7211 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 CONFIG_CPU_32=y -# CONFIG_CPU_26 is not set +CONFIG_CPU_SA1100=y +CONFIG_CPU_32v4=y +CONFIG_CPU_ABRT_EV4=y +CONFIG_CPU_CACHE_V4WB=y +CONFIG_CPU_TLB_V4WB=y +CONFIG_CPU_MINICACHE=y # -# Processor Type +# Processor Features # -# CONFIG_CPU_32v3 is not set -CONFIG_CPU_32v4=y -# 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_ARM1020 is not set -# CONFIG_CPU_SA110 is not set -CONFIG_CPU_SA1100=y -# CONFIG_ARM_THUMB is not set -CONFIG_DISCONTIGMEM=y # # General setup # -# CONFIG_PCI is not set -# CONFIG_ISA is not set -# CONFIG_ISA_DMA is not set +CONFIG_DISCONTIGMEM=y +CONFIG_ISA=y +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_SA1110=y +# CONFIG_CPU_FREQ_PROC_INTF is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_24_API=y CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=y +# CONFIG_PCMCIA_DEBUG is not set # CONFIG_I82365 is not set # CONFIG_TCIC is not set -# CONFIG_PCMCIA_CLPS6700 is not set CONFIG_PCMCIA_SA1100=y -CONFIG_NET=y -CONFIG_SYSVIPC=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_SYSCTL=y # # At least one math emulation must be selected # -CONFIG_FPE_NWFPE=y -# CONFIG_FPE_FASTFPE is not set -CONFIG_KCORE_ELF=y -# CONFIG_KCORE_AOUT is not set -# CONFIG_BINFMT_AOUT is not set +# CONFIG_FPE_NWFPE is not set +CONFIG_FPE_FASTFPE=y CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set -# CONFIG_PM is not set + +# +# Generic Driver Options +# +# CONFIG_FW_LOADER is not set +CONFIG_PM=y +# CONFIG_PREEMPT is not set # CONFIG_APM is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="console=ttySA0 root=/dev/mtdblock3 rw mem=32M" -# CONFIG_PFS168_CMDLINE is not set +CONFIG_CMDLINE="console=ttySA0,38400 root=/dev/mtdblock3 rootfstype=jffs2 rw mem=32M init=/linuxrc" CONFIG_LEDS=y CONFIG_LEDS_TIMER=y CONFIG_LEDS_CPU=y @@ -177,8 +206,9 @@ CONFIG_MTD=y # CONFIG_MTD_DEBUG is not set CONFIG_MTD_PARTITIONS=y -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_BOOTLDR_PARTS is not set +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_AFS_PARTS is not set # @@ -188,6 +218,7 @@ CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set # CONFIG_NFTL is not set +# CONFIG_INFTL is not set # # RAM/ROM/Flash chip drivers @@ -198,6 +229,7 @@ # CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_CFI_INTELEXT=y # CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_STAA is not set # CONFIG_MTD_RAM is not set # CONFIG_MTD_ROM is not set # CONFIG_MTD_ABSENT is not set @@ -206,47 +238,25 @@ # # Mapping drivers for chip access # +# CONFIG_MTD_COMPLEX_MAPPINGS is not set # CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_SUN_UFLASH is not set -# CONFIG_MTD_NORA is not set -# CONFIG_MTD_PNC2000 is not set -# CONFIG_MTD_RPXLITE is not set -# CONFIG_MTD_TQM8XXL is not set -# CONFIG_MTD_SC520CDP is not set -# CONFIG_MTD_NETSC520 is not set -# CONFIG_MTD_SBC_GXX is not set -# CONFIG_MTD_ELAN_104NC is not set -# CONFIG_MTD_DBOX2 is not set -# CONFIG_MTD_CSTM_MIPS_IXX is not set -# CONFIG_MTD_CFI_FLAGADM is not set -# CONFIG_MTD_SOLUTIONENGINE is not set -# CONFIG_MTD_MIXMEM is not set -# CONFIG_MTD_OCTAGON is not set -# CONFIG_MTD_VMAX is not set -# CONFIG_MTD_OCELOT is not set -# CONFIG_MTD_L440GX is not set # CONFIG_MTD_ARM_INTEGRATOR is not set -# CONFIG_MTD_CDB89712 is not set CONFIG_MTD_SA1100=y -# CONFIG_MTD_DC21285 is not set -# CONFIG_MTD_IQ80310 is not set +# CONFIG_MTD_EDB7312 is not set # # Self-contained MTD device drivers # -# CONFIG_MTD_PMC551 is not set # CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_LART is not set # CONFIG_MTD_MTDRAM is not set # CONFIG_MTD_BLKMTD is not set # # Disk-On-Chip Device Drivers # -# CONFIG_MTD_DOC1000 is not set # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOCPROBE is not set +# CONFIG_MTD_DOC2001PLUS is not set # # NAND Flash Device Drivers @@ -254,22 +264,17 @@ # CONFIG_MTD_NAND is not set # -# Plug and Play configuration +# Plug and Play support # # CONFIG_PNP is not set -# CONFIG_ISAPNP is not set -# CONFIG_PNPBIOS is not set # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_DEV_XD is not set -# CONFIG_PARIDE is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set # CONFIG_BLK_DEV_NBD is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 @@ -279,47 +284,52 @@ # 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_BLK_DEV_LVM is not set + +# +# Networking support +# +CONFIG_NET=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set -CONFIG_NETLINK=y -CONFIG_RTNETLINK=y # CONFIG_NETLINK_DEV is not set -# CONFIG_NETFILTER is not set -CONFIG_FILTER=y CONFIG_UNIX=y +# CONFIG_NET_KEY is not set CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_PNP is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set # CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set # CONFIG_IPV6 is not set -# CONFIG_KHTTPD is not set -# CONFIG_ATM is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_NETFILTER is not set # +# SCTP Configuration (EXPERIMENTAL) # -# +CONFIG_IPV6_SCTP__=y +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set -# CONFIG_DECNET is not set -# CONFIG_BRIDGE is not set # 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 @@ -332,8 +342,9 @@ # CONFIG_NET_SCHED is not set # -# Network device support +# Network testing # +# CONFIG_NET_PKTGEN is not set CONFIG_NETDEVICES=y # @@ -344,45 +355,35 @@ # 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_SUNLANCE is not set -# CONFIG_SUNBMAC is not set -# CONFIG_SUNQE is not set -# CONFIG_SUNLANCE is not set -# CONFIG_SUNGEM is not set -CONFIG_NET_VENDOR_3COM=y -# CONFIG_EL1 is not set -# CONFIG_EL2 is not set -# CONFIG_ELPLUS is not set -# CONFIG_EL16 is not set -# CONFIG_ELMC is not set -# CONFIG_ELMC_II is not set -CONFIG_CERF_CS8900A=y +# CONFIG_MII is not set +# CONFIG_SMC91X 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_AT1700 is not set +# CONFIG_DEPCA is not set +# CONFIG_HP100 is not set # CONFIG_NET_ISA is not set -# CONFIG_NET_PCI is not set +CONFIG_NET_PCI=y +# CONFIG_AC3200 is not set +# CONFIG_APRICOT is not set +# CONFIG_CS89x0 is not set +CONFIG_CS8900=y # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_MYRI_SBUS is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_SK98LIN is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -# CONFIG_PLIP is not set + +# +# Ethernet (10000 Mbit) +# # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -390,13 +391,12 @@ # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set +# CONFIG_HOSTAP 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 # @@ -407,17 +407,7 @@ # # PCMCIA network device support # -CONFIG_NET_PCMCIA=y -# CONFIG_PCMCIA_3C589 is not set -# CONFIG_PCMCIA_3C574 is not set -# CONFIG_PCMCIA_FMVJ18X is not set -CONFIG_PCMCIA_PCNET=m -# CONFIG_PCMCIA_NMCLAN is not set -# CONFIG_PCMCIA_SMC91C92 is not set -# CONFIG_PCMCIA_XIRC2PS is not set -# CONFIG_ARCNET_COM20020_CS is not set -# CONFIG_PCMCIA_IBMTR is not set -# CONFIG_NET_PCMCIA_RADIO is not set +# CONFIG_NET_PCMCIA is not set # # Amateur Radio support @@ -430,113 +420,112 @@ # CONFIG_IRDA is not set # -# ATA/IDE/MFM/RLL support +# Bluetooth support # -CONFIG_IDE=y +# CONFIG_BT is not set # -# IDE, ATA and ATAPI Block devices +# ATA/ATAPI/MFM/RLL support # +CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # -# CONFIG_BLK_DEV_HD_IDE is not set -# CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set CONFIG_BLK_DEV_IDECS=m # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set -# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDE_TASKFILE_IO 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_IDE_CHIPSETS is not set +# CONFIG_BLK_DEV_IDEDMA is not set # CONFIG_IDEDMA_AUTO is not set -# CONFIG_BLK_DEV_ATARAID is not set -# CONFIG_BLK_DEV_ATARAID_PDC is not set -# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_HD is not set # -# SCSI support +# SCSI device support # # CONFIG_SCSI is not set # # I2O device support # -# CONFIG_I2O is not set -# CONFIG_I2O_BLOCK is not set -# CONFIG_I2O_LAN is not set -# CONFIG_I2O_SCSI is not set -# CONFIG_I2O_PROC is not set # # ISDN subsystem # -# CONFIG_ISDN is not set +# CONFIG_ISDN_BOOL is not set + +# +# Input device support +# +CONFIG_INPUT=y # -# Input core support +# Userland interfaces # -# CONFIG_INPUT is not set -# CONFIG_INPUT_KEYBDEV is not set -# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_TSLIBDEV is not set # CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +CONFIG_SERIO=y +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_CT82C710 is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set # # Character devices # CONFIG_VT=y -# CONFIG_VT_CONSOLE is not set -# CONFIG_SERIAL is not set -# CONFIG_SERIAL_EXTENDED is not set +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y # 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_8250 is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_DZ is not set CONFIG_SERIAL_SA1100=y CONFIG_SERIAL_SA1100_CONSOLE=y -CONFIG_SA1100_DEFAULT_BAUDRATE=9600 -# 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_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=32 -# CONFIG_UCB1200 is not set -# CONFIG_TOUCHSCREEN_UCB1200 is not set -# CONFIG_AUDIO_UCB1200 is not set -# CONFIG_ADC_UCB1200 is not set -# CONFIG_TOUCHSCREEN_H3600 is not set -# CONFIG_PROFILER is not set -# CONFIG_PFS168_SPI is not set -# CONFIG_PFS168_DTMF is not set -# CONFIG_PFS168_MISC is not set # # I2C support @@ -544,56 +533,45 @@ # CONFIG_I2C is not set # -# L3 serial bus support +# I2C Algorithms # -# CONFIG_L3 is not set -# CONFIG_L3_ALGOBIT is not set -# CONFIG_L3_BIT_SA1100_GPIO is not set -# CONFIG_BIT_SA1100_UCB1200 is not set # -# Other L3 adapters +# I2C Hardware Bus support # -# CONFIG_L3_SA1111 is not set # -# L3 driver support +# I2C Hardware Sensors Chip support # -# CONFIG_L3_DRV_UDA1341 is not set -# CONFIG_BIT_SA1100_GPIO is not set - -# -# Mice -# -# CONFIG_BUSMOUSE is not set -# CONFIG_MOUSE is not set +# CONFIG_I2C_SENSOR is not set # -# Joysticks +# L3 serial bus support # -# CONFIG_INPUT_GAMEPORT is not set +CONFIG_L3=m # -# Input core support is needed for gameports +# Mice # +# CONFIG_BUSMOUSE is not set +# CONFIG_QIC02_TAPE is not set # -# Input core support is needed for joysticks +# IPMI # -# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set -# CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set -CONFIG_SA1100_RTC=y +# CONFIG_GEN_RTC is not set +# CONFIG_SA1100_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set -# CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver @@ -605,6 +583,8 @@ # # PCMCIA character devices # +# CONFIG_SYNCLINK_CS is not set +# CONFIG_RAW_DRIVER is not set # # Multimedia devices @@ -612,94 +592,126 @@ # CONFIG_VIDEO_DEV is not set # +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC 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 is not set -# CONFIG_ADFS_FS_RW is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_CMS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT3_FS is not set # CONFIG_JBD is not set -# CONFIG_JBD_DEBUG is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +CONFIG_ROMFS_FS=y +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y -CONFIG_UMSDOS_FS=y CONFIG_VFAT_FS=y +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS=y +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_NAND is not set # CONFIG_CRAMFS is not set -# CONFIG_TMPFS is not set -CONFIG_RAMFS=y -# CONFIG_ISO9660_FS is not set -# CONFIG_JOLIET is not set -# CONFIG_MINIX_FS is not set -# CONFIG_FREEVXFS_FS is not set -# CONFIG_NTFS_FS is not set -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set +# CONFIG_VXFS_FS 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=y -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_NFS_V4=y +CONFIG_NFSD=y +CONFIG_NFSD_V3=y +CONFIG_NFSD_V4=y +# CONFIG_NFSD_TCP is not set # CONFIG_ROOT_NFS is not set -# CONFIG_NFSD is not set -# CONFIG_NFSD_V3 is not set -CONFIG_SUNRPC=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y +CONFIG_EXPORTFS=y +CONFIG_SUNRPC=y +# CONFIG_SUNRPC_GSS is not set # CONFIG_SMB_FS is not set +# CONFIG_CIFS 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_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +# CONFIG_AFS_FS is not set # # Partition Types # -# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y -# CONFIG_SMB_NLS is not set +# 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_NEC98_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_NLS=y # # Native Language Support # CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set +CONFIG_NLS_CODEPAGE_437=y # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set @@ -720,8 +732,9 @@ # 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_1=y # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set @@ -737,15 +750,16 @@ # CONFIG_NLS_UTF8 is not set # -# Console drivers +# Graphics support # -CONFIG_PC_KEYMAP=y -# CONFIG_VGA_CONSOLE is not set +# CONFIG_FB is not set # -# Frame-buffer support +# Console display driver support # -# CONFIG_FB is not set +# CONFIG_VGA_CONSOLE is not set +# CONFIG_MDA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y # # Sound @@ -753,121 +767,52 @@ # CONFIG_SOUND is not set # -# USB support -# -# CONFIG_USB is not set - -# -# USB Controllers -# -# CONFIG_USB_UHCI is not set -# CONFIG_USB_UHCI_ALT is not set -# CONFIG_USB_OHCI is not set -# CONFIG_USB_OHCI_SA1111 is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_AUDIO is not set -# CONFIG_USB_BLUETOOTH 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_JUMPSHOT 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_ACM is not set -# CONFIG_USB_PRINTER is not set - -# -# USB Human Interface Devices (HID) -# - -# -# Input core support is needed for USB HID -# - -# -# USB Imaging devices +# Misc devices # -# CONFIG_USB_DC2XX is not set -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_SCANNER is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set # -# USB Multimedia devices +# Multimedia Capabilities Port drivers # +# CONFIG_MCP is not set # -# Video4Linux support is needed for USB Multimedia device support +# Console Switches # -# CONFIG_USB_DABUSB is not set +# CONFIG_SWITCHES is not set # -# USB Network adaptors -# -# CONFIG_USB_PLUSB is not set -# CONFIG_USB_PEGASUS 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 +# USB support # -# CONFIG_USB_USS720 is not set +# CONFIG_USB_GADGET is not set # -# USB Serial Converter support +# Kernel hacking # -# CONFIG_USB_SERIAL is not set -# CONFIG_USB_SERIAL_GENERIC is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -# CONFIG_USB_SERIAL_EMPEG is not set -# CONFIG_USB_SERIAL_FTDI_SIO is not set -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_OMNINET is not set +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SLAB is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_ERRORS=y +CONFIG_DEBUG_LL=y # -# Miscellaneous USB drivers +# Security options # -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_ID75 is not set +# CONFIG_SECURITY is not set # -# Bluetooth support +# Cryptographic options # -# CONFIG_BT is not set +# CONFIG_CRYPTO is not set # -# Kernel hacking +# Library routines # -CONFIG_FRAME_POINTER=y -CONFIG_DEBUG_ERRORS=y -CONFIG_DEBUG_USER=y -# CONFIG_DEBUG_INFO is not set -CONFIG_MAGIC_SYSRQ=y -# CONFIG_NO_PGT_CACHE is not set -# CONFIG_DEBUG_LL is not set -# CONFIG_DEBUG_DC21285_PORT is not set -# CONFIG_DEBUG_CLPS711X_UART2 is not set +CONFIG_CRC32=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff -ruN linux-2.6.0-test7-rmk1/arch/arm/configs/cerfcube_pxa_defconfig linux-2.6.0-test7-rmk1-cerf1/arch/arm/configs/cerfcube_pxa_defconfig --- linux-2.6.0-test7-rmk1/arch/arm/configs/cerfcube_pxa_defconfig 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/configs/cerfcube_pxa_defconfig 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,698 @@ +# +# Automatically generated make config: don't edit +# +CONFIG_ARM=y +CONFIG_MMU=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General setup +# +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_EMBEDDED is not set +CONFIG_FUTEX=y +CONFIG_EPOLL=y + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODULE_FORCE_UNLOAD is not set +CONFIG_OBSOLETE_MODPARM=y +# CONFIG_MODVERSIONS is not set +CONFIG_KMOD=y + +# +# System Type +# +# CONFIG_ARCH_ADIFCC is not set +# CONFIG_ARCH_ANAKIN is not set +# CONFIG_ARCH_ARCA5K is not set +# CONFIG_ARCH_CLPS7500 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CO285 is not set +CONFIG_ARCH_PXA=y +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP3XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_SHARK is not set + +# +# Archimedes/A5000 Implementations +# + +# +# Archimedes/A5000 Implementations (select only ONE) +# + +# +# CLPS711X/EP721X Implementations +# + +# +# Epxa10db +# + +# +# Footbridge Implementations +# + +# +# IOP3xx Implementation Options +# +# CONFIG_ARCH_IOP310 is not set +# CONFIG_ARCH_IOP321 is not set + +# +# IOP3xx Chipset Features +# + +# +# Intel PXA250/210 Implementations +# +# CONFIG_ARCH_LUBBOCK is not set +# CONFIG_ARCH_PXA_IDP is not set +CONFIG_ARCH_PXA_CERF=y + +# +# SA11x0 Implementations +# + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_XSCALE=y +CONFIG_CPU_32v5=y + +# +# Processor Features +# +# CONFIG_ARM_THUMB is not set +CONFIG_XSCALE_PMU=y + +# +# General setup +# +# CONFIG_ZBOOT_ROM is not set +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +# CONFIG_HOTPLUG is not set + +# +# 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_PREEMPT is not set +# CONFIG_ARTHUR is not set +CONFIG_CMDLINE="root=/dev/mtdblock3 rw mem=64M console=ttyS0,38400 init=/linuxrc rootfstype=jffs2" +CONFIG_ALIGNMENT_TRAP=y + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Memory Technology Devices (MTD) +# +CONFIG_MTD=y +# CONFIG_MTD_DEBUG is not set +CONFIG_MTD_PARTITIONS=y +# CONFIG_MTD_CONCAT is not set +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_AFS_PARTS is not set + +# +# User Modules And Translation Layers +# +CONFIG_MTD_CHAR=y +CONFIG_MTD_BLOCK=y +# CONFIG_FTL is not set +# CONFIG_NFTL is not set + +# +# RAM/ROM/Flash chip drivers +# +CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_NOSWAP=y +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_OBSOLETE_CHIPS is not set + +# +# Mapping drivers for chip access +# +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_NORA is not set +# CONFIG_MTD_ARM_INTEGRATOR is not set +CONFIG_MTD_PXA_CERF=y +# CONFIG_MTD_EDB7312 is not set +# CONFIG_MTD_UCLINUX is not set + +# +# Self-contained MTD device drivers +# +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_BLKMTD is not set + +# +# Disk-On-Chip Device Drivers +# +# CONFIG_MTD_DOC1000 is not set +# CONFIG_MTD_DOC2000 is not set +# CONFIG_MTD_DOC2001 is not set + +# +# NAND Flash Device Drivers +# +# CONFIG_MTD_NAND is not set + +# +# Plug and Play support +# +# CONFIG_PNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +# CONFIG_IP_MULTICAST is not set +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_IPV6 is not set +# CONFIG_XFRM_USER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=y +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_LLC is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +CONFIG_NETDEVICES=y +# 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_MII is not set +CONFIG_NET_VENDOR_SMC=y +CONFIG_SMC91111=y + +# +# Ethernet (1000 Mbit) +# + +# +# Ethernet (10000 Mbit) +# +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices (depends on LLC=y) +# +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI support +# +CONFIG_SCSI=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# 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 is not set + +# +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs +# +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_REPORT_LUNS is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AIC7XXX 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_MEGARAID is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_EATA 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_GENERIC_NCR5380_MMIO is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# I2O device support +# + +# +# ISDN subsystem +# +# CONFIG_ISDN_BOOL is not set + +# +# Input device support +# +# CONFIG_INPUT is not set + +# +# Userland interfaces +# + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_SERIO is not set + +# +# Input Device Drivers +# + +# +# Character devices +# +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_DZ is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=32 + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# I2C Hardware Sensors Mainboard support +# + +# +# I2C Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set + +# +# L3 serial bus support +# +# CONFIG_L3 is not set + +# +# Mice +# +CONFIG_BUSMOUSE=y +# CONFIG_QIC02_TAPE is not set + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_GEN_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 +# CONFIG_RAW_DRIVER is not set +# CONFIG_HANGCHECK_TIMER is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS=y +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_NAND is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +CONFIG_NFS_V4=y +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=y +# CONFIG_SUNRPC_GSS is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_NEC98_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_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=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set + +# +# Graphics support +# +# CONFIG_FB is not set + +# +# Misc devices +# + +# +# Multimedia Capabilities Port drivers +# +# CONFIG_MCP is not set + +# +# Console Switches +# +# CONFIG_SWITCHES is not set + +# +# USB support +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +# CONFIG_BT is not set + +# +# Kernel hacking +# +CONFIG_FRAME_POINTER=y +CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_SLAB is not set +CONFIG_MAGIC_SYSRQ=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_WAITQ is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_ERRORS=y +CONFIG_KALLSYMS=y +CONFIG_DEBUG_LL=y + +# +# Security options +# +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +CONFIG_CRC32=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y diff -ruN linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/Kconfig linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/Kconfig --- linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/Kconfig 2003-10-08 12:24:02.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/Kconfig 2003-10-18 15:48:36.000000000 -0700 @@ -9,5 +9,9 @@ bool "Accelent Xscale IDP" depends on ARCH_PXA +config ARCH_PXA_CERF + bool "CerfBoard PXA Reference Board" + depends on ARCH_PXA + endmenu diff -ruN linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/Makefile linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/Makefile --- linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/Makefile 2003-10-08 12:24:06.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/Makefile 2003-10-18 15:48:36.000000000 -0700 @@ -8,6 +8,7 @@ # Specific board support obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o +obj-$(CONFIG_ARCH_PXA_CERF) += cerf.o # Support for blinky lights led-y := leds.o diff -ruN linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/cerf.c linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/cerf.c --- linux-2.6.0-test7-rmk1/arch/arm/mach-pxa/cerf.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-pxa/cerf.c 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,96 @@ +/* + * linux/arch/arm/mach-pxa/cerf.c + * + * Support for Intrinsyc's CerfBoard (pxa25x) + * + * Copyright: Intrinsyc 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 + +#include + +#include "generic.h" + +static void __init cerf_init_irq(void) +{ + pxa_init_irq(); + +// set_irq_type(IRQ_GPIO(0), IRQT_FALLING); +// set_irq_type(IRQ_GPIO(21), IRQT_RISING); /* Ethernet */ +} + +static int __init cerf_init(void) +{ + return 0; +} + +__initcall(cerf_init); + +static struct map_desc cerf_io_desc[] __initdata = { + /* virtual physical length type */ + { CERF_FLASH_BASE, CERF_FLASH_PHYS, CERF_FLASH_SIZE, MT_DEVICE }, /* Flash */ + { CERF_ETH_BASE , CERF_ETH_PHYS , CERF_ETH_SIZE , MT_DEVICE }, /* Ethernet */ + { CERF_ETH2_BASE , CERF_ETH2_PHYS , CERF_ETH2_SIZE , MT_DEVICE }, /* Ethernet DB */ +}; + +static void __init cerf_map_io(void) +{ + pxa_map_io(); + iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc)); + + /* setup memory timing for CS0/1 */ + MSC0 = MSC_CS(0, CERF_MSC_CS0) | MSC_CS(1, CERF_MSC_CS1); + printk(KERN_INFO "MCS0 = 0x%08x\n", MSC0); + + /* setup memory timing for CS2/3 */ + MSC1 = MSC_CS(2, CERF_MSC_CS2) | MSC_CS(3, CERF_MSC_CS3); + printk(KERN_INFO "MCS1 = 0x%08x\n", MSC1); + + /* setup memory timing for CS4/5 */ + MSC2 = MSC_CS(4, CERF_MSC_CS4) | MSC_CS(5, CERF_MSC_CS5); + printk(KERN_INFO "MCS2 = 0x%08x\n", MSC2); + +#if 0 + /* This enables the BTUART */ + CKEN |= CKEN7_BTUART; + pxa_gpio_mode(GPIO42_BTRXD_MD); + pxa_gpio_mode(GPIO43_BTTXD_MD); + pxa_gpio_mode(GPIO44_BTCTS_MD); + pxa_gpio_mode(GPIO45_BTRTS_MD); + + /* setup sleep mode values */ + PWER = 0x00000002; + PFER = 0x00000000; + PRER = 0x00000002; + PGSR0 = 0x00008000; + PGSR1 = 0x003F0202; + PGSR2 = 0x0001C000; + PCFR |= PCFR_OPDE; +#endif +} + +MACHINE_START(PXA_CERF, "CerfBoard PXA Reference Board") + MAINTAINER("Intrinsyc Software Inc.") + BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) + BOOT_PARAMS(0xa0000100) + MAPIO(cerf_map_io) + INITIRQ(cerf_init_irq) +MACHINE_END diff -ruN linux-2.6.0-test7-rmk1/arch/arm/mach-sa1100/cerf.c linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-sa1100/cerf.c --- linux-2.6.0-test7-rmk1/arch/arm/mach-sa1100/cerf.c 2003-10-08 12:24:04.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-sa1100/cerf.c 2003-10-18 18:35:02.000000000 -0700 @@ -5,44 +5,49 @@ #include #include #include +#include #include #include #include +#include #include #include #include +#include #include "generic.h" +static struct resource cerfuart2_resources[] = { + [0] = { + .start = 0x80030000, + .end = 0x8003ffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device cerfuart2_device = { + .name = "sa11x0-uart", + .id = 2, + .num_resources = ARRAY_SIZE(cerfuart2_resources), + .resource = cerfuart2_resources, +}; + +static struct platform_device *cerf_devices[] __initdata = { + &cerfuart2_device, +}; static void __init cerf_init_irq(void) { sa1100_init_irq(); - - /* Need to register these as rising edge interrupts - * For standard 16550 serial driver support - * Basically - I copied it from pfs168.c :) - */ -#ifdef CONFIG_SA1100_CERF_CPLD - /* PDA Full serial port */ - set_irq_type(IRQ_GPIO3, IRQT_RISING); - /* PDA Bluetooth */ - set_irq_type(IRQ_GPIO2, IRQT_RISING); -#endif /* CONFIG_SA1100_CERF_CPLD */ - - set_irq_type(IRQ_GPIO_UCB1200_IRQ, IRQT_RISING); + set_irq_type(CERF_ETH_IRQ, IRQT_RISING); } static struct map_desc cerf_io_desc[] __initdata = { /* virtual physical length type */ + { 0xe8000000, 0x00000000, 0x02000000, MT_DEVICE }, /* Flash bank 0 */ { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */ -#ifdef CONFIG_SA1100_CERF_CPLD - ,{ 0xf1000000, 0x40000000, 0x00100000, MT_DEVICE }, /* CPLD Chip */ - { 0xf2000000, 0x10000000, 0x00100000, MT_DEVICE }, /* CerfPDA Bluetooth */ - { 0xf3000000, 0x18000000, 0x00100000, MT_DEVICE } /* CerfPDA Serial */ -#endif }; static void __init cerf_map_io(void) @@ -51,21 +56,30 @@ iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc)); sa1100_register_uart(0, 3); -#ifdef CONFIG_SA1100_CERF_IRDA_ENABLED - sa1100_register_uart(1, 1); -#else - sa1100_register_uart(1, 2); + sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */ sa1100_register_uart(2, 1); -#endif /* set some GPDR bits here while it's safe */ - GPDR |= GPIO_CF_RESET; -#ifdef CONFIG_SA1100_CERF_CPLD - GPDR |= GPIO_PWR_SHUTDOWN; -#endif + GPDR |= CERF_GPIO_CF_RESET; } -MACHINE_START(CERF, "Intrinsyc's Cerf Family of Products") +static int __init cerf_init(void) +{ + int ret; + + if (!machine_is_cerf()) + return -ENODEV; + + ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); + if (ret < 0) + return ret; + + return 0; +} + +arch_initcall(cerf_init); + +MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") MAINTAINER("support@intrinsyc.com") BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) MAPIO(cerf_map_io) diff -ruN linux-2.6.0-test7-rmk1/arch/arm/mach-sa1100/pm.c linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-sa1100/pm.c --- linux-2.6.0-test7-rmk1/arch/arm/mach-sa1100/pm.c 2003-10-18 15:34:44.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/arch/arm/mach-sa1100/pm.c 2003-10-18 16:04:09.000000000 -0700 @@ -150,7 +150,7 @@ */ static int sa11x0_pm_prepare(u32 state) { - nmi_watchdog_disable(); +// nmi_watchdog_disable(); return 0; } @@ -159,7 +159,7 @@ */ static int sa11x0_pm_finish(u32 state) { - nmi_watchdog_enable(); +// nmi_watchdog_enable(); return 0; } diff -ruN linux-2.6.0-test7-rmk1/drivers/l3/l3-bit-sa1100.c linux-2.6.0-test7-rmk1-cerf1/drivers/l3/l3-bit-sa1100.c --- linux-2.6.0-test7-rmk1/drivers/l3/l3-bit-sa1100.c 2003-10-18 15:34:44.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/l3/l3-bit-sa1100.c 2003-10-18 15:48:36.000000000 -0700 @@ -213,6 +213,12 @@ bit->l3_mode = GPIO_GPIO17; } + if (machine_is_cerf()) { + bit->sda = GPIO_GPIO6; + bit->scl = GPIO_GPIO4; + bit->l3_mode = GPIO_GPIO5; + } + if (machine_is_h3600() || machine_is_h3100()) { bit->sda = GPIO_GPIO14; bit->scl = GPIO_GPIO16; diff -ruN linux-2.6.0-test7-rmk1/drivers/mtd/maps/Kconfig linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/Kconfig --- linux-2.6.0-test7-rmk1/drivers/mtd/maps/Kconfig 2003-10-08 12:24:51.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/Kconfig 2003-10-18 15:48:36.000000000 -0700 @@ -396,6 +396,14 @@ 21285 bridge used with Intel's StrongARM processors. More info at . +config MTD_PXA_CERF + tristate "CFI Flash device mapped on XScale CerfBoard" + depends on ARM && MTD_CFI && ARCH_PXA_CERF + help + This enables access routines for the flash chips on Intrinsyc's XScale + CerfBoard. If you have one of these boards and would like to use the + flash chips on it, say 'Y'. + config MTD_IQ80310 tristate "CFI Flash device mapped on the XScale IQ80310 board" depends on ARM && MTD_CFI && ARCH_IQ80310 diff -ruN linux-2.6.0-test7-rmk1/drivers/mtd/maps/Makefile linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/Makefile --- linux-2.6.0-test7-rmk1/drivers/mtd/maps/Makefile 2003-10-18 15:34:44.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/Makefile 2003-10-18 15:48:36.000000000 -0700 @@ -18,6 +18,7 @@ obj-$(CONFIG_MTD_EPXA10DB) += epxa10db-flash.o obj-$(CONFIG_MTD_IQ80310) += iq80310.o obj-$(CONFIG_MTD_IQ80321) += iq80321.o +obj-$(CONFIG_MTD_PXA_CERF) += cerf_pxa.o obj-$(CONFIG_MTD_L440GX) += l440gx.o obj-$(CONFIG_MTD_AMD76XROM) += amd76xrom.o obj-$(CONFIG_MTD_ICH2ROM) += ich2rom.o diff -ruN linux-2.6.0-test7-rmk1/drivers/mtd/maps/cerf_pxa.c linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/cerf_pxa.c --- linux-2.6.0-test7-rmk1/drivers/mtd/maps/cerf_pxa.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/cerf_pxa.c 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,171 @@ +/* + * $Id: + * + * Map driver for the CerfBoard developer platform. + * + * Author: Nicolas Pitre + * Copyright: (C) 2001 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 + + +#define WINDOW_ADDR 0 +#define WINDOW_SIZE 32*1024*1024 +#define BUSWIDTH 4 + +static __u8 cerf_pxa_read8(struct map_info *map, unsigned long ofs) +{ + return *(__u8 *)(map->map_priv_1 + ofs); +} + +static __u16 cerf_pxa_read16(struct map_info *map, unsigned long ofs) +{ + return *(__u16 *)(map->map_priv_1 + ofs); +} + +static __u32 cerf_pxa_read32(struct map_info *map, unsigned long ofs) +{ + return *(__u32 *)(map->map_priv_1 + ofs); +} + +static void cerf_pxa_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 cerf_pxa_write8(struct map_info *map, __u8 d, unsigned long adr) +{ + *(__u8 *)(map->map_priv_1 + adr) = d; +} + +static void cerf_pxa_write16(struct map_info *map, __u16 d, unsigned long adr) +{ + *(__u16 *)(map->map_priv_1 + adr) = d; +} + +static void cerf_pxa_write32(struct map_info *map, __u32 d, unsigned long adr) +{ + *(__u32 *)(map->map_priv_1 + adr) = d; +} + +static void cerf_pxa_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 cerf_pxa_map = { + name: "PXA CerfBoard flash", + size: WINDOW_SIZE, + buswidth: BUSWIDTH, + read8: cerf_pxa_read8, + read16: cerf_pxa_read16, + read32: cerf_pxa_read32, + copy_from: cerf_pxa_copy_from, + write8: cerf_pxa_write8, + write16: cerf_pxa_write16, + write32: cerf_pxa_write32, + copy_to: cerf_pxa_copy_to +}; + +static struct mtd_partition cerf_pxa_partitions[] = { + { + name: "Bootloader", + size: 0x00040000, + offset: 0, + mask_flags: MTD_WRITEABLE /* force read-only */ + },{ + name: "Partition Tables", + size: 0x00080000, + offset: 0x00040000, + },{ + name: "Kernel", + size: 0x00100000, + offset: 0x000C0000, + },{ + name: "Filesystem", + size: WINDOW_SIZE-0x001C0000, + offset: 0x001C0000 + } +}; + +#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 int __init init_cerf_pxa(void) +{ + struct mtd_partition *parts; + int nb_parts = 0; + int parsed_nr_parts = 0; + char *part_type = "static"; + + printk("Probing CerfBoard flash at physical address 0x%08x\n", WINDOW_ADDR); + cerf_pxa_map.map_priv_1 = ioremap(WINDOW_ADDR, WINDOW_SIZE); + if (!cerf_pxa_map.map_priv_1) { + printk("Failed to ioremap\n"); + return -EIO; + } + mymtd = do_map_probe("cfi_probe", &cerf_pxa_map); + if (!mymtd) { + iounmap((void *)cerf_pxa_map.map_priv_1); + return -ENXIO; + } + mymtd->module = THIS_MODULE; + +#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 = cerf_pxa_partitions; + nb_parts = NB_OF(cerf_pxa_partitions); + } + if (nb_parts) { + printk(KERN_NOTICE "Using %s partition definition\n", part_type); + add_mtd_partitions(mymtd, parts, nb_parts); + } else { + add_mtd_device(mymtd); + } + return 0; +} + +static void __exit cleanup_cerf_pxa(void) +{ + if (mymtd) { + del_mtd_partitions(mymtd); + map_destroy(mymtd); + if (parsed_parts) + kfree(parsed_parts); + } + if (cerf_pxa_map.map_priv_1) + iounmap((void *)cerf_pxa_map.map_priv_1); + return 0; +} + +module_init(init_cerf_pxa); +module_exit(cleanup_cerf_pxa); + diff -ruN linux-2.6.0-test7-rmk1/drivers/mtd/maps/sa1100-flash.c linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/sa1100-flash.c --- linux-2.6.0-test7-rmk1/drivers/mtd/maps/sa1100-flash.c 2003-10-18 15:34:44.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/mtd/maps/sa1100-flash.c 2003-10-18 15:48:36.000000000 -0700 @@ -154,50 +154,34 @@ #ifdef CONFIG_SA1100_CERF #ifdef CONFIG_SA1100_CERF_FLASH_32MB -static struct mtd_partition cerf_partitions[] = { - { - .name = "firmware", - .size = 0x00040000, - .offset = 0, - }, { - .name = "params", - .size = 0x00040000, - .offset = 0x00040000, - }, { - .name = "kernel", - .size = 0x00100000, - .offset = 0x00080000, - }, { - .name = "rootdisk", - .size = 0x01E80000, - .offset = 0x00180000, - } -}; +# define CERF_FLASH_SIZE 0x02000000 #elif defined CONFIG_SA1100_CERF_FLASH_16MB +# define CERF_FLASH_SIZE 0x01000000 +#elif defined CONFIG_SA1100_CERF_FLASH_8MB +# define CERF_FLASH_SIZE 0x00800000 +#else +# error "Undefined flash size for CERF in sa1100-flash.c" +#endif + static struct mtd_partition cerf_partitions[] = { { - .name = "firmware", + .name = "Bootloader", .size = 0x00020000, - .offset = 0, + .offset = 0x00000000, }, { - .name = "params", - .size = 0x00020000, + .name = "Params", + .size = 0x00040000, .offset = 0x00020000, }, { - .name = "kernel", + .name = "Kernel", .size = 0x00100000, - .offset = 0x00040000, + .offset = 0x00060000, }, { - .name = "rootdisk", - .size = 0x00EC0000, - .offset = 0x00140000, + .name = "Filesystem", + .size = CERF_FLASH_SIZE-0x00160000, + .offset = 0x00160000, } }; -#elif defined CONFIG_SA1100_CERF_FLASH_8MB -# error "Unwritten type definition" -#else -# error "Undefined memory orientation for CERF in sa1100-flash.c" -#endif #endif #ifdef CONFIG_SA1100_CONSUS diff -ruN linux-2.6.0-test7-rmk1/drivers/net/Kconfig linux-2.6.0-test7-rmk1-cerf1/drivers/net/Kconfig --- linux-2.6.0-test7-rmk1/drivers/net/Kconfig 2003-10-08 12:24:42.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/net/Kconfig 2003-10-18 15:48:36.000000000 -0700 @@ -722,7 +722,7 @@ config NET_VENDOR_SMC bool "Western Digital/SMC cards" - depends on NET_ETHERNET && (ISA || MCA || EISA || MAC) + depends on NET_ETHERNET && (ISA || MCA || EISA || MAC || ARCH_PXA) help If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from @@ -808,6 +808,18 @@ . The module will be called smc9194. +config SMC91111 + tristate "SMC 91111 support" + depends on NET_VENDOR_SMC && (ISA || MAC || ARCH_PXA) + ---help--- + This is support for the SMC91111 based Ethernet cards. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called smc91111.o. If you want to compile it as a + module, say M here and read as well + as . + config NET_VENDOR_RACAL bool "Racal-Interlan (Micom) NI cards" depends on NET_ETHERNET && ISA @@ -1301,6 +1313,22 @@ tristate "TOSHIBA TC35815 Ethernet support" depends on NET_PCI && PCI && TOSHIBA_JMR3927 +config CS8900 + tristate "CS8900 support" + depends on NET_PCI && ISA + ---help--- + Support for CS8900 chipset based Ethernet cards. If you have a + network (Ethernet) card of this type, say Y and read the + Ethernet-HOWTO, available from + as well as + . + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read as well as + . The module will be + called cs8900.o. + config DGRS tristate "Digi Intl. RightSwitch SE-X support" depends on NET_PCI && (PCI || EISA) diff -ruN linux-2.6.0-test7-rmk1/drivers/net/Makefile linux-2.6.0-test7-rmk1-cerf1/drivers/net/Makefile --- linux-2.6.0-test7-rmk1/drivers/net/Makefile 2003-10-08 12:24:03.000000000 -0700 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/net/Makefile 2003-10-18 15:48:36.000000000 -0700 @@ -76,6 +76,7 @@ obj-$(CONFIG_SK_G16) += sk_g16.o obj-$(CONFIG_HP100) += hp100.o obj-$(CONFIG_SMC9194) += smc9194.o +obj-$(CONFIG_SMC91111) += smc91x.o obj-$(CONFIG_FEC) += fec.o obj-$(CONFIG_68360_ENET) += 68360enet.o obj-$(CONFIG_ARM_ETHERH) += 8390.o @@ -168,6 +169,7 @@ obj-$(CONFIG_HYDRA) += hydra.o 8390.o obj-$(CONFIG_ARIADNE) += ariadne.o obj-$(CONFIG_CS89x0) += cs89x0.o +obj-$(CONFIG_CS8900) += cs8900.o obj-$(CONFIG_MACSONIC) += macsonic.o obj-$(CONFIG_MACMACE) += macmace.o obj-$(CONFIG_MAC89x0) += mac89x0.o diff -ruN linux-2.6.0-test7-rmk1/drivers/net/cs8900.c linux-2.6.0-test7-rmk1-cerf1/drivers/net/cs8900.c --- linux-2.6.0-test7-rmk1/drivers/net/cs8900.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/net/cs8900.c 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,905 @@ + +/* + * linux/drivers/net/cs8900.c + * + * Author: Abraham van der Merwe + * + * A Cirrus Logic CS8900A driver for Linux + * based on the cs89x0 driver written by Russell Nelson, + * Donald Becker, and others. + * + * This source code 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: + * 22-May-2002 Initial version (Abraham vd Merwe) + * 30-May-2002 Added char device support for eeprom (Frank Becker) + * + */ + +/* + * At the moment the driver does not support memory mode operation. + * It is trivial to implement this, but not worth the effort. + */ + +/* + * TODO: + * + * 1. Sort out ethernet checksum + * 2. If !ready in send_start(), queue buffer and send it in interrupt handler + * when we receive a BufEvent with Rdy4Tx, send it again. dangerous! + * 3. how do we prevent interrupt handler destroying integrity of get_stats()? + * 4. Change reset code to check status. + * 5. Implement set_mac_address and remove fake mac address + * 7. Link status detection stuff + * 8. Write utility to write EEPROM, do self testing, etc. + * 9. Implement DMA routines (I need a board w/ DMA support for that) + * 10. Power management + * 11. Add support for multiple ethernet chips + */ + +// added BSt +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Added BSt +#include + + +#ifdef CONFIG_SA1100_CERF +#include "asm/arch/cerf.h" +#endif + + +#include "cs8900.h" + +//#define FULL_DUPLEX +//#define DEBUG + +typedef struct { + struct net_device_stats stats; + u16 txlen; + int char_devnum; + + spinlock_t lock; +} cs8900_t; + +int cs8900_probe (struct net_device *dev); +static struct net_device cs8900_dev = +{ + init: cs8900_probe +}; + +/* + * There seems to be no way to determine the exact size of the eeprom, + * so we use the largest size. + * FIXME: Verify it's safe to read/write past the end of a 64/128 + * byte eeprom. + * + * Possible eeprom sizes: + * Cx46 - 64 bytes + * Cx56 - 128 bytes + * Cx66 - 256 bytes + */ +#define MAX_EEPROM_SIZE 256 + +static int cs8900_eeprom_fopen(struct inode *inode, struct file *file); +static int cs8900_eeprom_frelease(struct inode *inode, struct file *file); +static loff_t cs8900_eeprom_fllseek(struct file * file,loff_t offset, int flags); +static ssize_t cs8900_eeprom_fread(struct file *file, char *buf, size_t count, loff_t *f_pos); +static ssize_t cs8900_eeprom_fwrite(struct file *file, const char *buf, size_t count, loff_t *f_pos); +static struct file_operations cs8900_eeprom_fops = { + owner: THIS_MODULE, + open: cs8900_eeprom_fopen, + release: cs8900_eeprom_frelease, + llseek: cs8900_eeprom_fllseek, + read: cs8900_eeprom_fread, + write: cs8900_eeprom_fwrite, +}; + +static u16 cs8900_eeprom_cache[MAX_EEPROM_SIZE/2]; + +/* + * I/O routines + */ + +static inline u16 cs8900_read (struct net_device *dev,u16 reg) +{ + outw (reg,dev->base_addr + PP_Address); + return (inw (dev->base_addr + PP_Data)); +} + +static inline void cs8900_write (struct net_device *dev,u16 reg,u16 value) +{ + outw (reg,dev->base_addr + PP_Address); + outw (value,dev->base_addr + PP_Data); +} + +static inline void cs8900_set (struct net_device *dev,u16 reg,u16 value) +{ + cs8900_write (dev,reg,cs8900_read (dev,reg) | value); +} + +static inline void cs8900_clear (struct net_device *dev,u16 reg,u16 value) +{ + cs8900_write (dev,reg,cs8900_read (dev,reg) & ~value); +} + +static inline void cs8900_frame_read (struct net_device *dev,struct sk_buff *skb,u16 length) +{ + insw (dev->base_addr,skb_put (skb,length),(length + 1) / 2); +} + +static inline void cs8900_frame_write (struct net_device *dev,struct sk_buff *skb) +{ + outsw (dev->base_addr,skb->data,(skb->len + 1) / 2); +} + +/* + * EEPROM I/O routines + */ + +static int cs8900_eeprom_wait (struct net_device *dev) +{ + int i; + + for (i = 0; i < 3000; i++) { + if (!(cs8900_read (dev,PP_SelfST) & SIBUSY)) + return (0); + udelay (1); + } + + return (-1); +} + +static int cs8900_eeprom_read (struct net_device *dev,u16 *value,u16 offset) +{ + if (cs8900_eeprom_wait (dev) < 0) + return (-1); + + cs8900_write (dev,PP_EEPROMCommand,offset | EEReadRegister); + + if (cs8900_eeprom_wait (dev) < 0) + return (-1); + + *value = cs8900_read (dev,PP_EEPROMData); + + return (0); +} + +static int cs8900_eeprom_write (struct net_device *dev,u16 *value,u16 offset) +{ + cs8900_eeprom_wait(dev); + cs8900_write(dev, PP_EEPROMCommand, (EEWriteEnable)); + cs8900_eeprom_wait(dev); + cs8900_write(dev, PP_EEPROMData, *value); + cs8900_eeprom_wait(dev); + cs8900_write(dev, PP_EEPROMCommand, (offset | EEWriteRegister)); + cs8900_eeprom_wait(dev); + cs8900_write(dev, PP_EEPROMCommand, (EEWriteDisable)); + cs8900_eeprom_wait(dev); + + return 0; +} + +/* + * Debugging functions + */ + +#ifdef DEBUG +static inline int printable (int c) +{ + return ((c >= 32 && c <= 126) || + (c >= 174 && c <= 223) || + (c >= 242 && c <= 243) || + (c >= 252 && c <= 253)); +} + +static void dump16 (struct net_device *dev,const u8 *s,size_t len) +{ + int i; + char str[128]; + + if (!len) return; + + *str = '\0'; + + for (i = 0; i < len; i++) { + if (i && !(i % 4)) strcat (str," "); + sprintf (str,"%s%.2x ",str,s[i]); + } + + for ( ; i < 16; i++) { + if (i && !(i % 4)) strcat (str," "); + strcat (str," "); + } + + strcat (str," "); + for (i = 0; i < len; i++) sprintf (str,"%s%c",str,printable (s[i]) ? s[i] : '.'); + + printk (KERN_DEBUG "%s: %s\n",dev->name,str); +} + +static void hexdump (struct net_device *dev,const void *ptr,size_t size) +{ + const u8 *s = (u8 *) ptr; + int i; + for (i = 0; i < size / 16; i++, s += 16) dump16 (dev,s,16); + dump16 (dev,s,size % 16); +} + +static void dump_packet (struct net_device *dev,struct sk_buff *skb,const char *type) +{ + printk (KERN_INFO "%s: %s %d byte frame %.2x:%.2x:%.2x:%.2x:%.2x:%.2x to %.2x:%.2x:%.2x:%.2x:%.2x:%.2x type %.4x\n", + dev->name, + type, + skb->len, + skb->data[0],skb->data[1],skb->data[2],skb->data[3],skb->data[4],skb->data[5], + skb->data[6],skb->data[7],skb->data[8],skb->data[9],skb->data[10],skb->data[11], + (skb->data[12] << 8) | skb->data[13]); + if (skb->len < 0x100) hexdump (dev,skb->data,skb->len); +} + +static void eepromdump( struct net_device *dev) +{ + u16 buf[0x80]; + u16 i; + int count; + int total; + + if( cs8900_read( dev, PP_SelfST) & EEPROMpresent) + { + printk (KERN_INFO "%s: EEPROM present\n",dev->name); + } + else + { + printk (KERN_INFO "%s: NO EEPROM present\n",dev->name); + return; + } + + if( cs8900_read( dev, PP_SelfST) & EEPROMOK) + { + printk (KERN_INFO "%s: EEPROM OK\n",dev->name); + } + else + { + printk (KERN_INFO "%s: EEPROM checksum mismatch - fixing...\n",dev->name); + } + + printk (KERN_INFO "%s: Hexdump\n",dev->name); + for( i=0; i<0x80; i++) + { + cs8900_eeprom_read( dev, &buf[i], i); + } + hexdump( dev, buf, 0x100); + + if( buf[0] & 0x0100) + { + printk (KERN_INFO "%s: non-sequential EEPROM\n",dev->name); + } + else + { + printk (KERN_INFO "%s: sequential EEPROM\n",dev->name); + } + + if( (buf[0] & 0xe000) == 0xa000) + { + printk (KERN_INFO "%s: Found reset configuration block\n",dev->name); + } + else + { + printk (KERN_INFO "%s: Reset configuration block not found\n",dev->name); + return; + } + + count = 2; + total = buf[0] & 0xff; + printk (KERN_INFO "%s: Reset configuration block size = %d bytes\n",dev->name, total); + + while( count < total) + { + int groupsize = (buf[count/2] >> 12) + 1; + int basereg = (buf[count/2] &0x1ff); + printk (KERN_INFO "%s: Group size = %d words\n",dev->name, groupsize); + printk (KERN_INFO "%s: Base register = %x\n",dev->name, basereg); + count += (groupsize + 1)*2; + } +} + +#endif /* #ifdef DEBUG */ + +/* + * Driver functions + */ + +static void cs8900_receive (struct net_device *dev) +{ + cs8900_t *priv = (cs8900_t *) dev->priv; + struct sk_buff *skb; + u16 status,length; + + status = cs8900_read (dev,PP_RxStatus); + length = cs8900_read (dev,PP_RxLength); + + if (!(status & RxOK)) { + priv->stats.rx_errors++; + if ((status & (Runt | Extradata))) priv->stats.rx_length_errors++; + if ((status & CRCerror)) priv->stats.rx_crc_errors++; + return; + } + + if ((skb = dev_alloc_skb (length + 4)) == NULL) { + priv->stats.rx_dropped++; + return; + } + + skb->dev = dev; + skb_reserve (skb,2); + + cs8900_frame_read (dev,skb,length); + +#ifdef FULL_DUPLEX + dump_packet (dev,skb,"recv"); +#endif /* #ifdef FULL_DUPLEX */ + + skb->protocol = eth_type_trans (skb,dev); + + netif_rx (skb); + dev->last_rx = jiffies; + + priv->stats.rx_packets++; + priv->stats.rx_bytes += length; +} + +static int cs8900_send_start (struct sk_buff *skb,struct net_device *dev) +{ + cs8900_t *priv = (cs8900_t *) dev->priv; + u16 status; + + spin_lock_irq(&priv->lock); + netif_stop_queue (dev); + + cs8900_write (dev,PP_TxCMD,TxStart (After5)); + cs8900_write (dev,PP_TxLength,skb->len); + + status = cs8900_read (dev,PP_BusST); + + if ((status & TxBidErr)) { + spin_unlock_irq(&priv->lock); + printk (KERN_WARNING "%s: Invalid frame size %d!\n",dev->name,skb->len); + priv->stats.tx_errors++; + priv->stats.tx_aborted_errors++; + priv->txlen = 0; + return (1); + } + + if (!(status & Rdy4TxNOW)) { + spin_unlock_irq(&priv->lock); + printk (KERN_WARNING "%s: Transmit buffer not free!\n",dev->name); + priv->stats.tx_errors++; + priv->txlen = 0; + /* FIXME: store skb and send it in interrupt handler */ + return (1); + } + + cs8900_frame_write (dev,skb); + spin_unlock_irq(&priv->lock); + +#ifdef DEBUG + dump_packet (dev,skb,"send"); +#endif /* #ifdef DEBUG */ + + dev->trans_start = jiffies; + + dev_kfree_skb (skb); + + priv->txlen = skb->len; + + return (0); +} + +static irqreturn_t cs8900_interrupt (int irq,void *id,struct pt_regs *regs) +{ + struct net_device *dev = (struct net_device *) id; + cs8900_t *priv; + u16 status; + + if (dev->priv == NULL) { + printk (KERN_WARNING "%s: irq %d for unknown device.\n",dev->name,irq); + return 0; + } + + priv = (cs8900_t *) dev->priv; + + while ((status = cs8900_read (dev,PP_ISQ))) { + switch (RegNum (status)) { + case RxEvent: + cs8900_receive (dev); + break; + + case TxEvent: + priv->stats.collisions += ColCount (cs8900_read (dev,PP_TxCOL)); + if (!(RegContent (status) & TxOK)) { + priv->stats.tx_errors++; + if ((RegContent (status) & Out_of_window)) priv->stats.tx_window_errors++; + if ((RegContent (status) & Jabber)) priv->stats.tx_aborted_errors++; + break; + } else if (priv->txlen) { + priv->stats.tx_packets++; + priv->stats.tx_bytes += priv->txlen; + } + priv->txlen = 0; + netif_wake_queue (dev); + break; + + case BufEvent: + if ((RegContent (status) & RxMiss)) { + u16 missed = MissCount (cs8900_read (dev,PP_RxMISS)); + priv->stats.rx_errors += missed; + priv->stats.rx_missed_errors += missed; + } + if ((RegContent (status) & TxUnderrun)) { + priv->stats.tx_errors++; + priv->stats.tx_fifo_errors++; + + priv->txlen = 0; + netif_wake_queue (dev); + } + /* FIXME: if Rdy4Tx, transmit last sent packet (if any) */ + break; + + case TxCOL: + priv->stats.collisions += ColCount (cs8900_read (dev,PP_TxCOL)); + break; + + case RxMISS: + status = MissCount (cs8900_read (dev,PP_RxMISS)); + priv->stats.rx_errors += status; + priv->stats.rx_missed_errors += status; + break; + } + } + return IRQ_RETVAL(1); +} + +static void cs8900_transmit_timeout (struct net_device *dev) +{ + cs8900_t *priv = (cs8900_t *) dev->priv; + priv->stats.tx_errors++; + priv->stats.tx_heartbeat_errors++; + priv->txlen = 0; + netif_wake_queue (dev); +} + +static int cs8900_start (struct net_device *dev) +{ + int result; + + /* install interrupt handler */ + if ((result = request_irq (dev->irq,&cs8900_interrupt,0,dev->name,dev)) < 0) { + printk (KERN_ERR "%s: could not register interrupt %d\n",dev->name,dev->irq); + return (result); + } + + set_irq_type(dev->irq, IRQT_RISING); + + /* enable the ethernet controller */ + cs8900_set (dev,PP_RxCFG,RxOKiE | BufferCRC | CRCerroriE | RuntiE | ExtradataiE); + cs8900_set (dev,PP_RxCTL,RxOKA | IndividualA | BroadcastA); + cs8900_set (dev,PP_TxCFG,TxOKiE | Out_of_windowiE | JabberiE); + cs8900_set (dev,PP_BufCFG,Rdy4TxiE | RxMissiE | TxUnderruniE | TxColOvfiE | MissOvfloiE); + cs8900_set (dev,PP_LineCTL,SerRxON | SerTxON); + cs8900_set (dev,PP_BusCTL,EnableRQ); + +#ifdef FULL_DUPLEX + cs8900_set (dev,PP_TestCTL,FDX); +#endif /* #ifdef FULL_DUPLEX */ + + /* start the queue */ + netif_start_queue (dev); + + MOD_INC_USE_COUNT; + + return (0); +} + +static int cs8900_stop (struct net_device *dev) +{ + /* disable ethernet controller */ + cs8900_write (dev,PP_BusCTL,0); + cs8900_write (dev,PP_TestCTL,0); + cs8900_write (dev,PP_SelfCTL,0); + cs8900_write (dev,PP_LineCTL,0); + cs8900_write (dev,PP_BufCFG,0); + cs8900_write (dev,PP_TxCFG,0); + cs8900_write (dev,PP_RxCTL,0); + cs8900_write (dev,PP_RxCFG,0); + + /* uninstall interrupt handler */ + free_irq (dev->irq,dev); + + /* stop the queue */ + netif_stop_queue (dev); + + MOD_DEC_USE_COUNT; + + return (0); +} + +static struct net_device_stats *cs8900_get_stats (struct net_device *dev) +{ + cs8900_t *priv = (cs8900_t *) dev->priv; + return (&priv->stats); +} + +static void cs8900_set_receive_mode (struct net_device *dev) +{ + if ((dev->flags & IFF_PROMISC)) + cs8900_set (dev,PP_RxCTL,PromiscuousA); + else + cs8900_clear (dev,PP_RxCTL,PromiscuousA); + + if ((dev->flags & IFF_ALLMULTI) && dev->mc_list) + cs8900_set (dev,PP_RxCTL,MulticastA); + else + cs8900_clear (dev,PP_RxCTL,MulticastA); +} + +static int cs8900_eeprom (struct net_device *dev) +{ + cs8900_t *priv = (cs8900_t *) dev->priv; + int i; + +#ifdef DEBUG + eepromdump (dev); +#endif + + if( (cs8900_read( dev, PP_SelfST) & EEPROMpresent) == 0) + { + /* no eeprom */ + return (-ENODEV); + } + + /* add character device for easy eeprom programming */ + if( (priv->char_devnum=register_chrdev(0,"cs8900_eeprom",&cs8900_eeprom_fops)) != 0) + printk (KERN_INFO "%s: Registered cs8900_eeprom char device (major #%d)\n", + dev->name, priv->char_devnum); + else + printk (KERN_WARNING "%s: Failed to register char device cs8900_eeprom\n",dev->name); + + if( (cs8900_read( dev, PP_SelfST) & EEPROMOK) == 0) + { + /* bad checksum, invalid config block */ + return (-EFAULT); + } + + /* If we get here, the chip will have initialized the registers + * that were specified in the eeprom configuration block + * We assume this is at least the mac address. + */ + for (i = 0; i < ETH_ALEN; i += 2) + { + u16 mac = cs8900_read (dev,PP_IA + i); + dev->dev_addr[i] = mac & 0xff; + dev->dev_addr[i+1] = (mac>>8) & 0xff; + } + + return (0); +} + +/* + * EEPROM Charater device + */ + +static int cs8900_eeprom_fopen(struct inode *inode, struct file *file) +{ + u16 i; + for( i=0; if_pos + offset; + break; + case 2: /* SEEK_END */ + newpos = (MAX_EEPROM_SIZE-1) - offset; + break; + default: /* can't happen */ + return -EINVAL; + + } + + if( (newpos<0) || (newpos>=MAX_EEPROM_SIZE)) return -EINVAL; + + file->f_pos = newpos; + return newpos; +} + +static ssize_t cs8900_eeprom_fread(struct file *file, char *buf, size_t count, loff_t *f_pos) +{ + unsigned char *temp = (unsigned char *)cs8900_eeprom_cache; + + if (*f_pos >= MAX_EEPROM_SIZE) + return 0; + + if (*f_pos + count > MAX_EEPROM_SIZE) + count = MAX_EEPROM_SIZE - *f_pos; + + if (count<1) + return 0; + + if (copy_to_user(buf, &temp[*f_pos], count)){ + return -EFAULT; + } + *f_pos += count; + return count; +} + +static ssize_t cs8900_eeprom_fwrite(struct file *file, const char *buf, size_t count, loff_t *f_pos) +{ + u16 i; + unsigned char *temp = (unsigned char *)cs8900_eeprom_cache; + + if (*f_pos >= MAX_EEPROM_SIZE) + return 0; + + if (*f_pos + count > MAX_EEPROM_SIZE) + count = MAX_EEPROM_SIZE - *f_pos; + + if (count<1) + return 0; + + /* FIXME: lock critical section */ + + /* update the cache */ + if (copy_from_user(&temp[*f_pos], buf, count)){ + return -EFAULT; + } + + /* not concerned about performance, so write the entire thing */ + for( i=0; i= 40) + return -1; + return 0; +} + +static int __init cs8900_read_eeprom (struct net_device *dev, u16 off, u16 *value) +{ + if (cs8900_wait_eeprom_ready(dev) < 0) + return 0; + /* Send EEPROM read command and location to read */ + cs8900_write (dev, PP_EEPROMCommand, off | EEReadRegister); + + if (cs8900_wait_eeprom_ready(dev) < 0) + return 0; + + /* Get EEPROM data from EEPROM data register */ + *value = cs8900_read (dev, PP_EEPROMData); + return 1; +} +#endif /* #ifdef CONFIG_SA1100_CERF */ + +/* + * Driver initialization routines + */ + +int __init cs8900_probe (struct net_device *dev) +{ + static cs8900_t priv; + int i,result; + u16 value; +#if defined(CONFIG_SA1100_CERF) + u16 MAC_addr[3] = {0, 0, 0}; +#endif /* #if defined(CONFIG_SA1100_CERF */ + + printk ("Cirrus Logic CS8900A driver for Linux (V0.01)\n"); + + memset (&priv,0,sizeof (cs8900_t)); + + ether_setup (dev); + + dev->open = cs8900_start; + dev->stop = cs8900_stop; + dev->hard_start_xmit = cs8900_send_start; + dev->get_stats = cs8900_get_stats; + dev->set_multicast_list = cs8900_set_receive_mode; + dev->tx_timeout = cs8900_transmit_timeout; + dev->watchdog_timeo = HZ; + + dev->dev_addr[0] = 0x00; + dev->dev_addr[1] = 0x12; + dev->dev_addr[2] = 0x34; + dev->dev_addr[3] = 0x56; + dev->dev_addr[4] = 0x78; + dev->dev_addr[5] = 0x9a; + + dev->if_port = IF_PORT_10BASET; + dev->priv = (void *) &priv; + + spin_lock_init(&priv.lock); + + SET_MODULE_OWNER (dev); + + if ((result = check_region (dev->base_addr,16))) { + printk (KERN_ERR "%s: can't get I/O port address 0x%lx\n",dev->name,dev->base_addr); + return (result); + } + request_region (dev->base_addr,16,dev->name); + +#ifdef CONFIG_SA1100_FRODO + dev->base_addr = FRODO_ETH_IO + 0x300; + dev->irq = FRODO_ETH_IRQ; + frodo_reset (dev); +#endif /* #ifdef CONFIG_SA1100_FRODO */ + +#if defined(CONFIG_SA1100_CERF) + dev->base_addr = CERF_ETH_IO + 0x300; + dev->irq = CERF_ETH_IRQ; +#endif /* #if defined(CONFIG_SA1100_CERF) */ + +#if defined(CONFIG_SA1100_CERF) + if (!cs8900_read_eeprom(dev, 0x1c, &MAC_addr[0])) + printk("\ncs8900: [CERF] EEPROM[0] read failed\n"); + if (!cs8900_read_eeprom(dev, 0x1d, &MAC_addr[1])) + printk("\ncs8900: [CERF] EEPROM[1] read failed\n"); + if (!cs8900_read_eeprom(dev, 0x1e, &MAC_addr[2])) + printk("\ncs8900: [CERF] EEPROM[2] read failed\n"); + for (i = 0; i < ETH_ALEN / 2; i++) + { + dev->dev_addr[i*2] = MAC_addr[i] & 0xff; + dev->dev_addr[i*2+1] = (MAC_addr[i] >> 8) & 0xff; + } +#endif /* #if defined(CONFIG_SA1100_CERF) */ + + /* verify EISA registration number for Cirrus Logic */ + if ((value = cs8900_read (dev,PP_ProductID)) != EISA_REG_CODE) { + printk (KERN_ERR "%s: incorrect signature 0x%.4x\n",dev->name,value); + return (-ENXIO); + } + + /* verify chip version */ + value = cs8900_read (dev,PP_ProductID + 2); + if (VERSION (value) != CS8900A) { + printk (KERN_ERR "%s: unknown chip version 0x%.8x\n",dev->name,VERSION (value)); + return (-ENXIO); + } + /* setup interrupt number */ + cs8900_write (dev,PP_IntNum,0); + + + /* If an EEPROM is present, use it's MAC address. A valid EEPROM will + * initialize the registers automatically. + */ + result = cs8900_eeprom (dev); +#if defined(CONFIG_SA1100_CERF) + result = -ENODEV; +#endif /* defined(CONFIG_SA1100_CERF) */ + + printk (KERN_INFO "%s: CS8900A rev %c at %#lx irq=%d", + dev->name,'B' + REVISION (value) - REV_B, dev->base_addr, dev->irq); + if (result == -ENODEV) { + /* no eeprom or invalid config block, configure MAC address by hand */ + for (i = 0; i < ETH_ALEN; i += 2) + cs8900_write (dev,PP_IA + i,dev->dev_addr[i] | (dev->dev_addr[i + 1] << 8)); + printk (", no eeprom "); + } + else if( result == -EFAULT) + { + printk (", eeprom (invalid config block)"); + } + else + { + printk (", eeprom ok"); + } + + printk (", addr:"); + for (i = 0; i < ETH_ALEN; i += 2) + { + u16 mac = cs8900_read (dev,PP_IA + i); + printk ("%c%02X:%2X", (i==0)?' ':':', mac & 0xff, (mac >> 8)); + } + printk ("\n"); + + return (0); +} + +static int __init cs8900_init (void) +{ + strcpy(cs8900_dev.name, "eth%d"); + + return (register_netdev (&cs8900_dev)); +} + +static void __exit cs8900_cleanup (void) +{ + cs8900_t *priv = (cs8900_t *) cs8900_dev.priv; + if( priv->char_devnum) + { + unregister_chrdev(priv->char_devnum,"cs8900_eeprom"); + } + release_region (cs8900_dev.base_addr,16); + unregister_netdev (&cs8900_dev); +} + +MODULE_AUTHOR ("Abraham van der Merwe "); +MODULE_DESCRIPTION ("Cirrus Logic CS8900A driver for Linux (V0.01)"); +MODULE_LICENSE ("GPL"); + +module_init (cs8900_init); +module_exit (cs8900_cleanup); diff -ruN linux-2.6.0-test7-rmk1/drivers/net/cs8900.h linux-2.6.0-test7-rmk1-cerf1/drivers/net/cs8900.h --- linux-2.6.0-test7-rmk1/drivers/net/cs8900.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/net/cs8900.h 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,237 @@ +#ifndef CS8900_H +#define CS8900_H + +/* + * linux/drivers/net/cs8900.h + * + * Author: Abraham van der Merwe + * + * A Cirrus Logic CS8900A driver for Linux + * based on the cs89x0 driver written by Russell Nelson, + * Donald Becker, and others. + * + * This source code 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. + */ + +/* + * Ports + */ + +#define PP_Address 0x0a /* PacketPage Pointer Port (Section 4.10.10) */ +#define PP_Data 0x0c /* PacketPage Data Port (Section 4.10.10) */ + +/* + * Registers + */ + +#define PP_ProductID 0x0000 /* Section 4.3.1 Product Identification Code */ +#define PP_MemBase 0x002c /* Section 4.9.2 Memory Base Address Register */ +#define PP_IntNum 0x0022 /* Section 3.2.3 Interrupt Number */ +#define PP_EEPROMCommand 0x0040 /* Section 4.3.11 EEPROM Command */ +#define PP_EEPROMData 0x0042 /* Section 4.3.12 EEPROM Data */ +#define PP_RxCFG 0x0102 /* Section 4.4.6 Receiver Configuration */ +#define PP_RxCTL 0x0104 /* Section 4.4.8 Receiver Control */ +#define PP_TxCFG 0x0106 /* Section 4.4.9 Transmit Configuration */ +#define PP_BufCFG 0x010a /* Section 4.4.12 Buffer Configuration */ +#define PP_LineCTL 0x0112 /* Section 4.4.16 Line Control */ +#define PP_SelfCTL 0x0114 /* Section 4.4.18 Self Control */ +#define PP_BusCTL 0x0116 /* Section 4.4.20 Bus Control */ +#define PP_TestCTL 0x0118 /* Section 4.4.22 Test Control */ +#define PP_ISQ 0x0120 /* Section 4.4.5 Interrupt Status Queue */ +#define PP_TxEvent 0x0128 /* Section 4.4.10 Transmitter Event */ +#define PP_BufEvent 0x012c /* Section 4.4.13 Buffer Event */ +#define PP_RxMISS 0x0130 /* Section 4.4.14 Receiver Miss Counter */ +#define PP_TxCOL 0x0132 /* Section 4.4.15 Transmit Collision Counter */ +#define PP_SelfST 0x0136 /* Section 4.4.19 Self Status */ +#define PP_BusST 0x0138 /* Section 4.4.21 Bus Status */ +#define PP_TxCMD 0x0144 /* Section 4.4.11 Transmit Command */ +#define PP_TxLength 0x0146 /* Section 4.5.2 Transmit Length */ +#define PP_IA 0x0158 /* Section 4.6.2 Individual Address (IEEE Address) */ +#define PP_RxStatus 0x0400 /* Section 4.7.1 Receive Status */ +#define PP_RxLength 0x0402 /* Section 4.7.1 Receive Length (in bytes) */ +#define PP_RxFrame 0x0404 /* Section 4.7.2 Receive Frame Location */ +#define PP_TxFrame 0x0a00 /* Section 4.7.2 Transmit Frame Location */ + +/* + * Values + */ + +/* PP_IntNum */ +#define INTRQ0 0x0000 +#define INTRQ1 0x0001 +#define INTRQ2 0x0002 +#define INTRQ3 0x0003 + +/* PP_ProductID */ +#define EISA_REG_CODE 0x630e +#define REVISION(x) (((x) & 0x1f00) >> 8) +#define VERSION(x) ((x) & ~0x1f00) + +#define CS8900A 0x0000 +#define REV_B 7 +#define REV_C 8 +#define REV_D 9 + +/* PP_RxCFG */ +#define Skip_1 0x0040 +#define StreamE 0x0080 +#define RxOKiE 0x0100 +#define RxDMAonly 0x0200 +#define AutoRxDMAE 0x0400 +#define BufferCRC 0x0800 +#define CRCerroriE 0x1000 +#define RuntiE 0x2000 +#define ExtradataiE 0x4000 + +/* PP_RxCTL */ +#define IAHashA 0x0040 +#define PromiscuousA 0x0080 +#define RxOKA 0x0100 +#define MulticastA 0x0200 +#define IndividualA 0x0400 +#define BroadcastA 0x0800 +#define CRCerrorA 0x1000 +#define RuntA 0x2000 +#define ExtradataA 0x4000 + +/* PP_TxCFG */ +#define Loss_of_CRSiE 0x0040 +#define SQErroriE 0x0080 +#define TxOKiE 0x0100 +#define Out_of_windowiE 0x0200 +#define JabberiE 0x0400 +#define AnycolliE 0x0800 +#define T16colliE 0x8000 + +/* PP_BufCFG */ +#define SWint_X 0x0040 +#define RxDMAiE 0x0080 +#define Rdy4TxiE 0x0100 +#define TxUnderruniE 0x0200 +#define RxMissiE 0x0400 +#define Rx128iE 0x0800 +#define TxColOvfiE 0x1000 +#define MissOvfloiE 0x2000 +#define RxDestiE 0x8000 + +/* PP_LineCTL */ +#define SerRxON 0x0040 +#define SerTxON 0x0080 +#define AUIonly 0x0100 +#define AutoAUI_10BT 0x0200 +#define ModBackoffE 0x0800 +#define PolarityDis 0x1000 +#define L2_partDefDis 0x2000 +#define LoRxSquelch 0x4000 + +/* PP_SelfCTL */ +#define RESET 0x0040 +#define SWSuspend 0x0100 +#define HWSleepE 0x0200 +#define HWStandbyE 0x0400 +#define HC0E 0x1000 +#define HC1E 0x2000 +#define HCB0 0x4000 +#define HCB1 0x8000 + +/* PP_BusCTL */ +#define ResetRxDMA 0x0040 +#define DMAextend 0x0100 +#define UseSA 0x0200 +#define MemoryE 0x0400 +#define DMABurst 0x0800 +#define IOCHRDYE 0x1000 +#define RxDMAsize 0x2000 +#define EnableRQ 0x8000 + +/* PP_TestCTL */ +#define DisableLT 0x0080 +#define ENDECloop 0x0200 +#define AUIloop 0x0400 +#define DisableBackoff 0x0800 +#define FDX 0x4000 + +/* PP_ISQ */ +#define RegNum(x) ((x) & 0x3f) +#define RegContent(x) ((x) & ~0x3d) + +#define RxEvent 0x0004 +#define TxEvent 0x0008 +#define BufEvent 0x000c +#define RxMISS 0x0010 +#define TxCOL 0x0012 + +/* PP_RxStatus */ +#define IAHash 0x0040 +#define Dribblebits 0x0080 +#define RxOK 0x0100 +#define Hashed 0x0200 +#define IndividualAdr 0x0400 +#define Broadcast 0x0800 +#define CRCerror 0x1000 +#define Runt 0x2000 +#define Extradata 0x4000 + +#define HashTableIndex(x) ((x) >> 0xa) + +/* PP_TxCMD */ +#define After5 0 +#define After381 1 +#define After1021 2 +#define AfterAll 3 +#define TxStart(x) ((x) << 6) + +#define Force 0x0100 +#define Onecoll 0x0200 +#define InhibitCRC 0x1000 +#define TxPadDis 0x2000 + +/* PP_BusST */ +#define TxBidErr 0x0080 +#define Rdy4TxNOW 0x0100 + +/* PP_TxEvent */ +#define Loss_of_CRS 0x0040 +#define SQEerror 0x0080 +#define TxOK 0x0100 +#define Out_of_window 0x0200 +#define Jabber 0x0400 +#define T16coll 0x8000 + +#define TX_collisions(x) (((x) >> 0xb) & ~0x8000) + +/* PP_BufEvent */ +#define SWint 0x0040 +#define RxDMAFrame 0x0080 +#define Rdy4Tx 0x0100 +#define TxUnderrun 0x0200 +#define RxMiss 0x0400 +#define Rx128 0x0800 +#define RxDest 0x8000 + +/* PP_RxMISS */ +#define MissCount(x) ((x) >> 6) + +/* PP_TxCOL */ +#define ColCount(x) ((x) >> 6) + +/* PP_SelfST */ +#define T3VActive 0x0040 +#define INITD 0x0080 +#define SIBUSY 0x0100 +#define EEPROMpresent 0x0200 +#define EEPROMOK 0x0400 +#define ELpresent 0x0800 +#define EEsize 0x1000 + +/* PP_EEPROMCommand */ +#define EEWriteEnable 0x00F0 +#define EEWriteDisable 0x0000 +#define EEWriteRegister 0x0100 +#define EEReadRegister 0x0200 +#define EEEraseRegister 0x0300 +#define ELSEL 0x0400 + +#endif /* #ifndef CS8900_H */ diff -ruN linux-2.6.0-test7-rmk1/drivers/net/smc91x.c linux-2.6.0-test7-rmk1-cerf1/drivers/net/smc91x.c --- linux-2.6.0-test7-rmk1/drivers/net/smc91x.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.0-test7-rmk1-cerf1/drivers/net/smc91x.c 2003-10-18 15:48:36.000000000 -0700 @@ -0,0 +1,1467 @@ +/* ---------------------------------------------------------------------- + * smc91x.c + * + * Copyright (C) 2003 Intrinsyc 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. + * + * Derived from smc91111.c. Too many cooks to list... + * + * 18-Feb-2003 : Initial version [FB] + * 10-Mar-2003 : Basic functionality [FB] + * 15-Apr-2003 : Autoneg, carrier detect [FB] + * 21-Apr-2003 : Some cleanup [FB] + * 23-Apr-2003 : RCS version tag, timeout code, misc fixes, + * simple ethtool support [FB] + * 25-Apr-2003 : Added multicast hardware assisted filtering, + * moved remaining ins/outs to _io.h [FB] + * + * TODO: + * - graceful stop: see smc91x_stop + * - topology hotswapping (10mbps/hd -> 100mbps/fd etc.) + * see smc91x_phy_interrupt + * - ethtool needs locking for some operations. + * use only when interface is down for now + * - make use of drivers/net/mii.c for ethtool? + ------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "smc91x.h" +#include "smc91x_io.h" +#include "smc91x_cfg.h" + +#define SMC_DEBUG 0 + +#ifdef SMC_DEBUG +static unsigned int smc_debug = SMC_DEBUG; +#else +#define smc_debug 0 +#endif + +#define DRIVER_NAME "SMC91x" +#define DRIVER_VERSION "$Revision: 1.6 $" + +static int smc91x_probe (struct net_device *dev); +static int smc91x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev); + +static smc91x_config_t smc91x_config[] = SMC91X_INTERFACES; +static struct net_device smc91x_dev[ ARRAY_SIZE(smc91x_config)]; + +static const char * smc91x_chip_id[] = { + "?", "?", "?", + /* 3 */ "SMC91C90/91C92", + /* 4 */ "SMC91C94", + /* 5 */ "SMC91C95", + /* 6 */ "SMC91C96", + /* 7 */ "SMC91C100", + /* 8 */ "SMC91C100FD", + /* 9 */ "SMC91C11xFD", + "?", "?", "?", + "?", "?", "?" +}; + +/* --- PHY MII --- */ + +static inline void smc91x_phy_sync_bits( u8 *bits, int *idx) +{ + int i; + /* 32 consecutive ones on MDO to establish sync */ + for (i = 0; i < 32; ++i) + bits[(*idx)++] = MII_MDOE | MII_MDO; + + /* Start code <01> */ + bits[(*idx)++] = MII_MDOE; + bits[(*idx)++] = MII_MDOE | MII_MDO; +} + +static inline void smc91x_phy_set_bits( u32 val, int numbits, u8 *bits, int *idx) +{ + int i; + u32 mask = 1<<(numbits-1); + + /* Output the PHY address, msb first */ + for (i = 0; i < numbits; ++i) { + if (val & mask) + bits[(*idx)++] = MII_MDOE | MII_MDO; + else + bits[(*idx)++] = MII_MDOE; + + /* Shift to next lowest bit */ + mask >>= 1; + } +} + +static inline void smc91x_phy_set_address( u8 phyaddr, u8 *bits, int *idx) +{ + smc91x_phy_set_bits( phyaddr, 5, bits, idx); +} + +static inline void smc91x_phy_set_register( u8 phyreg, u8 *bits, int *idx) +{ + smc91x_phy_set_bits( phyreg, 5, bits, idx); +} + +static inline void smc91x_phy_write_bits( unsigned long base, u8 *bits, int numbits) +{ + int i; + int oldBank; + u16 mii_reg; + + /* Save the current bank */ + oldBank = smc91x_get_bank(base); + + /* Select bank 3 */ + smc91x_set_bank(base, 3); + + /* Get the current MII register value */ + mii_reg = smc91x_get_mii(base); + + /* Turn off all MII Interface bits */ + mii_reg &= ~(MII_MDOE | MII_MCLK | MII_MDI | MII_MDO); + + /* Clock all 64 cycles */ + for (i = 0; i < numbits; ++i) { + /* Clock Low - output data */ + smc91x_set_mii( mii_reg | bits[i], base); + + /* Clock Hi - input data */ + smc91x_set_mii( mii_reg | bits[i] | MII_MCLK, base); + bits[i] |= (smc91x_get_mii(base) & MII_MDI); + } + + /* Return to idle state */ + /* Set clock to low, data to low, and output tristated */ + smc91x_set_mii( mii_reg, base); + + /* Restore original bank select */ + smc91x_set_bank(base, oldBank); +} + +static u16 smc91x_phy_reg_read(unsigned long base, u8 phyaddr, u8 phyreg) +{ + int i; + u8 bits[64]; + int clk_idx = 0; + int input_idx; + u16 phydata; + + smc91x_phy_sync_bits( bits, &clk_idx); + + /* Read command <10> */ + bits[clk_idx++] = MII_MDOE | MII_MDO; + bits[clk_idx++] = MII_MDOE; + + smc91x_phy_set_address( phyaddr, bits, &clk_idx); + smc91x_phy_set_register( phyreg, bits, &clk_idx); + + /* Tristate and turnaround (2 bit times) */ + bits[clk_idx++] = 0; + /*bits[clk_idx++] = 0; */ + + /* Input starts at this bit time */ + input_idx = clk_idx; + + /* Will input 16 bits */ + for (i = 0; i < 16; ++i) + bits[clk_idx++] = 0; + + /* Final clock bit */ + bits[clk_idx++] = 0; + + smc91x_phy_write_bits( base, bits, sizeof bits); + + /* Recover input data */ + phydata = 0; + for (i = 0; i < 16; ++i) { + phydata <<= 1; + + if (bits[input_idx++] & MII_MDI) + phydata |= 0x0001; + } + + return phydata; +} + +static void smc91x_phy_reg_write( u16 phydata, unsigned long base, u8 phyaddr, u8 phyreg) +{ + u8 bits[65]; + int clk_idx = 0; + + smc91x_phy_sync_bits( bits, &clk_idx); + + /* Write command <01> */ + bits[clk_idx++] = MII_MDOE; + bits[clk_idx++] = MII_MDOE | MII_MDO; + + smc91x_phy_set_address( phyaddr, bits, &clk_idx); + smc91x_phy_set_register( phyreg, bits, &clk_idx); + + /* Tristate and turnaround (2 bit times) */ + bits[clk_idx++] = 0; + bits[clk_idx++] = 0; + + smc91x_phy_set_bits( phydata, 16, bits, &clk_idx); + + /* Final clock bit (tristate) */ + bits[clk_idx++] = 0; + + smc91x_phy_write_bits( base, bits, sizeof bits); +} + +static int smc91x_detect_phy( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + unsigned int base = dev->base_addr; + u16 phy_id1; + u16 phy_id2; + int phyaddr; + int found = 0; + + /* Scan all 32 PHY addresses if necessary */ + for (phyaddr = 0; phyaddr < 32; ++phyaddr) { + /* Read the PHY identifiers */ + phy_id1 = smc91x_phy_reg_read(base, phyaddr, PHY_ID1_REG); + phy_id2 = smc91x_phy_reg_read(base, phyaddr, PHY_ID2_REG); + + if( smc_debug > 1) printk( KERN_INFO "%s: phy_id1=%x, phy_id2=%x\n", + dev->name, phy_id1, phy_id2); + + /* Make sure it is a valid identifier */ + if ((phy_id2 > 0x0000) && (phy_id2 < 0xffff) && + (phy_id1 > 0x0000) && (phy_id1 < 0xffff)) { + if ((phy_id1 != 0x8000) && (phy_id2 != 0x8000)) { + /* Save the PHY's address */ + priv->phyaddr = phyaddr; + found = 1; + break; + } + } + } + + if (!found) { + printk( KERN_INFO "%s: No PHY found\n", dev->name); + return -ENODEV; + } + + /* show PHY type */ + if (smc_debug && (phy_id1 == 0x0016) && ((phy_id2 & 0xFFF0) == 0xF840)) { + printk( KERN_INFO "%s: Detected PHY LAN83C183 (LAN91C111 Internal)\n", + dev->name); + } + + if (smc_debug && (phy_id1 == 0x0282) && ((phy_id2 & 0xFFF0) == 0x1C50)) { + printk( KERN_INFO "%s: Detected PHY LAN83C180\n", dev->name); + } + + return 0; +} + +static void smc91x_phy_reset( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t *) dev->priv; + int timeout = 300; /* Wait up to 3 seconds */ + smc91x_phy_reg_write( PHY_CNTL_RST, dev->base_addr, priv->phyaddr, PHY_CNTL_REG); + /* Wait for the reset to complete, or time out */ + while (timeout--) { + if (!(smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_CNTL_REG) + & PHY_CNTL_RST)) { + /* reset complete */ + break; + } + + mdelay(10); + } + if (timeout < 1) { + printk( KERN_ERR "%s: PHY reset timed out\n", dev->name); + } + + /* phy sometimes ignores the first write after phy reset. Write + * default value to control register to get past this. + */ + smc91x_phy_reg_write( + PHY_CNTL_SPEED | PHY_CNTL_ANEG_EN | PHY_CNTL_MII_DIS, + dev->base_addr, priv->phyaddr, PHY_CNTL_REG); +} + +/* --- Helpers --- */ + +static void smc91x_reg_dump( struct net_device *dev, char *id) +{ + int i,b; + unsigned int base = dev->base_addr; + smc91x_t *priv = (smc91x_t *) dev->priv; + unsigned int phyaddr = priv->phyaddr; + + printk( KERN_INFO "Dump (%s)\n", id); + for( b=0; b<4; b++) { + printk( KERN_INFO "--- Bank %d\n", b); + for( i=0; i<14; i+=2) { + printk( KERN_INFO "%02x = %04x\n", + i, smc91x_reg_read( base, i, b)); + } + } + printk( KERN_INFO "--- PHY\n"); + for( i=0; i<6; i++) { + printk( KERN_INFO "%02x = %04x\n", + i, smc91x_phy_reg_read( base, phyaddr, i)); + } + for( i=16; i<20; i++) { + printk( KERN_INFO "%02x = %04x\n", + i, smc91x_phy_reg_read( base, phyaddr, i)); + } +} + +static void smc91x_set_speed_and_duplex( struct net_device *dev, int speed, int dup) +{ + u16 val; + u16 phy_settings = 0; + u16 mac_settings = 0; + smc91x_t *priv = (smc91x_t*) dev->priv; + + printk( KERN_DEBUG "%s: %smbps %s-duplex\n", dev->name, + speed?"100":"10", dup?"full":"half"); + + if( speed) { + phy_settings |= PHY_CNTL_SPEED; + mac_settings |= RPC_SPEED; + priv->speed = SPEED_100; + } else { + priv->speed = SPEED_10; + } + + if( dup) { + phy_settings |= PHY_CNTL_DPLX; + mac_settings |= RPC_DPLX; + priv->duplex = DUPLEX_FULL; + + val = smc91x_reg_read(dev->base_addr, TCR_REG, 0) | TCR_SWFDUP; + } else { + priv->duplex = DUPLEX_HALF; + val = smc91x_reg_read(dev->base_addr, TCR_REG, 0) & ~TCR_SWFDUP; + } + /* update switched full duplex mode */ + smc91x_reg_write( val, dev->base_addr, TCR_REG, 0); + + if( priv->autoneg_on) { + mac_settings |= RPC_ANEG; + phy_settings |= PHY_CNTL_ANEG_EN; + } + +#ifdef FIXED_LINK + val = smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_CFG1_REG); + val |= PHY_CFG1_LNKDIS; + smc91x_phy_reg_write( val, dev->base_addr, priv->phyaddr, PHY_CFG1_REG); +#endif + + val = phy_settings; + smc91x_phy_reg_write( val, dev->base_addr, priv->phyaddr, PHY_CNTL_REG); + + smc91x_reg_write( + mac_settings | + RPC_LEDA(RPC_LED_100_10) | RPC_LEDB(RPC_LED_TX_RX), + dev->base_addr, RPC_REG, 0); +} + +static void smc91x_autonegotiate( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + + u16 phy_status = smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_STAT_REG); + if( priv->autoneg_on && (phy_status & PHY_STAT_CAP_ANEG)) { + u16 local_caps; + u16 advertise_caps; + u16 remote_caps; + int count; + local_caps = smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_STAT_REG); + + advertise_caps = PHY_AD_CSMA; + + if (local_caps & PHY_STAT_CAP_T4) + advertise_caps |= PHY_AD_T4; + + if (local_caps & PHY_STAT_CAP_TXF) + advertise_caps |= PHY_AD_TX_FDX; + + if (local_caps & PHY_STAT_CAP_TXH) + advertise_caps |= PHY_AD_TX_HDX; + + if (local_caps & PHY_STAT_CAP_TF) + advertise_caps |= PHY_AD_10_FDX; + + if (local_caps & PHY_STAT_CAP_TH) + advertise_caps |= PHY_AD_10_HDX; + + smc91x_phy_reg_write( advertise_caps, + dev->base_addr, priv->phyaddr, PHY_AD_REG); + + smc91x_reg_write( RPC_ANEG, dev->base_addr, RPC_REG, 0); + smc91x_phy_reg_write( PHY_CNTL_ANEG_EN | PHY_CNTL_ANEG_RST, + dev->base_addr, priv->phyaddr, PHY_CNTL_REG); + + count = 200; + while( count--) { + remote_caps = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_RMT_REG); + if (remote_caps & PHY_AD_ACK) break; + mdelay(10); + } + + if( count < 1) { + printk(KERN_DEBUG "%s: PHY auto-negotiate timed out\n", + dev->name); + smc91x_set_speed_and_duplex( dev, 0, 0); + } else { + u16 phy_int; + u16 status = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_STAT_REG); + + if (status & PHY_STAT_REM_FLT) { + printk(KERN_DEBUG "%s: PHY remote fault detected\n", dev->name); + } + + mdelay(100); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_STAT_REG); + phy_int = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_INT_REG); + + mdelay(100); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_STAT_REG); + phy_int = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_INT_REG); + + smc91x_set_speed_and_duplex( dev, + ((phy_int&PHY_INT_SPDDET)!=0), + ((phy_int&PHY_INT_DPLXDET)!=0)); + } + } else { + priv->autoneg_on = 0; + smc91x_set_speed_and_duplex( dev, + (priv->speed==SPEED_100), + (priv->duplex==DUPLEX_FULL)); + } +} + +/* --- Ethtool --- */ + +static int smc91x_ethtool_ioctl( struct net_device *dev, void *useraddr) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + u32 ethcmd; + + if (get_user(ethcmd, (u32 *)useraddr)) + return -EFAULT; + + switch (ethcmd) { + case ETHTOOL_GDRVINFO: /* get driver info */ + { + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO }; + strcpy (info.driver, DRIVER_NAME); + strcpy (info.version, DRIVER_VERSION); + if (copy_to_user (useraddr, &info, sizeof (info))) + return -EFAULT; + } + return 0; + + case ETHTOOL_GSET: /* get settings */ + { + struct ethtool_cmd ecmd = { ETHTOOL_GSET }; + + ecmd.supported = + SUPPORTED_MII | + SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_100baseT_Half | + SUPPORTED_100baseT_Full | + SUPPORTED_Autoneg; + ecmd.advertising = + ADVERTISED_MII | + ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | + ADVERTISED_100baseT_Full; + ecmd.speed = priv->speed; + ecmd.duplex = priv->duplex; + ecmd.port = PORT_MII; + ecmd.phy_address = priv->phyaddr; + ecmd.transceiver = XCVR_INTERNAL; + ecmd.autoneg = priv->autoneg_on; + + if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) + return -EFAULT; + } + return 0; + + case ETHTOOL_SSET: /* set settings */ + { + struct ethtool_cmd ecmd; + if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) + return -EFAULT; + + if( ecmd.speed != SPEED_10 && + ecmd.speed != SPEED_100) + return -EINVAL; + else + priv->speed = ecmd.speed; + + if( ecmd.duplex != DUPLEX_HALF && + ecmd.duplex != DUPLEX_FULL) + return -EINVAL; + else + priv->duplex = ecmd.duplex; + + if( ecmd.autoneg != AUTONEG_DISABLE && + ecmd.autoneg != AUTONEG_ENABLE) + return -EINVAL; + else + priv->autoneg_on = (ecmd.autoneg==AUTONEG_ENABLE); + + smc91x_autonegotiate( dev); + } + return 0; + + case ETHTOOL_GLINK: /* get link status */ + { + struct ethtool_value edata = { ETHTOOL_GLINK }; + edata.data = netif_carrier_ok( dev); + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + + } + return 0; + + case ETHTOOL_GMSGLVL: /* get message-level */ + { + struct ethtool_value edata = { ETHTOOL_GMSGLVL }; + edata.data = smc_debug; + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + } + return 0; +#ifdef SMC_DEBUG + case ETHTOOL_SMSGLVL: /* set message-level */ + { + struct ethtool_value edata; + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + smc_debug = edata.data; + } + return 0; +#endif + + case ETHTOOL_NWAY_RST: /* restart autonegotiation */ + { + smc91x_autonegotiate( dev); + } + return 0; + +#ifdef ETHTOOL_TEST /* 2.4.19 and newer */ + case ETHTOOL_GSTRINGS: /* strings */ + { + } + return 0; + + case ETHTOOL_TEST: /* test */ + { + smc91x_reg_dump( dev, "smc91x_ethtool_ioctl"); + } + return 0; +#endif + default: + break; + } + + return -EOPNOTSUPP; +} + +/* --- MAC --- */ + +static void smc91x_enable( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 val; + int i; + + /* set EPH Power EN */ + val = smc91x_reg_read(dev->base_addr, CONFIG_REG, 1) | CONFIG_EPH_POWER_EN; + smc91x_reg_write( val, dev->base_addr, CONFIG_REG, 1); + + /* clear PDN in PHY MI */ + val = smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_CNTL_REG) & ~PHY_CNTL_PDN; + smc91x_phy_reg_write( val, dev->base_addr, priv->phyaddr, PHY_CNTL_REG); + + /* MMU reset */ + smc91x_set_bank( dev->base_addr, 2); + smc91x_mmu_reset( dev->base_addr); + smc91x_mmu_wait_ready( dev->base_addr); + + /* enable tx */ + smc91x_reg_write( TCR_ENABLE, dev->base_addr, TCR_REG, 0); + + /* enable rx */ + smc91x_reg_write( priv->rcr, dev->base_addr, RCR_REG, 0); + + /* enable auto-release */ + val = smc91x_reg_read(dev->base_addr, CTL_REG, 1) | CTL_AUTO_RELEASE; + smc91x_reg_write( val, dev->base_addr, CTL_REG, 1); + + smc91x_phy_reset( dev); + + for (i = 0; i < 6; i += 2) { + u16 address; + + address = dev->dev_addr[i + 1] << 8; + address |= dev->dev_addr[i]; + smc91x_reg_write( address, dev->base_addr, ADDR0_REG+i, 1); + } + + smc91x_autonegotiate( dev); + + priv->last_phy_int = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_INT_REG); + /* mask phy interrupts we are not interested in */ + smc91x_phy_reg_write( + PHY_INT_LOSSSYNC | PHY_INT_CWRD | PHY_INT_SSD | + PHY_INT_ESD | PHY_INT_RPOL | PHY_INT_JAB, + dev->base_addr, priv->phyaddr, PHY_MASK_REG); + + /* enable interrupts */ + smc91x_write_interrupt_mask( dev->base_addr, + IM_EPH_INT | IM_RX_OVRN_INT | IM_RCV_INT | IM_MDINT); +} + +static void smc91x_reset( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + + if( smc_debug) printk( KERN_INFO "%s: Pulling a reset!\n", dev->name); + + /* disable tx */ + smc91x_reg_write( 0, dev->base_addr, TCR_REG, 0); + + /* disable rx */ + smc91x_reg_write( 0, dev->base_addr, RCR_REG, 0); + + /* disable interrupts */ + smc91x_write_interrupt_mask( dev->base_addr, 0); + + /* soft reset */ + smc91x_reg_write( RCR_SOFTRST, dev->base_addr, RCR_REG, 0); + smc91x_reg_write( 0, dev->base_addr, RCR_REG, 0); + + mdelay(10); + + /* re-enable everything */ + smc91x_enable( dev); + + /* clear saved skb and open the queue */ + priv->saved_skb = 0; + netif_wake_queue (dev); +} + +static int smc91x_detect( struct net_device *dev) +{ + u16 bank; + + bank = smc91x_get_bank( dev->base_addr); + if( (bank & 0xFF00) != 0x3300) + return -ENODEV; + + smc91x_set_bank( dev->base_addr, 0); + + bank = smc91x_get_bank( dev->base_addr); + if( (bank & 0xFF00) != 0x3300) + return -ENODEV; + + return smc91x_detect_phy( dev); +} + +static void smc91x_receive( struct net_device *dev) +{ + unsigned int base = dev->base_addr; + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 packet_number; + u32 val; + u16 status; + u16 packet_length; + + if( smc_debug > 2) printk( KERN_INFO "%s: smc91x_receive\n", dev->name); + + packet_number = smc91x_read_rx_packet_number( base); + + if( packet_number & FIFO_RXREMPTY) { + + /* we got called , but nothing was on the FIFO */ + printk( KERN_ERR "%s: smc91x_receive rx fifo empty.\n", + dev->name); + return; + } + + smc91x_reg_write((PTR_READ | PTR_RCV | PTR_AUTOINC), base, PTR_REG, 2); + + val = smc91x_read_packet_header( base); + + status = (u16) val & 0xffff; + packet_length = (u16) (val >> 16) & 0x7ff; + + if( packet_length <= 6) { + printk( KERN_ERR "%s: smc91x_receive rx packet len too small (%d)\n", + dev->name, packet_length); + goto done; + } + + if (!(status & RS_ERRORS)) { + struct sk_buff *skb; + unsigned char *data; + + /* set multicast stats */ + if (status & RS_MULTICAST) + priv->stats.multicast++; + + if ( priv->odd_byte_bug || (status & RS_ODDFRAME)) + packet_length++; + + /* Allocate enough memory for entire receive frame, */ + /* plus alignment needs, to be safe */ + skb = dev_alloc_skb(packet_length + 12); + + if (skb == NULL) { + printk(KERN_ERR "%s: Low memory, packet dropped.\n", + dev->name); + priv->stats.rx_dropped++; + goto done; + } + + /* + * Apparently dev_alloc_skb is not guaranteed to return a nicely + * aligned data buffer. Make sure we get the alignment we need: + * + * BIG FAT WARNING: Some architectures (ARM Xscale for + * example) require specific alignments for DMA operations. + * In the case of the PXA250, 64 bit alignment is required + * for memory targets/sources. + */ + skb_reserve(skb, (-(u32) skb->data) & 7); /* 64 bit alignment */ + + skb->dev = dev; + data = skb_put(skb, packet_length); + + smc91x_read_packet_data( base, skb, data, packet_length); + + skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); + dev->last_rx = jiffies; + priv->stats.rx_packets++; + priv->stats.rx_bytes += packet_length; + } else { + priv->stats.rx_errors++; + + if (status & RS_ALGNERR) + priv->stats.rx_frame_errors++; + if (status & (RS_TOOSHORT | RS_TOOLONG)) + priv->stats.rx_length_errors++; + if (status & RS_BADCRC) + priv->stats.rx_crc_errors++; + } + +done: + smc91x_mmu_wait_ready( base); + smc91x_mmu_release( base); + + return; +} + +static void smc91x_transmit( struct net_device *dev) +{ + u16 length; + unsigned char *buf; + u16 packet_number; + smc91x_t *priv = (smc91x_t *) dev->priv; + unsigned long base = dev->base_addr; + struct sk_buff *skb = priv->saved_skb; + + if( smc_debug > 2) printk( KERN_INFO "%s: smc91x_transmit\n", dev->name); + + /* allocation done, feed chip data */ + length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; + buf = skb->data; + + /*assume bank 2 */ + packet_number = smc91x_read_alloc_packet_number(base); + + if( packet_number & AR_FAILED) { + printk(KERN_ERR "%s: Memory allocation failed.\n", + dev->name); + priv->stats.tx_aborted_errors++; + priv->saved_skb = 0; + return; + } + + smc91x_write_packet_number(base, packet_number); + smc91x_reg_write( PTR_AUTOINC, base, PTR_REG, 2); + + smc91x_write_packet_length(base, length, priv); + smc91x_write_packet_data(base, buf, length, priv); + + /* and let the chipset deal with it */ + smc91x_mmu_wait_ready( base); + smc91x_mmu_enqueue( base); + + if( smc_debug > 3) + printk( KERN_INFO "%s: Sent packet of length %d \n", + dev->name, length); + priv->tx_bytes += length; + priv->tx_packets++; + + priv->saved_skb = NULL; + dev_kfree_skb_any(skb); + dev->trans_start = jiffies; + + /* 10mbps needs throttling to reduce rcv overruns when + * using auto-release. + */ + if( priv->speed == SPEED_100) netif_wake_queue(dev); +} + +static void smc91x_transmit_restart( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t *) dev->priv; + unsigned long base = dev->base_addr; + u16 eph_status = smc91x_reg_read( base, EPH_STATUS_REG, 0); + u16 packet_number = smc91x_reg_read( base, FIFO_REG, 2); + + printk( KERN_DEBUG "%s: TX failed, retrying (pn=%04x,eph=%04x)\n", + dev->name, packet_number, eph_status); + + priv->stats.tx_errors++; + if (eph_status & ES_LOSTCARR) + priv->stats.tx_carrier_errors++; + if (eph_status & ES_LATCOL) + priv->stats.tx_window_errors++; + + /* ack int, remove packet from fifo */ + smc91x_ack_interrupt( base, IM_TX_INT); + + /* re-enqueue packet */ + smc91x_write_packet_number( base, packet_number); + smc91x_mmu_enqueue( base); + + /* re-enable tx */ + smc91x_reg_write( TCR_ENABLE, base, TCR_REG, 0); +} + +static int smc91x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) +{ + unsigned long flags; + smc91x_t *priv = (smc91x_t *) dev->priv; + unsigned long base = dev->base_addr; + + if( smc_debug > 2) printk( KERN_INFO "%s: smc91x_hard_start_xmit\n", dev->name); + + if (priv->saved_skb) { + /* this should never happen */ + priv->stats.tx_aborted_errors++; + printk(KERN_ERR "%s: Unexpected send packet request. " + "Not finished with previous one.\n", + dev->name); + return 1; + } + priv->saved_skb = skb; + + netif_stop_queue (dev); + + /* All the other mmu operations (excluding reset) are in interrupt + * context. I.e. this is the only place we have to be careful + * about really having a non-busy mmu after the wait_ready call. + * Also the ALLOC_INT cannot be cleared directly (see 8.21) so + * we want to be sure interrupts are off until we know the alloc + * request has been submitted. + */ + local_irq_save(flags); + smc91x_enable_interrupt( base, IM_ALLOC_INT); + smc91x_mmu_wait_ready( base); + smc91x_mmu_alloc( base); /* allocation request for memory page */ + local_irq_restore(flags); + + return 0; +} + +static void smc91x_update_stats( unsigned long base, smc91x_t *priv) +{ + u16 card_stats; + + /* update stats */ + card_stats = smc91x_reg_read( base, COUNTER_REG, 0); + /* single collisions */ + priv->stats.collisions += card_stats & 0xF; + card_stats >>= 4; + /* multiple collisions */ + priv->stats.collisions += card_stats & 0xF; + + priv->stats.tx_packets += priv->tx_packets; + priv->stats.tx_bytes += priv->tx_bytes; + priv->tx_bytes = 0; + priv->tx_packets = 0; +} + +static void smc91x_wait_for_link(unsigned long _dev) +{ + struct net_device *dev = (struct net_device *)_dev; + smc91x_t *priv = (smc91x_t*) dev->priv; + int count; + u16 status; + + /* wait for link to come up */ + count = 200; + do { + status = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_STAT_REG); + udelay(100); + } while ( ((status & PHY_STAT_LINK)==0) && --count); + + /* wait for remote fault to clear */ + count = 200; + do { + status = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_STAT_REG); + udelay(100); + } while ( ((status & PHY_STAT_REM_FLT)!=0) && --count); + + /* Make sure any latched bits get sucked out. + * The lnkfail bit seems to be tied to the link-status bit. + * No suck, no interrupt :( + */ + mdelay(100); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_STAT_REG); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_INT_REG); + mdelay(100); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_STAT_REG); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_INT_REG); + mdelay(100); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_STAT_REG); + smc91x_phy_reg_read( dev->base_addr, priv->phyaddr, PHY_INT_REG); +} + +static void smc91x_phy_interrupt( struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 phy_int = smc91x_phy_reg_read( + dev->base_addr, priv->phyaddr, PHY_INT_REG); + u16 changed = phy_int ^ priv->last_phy_int; + + if( smc_debug) + printk( KERN_INFO "%s: PHY MI int (last=%04x, new=%04x)\n", + dev->name, priv->last_phy_int, phy_int); + + if( changed & (PHY_INT_SPDDET | PHY_INT_DPLXDET)) { + if( smc_debug) printk( KERN_INFO "%s: PHY MI new speed/duplex\n", dev->name); + /* FIXME: detection works, but we don't fully get back on our feet. + * Reset PHY, MAC, etc. ...? + */ + if( smc_debug > 2) smc91x_reg_dump( dev, "smc91x_phy_interrupt"); + + smc91x_set_speed_and_duplex( dev, + ((phy_int&PHY_INT_SPDDET)!=0), + ((phy_int&PHY_INT_DPLXDET)!=0)); + + tasklet_schedule(&priv->link_tasklet); + } + + if( phy_int&PHY_INT_LNKFAIL) { + printk( KERN_DEBUG "%s: Link down\n", dev->name); + netif_carrier_off( dev); + } else { + printk( KERN_DEBUG "%s: Link up\n", dev->name); + netif_carrier_on( dev); + } + + priv->last_phy_int = phy_int; +} + +static void smc91x_eph_interrupt( struct net_device *dev) +{ + unsigned int base = dev->base_addr; + printk( KERN_INFO "%s: EPH int %x\n", dev->name, + smc91x_reg_read( base, EPH_STATUS_REG, 0)); +} + +static irqreturn_t smc91x_interrupt (int irq,void *id,struct pt_regs *regs) +{ + struct net_device *dev = id; + unsigned int base = dev->base_addr; + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 oldBank; + u8 mask; + int timeout = 10; + + /* Save the current bank select */ + oldBank = smc91x_get_bank(base); + /* Get current interrupt mask */ + mask = smc91x_read_interrupt_mask( base); + /* Mask interrupts */ + smc91x_write_interrupt_mask( base, 0); + + if( smc_debug > 3) + printk( KERN_INFO "smc91x_interrupt mask %x stat %x\n", + mask, smc91x_read_interrupt_status( base)); + + do { + u8 status = smc91x_read_interrupt_status( base) & mask; + + if( smc_debug > 3) + printk( KERN_INFO "smc91x_interrupt2 mask %x stat %x\n", + mask, smc91x_read_interrupt_status( base)); + + if (!status) break; + + if (status & IM_RCV_INT) { + smc91x_receive( dev); + } else if (status & IM_RX_OVRN_INT) { + priv->stats.rx_errors++; + priv->stats.rx_fifo_errors++; + smc91x_ack_interrupt( base, IM_RX_OVRN_INT); + } else if (status & IM_TX_EMPTY_INT) { + smc91x_ack_interrupt( base, IM_TX_EMPTY_INT); + if( status & IM_TX_INT) { + smc91x_transmit_restart( dev); + } else { + smc91x_update_stats( base, priv); + /* 10mbps needs throttling to reduce rcv overruns + * when using auto-release. + */ + if( priv->speed == SPEED_10) netif_wake_queue(dev); + mask &= ~(IM_TX_INT | IM_TX_EMPTY_INT); + } + } else if (status & IM_TX_INT) { + u16 eph_status; + eph_status = smc91x_reg_read( base, EPH_STATUS_REG, 0); + + if( eph_status & ES_TX_SUC) { + /* Should never get here for auto-release */ + printk( KERN_INFO "TX ok\n"); + smc91x_ack_interrupt( base, IM_TX_INT); + } else { + smc91x_transmit_restart( dev); + } + } else if (status & IM_ALLOC_INT) { + mask &= ~IM_ALLOC_INT; + smc91x_transmit( dev); + /* enable tx interrupts */ + mask |= (IM_TX_INT | IM_TX_EMPTY_INT); + } else if (status & IM_MDINT) { + smc91x_ack_interrupt( base, IM_MDINT); + smc91x_phy_interrupt( dev); + } else if (status & IM_EPH_INT) { + smc91x_eph_interrupt( dev); + } + } while (timeout--); + + /* Re-enable interrupts */ + smc91x_write_interrupt_mask( base, mask); + /* Restore original bank select */ + smc91x_set_bank(base, oldBank); + + return IRQ_HANDLED; +} + +static int smc91x_open (struct net_device *dev) +{ + int result; + smc91x_t *priv = (smc91x_t*) dev->priv; + + /* install interrupt handler */ + if ((result = request_irq (dev->irq,&smc91x_interrupt,0,dev->name,dev)) < 0) { + printk (KERN_ERR "%s: could not register interrupt %d\n",dev->name,dev->irq); + return result; + } + +#if defined(CONFIG_ARCH_PXA) + set_irq_type(dev->irq, IRQT_RISING); +#endif + +#if defined(CONFIG_ARCH_PXA) + /* treat a dma addr of zero as no dma */ + if( priv->dma_addr) { + result = pxa_request_dma( + dev->name, DMA_PRIO_LOW, smc91x_dma_irq, (void *) priv); + if (result < 0) { + printk(KERN_ERR "%s: unable to acquire a DMA channel.\n", dev->name); + free_irq (dev->irq, dev); + return result; + } + dev->dma = result; + } +#endif + + smc91x_enable( dev); + + /* start the queue */ + netif_start_queue (dev); + + MOD_INC_USE_COUNT; + + return 0; +} + +static int smc91x_stop (struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 val; + + if( smc_debug > 3) smc91x_reg_dump( dev, "smc91x_stop"); + + /* stop the queue */ + netif_stop_queue( dev); + + /* disable tx */ + smc91x_reg_write( 0, dev->base_addr, TCR_REG, 0); + + /* TODO: remove and release all tx packets */ + + /* disable rx */ + smc91x_reg_write( 0, dev->base_addr, RCR_REG, 0); + + /* TODO: process and release remaining rx packets */ + + /* disable interrupts */ + smc91x_write_interrupt_mask( dev->base_addr, 0); + + /* set PDN in PHY MI */ + val = smc91x_phy_reg_read(dev->base_addr, priv->phyaddr, PHY_CNTL_REG) | PHY_CNTL_PDN; + smc91x_phy_reg_write( val, dev->base_addr, priv->phyaddr, PHY_CNTL_REG); + + /* clear EPH Power EN */ + val = smc91x_reg_read(dev->base_addr, CONFIG_REG, 1) & ~CONFIG_EPH_POWER_EN; + smc91x_reg_write( val, dev->base_addr, CONFIG_REG, 1); + + /* uninstall interrupt handler */ + free_irq( dev->irq,dev); + +#if defined(CONFIG_ARCH_PXA) + pxa_free_dma( dev->dma); +#endif + + MOD_DEC_USE_COUNT; + + return 0; +} + +static void smc91x_transmit_timeout (struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t *) dev->priv; + + smc91x_reg_dump( dev, "smc91x_transmit_timeout"); + + priv->stats.tx_errors++; + priv->stats.tx_heartbeat_errors++; + priv->tx_bytes = 0; + priv->tx_packets = 0; + + smc91x_reset( dev); +} + +static struct net_device_stats *smc91x_get_stats (struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + return & priv->stats; +} + +static int smc91x_do_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) +{ + int rc = 0; + + if (!netif_running(dev)) + return -EINVAL; + + switch (cmd) { + case SIOCETHTOOL: + return smc91x_ethtool_ioctl(dev, (void *) rq->ifr_data); + + default: + rc = -EOPNOTSUPP; + break; + } + + return rc; +} + +/* Finds the CRC32 of a set of bytes. From Peter Cammaert's code. */ +static int smc91x_crc32(char *s, int length) +{ + /* indices */ + int perByte; + int perBit; + /* crc polynomial for Ethernet */ + const unsigned long poly = 0xedb88320; + /* crc value - preinitialized to all 1's */ + unsigned long crc_value = 0xffffffff; + + for (perByte = 0; perByte < length; perByte++) { + unsigned char c; + + c = *(s++); + for (perBit = 0; perBit < 8; perBit++) { + crc_value = (crc_value >> 1) ^ + (((crc_value ^ c) & 0x01) ? poly : 0); + c >>= 1; + } + } + return crc_value; +} + +static void smc91x_set_multicast_filter (struct net_device *dev) +{ + int i; + unsigned char multicast_table[8]; + struct dev_mc_list *mc_addr = dev->mc_list; + int mc_count = dev->mc_count; + /* table for flipping the order of 3 bits */ + unsigned char invert3[] = { 0, 4, 2, 6, 1, 5, 3, 7 }; + + /* start with a table of all zeros: reject all */ + memset(multicast_table, 0, sizeof (multicast_table)); + + for (i = 0; i < mc_count; i++, mc_addr = mc_addr->next) { + int position; + + /* do we have a pointer here? */ + if (!mc_addr) + break; + + /* make sure this is a multicast address - shouldn't this + be a given if we have it here ? */ + if (!(*mc_addr->dmi_addr & 1)) + continue; + + /* only use the low order bits */ + position = smc91x_crc32(mc_addr->dmi_addr, 6) & 0x3f; + + /* do some messy swapping to put the bit in the right spot */ + multicast_table[invert3[position & 7]] |= + (1 << invert3[(position >> 3) & 7]); + } + + for (i = 0; i < 8; i+=2) { + u16 mc_val = ((u16)multicast_table[i+1]<<8) + multicast_table[i]; + smc91x_reg_write( mc_val, dev->base_addr, MCAST_REG1+i, 3); + } +} + +static void smc91x_set_multicast_list (struct net_device *dev) +{ + smc91x_t *priv = (smc91x_t*) dev->priv; + u16 rcr = smc91x_reg_read( dev->base_addr, RCR_REG, 0); + + if ((dev->flags & IFF_PROMISC)) { + printk( KERN_INFO "%s: Promiscuous mode enabled\n", dev->name); + rcr |= RCR_PRMS; + } else if ( dev->flags & IFF_ALLMULTI) { + if( smc_debug) printk( KERN_INFO "%s: Multicast-all enabled\n", dev->name); + rcr |= RCR_ALMUL; + } else if ( dev->mc_count) { + if( smc_debug > 2) + { + int i; + struct dev_mc_list *addr = dev->mc_list; + printk( KERN_INFO "%s: Multicast enabled (filter)\n", dev->name); + for( i=0; imc_count; i++) + { + int j; + printk( KERN_INFO "%s: addr-%d", dev->name, i); + for( j=0; j<6; j++) + { + printk( ":%02x", addr->dmi_addr[j]); + } + printk( "\n"); + addr = addr->next; + } + } + + rcr = RCR_STRIP_CRC | RCR_RXEN; + + smc91x_set_multicast_filter( dev); + } else { + rcr = RCR_STRIP_CRC | RCR_RXEN; + + smc91x_reg_write( 0, dev->base_addr, MCAST_REG1, 3); + smc91x_reg_write( 0, dev->base_addr, MCAST_REG2, 3); + smc91x_reg_write( 0, dev->base_addr, MCAST_REG3, 3); + smc91x_reg_write( 0, dev->base_addr, MCAST_REG4, 3); + } + smc91x_reg_write( rcr, dev->base_addr, RCR_REG, 0); + + /* keep track of rcr */ + priv->rcr = rcr; +} + +static int __init smc91x_probe (struct net_device *dev) +{ + int result, i; + u16 rev; + u8 chip_id; + u8 chip_rev; + smc91x_t *priv; + smc91x_config_t *config_priv = (smc91x_config_t*) dev->priv; + + ether_setup (dev); + + dev->priv = kmalloc(sizeof(smc91x_t), GFP_KERNEL); + if (dev->priv == NULL) { + result = -ENOMEM; + goto err_out; + } + memset(dev->priv, 0, sizeof (smc91x_t)); + priv = (smc91x_t*) dev->priv; + + dev->base_addr = config_priv->port; + dev->irq = config_priv->irq; + priv->dma_addr = config_priv->dma_addr; + priv->use_32bit= config_priv->use_32bit; + + priv->rcr = RCR_STRIP_CRC | RCR_RXEN; + priv->autoneg_on = 1; + priv->speed = SPEED_10; + priv->duplex = DUPLEX_HALF; + + tasklet_init(&priv->link_tasklet, smc91x_wait_for_link, (unsigned long)dev); + + if( (result = smc91x_detect( dev)) < 0) + goto err_out; + + dev->open = smc91x_open; + dev->stop = smc91x_stop; + dev->hard_start_xmit = smc91x_hard_start_xmit; + dev->get_stats = smc91x_get_stats; + dev->do_ioctl = smc91x_do_ioctl; + dev->set_multicast_list = smc91x_set_multicast_list; + dev->tx_timeout = smc91x_transmit_timeout; + dev->watchdog_timeo = 5*HZ; + + SET_MODULE_OWNER (dev); + + request_region (dev->base_addr,SMC91X_REGION_EXTEND,dev->name); + + rev = smc91x_reg_read( dev->base_addr, REV_REG, 3); + chip_id = (rev >> 4) & 0xf; + chip_rev = rev & 0xf; + + printk( KERN_INFO "%s: %s(rev:%d) %s at %#3lx IRQ:%d", + dev->name, + smc91x_chip_id[ (rev >> 4) & 0xf], rev & 0xf, + priv->use_32bit?"32-bit":"16-bit", + dev->base_addr, dev->irq); + printk( " ADDR: "); + for (i = 0; i < 5; i++) + printk("%2.2x:", dev->dev_addr[i]); + printk("%2.2x \n", dev->dev_addr[5]); + +#ifdef HW_TEST +{ + u16 i=0; + printk( KERN_INFO "%s: Starting SMC hardware test\n", dev->name); + while(1) { + u16 rev; + u16 gp; + smc91x_reg_write( i, dev->base_addr, GP_REG, 1); + rev = smc91x_reg_read( dev->base_addr, REV_REG, 3); + if( (rev&0xff) != 0x90) { + printk( KERN_INFO "Failed to read rev %x\n", rev); + break; + } + gp = smc91x_reg_read( dev->base_addr, GP_REG, 1); + if( gp != i) { + printk( KERN_INFO "Failed to read gp %x (!=%x)\n", gp,i); + break; + } + i++; + if( i==1) { + smc91x_reg_write( RPC_LEDA(RPC_LED_100), dev->base_addr, RPC_REG, 0); + } + if( i==32768) { + smc91x_reg_write( RPC_LEDA(RPC_LED_10), dev->base_addr, RPC_REG, 0); + } + + } + panic( "HW test failed.\n"); +} +#endif + + /* The odd byte problem has been fixed in the LAN91C111 Rev B */ + if( (chip_id == 9) && (chip_rev < 1)) + priv->odd_byte_bug = 1; + + return result; + +err_out: + if( dev->priv) + kfree(dev->priv); + + return result; +} + +static int __init smc91x_init (void) +{ + int interface; + int device_present = 0; + int result; + + printk( KERN_INFO DRIVER_NAME " driver for Linux " DRIVER_VERSION "\n"); + + for( interface=0; interface