world leader in high performance signal processing
Trace: » cf-ide-nand

This is an old revision of the document!


The CompactFlash / IDE ATA / NAND 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
      • PC Card I/O
  • TRUE IDE PIO Mode Hard Disk Drive Interface
  • NAND 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


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

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 (Xilinx XC9572XL-7VQ64) as present in the reference design is not necessary. Please refer to the CPLD schematics. The CPLD is mainly used to perform address decoding, and to insert three additional bus setup cycles, to met the lower IDE ATA PIO Mode and CF I/O Mode specifications, to achieve SCLK running up to 80 MHz.

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 Flash on the STAMP board.

Please see Memory Map.


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.

# Processor Programmable Flag Pin Push Button Reference Designator Connected to Card Function Position
1 PF2 SW13 / PB1 X X
2 PF3 SW12 / PB2 NAND Busy 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

CF Common Memory AMS2 0x2021 1800
CF PC Card I/O AMS3 0x2031 0000
CF Attribute Memory AMS3 0x2031 1000
ATA HDD Interface AMS3 0x2031 4000
NAND 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.

file: arch/blackfin/mach-bf537/boards/stamp.c

scm failed with exit code 1:
file does not exist in git

Since we’re interfacing to an CF card, we don’t need the interrupt. If the interrupt is left unspecified the new PATA driver defaults to polling. Which is absolutely fine – because there are almost no delays.

You have the choice in the boards directory, to use CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE or CF_IDE_NAND_CARD_USE_HDD_INTERFACE. The default may not be the one you think it is:

file: arch/blackfin/mach-bf537/boards/stamp.c

scm failed with exit code 1:
file does not exist in git

The CF-IDE-NAND 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 MODE a sifted interface would have been preferable (CF_A0 to BF_A1, CF_A1 to BF_A2, …). But since the CF-IDE-NAND 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 supports True IDE mode. Not all cards support this!

Follow the steps here: ide-blackfin


To enable PCMCIA support follow the steps here:


Support for Compact Flash cards, outboard IDE 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:


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 <file:Documentation/Changes>
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 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 Mode
  • Two types of Compact Flash cards
  • Compact Flash
  • Memory
  • I/O Space
  • True IDE Mode (required)
    • ATA Compliant
  • CF+
  • Memory
  • I/O Space
  • True IDE Mode (optional)
  • ATA 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 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 Host Adapter
  • No drivers needed on host since ATA is standard

IDE ATA Introduction

The IDE/ATA connector on the card conforms to the Information Technology - AT Attachment with Packet Interface - 5 (ATA/ATAPI-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 ATA Blackfin Driver and Interface, please follow this link:


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
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

The NAND chip itself is not currently supported, please see this task)

For information about the NAND Flash mtd Blackfin Driver and Interface, please follow this link:


1) NOTE - Pin 32 was defined as IOCS16 in ATA-2, ANSI X3.279-1996.