Professional Documents
Culture Documents
Preliminary Data
Owner Name E-mail Division Site Sanjeev Varshney/Parul Agarwal Information classified Confidential - Do not copy (See last page for obligations) sanjeev.varshney@st.com parul.agarwal@st.com HED HVD R&D Greater Noida
Abstract
This document describes the functionality of the Serial Flash controller in detail. The Serial Flash controller is used to interface with the standard SPI protocol-based Serial Flash devices.
Key words
Quad, FSM, CS, DI, DO, Hold, WP, dual output, SPI
Revision history
Date Revision Author Modication description Updated spec for the new read mode (for improving performance of read accesses up to 40 Mbits/sec). Some general quality related changes. Added section on changing the SPI mode and added a bit in the SPI_MODE_SELECT register to facilitate the mode-change sequence. Updated with respect to the review comments received from G. Mathew. Added section on the Dual output mode support and corresponding pin changes. Open points: write and erase support.
20-Dec-2005
1.0
Sanjeev Varshney
13-Feb-2006
1.1
25-Oct-2007
1.2
June 2011
This is preliminary information on a new product now in development or undergoing evaluation. Details are subject to change without notice.
1/77
www.st.com
Date
Revision
Author
Modication description Updated the quad mode and write/erase support (fast sequence mode). Reorganized the document. Updated for integration guidelines. Reorganized the document in new format, more aligned to new spirit template. Open points/future enhancements: - separate clock input for the Serial Flash controller (today it is same as the EMISS system clock). - Macronix memories latest mode, that is, quad DDR mode 75 Mbits /sec) to be dened. Updated document with drivers team feedback and aligned with validation application note. Updated the description of the SPI_CLK_DIV, SPI_FAST_SEQ_FLASH_STA_DATA and SPI_STATUS_WR_TIME registers. Updated the SPI_CONFIG_DATA register with footnote. Added detail in the Section 4.1.9: Fast sequence boot mode. Added independent SPI clock details. Ported in latest spirit based template and incorporated feedbacks received from different people like Linux team, Validation team, verication team. Updated by documentation team for documentation style guide adherence. Updated to add 32 bit address serial ash support. Register description SPI_FAST_SEQ_ADD_CFG is updated. Updated to add the reset state of pads to z Note added in the spi_fast_seq_data register
15-May-2008
1.3
06-Jul-2009
2.0
Parul Agarwal
07-Jul-2009
2.1
Parul Agarwal
31-Jul-2009
2.2
Parul Agarwal
17-Jun-2010
3.0
Parul Agarwal
14-Sep-2010
3.1
Shilpi Jain
2/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
Contents
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 1.2 Referenced documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Features list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
System overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 IP block context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.1 3.1.2 3.1.3 Pad connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Comms integration guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Supported opcodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 3.3
Multiple-page sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Read multiple page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 Multiple-page write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Chip select bit functioning for DATA phase in single- and multiple-page sequences 29
Rev B
3/77
Contents 4.1.9
Boot flow from system prospective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Fast sequence boot mode flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Registers required for the fast sequence boot mode . . . . . . . . . . . . . . . . . . . . . . . 32 4.1.10 Changing modes of Serial Flash controller . . . . . . . . . . . . . . . . . . . . . . 33
Fast sequence mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
Error conditions and error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Debug modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.5.1 4.5.2 Memory requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Interrupt behavior and requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Information classified Confidential - Do not copy (See last page for obligations)
System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.6
Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.6.1 4.6.2 Hard reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Soft reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1 5.2 5.3 Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Clock relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Generated clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Bus interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.1 External hardware interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8 9
4/77
Rev B
Contents
10
11
A.2
Rev B
5/77
Introduction
Introduction
This document describes the Serial Flash controller module housed inside the EMI subsystem (EMISS). The EMISS has a separate serial bus to interface with the Serial Flash devices. The Serial Flash controller is designed to communicate with the Serial Flash devices.
1.1
Referenced documents
1.2
Glossary
FSM T2 Quad EMISS CS DI DO Hold WP I/P O/P BIDI SPI Contig mode NA Fast sequence mode STBus Type 2 Quadruple mode of Serial Flash EMI subsystem Chip select of Serial Flash Data in port of Serial Flash Data out port of Serial Flash Hold pin of Serial Flash Write protect pin of Serial Flash Input Output Bidirectional Serial peripheral interface Contiguous mode Not applicable
6/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
Atmel Serial Flash memory, AT25F4096 datasheet Atmel Serial Flash memory, AT25FS040 datasheet ST Serial Flash memory, M25P40 datasheet SST Serial Flash memory, SST25LF020A datasheet Winbond Flash memory, W25x10 datasheet Macronix Flash datasheet, MX25L1635D SST Serial Flash datasheet, S71359 Winbond Serial Flash datasheet, W25X10_20_40_80b Winbond Quad Serial Flash memory, W25Q80_16_32b
2
2.1
2.2
Features list
The main features of the Serial Flash controller are: Serial Flash boot support: x1 and x2 boot support using the legacy mode x1, x2, x4 boot support using the fast sequence boot mode
Fast sequence mode features: Read, write and erase support x1, x2 and x4 support for different operations Flexibility to support any available device size Programmable engine to support various Serial Flash devices Variable size data transfer support Capability to support 32 bit address Serial Flash devices Pacing signal support to communicate with FDMA/CPU for large data transfers Support for unaligned access Support for mode 0 (CPOL=0, CPHA=0) of the SPI protocol Flexibility to operate serial bus on various frequencies with different system clocks using the programmable clock division ratio Software write protect (WP) supported
Note:
x1, x2 and x4 refer to the data pad conguration of the Serial Flash. For more details, refer to Section 3.1.1: Pad connections.
Rev B
7/77
Information classified Confidential - Do not copy (See last page for obligations)
System overview
3
3.1
System overview
IP block context
The Serial Flash controller is integrated within the EMI subsystem (EMISS). The Figure 1 shows the EMISS in a SoC context. However, the IP can also be delivered as a stand-alone. The Serial Flash controller provides seamless interface to the Serial Flash device using the SPI protocol. The Serial Flash controller is accessible to system initiators through the Type2 interface of the EMISS. The main function of the Serial Flash controller is to take the STBus requests coming from the interconnect side and convert them into serial access (SPI protocol) to communicate with the Serial Flash devices.
Information classified Confidential - Do not copy (See last page for obligations)
Figure 1.
SoC
The Figure 2 shows the system-level view of the Serial Flash controller embedded inside the EMISS. Figure 2. Serial Flash controller inside EMISS
CS FDMA SPI_CLOCK EMI DI Type2 IC RGV EMI buffer Router Serial Flash controller Padlogic DO HOLD Serial Flash
CPU
NAND
WP
EMISS
8/77
Rev B
System overview
3.1.1
Pad connections
A typical Serial Flash can have different data bus widths in different congurations. For example in: x1 pad conguration: CS; SPI_CLOCK; and unidirectional DI and DO pads are used x2 pad conguration (dual output - legacy mode) CS; SPI_CLOCK; one unidirectional DI pad; and one bidirectional data pad DO are used x2 pad conguration (dual I/O - fast sequence mode) CS; SPI_CLOCK; and two bidirectional data pads DI and DO are used x4 pad conguration CS; SPI_CLOCK; and four bidirectional data pads DI, DO, HOLD and WRITE PROTECT are used These different congurations (x1, x2, x4) of Serial Flash decides the pad requirement at the SoC level. The Serial Flash controller generates six enable signals corresponding to six SPI pads. These enable signals are used to control the pad direction for all modes of the Serial Flash controller. The enables generated by the serial ash controller drives all the spi pads in input mode during reset. This is done to avoid driving the pads during reset. All the pads can be tristated at SoC level on reset for the serial ash to power on and off safely. As soon as the reset is deasserted and clock arrives the pads are put in their respective required modes. The Table 2 gives the values of the enable signals generated by the Serial Flash controller after the reset is over. Table 2.
Enables SPI_DATA_IN_ENB SPI_DATA_OUT_EN SPI_HOLD_ENB SPI_WR_PROTECT_ENB SPI_CLK_ENB SPI_CS_ENB
Polarity of enables
Value after reset Pad direction is over 0 1 1 1 1 1 Input mode Output mode Output mode Output mode Output mode Output mode
The pad requirements for different type of congurations are given in the following table:
Rev B
9/77
Information classified Confidential - Do not copy (See last page for obligations)
x2 (dual output legacy mode/FSM Output pad mode) x2 (dual I/O - fast sequence mode) x4 Output pad Output pad
Can either be tied appropriately at the top Bidirectional pad level, or the Serial Flash controller enable signals can be used to drive Bidirectional pad inactive value 1. Bidirectional pad Bidirectional pad Bidirectional pad
10/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
System overview
The Figure 3, Figure 4 and Figure 6 show the pad connections for x1, x2 and x4 congurations of the Flash, respectively. Figure 3. x1 pad connection
SPI_NOT_CS SPI_CLOCK
CS SPI_CLOCK
CS CLOCK
SPI_DATA_OUT
DO
DI
Serial Flash
SPI_DATA_IN
DI Padlogic
DO
Figure 4.
SPI_CS_ENB SPI_NOT_CS CS
CS
SPI_CLK_ENB SPI_CLOCK
Serial Flash controller SPI_DATA_OUT_EN SPI_DATA_OUT SPI_DBL_DATA_IN DO DI
SPI_CLOCK
CLOCK
Serial Flash
SPI_DATA_IN
DI
DO
Padlogic
Rev B
11/77
Information classified Confidential - Do not copy (See last page for obligations)
Serial Flash controller functional specification x2 pad connection (dual I/O mode)
SPI_CS_ENB SPI_NOT_CS CS CS
Serial Flash Information classified Confidential - Do not copy (See last page for obligations)
12/77
Rev B
System overview
SPI_DATA_OUT_EN SPI_DATA_OUT Serial Flash controller SPI_DATA_IN_ENB SPI_DATA_OUT_QUAD SPI_DATA_IN DI DO Serial Flash SPI_DBL_DATA_IN DO DI
3.1.2
Rev B
13/77
Information classified Confidential - Do not copy (See last page for obligations)
COMMS subsystem
SPI_DATA_IN
SPI_DATA_IN
EMISS
3.1.3
Supported opcodes
The different opcodes supported by different modes of the Serial Flash controller are provided in the following table: Table 4.
Modes
LD 4/8/16/32 N/A
Note:
Accessing opcodes other than those mentioned above generate error conditions by setting the INIT_R_OPC signal as high.
14/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
System overview
3.2
Hardware interfaces
The Serial Flash controller has one Type 2 RGV target interfacing with EMI buffer through router. This interface is utilized by the CPU for booting and programming the Serial Flash controller registers to congure the IP in the required mode. The Serial Flash controller provides two DREQs (SPI_DATA_DREQ and SPI_SEQ_DREQ) to interface with FDMA/HOST. The DREQs communicate the status of the Serial Flash controller. Use the SPI_DATA_DREQ signal to move the data in and out of the FIFO. Use the SPI_SEQ_DREQ signal to program the sequence registers. Connect the SPI_DATA_DREQ and SPI_SEQ_DREQ signals with ILC to manage interrupts to the HOST. For more details, refer to Section 4.5.2: Interrupt behavior and requirements. The Figure 8 shows an example connection of DREQs with the CPU and FDMA.
Figure 8.
CS SPI_CLOCK FDMA EMI buffer Router SPI controller Padlogic DI DO HOLD WP Quad Serial Flash
IC CPU
EMISS
3.3
Functional components
Not applicable.
Rev B
15/77
Information classified Confidential - Do not copy (See last page for obligations)
4
4.1
4.1.1
After reset, the Serial Flash controller is ready to boot in the legacy normal mode. There are three legacy modes: normal mode fast read mode
The contiguous mode is present in addition to the three legacy modes. This is a performance enhancement mode, which can be combined with any of the three legacy modes. For more details, refer to Section 4.1.7: Contiguous mode. The Figure 9 illustrates the modes of the Serial Flash controller. These modes are described in detail in later sections. Figure 9. Serial Flash controller modes
Normal mode
16/77
Rev B
4.1.2
Conguration block
Clock divider
SPI_CLOCK
Interconnect
STBus (RGV) interface Padlogic Main controller SPI data and enable pins to padlogic
MODE_SPI_CLK_DIV
Fast-sequence controller
The STBus interface receives STBus requests and manages responses to the interconnect. It triggers state machines of the main controller block or the fast-sequence controller block to initiate SPI transactions. The STBus interface block also recognizes conguration requests and forwards these requests to the conguration block. The conguration block handles the incoming conguration requests from the interconnect side. This block provides the read/write functionality for all the conguration registers. The main controller block is responsible for the functioning of legacy modes. The Serial Flash controller has a congurable clock divider to tune the EMISS clock for Serial Flash devices. This divider is congured through a static signal MODE_SPI_CLK_DIV<7:0> after reset, and can be programmed afterwards through the SPI_CLK_DIV register. The static signal MODE_SPI_CLK_DIV<7:0> provided at the top level of the Serial Flash controller gives exibility to different SoCs to choose any division ratio for boot. It is mandatory to tie these pins at the SoC integration level with a minimum value of divide by 8 to allow booting from slow serial devices. After booting, the SPI_CLK_DIV register can be
Rev B
17/77
programmed to dynamically change the frequency. The clock division ratio for this register ranges from divide by 2 to 256 in steps of 2, that is 2, 4, 6, 8,......, 254 and 256. The fast-sequence controller block is responsible for handling the fast sequence mode operations. It decodes the instructions written in the fast-sequence registers and executes them sequentially. It also has a state machine to generate control signals for the fast sequence mode. This block has a FIFO embedded inside to store data. While performing Flash writes, the data to be written to the Flash is stored in this FIFO. Similarly, during Flash read operations, the data read from the Flash is stored in this FIFO. The padlogic block is responsible to re-time incoming and outgoing data signals to ease timing closure. This block also generates information regarding the stalling of the Flash interface by keeping track of the FIFO status. This block also manages serial to parallel conversion and vice-versa.
4.1.3
18/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
4.1.4
Normal mode
By default, the Serial Flash controller is in the normal mode. This mode supports read access to the Serial Flash. This mode supports command (03h) of Serial Flash devices. Although the opcodes supported are higher than 4 bytes, the granularity of one SPI transaction is only 4 bytes. That is, the Serial Flash controller breaks opcodes greater than 4 bytes into 4 bytes access, aligned at the 4 bytes boundary. Due to this, the Serial Flash controller consumes 64 SPI_CLOCK cycles (32 cycles for opcode and address) for fetching every 4 bytes of data from the Flash. For better efciency, this mode can be combined with contiguous mode. For more details, refer to Section 4.1.7: Contiguous mode.
4.1.5
4.1.6
Rev B
19/77
SPI_CLOCK
CS
8 bits
24 bits
8 bits
DI switches to output
DO
3 1
4.1.7
Contiguous mode
The contiguous mode is the performance enhancement mode. When enabled, it improves the performance of the Serial Flash controller for back-to-back contiguous accesses made to Flash memory locations. To congure the IP in the contiguous mode, program the CONTIG_MODE bit of the SPI_MODE_SELECT register. The contiguous mode is not a stand-alone mode. It must be selected in conjunction with any of the legacy modes. The possible congurations of the legacy modes with the contiguous mode are given in the SPI_MODE_SELECT register. In this mode, if contiguous and back-to-back requests are made to the Serial Flash controller, it performs the complete read access simultaneously, thereby, saving on the command and address cycles for multiple requests. As a result there is no additional overhead of address and command cycles for every four data bytes. The contiguous mode reads are benecial only when STBus asserts back-to-back contiguous Flash read requests to the Serial Flash controller. In case a non-contiguous read or register access is made in between contiguous reads, the Serial Flash controller restarts a new SPI sequence, that is command, address and data read cycles are asserted once again. The Serial Flash controller treats the STBus requests as back-to-back when the next STBus request arrives within 8 SPI_CLOCK cycles. Requests are contiguous when consecutive STBus transaction addresses are 4 bytes apart, that is, address of the nth transaction = address of (n-1) transaction + 4.
20/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
The example waveforms of the contiguous and normal modes are given in the following gure: Figure 12. Normal and contiguous mode waveform comparison
CLOCK
INIT_REQ SPI_CLOCK
ADDR[24]
DATA[32]
OPC[8]
ADDR[24]
DATA[32]
INIT_R_DATA
xxxxh
abcd
wxyz
CLOCK
INIT_REQ
SPI_CLOCK
001h
002h
003h
SPI_NOT_CS
The reads from non-contiguous locations with the CONTIG_MODE bit set is slower as compared to the normal mode. This is because the Serial Flash controller always pre-fetches 1 byte of data from the Serial Flash for every STBus request. This extra byte fetched is discarded as it is not required. This impacts the performance in case of noncontiguous requests. Thus, it is recommended to use normal mode when reading from the non-contiguous locations.
Rev B
21/77
Information classified Confidential - Do not copy (See last page for obligations)
INIT_ADDR(31:2) 000h
001h
002h
4.1.8
22/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
The fast sequence mode operation is based on the contents of the fast-sequence registers. The complete instruction set is enlisted in the following table: Table 6. Instruction set of the fast sequence mode
Instruction CMD 1 CMD 2 CMD 3 CMD 4 CMD 5 ADD 1 ADD 2 Comment Shifts the command written in the SPI_FAST_SEQ_OPC1 register to the Flash. Shifts the command written in the SPI_FAST_SEQ_OPC2 register to the Flash. Information classified Confidential - Do not copy (See last page for obligations) Shifts the command written in the SPI_FAST_SEQ_OPC3 register to the Flash. Shifts the command written in the SPI_FAST_SEQ_OPC4 register to the Flash. Shifts the command written in the SPI_FAST_SEQ_OPC5 register to the Flash. Shifts the address written in the SPI_FAST_SEQ_ADD1 register to the Flash. Shifts the address written in the SPI_FAST_SEQ_ADD2 register to the Flash. Reads/writes the DATA_BYTE1 bit written in the SPI_FAST_SEQ_FLASH_STA_DATA register to the Flash. Reads the DATA_BYTE2 bit written in the SPI_FAST_SEQ_FLASH_STA_DATA register to the Flash. Writes the DATA_BYTE1 and DATA_BYTE2 bits written in the SPI_FAST_SEQ_FLASH_STA_DATA register to the Flash. MODE DUMMY DATA_WR DATA_RD WAIT JUMP_TO_BOOT JUMP_TO_RPT STOP Shifts the data written in the SPI_MODE_BITS register to the Flash. Shifts the data written in the SPI_DUMMY_BITS register to the Flash. Writes the data to the Flash. Reads the data from the Flash. Waits for the time written in the SPI_PROGRAM_ERASE_TIME register. Jumps to the operations written in the SPI_QUAD_BOOT_READ_SEQ1 register. Jumps to the operations written in the SPI_REPEAT_SEQ1 register. Last instruction to end the sequence.
Sequence Operand bits 0001 0010 0001 0011 0100 0101 0001 0010 0010 0001 (Read status register 1) or (Write status register 1) 0011
0010 STATUS_REG_DATA (Read status register 2) 0011 (Write status register 1 and 2)
0100 0101
Rev B
23/77
The fast sequence mode is broadly classied into two types depending upon the data transfer size: single-page sequence multiple-page sequence The page size of a typical Serial Flash is equal to 256 bytes. Use the single-page sequence for transferring data of size less than or equal to one Serial Flash page. Use the multiplepage sequence for transferring data of size greater than one Serial Flash page. Only one type of operation can be performed at a time. The different types of permitted operations are: erase read write write status register Do not club the read and write operations in one sequence because the FIFO for the data is same for read and write. The read status register can be clubbed with the read and write sequences, but the write status register has to be an exclusive sequence.
Single-page sequence
Single-page read sequence
The single-page read sequence is meant for reading data less than or equal to 256 bytes from the Serial Flash. The execution of events in case of the single-page read sequence is: The software programs read operation sequence in the sequence registers. The software starts the sequence by writing the START_SEQ_BIT bit of the SPI_FAST_SEQ_CFG register. The Serial Flash controller generates the SPI transaction on serial bus. On receiving appropriate command and address, the Flash starts returning data to the Serial Flash controller. The Serial Flash controller stores the data received from the Flash in the internal FIFO. The Serial Flash controller asserts the SPI_DATA_DREQ signal when 256 bytes are written to the FIFO (SPI_DATA_DREQ must be programmed for half FIFO in case of single-page transfers). FDMA/CPU reads the data from the FIFO on receiving the SPI_SEQ_DREQ and SPI_DATA_DREQ signals. Note: In case of Flash read, the FDMA/CPU reads data from the FIFO. In case of Flash write, the FDMA/CPU writes data in the FIFO. Using single-page sequences, the Serial Flash controller performs the x1, x2 and x4 read/write operations and erase operations. Note: The Serial Flash controller asserts the SPI_DATA_DREQ signal when 256 bytes of data is read from the Flash and stored in the FIFO. However, the system has the exibility to poll the SPI_FAST_SEQ_STA register to determine the data available in the FIFO. In this case, it is not mandatory to program the SPI_DATA_DREQ settings. For transferring less than 256 bytes of data, the HOST/CPU can poll the SPI_FAST_SEQ_STA register and no settings of SPI_DATA_DREQ are required. This is particularly useful in cases when DREQ signals are not connected, and also helps in debugging.
24/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
The dataow of the single-page read sequence is given in Figure 13. Figure 13. Data ow for single-page sequence
(3) Flash starts returning data to the controller. Serial Flash (4) Data received from the Flash = 256 bytes. SPI transaction terminated by the controller.
FIFO
SPI_CLOCK
CSn
DATA_OUT
OPC + ADDR
DATA_IN
Rev B
25/77
Information classified Confidential - Do not copy (See last page for obligations)
(6) FDMA/CPU fetches data from the FIFO after its turn around time.
In case of Flash read, the FDMA/CPU reads data from the FIFO. In case of Flash write, the FDMA/CPU writes data in the FIFO. Using the single-page sequences, the Serial Flash controller performs the x1, x2 and x4 read/write operations and erase operations.
Multiple-page sequences
Multiple-page sequences are used to support transfer size greater than 256 bytes. In this mode, the software programs the required data transfer size in the SPI_FAST_SEQ_TRANS_SIZE register. To execute the multiple-page sequence, program the following two set of registers: SPI_FAST_SEQn registers for the initialization sequence SPI_REPEAT_SEQ1 and SPI_REPEAT_SEQ2 registers for the repeat sequence It is mandatory to program both the set of registers (initialization and repeat sequence registers) for multiple-page operations.
26/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
The Figure 14 shows a typical example of Serial Flash controller, FDMA/CPU and Serial Flash. The coordination between these components starts from the moment when the FDMA/CPU congures the Serial Flash controller for multiple-page sequence until the time when the FIFO is full and the Serial Flash controller stalls the serial interface by terminating the SPI transaction. The Figure 15 shows the continuation of events after the FIFO is full and the FDMA continues reading data from the FIFO. Figure 14. Events until the FIFO is full in multiple-page read sequence
(7) FIFO full: SPI transaction terminated by the controller.
(4) Half FIFO SPI_DATA_DREQ asserted by the controller. FDMA/CPU (5) FDMA/CPU fetches data from the FIFO after its turn around time. FIFO
Serial Flash
SPI_CLOCK
CSn
DATA_OUT
OPC + ADDR
DATA_IN
Data
Rev B
27/77
Information classified Confidential - Do not copy (See last page for obligations)
Figure 15. Events after the FIFO is full in multiple-page read sequence
FDMA/CPU
(10) FIFO available: new SPI Serial Flash transaction started by the controller.
SPI_CLOCK CS assertion managed by the controller. New address calculated and provided by the controller DATA_OUT OPC + ADDR
CSn
DATA_IN
Data
See Table 7 and Table 8 for an example of programming the registers for multiple-page read (quad mode). Table 7.
Instruction
CMD 1
SPI_FAST_SEQ_OPC1
CMD 2
SPI_FAST_SEQ_OPC2
28/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
Table 8.
Instruction
CMD 3
SPI_FAST_SEQ_OPC3
ADD 1
MODE
SPI_MODE_BITS
Write the mode bits information in the SPI_MODE_BITS register. Write the dummy bits to be written to the Flash. Write the number of SPI_CLOCK cycles and number of pads required to shift out the dummy bits to the Flash. Read the data from the Flash. End operation. Program the SPI_REPEAT_SEQ2 register.
DUMMY
SPI_DUMMY_BITS
DATA STOP
SPI_FAST_SEQ_DATAn
Multiple-page write
The multiple-page write operation is similar to the multiple-page read operation. The Serial Flash controller rst executes the SPI_FAST_SEQn registers until it encounters a JUMP instruction. By executing the SPI_FAST_SEQn registers sequence, it initializes the memory into the desired mode. After reaching the JUMP instruction, it starts executing the repeat sequence registers. For example in a typical Flash, the Serial Flash controller issues the write command, address and one page data to the Flash (Flash cannot write more than a page at a time). After the FIFO data has been transferred to the Flash, FIFO gets empty and the SPI_DATA_DREQ signal is asserted by the Serial Flash controller so that the FDMA/CPU writes the consecutive data in the SPI_FAST_SEQ_DATAn registers. After the data is shifted to the Flash, the Serial Flash controller de-asserts the chip select and executes the WAIT instruction. In this instruction, the Serial Flash controller waits for the pre-programmed wait counter to complete until the memory completes its page program time. In the write multiple page sequences, the Serial Flash controller stalls both the interfaces (STBus interface and serial interface). For the STBus interface, it stops giving grant to FIFO write requests in case the FIFO is full. For the SPI interface, it terminates the SPI transactions on serial bus by driving the chip select low, in case the FIFO_EMPTY condition arrives. When the data for the consecutive pages is again written in FIFO, the Serial Flash controller repeats the repeat sequence. This time the address sent to the Serial Flash is calculated and incremented by the Serial Flash controller itself. The Serial Flash controller keeps on repeating the repeat sequence until the data written in the Flash is equal to the transfer size programmed in the SPI_FAST_SEQ_TRANS_SIZE register. Once the transfer size is done, the STOP instruction is served and the Serial Flash controller is ready again to receive new sequences of operation from the CPU/FDMA.
Rev B
29/77
Information classified Confidential - Do not copy (See last page for obligations)
Write the starting address of the page, number of SPI_CLOCK cycles and number SPI_FAST_SEQ_ADD1 of pads required to shift out the address to Program the SPI_FAST_SEQ_ADD_CFG the Flash. Also, set the chip select SPI_REPEAT_SEQ1 de-assertion register. (CS_DEASSERT_FOR_ADD1) bit.
See Table 9 and Table 10 for an example of programming the registers for multiple-page write (quad mode in winbond Flash). Table 9.
Instruction
CMD 1
SPI_FAST_SEQ_OPC1
Write the data to be written to the status SPI_FAST_SEQ_FLASH register. Set the chip select de-assertion STATUS_REG_DATA _STA_DATA bit (CS_DEASSERT) and number of pads required. JUMP SPI_REPEAT_SEQ1 Jump to the repeat sequence register.
Table 10.
Instruction
CMD 3
SPI_FAST_SEQ_OPC3
CMD 4
SPI_FAST_SEQ_OPC4
ADD 1
SPI_FAST_SEQ_DATAn Write the data to be written to the Flash. SPI_PROGRAM_ERAS E_TIME Wait for counter to complete the Flash page program time. End operation. Program the SPI_REPEAT_SEQ2 register.
Note:
As mentioned in the single page write sequence, the software has to rst write the sequence, and then write one page data in the FIFO and nally write the START_SEQ_BIT bit of the SPI_FAST_SEQ_CFG register.
30/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
CMD 2
SPI_FAST_SEQ_OPC2
Chip select bit functioning for DATA phase in single- and multiple-page sequences
The Serial Flash controller offers exibility to congure opcode phase, address phase, mode phase, data phase and dummy phase as per Serial Flash requirements. The exibility to assert/de-assert CS after each of them has been provided to make them independent and also to support changing protocols of different Serial Flashes. However, the last phase of a sequence should always have the conguration to de-assert CS after the last phase is over. Note: One particular transaction is the sequence of events happening during one CS assertion. The purpose of this CS de-assert bit is to cater to future read/write protocol of Serial Flash devices in which there can be some requirement to send some other instruction bits after the DATA read/write phase is complete. For example, executing the following read operation on Serial Flash requires CS conguration to be 0 during the DATA phase: Opcode -> Address -> Dummy bits -> Data read -> Mode bits For the above sequence, the data CS de-assertion bit must be congured to 0 so that the CS remains asserted after the DATA phase as Mode bits are required to be send to the Flash device for completing the sequence. In this case, it is mandatory to congure the CS_DEASSERT bit of the SPI_MODE_BITS register to 1 so that the CS gets de-asserted after the mode phase is over. However, if the CS is programmed to remain asserted after the last phase of the transaction is over, though the Serial Flash controller would not de-assert the CS itself, but it will go into a hang state and the sequence would not get over. As a result, the CPU/FDMA would not be able to program the next sequence and the Serial Flash controller would not start with another sequence and the IP would require a reset. This bit does not provide the exibility to keep CS asserted in between one multiple-page data transfer. The Serial Flash controller manages the CS assertion and de-assertion across the multiple-page data transfer. Figure 16. CS asserted after data phase is over
CSn
CLOCK
DATA_OUT
Opcode
Address
Dummy
Mode
DATA_IN
Data
Rev B
31/77
Information classified Confidential - Do not copy (See last page for obligations)
4.1.9
The system follows certain steps to boot in the fast sequence boot mode. These steps are illustrated in the following gure: Figure 17. Booting from Serial Flash
CPU executes the cached instruction to wait for 100 SPI_CLOCK cycles.
CPU programs the SPI_MODE_SELECT register to bring the Serial Flash controller in the fast sequence boot mode.
Serial Flash Controller initializes the Serial Flash in the required mode.
32/77
Rev B
The Serial Flash controller does not check the status of the serial device before issuing any sequence to the device. This should be managed and looked upon by the CPU/HOST before programming any sequence in the Serial Flash controller. For example, if any read sequence is programmed and executed during the time when the serial device is busy in executing the erase/write command then the read command issued by the Serial Flash controller would be ignored by the Flash. Hence, it is mandatory for the CPU/HOST to check the status of the Flash before programming the Serial Flash controller.
SPI_CLOCK CSn
DATA_OUT
Boot requests serviced to fetch data from Flash Data returned by the Flash
Rev B
33/77
Information classified Confidential - Do not copy (See last page for obligations)
SPI_QUAD_BOOT_READ_SEQ1 and These registers contain the quad read command sequence required by the SPI_QUAD_BOOT_READ_SEQ2 Flash.
An example of programming the registers for the fast sequence boot mode in x4 conguration is given in the following table: Table 12.
Instruction
CMD 1
SPI_FAST_SEQ_OPC1
CMD 2
SPI_FAST_SEQ_OPC2
Write the data to be written to the status STATUS_REG_ SPI_FAST_SEQ_FLASH register. Set the CS de-assert DATA _STA_DATA (CS_DEASSERT) bit, number of bytes eld and other required information. JUMP Jump to the SPI_QUAD_BOOT_READ_SEQn register operation.
34/77
Rev B
Table 13.
Instruction CMD 3
ADDR1
Write the number of SPI_CLOCK cycles SPI_FAST_SEQ_ADD1 and number of pads required to shift out the SPI_FAST_SEQ_ADD_CFG address to the Flash. Write the mode bits to be written to the Flash. Write the number of SPI_CLK cycles and number of pads required to shift out the mode bits to the Flash. Write the dummy bits to be written to the Flash. Write the number of SPI_CLK cycles and number of pads required to shift out the dummy bits to the Flash. Read the data from the Flash. End sequence. Program the SPI_QUAD_BOOT_R EAD_SEQ2 register. Program the SPI_QUAD_BOOT_R EAD_SEQ1 register. Information classified Confidential - Do not copy (See last page for obligations)
MODE
SPI_MODE_BITS
DUMMY
SPI_DUMMY_BITS
DATA_RD STOP
4.1.10
4.2
Rev B
35/77
4.3
4.4
Debug modes
Not applicable.
4.5
4.5.1
System requirements
Memory requirements
The conguration space allocated to the Serial Flash controller is from 0x2000 to 0x2FFF, that is, 4 Kbytes. At present, the Serial Flash controller uses only 0x2000 to 0x2500. Rest of the memory space is reserved. The Figure 19 shows in detail the memory requirement of the Serial Flash controller. For more information, refer to Chapter 9: Registers.
Information classified Confidential - Do not copy (See last page for obligations)
36/77
Rev B
0x0000
0x164
0x500 Reserved
0xFFF
Rev B
37/77
Information classified Confidential - Do not copy (See last page for obligations)
SPI_FAST_SEQ_OPCn registers
4.5.2
4.6
Initialization
Information classified Confidential - Do not copy (See last page for obligations)
Not applicable.
4.6.1
Hard reset
Hard reset (rst_n) is provided to reset the Serial Flash controller. It is active low. After hard reset, the IP is in the default normal boot mode.
4.6.2
Soft reset
Soft reset is available in the Serial Flash controller for resetting the fast sequence mode registers and ushing the FIFO contents. For more details, refer to Chapter 9: Registers. The soft reset is not applicable to legacy modes, that is, the IP remains in the fast sequence mode after the soft reset is applied. The IP does not go to the default normal boot mode after the soft reset is applied.
38/77
Rev B
Clocking
Clocking
The Serial Flash controller operates at 100 MHz. This clock is same as the EMISS clock. The Serial Flash devices are clocked through the Serial Flash controller using SPI_CLOCK. This SPI_CLOCK is generated inside the Serial Flash controller by dividing the EMISS clock as dened by the clock division ratio in the SPI_CLK_DIV register. Depending upon the type of Flash used by the system, SPI_CLOCK can be managed by programming the suitable clock division ratio.
5.1
Frequencies
Table 14.
Clock name Min CLOCK SPI_CLOCK 0 0 Typical 100 MHz 50 MHz Max 100 MHz 50 MHz
5.2
Clock relationships
The SPI_CLOCK and CLOCK are synchronous clocks.
5.3
Generated clocks
The SPI_CLOCK is a generated clock. It is generated by the clock divider inside the Serial Flash controller. The clock divider runs on the EMISS clock and the division ratio is controlled by the SPI_CLK_DIV register. After reset, the mode pin (MODE_SPI_CLK_DIV) decides the division ratio. This mode pin is brought at the top so that the desired frequency can be achieved at the SoC for booting. The generated SPI_CLOCK is used to clock the external Flash. It is also used by the Serial Flash controller to clock the incoming and outgoing data to the external Flash.
Rev B
39/77
Information classified Confidential - Do not copy (See last page for obligations)
Bus interfaces
Bus interfaces
Table 15.
Bus type T2-RGV
Table 16.
6.1
40/77
Rev B
7.1
7.2
Point-to-point connections
Information classified Confidential - Do not copy (See last page for obligations) Rev B 41/77
Not applicable.
8
Table 17.
Signal name rst_n clock
spi_validnextcycle
early
clock
I O I I O I
early
clock clock
init_r_opc
clock
spi_cfgnotdat
early
clock
42/77
Rev B
spi_buff_bank
clock
System
O O O I I
early
spi_clock spi_clock
Pad interface
O I O I O O O
spi_data_out_en
early
clock
O O O O
Rev B
43/77
spi_data_dreq
clock
I I O I I
early
clock Information classified Confidential - Do not copy (See last page for obligations) clock clock Test
early early
clock clock
44/77
Rev B
Registers
9
9.1
Registers
Address blocks and sub-blocks
The conguration space available to the Serial Flash controller is 4 Kbytes from 0x02000 to 0x02FFF. All programming registers are accessible through the Type 2 port. Table 18. SPIRIT address block programming_and_data_transfer_bus
Size 4K Address block SPI Description SPI programming registers Information classified Confidential - Do not copy (See last page for obligations)
9.1.1
Table 19.
Summary table
Register summary table
Description Clock division register Contiguous mode, fast read mode, dual output mode, fast sequence mode and fast sequence boot mode selection. Congure the Serial Flash controller for different parameters of the Serial Flash supported Single-bit status register reecting when mode of SPI (in the SPI_MODE_SELECT register) can be changed Total number of bits to be read/written from/to the Flash Starting address of the memory location of the Flash to be read or written Address conguration information required for shifting the address in the Flash Opcodes required to be shifted to the Flash along with their conguration High performance mode sequence bits required by some Serial Flash devices for improved performances Dummy bits information required by some Serial Flash devices Data to be read or written from the Flash status register and its conguration required See page 47 page 48
0x020
SPI_CONFIG_DATA
page 49
0x028
SPI_STATUS_MODE_CHANGE
page 50
0x124
page 54
0x128
SPI_DUMMY_BITS
page 56
0x12C
SPI_FAST_SEQ_FLASH_STA_DATA
page 57
Rev B
45/77
Address offset Register 0x130 0x134 0x138 0x13C 0x140 SPI_FAST_SEQ1 SPI_FAST_SEQ2 SPI_FAST_SEQ3 SPI_FAST_SEQ4 SPI_FAST_SEQ_CFG
Description
See page 58
Sequence to be programmed by software, which are executed by the Serial Flash controller
Conguration required by the fast sequence and fast sequence boot modes Contains information about the status of the sequence written in the sequence registers Initialization sequence required by the Flash to come in the quad mode Quad read command sequence for reading data in the quad mode Page program/erase time required by the Flash to perform write/erase Repeat sequences required for multiple page read/write operation Status register write time required by the Flash Data to be read or written to the Flash. The maximum size of this FIFO is 512 bytes (two memory pages)
page 62
page 64 page 65 page 66 page 67 page 68 page 69 page 70 page 71 page 72 Information classified Confidential - Do not copy (See last page for obligations)
0x300 - 0x4FF
SPI_FAST_SEQ_DATAn
page 72
46/77
Rev B
Registers
9.1.2
SPI_CLK_DIV
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 RESERVED
SPIBaseAddress + 0x10 R/W 0x02 Use this register to set the division factor of the EMISS clock received by the Serial Flash controller. By default, it is divided by two. The division ratio can vary from 2 to 256. The 0th bit of this register is tied to 0 to ensure even division factor.
Information classified Confidential - Do not copy (See last page for obligations)
[31:8] RESERVED [7:1] CLK_DIV_FACTOR: Use these bits to set the division factor of the EMISS clock. Values must be in the range from 1 to 127. 1 for division factor 2. 2 for division factor 4. ......... 127 for division factor 256. [0] RESERVED: Tie this bit to 0 to ensure that the division factor is always even. This bit is non-writable.
Rev B
47/77
Registers
SPI_MODE_SELECT
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5
Mode select
4 FAST_SEQ_BOOT_MODE 3 FAST_SEQ_MODE 2 DUAL_OUTPUT_MODE 1 0
SPIBaseAddress + 0x0018
Information classified Confidential - Do not copy (See last page for obligations)
R/W 0x00 Select the Serial Flash controller mode, such as the contiguous mode, fast read mode, dual output read mode, fast sequence mode and fast sequence boot mode by writing into different bitelds of this register. By default, the Serial Flash controller is in the normal read mode. The possible congurations of the legacy modes with the contiguous mode are given in the following table: Table 20.
Modes
Contiguous Yes
The FAST_SEQ_MODE bit must always be set while setting the FAST_SEQ_BOOT_MODE bit to bring the Serial Flash controller in the fast sequence boot mode.
[31:5] RESERVED [4] FAST_SEQ_BOOT_MODE: 0: Normal fast sequence mode. [3] FAST_SEQ_MODE: 0: Normal mode. 1: Fast sequence boot mode. 1: Fast sequence mode.
[2] DUAL_OUTPUT_MODE: Set this bit to run the Serial Flash controller in the dual data mode (0x3B). 0: Normal mode. 1: Dual output mode. [1] FAST_READ: The fast read mode is only supported with STNOTATMEL = 1, that is, for ST memories. 0: Normal mode. 1: Fast read mode. [0] CONTIG_MODE: Performance improved mode. This mode is for throughput improvement. Set this bit in case contiguous reads are required from Serial Flash. 0: Normal mode. 1: Contiguous mode.
48/77
Rev B
CONTIG_MODE
FAST_READ
RESERVED
Registers
SPI_CONFIG_DATA
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SPI_DATA_HOLD_TIME CS_SETUP_HOLD 9
MIN_CS_HIGH
SPIBaseAddress + 0x0020 R/W 0x00A00AA1 SPI conguration data. Program the Serial Flash device for chip select, data setup or hold time using this register. The minimum de-assertion width of the chip select can also be programmed.
Information classified Confidential - Do not copy (See last page for obligations)
[31:24] SPI_DATA_HOLD_TIME: Set the setup time required for the Serial Flash devices supported. Set in terms of EMISS clock. Reset value is 00. Program this parameter as follows: 0x00: Set the hold time as one EMISS clock cycle. 0x01: Set the hold time as two EMISS clock cycles. ............. 0xFF: Set the hold time as 256 EMISS clock cycles. [23:16] CS_SETUP_HOLD: Set the chip select setup/hold time for the Serial Flash with respect to the EMISS clock. The reset value is 0xA0. The chip select setup/hold time is in the range from 1 to 255. Program this parameter as follows: 0x00: Reserved. 0x01: Set the minimum setup/hold time as one EMISS clock cycle. 0x02: Set the minimum setup/hold time as two EMISS clock cycles. [15:4] MIN_CS_HIGH: Set the minimum time required for the chip select to remain high before asserting again. It is in the range from 0 to 4095 cycles. Set in terms of EMISS clock. The reset value is 0x0AA. [3:0] SPI_DEVICE: Set the part number for the Serial Flash. When STNOTATMEL is 1, the reset value is 0x1. Otherwise, the reset value is 0x4. 0x1: ST. 0x4: Atmel. Others: Reserved.
Note: The SPI_DATA_HOLD_TIME bits are now obsolete. The data hold time is managed by the hardware by retiming the data output to the Serial Flash by one EMISS clock cycle. The same is done for the data received from the Serial Flash. This parameter is kept for legacy purposes only. It is no more required to ne tune the data hold time. Note: The CS_SETUP_HOLD time and MIN_CS_HIGH time are though driven by the register values but some extra cycles are added by the controller for internal calculations. Hence, it cannot be observed as a one-to-one mapping of programmable values.
Rev B
SPI_DEVICE
49/77
Registers
SPI_STATUS_MODE_CHANGE
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 RESERVED 9 8
SPIBaseAddress + 0x0028 R 0x1 Use this register to see the status for changing the mode of the Serial Flash controller dynamically while it is in the normal mode, contiguous mode, fast read mode and dual output mode. This bit must always be monitored by the software before changing the legacy modes of the Serial Flash controller.
Information classified Confidential - Do not copy (See last page for obligations)
Note: The bit[0] holds no relevance in the fast sequence mode, where mode change must take place after the SPI_SEQ_DREQ signal is asserted.
[31:1] RESERVED [0] MODE_CHANGE: 0: Not ready for dynamic mode change. 1: Can change the mode dynamically.
SPI_FAST_SEQ_TRANS_SIZE
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 NO_OF_BITS RESERVED
SPIBaseAddress + 0x0100 R/W 0x00 This register contains the total number of bits to be written or read from the Flash. Write this register whenever data is required to be written to or read from the Flash in a sequence. The total number of bits written in this register must always be multiple of 32 bits (4 bytes), since the FIFO width is 32 bits. For example, to write a single 256-bytes Flash page, 0x800 must be written in this register.
[31:30] RESERVED [29:0] NO_OF_BITS: Number of bits to be written to the Flash or number of bits to be read from the Flash in one single sequence.
50/77
Rev B
Registers
SPI_FAST_SEQ_ADD1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 ADDRESS
SPIBaseAddress + 0x0104 R/W 0x00 This register contains the starting address of the operation required to be executed by the Serial Flash controller in the fast sequence mode. The Serial Flash controller starts sending the address by sending the MSB bit of the address to the Flash.
SPI_FAST_SEQ_ADD2
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 ADDRESS
SPIBaseAddress + 0x0108 R/W 0x00 This register contains the starting address of the operation required to be executed by the Serial Flash controller in the fast sequence mode. The Serial Flash controller starts sending the address by sending the MSB bit of the address to the Flash.
Rev B
51/77
Information classified Confidential - Do not copy (See last page for obligations)
Registers
SPI_FAST_SEQ_ADD_CFG
ADDR2_32_BIT
SPIBaseAddress + 0x010C R/W 0x00 This register contains the information of the number of SPI_CLOCK cycles required to shift out the address written in the SPI_FAST_SEQ_ADD1 and SPI_FAST_SEQ_ADD2 registers. In case of the fast sequence boot mode, this conguration is required for shifting out the corresponding request address to the boot bank. The SPI_CLOCK cycles depend upon the type of memory and command selected. For example, it may be 24 SPI_CLOCK cycles for quad data read while six SPI_CLOCK cycles for quad I/O read, depending upon the device. It also contains the information whether the present address cycles are continued by some command/data or needs to be terminated by de-asserting the CS (as in the case of ERASE commands). Also, it stores the information that the required address needs to be sent on how many pads (depends upon the device supported and operation done). Write this register either in the fast sequence mode or the fast sequence boot mode of the Serial Flash controller. The bit elds ADDR1_32_BIT & ADDR2_32_BIT are required to congure the controller for supporting 32 bit address ashes. They are set to 1 whenever 32 bit address scheme is required by the serial ash.
Information classified Confidential - Do not copy (See last page for obligations)
[31:26] RESERVED [25] ADDR2_32_BIT:Address2 is 32 bit long. 0:24 bit address 1: 32 bit address [24] CS_DEASSERT_FOR_ADD2: De-assert the chip select. 0: The chip select remains asserted after shifting out the address 2 for sending command/data. 1: De-assert the chip select after shifting out the address 2. [23:22] NO_OF_PADS_FOR_ADD2: Number of pads on which the address 2 needs to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved.
52/77
Rev B
ADDR1_32_BIT
RESERVED
RESERVED
Registers
[21:16] NO_OF_ADD2_CYCLES: Address cycles required to shift out the address 2 into the device. [15:10] RESERVED [9] ADDR1_32_BIT:Address1 is 32 bit long. 0:24 bit address 1: 32 bit address [8] CS_DEASSERT_FOR_ADD1: De-assert the chip select. 0: The chip select remains asserted after shifting out the address 1 for sending command/data. 1: De-assert the chip select after shifting out the address 1. [7:6] NO_OF_PADS_FOR_ADD1: Number of pads on which the address 1 needs to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved. [5:0] NO_OF_ADD1_CYCLES: Address cycles required to shift out the address 1 into the device.
SPI_FAST_SEQ_OPCn
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 NO_OF_SPI_CLK_CYCLES 9
SPIBaseAddress + 0x0110 + (n - 1) * 0x04 (where n = 1 to 5) R/W 0x0 This register contains the opcodes required to be executed by the Flash. When the fast-sequence operation starts after writing the SPI_FAST_SEQ_CFG register, the SPI retrieves the opcodes from these registers. This register also contains the information about the number of pads and SPI_CLOCK cycles required to shift out this opcode to the Flash.
Rev B
53/77
Information classified Confidential - Do not copy (See last page for obligations)
FLASH_OPCODE
CS_DEASSERT
NO_OF_PADS
RESERVED
Registers
[31:17] RESERVED [16] CS_DEASSERT: De-assert the chip select. 0: The chip select remains asserted after shifting the command for sending command/data. 1: De-assert the chip select after shifting the command. [15:14] NO_OF_PADS: Number of pads on which the command needs to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved. Information classified Confidential - Do not copy (See last page for obligations) [13:8] NO_OF_SPI_CLK_CYCLES: Number of SPI_CLOCK cycles required by the Serial Flash controller to shift out the command. [7:0] FLASH_OPCODE: Flash opcode required to be executed by the Flash.
SPI_MODE_BITS
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 NO_OF_SPI_CLK_CYCLES 9 8 7 6 5 4
Mode bits
3 2 1 0
CS_DEASSERT
NO_OF_PADS
SPIBaseAddress + 0x0124 R/W 0x00 This register contains the mode information required by some Serial Flash devices to perform enhanced quad read/write operations. Also, this register contains the total SPI_CLOCK cycles required to shift out the mode bits to the Flash. It also writes about the number of pads required to shift-out the mode bits and also about the chip select assertion/de-assertion after the mode bits.
[31:25] RESERVED [24] CS_DEASSERT: De-asserts the chip select. 0: The chip select remains asserted after shifting the mode bits for sending command/data. 1: De-assert the chip select after shifting the mode bits. [23:22] NO_OF_PADS: Number of pads on which the mode bits need to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved.
54/77
Rev B
MODE_BITS
RESERVED
RESERVED
Registers
[21:16] NO_OF_SPI_CLK_CYCLES: Number of SPI_CLOCK cycles required by the Serial Flash controller to shift-out the mode bits. [15:8] RESERVED [7:0] MODE_BITS: Mode bits required to enhance performance during the quad read/write operations.
Rev B
55/77
Information classified Confidential - Do not copy (See last page for obligations)
Registers
SPI_DUMMY_BITS
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 NO_OF_SPI_CLK_CYCLES 9 8 7 6 5
Dummy bits
4 3 2 1 0
CS_DEASSERT
NO_OF_PADS
SPIBaseAddress + 0x0128 R/W 0x00 This register contains the dummy bits information as required by some Serial Flash devices to perform enhanced quad read/write operations. Also, this register contains the total SPI_CLOCK cycles required to shift-out the dummy bits to the Flash. It writes about the number of pads required to shift-out the dummy bits and also about the chip select assertion/de-assertion after the dummy bits.
Information classified Confidential - Do not copy (See last page for obligations)
[31:25] RESERVED [24] CS_DEASSERT: De-assert the chip select. 0: The chip select remains asserted after shifting-out the dummy bits for sending command/data. 1: De-assert the chip select after shifting-out the dummy bits for sending command/data. [23:22] NO_OF_PADS: Number of pads on which the dummy bits needs to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved. [21:16] NO_OF_SPI_CLK_CYCLES: Number of SPI_CLOCK cycles required by the Serial Flash controller to shift-out the dummy bits. [15:8] RESERVED [7:0] DUMMY_BITS: Dummy bits required to enhance performance during quad read/write operations.
56/77
Rev B
DUMMY_BITS
RESERVED
RESERVED
Registers
SPI_FAST_SEQ_FLASH_STA_DATA
SPIBaseAddress + 0x012C R/W 0x00 This register contains the data required to be written in the status register of the Flash. For example, the status register needs to be written to the Flash to enable or disable modes of the Flash. The chip select assertion or de-assertion is also stated in this register. The bit[21] (STA_RDNOTWR) of this register must be set according to the operation in the sequence registers. Either a read status register or a write status register operation can be performed at a time in one sequence. The read status register cannot be clubbed with any other operation. The read status register has to be a separate sequence always. According to the operand selected while writing the sequence registers, the corresponding data byte can be read or written to the elds [15:8] or/and [7:0] of this register.
Information classified Confidential - Do not copy (See last page for obligations)
[31:22] RESERVED [21] STA_RDNOTWR: Status register read not write. 0: Write status register. 1: Read status register. [20] CS_DEASSERT: De-assert the chip select. 0: The chip select remains asserted after shifting the status register data bits for sending command/data. 1: De-assert the chip select after shifting the status register data bits for sending command/data. [19:18] RESERVED [17:16] NO_OF_PADS: Number of pads on which the status bits needs to be sent to the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved. [15:8] DATA_BYTE2: Second data byte to be written to the Flash. [7:0] DATA_BYTE1: First data byte to be written to the Flash.
Rev B
57/77
Registers
SPI_FAST_SEQ1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SECOND_OPERAND FOURTH_OPERAND THIRD_OPERAND SECOND_INS FOURTH_INS 9 8 7
Fast sequence 1
6 FIRST_OPERAND 5 4 3 2 1 0
THIRD_INS
0x00 This register contains the sequence that is required to be executed by the Serial Flash controller. Therefore, this register must be programmed after going through the datasheet of the Flash supported. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] FOURTH_OPERAND: Fourth operand. [27:24] FOURTH_INS: Fourth instruction to be executed by the Flash. [23:20] THIRD_OPERAND: Third operand. [19:16] THIRD_INS: Third instruction to be executed by the Flash. [15:12] SECOND_OPERAND: Second operand. [11:8] SECOND_INS: Second instruction to be executed by the Flash. [7:4] FIRST_OPERAND: First operand for rst instruction. [3:0] FIRST_INS: First instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
58/77
Rev B
FIRST_INS
Registers
SPI_FAST_SEQ2
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SEVENTH_OPERAND EIGHTH_OPERAND SIXTH_OPERAND SEVENTH_INS 9 8 7
Fast sequence 2
6 FIFTH_OPERAND 5 4 3 2 1 0
EIGHTH_INS
SIXTH_INS
SPIBaseAddress + 0x0134 R/W 0x00 This register contains the subsequent sequence that is required to be executed by the Serial Flash controller after executing the commands written in the SPI_FAST_SEQ1 register. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
Information classified Confidential - Do not copy (See last page for obligations)
[31:28] EIGHTH_OPERAND: Eighth operand. [27:24] EIGHTH_INS: Eighth instruction to be executed by the Flash. [23:20] SEVENTH_OPERAND: Seventh operand. [19:16] SEVENTH_INS: Seventh instruction to be executed by the Flash. [15:12] SIXTH_OPERAND: Sixth operand. [11:8] SIXTH_INS: Sixth instruction to be executed by the Flash. [7:4] FIFTH_OPERAND: Fifth operand. [3:0] FIFTH_INS: Fifth instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
Rev B
FIFTH_INS
59/77
Registers
SPI_FAST_SEQ3
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 ELEVENTH_OPERAND TWELFTH_OPERAND TENTH_OPERAND ELEVENTH_INS 9 8 7
Fast sequence 3
6 NINTH_OPERAND 5 4 3 2 1 0
TWELFTH_INS
TENTH_INS
SPIBaseAddress + 0x0138 R/W 0x00 This register contains the subsequent sequence that is required to be executed by the Serial Flash controller after executing the commands written in the SPI_FAST_SEQ2 register. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
Information classified Confidential - Do not copy (See last page for obligations)
[31:28] TWELFTH_OPERAND: Twelfth operand. [27:24] TWELFTH_INS: Twelfth instruction to be executed by the Flash. [23:20] ELEVENTH_OPERAND: Eleventh operand. [19:16] ELEVENTH_INS: Eleventh instruction to be executed by the Flash. [15:12] TENTH_OPERAND: Tenth operand. [11:8] TENTH_INS: Tenth instruction to be executed by the Flash. [7:4] NINTH_OPERAND: Ninth operand. [3:0] NINTH_INS: Ninth instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
60/77
Rev B
NINTH_INS
Registers
SPI_FAST_SEQ4
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 FOURTEENTH_OPERAND SIXTEENTH_OPERAND FIFTEENTH_OPERAND FOURTEENTH_INS 9 8 7
Fast sequence 4
6 THIRTEENTH_OPERAND 5 4 3 2 1 0
SPIBaseAddress + 0x013C
Information classified Confidential - Do not copy (See last page for obligations)
R/W 0x00 This register contains the subsequent sequence that is required to be executed by the Serial Flash controller after executing the commands written in SPI_FAST_SEQ3 register. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode. .
[31:28] SIXTEENTH_OPERAND: Sixteenth operand. [27:24] SIXTEENTH_INS: Sixteenth instruction to be executed by the Flash. [23:20] FIFTEENTH_OPERAND: Fifteenth operand. [19:16] FIFTEENTH_INS: Fifteenth instruction to be executed by the Flash. [15:12] FOURTEENTH_OPERAND: Fourteenth operand. [11:8] FOURTEENTH_INS: Fourteenth instruction to be executed by the Flash. [7:4] THIRTEENTH_OPERAND: Thirteenth operand. [3:0] THIRTEENTH_INS: Thirteenth instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
Rev B
THIRTEENTH_INS
SIXTEENTH_INS
FIFTEENTH_INS
61/77
Registers
SPI_FAST_SEQ_CFG
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 DATA_DREQ_HALF_NOT_FULL
R/W 0x00 This register contains the information required by the Serial Flash controller to operate in the fast sequence mode and fast sequence boot mode. This register must be programmed after all the registers required for the fast sequence mode operation are written. Writing 1 into the bit[0] of this register allows the Serial Flash controller to start with the sequence written in the SPI_FAST_SEQ1 register and continues until it encounters a STOP instruction. The CS_DEASSERT bit of this register is used to de-assert the chip select of the Flash as soon as the data transfer is complete. It does not take WAIT or STOP instructions into account. The WAIT instruction is done after data transfer is completed from Serial Flash. This is done to follow the Serial Flash protocol. The Serial Flash controller decides whether the sequence programmed in the sequence registers is a read, write or erase operation using bit[8] and bit[7] of this register. The Serial Flash controller also determines the number of pads and de-assert chip select options for data reading or writing by this register. The soft reset can be applied to the Serial Flash controller by asserting bit[5] of this register. The soft reset bit is not self-clearing. Software needs to assert and de-assert soft reset. The time given for soft reset assertion must take care of the clock division ratio programmed. It must be such that a minimum of ve SPI_CLOCK cycles are provided for proper logic resetting. For performing ERASE operations, ERASE_BIT must be set to 1. Also, erase operation requires RD_NOT_WR bit to be set to 1. The RD_NOT_WR bit should always be cleared to 0 before writing the data to the FIFO. The Serial Flash controller asserts the SPI_DATA_DREQ signal to reect the status of the FIFO for the FDMA to read or write the data from the FIFO. This information is made programmable by writing into bit[18] of this register. By default, the SPI_DATA_DREQ signal is asserted when the FIFO is full, but it can be asserted when the FIFO is half full by writing this bit to 1. For best performance, bit[18] must be set to 1, that is, half FIFO (256 bytes).
62/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
Address:
SPIBaseAddress + 0x0140
START_SEQ_BIT
CS_DEASSERT
NO_OF_PADS
RD_NOT_WR
ERASE_BIT
SW_RESET
RESERVED
RESERVED
RESERVED
Registers
[31:19] RESERVED [18] DATA_DREQ_HALF_NOT_FULL: 0: Dreq asserted when FIFO is full or empty (512 bytes). 1: Dreq asserted when FIFO is half-full or half-empty (256 bytes). [17:16] NO_OF_PADS: Number of pads on which the data needs to be sent/received from the device. 00: One pad. 01: Two pads. 11: Four pads. 10: Reserved. [15:9] RESERVED Information classified Confidential - Do not copy (See last page for obligations) [8] ERASE_BIT: Erase operation bit. 0: No erase operation. 1: Perform erase operation. [7] RD_NOT_WR: Read or write operation bit. 0: Write to Serial Flash. 1: Read from Serial Flash. [6] CS_DEASSERT: De-assert the chip select of the Flash after receiving/sending data to the Flash. 0: The chip select remains asserted after sending/receiving the data. 1: De-asserts the chip select after sending/receiving the data. [5] SW_RESET: Soft reset bit. 0: No soft reset. 1: Apply soft reset. [4:1] RESERVED [0] START_SEQ_BIT: Start sequence bit. 0: No operation is started. 1: Start the sequence written in the SPI_FAST_SEQ1 register.
Rev B
63/77
Registers
SPI_FAST_SEQ_STA
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 RESERVED 9
SPIBaseAddress + 0x0144 R/W 0x0 This register reects the current status of the fast sequence mode. It noties about the current command being executed. By default, the FAST_SEQ_STA eld of this register is 0. After the SPI_FAST_SEQ_CFG register is written, the FAST_SEQ_STA bit is set to 1. The FAST_SEQ_STA bit is reset to 0 again when all the commands written in the sequence registers have been executed. The FIFO_STATUS denotes the number of 32-bit words available for reading from or writing to the FIFO.
Information classified Confidential - Do not copy (See last page for obligations)
[31:12] RESERVED [11:5] FIFO_STA: Reect the data locations available in FIFO. [4] FAST_SEQ_STA: 0: Sequence written in the sequence registers is in progress. 1: Sequence execution is completed. [3:0] CURRENT_CMD: The current command being executed is reected here.
64/77
Rev B
FAST_SEQ_STA
FIFO_STA
Registers
SPI_QUAD_BOOT_SEQ_INIT1
FOURTH_OPERAND THIRD_OPERAND
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 FOURTH_INS
THIRD_INS
0x0 This register contains the initialization sequence that is required to be executed by the Serial Flash controller to initialize the Serial Flash in the fast sequence boot mode for booting. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] FOURTH_OPERAND: Fourth operand. [27:24] FOURTH_INS: Fourth instruction to be executed by the Flash. [23:20] THIRD_OPERAND: Third operand. [19:16] THIRD_INS: Third instruction to be executed by the Flash. [15:12] SECOND_OPERAND: Second operand. [11:8] SECOND_INS: Second instruction to be executed by the Flash. [7:4] FIRST_OPERAND: First operand for the rst instruction. [3:0] FIRST_INS: First instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
Rev B
FIRST_INS
65/77
Registers
SPI_QUAD_BOOT_SEQ_INIT2
SEVENTH_OPERAND EIGHTH_OPERAND
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SEVENTH_INS
EIGHTH_INS
SIXTH_INS
0x0 This register contains the subsequent initialization sequence that is required to be executed by the Serial Flash controller to initialize the Serial Flash in the fast sequence boot mode for booting. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] EIGHTH_OPERAND: Eighth operand. [27:24] EIGHTH_INS: Eighth instruction to be executed by the Flash. [23:20] SEVENTH_OPERAND: Seventh operand. [19:16] SEVENTH_INS: Seventh instruction to be executed by the Flash. [15:12] SIXTH_OPERAND: Sixth operand. [11:8] SIXTH_INS: Sixth instruction to be executed by the Flash. [7:4] FIFTH_OPERAND: Fifth operand. [3:0] FIFTH_INS: Fifth instruction to be executed by the Flash.
66/77
Rev B
FIFTH_INS
Registers
SPI_QUAD_BOOT_READ_SEQ1
SECOND_OPERAND FOURTH_OPERAND THIRD_OPERAND
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 FOURTH_INS
THIRD_INS
0x0 This register contains the quad read sequence for reading data during boot in the quad mode. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] FOURTH_OPERAND: Fourth operand. [27:24] FOURTH_INS: Fourth instruction to be executed by the Flash. [23:20] THIRD_OPERAND: Third operand. [19:16] THIRD_INS: Third instruction to be executed by the Flash. [15:12] SECOND_OPERAND: Second operand. [11:8] SECOND_INS: Second instruction to be executed by the Flash. [7:4] FIRST_OPERAND: First operand for the rst instruction. [3:0] FIRST_INS: First instruction to be executed by the Flash.
Rev B
FIRST_INS
67/77
Registers
SPI_QUAD_BOOT_READ_SEQ2
SEVENTH_OPERAND
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 EIGHTH_OPERAND SIXTH_OPERAND
FIFTH_OPERAND
SEVENTH_INS
EIGHTH_INS
SIXTH_INS
SPIBaseAddress + 0x0154 R/W 0x0 This register contains the quad read sequence for reading data during boot in the quad mode. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
Information classified Confidential - Do not copy (See last page for obligations)
[31:28] EIGHTH_OPERAND: Eighth operand. [27:24] EIGHTH_INS: Eighth instruction to be executed by the Flash. [23:20] SEVENTH_OPERAND: Seventh operand. [19:16] SEVENTH_INS: Seventh instruction to be executed by the Flash. [15:12] SIXTH_OPERAND: Sixth operand. [11:8] SIXTH_INS: Sixth instruction to be executed by the Flash. [7:4] FIFTH_OPERAND: Fifth operand. [3:0] FIFTH_INS: Fifth instruction to be executed by the Flash.
68/77
Rev B
FIFTH_INS
Registers
SPI_PROGRAM_ERASE_TIME
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8
This register contains the page program/erase time required by the Flash. The required parameter must be written in this register by the software. The Serial Flash controller runs a counter based on this value to wait for the page program time/erase time to complete. The Serial Flash controller always initializes the counter with the value programmed in this register whenever it encounters a WAIT instruction in the sequence. The maximum delay that can be supported by this register is 21 ms.
[31:21] RESERVED [20:0] WAIT_TIME: Wait counter value in terms of EMISS clock cycles.
Rev B
WAIT_TIME
RESERVED
69/77
Registers
SPI_REPEAT_SEQ1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SECOND_OPERAND FOURTH_OPERAND THIRD_OPERAND SECOND_INS FOURTH_INS 9 8
Repeat sequence 1
7 6 FIRST_OPERAND 5 4 3 2 1 0
THIRD_INS
0x0 This register contains the sequence required to be repeated during a multiple-page read/write operation. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] FOURTH_OPERAND: Fourth operand. [27:24] FOURTH_INS: Fourth instruction to be executed by the Flash. [23:20] THIRD_OPERAND: Third operand. [19:16] THIRD_INS: Third instruction to be executed by the Flash. [15:12] SECOND_OPERAND: Second operand. [11:8] SECOND_INS: Second instruction to be executed by the Flash. [7:4] FIRST_OPERAND: First operand for the rst instruction. [3:0] FIRST_INS: First instruction to be executed by the Flash. 0001: CMD. 0010: ADD. 0011: STATUS_REG_DATA. 0100: MODE. 0101: DUMMY. 0110: DATA. 0111: WAIT. 1000: JUMP. 1111: STOP.
70/77
Rev B
FIRST_INS
Registers
SPI_REPEAT_SEQ2
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 SEVENTH_OPERAND EIGHTH_OPERAND SIXTH_OPERAND SEVENTH_INS 9 8
Repeat sequence 1
7 6 FIFTH_OPERAND 5 4 3 2 1 0
EIGHTH_INS
SIXTH_INS
0x0 This register contains the sequence required to be repeated during a multiple-page read/write operation. For more details on issuing instructions, refer to Table 6: Instruction set of the fast sequence mode.
[31:28] EIGHTH_OPERAND: Eighth operand. [27:24] EIGHTH_INS: Eighth instruction to be executed by the Flash. [23:20] SEVENTH_OPERAND: Seventh operand. [19:16] SEVENTH_INS: Seventh instruction to be executed by the Flash. [15:12] SIXTH_OPERAND: Sixth operand. [11:8] SIXTH_INS: Sixth instruction to be executed by the Flash. [7:4] FIFTH_OPERAND: Fifth operand. [3:0] FIFTH_INS: Fifth instruction to be executed by the Flash.
Rev B
FIFTH_INS
71/77
Registers
SPI_STATUS_WR_TIME
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 RESERVED WAIT_TIME 9 8 7
SPIBaseAddress + 0x0164 RW 0x0 This register consists of the time required by the Flash to perform the write status register operation. The contents of this register are taken automatically by the Serial Flash controller whenever it encounters the STATUS_REG_DATA instruction in the sequence. The maximum delay that can be supported by this register is 21 ms.
[31:21] RESERVED [20:0] WAIT_TIME: Wait counter value in terms of EMISS clock cycles.
SPI_FAST_SEQ_DATAn
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 DATA 9 8
SPIBaseAddress + 0x0300 + n * 0x04 (where n = 0 to 63) RW 0x0 These registers contain the data to be read from the Flash or the data to be written to the Flash. These registers can store up to 512 bytes of data. If the read from the Flash is being done then these registers store the data returned from the Flash. Therefore, the data can be read afterwards by the CPU or FDMA after the SPI_SEQ_DREQ signal is generated by the Serial Flash controller. If the data is being written to the Flash, the CPU/FDMA must write the required data in these registers once the SPI_DATA_DREQ signal is asserted.
[31:0] DATA: Data read from the Flash or data to be written in the Flash.
Note:
While writing data in the FIFO for a write operation, sufcient time (more then or equal to 10 spi_clocks ) should be provided to the controller to switch between read and write clocks. This requirement arises from the fact that the FIFO is shared between read and write operations. When a read sequence is followed by a write sequence, the fo read clock changes dynamically from stbus clock to spi clock and the fo write clock changes from spi clock to stbus clock. Hence, if a FIFO data write request is received during this period it gets missed. This time can be taken care if the sequence register programming is done during this duration.
72/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
10
10.1
10.1.1
Commands
Not applicable.
Rev B
73/77
Information classified Confidential - Do not copy (See last page for obligations)
11
74/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
Appendix A
A.1
A.1.1
Performance calculations
Contiguous mode versus normal mode
In the normal mode, considering that Serial Flash is operating at the SPI_CLOCK frequency of 50 MHz, it takes approximately 700 SPI cycles to read 40 bytes of data. The same amount of contiguous data can be read in the contiguous mode in approximately 360 SPI cycles.
Information classified Confidential - Do not copy (See last page for obligations)
It indicates that if the frequency of SPI_CLOCK is 50 MHz then approximately 44 Mbit/s speed can be achieved with the contiguous mode (50 MHz x 320/360 = 44 Mbit/s). This theoretical improvement in the bandwidth is approximately two times as compared to the normal mode where maximum data rate achievable is approximately 22 Mb/sec at 50 MHz (50 x 320/700). For very long accesses, this data rate would approach to 50 Mbit/s. This is due to the fact that address cycle is shared between many data transfers and thus it becomes negligible.
The next contiguous request must be received before eight SPI clocks cycles have elapsed from the time the valid next cycle signal is asserted for the performance improvement to be visible. The performance of the Serial Flash controller in the contiguous mode will degrade for non-contiguous request. In case a lot of non-contiguous requests are anticipated then it is advisable to run the Serial Flash controller in the non-contiguous mode (CONTIG_MODE = 0, that is, bit[0] of the SPI_MODE_SELECT register = 0). ATMEL apparently has changed protocol of its Serial Flash memories and ATMEL protocol has now become same as ST Serial-Flash protocol. This, however, can easily be supported by conguring new ATMEL memories with STNOTATMEL = 1. No special changes are made in IP due to new ATMEL memory protocol.
A.1.2
A.1.3
Rev B
75/77
A.1.4
Table 21.
x1
x2
x4
2088
1064
552
The contiguous mode throughput has been calculated keeping in view the best case when the STBus requests are contiguous and back-to-back. The performance would degrade otherwise.
A.2
76/77
Rev B
Information classified Confidential - Do not copy (See last page for obligations)
CONFIDENTIALITY OBLIGATIONS:CONFIDENTIALITY OBLIGATIONS: This document contains sensitive information. Its distribution is subject to the signature of a Non-Disclosure Agreement (NDA). It is classified CONFIDENTIAL. At all times you should comply with the following security rules (Refer to NDA for detailed obligations): Do not copy or reproduce all or part of this document Keep this document locked away Further copies can be provided on a need to know basis, please contact your local ST sales office.
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (ST) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to STs terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN STS TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USERS OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
2011 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com
Rev B
77/77
Information classified Confidential - Do not copy (See last page for obligations)