AMD Geode™ GX1 Processor
Flash Memory Implementation
Options and Applications
1.0 Scope
This application note describes two methods of paged flash
disk design for the AMD Geode™ GX1 processor. The two
reference designs are Paged Flash Disk Using Memory
Decode and Paged Flash Disk Using the General Purpose
Chip Select. The purpose of this document is to explain the
hardware and software implementation for these two
designs. Once the system designer understands the implementation, these designs can be easily modified to use different hardware if desired.
Note: This is revision 1.1 of this document. The change
from revision 1.0 (dated December 2000) is in format only. No technical changes.
2.0 Discussion
The design titled Paged Flash Disk Using Memory Decode
includes eight flash devices, two latches, two NAND gates,
and a programmable logic device (see attached schematic). Once the software development is done, these flash
devices look like a 16 MB hard drive to a system using
either DOS or Microsoft
Software development using the AMD AM29F016B Flash
Disk has been done with a slightly different hardware
implementation using Datalight’s FlashFX Software Development Kit (SDK) and using DOS as the target platform.
The basics of implementing a flash drive are discusse d in
this application note, but the designer must get both the kit
and the development support from Datalight. FlashFX drivers can be written for DOS, QNX, or Windows CE operating systems. In addition, BIOS extensions can also be
created with the FlashFX software. Various FlashFX software programs have been written and are included in the
SP4GX10 (GX1/CS5530A) development kit. With this software, either a DOS driver or a BIOS extension can be used
to make the flash look like a drive and boot from the flash
device using Datalight’s ROM-DOS. If the flash device is
used as the boot device, there may be problems booting
from a floppy. See Datalight’s website at
www.datalight.com f o r information about FlashFX.
®
Windows® 98 on a FAT16 drive.
2.1Hardware Implementation
2.1.1Memory Decode Design: Hardware
The programmable logic device, the Atmel ATF22V10, is
used to decode a memory range window for accessing the
flash. As ISA bus signals SMEMR# and SMEMW# are only
active when the memory range is below 1 MB, a full
decode of all the ISA address lines is not necessary a nd
only ISA address lines SA[19:13] are used to decode the
memory range. The Programmable Logic Device (PLD)
activates one of the eight flash device chip selects when a
memory access between C8000h and C9FFFh occurs,
meaning that at any one time, only an 8 KB region in one of
the flash devices is available. To access another region,
there must be a mechanism for switching to either another
flash device or another 8 KB region in the flash device. The
two transparent latches (74LCX573) and other logic blocks
within the PLD together perform this function. The PLD
also decodes the memory addresses CA000h and
CA001h. When a memory write occurs to CA000h, the
LATCHCS1 signal go es high. When this happens, the output ‘Q’ signals of latch U1 follow the input ‘D’ signals.
These signals are latched on the falling edge. Thus, a
memory write to CA000h causes the data lines to be
latched and sets the upper address signals SA[20:13] on
the flash. Similarly, a memory write to CA001h causes the
lower three data bits of the ISA data bus to be latched and
sets DEC[2:0]. These signals are inputs to the PLD and are
used to select the flash device as shown in Table 2-1 on
page 2.
Note: Since the PLD only uses SA0 to select one of two
Implementation
latches, all other addresses between CA002h and
CBFFFh are duplicates of CA000h and CA001h.
For simplification, it is recommended that only
CA000h and CA001h be used to set the output of
latches U1 and U2. No other software should use
the range CA000h through CBFFFh.
The design titled Paged Flash Disk Using the General Purpose Chip Select includes eight flash devices, one latch,
and a programmable logic device (see attached schematic). These eight flash devices also look like a 16 MB
hard drive with FlashFX software development.
This design is included to show an alternative method of
creating a paged flash disk. It uses less hardware than the
the memory decode design; however, it uses a general purpose chip select output signal from the CS5530A companion device, and depending on the design, an extra chip
select may not be available for use. As in the previous
design, the PLD ATF22V1 0 is used to decode a memory
range window for accessing the flash. As ISA bus signals
SMEMR# and SMEMW# are only active when the memory
range is below 1 MB, a full decode of all the ISA bus signals is not necessary and only ISA address lines SA[19:14]
are used to decode the memory range. The PLD activates
one of the four flash device chip selects when a memory
access between C8000h and CBFFFh occurs. This means
that at any one time, only a 16 KB region in one of the flash
devices can be accessed. The transparent latch
(74LCX573) and PLD are used to select the 16 KB region
and the device. The PLD output, LATCHADDR, is programmed to go low when IOW#, the general purpose chip
select, and the lowest address bit are all low. If the general
purpose chip select has been enabled and configured
through software to respond to writes at 300h and 301h,
when the processor performs an I/O write to address 300h,
the output signal from the PLD LATCHADDR goes high
and the ‘Q’ outputs of the latch follow the inputs ‘D’. On the
falling edge, the data is latched and held until another I/O
write to address 300h occurs. In this manner, software can
select a particular 16 KB memory region for “windowing”.
The registers that select a particular flash device are within
the PLD itself. Output pins 20 and 21 of the PLD U2 in the
schematic are designated latches to select a particular
flash device and hold their values until they are changed
again. The PLD first generates the clock signal called
DECODECLK. This signal goes low when IOW# goes low,
the general purpose chip select goes low, and the lowest
address bit SA0 is high. If the general purpo se chip select
is configured to decode on 300h through 301h, then an I/O
write to 301h causes DECODECLK to go low. The registered outputs DEC0 and DEC1 latch valid data on the rising edge of the clock, DECODECLK. These outputs select
one of four flash devices as described in Table 2-2.
Figure 2-2. General Purpose Chip Select Desi gn: Hardware Implementation
AMD Geode™ GX1 Processor Flash Memory Implementation Options and Applications3
Page 4
Application Note
Revision 1.1 - January 2004 - Confidential
2.2Software Implementation
2.2.1Memory Decode Design: Software Setup
There is no prior setup required for the paged flash disk desig n using me mory decode. The BIOS generally configures the
processor to send all accesses between C8000h and CBFFFh to the PCI bus. These transactions then get passed onto the
ISA bus through the CS5530A and the flash disks exist on the ISA bus. In order to avoid contention on the ISA bus, the user
must not attempt to place a BIOS extension at C8000h through CBFFFh. Similarly, no BIOS extension should be built into
the BIOS that uses the memory range CA000h through CBFFFh.
Generally, the BIOS sets up the chip selects, but if necessary the software can do this. If using the FlashFX SDK, this
should be done in the mount routine of the Flash Interface Module (FIM). Refer to the FIM code for this implementation as
an example.
2) In the FlashFX SDK, modify the WindowMap() function in file oemhdr.c. This function performs two subfunctions. It cor-
rectly sets the page, selects the flash device (if there is more than one), and returns a pointer to the memor y address
corresponding to ulStart. The parameter called ulStart is simply an offset into the disk. An example WindowMap() function is as follows.
uOffset = (D_UINT) (ulStart % WindowSize());
// Upper address is bits 13 through 20.
cUpperAddr=(D_UCHAR) ((ulStart>>13)&0xff);
// Flash Select are upper address bits 21 through 23.
cFlashSelect=(D_UCHAR) ((ulStart>>21)&0x07);
ASM .386
ASM push es
ASM push ebx
ASM push eax
// Set the segment register to CA00h.
ASM movax,0ca00h
ASMmoves,ax
ASM xorbx,bx
// Latch the upper address bits
ASM moval,cUpperAddr
ASM moves:[bx],al
4AMD Geode™ GX1 Processor Flash Memory Implementation Options and Applications
Page 5
Application Note
Revision 1.1 - January 2004 - Confidential
// Select the flash device.
ASM incbx
ASM moval,cFlashSelect
ASM moves:[bx],al
ASM pop eax
ASM pop ebx
ASM pop es
return (uOffset);
}
3) If using FlashFX SDK, a FIM also must be written. There are four essential functions in this module: mount, write,
erase, and read. These functions are specific to the type of flash being used. At the top of the module there is usually
a list of include and define statements. Assume the following files are included and the following variables are defined.
D_UINT ulFlashPtr;// Pointer to location to write in flash.
D_UINTBIG ulWindowSize;// Size of window.
D_UINTBIG ulThisLength;// Number of bytes to write within the
// current window.
D_UCHAR D_FAR * lpcDataBuffer;// Pointer to buffer to read data
AMD Geode™ GX1 Processor Flash Memory Implementation Options and Applications9
Page 10
Revision 1.1 - January 2004 - Confidential
} while ( ulLength );
/* Erase worked */
return TRUE;
FailedErase:
/* Leave the block in read mode */
ASM push es ds edi esi eax ebx ecx edx
ASM mov ax,WINDOW_START
ASM mov es, ax
ASM mov bx, ulFlashPtr
ASM mov BYTE PTR es:[bx], 0xf0
ASM pop edx ecx ebx eax esi edi ds es
return FALSE;
}
The following function performs a read of the flash device.
2) All the FIMs for this design are identical to those for the memory decode design except for the mount function. In the
mount function, the general purpose chip sel ect must be configured. The following is the mount function and the extra
defines that must be added.
// Use the following address to access the general purpose chip select
// register if HOLDREQ# is tied low; otherwise, if HOLDREQ# is tied
// high, use 080008070h.
#define GPCS_CONFIG_ADD 080009070h
// Index 70-71: General Purpose Chip Select IO Base Address
// Index 72:
// Bit 7 = 1 Enable chip select
// Bit 6 = 1 Enable on writes
// Bit 5 = 0 Disable on reads
// Bits 4:0 = 00001 Range is two bytes.
#define GPCS_CONFIG_DATA000c10300h
D_BOOL XAmd016Mount(void)
{
D_UINT ulFlashPtr;
D_UINT uId;
D_BOOL bWorked;
// Before setting up the flash address, the general
// purpose chip select should be configured so that
// the chip select is enabled on writes to 0x300
// and 0x301. This must occur before the WindowMap()
// function!
-------------------------------C8000 - C9FFF 8KB WINDOW FOR ACCESSING THE FLASH MEMORY
PURPOSE
CA000 WRITE ONE BYTE HERE IN ORDER TO LATCH UPPER ADDRESS BITS
CA001 WRITE ONE BYTE HERE IN ORDER TO SELECT THE PARTICULAR FLASH DEVICE
CA002-CBFFF DO NOT WRITE ANYTHING HERE - MEMORY LOCATIONS CA000 AND CA001
AMD’s products are not designed, intended, authorized or warranted for use as
components in systems intended for surgical implant into the body, or in other
applications intended to support or sustain life, or in any other application in which
the failure of AMD’s product could create a situation where personal injury, death,
or severe property or environmental damage ma y occur. AMD reserves the right to
discontinue or make changes to its products at any time without notice.
www.amd.com
One AMD Place
P.O. Box 3453,
Sunnyvale, CA 94088-3453 USA
Tel: 408-732-2400 or 800-538-8450
TWX: 910-339-9280
TELEX: 34-6306
TECHNICAL SUPPORT
USA & Canada: 800-222-9323 or 408-749-5703
USA & Canada: PC Microprocessor: 408-749-3060
USA & Canada Email: [email protected]
Latin America Email: [email protected]
Argentina: 001-800-200-1111, after tone 800-859-4478
Chile: 800-532-853
Mexico: 95-800-222-9323
Europe & UK: +44–0-1276-803299
Fax: +44–0-1276-803298
France: 0800-908-621
Germany: +49–89-450-53199
Italy: 800-877224
Europe Email: [email protected]
Far East Fax: 852-2956-0588
Japan Fax: 81-3-3346-7848
TRADEMARKS
AMD, the AMD Arrow logo, and combinations
thereof, and Geode are trademarks of
Advanced Micro Devices, Inc.
Microsoft and Windows are trademarks of
Microsoft Corporation in the United States and/or
other jurisdictions.
Other product names used in this publication are
for identification purposes only and may be trademarks of their respective companies.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.