diff -urN linux-tux2/arch/arm/def-configs/shannon linux/arch/arm/def-configs/shannon --- linux-tux2/arch/arm/def-configs/shannon Wed Nov 14 04:34:45 2001 +++ linux/arch/arm/def-configs/shannon Wed Nov 14 04:58:47 2001 @@ -1,5 +1,5 @@ # -# Automatically generated make config: don't edit +# Automatically generated by make menuconfig: don't edit # CONFIG_ARM=y # CONFIG_EISA is not set @@ -8,12 +8,14 @@ CONFIG_UID16=y CONFIG_RWSEM_GENERIC_SPINLOCK=y # CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_GENERIC_BUST_SPINLOCK is not set +# CONFIG_GENERIC_ISA_DMA is not set # # Code maturity level options # CONFIG_EXPERIMENTAL=y -CONFIG_OBSOLETE=y +# CONFIG_OBSOLETE is not set # # Loadable module support @@ -31,6 +33,7 @@ # CONFIG_ARCH_CLPS711X is not set # CONFIG_ARCH_CO285 is not set # CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_CAMELOT is not set # CONFIG_ARCH_FOOTBRIDGE is not set # CONFIG_ARCH_INTEGRATOR is not set # CONFIG_ARCH_L7200 is not set @@ -41,26 +44,32 @@ # # Archimedes/A5000 Implementations # - -# -# Archimedes/A5000 Implementations (select only ONE) -# +# CONFIG_ARCH_ARC is not set +# CONFIG_ARCH_A5K is not set # # Footbridge Implementations # +# CONFIG_ARCH_CATS is not set +# CONFIG_ARCH_PERSONAL_SERVER is not set +# CONFIG_ARCH_EBSA285_ADDIN is not set +# CONFIG_ARCH_EBSA285_HOST is not set +# CONFIG_ARCH_NETWINDER is not set # # SA11x0 Implementations # # CONFIG_SA1100_ASSABET is not set +# CONFIG_ASSABET_NEPONSET is not set +# CONFIG_SA1100_ADSBITSY is not set # CONFIG_SA1100_BRUTUS is not set # CONFIG_SA1100_CERF is not set -# CONFIG_SA1100_BITSY is not set +# CONFIG_SA1100_H3600 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_JORNADA720 is not set # CONFIG_SA1100_HUW_WEBPANEL is not set # CONFIG_SA1100_ITSY is not set @@ -70,6 +79,7 @@ # CONFIG_SA1100_PANGOLIN is not set # CONFIG_SA1100_PLEB is not set CONFIG_SA1100_SHANNON=y +# CONFIG_SA1100_SHANNON_32M is not set # CONFIG_SA1100_SHERMAN is not set # CONFIG_SA1100_SIMPAD is not set # CONFIG_SA1100_PFS168 is not set @@ -77,47 +87,55 @@ # CONFIG_SA1100_XP860 is not set # CONFIG_SA1100_YOPY is not set # CONFIG_SA1100_USB is not set +# CONFIG_SA1100_USB_NETLINK is not set +# CONFIG_SA1100_USB_CHAR is not set # # CLPS711X/EP721X Implementations # +# 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 - -# -# Processor Type -# # 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_ARM922T is not set +# CONFIG_CPU_ARM926T is not set # CONFIG_CPU_ARM1020 is not set # CONFIG_CPU_SA110 is not set CONFIG_CPU_SA1100=y +CONFIG_ARM_THUMB=y CONFIG_DISCONTIGMEM=y -# CONFIG_CPU_BIG_ENDIAN is not set # # General setup # # CONFIG_PCI is not set -# CONFIG_ISA is not set +CONFIG_ISA=y # CONFIG_ISA_DMA is not set -# CONFIG_CPU_FREQ is not set +CONFIG_CPU_FREQ=y CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=y +# CONFIG_I82092 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 @@ -132,7 +150,7 @@ # CONFIG_BINFMT_MISC is not set # CONFIG_PM is not set # CONFIG_ARTHUR is not set -CONFIG_CMDLINE="console=ttySA0,9600 console=tty1 root=/dev/mtdblock2 init=/linuxrc" +CONFIG_CMDLINE="console=ttySA0,115200 console=tty1 root=/dev/mtdblock2 init=/linuxrc" # CONFIG_LEDS is not set CONFIG_ALIGNMENT_TRAP=y @@ -150,10 +168,6 @@ # CONFIG_MTD_REDBOOT_PARTS is not set # CONFIG_MTD_BOOTLDR_PARTS is not set # CONFIG_MTD_AFS_PARTS is not set - -# -# User Modules And Translation Layers -# CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set @@ -163,44 +177,39 @@ # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=y +# CONFIG_MTD_JEDECPROBE is not set +CONFIG_MTD_GEN_PROBE=y # CONFIG_MTD_CFI_ADV_OPTIONS is not set # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_AMDSTD=y -# CONFIG_MTD_SHARP 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=y +CONFIG_MTD_AMDSTD=y +# CONFIG_MTD_SHARP is not set # CONFIG_MTD_JEDEC is not set # # Mapping drivers for chip access # # CONFIG_MTD_PHYSMAP is not set -# CONFIG_MTD_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_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_CFI_FLAGADM is not set -# CONFIG_MTD_ARM_INTEGRATOR is not set -# CONFIG_MTD_OCELOT is not set -# CONFIG_MTD_L440GX is not set +# CONFIG_MTD_PCI 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_SHANNON_SERIALFLASH=y # CONFIG_MTD_DOC1000 is not set # CONFIG_MTD_DOC2000 is not set # CONFIG_MTD_DOC2001 is not set @@ -215,13 +224,21 @@ # Plug and Play configuration # # 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_CISS_SCSI_TAPE is not set +# CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_LOOP is not set -# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y @@ -230,13 +247,22 @@ # Multi-device support (RAID and LVM) # # CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y -# CONFIG_NETLINK is not set +CONFIG_NETLINK=y +# CONFIG_RTNETLINK is not set +# CONFIG_NETLINK_DEV is not set # CONFIG_NETFILTER is not set # CONFIG_FILTER is not set CONFIG_UNIX=y @@ -251,10 +277,6 @@ # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # CONFIG_ATM is not set - -# -# -# # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_DECNET is not set @@ -286,22 +308,42 @@ # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y +# CONFIG_ARM_AM79C961A is not set +# CONFIG_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 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_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 # CONFIG_PPP is not set # CONFIG_SLIP is not set @@ -315,6 +357,7 @@ # # CONFIG_TR is not set # CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # @@ -325,7 +368,17 @@ # # PCMCIA network device support # -# CONFIG_NET_PCMCIA is not set +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=y +# CONFIG_PCMCIA_NMCLAN is not set +CONFIG_PCMCIA_SMC91C92=y +CONFIG_PCMCIA_XIRC2PS=y +# CONFIG_ARCNET_COM20020_CS is not set +# CONFIG_PCMCIA_IBMTR is not set +# CONFIG_NET_PCMCIA_RADIO is not set # # Amateur Radio support @@ -340,9 +393,40 @@ # # ATA/IDE/MFM/RLL support # -# CONFIG_IDE is not set -# CONFIG_BLK_DEV_IDE_MODES is not set +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDEDISK is not set +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set +# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set +# CONFIG_BLK_DEV_IDEDISK_IBM is not set +# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set +# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set +# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set +# CONFIG_BLK_DEV_IDEDISK_WD is not set +# CONFIG_BLK_DEV_COMMERIAL is not set +# CONFIG_BLK_DEV_TIVO is not set +CONFIG_BLK_DEV_IDECS=y +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_IDE_MODES 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 # # SCSI support @@ -353,6 +437,10 @@ # 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 @@ -374,22 +462,38 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y # CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_ANAKIN is not set +# CONFIG_SERIAL_ANAKIN_CONSOLE is not set +# CONFIG_SERIAL_AMBA is not set +# CONFIG_SERIAL_AMBA_CONSOLE is not set +# CONFIG_SERIAL_CLPS711X is not set +# CONFIG_SERIAL_CLPS711X_CONSOLE is not set +# CONFIG_SERIAL_21285 is not set +# CONFIG_SERIAL_21285_OLD is not set +# CONFIG_SERIAL_21285_CONSOLE is not set +# CONFIG_SERIAL_UART00 is not set +# CONFIG_SERIAL_UART00_CONSOLE is not set CONFIG_SERIAL_SA1100=y CONFIG_SERIAL_SA1100_CONSOLE=y -CONFIG_SA1100_DEFAULT_BAUDRATE=9600 +CONFIG_SA1100_DEFAULT_BAUDRATE=115200 # 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=256 -CONFIG_SHANNON_IRKBD=y -CONFIG_UCB1200=y -CONFIG_TOUCHSCREEN_UCB1200=y -CONFIG_AUDIO_UCB1200=y -CONFIG_ADC_UCB1200=y -# CONFIG_TOUCHSCREEN_BITSY is not set -# CONFIG_PROFILER is not set # # I2C support @@ -397,19 +501,53 @@ # CONFIG_I2C is not set # -# Mice +# L3 serial bus support # -# CONFIG_BUSMOUSE is not set -# CONFIG_MOUSE is not set +# CONFIG_L3 is not set +# CONFIG_L3_ALGOBIT is not set +# CONFIG_L3_BIT_SA1100_GPIO is not set +# CONFIG_L3_SA1111 is not set +# CONFIG_BIT_SA1100_GPIO is not set # -# Joysticks +# Mice # -# CONFIG_JOYSTICK is not set +# CONFIG_BUSMOUSE is not set +CONFIG_MOUSE=y +CONFIG_PSMOUSE=y +# CONFIG_82C710_MOUSE is not set +# CONFIG_PC110_PAD is not set # -# Input core support is needed for joysticks +# Joysticks # +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_INPUT_NS558 is not set +# CONFIG_INPUT_LIGHTNING is not set +# CONFIG_INPUT_PCIGAME is not set +# CONFIG_INPUT_CS461X is not set +# CONFIG_INPUT_EMU10K1 is not set +# CONFIG_INPUT_SERIO is not set +# CONFIG_INPUT_SERPORT is not set +# CONFIG_INPUT_ANALOG is not set +# CONFIG_INPUT_A3D is not set +# CONFIG_INPUT_ADI is not set +# CONFIG_INPUT_COBRA is not set +# CONFIG_INPUT_GF2K is not set +# CONFIG_INPUT_GRIP is not set +# CONFIG_INPUT_INTERACT is not set +# CONFIG_INPUT_TMDC is not set +# CONFIG_INPUT_SIDEWINDER is not set +# CONFIG_INPUT_IFORCE_USB is not set +# CONFIG_INPUT_IFORCE_232 is not set +# CONFIG_INPUT_WARRIOR is not set +# CONFIG_INPUT_MAGELLAN is not set +# CONFIG_INPUT_SPACEORB is not set +# CONFIG_INPUT_SPACEBALL is not set +# CONFIG_INPUT_STINGER is not set +# CONFIG_INPUT_DB9 is not set +# CONFIG_INPUT_GAMECON is not set +# CONFIG_INPUT_TURBOGRAFX is not set # CONFIG_QIC02_TAPE is not set # @@ -423,14 +561,22 @@ # CONFIG_PCWATCHDOG is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set -# CONFIG_60XX_WDT is not set -# CONFIG_MIXCOMWD is not set +# CONFIG_21285_WATCHDOG is not set +# CONFIG_977_WATCHDOG is not set +CONFIG_SA1100_WATCHDOG=y +# CONFIG_EUROTECH_WDT is not set +# CONFIG_IB700_WDT is not set # CONFIG_I810_TCO is not set +# CONFIG_MIXCOMWD is not set +# CONFIG_60XX_WDT is not set +# CONFIG_W83877F_WDT is not set # CONFIG_MACHZ_WDT is not set -CONFIG_SA1100_WATCHDOG=y +# CONFIG_INTEL_RNG is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set CONFIG_SA1100_RTC=y +CONFIG_SHANNON_IRKBD=y +CONFIG_SHANNON_WHEATIES=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -458,43 +604,77 @@ # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set # CONFIG_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_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set # CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=y CONFIG_JFFS2_FS_DEBUG=0 # CONFIG_CRAMFS is not set -# CONFIG_TMPFS is not set +CONFIG_TMPFS=y CONFIG_RAMFS=y # CONFIG_ISO9660_FS is not set -CONFIG_MINIX_FS=y -# CONFIG_VXFS_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_FREEVXFS_FS is not set # CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set -# CONFIG_EXT2_FS is not set +CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set # CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set # # Network File Systems # # CONFIG_CODA_FS is not set -# CONFIG_NFS_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=y +CONFIG_NFS_V3=y +# CONFIG_ROOT_NFS is not set # CONFIG_NFSD is not set -# CONFIG_SUNRPC is not set -# CONFIG_LOCKD is not set -# CONFIG_SMB_FS is not set +# CONFIG_NFSD_V3 is not set +CONFIG_SUNRPC=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=y +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" # CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set +# CONFIG_ZLIB_FS_INFLATE is not set # # Partition Types @@ -506,11 +686,53 @@ # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set # CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set -# CONFIG_SMB_NLS is not set -# CONFIG_NLS is not set +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_UTF8 is not set # # Console drivers @@ -523,9 +745,11 @@ # CONFIG_FB=y CONFIG_DUMMY_CONSOLE=y +# CONFIG_FB_ACORN is not set +# CONFIG_FB_ANAKIN is not set +# CONFIG_FB_CLPS711X is not set CONFIG_FB_SA1100=y -# CONFIG_SA1100_FRONTLIGHT is not set -# CONFIG_FB_E1355 is not set +# CONFIG_FB_CYBER2000 is not set # CONFIG_FB_VIRTUAL is not set # CONFIG_FBCON_ADVANCED is not set CONFIG_FBCON_CFB2=y @@ -540,12 +764,116 @@ # # Sound # -# CONFIG_SOUND is not set +CONFIG_SOUND=y +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +# CONFIG_SOUND_VIA82CXXX_PROCFS is not set +CONFIG_SOUND_SA1100=y +# CONFIG_SOUND_UDA1341 is not set +# CONFIG_SOUND_ASSABET_UDA1341 is not set +# CONFIG_SOUND_H3600_UDA1341 is not set +# CONFIG_SOUND_PANGOLIN_UDA1341 is not set +# CONFIG_SOUND_SA1111_UDA1341 is not set +# CONFIG_SOUND_SA1100SSP is not set +# CONFIG_SOUND_OSS is not set +# CONFIG_SOUND_WAVEARTIST is not set +# CONFIG_SOUND_TVMIXER is not set + +# +# Multimedia Capabilities Port drivers +# +CONFIG_MCP=y +CONFIG_MCP_SA1100=y +CONFIG_MCP_UCB1200=y +CONFIG_MCP_UCB1200_AUDIO=y +CONFIG_MCP_UCB1200_TS=y # # USB support # # CONFIG_USB is not set +# 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 +# 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_DPCM is not set +# CONFIG_USB_STORAGE_HP8200e is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_HID is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_AIPTEK is not set +# 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 +# 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 +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +# 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_IR 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_USA28XA is not set +# CONFIG_USB_SERIAL_KEYSPAN_USA28XB 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_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_ID75 is not set # # Bluetooth support @@ -559,5 +887,10 @@ CONFIG_DEBUG_ERRORS=y CONFIG_DEBUG_USER=y # CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_SLAB is not set CONFIG_MAGIC_SYSRQ=y +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_NO_PGT_CACHE is not set CONFIG_DEBUG_LL=y +# CONFIG_DEBUG_DC21285_PORT is not set +# CONFIG_DEBUG_CLPS711X_UART2 is not set diff -urN linux-tux2/drivers/char/newwheaties.c linux/drivers/char/newwheaties.c --- linux-tux2/drivers/char/newwheaties.c Wed Dec 31 18:00:00 1969 +++ linux/drivers/char/newwheaties.c Sat Nov 10 17:46:32 2001 @@ -0,0 +1,527 @@ +/* + * wheaties.c + * + * TuxScreen aka Shannon device driver for the Wheaties DSP aka Lucent DSP1650. + * + * $Id: wheaties.c,v 1.1.1.1 2001/11/10 22:08:57 spacecoaster Exp $ + * + * (C) Copyright 2001 Derek Mulcahy + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * Currently we delay 10ms after each message. Need to implement a write queue + * which will set a timer to ensure that messages are pumped out with the required + * spacing. This will remove the last serious delay (apart from the ~1sec in open). + * + * Currently we use a spin lock to protect everything, this is not nice and locks + * out all interrupts whilst we are reading/writing. The write queue will help. + * The serial ports are particularly unhappy with this situation and they say so! + * + * Search for Note: to find those areas which definitely need investigation. + * + */ + +/* Glossary: + * + * MCP - An 8 bit bus with DMA and FIFOs used to talk to the + * UCB1200. Mentioned here because it takes the pins from the SSP, + * which then defaults to using the pins we want for the SPI. + * Enabling and disabling the MCP/SSP happens in another driver + * and may impact this driver. You now understand why this driver + * has a glossary. + * + * SA-1100 - The StrongArm processor used in the TuxScreen, if you + * didn't know this then you probably don't want to read + * further. + * + * SPI - Serial Peripheral Interface, the serial interface connecting + * the SA-1100 with the Wheaties module, includes i/o, rts, cts and + * clock pins. Uses SA-1100 GPIO lines. The clock line is used to + * indicate when data is ready. When talking to the DSP we use the + * rts/cts lines to impose a message structure on the transers. + * + * SSP - SA-1100 serial bus which can use the same lines as we use for + * the SPI. This appears to be a real mans bus with hardware + * support. SPI is a bit twiddling nightmare. Don't confuse the two. + * Further investigation indicates that we need to use the SSP + * mode for some transfers. + * + * Wheaties - The name of the modules which includes the DSP1650 chip + * and other hardware. Provides GPIO lines connected to LEDs, + * keypad etc. Generates and recognizes audio tones on speaker, + * telephone line, handset. Also talks to the UCB1200 and can + * emulate a modem (in your dreams buddy). + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WHEATIES_MAJOR 60 /* need a proper allocation */ +#define WHEATIES_NAME "wheaties" + +#define SPI_NODEV 0 /* Fake Output device, disables repeated + device selection */ +#define SPI_FLASH GPIO_GPIO0 /* Output - Driven low, + enables SPI to flash */ +#define SPI_DSP GPIO_GPIO1 /* Output - Driven low, + enables SPI to DSP */ +#define SPI_OUTPUT GPIO_GPIO10 /* Output - SPI output to DSP */ +#define SPI_INPUT GPIO_GPIO11 /* Input - SPI input from DSP */ +#define SPI_CLOCK GPIO_GPIO12 /* Output - Clock for SPI */ +#define SPI_FRAME GPIO_GPIO13 /* Output - Frame marker - not used */ +#define SPI_RTS GPIO_GPIO14 /* Input - SPI Ready to Send */ +#define SPI_CTS GPIO_GPIO15 /* Output - SPI Clear to Send */ +#define DSP_RESET GPIO_GPIO17 /* Output - Drive low to reset + the DSP */ + +#define IRQ_RTS IRQ_GPIO14 + +#define SPI_ALT (SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME) + +/* + * we want to throw away old messages and a fixed size array which wraps around + * is the simplest way of doing this. The ancient kludge of storing the data in + * the pointer itself rather than allocating a tiny chunk is also used. If it + * was good enough for Dennis Ritchie it is good enough for us. + */ +#define MAX_MSGS 64 +#define MAX_MESSAGE_SIZE 1024 + +static struct msg { + int len; + int offset; + unsigned char *data; +} *msgs; +static int head; +static int tail; + +static spinlock_t lock = SPIN_LOCK_UNLOCKED; +static DECLARE_WAIT_QUEUE_HEAD(waitq); + +static int wheaties_open(struct inode * inode, struct file * filp); +static int wheaties_release(struct inode * inode, struct file * filp); +static ssize_t wheaties_read(struct file * , char * , size_t , loff_t * l); +static ssize_t wheaties_write(struct file *file, const char *buf, + size_t count, loff_t *ppos); +static unsigned int wheaties_poll(struct file *file, struct poll_table_struct *pts); +static int wheaties_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg); + +static struct file_operations wheaties_fops = { + open: wheaties_open, + release: wheaties_release, + read: wheaties_read, + write: wheaties_write, + poll: wheaties_poll, + ioctl: wheaties_ioctl, + owner: THIS_MODULE, +}; + +/* + * xfer_bits - write and read n bits - takes the bits from the top + * return the bits read - returns the bits at the bottom + * + * The SPI connection to the DSP is the meanest interface ever. It + * doesn't return a bit until we send it one. Nothin for nothin. How + * this impacts reading from DSP flash memory without simultaneously + * writing to it is for future investigation. + * + * To transfer a bit we set/clear the SPI_OUTPUT GPIO line, raise + * SPI_CLOCK, read the input bit from SPI_INPUT and lower + * SPI_CLOCK. The first bit is treated outside the loop, this is to + * improve performance. + */ +static unsigned int +xfer_bits(int device, unsigned int obits, int n) { + unsigned int ibits = 0; + + /* enable SPI connection to the device */ + if (device) + GPCR = device; + + /* set the first bit on the output line */ + if (obits & 0x80000000) + GPSR = SPI_OUTPUT; + else + GPCR = SPI_OUTPUT; + + for ( ; n > 0; n--) { + ibits <<= 1; + + udelay(1); + + GPSR = SPI_CLOCK; + if (GPLR & SPI_INPUT) + ibits |= 1; + + udelay(1); + + obits <<= 1; + if (obits & 0x80000000) + GPSR = SPI_OUTPUT; + else + GPCR = SPI_OUTPUT; + GPCR = SPI_CLOCK; + } + + /* disable SPI connection to the device */ + if (device) + GPSR = device; + + return ibits; +} + +static unsigned char xfer_byte(unsigned char obyte) { + return xfer_bits(SPI_DSP, obyte << 24, 8) & 0xff; +} + +/* + * write_message - write a multi byte message to the Wheaties module. + * + * Round em up and head em out. + */ +static void write_message(int count, unsigned char *msg) { + int i; + + for (i = 0; i < count; i++) { + xfer_byte(msg[i]); + udelay(100); + } +} + +/* + * read_byte - read a single byte from the Wheaties module. + * return 1 for success, 0 for failure. + * + * The xfer_byte command always requires a byte to transfer to the + * Wheaties, even when reading. Giving it 0 to transfer seems to keep + * it happy. + * + * The RTS bit is 0 when a byte is available on the SPI. This is + * checked first and 0 is returned if the RTS bit is set (no data). + * CTS is set to 1 to indicate that it is clear to send data. We loop + * waiting for Wheaties to set RTS to indicate the byte is available. + * After reading the byte we clear CTS and wait for RTS to clear. + * + * An additonal twist, for the last byte in a message RTS never + * clears, thus we hang around for a while, 500usecs, and then give + * up. So we exit this routine with RTS clear and that means more + * bytes in this message, or RTS set and that means we are done. It is + * not clear what would happen if the next message started within the + * 500 usec window. + */ +static int read_byte(unsigned char *data) { + int i; + + if (GPLR & SPI_RTS) { + return 0; + } + + /* assert CTS */ + GPSR = SPI_CTS; + + /* wait for RTS to set - need to break after 2ms */ + do { + } while ((GPLR & SPI_RTS) == 0); + *data = xfer_byte(0); + + udelay(100); + + /* clear CTS */ + GPCR = SPI_CTS; + + /* wait for RTS to clear, or 500usec */ + i = 0; + do { + i++; + udelay(1); + } while ((GPLR & SPI_RTS) && (i < 500)); + + return 1; +} + +/* + * read_message: read a message + * returns the number of bytes read. + */ +static int read_message(unsigned char *data, int limit) { + int i = 0; + + while((limit > 0) && read_byte(data + i)) { + i++; + limit--; + } + udelay(100); + return i; +} + +static void +dsp_reset(void) +{ + GPCR = DSP_RESET; + + /* the reset needs a pulse width of at least 150 us */ + udelay(200); + + GPSR = DSP_RESET; + + /* wait 800ms */ + sleep_on_timeout(&waitq, (800 * HZ) / 1000); +} + +static int +wheaties_open(struct inode * inode, struct file * filp) +{ + dsp_reset(); + return 0; +} + +static int +wheaties_release(struct inode * inode, struct file * filp) +{ + return 0; +} + +static ssize_t +wheaties_read(struct file * file, char * buf, size_t count, loff_t *ppos) +{ + struct msg *m; + void *p; + ssize_t result; + unsigned long flags; + + if (wait_event_interruptible(waitq, head != -1)) + return -ERESTARTSYS; + + spin_lock_irqsave(&lock, flags); + m = msgs + head; + if (m->len > sizeof(m->data)) { + p = m->data; + } else { + p = &m->data; + } + if (count > (m->len - m->offset)) { + count = m->len - m->offset; + } + /* Note: shouldn't hold spinlock while copying */ + if (copy_to_user(buf, p + m->offset, count)) { + result = -EFAULT; + goto out; + } + m->offset += count; + if (m->offset >= m->len) { + if (m->len > sizeof(m->data)) + kfree(m->data); + m->len = 0; + m->offset = 0; + head = (head + 1) % MAX_MSGS; + if (head == tail) { + head = -1; + tail = 0; + } + } + *ppos += count; + result = count; + + out: + spin_unlock_irqrestore(&lock, flags); + + return result; +} + +static ssize_t +wheaties_write(struct file *file, const char *buf, size_t count, loff_t *ppos) +{ + void *data; + ssize_t result = -ENOMEM; + unsigned long flags; + + data = kmalloc(count, GFP_KERNEL); + if (!data) + goto out; + if (copy_from_user(data,buf,count)) { + result = -EFAULT; + goto out; + } + spin_lock_irqsave(&lock, flags); + write_message(count, data); + spin_unlock_irqrestore(&lock, flags); + *ppos += count; + result = count; + + out: + if (data) + kfree(data); + return result; +} + +static unsigned int +wheaties_poll(struct file *file, struct poll_table_struct *pts) +{ + unsigned int mask = POLLOUT | POLLWRNORM; + + poll_wait(file, &waitq, pts); + if (head != -1) mask |= POLLIN | POLLRDNORM; + return mask; +} + +static int wheaties_ioctl(struct inode *inode, struct file * file, + unsigned int cmd, unsigned long arg) +{ + int result = 0; + + switch (cmd) { + case WHEATIES_IOC_RESET: + dsp_reset(); + break; + } + return result; +} + +static void +rts_handler(int irq, void *dev_id, struct pt_regs *regs) +{ + /* Note: kernel stack is pretty small - should allocate this */ + unsigned char data[MAX_MESSAGE_SIZE]; + struct msg *m; + void *p; + int n; + unsigned long flags; + + spin_lock_irqsave(&lock, flags); + while((n = read_message(data, sizeof(data)))) { + if (head == tail || head == -1) { + head = (head + 1) % MAX_MSGS; + } + m = msgs + tail; + if (m->len > sizeof(m->data)) + kfree(m->data); + /* Note: need to handle out of memory */ + if (n > sizeof(m->data)) { + m->data = kmalloc(n, GFP_ATOMIC); + p = m->data; + } else { + p = &m->data; + } + m->len = n; + m->offset = 0; + memcpy(p, data, n); + tail = (tail + 1) % MAX_MSGS; + } + spin_unlock_irqrestore(&lock, flags); + wake_up_interruptible(&waitq); +} + +/* + * init_spi - configure the GPIO lines and SA-1100 registers for the SPI. + */ +static void +init_spi(void) +{ + /* configure alternative function mode for SPI */ + /* Note: we don't initialise SPI_RTS, but it's an input so who cares */ + /* Note: we DO initialise SPI_INPUT, which is also an input, weird */ + /* Note: SPI_RTS and SPI_CTS in GAFR should not need to be + cleared, someone else is setting them in another driver. */ + GAFR &= ~(SPI_RTS | SPI_CTS | SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME); + GPCR = SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME; + GPSR = SPI_FLASH | SPI_DSP; + GPCR = SPI_CTS; + + /* set GPIO inputs and outputs for SPI */ + GPDR |= SPI_FLASH; + GPDR |= SPI_DSP; + GPDR |= SPI_OUTPUT; + GPDR &= ~SPI_INPUT; + GPDR |= SPI_CLOCK; + GPDR |= SPI_FRAME; + GPDR &= ~SPI_RTS; + GPDR |= SPI_CTS; + GPDR |= DSP_RESET; + + /* RTS generates falling edge interrupts when it transitions from 1 to 0 */ + GFER |= SPI_RTS; + + /* + * Enable SSP on alternate function pins, SSP is still not really + * enabled until we set SCE in the Ser4MCCR0 register, but this + * allows us to use it when required. + * Note: that this accidentally clears UPR but may not be an issue. + */ + PPAR = PPAR_SPR; + + /* Clear the SSP control registers */ + Ser4SSCR0 = 0; + Ser4SSCR1 = 0; +} + +int __init +wheaties_init(void) +{ + int result; + + result = register_chrdev(WHEATIES_MAJOR, WHEATIES_NAME, &wheaties_fops); + if (result) { + printk("Can't get major device %d for " WHEATIES_NAME " - result=%d.\n", + WHEATIES_MAJOR, result); + goto fail_chrdev; + } + + init_spi(); + + set_GPIO_IRQ_edge(SPI_RTS, GPIO_FALLING_EDGE); + result = request_irq(IRQ_RTS, rts_handler, SA_SHIRQ, WHEATIES_NAME, rts_handler); + if (result) { + printk("Can't get IRQ for " WHEATIES_NAME " RTS line - result=%d.\n", result); + goto fail_irq; + } + + if (!msgs) { + msgs = kmalloc(sizeof(struct msg) * MAX_MSGS, GFP_KERNEL); + if (!msgs) { + printk("Can't allocate memory for msgs in " WHEATIES_NAME "\n"); + result = -ENOMEM; + goto fail_msgs; + } + memset(msgs, 0, sizeof(struct msg) * MAX_MSGS); + head = -1; + tail = 0; + } + + return result; + + fail_msgs: + free_irq(IRQ_RTS, rts_handler); + fail_irq: + unregister_chrdev(WHEATIES_MAJOR, WHEATIES_NAME); + fail_chrdev: + return result; +} + +void __exit +wheaties_cleanup(void) +{ + if (msgs) { + kfree(msgs); + msgs = 0; + } + free_irq(IRQ_RTS, rts_handler); + unregister_chrdev(WHEATIES_MAJOR, WHEATIES_NAME); +} + +module_init(wheaties_init); +module_exit(wheaties_cleanup); diff -urN linux-tux2/drivers/char/wheaties.c linux/drivers/char/wheaties.c --- linux-tux2/drivers/char/wheaties.c Wed Nov 14 04:34:45 2001 +++ linux/drivers/char/wheaties.c Sun Nov 11 18:57:38 2001 @@ -3,6 +3,15 @@ * * TuxScreen aka Shannon device driver for the Wheaties DSP aka Lucent DSP1650. * + * $Id: wheaties.c,v 1.15 2001/10/22 01:34:15 derek Exp $ + * + * (C) Copyright 2001 Derek Mulcahy + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * * Currently we delay 10ms after each message. Need to implement a write queue * which will set a timer to ensure that messages are pumped out with the required * spacing. This will remove the last serious delay (apart from the ~1sec in open). @@ -13,7 +22,7 @@ * * Search for Note: to find those areas which definitely need investigation. * - * $Id: wheaties.c,v 1.1.4.1 2001/11/06 06:31:43 russ Exp $ */ + */ /* Glossary: * @@ -31,8 +40,8 @@ * SPI - Serial Peripheral Interface, the serial interface connecting * the SA-1100 with the Wheaties module, includes i/o, rts, cts and * clock pins. Uses SA-1100 GPIO lines. The clock line is used to - * indicate when data is ready. When talking to the DSP we use the - * rts/cts lines to impose a message structure on the transers. + * indicate when data is ready. When talking to the DSP we use the + * rts/cts lines to impose a message structure on the transfer. * * SSP - SA-1100 serial bus which can use the same lines as we use for * the SPI. This appears to be a real mans bus with hardware @@ -49,7 +58,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,11 +70,8 @@ #include #include -#undef CONFIG_PROC_FS - -#define WHEATIES_MAJOR 60 /* need a proper allocation */ +#define WHEATIES_MAJOR 60 /* need a proper allocation, or use devfs? */ #define WHEATIES_NAME "wheaties" - #define SPI_NODEV 0 /* Fake Output device, disables repeated device selection */ #define SPI_FLASH GPIO_GPIO0 /* Output - Driven low, @@ -73,7 +79,7 @@ #define SPI_DSP GPIO_GPIO1 /* Output - Driven low, enables SPI to DSP */ #define SPI_OUTPUT GPIO_GPIO10 /* Output - SPI output to DSP */ -#define SPI_INPUT GPIO_GPIO11 /* Input - SPI input from DSP */ +#define SPI_INPUT GPIO_GPIO11 /* Input - SPI input fro DSP */ #define SPI_CLOCK GPIO_GPIO12 /* Output - Clock for SPI */ #define SPI_FRAME GPIO_GPIO13 /* Output - Frame marker - not used */ #define SPI_RTS GPIO_GPIO14 /* Input - SPI Ready to Send */ @@ -83,7 +89,7 @@ #define IRQ_RTS IRQ_GPIO14 -#define SPI_ALT (SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME) +#define SPI_ALT (SPI_OUTPUT | SPI_INPUT | SPI_SCLK | SPI_SFRM) /* * we want to throw away old messages and a fixed size array which wraps around @@ -105,10 +111,6 @@ static spinlock_t lock = SPIN_LOCK_UNLOCKED; static DECLARE_WAIT_QUEUE_HEAD(waitq); -#ifdef CONFIG_PROC_FS -static struct proc_dir_entry *proc_wheaties; -#endif - static int wheaties_open(struct inode * inode, struct file * filp); static int wheaties_release(struct inode * inode, struct file * filp); static ssize_t wheaties_read(struct file * , char * , size_t , loff_t * l); @@ -129,8 +131,8 @@ }; /* - * xfer_bits - write and read n bits - takes the bits from the top - * return the bits read - returns the bits at the bottom + * xfer_byte - write and read a byte + * return the character read * * The SPI connection to the DSP is the meanest interface ever. It * doesn't return a bit until we send it one. Nothin for nothin. How @@ -142,48 +144,43 @@ * SPI_CLOCK. The first bit is treated outside the loop, this is to * improve performance. */ -static unsigned int -xfer_bits(int device, unsigned int obits, int n) { - unsigned int ibits = 0; +static unsigned char xfer_byte(unsigned char obyte) { + unsigned char ibyte = 0; + int i; + int t; - /* enable SPI connection to the device */ - if (device) - GPCR = device; + /* enable SPI connection to the DSP */ + GPCR = SPI_DSP; - /* set the first bit on the output line */ - if (obits & 0x80000000) + if (obyte & 0x80) GPSR = SPI_OUTPUT; else GPCR = SPI_OUTPUT; - for ( ; n > 0; n--) { - ibits <<= 1; - - udelay(1); + t = 1; + for (i = 8; i > 0; i--) { + ibyte <<= 1; + udelay(t); + t = 5; GPSR = SPI_CLOCK; if (GPLR & SPI_INPUT) - ibits |= 1; + ibyte |= 1; - udelay(1); + udelay(t); - obits <<= 1; - if (obits & 0x80000000) + obyte <<= 1; + if (obyte & 0x80) GPSR = SPI_OUTPUT; else GPCR = SPI_OUTPUT; GPCR = SPI_CLOCK; } - /* disable SPI connection to the device */ - if (device) - GPSR = device; - - return ibits; -} + /* enable SPI connection to the DSP */ + GPSR = SPI_DSP; -static unsigned char xfer_byte(unsigned char obyte) { - return xfer_bits(SPI_DSP, obyte << 24, 8) & 0xff; + return ibyte; } /* @@ -198,6 +195,8 @@ xfer_byte(msg[i]); udelay(100); } + /* not happy with this delay, 10ms after each message :-) */ + udelay(10 * 1000); } /* @@ -236,7 +235,7 @@ } while ((GPLR & SPI_RTS) == 0); *data = xfer_byte(0); - udelay(100); + udelay(200); /* clear CTS */ GPCR = SPI_CTS; @@ -265,42 +264,11 @@ return i; } -#ifdef CONFIG_PROC_FS -static int wheaties_sa1100_read_proc(char *buf, char **start, off_t offset, int len) -{ - char *p = buf; - - /* Only put registers here which will not alter the state SA-1100 */ - p += sprintf(p, "GPDR: 0x%08x\n", GPDR); - p += sprintf(p, "GPSR: 0x%08x\n", GPSR); - p += sprintf(p, "GPCR: 0x%08x\n", GPCR); - p += sprintf(p, "GAFR: 0x%08x\n", GAFR); - p += sprintf(p, "GPLR: 0x%08x\n", GPLR); - p += sprintf(p, "GRER: 0x%08x\n", GRER); - p += sprintf(p, "GFER: 0x%08x\n", GFER); - p += sprintf(p, "GEDR: 0x%08x\n", GEDR); - p += sprintf(p, "PPAR: 0x%08x\n", PPAR); - p += sprintf(p, "ICMR: 0x%08x\n", ICMR); - p += sprintf(p, "ICCR: 0x%08x\n", ICCR); - p += sprintf(p, "ICLR: 0x%08x\n", ICLR); - p += sprintf(p, "Ser4MCCR0: 0x%08x\n", Ser4MCCR0); - p += sprintf(p, "Ser4MCCR1: 0x%08x\n", Ser4MCCR1); - p += sprintf(p, "Ser4MCSR: 0x%08x\n", Ser4MCSR); - p += sprintf(p, "Ser4SSCR0: 0x%08x\n", Ser4SSCR0); - p += sprintf(p, "Ser4SSCR1: 0x%08x\n", Ser4SSCR1); - - return p - buf; -} -#endif - -static void -dsp_reset(void) +static void dsp_reset() { GPCR = DSP_RESET; - - /* the reset needs a pulse width of at least 150 us */ + /* the reset needs a pulse width of at least 150us */ udelay(200); - GPSR = DSP_RESET; /* wait 800ms */ @@ -328,7 +296,7 @@ ssize_t result; unsigned long flags; - if (wait_event_interruptible(waitq, head != -1)) + if( wait_event_interruptible(waitq, head != -1)) return -ERESTARTSYS; spin_lock_irqsave(&lock, flags); @@ -406,14 +374,12 @@ static int wheaties_ioctl(struct inode *inode, struct file * file, unsigned int cmd, unsigned long arg) { - int result = 0; - switch (cmd) { case WHEATIES_IOC_RESET: dsp_reset(); break; } - return result; + return 0; } static void @@ -434,7 +400,7 @@ m = msgs + tail; if (m->len > sizeof(m->data)) kfree(m->data); - /* Note: need to handle out of memory */ + /* Note: need to handle out of memory */ if (n > sizeof(m->data)) { m->data = kmalloc(n, GFP_ATOMIC); p = m->data; @@ -498,45 +464,42 @@ { int result; - printk(__FUNCTION__ ": $Revision: 1.1.4.1 $\n"); - result = register_chrdev(WHEATIES_MAJOR, WHEATIES_NAME, &wheaties_fops); if (result) { printk("Can't get major device %d for " WHEATIES_NAME " - result=%d.\n", WHEATIES_MAJOR, result); - goto out; + goto fail_chrdev; } -#ifdef CONFIG_PROC_FS - proc_wheaties = proc_mkdir("driver/" WHEATIES_NAME, NULL); - proc_wheaties->owner = THIS_MODULE; - create_proc_info_entry("sa1100", 0, proc_wheaties, wheaties_sa1100_read_proc); -#endif - + /* init_waitqueue_head(&waitq); */ init_spi(); set_GPIO_IRQ_edge(SPI_RTS, GPIO_FALLING_EDGE); result = request_irq(IRQ_RTS, rts_handler, SA_SHIRQ, WHEATIES_NAME, rts_handler); if (result) { - printk("Can't get IRQ for " WHEATIES_NAME " RTS line - result=%d.\n", - result); - /* Note: tidy up, unregister_chrdev(), etc. */ - goto out; + printk("Can't get IRQ for " WHEATIES_NAME " RTS line - result=%d.\n", result); + goto fail_irq; } if (!msgs) { msgs = kmalloc(sizeof(struct msg) * MAX_MSGS, GFP_KERNEL); + if (!msgs) { + printk("Can't allocate memory for msgs in " WHEATIES_NAME "\n"); + result = -ENOMEM; + goto fail_msgs; + } memset(msgs, 0, sizeof(struct msg) * MAX_MSGS); head = -1; tail = 0; } - if (msgs == 0) { - // Note: cleanup other stuff - result = -ENOMEM; - goto out; - } - out: + return result; + +fail_msgs: + free_irq(IRQ_RTS, rts_handler); +fail_irq: + unregister_chrdev(WHEATIES_MAJOR, WHEATIES_NAME); +fail_chrdev: return result; } @@ -547,233 +510,9 @@ kfree(msgs); msgs = 0; } -#ifdef CONFIG_PROC_FS - remove_proc_entry("sa1100", proc_wheaties); - remove_proc_entry("driver/" WHEATIES_NAME, NULL); -#endif - free_irq(SPI_RTS, rts_handler); + free_irq(IRQ_RTS, rts_handler); unregister_chrdev(WHEATIES_MAJOR, WHEATIES_NAME); } module_init(wheaties_init); module_exit(wheaties_cleanup); - -#include - -static struct mtd_info *mtd; - -static void -read_page(int page, unsigned char *data, int len) { - int sssr; - unsigned long flags; - int j = 0; - int i = 0; - - GPCR = SPI_FLASH; - /* Delay 250ns between enable flash and clock */ - - spin_lock_irqsave(&lock, flags); - xfer_bits(SPI_NODEV, (0x52 << 24) | (page << 9) | 0x00, 32); - xfer_bits(SPI_NODEV, 0, 32 + 1); - - Ser4SSCR0 = (2 << 8) | SSCR0_SSE | SSCR0_Motorola | SSCR0_DataSize(8); - - /* unconfigure alternate function mode for GPIO pins */ - GAFR |= SPI_ALT; - - while (1) { - sssr = Ser4SSSR; - if (sssr & SSSR_RNE) { - data[j] = Ser4SSDR; - if (++j >= len) - break; - } - if ((i < len) && (sssr & SSSR_TNF)) { - Ser4SSDR = 0; - i++; - } - } - spin_unlock_irqrestore(&lock, flags); - - Ser4SSCR0 = 0; - - /* unconfigure alternate function mode for GPIO pins */ - GAFR &= ~SPI_ALT; - - GPSR = SPI_FLASH; - /* Delay 250ns between disable and enable of flash */ - udelay(1); -} - -static void -flash_wait(void) -{ - GPCR = SPI_FLASH; - - xfer_bits(SPI_NODEV, 0x57<<24, 9); - - while (!(GPLR & SPI_INPUT)) { - mdelay(1); - } - - GPSR = SPI_FLASH; - - /* Delay for Tcs - 250ns between disable and enable of flash */ - udelay(1); -} - -static void -write_page(int page, const unsigned char *data, int len) { - int sssr; - int ssdr; - unsigned long flags; - int j = 0; - int i = 0; - - flash_wait(); - - GPCR = SPI_FLASH; - - spin_lock_irqsave(&lock, flags); - xfer_bits(SPI_NODEV, (0x82 << 24) | (page << 9) | 0x00, 32); - - Ser4SSCR0 = (2 << 8) | SSCR0_SSE | SSCR0_Motorola | SSCR0_DataSize(8); - - /* unconfigure alternate function mode for GPIO pins */ - GAFR |= SPI_ALT; - - while (1) { - sssr = Ser4SSSR; - if (sssr & SSSR_TNF) { - Ser4SSDR = data[j] << 8; - if (++j >= len) - break; - } - if ((i < len) && (sssr & SSSR_RNE)) { - ssdr = Ser4SSDR; - i++; - } - } - spin_unlock_irqrestore(&lock, flags); - - Ser4SSCR0 = 0; - - /* unconfigure alternate function mode for GPIO pins */ - GAFR &= ~SPI_ALT; - - GPSR = SPI_FLASH; - - /* Delay for Tcs - 250ns between disable and enable of flash */ - udelay(1); -} - -/* struct erase_info { */ -/* struct mtd_info *mtd; */ -/* u_int32_t addr; */ -/* u_int32_t len; */ -/* u_long time; */ -/* u_long retries; */ -/* u_int dev; */ -/* u_int cell; */ -/* void (*callback) (struct erase_info *self); */ -/* u_long priv; */ -/* u_char state; */ -/* struct erase_info *next; */ -/* }; */ - -static int -serial_erase(struct mtd_info *mtd, struct erase_info *instr) -{ -#ifdef VERBOSE - printk(__FUNCTION__ " addr=%d len=%d next=%p\n", - instr->addr, instr->len, instr->next); -#endif - return 0; -} - -static int -serial_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, - unsigned char *buf) -{ - int i; - unsigned char data[264]; - -#ifdef VERBOSE - printk(__FUNCTION__ " from=%d len=%d buf=%p\n", (int)from, len, buf); -#endif - - for (i = 0; i < len; i += 256) { - read_page((from + i) / 256, data, 264); - memcpy(buf + i, data, 256); - } - *retlen = len; - return 0; -} - -static int -serial_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, - const unsigned char *buf) -{ - int i; - unsigned char data[264]; - -#ifdef VERBOSE - printk(__FUNCTION__ " to=%d len=%d buf=%p\n", (int)to, len, buf); -#endif - - memset(data, 0, sizeof(data)); - - for (i = 0; i < len; i += 256) { - memcpy(data, buf + i, 256); - write_page((to + i) / 256, data, 264); - } - *retlen = len; - return 0; -} - -static void serial_sync (struct mtd_info *mtd) -{ -#ifdef VERBOSE - printk(__FUNCTION__ "\n"); -#endif -} - -int -serial_flash_setup(void) -{ - int result = 0; - - mtd = kmalloc(sizeof(*mtd), GFP_KERNEL); - if (mtd == 0) { - result = -ENOMEM; - goto out; - } - memset(mtd, 0, sizeof(*mtd)); - mtd->name = "atmel"; - mtd->type = MTD_NORFLASH; - mtd->flags = MTD_CAP_NORFLASH; - mtd->size = 256 * 2048; - mtd->read = serial_read; - mtd->write = serial_write; - mtd->sync = serial_sync; - mtd->erase = serial_erase; - mtd->erasesize = 8192; - - add_mtd_device(mtd); - - out: - return result; -} - -void -serial_flash_cleanup(void) -{ - if (mtd) { - del_mtd_device(mtd); - kfree(mtd); - mtd = 0; - } -} - -EXPORT_SYMBOL(serial_flash_setup); -EXPORT_SYMBOL(serial_flash_cleanup); diff -urN linux-tux2/drivers/char/wheaties.h linux/drivers/char/wheaties.h --- linux-tux2/drivers/char/wheaties.h Wed Dec 31 18:00:00 1969 +++ linux/drivers/char/wheaties.h Sat Nov 10 16:19:20 2001 @@ -0,0 +1,21 @@ +#define WHEATIES_MAJOR 60 /* need a proper allocation */ +#define WHEATIES_NAME "wheaties" + +#define SPI_NODEV 0 /* Fake Output device, disables repeated + device selection */ +#define SPI_FLASH GPIO_GPIO0 /* Output - Driven low, + enables SPI to flash */ +#define SPI_DSP GPIO_GPIO1 /* Output - Driven low, + enables SPI to DSP */ +#define SPI_OUTPUT GPIO_GPIO10 /* Output - SPI output to DSP */ +#define SPI_INPUT GPIO_GPIO11 /* Input - SPI input from DSP */ +#define SPI_CLOCK GPIO_GPIO12 /* Output - Clock for SPI */ +#define SPI_FRAME GPIO_GPIO13 /* Output - Frame marker - not used */ +#define SPI_RTS GPIO_GPIO14 /* Input - SPI Ready to Send */ +#define SPI_CTS GPIO_GPIO15 /* Output - SPI Clear to Send */ +#define DSP_RESET GPIO_GPIO17 /* Output - Drive low to reset + the DSP */ + +#define IRQ_RTS IRQ_GPIO14 + +#define SPI_ALT (SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME) diff -urN linux-tux2/drivers/misc/mcp-core.c linux/drivers/misc/mcp-core.c --- linux-tux2/drivers/misc/mcp-core.c Wed Nov 14 04:34:16 2001 +++ linux/drivers/misc/mcp-core.c Thu Nov 8 13:33:51 2001 @@ -135,6 +135,7 @@ return 0; } +EXPORT_SYMBOL(mcp_get); EXPORT_SYMBOL(mcp_set_telecom_divisor); EXPORT_SYMBOL(mcp_set_audio_divisor); EXPORT_SYMBOL(mcp_reg_write); diff -urN linux-tux2/drivers/misc/mcp-sa1100.c linux/drivers/misc/mcp-sa1100.c --- linux-tux2/drivers/misc/mcp-sa1100.c Wed Nov 14 04:34:16 2001 +++ linux/drivers/misc/mcp-sa1100.c Tue Nov 13 02:26:35 2001 @@ -95,7 +95,7 @@ machine_is_freebird() || machine_is_graphicsclient() || machine_is_graphicsmaster() || machine_is_lart() || machine_is_pfs168() || machine_is_simpad() || - machine_is_yopy()) { + machine_is_yopy() || machine_is_shannon() ) { /* * Setup the PPC unit correctly. */ diff -urN linux-tux2/drivers/misc/ucb1x00-audio.c linux/drivers/misc/ucb1x00-audio.c --- linux-tux2/drivers/misc/ucb1x00-audio.c Wed Nov 14 04:34:16 2001 +++ linux/drivers/misc/ucb1x00-audio.c Wed Nov 14 04:28:53 2001 @@ -54,7 +54,7 @@ ucb1x00_reg_write(ucba->ucb, UCB_TC_B, 0); ucb1x00_set_telecom_divisor(ucba->ucb, div * 32); ucb1x00_reg_write(ucba->ucb, UCB_TC_A, div); - ucb1x00_reg_write(ucba->ucb, UCB_TC_B, UCB_AC_B_IN_ENA|UCB_AC_B_OUT_ENA); + ucb1x00_reg_write(ucba->ucb, UCB_TC_B, UCB_TC_B_IN_ENA|UCB_TC_B_OUT_ENA); } else { ucb1x00_reg_write(ucba->ucb, UCB_AC_B, 0); ucb1x00_set_audio_divisor(ucba->ucb, div * 32); @@ -211,6 +213,7 @@ ucb1x00_disable(ucb); #endif + a->telecom = 1; a->state.input_dma = ucb->mcp->dma_telco_rd; a->state.input_id = "UCB1x00 telco in"; a->state.output_dma = ucb->mcp->dma_telco_wr; diff -urN linux-tux2/drivers/misc/ucb1x00-core.c linux/drivers/misc/ucb1x00-core.c --- linux-tux2/drivers/misc/ucb1x00-core.c Wed Nov 14 04:34:45 2001 +++ linux/drivers/misc/ucb1x00-core.c Wed Nov 14 04:27:56 2001 @@ -412,7 +413,7 @@ } #endif #ifdef CONFIG_SA1100_SHANNON - else if (machine_is_shannon()) { + if (machine_is_shannon()) { ucb->irq = IRQ_GPIO_IRQ_CODEC; irq_gpio_pin = GPIO_IRQ_CODEC; } @@ -465,31 +466,34 @@ printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id); goto out; } - + my_ucb = kmalloc(sizeof(struct ucb1x00), GFP_KERNEL); ret = -ENOMEM; if (!my_ucb) goto out; - memset(my_ucb, 0, sizeof(struct ucb1x00)); - - spin_lock_init(&my_ucb->lock); - spin_lock_init(&my_ucb->io_lock); - sema_init(&my_ucb->adc_sem, 1); - - my_ucb->id = id; - my_ucb->mcp = mcp; - #ifdef CONFIG_SA1100_SHANNON if (machine_is_shannon()) { + /* reset the codec */ GPDR |= GPIO_CODEC_RESET; GPCR = GPIO_CODEC_RESET; GPSR = GPIO_CODEC_RESET; + udelay(100); } #endif + + memset(my_ucb, 0, sizeof(struct ucb1x00)); + + spin_lock_init(&my_ucb->lock); + spin_lock_init(&my_ucb->io_lock); + sema_init(&my_ucb->adc_sem, 1); + + my_ucb->id = id; + my_ucb->mcp = mcp; + ucb1x00_reg_write(my_ucb, UCB_IE_RIS, 0); ucb1x00_reg_write(my_ucb, UCB_IE_FAL, 0); ucb1x00_reg_write(my_ucb, UCB_IE_CLEAR, 0xffff); diff -urN linux-tux2/drivers/misc/ucb1x00-ts.c linux/drivers/misc/ucb1x00-ts.c --- linux-tux2/drivers/misc/ucb1x00-ts.c Wed Nov 14 04:34:45 2001 +++ linux/drivers/misc/ucb1x00-ts.c Wed Nov 14 04:25:58 2001 @@ -35,7 +35,7 @@ struct bl_settings bl_shannon = { max_brightness: 7, max_contrast: 0x3f, - brightness: 2, + brightness: 5, contrast: 0x1F }; #endif @@ -159,7 +159,7 @@ } /* - * Switch to X position reading + * Switch to Y position reading */ static inline void ucb1x00_ts_mode_ypos(struct ucb1x00_ts *ts) { @@ -256,7 +256,7 @@ spin_unlock_irq(&tsk->sigmask_lock); add_wait_queue(&ts->irq_wait, &wait); - + ucb1x00_adc_enable(ts->ucb); ucb1x00_ts_mode_xres(ts); ts->x_res = ucb1x00_adc_read(ts->ucb, 0, UCB_NOSYNC); @@ -294,7 +294,7 @@ schedule_timeout(interval); /* - * We got an IRQ, which work us up. Process the touchscreen. + * We got an IRQ, which woke us up. Process the touchscreen. */ ucb1x00_ts_event(ts, interval == MAX_SCHEDULE_TIMEOUT); } @@ -415,11 +415,13 @@ int ret; if (backlight) { + ucb1x00_enable(ts->ucb); backlight_init(); backlight_contrast(backlight->contrast); backlight_brightness(backlight->brightness); backlight->power = 1; backlight_power(1); + ucb1x00_disable(ts->ucb); } /* diff -urN linux-tux2/drivers/mtd/devices/Config.in linux/drivers/mtd/devices/Config.in --- linux-tux2/drivers/mtd/devices/Config.in Thu Oct 4 17:13:18 2001 +++ linux/drivers/mtd/devices/Config.in Wed Nov 14 04:45:28 2001 @@ -23,6 +23,9 @@ fi fi dep_tristate ' MTD emulation using block device' CONFIG_MTD_BLKMTD $CONFIG_MTD +if [ "$CONFIG_SA1100_SHANNON" = "y" ]; then + dep_tristate ' Shannon Atmel Serial FlashSupport' CONFIG_MTD_SHANNON_SERIALFLASH $CONFIG_MTD +fi comment 'Disk-On-Chip Device Drivers' dep_tristate ' M-Systems Disk-On-Chip 1000' CONFIG_MTD_DOC1000 $CONFIG_MTD diff -urN linux-tux2/drivers/mtd/devices/Makefile linux/drivers/mtd/devices/Makefile --- linux-tux2/drivers/mtd/devices/Makefile Thu Oct 4 17:13:18 2001 +++ linux/drivers/mtd/devices/Makefile Wed Nov 14 04:46:51 2001 @@ -5,6 +5,8 @@ O_TARGET := devlink.o +export-objs := spi.o + # *** BIG UGLY NOTE *** # # The removal of get_module_symbol() and replacement with @@ -20,6 +22,7 @@ obj-$(CONFIG_MTD_PMC551) += pmc551.o obj-$(CONFIG_MTD_MTDRAM) += mtdram.o obj-$(CONFIG_MTD_LART) += lart.o +obj-$(CONFIG_MTD_SHANNON_SERIALFLASH) += spi.o serial_flash.o obj-$(CONFIG_MTD_BLKMTD) += blkmtd.o include $(TOPDIR)/Rules.make diff -urN linux-tux2/drivers/mtd/devices/serial_flash.c linux/drivers/mtd/devices/serial_flash.c --- linux-tux2/drivers/mtd/devices/serial_flash.c Wed Dec 31 18:00:00 1969 +++ linux/drivers/mtd/devices/serial_flash.c Wed Nov 14 05:07:07 2001 @@ -0,0 +1,310 @@ +/* + * serial_flash.c + * + * MTD style driver for Atmel Serial Flash on TuxScreen + * + * $Id: serial_flash.c,v 1.5 2001/11/13 18:08:12 spacecoaster Exp $ + * + * (C) Copyright 2001 Derek Mulcahy + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * $Id: serial_flash.c,v 1.5 2001/11/13 18:08:12 spacecoaster Exp $ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "spi.h" + +/*#define VERBOSE*/ + +static struct mtd_info *mtd; + +static void +flash_wait(void) +{ + GPCR = SPI_FLASH; + + spi_xfer_bits(SPI_NODEV, 0x57<<24, 9); + + /* loops about 14000 times (17ms) - should be replaced with something better */ + while (!(GPLR & SPI_INPUT)) { + udelay(1); + } + + GPSR = SPI_FLASH; + + /* Delay for Tcs - 250ns between disable and enable of flash */ + udelay(1); +} + +static void +read_page(int page, unsigned char *data, int len) { + int sssr; + unsigned long flags; + int j = 0; + int i = 0; + + flash_wait(); + + GPCR = SPI_FLASH; + /* Delay 250ns between enable flash and clock */ + + spin_lock_irqsave(&spi_lock, flags); + spi_xfer_bits(SPI_NODEV, (0x52 << 24) | (page << 9) | 0x00, 32); + spi_xfer_bits(SPI_NODEV, 0, 32 + 1); + + Ser4SSCR0 = (0 << 8) | SSCR0_SSE | SSCR0_Motorola | SSCR0_DataSize(8); + + /* configure alternate function mode for GPIO pins */ + GAFR |= SPI_ALT; + + while (1) { + sssr = Ser4SSSR; + if (sssr & SSSR_RNE) { + data[j] = Ser4SSDR; + if (++j >= len) + break; + } + if ((i < len) && (sssr & SSSR_TNF)) { + Ser4SSDR = 0; + i++; + } + } + spin_unlock_irqrestore(&spi_lock, flags); + + Ser4SSCR0 = 0; + + /* unconfigure alternate function mode for GPIO pins */ + GAFR &= ~SPI_ALT; + + GPSR = SPI_FLASH; + /* Delay 250ns between disable and enable of flash */ + udelay(1); +} + +#if 0 +/* neither of the erase routines work - they don't set the busy bit */ + +static void +erase_page(int page) { + flash_wait(); + + spi_xfer_bits(SPI_FLASH, (0x81 << 24) | (page << 9) | 0x00, 32); + + /* Delay for Tcs - 250ns between disable and enable of flash */ + udelay(1); +} + +static void +erase_block(int block) { + flash_wait(); + + spi_xfer_bits(SPI_FLASH, (0x50 << 24) | (block << 12) | 0x00, 32); + + /* Delay for Tcs - 250ns between disable and enable of flash */ + udelay(1); +} +#endif + +static void +write_page(int page, const unsigned char *data, int len) { + int sssr; + int ssdr; + unsigned long flags; + int j = 0; + int i = 0; + + flash_wait(); + + GPCR = SPI_FLASH; + + spin_lock_irqsave(&spi_lock, flags); + spi_xfer_bits(SPI_NODEV, (0x82 << 24) | (page << 9) | 0x00, 32); + + Ser4SSCR0 = (0 << 8) | SSCR0_SSE | SSCR0_Motorola | SSCR0_DataSize(8); + + /* configure alternate function mode for GPIO pins */ + GAFR |= SPI_ALT; + + while (1) { + sssr = Ser4SSSR; + if ((j < len) && (sssr & SSSR_TNF)) { + Ser4SSDR = data[j++] << 8; + } + if ((i < len) && (sssr & SSSR_RNE)) { + ssdr = Ser4SSDR; + i++; + } + /* + * Break when all the data sent has been received, this ensures + * that the data in the fifo has been flushed out. + */ + if ((j >= len) && (i >= len)) + break; + } + spin_unlock_irqrestore(&spi_lock, flags); + + Ser4SSCR0 = 0; + + /* unconfigure alternate function mode for GPIO pins */ + GAFR &= ~SPI_ALT; + + GPSR = SPI_FLASH; + + /* Delay for Tcs - 250ns between disable and enable of flash */ + udelay(1); +} + +/* struct erase_info { */ +/* struct mtd_info *mtd; */ +/* u_int32_t addr; */ +/* u_int32_t len; */ +/* u_long time; */ +/* u_long retries; */ +/* u_int dev; */ +/* u_int cell; */ +/* void (*callback) (struct erase_info *self); */ +/* u_long priv; */ +/* u_char state; */ +/* struct erase_info *next; */ +/* }; */ + +static int +serial_erase(struct mtd_info *mtd, struct erase_info *instr) +{ + int i; + unsigned char data[264]; + +#ifdef VERBOSE + printk(__FUNCTION__ " addr=%08x len=%08x\n", instr->addr, instr->len); +#endif + + memset(data, 0xff, sizeof(data)); + + for (i = 0; i < instr->len; i += 256) { + write_page((instr->addr + i) / 256, data, 264); + } + instr->state = MTD_ERASE_DONE; + if (instr->callback) + (*(instr->callback))(instr); + return 0; +} + +static int +serial_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, + unsigned char *buf) +{ + int i; + unsigned char data[264]; + +#ifdef VERBOSE + printk(__FUNCTION__ " from=%d len=%d buf=%p\n", (int)from, len, buf); +#endif + + for (i = 0; i < len; i += 256) { + read_page((from + i) / 256, data, 264); + memcpy(buf + i, data, 256); + } + *retlen = len; + return 0; +} + +static int +serial_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, + const unsigned char *buf) +{ + int i; + unsigned char data[264]; + +#ifdef VERBOSE + printk(__FUNCTION__ " to=%d len=%d buf=%p\n", (int)to, len, buf); +#endif + + memset(data, 0, sizeof(data)); + + for (i = 0; i < len; i += 256) { + memcpy(data, buf + i, 256); + write_page((to + i) / 256, data, 264); + } + *retlen = len; + return 0; +} + +static void serial_sync (struct mtd_info *mtd) +{ +#ifdef VERBOSE + printk(__FUNCTION__ "\n"); +#endif +} + +#ifdef MODULE +static void __init +#else +static void __exit +#endif +serial_flash_cleanup(void) +{ + if (mtd) { + del_mtd_device(mtd); + kfree(mtd); + mtd = 0; + } +} + +static int __init +serial_flash_init(void) +{ + int result = 0; + + mtd = kmalloc(sizeof(*mtd), GFP_KERNEL); + if (mtd == 0) { + result = -ENOMEM; + serial_flash_cleanup(); + goto out; + } + memset(mtd, 0, sizeof(*mtd)); + mtd->name = "atmel"; + mtd->type = MTD_NORFLASH; + mtd->flags = MTD_CAP_NORFLASH; + mtd->size = 256 * 2048; + mtd->read = serial_read; + mtd->write = serial_write; + mtd->sync = serial_sync; + mtd->erase = serial_erase; + mtd->erasesize = 8192; + + add_mtd_device(mtd); + + out: + return result; +} + +module_init(serial_flash_init); +module_exit(serial_flash_cleanup); + +MODULE_AUTHOR("Derek Mulcahy "); +MODULE_DESCRIPTION("Shannon ATMEL serial flash driver"); + +/* + * Local variables: + * c-basic-offset: 4 + * End: + */ diff -urN linux-tux2/drivers/mtd/devices/spi.c linux/drivers/mtd/devices/spi.c --- linux-tux2/drivers/mtd/devices/spi.c Wed Dec 31 18:00:00 1969 +++ linux/drivers/mtd/devices/spi.c Sat Nov 10 16:19:20 2001 @@ -0,0 +1,187 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "spi.h" + +spinlock_t spi_lock = SPIN_LOCK_UNLOCKED; + +/* + * xfer_bits - write and read n bits - takes the bits from the top + * return the bits read - returns the bits at the bottom + * + * The SPI connection to the DSP is the meanest interface ever. It + * doesn't return a bit until we send it one. Nothin for nothin. How + * this impacts reading from DSP flash memory without simultaneously + * writing to it is for future investigation. + * + * To transfer a bit we set/clear the SPI_OUTPUT GPIO line, raise + * SPI_CLOCK, read the input bit from SPI_INPUT and lower + * SPI_CLOCK. The first bit is treated outside the loop, this is to + * improve performance. + */ +unsigned int +spi_xfer_bits(int device, unsigned int obits, int n) { + unsigned int ibits = 0; + + /* enable SPI connection to the device */ + if (device) + GPCR = device; + + /* set the first bit on the output line */ + if (obits & 0x80000000) + GPSR = SPI_OUTPUT; + else + GPCR = SPI_OUTPUT; + + for ( ; n > 0; n--) { + ibits <<= 1; + + udelay(1); + + GPSR = SPI_CLOCK; + if (GPLR & SPI_INPUT) + ibits |= 1; + + udelay(1); + + obits <<= 1; + if (obits & 0x80000000) + GPSR = SPI_OUTPUT; + else + GPCR = SPI_OUTPUT; + GPCR = SPI_CLOCK; + } + + /* disable SPI connection to the device */ + if (device) + GPSR = device; + + return ibits; +} + +unsigned char +spi_xfer_byte(unsigned char obyte) { + return spi_xfer_bits(SPI_DSP, obyte << 24, 8) & 0xff; +} + +/* + * read_byte - read a single byte from the Wheaties module. + * return 1 for success, 0 for failure. + * + * The xfer_byte command always requires a byte to transfer to the + * Wheaties, even when reading. Giving it 0 to transfer seems to keep + * it happy. + * + * The RTS bit is 0 when a byte is available on the SPI. This is + * checked first and 0 is returned if the RTS bit is set (no data). + * CTS is set to 1 to indicate that it is clear to send data. We loop + * waiting for Wheaties to set RTS to indicate the byte is available. + * After reading the byte we clear CTS and wait for RTS to clear. + * + * An additonal twist, for the last byte in a message RTS never + * clears, thus we hang around for a while, 500usecs, and then give + * up. So we exit this routine with RTS clear and that means more + * bytes in this message, or RTS set and that means we are done. It is + * not clear what would happen if the next message started within the + * 500 usec window. + */ +int +spi_read_byte(unsigned char *data) { + int i; + + if (GPLR & SPI_RTS) { + return 0; + } + + /* assert CTS */ + GPSR = SPI_CTS; + + /* wait for RTS to set - need to break after 2ms */ + do { + } while ((GPLR & SPI_RTS) == 0); + *data = spi_xfer_byte(0); + + udelay(100); + + /* clear CTS */ + GPCR = SPI_CTS; + + /* wait for RTS to clear, or 500usec */ + i = 0; + do { + i++; + udelay(1); + } while ((GPLR & SPI_RTS) && (i < 500)); + + return 1; +} + +void __exit +spi_cleanup(void) +{ +} + +/* + * init_spi - configure the GPIO lines and SA-1100 registers for the SPI. + */ +int __init +spi_init(void) +{ + int result = 0; + + /* configure alternative function mode for SPI */ + /* Note: we don't initialise SPI_RTS, but it's an input so who cares */ + /* Note: we DO initialise SPI_INPUT, which is also an input, weird */ + /* Note: SPI_RTS and SPI_CTS in GAFR should not need to be + cleared, someone else is setting them in another driver. */ + GAFR &= ~(SPI_RTS | SPI_CTS | SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME); + GPCR = SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME; + GPSR = SPI_FLASH | SPI_DSP; + GPCR = SPI_CTS; + + /* set GPIO inputs and outputs for SPI */ + GPDR |= SPI_FLASH; + GPDR |= SPI_DSP; + GPDR |= SPI_OUTPUT; + GPDR &= ~SPI_INPUT; + GPDR |= SPI_CLOCK; + GPDR |= SPI_FRAME; + GPDR &= ~SPI_RTS; + GPDR |= SPI_CTS; + GPDR |= DSP_RESET; + + /* RTS generates falling edge interrupts when it transitions from 1 to 0 */ + GFER |= SPI_RTS; + + /* + * Enable SSP on alternate function pins, SSP is still not really + * enabled until we set SCE in the Ser4MCCR0 register, but this + * allows us to use it when required. + * Note: that this accidentally clears UPR but may not be an issue. + */ + PPAR = PPAR_SPR; + + /* Clear the SSP control registers */ + Ser4SSCR0 = 0; + Ser4SSCR1 = 0; + + return result; +} + +EXPORT_SYMBOL(spi_xfer_bits); +EXPORT_SYMBOL(spi_xfer_byte); +EXPORT_SYMBOL(spi_read_byte); +EXPORT_SYMBOL(spi_cleanup); +EXPORT_SYMBOL(spi_init); diff -urN linux-tux2/drivers/mtd/devices/spi.h linux/drivers/mtd/devices/spi.h --- linux-tux2/drivers/mtd/devices/spi.h Wed Dec 31 18:00:00 1969 +++ linux/drivers/mtd/devices/spi.h Sat Nov 10 16:19:20 2001 @@ -0,0 +1,23 @@ +#define SPI_NODEV 0 /* Fake Output device, disables repeated + device selection */ +#define SPI_FLASH GPIO_GPIO0 /* Output - Driven low, + enables SPI to flash */ +#define SPI_DSP GPIO_GPIO1 /* Output - Driven low, + enables SPI to DSP */ +#define SPI_OUTPUT GPIO_GPIO10 /* Output - SPI output to DSP */ +#define SPI_INPUT GPIO_GPIO11 /* Input - SPI input from DSP */ +#define SPI_CLOCK GPIO_GPIO12 /* Output - Clock for SPI */ +#define SPI_FRAME GPIO_GPIO13 /* Output - Frame marker - not used */ +#define SPI_RTS GPIO_GPIO14 /* Input - SPI Ready to Send */ +#define SPI_CTS GPIO_GPIO15 /* Output - SPI Clear to Send */ +#define DSP_RESET GPIO_GPIO17 /* Output - Drive low to reset + the DSP */ + +#define IRQ_RTS IRQ_GPIO14 + +#define SPI_ALT (SPI_OUTPUT | SPI_INPUT | SPI_CLOCK | SPI_FRAME) + +extern int spi_read_byte(unsigned char *data); +extern unsigned int spi_xfer_bits(int device, unsigned int obits, int n); +extern unsigned char spi_xfer_byte(unsigned char obyte); +extern spinlock_t spi_lock; diff -urN linux-tux2/drivers/mtd/maps/sa1100-flash.c linux/drivers/mtd/maps/sa1100-flash.c --- linux-tux2/drivers/mtd/maps/sa1100-flash.c Wed Nov 14 04:34:45 2001 +++ linux/drivers/mtd/maps/sa1100-flash.c Sat Nov 10 17:06:12 2001 @@ -569,9 +569,6 @@ } }; -extern int serial_flash_setup(void); -extern void serial_flash_cleanup(void); - #endif #ifdef CONFIG_SA1100_SHERMAN @@ -853,21 +850,11 @@ printk(KERN_NOTICE "Using %s partition definition\n", part_type); add_mtd_partitions(mymtd, parts, nb_parts); } -#ifdef CONFIG_SA1100_SHANNON - if (machine_is_shannon()) { - serial_flash_setup(); - } -#endif return 0; } static void __exit sa1100_mtd_cleanup(void) { -#ifdef CONFIG_SA1100_SHANNON - if (machine_is_shannon()) { - serial_flash_cleanup(); - } -#endif if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd);