This application note describes initialization, general
rules, programming model and performance analysis for
the MPC5200 ATA interface, mainly from a software
perspective. The main focus is to help system architects
understand which mode under what circumstances is
optimal for the final product. Detailed software examples
can be found on the publicly available CD with sample
code for the MPC5200. The MPC5200B microcontroller
is based on an e300
instruction set.
The ATA interface is used to connect:
•Hard disks
•CD-ROMs
•DVDs
•Flash storage devices
The MPC5200 ATA interface is fully compatible with
AT A/AT API-4 specification (A T Attachment with Packet Interface Extension, ANSI NCITS 317-1998) supporting
all three groups of modes:
•PIO (from PIO-0 to PIO-4) – up to 16.7 MBytes/sec
•Multiword DMA (from MDMA-0 to MDMA-2) – up to 16.7 MBytes/sec
•Ultra DMA (from UDMA-0 to UDMA-2) – up to 33 MBytes/sec
MPC5200 supports 27-bit and 48-bit LBA addressing on every device.
2ATA Interface
The MPC5200 ATA interface includes three groups of registers:
•AT A host registers – host configuration, timing values for all modes (from PIO, MDMA, UDMA)
•ATA FIFO registers – control ATA FIFO for DMA modes (MDMA, UDMA)
•ATA drive registers – access to the registers physically located on the ATA drive
Figure 1 illustrates basic components of the MPC5200 ATA interface internal to the MPC5200. Data
transfer is driven either by MPC5200 core (PIO) or by the BestComm DMA engine (MDMA, UDMA).
BestComm is designed to offload the MPC5200 core and can transfer data to/from different peripherals
simultaneously. The MPC5200 ATA interface is clocked by the IPBI clock of the MPC5200 processor
(66/132 MHz). MPC5200 acts as an ATA host and can control up to two ATA devices as defined in
ATA/ATAPI-4 specification. Pin ATA_ISOLATION of the MPC5200 (not defined as a signal by
ATA/ATAPI-4 spec) connects to the transceiver’s OE pin to control the direction (high = write to drive,
low = read from drive) of the transfer.
BestComm
(higher priority)
IPBI
(lower priority)
ATA device 0
(e.g. DVD drive)
MPC5200
ATA Rx/Tx FIFO
Interface
(MDMA/UDMA)
Arbiter
IPBI Interface
IPBI clock (66/132 MHz)
ATA 40-pin cable
(PIO)
ATA
Line
Drivers
3.3 V – 5 V
ATA Host Interface
ATA_ISOLATION
ATA device 1
(e.g. CompactFlash)
Figure 1. ATA Architecture
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor2
Page 3
ATA Interface
2.1Electrical Characteristics
AT A is a vo ltage level interface and the table below defines the voltage levels fo r logical ones and zeroes
or input and output values.
Table 1. ATA DC Characteristics
DescriptionMinMax
Driver sink current1
I
oL
I
V
V
V
V
NOTES:
1
IoL for DASP shall be 12 mA minimum to meet legacy timing and signal integrity.
2
IoH value at 400 mA is insufficient in the case of DMARQ that is typically pulled low by a 5.6 kW
resistor.
Driver source current
oH
Voltage input high (logical one)2.0 Vdc—
iH
Voltage input low (logical zero)—0.8 Vdc
iL
Voltage output high (IoH=-400 µA, logical one)2.4 Vdc—
oH
Voltage output low (IoL= 12 mA, logical zero)—0.5 Vdc
oL
2.2Signals
ATA SignalATA Acronym MPC5200 PinDirection
Cable selectCSEL—>28
Chip select 0CS0-ATA_CSB0>37
Chip select 1CS1-ATA_CSB1>38
Data bus bit 0DD0ATA_DATA_0<>17
Data bus bit 1DD1ATA_DATA_1<>15
2
Table 2. ATA Signals
4mA—
400 µA—
40-Pin
ATA Cable
Data bus bit 2DD2ATA_DATA_2<>13
Data bus bit 3DD3ATA_DATA_3<>11
Data bus bit 4DD4ATA_DATA_4<>9
Data bus bit 5DD5ATA_DATA_5<>7
Data bus bit 6DD6ATA_DATA_6<>4
Data bus bit 7DD7ATA_DATA_7<>3
Data bus bit 8DD8ATA_DATA_8<>4
Data bus bit 9DD9ATA_DATA_9<>6
Data bus bit 10DD10ATA_DATA_10<>8
Data bus bit 11DD11ATA_DATA_11<>10
Data bus bit 12DD12ATA_DATA_12<>12
Data bus bit 13DD13ATA_DATA_13<>14
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor3
Page 4
ATA Interface
Table 2. ATA Signals (continued)
ATA SignalATA Acronym MPC5200 PinDirection
Data bus bit 14DD13ATA_DATA_14<>16
Data bus bit 15DD14ATA_DATA_15<>18
Device active or slave (Device 1)
present
Device address bit 0DA0ATA_SA_0>35
Device address bit 1DA1ATA_SA_1>33
Device address bit 2DA2ATA_SA_2>36
DMA acknowledgeDMACK-ATA_DACK_B>29
DMA requestDMARQATA_DRQ<21
Interrupt requestINTRQATA_INTRQ<31
I/O read
DMA ready during Ultra DMA data in
bursts
Data strobe during Ultra DMA data
out bursts
I/O ready
DMA ready during Ultra DMA data
out bursts
Data strobe during Ultra DMA data in
bursts
I/O write
Stop during Ultra DMA data bursts
Passed diagnostics
Cable assembly type identifier
DASP-—>39
DIOR-
HDMARDY-
HSTROBE
IORDY-
DDMARDY-
DSTROBE
DIOW-
STOP
PDIAGCBLID-
ATA _IO R _ B>
>
>
ATA_IOCHRDY<
<
<
ATA _ IO W _B>
>
-<>34
40-Pin
ATA Cable
25
27
23
ResetRESET-HRESET_B>1
GroundGND2,19,22,24,
26,
30,40
2.3IO Cable
The cable specification impacts system integrity and the maximum length that shall be supported in any
application. Cable total length shall not exceed 0.46 m (18 in.). Cable capacitance shall not exceed 35 pF.
80-pin grounded cable helps to avoid problems with noise and inductance although 40-pin cable is
sufficient for modes up to UDMA-2 as in the ATA/ATAPI-4 spec. Also ATA/ATAPI-4 compliant
termination is a must; otherwise, CRC checksum error may randomly occur.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor4
Page 5
ATA Interface
2.4Byte Ordering
Assuming a block of data contains "n" bytes of information, the bytes are labeled Byte(0) through
Byte(n-1), where Byte(0) is the first byte of the block, and Byte(n-1) is the last byte of the block. Table 3
shows the order of the bytes on the ATA interface.
This section describes the generation of the actual address (CSn-, DAn) that is present on the physical A TA
interface to address an ATA drive register by means of operations on internal registers of the MPC5200.
Table 4 shows how internal registers are decoded to ATA bus operations.
Table 4. ATA Register Address/Chip Select Decoding
.
AddressesFunctions
MPC5200
register
address
—11xxxData bus high impedanceNot used
—100xxData bus high impedanceNot used
—1010xData bus high impedanceNot used
0x3A5C10110Drive alternate statusDrive device control
—10111ObsoleteNot used
0x3A6001000Drive dataDrive data
0x3A6401001Drive errorDrive features
0x3A6801010Drive sector countDrive sector count
0x3A6c01011Drive sector numberDrive sector number
0x3A7001100Drive cylinder lowDrive cylinder low
0x3A7401101Drive cylinder highDrive cylinder high
CS0- CS1- DA2DA1DA0
READ (DIOR-)WRITE (DIOW-)
Control Block Registers
Drive LBA bits 0-7*Drive LBA bits 0-7*
Drive LBA bits 8-15*Drive LBA bits 8-15*
Drive LBA bits 16-23*Drive LBA bits 16-23*
Freescale Semiconductor5
MPC5200 ATA Interface, Rev. 0
Page 6
ATA Interface
Table 4. ATA Register Address/Chip Select Decoding (continued)
0x3A7801110Drive device/headDrive device/head
Drive LBA bits 24-27*Drive LBA bits 24-27*
0x3A7C01111Drive device statusDrive command
—00xxxInvalid addressInvalid address
*Mapping of registers in LBA mode
2.6Sector Addressing
The addressing of data sectors recorded on the device's media is performed by a logical sector address.
Two modes are supported:
•Cylinder/head/sector addressing (CHS)
•Logical block addressing (LBA)
The MPC5200 host system may select either CHS translation addressing or LBA addressing on a
command-by-command basis by using the LBA bit in the ATA drive device/head register. The LBA bit
must be set if the host uses LBA addressing mode. The MPC5200 allows 27-bit LBA addressing per
device.
2.7ATA Programming Model
Figure 2 describes the typical structure and sequence of steps needed to initialize and issue ATA
commands for MPC5200.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor6
Page 7
BestComm task loader
Download BestComm image
Set task priorities
Initialize BestComm variables
ATA Interface
ATA driver
Set cached ATA memory regions
Initialize ATA host (MPC5200)
Initialize ATA device
(e.g. hard disk, CD-ROM, DVD)
Execute ATA command
according specified protocol
can be restarted at any time
Figure 2. MPC5200 ATA Programming Model
A BestComm task loader is needed if there is some peripheral requiring DMA transfer over the FIFOs
to/from a peripheral (ATA MDMA/UDMA, Ethernet, LocalPlus, PCI, etc.). The BestComm image is
downloaded and initialized only once, right after booting, due to the static content of the BestComm image
(image means BestComm binary firmware). The BestComm image acts as a server that serves clients
(peripheral software drivers).
It is recommended to start with the software examples published on the sample code CD. These software
examples include a set of already “pre-cooked” BestComm tasks that handle all required peripherals via
the BestComm C-API (BAPI). The system integrator needs to recompile all drivers in the case of any
change in the image. This guarantees compatible versions for both BestComm firmware and software
drivers.
Figure 3documents the structure for the MDMA/UDMA data transfer.
Freescale Semiconductor7
MPC5200 ATA Interface, Rev. 0
Page 8
ATA Interface
Data transfer driven
by BestComm
ATA level shifters
ATA host interface
ATA Rx/Tx FIFO
BestComm
BestComm image in
MPC5200 SRAM
ATA task
ATA cable
MDMA/UDMA data
MPC5200
ATA device
(e.g., DVD drive)
Peripheral FIFOs
Embedded computer
Set of “pre-cooked”
tasks
BestComm C-API
Set of peripheral
drivers and their
ATA data
buffers
Application 1
(e.g., DVD player)
SDR/DDR memory
ATA software driver
Application 2
(e.g., MP3 player)
data buffers
Figure 3. MDMA/UDMA BestComm Driven Data Transfer
The BestComm C-API is not resident software. It is a piece of software statically linked to the driver that
includes a set of standardized function calls.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor8
Page 9
ATA Interface
The following steps should be used to set up the cache for ATA memory buffer regions:
•Set DBAT registers and enable data cache.2 (See Programming Environments Manual for 32-Bit Implementations of the PowerPC Architecture for details.)
•Set XLB priorities in the XLB arbiter master priority register and enable XLB priorities in the
arbiter master priority enable register.
3
(See the XLB Arbiter chapter in the MPC5200 User’s
Manual for details.)
•Set window address, size and snooping policy in the XLB arbiter snoop window register and
enable snooping in the XLB arbiter configuration register.
4
(See the XLB Arbiter chapter in the
MPC5200 User’s Manual for details.)
2.8Host Initialization
The MPC5200 ATA host initialization covers three different groups of steps:
1. ATA common initialization
— Set ATA chip select in GPS port configuration register
— Read IPBI clock speed in CDM configuration register (66 or 132 MHz) needed for timing
registers)
— Enable ATA clock in CDM clock enable register
— Install ATA interrupt handler and BestComm interrupt handler for MDMA/UDMA modes
— Enable ATA/BestComm interrupt
2. PIO initialization (BestComm not needed for PIO modes)
— Set PIO timing registers
5
— Enable drive interrupt (to pass to CPU in PIO modes) in ATA host configuration register
(IE bit)
— Enable IORDY in ATA host configuration register (for PIO-3 and above)
3. MDMA/UDMA initialization
— Set either MDMA or UDMA timing registers
2.9Protocols
ATA commands written into the ATA drive device command register are grouped into different classes
according to the protocols. The protocols define the command execution flow . The command classes with
their associated protocols are defined in Table 5.
The following sections directly document the commands instead of providing a detailed general
description for each protocol. The addressing scheme and the handling of some of the commands are
usually provided in linkable libraries by operating system vendors; therefore, the following description is
2. Usually entire memory cached, initialized by bootloader
3. Initialized by bootloader
4. Set up by driver
5. Bootloader sets up IPBI clock speed, peripheral drivers should read status only
Freescale Semiconductor9
MPC5200 ATA Interface, Rev. 0
Page 10
ATA Interface
intended to help software engineers understand how to initialize the MPC5200 ATA interface and how to
execute standard commands.
NOTE
Flash storage media require a different set of commands that are not
described in this application note. It is recommended to first read the
identify table for each ATA device found on the ATA bus. It contains
specific information needed to handle the device properly . For protocol and
identification information details, see Attachment with Packet Interface Extension, ANSI NCITS 317-1998.
1. Select drive according to device selection protocol in ATA/ATAPI-4 spec:
6
a) Wait for BSY
6. BSY - The Drive Busy bit indicates that the device is busy.
7. DRQ - The Data Request bit indicates that the device is ready to transfer a word of data between the host and the device.
=0 and DRQ7 = 0 in ATA drive alternate status register
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor10
Page 11
b) Write ATA drive device/head register with appropriate DEV8 bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
2. Enable
INTRQ in ATA drive device control register (nIEN bit)
3. Set PIO mode in ATA drive features register according to non-data command protocol in
ATA/ATAPI-4 spec:
a) Set PIO mode in ATA drive sector count register
b) Write
c) Write
d) Wait for ATA interrupt – indicates that the device has accepted the
SETTRANSFER mode into ATA drive features register
SETFEATURES command into ATA drive device command register
SETFEATURES command
2.9.1.2MDMA/UDMA Initialization Protocol Steps
1. Select drive according to device selection protocol in ATA/ATAPI-4 spec:
a) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
b) Write ATA drive device/head register with appropriate DEV bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
2. Enable
3. Set MDMA/UDMA mode in ATA drive features register according to non-data command
protocol in ATA/ATAPI-4 spec:
a) Set MDMA/UDMA mode in ATA drive sector count register
b) Write
c) Write
d) Wait for ATA interrupt – indicates that the device has accepted the
INTRQ in ATA drive device control register (nIEN bit)
SETTRANSFERMODE into ATA drive features register
SETFEATURES command into ATA drive device command register
SETFEATURES command
ATA Interface
8. DEV - The Device Selection bit in ATA drive device/head register specifies which device is selected, 0 or 1.
Freescale Semiconductor11
MPC5200 ATA Interface, Rev. 0
Page 12
ATA Interface
2.9.2PIO Data Read
2.9.2.1PIO Data in Command Protocol Steps
1. Select drive according to device selection protocol in ATA/ATAPI-4 spec:
a) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
b) Write ATA drive device/head register with appropriate DEV bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
2. Write ATA drive cylinder low register, AT A drive cylinder high register, A TA drive sector number
register, ATA drive sector count register
3. Write
4. Wait 400 ns
5. Wait for ATA interrupt – indicates that the data is ready for reading by host
6. Read (sector_count × sector_size) 16-bit ATA data words from ATA drive data register driven
READSECTOR(S) command into ATA drive device command register
either by core or Bestcomm. In the case of Bestcomm when snooping is not used, cache needs to
be invalidated first
2.9.3PIO Data Write
2.9.3.1PIO Data Out Command Protocol Steps
1. Select drive according to device selection protocol in ATA/ATAPI-4 spec:
a) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
b) Write ATA drive device/head register with appropriate DEV bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
2. Write ATA drive cylinder low register, AT A drive cylinder high register, A TA drive sector number
register, ATA drive sector count register
3. Write
4. Wait 400 ns
5. Wait for BSY=0 and DRQ = 1 in ATA drive alternate status register
6. Write (sector_count × sector_size) 16-bit A TA data words to A TA drive data register, driven either
7. Wait for ATA interrupt – indicates that the data has been written by the device
WRITESECTOR(S) command into ATA drive device command register
by core or Bestcomm. In the case of Bestcomm when snooping is not used, cache needs to be
flushed first (entire write buffer)
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor12
Page 13
ATA Interface
2.9.4DMA Data Read
2.9.4.1DMA Command Protocol Steps
1. Select drive according to the device selection protocol in ATA/ATAPI-4 spec:
a) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
b) Write ATA drive device/head register with appropriate DEV bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
2. If snooping is not used, cache needs to be invalidated
3. Initialize and start BestComm ATA task
4. Set ATA FIFO alarm and granularity in ATA Rx/Tx FIFO alarm register, ATA Rx/Tx FIFO
control register
5. Set FIFO Reset bit (FR) in ATA drive device command register when the direction is switched
from Tx to Rx
6. Clear FIFO Reset bit (FR) in ATA drive device command register*
7. Set FIFO Flush in Rx Mode bit (FE) and Read bit (READ) in ATA drive device command
register*
8. If UDMA, set UDMA bit (UDAMA) in ATA drive device command register. Clear it for
MDMA*
9. Set Drive Interrupt bit (IE) in ATA drive device command register*
NOTE
This could be done just by one command.
10. Wait 400 ns
11. Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
12. Write ATA drive cylinder low register, AT A drive cylinder high register , ATA drive sector number
register, ATA drive sector count register
13. Wait 400 ns
14. Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
15. Write
READDMA command into ATA drive device command register
16. Wait for BestComm interrupt – indicates all data moved from ATA Rx FIFO to the RAM
2.9.5DMA Data Write
2.9.5.1DMA Command Protocol Steps
1. Select drive according to device selection protocol in ATA/ATAPI-4 spec:
a) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
b) Write ATA drive device/head register with appropriate DEV bit and LBA bit
c) Wait 400 ns
d) Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
Freescale Semiconductor13
MPC5200 ATA Interface, Rev. 0
Page 14
Performance Analysis
2. If snooping is not used, cache needs to be flushed (entire write buffer)
3. Initialize and start BestComm ATA task
4. Set ATA FIFO alarm and granularity in ATA Rx/Tx FIFO alarm register, ATA Rx/Tx FIFO
control register
5. Set Write bit (WRITE) in ATA drive device command register*
6. If UDMA, set UDMA bit (UDAMA) in ATA drive device command register. Clear it for
MDMA*
7. Set Drive Interrupt (IE) bit in ATA drive device command register*
NOTE
This could be done just by one command.
8. Wait 400ns
9. Wait for BSY=0 and DRQ = 0 in ATA drive alternate status register
10. Write ATA drive cylinder low register, AT A drive cylinder high register , ATA drive sector number
register, ATA drive sector count register
11. Write
WRITEDMA command into ATA drive device command register
12. Wait for ATA interrupt – indicates that the data has been written by the device
2.9.6Interrupt Handler
In the interrupt service routine, the first action is to clear the lower part of the ATA drive device command
register by writing a logical zero (bits HUT, FR, FE, IE, UDAMA, READ, WRITE). The pending ATA
drive interrupt is cleared by reading of the ATA drive device sstatus register as it is specified in the
ATA/ATAPI-4 specification.
3Performance Analysis
Table 6 documents the maximum data throughput for all possible ATA modes. Of course, it is a theoretical
maximum throughput that, in reality, is never achieved. The real final result depends on the following:
•Device response delay – Average seek time for hard disks is a few milliseconds; therefore, some
host-based cache would be essential for applications like video players where large and
continuous streams of data need to be read from the device. This kind of host-based cache is
usually implemented as filesystem cache
•Sustained data rate – Devices like hard disks have limited speed at which physical data is read.
This number can be found in the device data sheet.
•Mode dependent delay
— Standby mode – The ATA device goes to the standby mode when the standby timer expires.
The interface is capable of accepting commands while waiting for the spindle to reach
operating speed. Delay is roughly hundreds of milliseconds
— Idle mode – See technical documentation for the ATA device.
MPC5200 ATA Interface, Rev. 0
Freescale Semiconductor14
Page 15
Performance Analysis
•Device fragmentation delay – If the device is highly defragmented, using the look-ahead feature9
does not help. This is a typical problem of hard disks or Flash storage devices. DVDs and CDs
always have contiguous blocks of data.
•MPC5200 timing granularity – The MPC5200 ATA interface is clocked by the IPBI clock
(66/132 MHz). The ATA/ATAPI-4 specification defines minimum values for cycle time, setup
time, and hold time. Minimum values for timing registers are specified in IPBI clock cycles and
need to be rounded up; therefore, the best result are achieved with finer granularity . (For example,
the IPBI clock 132 MHz is measured on the logic analyzer, 31.5 MBytes/sec, for UDMA-2.)
Compare this with the maximum theoretical throughput in Table 6.
Table 6. ATA Maximum Data Throughput
Mode
PIO-03.3corecore/Bestcomm
PIO-15.2corecore/Bestcomm
PIO-28.3corecore/Bestcomm
PIO-311.1corecore/Bestcomm
PIO-416.7corecore/Bestcomm
MDMA-04.2coreBestComm
MDMA-113.3coreBestComm
MDMA-216.7coreBestComm
UDMA-016.7coreBestComm
UDMA-125coreBestComm
UDMA-233coreBestComm
Max.Rate
[MBytes/Sec]
MPC5200 ATA
Initialization
Driven By
MPC5200 ATA
Data Transfer
Driven By
ATA performance can be optimized by:
•Reading/writing of the maximum number of sectors per single ATA command (see Figure 4
Regular hard disk defragmentation is essential
•Enabling of special features in the ATA device—look-ahead, write cache, etc. First, they need to
be checked in the identify table to see if supported and then enabled by the
SETFEATURES
command
10
).
•Using IPBI 132 MHz as described above
•Utilizing Bestcomm which can drive read/write in PIO mode to offload the core
9. Look-ahead read allows reading consequent sectors into the device cache. ATA host reads data from device cache. The size
of cache is vendor/type dependent, which can be found in the device documentation
10.Normalized results are measured by writing/reading 1 MB data to/from the same LBA address for IBM DBCA-203240 hard
disk with disabled drive cache. It could be different for other ATA devices. Check maximum number of sectors per single command
in the device identify table (usually up to 16 sectors per single command supported).
Freescale Semiconductor15
MPC5200 ATA Interface, Rev. 0
Page 16
Performance Analysis
3.0
2.5
2.0
1.5
1.0
normalized throughput
0.5
0.0
1.0001.000
4
1.455
8
1.833
1.923
16 sectors per single command
2.535
UDMA-2 write
UDMA-2 read
Figure 4. ATA Relative Throughput Improvement
System throughput is a result of the speed of the peripheral and the final integration—typically in OSs. For
a properly defragmented ATA device, it is considered bad programming style if the MPC5200 ATA host
reads or writes only a small number of sectors per single ATA command. In this case, the ATA software
driver and its interrupt handler could consume significant amounts of core time. The AT A software driver
can block anything running with lower priority in the system (seeTable 7).
11
In some cases in OSs, such
bad application implementation can degrade final ATA throughput by ~50% .
Table 7. System Throughput
.
ATA Mo de
UDMA-2
Sectors Per Single
Command
115
460
16240
Time Between Two ATA
Interrupts
µs
µs
µs
Looking at Table 7, the question arises as to why the throughput improvement indicated in Figure 4 is not
as expected. The answer is simple; it is writing/reading the same LBA address with the look-ahead/write
cache feature disabled. The time needed to read data from the interface is much smaller (microseconds)
than the average seek time (milliseconds).
Static memory allocation for the ATA software driver is recommended.
Although not described in the MPC5200 User’s Manual, the MPC5200 ATA interface is capable of
UDMA-4 66 MBytes/sec mode. The programming model is the same as for UDMA-2. The impact of all
the above possible performance considerations is more visible because of higher speed.
11.Reading subsequent sectors from hard disk with enabled look-ahead feature, the worst scenario for MPC5200 core load
Acronyms use terminology such as ata.h in freely distributed software
examples.
1
OffsetSize [Bits]
Table A2. MPC5200 ATA Timing Registers
RegisterAcronym
ATA PIO timing 1ata_pio1MBAR+0x3A0832
ATA PIO timing 2ata_pio2MBAR+0x3A0C32
ATA multiword DMA timing 1ata_dma1MBAR+0x3A1032
ATA multiword DMA timing 2ata_dma2MBAR+0x3A1432
ATA ultra DMA timing 1ata_udma1MBAR+0x3A1832
ATA ultra DMA timing 2ata_udma2MBAR+0x3A1C32
ATA ultra DMA timing 3ata_udma3MBAR+0x3A2032
ATA ultra DMA timing 4ata_udma4MBAR+0x3A2432
ATA ultra DMA timing 5ata_udma5MBAR+0x3A2832
ATA share countata_invalidMBAR+0x3A2C32
NOTES:
1
Acronyms use terminology such as ata.h in freely distributed software
examples.
1
OffsetSize [Bits]
Table A3. MPC5200 ATA FIFO Registers
RegisterAcronym
ATA Rx/Tx FIFO data wordata_fifo_dataMBAR+0x3A3C32
ATA Rx/Tx FIFO statusata_fifo_statusMBAR+0x3A418
ATA Rx/Tx FIFO controlata_fifo_controlMBAR+0x3A448
ATA Rx/Tx FIFO alarmata_fifo_alarmMBAR+0x3A4A16
ATA Rx/Tx FIFO read pointerata_fifo_rdpMBAR+0x3A4E16
ATA Rx/Tx FIFO write pointerata_fifo_wrpMBAR+0x3A5216
NOTES:
1
Acronyms use terminology such as ata.h in freely distributed software examples.
MPC5200 ATA Interface, Rev. 0
1
OffsetSize [Bits]
Freescale Semiconductor18
Page 19
Table A4. MPC5200 ATA Drive Registers
MPC5200 ATA Register Summary
RegisterAcronym
1
OffsetSize [Bits]Mode
ATA drive device controlata_drive_ctrlMBAR+0x3A5C8write-only
ATA drive alternate status8read-only
ATA drive dataata_drive_data MBAR+0x3A6016R/W
ATA drive featuresata_drive_ftrMBAR+0x3A648write-only
ATA drive error8read-only
ATA drive sector countata_drive_scMBAR+0x3A688R/W
ATA drive sector numberata_drive_snMBAR+0x3A6C8R/W
ATA drive cylinder lowata_drive_clMBAR+0x3A708R/W
ATA drive cylinder highata_drive_chMBAR+0x3A748R/W
ATA drive device/headata_drive_dhMBAR+0x3A788R/W
ATA drive device command ata_drive_cmd MBAR+0x3A7C8write-only
ATA drive device status8read-only
NOTES:
1
Acronyms use terminology such as ata.h in freely distributed software examples.
Freescale Semiconductor19
MPC5200 ATA Interface, Rev. 0
Page 20
How to Reach Us:
Home Page:
www.freescale.com
E-mail:
support@freescale.com
USA/Europe or Locations Not Listed:
Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
support@freescale.com
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064
Japan
0120 191014 or +81 3 5437 9125
support.japan@freescale.com
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
support.asia@freescale.com
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
LDCForFreescaleSemiconductor@hibbertgroup.com
Information in this document is provided solely to enable system and software
implementers to use Freescale Semiconductor products. There are no express or
implied copyright licenses granted hereunder to design or fabricate any integrated
circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to
any products herein. Freescale Semiconductor makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor assume any liability arising out of the application or use of any
product or circuit, and specifically disclaims any and all liability, including without
limitation consequential or incidental damages. “Typical” parameters that may be
provided in Freescale Semiconductor data sheets and/or specifications can and do vary
in different applications and actual performance may vary over time. All operating
parameters, including “Typicals”, must be validated for each customer application by
customer’s technical experts. Freescale Semiconductor does not convey any license
under its patent rights nor the rights of others. Freescale Semiconductor products are
not designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and
its officers, employees, subsidiaries, affiliates, and distributors harmless against all
claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Freescale
Semiconductor was negligent regarding the design or manufacture of the part.
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
The described product is a PowerPC microprocessor core. The PowerPC name is a
trademark of IBM Corp. and is used under license. All other product or service names
are the property of their respective owners.