/******************************************************************************************* *** Copyright (C) Intel Corporation 2006 *** All Rights Reserved. *** --------------------------------------------------------------------------------------------- *** PROJECT NAME: Intel StrataFlash(R) Cellular Memory (M18) Template Reference Code *** *** FILE: target.h *** *** TARGET: Motorola Coldfire* 5272 with custom M18 Add-on sockets *** *** VERSION: 1.0 *** *** DATE: 03/24/06 *** *** AUTHOR: Ronald Richardson *** *** PURPOSE: Function signatures and documentation of the three primitive driver *** operations (namely initialization, read and write). *** *** --------------------------------------------------------------------------------------------- *** General Note(s): *** *** 2. This template driver has been written to support X16 devices only, and must be *** heavily modified to support X32 devices. *** ******************************************************************************************* *** NOTICE OF LICENSE AGREEMENT *** *** This code is provided by Intel Corp., and the use is governed *** under the terms of a license agreement. See license agreement *** for complete terms of license. *** *** YOU MAY ONLY USE THE SOFTWARE WITH INTEL FLASH PRODUCTS. YOUR *** USE OF THE SOFTWARE WITH ANY OTHER FLASH PRODUCTS IS EXPRESSLY *** PROHIBITED UNLESS AND UNTIL YOU APPLY FOR, AND ARE GRANTED IN *** INTEL'S SOLE DISCRETION, A SEPARATE WRITTEN SOFTWARE LICENSE *** FROM INTEL LICENSING ANY SUCH USE. *************************************************************************************************/ #ifndef TARGET_H_ #define TARGET_H_ #include "template.h" /******************************************************************************************* *** Primitive Methods, used throughout driver *******************************************************************************************/ /*-----------------------------------------------------------------------------------------* | TMPL_InitHardware | | Description: | | Initializes target hardware to use the M18 device. This methods should be modified | to support the target hardware. | | Parameters: | | None | | Returns: | | Nothing | | Precondition: | | None | | Postcondition: | | HW State: Initialize M18 device and device controllers. M18 ready to accept | this driver's commands. | *-----------------------------------------------------------------------------------------*/ void TMPL_InitHardware( ); /*-----------------------------------------------------------------------------------------* | TMPL_WriteWord | | Description: | | Writes a single 16-bit word to the target device. The function should treat 'addr' as | an address 'local' to the flash device. This address is effectively an offset from the | 'baseAddr' as given in flash_info. | | The current implementation uses GPIO to drive the highest 6 address pins because of | hardware limitations. This method should be customized for use on the target hardware. | | Parameters: | | IN info Provides the flash device's 'Base Address' within the target hardware's | memory space. | IN addr The local address to reference. This is treated as an offset from the | baseAddr. | IN word The word of data to write at 'addr' | | Returns: | | Nothing | | Precondition: | | ArrayState: Any | Hardware: Initialized such that '*baseAddr=0x1234' would write 0x1234 to device | base address 0. | | Postcondition: | | ArrayState: Unchanged | Device: Data 'word' will have been written to 'baseAddr[addr]' | *-----------------------------------------------------------------------------------------*/ void TMPL_WriteWord ( const flash_info * info, uint32 addr, uint16 word ); /*-----------------------------------------------------------------------------------------* | TMPL_ReadWord | | Description: | | Reads a single 16-bit word from the target device. The function should treat 'addr' as | an address 'local' to the flash device. This address is effectively an offset from the | 'baseAddr' as given in flash_info. | | The current implementation uses GPIO to drive the highest 6 address pins because of | hardware limitations. This method should be customized for use on the target hardware. | | Parameters: | | IN info Provides the flash device's 'Base Address' within the target hardware's | memory space. | IN addr The local address to reference. This is treated as an offset from the | baseAddr. | | Returns: | | uint16 The data read from the device at the given address. (effectively | 'return baseAddr[addr];' ) | | Precondition: | | ArrayState: Any | Hardware: Initialized such that '*baseAddr=0x1234' would write 0x1234 to device | base address 0. | | Postcondition: | | ArrayState: Unchanged | | Note: | | Should be made 'inline' if possible, depending on target compiler & hardware, | for efficiency purposes. | *-----------------------------------------------------------------------------------------*/ uint16 TMPL_ReadWord ( const flash_info * info, uint32 addr ); #endif /*TARGET_H_*/