Introduction The CompactFlash / IDE (Integrated Drive Electronics (hard drives!)) ATA (Advanced Technology Attachment (hard drives!)) / NAND (Not AND (large flash memory type)) Flash – Multifunction interface card implements the following features: Card Features: Full blown CF Card Interface. Memory Mapped access to all CF Card Memory Spaces Attribute Memory Common Memory TRUE IDE (Integrated Drive Electronics (hard drives!)) MODE PC Card I/O TRUE IDE (Integrated Drive Electronics (hard drives!)) PIO Mode Hard Disk Drive Interface NAND (Not AND (large flash memory type)) Flash Memory Interface (Note: not currently supported, please see this task) Support for different timings, according to the CF+ and CompactFlash Specification Revision 3.0 (CompactFlash Association) CompactFlash Association Hardware The card was mainly designed to work with an BF537-STAMP board. It might be the case that your STAMP board doesn't have the expansion connectors assembled on the bottom side of the board. This can easily be added, by assembling/soldering them by hand. The connector requires three (3) SAMTEC part number SFC-145-T2-F-D-A. These connectors are usually less than ~3.00 each, and can be ordered from Samtec. Schematics and design files for the Add-On-Card can be found here: Hardware Projects and Schematics Blackfin STAMP Hardware Projects The card uses Bi-directional BUS switches (IDT QS316245) to perform Bus isolation and 5V to 3.3V logic level translation. In most of the applications a CPLD (Complex Programmable Logic Device) (Xilinx XC9572XL-7VQ64) as present in the reference design is not necessary. Please refer to the CPLD (Complex Programmable Logic Device) schematics. The CPLD (Complex Programmable Logic Device) is mainly used to perform address decoding, and to insert three additional bus setup cycles, to met the lower IDE (Integrated Drive Electronics (hard drives!)) ATA (Advanced Technology Attachment (hard drives!)) PIO Mode and CF I/O Mode specifications, to achieve SCLK (System Clock) running up to 80 MHz (Megahertz). Known Issues Recent Linux libata assumes the IDE (Integrated Drive Electronics (hard drives!)) Interrupt INTRQ staying inactive low the time between the IRQ (Interrupt request) is requested and the device is configured. The problem here is that the INTRQ signal output line has high impedance when no devices are selected or interruption is disabled. The CF-IDE (Integrated Drive Electronics (hard drives!))-NAND (Not AND (large flash memory type)) Card however has 10kOhm Pull-Up on INTRQ - which will then cause a “irq XX: nobody cared” error during libata driver initialization. Workaround is to add a stronger (1kOhm) Pull-Down to INTRQ. See picture below: On the CF Card socket there is also a pull-up – but there we had no choice since in PC-Card IO mode the Interrupt is asserted Low. So this was a tradeoff, and at the time doing the card – it worked without errors, in all modes. Assuming you are going to use the CF Card Interface in TRUE IDE (Integrated Drive Electronics (hard drives!)) MODE with interrupt, you need to add this workaround there too. As an alternative use either TRUE IDE (Integrated Drive Electronics (hard drives!)) MODE without interrupt, the PCMCIA driver with IDE (Integrated Drive Electronics (hard drives!)) Card Service Drivers or better the CF Common Memory Mode Interface without IDE (Integrated Drive Electronics (hard drives!)) Interrupt. Hardware Setup In order to successfully communicate with the Add-On-Card - Asynchronous Memory banks 3 and or 2 needs to be disconnected from the NOR (Not OR (parallel flash memory type)) Flash on the STAMP board. Please see Memory Map. SW6 #, Bank, Position 1 , AMS0 , ON 2 , AMS1 , ON 3 , AMS2 , OFF 4 , AMS3 , OFF The push button enable switch (SW5) is capable of disconnecting the push buttons from the PF (refer to “Push Button Enable Switch (SW5)” below on for more information). The programmable flag signals and their corresponding switches are shown below. SW5 # , Processor Programmable Flag Pin , Push Button Reference Designator , Connected to Card Function , Position 1 , PF2 , SW13 / PB1 , X , X 2 , PF3 , SW12 / PB2 , NAND (Not AND (large flash memory type)) Busy , OFF 3 , PF4 , SW11 / PB3 , CF INT , OFF 4 , PF5 , SW10 / PB4 , HDD INT , OFF For further details on how to setup the STAMP board see here: Setting up the BF537-STAMP Hardware Memory Map Two AMS (Asynchronous Memory Select) Strobes are used to provide different timings for the supported low and high speed interfaces Interface, Bank, Address CF Common Memory , AMS2 , 0x2021 1800 CF TRUE IDE (Integrated Drive Electronics (hard drives!)) MODE , AMS3 , 0x2031 C000 CF PC Card I/O , AMS3 , 0x2031 0000 CF Attribute Memory , AMS3 , 0x2031 1000 ATA (Advanced Technology Attachment (hard drives!)) HDD Interface , AMS3 , 0x2031 4000 NAND (Not AND (large flash memory type)) Flash , AMS2 , 0x2021 2000 Kernel Configuration CF Common Memory Example using PATA Platform driver If you like to use the CF Card in common memory mode (fastest), you need to use following PATA Platfrom configuration. Since we’re interfacing to an CF card, we don’t need the interrupt. If the interrupt is left unspecified the newPATA (Parallel ATA (IDE hard drives!))driver defaults to polling. Which is absolutely fine – because there are almost no delays. You have the choice in theboardsdirectory, to useCF_IDE (Integrated Drive Electronics (hard drives!))_NAND (Not AND (large flash memory type))_CARD_USE_CF_IN_COMMON_MEMORY_MODEorCF_IDE (Integrated Drive Electronics (hard drives!))_NAND (Not AND (large flash memory type))_CARD_USE_HDD_INTERFACE. The default may not be the one you think it is: The CF-IDE (Integrated Drive Electronics (hard drives!))-NAND (Not AND (large flash memory type)) card connects CF A0 to Blackfin A13. This sounds odd but was done to enable the PCMCIA IO mode, which assumes an Address aligned interface. The pata platform driver now supports an IO shift (pata_platform_info→ioport_shift). So for CF cards in COMMON MEMORY or TRUE IDE (Integrated Drive Electronics (hard drives!)) MODE a sifted interface would have been preferable (CF_A0 to BF_A1, CF_A1 to BF_A2, …). But since the CF-IDE (Integrated Drive Electronics (hard drives!))-NAND (Not AND (large flash memory type)) card also implements Card Enable (-CE) odd, even byte steering the interface is still functional. scsi0 : pata_platform ata1: PATA max PIO0 no IRQ, using PIO polling mmio cmd 0x20211800 ctl 0x2021180E ata1.00: CFA: SanDisk SDCFX-1024, HDX 4.03, max PIO6 ata1.00: 2001888 sectors, multi 0: LBA ata1.00: Drive reports diagnostics failure. This may indicate a drive ata1.00: fault or invalid emulation. Contact drive vendor for information. ata1.00: configured for PIO ata1.00: configured for PIO ata1: EH complete scsi 0:0:0:0: Direct-Access ATA SanDisk SDCFX-10 HDX PQ: 0 ANSI: 5 sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977 MiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] 2001888 512-byte hardware sectors: (1.02 GB/977 MiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sd 0:0:0:0: [sda] Attached SCSI removable disk CompactFlash CF TRUE IDE When purchasing a compact flash card, make sure that it supportsTrue IDE (Integrated Drive Electronics (hard drives!)) mode. Not all cards support this! Follow the steps here: ide-blackfin PCMCIA IDE Driver To enable PCMCIA support follow the steps here: bfin_cf_pcmcia Support for Compact Flash cards, outboard IDE (Integrated Drive Electronics (hard drives!)) disks, tape drives, and CD-ROM drives connected through a PCMCIA card. CompactFlash CF 802.11b Wireless LAN Follow the steps here: blackfin_802.11_wlan_-_orinoco_based_driver Or checkout the PCMCIA Orinoco Driver: (orinoco_cs.c) PCMCIA CompactFlash CF 802.11b Wireless LAN Driver To enable PCMCIA support follow the steps here: bfin_cf_pcmcia A driver for “Hermes” chipset based PCMCIA wireless adaptors, such as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/ EnteraSys RoamAbout 802.11, ELSA Airlancer, Melco Buffalo and others). It should also be usable on various Prism II based cards such as the Linksys, D-Link and Farallon Skyline. It should also work on Symbol cards such as the 3Com AirConnect and Ericsson WLAN. To use your PC-cards, you will need supporting software from David Hinds' pcmcia-cs package (see the file for location). You also want to check out the PCMCIA-HOWTO, available from . IDE ATA Hard Disk Drive Follow the steps here: ide-blackfin Use following card specific configuration IDE (Integrated Drive Electronics (hard drives!)) Extra Configuration Device Drivers ---> ATA/ATAPI/MFM/RLL support ---> <*> ATA/ATAPI/MFM/RLL support <*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support <*> IDE support on Blackfin CPU IDE Interface Address Mapping (see help) (Linear 16-bit mapping with reg spacing) ---> (0x20314020) IDE register base address (0x2031401C) IDE register alternate address (55) IDE IRQ_PFx number (2) Address Stride / IDE GAP CompactFlash Introduction CompactFlash Basics Extension of PCMCIA (PC Card) specification Compact Flash is intended for a new class of light weight, low power portable devices Compact Flash concept Capture,retain and transport data, audio and images Extended operation beyond memory storage I/O devices Magnetic disk data storage Matchbook sized form factor Type I (3.3 mm thick) Type II (5.0 mm thick) Compact Flash Overview Host Bus Adapter (HBA) Interface between host and CF card Host bus independent 8/16 bit data access Can access these card functions: Memory Attribute Memory Common Memory I/O Space True IDE (Integrated Drive Electronics (hard drives!)) Mode Two types of Compact Flash cards Compact Flash Memory I/O Space True IDE (Integrated Drive Electronics (hard drives!)) Mode (required) ATA (Advanced Technology Attachment (hard drives!)) Compliant CF+ Memory I/O Space True IDE (Integrated Drive Electronics (hard drives!)) Mode (optional) ATA (Advanced Technology Attachment (hard drives!)) Compliant Data Bus 8 bit HBA data bus 16 bit HBA data bus I/O Space 8 bit registers 16 bit registers Can have multiple I/O functions 5V or 3.3V Attribute Memory Card Information Structure (CIS) Base address of 0x000 Stored in non-volatile memory Configuration and Status Registers Base address of 0x200 for Compact Flash cards Base address is specified in CIS for CF+ cards Configuration Option Register (Mandatory) BASE + 0x00 Enables I/O functions Address decoding IRQ (Interrupt request) type and status Common Memory Flash Memory for general storage Working memory space typically used to map memory arrays CF cards only have 11 address lines 2k bytes of addressable common memory I/O Space May be one or more functions Memory only I/O Cards Multifunction Cards with combinations of memory and I/O functions Examples of I/O functions GPS Network Modem I/O Space re-maps some pins for new functions Pin Replacement Register has status of memory only pins during I/O configuration Card powers up as a memory card for HBA to read the CIS data Card is subsequently configured as I/O function True IDE Mode Mandatory for Compact Flash cards Optional for CF+ cards Large amounts of memory Disk Drives Emulated Disk Drives using Flash memory Card must include an ATA (Advanced Technology Attachment (hard drives!)) Host Adapter No drivers needed on host since ATA (Advanced Technology Attachment (hard drives!)) is standard IDE ATA Introduction The IDE (Integrated Drive Electronics (hard drives!))/ATA (Advanced Technology Attachment (hard drives!)) connector on the card conforms to the Information Technology - AT Attachment with Packet Interface - 5 (ATA (Advanced Technology Attachment (hard drives!))/ATAPI (Advanced Technology Attachment Packet Interface (hard drives!))-5) Working Draft, known as T13 1321D, which can be found here. The exact pinout is found below. :50pin_ide.png This alternative connector is often used for 2 1/2 inch or smaller devices. This connector is shown in figure below. Although there are 50 pins in the plug, a 44-pin mating receptacle may be used. Although Pins E, F, and 20 are keys and should be removed, it is pretty difficult to find connectors with this pinout, so a key in the shrowd is there to ensure proper connection of the included cable. Some devices may utilize pins A, B, C, and D for option selection via physical jumpers. If a device uses pins A, B, C, and D for device selection, when no jumper is present the device should be designated as Device 0. When a jumper is present between pins B and D, the device should respond to the CSEL signal to determine the device number. When a jumper is present between pins A and B, the device should be designated as Device 1. For those who enjoy a pretty picture of jumper settings, we have one. For information about the IDE (Integrated Drive Electronics (hard drives!)) ATA (Advanced Technology Attachment (hard drives!)) Blackfin Driver and Interface, please follow this link: ide-blackfin Signal assignments for 50-pin connector Signal name , Connector contact , Conductor , Conductor , Connector contact , Signal name Option selection pins , A , , , B , Option selection pins Option selection pins , C , , , D , Option selection pins (keypin) , E , , , F , (keypin) RESET- , 1 , 1 , 2 , 2 , Ground DD7 , 3 , 3 , 4 , 4 , DD8 DD6 , 5 , 5 , 6 , 6 , DD9 DD5 , 7 , 7 , 8 , 8 , DD10 DD4 , 9 , 9 , 10 , 10 , DD11 DD3 , 11 , 11 , 12 , 12 , DD12 DD2 , 13 , 13 , 14 , 14 , DD13 DD1 , 15 , 15 , 16 , 16 , DD14 DD0 , 17 , 17 , 18 , 18 , DD15 Ground , 19 , 19 , 20 , 20 , (keypin) DMARQ , 21 , 21 , 22 , 22 , Ground DIOW-:STOP , 23 , 23 , 24 , 24 , Ground DIOR-:HDMARDY-:HSTROBE , 25 , 25 , 26 , 26 , Ground IORDY:DDMARDY-:DSTROBE , 27 , 27 , 28 , 28 , CSEL DMACK- , 29 , 29 , 30 , 30 , Ground INTRQ , 31 , 31 , 32 , 32 , Obsolete 1) DA1 , 33 , 33 , 34 , 34 , PDIAG DA0 , 35 , 35 , 36 , 36 , DA2 CS0- , 37 , 37 , 38 , 38 , CS1- DASP- , 39 , 39 , 40 , 40 , Ground +5 V (logic) , 41 , 41 , 42 , 42 , +5 V (motor) Ground(return) , 43 , 43 , 44 , 44 , Reserved - no connection NAND Flash Introduction For information about the NAND (Not AND (large flash memory type)) Flash mtd Blackfin Driver and Interface, please follow this link: bfin_async_nand 1) NOTE - Pin 32 was defined as IOCS16 in ATA (Advanced Technology Attachment (hard drives!))-2, ANSI X3.279-1996.