Samsung products are not designed, intended, or use of the information contained herein. authorized for use as components in systems Samsung reserves the right to make changes in its intended for surgical implant into the body, for other products or product specifications with the intent to...
2.12 Reset ...............................2-16 2.13 Introduction for ARM940T ........................2-17 2.14 ARM940T Block Diagram.........................2-18 2.15 About The ARM940T Programmer's Model ..................2-19 2.15.1 Data Abort Model........................2-20 2.15.2 Instruction Set Extension Spaces..................2-20 2.16 ARM940T CP15 Registers .......................2-21 2.16.1 CP15 Register Map Summary ....................2-21 S3C2500B RISC MICROCONTROLLER...
Page 5
3.9.2 Shifted Register Offset......................3-29 3.9.3 Bytes and Words ........................3-29 3.9.4 Use of R15..........................3-31 3.9.5 Restriction on the Use of Base Register ................. 3-31 3.9.6 Data Aborts..........................3-31 3.9.7 Instruction Cycle Times......................3-31 3.9.8 Assembler Syntax........................3-32 S3C2500B RISC MICROCONTROLLER...
Page 6
3.14.4 Assembler Syntax.........................3-52 3.15 Coprocessor Data Transfers (LDC, STC) ..................3-53 3.15.1 The Coprocessor Fields ......................3-53 3.15.2 Addressing Modes ........................3-54 3.15.3 Address Alignment........................3-54 3.15.4 Use of R15 ...........................3-54 3.15.5 Data Aborts...........................3-54 3.15.6 Instruction Cycle Times ......................3-54 3.15.7 Assembler Syntax.........................3-55 S3C2500B RISC MICROCONTROLLER...
Page 8
3.38 Format 19: Long Branch With Link....................3-95 3.38.1 Operation..........................3-95 3.38.2 Instruction Cycle Times ......................3-96 3.39 Instruction Set Examples .........................3-97 3.39.1 Multiplication by a Constant Using Shifts and Adds...............3-97 3.39.2 General Purpose Signed Divide....................3-98 3.39.3 Division by a Constant ......................3-100 S3C2500B RISC MICROCONTROLLER...
Page 9
5.7.4 SDRAM Commands....................... 5-44 5.7.5 External Data Bus Width......................5-45 5.7.6 Merging Write Buffer ......................5-45 5.7.7 Self Refresh........................... 5-45 5.7.8 Basic Operation ........................5-46 5.7.9 SDRAM Special Registers ..................... 5-47 5.7.10 SDRAM Controller Timing....................5-54 viii viii S3C2500B RISC MICROCONTROLLER...
Page 10
7.4.1 BDMA Relative Special Register ....................7-15 7.4.2 MAC Relative Special Register....................7-24 7.5 Ethernet Operations...........................7-37 7.5.1 MAC Frame Format........................7-37 7.5.2 The MII Station Manager ......................7-45 7.5.3 Full-Duplex Pause Operations ....................7-46 7.5.4 Error Signalling........................7-48 7.5.5 Timing Parameters for MII Transactions .................7-50 S3C2500B RISC MICROCONTROLLER...
Page 12
9.5.8 IOM2 C/I1 Channel Receive Data Register................9-21 9.5.9 IOM2 Monitor Channel Transmit Data Register...............9-22 9.5.10 IOM2 Monitor Channel Receive Data Register..............9-22 9.5.11 TSA A Control Register......................9-23 9.5.12 TSA B Control Register......................9-24 9.5.13 TSA C Control Register ......................9-25 9.5.14 IOM2STRB (Strobe Register) ....................9-26 S3C2500B RISC MICROCONTROLLER...
Page 13
10.5.13 USB Write Count for Endpoint 1 Register................10-47 10.5.14 USB Write Count for Endpoint 2 Register................10-49 10.5.15 USB Write Count for Endpoint 3 Register................10-51 10.5.16 USB Write Count for Endpoint 4 Register................10-53 10.5.17 USB Endpoint 0/1/2/3/4 FIFO Register................10-55 S3C2500B RISC MICROCONTROLLER...
Page 14
12.5.3 Data Transfer Modes ......................12-18 12.6 GDMA Transfer Timing Data......................12-19 12.6.1 Single and One Data Burst Mode..................12-20 12.6.2 Single and Four Data Burst Mode ..................12-21 12.6.3 Block and One Data Burst Mode...................12-22 12.6.4 Block and Four Data Burst ....................12-23 S3C2500B RISC MICROCONTROLLER xiii...
Page 15
15.3.3 I/O Port Control Register for GDMA ..................15-8 15.3.4 I/O Port Control Register for External Interrupt..............15-9 15.3.5 I/O Port External Interrupt Clear Register................15-11 15.3.6 I/O Port Data Register......................15-12 15.3.7 I/O Port Drive Control Register .................... 15-12 S3C2500B RISC MICROCONTROLLER...
Page 16
17.6.5 Watchdog Timer Register .....................17-9 Chapter 18Electrical Data 18.1 Overview ............................18-1 18.2 Absolute Maximum Ratings ......................18-1 18.3 Recommended Operating Conditions....................18-1 18.4 DC Electrical Specifications ......................18-2 18.5 Max Power Consumption .........................18-4 18.6 AC Electrical Characteristics ......................18-5 Chapter 19Mechanical Data 19.1 Overview ............................19-1 S3C2500B RISC MICROCONTROLLER...
Title Page Number Number S3C2500B Block Diagram ..................1-5 S3C2500B Pin Assignment Diagram ..............1-6 Big-Endian Addresses of Bytes within Words............2-2 Little-Endian Addresses of Bytes Words ..............2-2 Register Organization in ARM State ...............2-5 Register Organization in THUMB State ..............2-6 Mapping of THUMB State Registers onto ARM State Registers......2-7 Program Status Register Format ................2-8...
Page 19
External Address Bus Diagram ................4-4 Priority Groups of S3C2500B................. 4-5 AHB Programmable Priority Registers ..............4-6 Shows the Clock Generation Logic of the S3C2500B..........4-14 Divided System Clock Timing Diagram..............4-19 Memory Bank Address map................... 5-4 Memory Controller Bus Signals................5-6 8-bit ROM, SRAM and Flash Basic Connection .............
Page 20
CSMA/CD Receive Operation ................7-44 7-12 MAC Control Frame Format ...................7-46 7-13 Timing Relationship of Transmission Signals at MII..........7-50 7-14 Timing Relationship of Reception Signals at MII.............7-50 7-15 MDIO Sourced by PHY...................7-50 7-16 MDIO Sourced by STA ...................7-50 S3C2500B RISC MICROCONTROLLER...
Page 21
IOM2 Control Register ................... 9-13 IOM2 Status Register .................... 9-15 IOM2 Interrupt Enable Register ................9-17 9-10 IOM2 TIC Bus Address Register ................9-18 9-11 IOM2 IC Channel Transmit Data Register.............. 9-19 9-12 IOM2 IC Channel Receive Data Register............... 9-19 S3C2500B RISC MICROCONTROLLER...
List of Tables Table Title Page Number Number S3C2500B Signal Descriptions ................1-13 S3C2500B Pad Type and Feature ................1-31 S3C2500B System Configuration ................1-32 S3C2500B Memory Controller ................1-32 S3C2500B SDRAM Controller ................1-32 S3C2500B IIC Controller ..................1-33 S3C2500B Ethernet Controller 0................1-33 S3C2500B Ethernet Controller 1................1-34 S3C2500B HDLC Controller 0 ................1-35...
Page 27
The Base Address of Remapped Memory.............. 4-3 AHB Bus Priorities for Arbitration................4-4 Clock Frequencies for CLKMOD Pins, CPU_FREQ Pins, and BUS_FREQ Pins ..4-9 P, M, S values of the S3C2500B PLL ..............4-13 System Configuration Registers................4-15 xxvi...
This highly integrated microcontroller enables customers to save system costs and increase performance over other 32-bit microcontroller. The S3C2500B is built based on an outstanding CPU core: The ARM940T cached processor is a member of the ARM9 Thumb family of high-performance 32-bit system-on-a-chip processor solutions.
PRODUCT OVERVIEW S3C2500B 1.2 FEATURES ARM940T Core processor On-chip CAM (21 addresses) • • Fully 16/32-bit RISC architecture. Full-duplex mode for doubled bandwidth • • Harvard cache architecture with separate 4KB Pause operation hardware support for full- Instruction and Data cache duplex flow control •...
Page 37
S3C2500B PRODUCT OVERVIEW 1.2 FEATURES (Continue) IOM2 Controller General DMA Channels • • IOM2 terminal mode support Six GDMA channels • • Inter-device communication via IC channel Memory to memory data transfer • • TIC bus access control Memory to peripheral data transfer (high-speed UART, DES, and USB controller) •...
Page 38
PRODUCT OVERVIEW S3C2500B 1.2 FEATURES (Continue) PLL3 for PHY C Controller • • The input frequency is 10MHz Master mode operation only • • Provide 20MHz or 25MHz output to external Baud rate generator for serial clock PHY chip Four PLLs for System, Core, USB and PHY...
Pin Name Type Pad Type Description System XCLK Phic S3C2500B PLL Clock Source. If CLKSEL is Config Low, PLL output clock is used as the system (20) clock. If CLKSEL is high, XCLK is used as the system clock. HCLKO phbst24 System clock output.
Page 48
System Bus Clock Frequency Selection. nRESET phis Not Reset. NRESET is the global reset input for the S3C2500B and nRESET must be held to "low" for at least 64 clock cycles for digital filtering. TMODE phicd Test Mode. The TMODE pin setting is...
Page 49
ADDR[10]/AP. XDATA[31:0] phbsut20 External bi-directional 32bit data bus. The S3C2500B supports 8 bit, 16bit, 32bit bus with ROM/SRAM/Flash/Ext IO bank, but supports 16 bit or 32 bit bus with SDRAM bank. nSDCS[1:0] phot20 Not chip select strobe for SDRAM.
Page 50
Not ROM/SRAM/Flash/ External I/O Chip select. The S3C2500B supports upt to 8 banks of ROM/SRAM/Flash/ External I/O. By controlling the nRCS signals, you can map CPU address into the physical memory banks. B0SIZE[1:0] phic Bank 0 Data Bus Access Size.
Page 51
SDRAM refresh operation. The XBMREQ is deactivated when the external bus master releases the external bus. When this occurs, the S3C2500B can get the control of the bus and the XBMACK goes “low”. XBMACK phob8 External bus Acknowledge.
Page 52
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet MDC_0 phob12 Management Data Clock. Controller0 The signal level at the MDC pin is used as a (18) timing reference for data transfers that are controlled by the MDIO signal.
Page 53
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet TX_EN_0 phob4 Transmit Enable/Transmit Enable for 10M. Controller0 TX_EN provides precise framing for the data (18) carried on TXD[3:0]. This pin is active during...
Page 54
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet CRS_0 phis Carrier Sense/Carrier Sense for 10M. Controller0 CRS is asserted asynchronously with (18) minimum delay from the detection of a non- idle medium in MII mode. CRS_10M is asserted when a 10-Mbit/s PHY has data to transfer.
Page 55
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet RX_ERR_0 phisd Receive Error. Controller0 PHY asserts RX_ERR synchronously (18) whenever it detects a physical medium error (e.g., a coding violation). PHY asserts RX_ERR only when it asserts RX_DV.
Page 56
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet TXD1[3:0]/ phob12 Transmit Data/Transmit Data for 10M. Controller1 TXD_10M/ Transmit data is aligned on nibble boundaries. (18) LOOP_10M TXD[0] corresponds to the first bit to be...
Page 57
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet TX_ERR_1/ phob4 Transmit Error/Packet Compression Enable Controller1 PCOMP_10M for 10M. (18) TX_ERR is driven synchronously to TX_CLK and sampled continuously by the Physical Layer Entity, PHY.
Page 58
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description Ethernet RX_CLK_1 phis Receive Clock/Receive Clock for 10M. Controller1 RX_CLK is a continuous clock signal. Its (18) frequency is 25 MHz for 100-Mbit/s operation, and 2.5 MHz for 10-Mbit/s.
Page 59
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description HDLC0 HTXD0/DU phbsud4 IOM2 Data Upstream. Open Drain Output and schmit trigger input. HDLC Ch-0 Transmit Data. The serial data output from the transmitter is encoded in NRZ/NRZI/ FM/Manchester data format.
Page 60
Pad Type Description HDLC0 HnCTS0/ phbst8 HDLC Ch-0 Clear To Send. GPIO44 The S3C2500B stores each transition of nCTS to ensure that its occurrence will be acknowledged by the system. General I/O Port. HnDCD0/ phbst8 HDLC Ch-0 Data Carrier Detected.
Page 61
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description HDLC1 HTXD1/GPIO48 phbst16 HDLC Ch-1 Transmit Data. See the HTXD0 description General I/O Port. HRXD1/GPIO49 phbst8 HDLC Ch-1 Receive Data. See the HRXD0 description General I/O Port.
Page 62
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description HDLC2 HnDCD2/ phbst8 HDLC Ch-2 Data Carrier Detected. GPIO61 See the HnDCD0 description General I/O Port HRXC2/ phbst8 HDLC Ch-2 Receiver Clock. GPIO62 See the HRXC0 description...
Page 63
S3C2500B PRODUCT OVERVIEW Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description HUART0 HUnDSR0/ phbst8 Not HUART0 Data Set Ready. GPIO31 This input signals in the HUART0 that the peripheral (or host) is ready to transmit or...
Page 64
PRODUCT OVERVIEW S3C2500B Table 1-1. S3C2500B Signal Descriptions (Continue) Group Pin Name Type Pad Type Description HUART1 HUnDTR1/ phbst8 Not HUART1 Data Terminal Ready.. GPIO37 See HUnDTR0description General I/O Port HUnDSR1/ phbst8 Not HUART1 Data Set Ready. GPIO38 See HUnDSR0 description...
– Open drain buffer Pbusbfs USB Buffer – NOTE: For the detail information about the pad type, “Input/Output Cells of the STD130/MDL130 0.18µm 3.3V Standard Cell Library Data Book” which is produced by Samsung Electronics Co., Ltd, ASIC Team. 1-31...
PRODUCT OVERVIEW S3C2500B 1.8 SPECIAL REGISTERS Table 1-3. S3C2500B System Configuration Registers Address Description Reset Value SYSCFG 0xF0000000 System configuration register – PDCODE 0xF0000004 Product code and revision number register 0x25000000 CLKCON 0xF0000008 System clock control register 0x00000000 PCLKDIS 0xF000000C...
S3C2500B PROGRAMMER′ ′ S MODEL 2.1 OVERVIEW S3C2500B was developed using the advanced ARM9TDMI core designed by advanced RISC machines, Ltd. — Processor Operating States From the programmer′s point of view, the ARM9TDMI can be in one of two states: —...
Word is addressed by byte address of most significant byte. Figure 2-1. Big-Endian Addresses of Bytes within Words NOTE The data locations in the external memory are different with Figure 2-1 in the S3C2500B. Please refer to the chapter 4, system manager. 2.3.2 LITTLE-ENDIAN FORMAT In Little-Endian format, the lowest numbered byte in a word is considered the word′s least significant byte, and...
PROGRAMMER′ ′ S MODEL S3C2500B 2.4 INSTRUCTION LENGTH Instructions are either 32 bits long (in ARM state) or 16 bits long (in THUMB state). 2.5 DATA TYPES ARM9TDMI supports byte (8-bit), half-word (16-bit) and word (32-bit) data types. Words must be aligned to four- byte boundaries and half words to two-byte boundaries.
PROGRAMMER′ ′ S MODEL S3C2500B 2.7 REGISTERS ARM9TDMI has a total of 37 registers-31 general-purpose 32-bit registers and six status registers - but these cannot all be seen at once. The processor state and operating mode dictate which registers are available to the programmer.
Page 85
PROGRAMMER′ ′ S MODEL S3C2500B ARM State General Registers and Program Counter System & User Supervisor About Undefined R8_fiq R9_fiq R10_fiq R11_fiq R12_fiq R13_svc R13_abt R13_irq R13_und R13_fiq R14_svc R14_abt R14_irq R14_und R14_fiq R15 (PC) R15 (PC) R15 (PC) R15 (PC)
Page 86
PROGRAMMER′ ′ S MODEL S3C2500B 2.7.2 The THUMB State Register Set The THUMB state register set is a subset of the ARM state set. The programmer has direct access to eight general registers, R0–R7, as well as the Program Counter (PC), a stack pointer register (SP), a link register (LR), and the CPSR.
PROGRAMMER′ ′ S MODEL S3C2500B 2.7.3 THE RELATIONSHIP BETWEEN ARM AND THUMB STATE REGISTERS The THUMB state registers relate to the ARM state registers in the following way: — THUMB state R0–R7 and ARM state R0–R7 are identical — THUMB state CPSR and SPSRs and ARM state CPSR and SPSRs are identical —...
PROGRAMMER′ ′ S MODEL S3C2500B 2.7.4 ACCESSING HI-REGISTERS IN THUMB STATE In THUMB state, registers R8–R15 (the Hi registers) are not part of the standard register set. However, the assembly language programmer has limited access to them, and can use them for fast temporary storage.
PROGRAMMER′ ′ S MODEL S3C2500B 2.8.1 THE CONDITION CODE FLAGS The N, Z, C and V bits are the condition code flags. These may be changed as a result of arithmetic and logical operations, and may be tested to determine whether an instruction should be executed.
Page 90
PROGRAMMER′ ′ S MODEL S3C2500B Table 2-1. PSR Mode. Bit Values M[4:0] Mode Visible THUMB State Registers Visible ARM State Registers 10000 User R7..R0, R14..R0, LR, SP PC, CPSR PC, CPSR 10001 R7..R0, R7..R0, LR_fiq, SP_fiq R14_fiq..R8_fiq, PC, CPSR, SPSR_fiq...
PROGRAMMER′ ′ S MODEL S3C2500B 2.9 EXCEPTIONS Exceptions arise whenever the normal flow of a program has to be halted temporarily, for example to service an interrupt from a peripheral. Before an exception can be handled, the current processor state must be preserved so that the original program can resume when the handler routine has finished.
PROGRAMMER′ ′ S MODEL S3C2500B 2.9.3 EXCEPTION ENTRY/EXIT SUMMARY Table 2-2 summarizes the PC value preserved in the relevant R14 on exception entry, and the recommended instruction for exiting the exception handler. Table 2-2. Exception Entry/Exit Return Instruction Previous State...
PROGRAMMER′ ′ S MODEL S3C2500B 2.9.5 IRQ The IRQ (Interrupt Request) exception is a normal interrupt caused by a LOW level on the nIRQ input. IRQ has a lower priority than FIQ and is masked out when a FIQ sequence is entered. It may be disabled at any time by setting the I bit in the CPSR, though this can only be done from a privileged (non-User) mode.
PROGRAMMER′ ′ S MODEL S3C2500B 2.9.7 SOFTWARE INTERRUPT The software interrupt instruction (SWI) is used for entering Supervisor mode, usually to request a particular supervisor function. A SWI handler should return by executing the following irrespective of the state (ARM or...
PROGRAMMER′ ′ S MODEL S3C2500B 2.10.1 EXCEPTION PRIORITIES When multiple exceptions arise at the same time, a fixed priority system determines the order in which they are handled: Highest priority: 1. Reset 2. Data abort 3. FIQ 4. IRQ 5. Prefetch abort Lowest priority: 6.
PROGRAMMER′ ′ S MODEL S3C2500B 2.11 INTERRUPT LATENCIES The worst case latency for FIQ, assuming that it is enabled, consists of the longest time the request can take to pass through the synchroniser (Tsyncmax if asynchronous), plus the time for the longest instruction to complete (Tldm, the longest instruction is an LDM which loads all the registers including the PC), plus the time for the data abort entry (Texc), plus the time for FIQ entry (Tfiq).
PROGRAMMER′ ′ S MODEL S3C2500B 2.13 INTRODUCTION FOR ARM940T The ARM940T cached processor macrocell is a member of the ARM9 Thumb Family of high-performance 32-bit system-on-a-chip processor solutions. It is targeted at a wide range of embedded control applications where high performance, low system cost, small die size, and low power are key considerations.
PROGRAMMER′ ′ S MODEL S3C2500B 2.14 ARM940T BLOCK DIAGRAM CPID[31:0] CPDIN[31:0] CPDOUT[31:0] IA[31:0] DA[31:0] Coprocessor Interface ID[31:0] DD[31:0] Protection Unit I Cache D Cache CP15 Control Control Instruction Data ARM9TDMI Cache Cache Processor Core (Integral EmbeddedICE) JTAG Interface[4:0] AMBA Interface...
PROGRAMMER′ ′ S MODEL S3C2500B 2.15 ABOUT THE ARM940T PROGRAMMER'S MODEL The ARM940T cached processor macrocell includes the ARM9TDMI microprocessor core, instruction and data caches, a write-buffer, and a protection unit for defining the attributes of regions of memory. The ARM940T incorporates two coprocessors: •...
PROGRAMMER′ ′ S MODEL S3C2500B 2.15.1 DATA ABORT MODEL The base restored data abort model differs from the base updated data abort model implemented by ARM7TDMI. The difference in the data abort model affects only a very small section of operating system code, the data abort handler.
PROGRAMMER′ ′ S MODEL S3C2500B 2.16 ARM940T CP15 REGISTERS 2.16.1 CP15 REGISTER MAP SUMMARY The ARM940T incorporates CP15 for system control. The register map for C15 is shown in Table 2-5. Table 2-5. CP15 Register Map Register Function Access ID code/Cache type...
Page 102
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.2 Register 0: Cache type This is a read-only register which allows operating systems to establish how to perform operations such as cache cleaning and lockdown. Future ARM cached processors will contain this register, allowing RTOS vendors to produce future-proof versions of their operating systems.
Page 103
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.3 Register 1: Control register This contains the global control bits of the ARM940T. All reserved bits should either be written with zero or one, as indicated, or written using read-modify-write. The reserved bits have an unpredictable value when read.
Page 104
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.4 Register 2: Instruction and data cacheable registers This location provides access to two registers which contain the cacheable attributes for each of eight memory areas. The two registers provide individual control for the I and D address spaces. The opcode_2 field determines whether the instruction-or data-cacheable attributes are programmed: If the opcode_2 field = 0, the data-cacheable bits are programmed.
Page 105
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.5 Register 3: Write buffer control register This register contains a write buffer control (bufferable) attribute bit for each of the eight areas of memory. Each bit is used in conjunction with the cacheable bit to control write-buffer operation. For a description of buffer behavior, see The write buffer on page 4-11.
Page 106
PROGRAMMER′ ′ S MODEL S3C2500B Each register contains the access permission bits, apn[1:0], for the eight areas of instruction or data memory, as shown in Table 2-12. All defined bits in the control register are set to zero at reset.
Page 107
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.7 Register 6: Protection region base and size registers This register is used to define 16 programmable regions (eight instruction, eight data) in memory. These registers define the base and size of each of the eight areas of memory. Individual control is provided for the instruction and data memory regions.
Page 108
PROGRAMMER′ ′ S MODEL S3C2500B Each protection region register has the format shown in Table 2-16. Table 2-16. CP15 Protection Region Register Format Register bit Function 31:12 Base address 11:6 Unused Area size (See Table 2-17) Region enable. Reset to disable (0).
Page 109
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.8 Register 7: Cache operations A write to this register can be used to perform the following operations: • Flush ICache and Dcache • Prefetch an ICache line • Wait for interrupt • Drain the write buffer •...
Page 110
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.8.1 Index/Segment Format Where the required value is an index/segment, the format is: Table 2-19. CP15 Register 7 Index/Segment Data Format Rd bit position Function 31:26 Index 25:6 Should be zero Segment Should be zero 2.16.1.8.2 ICache Prefetch Data Format...
Page 111
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.8.4 Drain Write Buffer This CP15 operation causes instruction execution to be stalled until the write buffer is emptied. This operation is useful in real time applications where the processor needs to be sure that a write to a peripheral has completed before program execution continues.
Page 112
PROGRAMMER′ ′ S MODEL S3C2500B 2.16.1.10 Register 15: Test/debug register The DTRRobin and ITRRobin bits set the respective caches into a pseudo round-robin replacement mode. All defined bits in the control register are set to zero at reset. Table 2-22. CP15 Register 15...
S3C2500B INSTRUCTION SET INSTRUCTION SET 3.1 INSTRUCTION SET SUMMAY This chapter describes the ARM instruction set and the THUMB instruction set in the ARM9TDMI core. 3.1.1 FORMAT SUMMARY The ARM instruction set formats are shown below. 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 4 3 2 1 0...
INSTRUCTION SET S3C2500B 3.2 THE CONDITION FIELD In ARM state, all instructions are conditionally executed according to the state of the CPSR condition codes and the instruction′s condition field. This field (bits 31:28) determines the circumstances under which an instruction is to be executed.
S3C2500B INSTRUCTION SET 3.3 BRANCH AND EXCHANGE (BX) This instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. This instruction performs a branch by copying the contents of a general register, Rn, into the program counter, PC.
Page 118
INSTRUCTION SET S3C2500B Examples R0, Into_THUMB + 1 ; Generate branch target address ; and set bit 0 high - hence ; arrive in THUMB state. ; Branch and change to THUMB ; state. CODE16 ; Assemble subsequent code as Into_THUMB ;...
S3C2500B INSTRUCTION SET 3.4 BRANCH AND BRANCH WITH LINK (B, BL) The instruction is only executed if the condition is true. The various conditions are defined Table 3-2. The instruction encoding is shown in Figure 3-3, below. Cond Offset [24] Link Bit...
INSTRUCTION SET S3C2500B 3.4.3 ASSEMBLER SYNTAX Items in {} are optional. Items in < > must be present. B{L}{cond} <expression> Used to request the branch with link form of the instruction. If absent, R14 will not be affected by the instruction.
S3C2500B INSTRUCTION SET 3.5 DATA PROCESSING The data processing instruction is only executed if the condition is true. The conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-4. 26 25 Opcode Cond Operand2 [15:12] Destination Register...
Page 122
INSTRUCTION SET S3C2500B The instruction produces a result by performing a specified arithmetic or logical operation on one or two operands. The first operand is always a register (Rn). The second operand may be a shifted register (Rm) or a rotated 8 bit immediate value (Imm) according to the value of the I bit in the instruction.
S3C2500B INSTRUCTION SET 3.5.1 CPSR FLAGS The data processing operations may be classified as logical or arithmetic. The logical operations (AND, EOR, TST, TEQ, ORR, MOV, BIC, MVN) perform the logical action on all corresponding bits of the operand or operands to produce the result.
INSTRUCTION SET S3C2500B 3.5.2 SHIFTS When the second operand is specified to be a shifted register, the operation of the barrel shifter is controlled by the shift field in the instruction. This field indicates the type of shift to be performed (logical left or right, arithmetic right or rotate right).
Page 125
S3C2500B INSTRUCTION SET Contents of Rm carry out Value of Operand 2 Figure 3-7. Logical Shift Right The form of the shift field which might be expected to correspond to LSR #0 is used to encode LSR #32, which has a zero result with bit 31 of Rm as the carry output. Logical shift right zero is redundant as it is the same as logical shift left zero, so the assembler will convert LSR #0 (and ASR #0 and ROR #0) into LSL #0, and allow LSR #32 to be specified.
Page 126
INSTRUCTION SET S3C2500B Rotate right (ROR) operations reuse the bits which overshoot in a logical shift right operation by reintroducing them at the high end of the result, in place of the zeros used to fill the high end in logical right operations. For example, ROR #5 is shown in Figure 3-9.
Page 127
S3C2500B INSTRUCTION SET 3.5.2.2 Register Specified Shift Amount Only the least significant byte of the contents of Rs is used to determine the shift amount. Rs can be any general register other than R15. If this byte is zero, the unchanged contents of Rm will be used as the second operand, and the old value of the CPSR C flag will be passed on as the shifter carry output.
INSTRUCTION SET S3C2500B 3.5.3 IMMEDIATE OPERAND ROTATES The immediate operand rotate field is a 4 bit unsigned integer which specifies a shift operation on the 8 bit immediate value. This value is zero extended to 32 bits, and then subject to a rotate right by twice the value in the rotate field.
S3C2500B INSTRUCTION SET 3.5.7 INSTRUCTION CYCLE TIMES Data processing instructions vary in the number of incremental cycles taken as follows: Table 3-4. Incremental Cycle Times Processing Type Cycles Normal data processing Data processing with register specified shift 1S + 1I...
Page 130
INSTRUCTION SET S3C2500B Examples ADDEQ R2,R4,R5 ; If the Z flag is set make R2: = R4 + R5 TEQS R4,#3 ; Test R4 for equality with 3. ; (The S is in fact redundant as the ; assembler inserts it automatically.) R4,R5,R7,LSR R2 ;...
S3C2500B INSTRUCTION SET 3.6 PSR TRANSFER (MRS, MSR) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The MRS and MSR instructions are formed from a subset of the data processing operations and are implemented using the TEQ, TST, CMN and CMP instructions without the S flag set.
Page 132
INSTRUCTION SET S3C2500B MRS (Transfer PSR Contents to a Register) 00010 001111 Cond 000000000000 [15:21] Destination Register [19:16] Source PSR 0 = CPSR 1 = SPSR_<current mode> [31:28] Condition Field MRS (Transfer Register Contents to PSR) 00010 101001111 Cond 00000000...
S3C2500B INSTRUCTION SET 3.6.2 RESERVED BITS Only twelve bits of the PSR are defined in ARM9TDMI (N, Z, C, V, I, F, T & M[4:0]); the remaining bits are reserved for use in future versions of the processor. Refer to Figure 2-6 for a full description of the PSR bits.
INSTRUCTION SET S3C2500B 3.6.4 ASSEMBLER SYNTAX — MRS - transfer PSR contents to a register MRS{cond} Rd,<psr> — MSR - transfer register contents to PSR MSR{cond} <psr>,Rm — MSR - transfer register contents to PSR flag bits only MSR{cond} <psrf>,Rm The most significant four bits of the register contents are written to the N,Z,C &...
S3C2500B INSTRUCTION SET 3.7 MULTIPLY AND MULTIPLY-ACCUMULATE (MUL, MLA) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-12. The multiply and multiply-accumulate instructions use an 8 bit Booth's algorithm to perform integer multiplication.
INSTRUCTION SET S3C2500B 3.7.1 CPSR FLAGS Setting the CPSR flags is optional, and is controlled by the S bit in the instruction. The N (Negative) and Z (Zero) flags are set correctly on the result (N is made equal to bit 31 of the result, and Z is set if and only if the result is zero).
S3C2500B INSTRUCTION SET 3.8 MULTIPLY LONG AND MULTIPLY-ACCUMULATE LONG (MULL,MLAL) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-13. The multiply long instructions perform integer multiplication on two 32 bit operands and produce 64 bit results.
INSTRUCTION SET S3C2500B 3.8.2 CPSR FLAGS Setting the CPSR flags is optional, and is controlled by the S bit in the instruction. The N and Z flags are set correctly on the result (N is equal to bit 63 of the result, Z is set if and only if all 64 bits of the result are zero).
INSTRUCTION SET S3C2500B 3.9 SINGLE DATA TRANSFER (LDR, STR) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-14. The single data transfer instructions are used to load or store single bytes or words of data. The memory address used in the transfer is calculated by adding an offset to or subtracting an offset from a base register.
S3C2500B INSTRUCTION SET 3.9.1 OFFSETS AND AUTO-INDEXING The offset from the base may be either a 12 bit unsigned binary immediate value in the instruction, or a second register (possibly shifted in some way). The offset may be added to (U = 1) or subtracted from (U = 0) the base register Rn.
Page 142
INSTRUCTION SET S3C2500B Memory Register LDR from word aligned address Memory Register LDR from address offset by 2 Figure 3-15. Little-Endian Offset Addressing 3.9.3.2 Big-Endian Configuration A byte load (LDRB) expects the data on data bus inputs 31 through 24 if the supplied address is on a word boundary, on data bus inputs 23 through 16 if it is a word address plus one byte, and so on.
S3C2500B INSTRUCTION SET 3.9.4 USE OF R15 Write-back must not be specified if R15 is specified as the base register (Rn). When using R15 as the base register you must remember it contains an address 8 bytes on from the address of the current instruction.
INSTRUCTION SET S3C2500B 3.9.8 ASSEMBLER SYNTAX <LDR|STR>{cond}{B}{T} Rd,<Address> where: Load from memory into a register Store from a register into memory {cond} Two-character condition mnemonic. See Table 3-2. If B is present then byte transfer, otherwise word transfer If T is present the W bit will be set in a post-indexed instruction, forcing non- privileged mode for the transfer cycle.
Page 145
S3C2500B INSTRUCTION SET Examples R1,[R2,R4]! ; Store R1 at R2 + R4 (both of which are registers) ; and write back address to R2. R1,[R2],R4 ; Store R1 at R2 and write back R2 + R4 to R2. R1,[R2,#16] ; Load R1 from contents of R2 + 16, but don't write back.
INSTRUCTION SET S3C2500B 3.10 HALFWORD AND SIGNED DATA TRANSFER (LDRH/STRH/LDRSB/LDRSH) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-16. These instructions are used to load or store half-words of data and also load sign-extended bytes or half-words of data.
INSTRUCTION SET S3C2500B 3.10.2 HALF-WORD LOAD AND STORES Setting S = 0 and H = 1 may be used to transfer unsigned Half-words between an ARM9TDMI register and memory. The action of LDRH and STRH instructions is influenced by the BIGEND control signal. The two possible configurations are described in the section below.
S3C2500B INSTRUCTION SET 3.10.4.2 Big-Endian Configuration A signed byte load (LDRSB) expects data on data bus inputs 31 through to 24 if the supplied address is on a word boundary, on data bus inputs 23 through to 16 if it is a word address plus one byte, and so on. The selected byte is placed in the bottom 8 bit of the destination register, and the remaining bits of the register are filled with the sign bit, bit 7 of the byte.
INSTRUCTION SET S3C2500B 3.10.8 ASSEMBLER SYNTAX <LDR|STR>{cond}<H|SH|SB> Rd,<address> Load from memory into a register Store from a register into memory {cond} Two-character condition mnemonic. See Table 3-2. Transfer half-word quantity Load sign extended byte (Only valid for LDR) Load sign extended half-word (Only valid for LDR) An expression evaluating to a valid register number.
Page 151
S3C2500B INSTRUCTION SET Examples LDRH R1,[R2,-R3]! ; Load R1 from the contents of the half-word address ; contained in R2-R3 (both of which are registers) ; and write back address to R2 STRH R3,[R4,#14] ; Store the half-word in R3 at R14+14 but don't write back.
INSTRUCTION SET S3C2500B 3.11 BLOCK DATA TRANSFER (LDM, STM) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-18. Block data transfer instructions are used to load (LDM) or store (STM) any subset of the currently visible registers.
S3C2500B INSTRUCTION SET 3.11.2 ADDRESSING MODES The transfer addresses are determined by the contents of the base register (Rn), the pre/post bit (P) and the up/ down bit (U). The registers are transferred in the order lowest to highest, so R15 (if in the list) will always be transferred last.
S3C2500B INSTRUCTION SET 0x100C 0x100C 0x1000 0x1000 0x0FF4 0x0FF4 0x100C 0x100C 0x1000 0x1000 0x0FF4 0x0FF4 Figure 3-22. Pre-Decrement Addressing 3.11.4 USE OF THE S BIT When the S bit is set in a LDM/STM instruction its meaning depends on whether or not R15 is in the transfer list and on the type of instruction.
INSTRUCTION SET S3C2500B 3.11.6 INCLUSION OF THE BASE IN THE REGISTER LIST When write-back is specified, the base is written back at the end of the second cycle of the instruction. During a STM, the first register is written out at the start of the second cycle. A STM which includes storing the base, with the base as the first register to be stored, will therefore store the unchanged value, whereas with the base second or later in the transfer order, will store the modified value.
S3C2500B INSTRUCTION SET 3.11.9 ASSEMBLER SYNTAX <LDM|STM>{cond}<FD|ED|FA|EA|IA|IB|DA|DB> Rn{!},<Rlist>{^} where: {cond} Two character condition mnemonic. See Table 3-2. An expression evaluating to a valid register number <Rlist> A list of registers and register ranges enclosed in {} (e.g. {R0, R2–R7, R10}).
Page 158
INSTRUCTION SET S3C2500B Examples LDMFD SP!,{R0,R1,R2} ; Unstack 3 registers. STMIA R0,{R0-R15} ; Save all registers. LDMFD SP!,{R15} ; R15 <- (SP), CPSR unchanged. LDMFD SP!,{R15}^ ; R15 <- (SP), CPSR <- SPSR_mode ; (allowed only in privileged modes). STMFD R13,{R0-R14}^ ;...
S3C2500B INSTRUCTION SET 3.12 SINGLE DATA SWAP (SWP) Cond 00010 0000 1001 [3:0] Source Register [15:12] Destination Register [19:16] Base Register [22] Byte/Word Bit 0 = Swap word quantity 1 = Swap word quantity [31:28] Condition Field Figure 3-23. Swap Instruction The instruction is only executed if the condition is true.
INSTRUCTION SET S3C2500B 3.12.3 DATA ABORTS If the address used for the swap is unacceptable to a memory management system, the memory manager can flag the problem by driving ABORT HIGH. This can happen on either the read or the write cycle (or both), and in either case, the data abort trap will be taken.
S3C2500B INSTRUCTION SET 3.13 SOFTWARE INTERRUPT (SWI) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-24, below 1111 Cond Comment Field (Ignored by Processor) [31:28] Condition Field Figure 3-24.
INSTRUCTION SET S3C2500B 3.13.4 ASSEMBLER SYNTAX SWI{cond} <expression> {cond} Two character condition mnemonic, Table 3-2. <expression> Evaluated and placed in the comment field (which is ignored by ARM9TDMI). Examples ReadC ; Get next character from read stream. WriteI+ “k” ; Output a “k” to the write stream.
So then all coprocessor instructions will cause the undefined instruction trap to be taken on the S3C2500B. These coprocessor instructions can be emulated by the undefined trap handler. Even though external coprocessor can not be connected to the S3C2500B, the coprocessor instructions are still described here in full for completeness.
INSTRUCTION SET S3C2500B 3.14.3 INSTRUCTION CYCLE TIMES Coprocessor data operations take 1S + bI incremental cycles to execute, where b is the number of cycles spent in the coprocessor busy-wait loop. S and I are defined as sequential (S-cycle) and internal (I-cycle).
S3C2500B INSTRUCTION SET 3.15 COPROCESSOR DATA TRANSFERS (LDC, STC) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction encoding is shown in Figure 3-26. This class of instruction is used to load (LDC) or store (STC) a subset of a coprocessor's registers directly to memory.
INSTRUCTION SET S3C2500B 3.15.2 ADDRESSING MODES ARM9TDMI is responsible for providing the address used by the memory system for the transfer, and the addressing modes available are a subset of those used in single data transfer instructions. Note, however, that the immediate offsets are 8 bits wide and specify word offsets for coprocessor data transfers, whereas they are 12 bits wide and specify byte offsets for single data transfers.
S3C2500B INSTRUCTION SET 3.15.7 ASSEMBLER SYNTAX <LDC|STC>{cond}{L} p#,cd,<Address> Load from memory to coprocessor Store from coprocessor to memory When present perform long transfer (N = 1), otherwise perform short transfer (N = 0) {cond} Two character condition mnemonic. See Table 3-2.
INSTRUCTION SET S3C2500B 3.16 COPROCESSOR REGISTER TRANSFERS (MRC, MCR) The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2.. The instruction encoding is shown in Figure 3-27. This class of instruction is used to communicate information directly between ARM9TDMI and a coprocessor. An...
S3C2500B INSTRUCTION SET 3.16.2 TRANSFERS TO R15 When a coprocessor register transfer to ARM9TDMI has R15 as the destination, bits 31, 30, 29 and 28 of the transferred word are copied into the N, Z, C and V flags respectively. The other bits of the transferred word are ignored, and the PC and other CPSR bits are unaffected by the transfer.
INSTRUCTION SET S3C2500B 3.17 UNDEFINED INSTRUCTION The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The instruction format is shown in Figure 3-28. 25 24 5 4 3 xxxxxxxxxxxxxxxxxxxx xxxx Cond Figure 3-28.
S3C2500B INSTRUCTION SET 3.18 INSTRUCTION SET EXAMPLES The following examples show ways in which the basic ARM9TDMI instructions can combine to give efficient code. None of these methods saves a great deal of execution time (although they may save some), mostly they just save code.
Page 172
INSTRUCTION SET S3C2500B Division and Remainder A number of divide routines for specific applications are provided in source form as part of the ANSI C library provided with the ARM Cross development toolkit, available from your supplier. A short general purpose divide routine follows.
S3C2500B INSTRUCTION SET 5. Overflow in unsigned multiply accumulate with a 64 bit result UMULL Rl,Rh,Rm,Rn ; 3 to 6 cycles ADDS Rl,Rl,Ra1 ; Lower accumulate Rh,Rh,Ra2 ; Upper accumulate overflow ; 1 cycle and 2 registers 6. Overflow in signed multiply accumulate with a 64 bit result...
Page 174
INSTRUCTION SET S3C2500B Multiplication by 6 Ra,Ra,Ra,LSL #1 ; Multiply by 3 Ra,Ra,LSL#1 ; and then by 2 Multiply by 10 and add in extra number Ra,Ra,Ra,LSL#2 ; Multiply by 5 Ra,Rc,Ra,LSL#1 ; Multiply by 2 and add in next digit General recursive method for Rb := Ra*C, C a constant: 1.
S3C2500B INSTRUCTION SET 3.18.4 LOADING A WORD FROM AN UNKNOWN ALIGNMENT ; Enter with address in Ra (32 bits) uses ; Rb, Rc result in Rd. Note d must be less than c e.g. 0,1 Rb,Ra,#3 ; Get word aligned address...
INSTRUCTION SET S3C2500B 3.19 THUMB INSTRUCTION SET FORMAT The thumb instruction sets are 16-bit versions of ARM instruction sets (32-bit format). The ARM instructions are reduced to 16-bit versions, Thumb instructions, at the cost of versatile functions of the ARM instruction sets. The thumb instructions are decompressed to the ARM instructions by the Thumb decompressor inside the ARM9TDMI core.
S3C2500B INSTRUCTION SET 3.19.2 OPCODE SUMMARY The following table summarises the THUMB instruction set. For further information about a particular instruction please refer to the sections listed in the right-most column. Table 3-7. THUMB Instruction Set Opcodes Mnemonic Instruction Lo-Register...
Page 178
INSTRUCTION SET S3C2500B Table 3-7. THUMB Instruction Set Opcodes (Continued) Mnemonic Instruction Lo-Register Hi-Register Condition Operand Operand Codes Set Subtract with carry – STMIA Store multiple – – Store word – – STRB Store byte – – STRH Store half-word –...
S3C2500B INSTRUCTION SET 3.20 FORMAT 1: MOVE SHIFTED REGISTER Offset5 [2:0] Destination Register [5:3] Source Register [10:6] Immediate Vale [12:11] Opcode 0 = LSL 1 = LSR 2 = ASR Figure 3-30. Format 1 3.20.1 OPERATION These instructions move a shifted value between Lo registers. The THUMB assembler syntax is shown in Table 3-8.
S3C2500B INSTRUCTION SET 3.21.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-9. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples R0, R3, R4 ;...
INSTRUCTION SET S3C2500B 3.22 FORMAT 3: MOVE/COMPARE/ADD/SUBTRACT IMMEDIATE Offset8 [7:0] Immediate Value [10:8] Source/Destination Register [12:11] Opcode 0 = MOV 1 = CMP 2 = ADD 3 = SUB Figure 3-32. Format 3 3.22.1 OPERATIONS The instructions in this group perform operations between a Lo register and an 8-bit immediate value. The THUMB assembler syntax is shown in Table 3-10.
S3C2500B INSTRUCTION SET 3.23 FORMAT 4: ALU OPERATIONS [2:0] Source/Destination Register [5:3] Source Register 2 [9:6] Opcode Figure 3-33. Format 4 3.23.1 OPERATION The following instructions perform ALU operations on a Lo register pair. NOTE All instructions in this group set the CPSR condition codes Table 3-11.
INSTRUCTION SET S3C2500B 3.23.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-11. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples R3, R4 ;...
S3C2500B INSTRUCTION SET 3.24 FORMAT 5: HI-REGISTER OPERATIONS/BRANCH EXCHANGE Rs/Hs Rd/Hd [2:0] Destination Register [5:3] Source Register [6] Hi Operand Flag 2 [7] Hi Operand Flag 1 [9:8] Opcode Figure 3-34. Format 5 3.24.1 OPERATION There are four sets of instructions in this group. The first three allow ADD, CMP and MOV operations to be performed between Lo and Hi registers, or a pair of Hi registers.
INSTRUCTION SET S3C2500B Table 3-12. Summary of Format 5 Instructions OP H1 THUMB Assembler ARM Equivalent Action ADD Rd, Hs ADD Rd, Rd, Hs Add a register in the range 8-15 to a register in the range 0-7. ADD Hd, Rs...
S3C2500B INSTRUCTION SET Examples Hi-Register Operations PC, R5 ; PC := PC + R5 but don't set the condition codes.CMP R4, R12 ; Set the condition codes on the result of R4 - R12. R15, R14 ; Move R14 (LR) into R15 (PC) ;...
INSTRUCTION SET S3C2500B 3.25 FORMAT 6: PC-RELATIVE LOAD Word 8 [7:0] Immediate Value [10:8] Destination Register Figure 3-35. Format 6 3.25.1 OPERATION This instruction loads a word from an address specified as a 10-bit immediate offset from the PC. The THUMB assembler syntax is shown below.
S3C2500B INSTRUCTION SET 3.26 FORMAT 7: LOAD/STORE WITH REGISTER OFFSET [2:0] Source/Destination Register [5:3] Base Register [8:6] Offset Register [10] Byte/Word Flag 0 = Transfer word quantity 1 = Transfer byte quantity [11] Load/Store Flag 0 = Store to memory 1 = Load from memory Figure 3-36.
INSTRUCTION SET S3C2500B 3.26.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-14. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples R3, [R2,R6] ;...
S3C2500B INSTRUCTION SET 3.27 FORMAT 8: LOAD/STORE SIGN-EXTENDED BYTE/HALF-WORD [2:0] Destination Register [5:3] Base Register [8:6] Offset Register [10] Sign-Extended Flag 0 = Operand not sing-extended 1 = Operand sing-extended [11] H Flag Figure 3-37. Format 8 3.27.1 OPERATION These instructions load optionally sign-extended bytes or half-words, and store half-words. The THUMB assembler syntax is shown below.
INSTRUCTION SET S3C2500B 3.27.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-15. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples...
S3C2500B INSTRUCTION SET 3.28 FORMAT 9: LOAD/STORE WITH IMMEDIATE OFFSET Offset5 [2:0] Source/Destination Register [5:3] Base Register [10:6] Offset Register [11] Load/Store Flag 0 = Store to memory 1 = Load from memory [12] Byte/Word Flad 0 = Transfer word quantity 1 = Transfer byte quantity Figure 3-38.
INSTRUCTION SET S3C2500B 3.28.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-16. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples R2, [R5,#116] ;...
S3C2500B INSTRUCTION SET 3.29 FORMAT 10: LOAD/STORE HALF-WORD Offset5 [2:0] Source/Destination Register [5:3] Base Register [10:6] Immediate Value [11] Load/Store Flag 0 = Store to memory 1 = Load from memory Figure 3-39. Format 10 3.29.1 OPERATION These instructions transfer half-word values between a Lo register and memory. Addresses are pre-indexed, using a 6-bit immediate value.
INSTRUCTION SET S3C2500B 3.30 FORMAT 11: SP-RELATIVE LOAD/STORE Word 8 [7:0] Immediate Value [10:8] Destination Register [11] Load/Store Bit 0 = Store to memory 1 = Load from memory Figure 3-40. Format 11 3.30.1 OPERATION The instructions in this group perform an SP-relative load or store. The THUMB assembler syntax is shown in the following table.
S3C2500B INSTRUCTION SET 3.31 FORMAT 12: LOAD ADDRES Word 8 [7:0] 8-bit Unsigned Constant [10:8] Destination Register [11] Source 0 = PC 1 = SP Figure 3-41. Format 12 3.31.1 OPERATION These instructions calculate an address by adding an 10-bit constant to either the PC or the SP, and load the resulting address into a register.
INSTRUCTION SET S3C2500B 3.31.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-19. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples R2, PC, #572 ;...
S3C2500B INSTRUCTION SET 3.32 FORMAT 13: ADD OFFSET TO STACK POINTER SWord 7 [6:0] 7-bit Immediate Value [7] Sign Flag 0 = Offset is positive 1 = Offset is negative Figure 3-42. Format 13 3.32.1 OPERATION This instruction adds a 9-bit signed constant to the stack pointer. The following table shows the THUMB assembler syntax.
INSTRUCTION SET S3C2500B 3.33 FORMAT 14: PUSH/POP REGISTERS Rlist [7:0] Register List [8] PC/LR Bit 0 = Do not store LR/Load PC 1 = Store LR/Load PC [11] Load/Store Bit 0 = Store to memory 1 = Load from memory Figure 3-43.
S3C2500B INSTRUCTION SET 3.33.2 INSTRUCTION CYCLE TIMES All instructions in this format have an equivalent ARM instruction as shown in Table 3-21. The instruction cycle times for the THUMB instruction are identical to that of the equivalent ARM instruction. Examples PUSH {R0–R4,LR}...
INSTRUCTION SET S3C2500B 3.34 FORMAT 15: MULTIPLE LOAD/STORE Rlist [7:0] Register List [10:8] Base Register [11] Load/Store Bit 0 = Store to memory 1 = Load from memory Figure 3-44. Format 15 3.34.1 OPERATION These instructions allow multiple loading and storing of Lo registers. The THUMB assembler syntax is shown in the following table.
S3C2500B INSTRUCTION SET 3.35 FORMAT 16: CONDITIONAL BRANCH Cond SOffset 8 [7:0] 8-bit Signed Immediate [11:8] Condition Figure 3-45. Format 16 3.35.1 OPERATION The instructions in this group all perform a conditional Branch depending on the state of the CPSR condition codes.
INSTRUCTION SET S3C2500B Table 3-23. The Conditional Branch Instructions (Continued) Code THUMB ARM Equivalent Action Assembler 1011 BLT label BLT label Branch if N set and V clear, or N clear and V set (less than) 1100 BGT label BGT label...
S3C2500B INSTRUCTION SET 3.36 FORMAT 17: SOFTWARE INTERRUPT Value 8 [7:0] Comment Field Figure 3-46. Format 17 3.36.1 OPERATION The SWI instruction performs a software interrupt. On taking the SWI, the processor switches into ARM state and enters Supervisor (SVC) mode.
INSTRUCTION SET S3C2500B 3.37 FORMAT 18: UNCONDITIONAL BRANCH Offset11 [10:0] Immediate Value Figure 3-47. Format 18 3.37.1 OPERATION This instruction performs a PC-relative Branch. The THUMB assembler syntax is shown below. The branch offset must take account of the prefetch operation, which causes the PC to be 1 word (4 bytes) ahead of the current instruction.
S3C2500B INSTRUCTION SET 3.38 FORMAT 19: LONG BRANCH WITH LINK Offset [10:0] Long Branch and Link Offset High/Low [11] Low/High Offset Bit 0 = Offset high 1 = Offset low Figure 3-48. Format 19 3.38.1 OPERATION This format specifies a long branch with link.
INSTRUCTION SET S3C2500B 3.38.2 INSTRUCTION CYCLE TIMES This instruction format does not have an equivalent ARM instruction. Table 3-26. The BL Instruction THUMB Assembler ARM Equivalent Action BL label none LR := PC + OffsetHigh << 12 temp := next instruction address PC := LR + OffsetLow <<...
S3C2500B INSTRUCTION SET 3.39 INSTRUCTION SET EXAMPLES The following examples show ways in which the THUMB instructions may be used to generate small and efficient code. Each example also shows the ARM equivalent so these may be compared. 3.39.1 MULTIPLICATION BY A CONSTANT USING SHIFTS AND ADDS The following shows code to multiply by various constants using 1, 2 or 3 Thumb instructions alongside the ARM equivalents.
INSTRUCTION SET S3C2500B 3.39.2 GENERAL PURPOSE SIGNED DIVIDE This example shows a general purpose signed divide and remainder routine in both Thumb and ARM code. 3.39.2.1 Thumb code ;signed_divide ; Signed divide of R1 by R0: returns quotient in R0, ;...
Page 211
S3C2500B INSTRUCTION SET 3.39.2.2 ARM Code signed_divide ; Effectively zero a4 as top bit will be shifted out later ANDS a4, a1, #&80000000 RSBMI a1, a1, #0 EORS ip, a4, a2, ASR #32 ;ip bit 31 = sign of result ;ip bit 30 = sign of a2...
INSTRUCTION SET S3C2500B 3.39.3 DIVISION BY A CONSTANT Division by a constant can often be performed by a short fixed sequence of shifts, adds and subtracts. Here is an example of a divide by 10 routine based on the algorithm in the ARM Cookbook in both Thumb and ARM code.
S3C2500B SYSTEM CONFIGURATION SYSTEM CONFIGURATION 4.1 OVERVIEW The System Configuration consists of several functions that control the clock configuration, system bus arbitration method and address remap function etc. 4.2 FEATURES Key features of the system configuration include the following; •...
EXT I/O Bank #0 0x00000000 Figure 4-1. S3C2500B Address map after resest Each memory block is mapped within the fixed location of memory space. As shown in the figure 4-1, the maximum size of ROM/SRAM/Flash/External IO bank is restricted to 16M-bytes and the SDRAM bank can be mapped within 1G-byte memory space.
4.5 EXTERNAL ADDRESS TRANSLATION The S3C2500B address bus is , in some respects, different than the bus used in other standard CPUs. Based on the required data bus width of each memory bank, the internal system address bus is shifted out to an external address bus, ADDR[23:0].
The S3C2500B can support the fixed priority and the round-robin method for AHB bus arbitration by register setting. Especially, the S3C2500B can program the priority order in the fixed priority mode as well as the ratio of the bus occupancy in the round-robin priority mode.
Page 217
Controller 1 HDLC Controller 0 Figure 4-3. Priority Groups of S3C2500B AHB Bus Programmable Priority Register are HPRIF(Programmable Priority Register for Fixed) and HPRIR (Programmable Priority Register for Round-Robin). If system configuration register (0xF0000000) SYSCFG[0] = 0x1, the programmable fixed priority is run by HPRIF register.
Page 218
SYSTEM CONFIGURATION S3C2500B SYSCFG [0] System bus arbitration method (ARB) 0 = Round-robin 1 = Fixed priority NOTE: See page 4-16 and 4-17. HPRIF 16 15 12 11 Reserved hprif4 hprif3 hprif1 hprif5 hprif2 hprif0 Low Priority High Priority HPRIR...
Ethernet controller 0 1/6, and Ethernet controller 1 1/6. In short, GDMA is run four times more than Ethernet controller 0 and 1. This is because S3C2500B is designed to turn the bus occupancy to the next master when there is non-used master. For instance,...
Page 220
SYSTEM CONFIGURATION S3C2500B The following is the problem solving with software. HPRIR Channel Expected Real HPRIR Channel Occupancy System Bus Occupancy Occupancy GDMA GDMA Ethernet Ethernet controller 0 controller 0 ⇒ Ethernet Ethernet controller 1 controller 1 Problem Problem Solving Writing "0x000330", instead of "0x0"...
4.7 CLOCK CONFIGURATION The S3C2500B has four PLL clocking scheme – CPU PLL, System BUS PLL, USB PLL, PHY PLL. All of the PLL can operate if the corresponding clock select pin is set to “0” (CLKSEL- shared with CPU PLL and System BUS PLL, USB_CLKSEL, PHY_CLKSEL).
Page 222
SYSTEM CONFIGURATION S3C2500B Table 4-3. Clock Frequencies for CLKMOD Pins, CPU_FREQ Pins, and BUS_FREQ Pins (Continued) CLKMOD [1:0] CPU_FREQ [2:0] BUS_FREQ [2:0] ARM940T Clock AMBA BUS Clock USB Clock Frequency Frequency Frequency 2'b11 (Async) 3'b001 3'b000 150MHz 133MHz 48MHz 3'b001...
Page 223
S3C2500B SYSTEM CONFIGURATION Table 4-3. Clock Frequencies for CLKMOD Pins, CPU_FREQ Pins, and BUS_FREQ Pins (Continued) CLKMOD [1:0] CPU_FREQ [2:0] BUS_FREQ [2:0] ARM940T Clock AMBA BUS Clock USB Clock Frequency Frequency Frequency 2'b11 (Async) 3'b101 3'b000 66MHz 133MHz 48MHz 3'b101...
Page 224
Where the Fin is the frequency of the PLL input clock and the Fout is the frequency of the PLL output clock. The four PLLs in the S3C2500B are controlled by above formula and the table 4-4 shows the PLL variables for the most widely used frequencies.
Page 225
Table 3. The CLKCON[15:0] register can divide the various AMBA clock frequecies of the Table 4-3. All PLL can be controlled by either pin setting or register setting. Figure 4-5. Shows the Clock Generation Logic of the S3C2500B 4-13...
SYSTEM CONFIGURATION S3C2500B 4.8 EXTERNAL BUS MASTER The S3C2500 allows the external bus master to get the external memory bus and control the external memory system. When the external bus master asserts XBMREQ to get the external memory bus, the S3C2500 asserts XMBACK high and drives the state of the external memory bus to high impedance after S3C2500 finishes current transfer with memory.
S3C2500B SYSTEM CONFIGURATION 4.9 SYSTEM CONFIGURATION SPECIAL REGISTERS The System Configuration reigisters are as follows Table 4-5. System Configuration Registers Name Address Description Reset Value SYSCFG 0xF0000000 System configuration register – PDCODE 0xF0000004 Product code and revision number register 0x250000A0...
SYSTEM CONFIGURATION S3C2500B 4.9.1 SYSTEM CONFIGURATION REGISTER (SYSCFG) You can control the system bus arbitration method, PLL operation, system clock output enable/disable function, external memory address remap function and Little/Big information read function by SYSCFG. Register Address Description Reset Value...
Page 229
SDRAM1 bank1 : 0x40000000 MISALIGN Misalign Exception Enable S3C2500B asserts the data abort exception in case of CPU misaligned accesses. But there is a limitation to that you should set off Instruction/Data cache when you want misaligned access aborts. HCLKO_DIS HCLKO output disable If this bit is set to “1”, HCLKO output is activated only when sdram...
S3C2500B SYSTEM CONFIGURATION 4.9.3 CLOCK CONTROL REGISTER (CLKCON) There is a clock control register(CLKCON) in system configuration. For the purpose of power save, Clock control register(CLKCON) can be programmed at low frequency and the slower clock than the system clock can be made by clock dividing value .
SYSTEM CONFIGURATION S3C2500B 4.9.4 PERIPHERAL CLOCK DISABLE REGISTER (PCLKDIS) There is a peripheral clock disable register in system configuration. You can set this register with the specific value for the purpose of power save. If you set PCLKDIS[0] to “1”, the clock for GDMA channel 0 is disabled.
SYSTEM CONFIGURATION 4.9.5 CLOCK STATUS REGISTER (CLKST) The operating frequency of the S3C2500B can be obtained by reading the CLKST register. The CPU Freq field in CLKST[11:0] decodes the CPU_FREQ[2:0] settings and the BUS Freq in CLKST[23:12] decodes the BUS_FREQ[2:0] settings. There are 3 clock modes in the S3C2500B - fast mode, sync mode and async mode. In async mode, there is no misinformation about the frequency.
SYSTEM CONFIGURATION S3C2500B 4.9.7 CORE PLL CONTROL REGISTER (CPLLCON) If you want to use this register, you should set CPLLREN in SYSCFG[31] to “1”. This register doesn’t work with CPLLREN set to “0”. Register Address Description Reset Value CPLLCON 0xF000001C...
S3C2500B SYSTEM CONFIGURATION 4.9.8 SYSTEM BUS PLL CONTROL REGISTER (SPLLCON) If you want to use this register, you should set SPLLREN in SYSCFG[30] to “1”. This register doesn’t work with SPLLREN set to “0”. Register Address Description Reset Value SPLLCON...
SYSTEM CONFIGURATION S3C2500B 4.9.9 USB PLL CONTROL REGISTER (UPLLCON) If you want to use this register, you should set UPLLREN in SYSCFG[29] to “1”. This register doesn’t work with UPLLREN set to “0”. Register Address Description Reset Value UPLLCON 0xF0000024...
DMA controller or CPU generates an address that corresponds to a SDRAM bank, the SDRAM controller generates the required SDRAM access signals. • To provide the required signals for bus traffic between the S3C2500B and ROM/SRAM and the external I/O banks. • •...
By generating an external bus request, an external device can access the S3C2500B's external memory interface pins. In addition, the S3C2500B can access slow external devices by using a WAIT signal. The WAIT signal, which is generated by the external device, extends the duration of the CPU’s memory...
S3C2500B MEMORY CONTROLLER 5.3 MEMORY MAP After a power-on or system reset, all bank address pointer registers are initialized to their default values. And the base address of all banks are fixed. The initial system memory map following system start-up is shown in Figure 5-1.
Page 240
MEMORY CONTROLLER S3C2500B 0xFFFFFFFF Internal Register 0xF0000000 Reserved 0x88000000 Bank 1 0x80000000 Reserved 0x48000000 Bank 0 0x40000000 Reserved 0x08000000 EXT I/O Bank 7 0x07000000 EXT I/O Bank 6 0x06000000 EXT I/O Bank 5 0x05000000 EXT I/O Bank 4 0x04000000 EXT I/O Bank 3...
MEMORY CONTROLLER 5.4 BUS INTERFACE SIGNALS The bus interface signals transfer information between the S3C2500B and external memory device. These divide into address and data which used commonly, SDRAM interface signals for SDRAM and memory device interface for ROM/SRAM, etc.
Page 242
MEMORY CONTROLLER S3C2500B ADDR[23:0] Address & Data DATA[31:0] B0SIZE[1:0] Adjust with pin selection nRCS[7:0] ROM & SRAM nEWAIT/nREADY Interface signals XBMACK External device XBMREQ interface signals S3C2500B nSDWE/nWE16 ROM, SRAM, Flash nWBE/nBE/DQM[3:0] and SDRAM common signals HCLKO nSDCS[1:0] SDRAM Interface...
MEMORY CONTROLLER 5.5 ENDIAN MODES S3C2500B supports both little-endian and big-endian for external memory or I/O devices by setting the pin BIG. Below tables(5-3 through 5-14) are show the program/data path between the CPU register and the external memory using little-/big-endian and word/half-word/byte access.
Page 244
MEMORY CONTROLLER S3C2500B Table 5-5 and 5-6. Using big-endian and half-word access, Program/Data path between register and external memory. WA=Address whose LSB is 0, 4, 8, C, EA=External Address HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E BA=Address whose LSB is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F X=Don't care.
Page 245
S3C2500B MEMORY CONTROLLER Table 5-7 and 5-8. Using big-endian and byte access, Program/Data path between register and external memory. WA=Address whose LSB is 0, 4, 8, C, EA=External Address HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E BA=Address whose LSB is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F X=Don't care.
Page 246
MEMORY CONTROLLER S3C2500B Table 5-9 and 5-10. Using little-endian and word access, Program/Data path between register and external memory. WA=Address whose LSB is 0, 4, 8, C, EA=External Address HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E...
Page 247
S3C2500B MEMORY CONTROLLER Table 5-11 and 5-12. Using little-endian and half-word access, Program/Data path between register and external memory. WA=Address whose LSB is 0, 4, 8, C, EA=External Address HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E BA=Address whose LSB is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F X=Don't care.
Page 248
MEMORY CONTROLLER S3C2500B Table 5-13 and 5-14. Using little-endian and byte access, Program/Data path between register and external memory. WA=Address whose LSB is 0, 4, 8, C, EA=External Address HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E BA=Address whose LSB is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F X=Don't care.
S3C2500B MEMORY CONTROLLER 5.6 EXT I/O BANK CONTROLLER Ext I/O Bank controller can be interfaceing ROM, SRAM, flash memory, etc, except SDRAM. It also supports muxed bus memory device which shares address bus and data bus. Ext I/O bank controller has three kind of the register for eight banks and then it can be controlled by various timing control options.
MEMORY CONTROLLER S3C2500B 5.6.2 EXTERNAL DEVICE CONNECTION Figure 5-3. illustrates a simple connection between 8-bit ROM/Flash and S3C2500B. ADDR[23:0] ADDR DATA[7:0] DATA 8-bit ROM/ nRCS[0] Flash nWBE[0] S3C2500B Figure 5-3. 8-bit ROM, SRAM and Flash Basic Connection 5-14...
Page 251
S3C2500B MEMORY CONTROLLER Figure 5-4. illustrates a example connection between two of 8-bit ROM/Flash and S3C2500B for the consisting of 16-bit ROM/SRAM/Flash. ADDR[23:0] ADDR[23:0] DATA[7:0] DATA[7:0] nRCS[0] 8-bit ROM/Flash nWBE[0] S3C2500B ADDR[23:0] DATA[15:8] DATA[7:0] 8-bit ROM/Flash nWBE[1] Figure 5-4. 8-bit ROM, SRAM and Flash Basic Connection (8-bit Memory x 2)
Page 252
MEMORY CONTROLLER S3C2500B Figure 5-5. illustrates a connection between 16-bit ROM/SRAM and S3C2500B. ADDR[23:0] ADDR DATA[15:0] DATA nSDWE/nWE16 16-bit SRAM nRCS nBE[1] S3C2500B Upper byte nBE[0] Lower byte Figure 5-5. 16-bit SRAM Basic Connection 5-16...
Page 253
S3C2500B MEMORY CONTROLLER Figure 5-6. illustrates a connection between 16-bit ROM/Flash and S3C2500B. ADDR[23:0] ADDR DATA[15:0] DATA nRCS 16-bit ROM/Flash nSDWE/nWE16 S3C2500B Figure 5-6. 16-bit ROM and Flash Basic Connection 5-17...
Page 254
MEMORY CONTROLLER S3C2500B Figure 5-7. illustrates a connection between 16-bit ROM and S3C2500B. ADDR[23:0] ADDR DATA[31:0] DATA[15:0] DATA 16-bit ROM nRCS nSDWE/nWE16 S3C2500B ADDR DATA[31:16] DATA 16-bit ROM Figure 5-7. 16-bit ROM Basic Connection 2 5-18...
Page 255
S3C2500B MEMORY CONTROLLER Figure 5-8. illustrates a connection between 16-bit SRAM and S3C2500B. ADDR[23:0] ADDR DATA[31:0] DATA[15:0] DATA 16-bit ROM nRCS nWBE[1] Upper byte nWBE[0] Lower byte S3C2500B ADDR DATA[31:16] DATA 16-bit ROM nWBE[3] Upper byte nWBE[2] Lower byte Figure 5-8. 16-bit SRAM Basic Connection 2...
Page 256
MEMORY CONTROLLER S3C2500B Figure 5-9. illustrates a connection between S3C2500B and muxed bus ROM & SRAM. ADDR[23]/ALE DATA[7:0] DATA[7:0] nRCS nWBE nWBE S3C2500B nREADY nREADY Figure 5-9. ROM & SRAM with Muxed Address & Data Bus Connection NOTE If the external I/O use nReady signal insteady of nWait, you must select nReady in WAITCON register of memory controller.
S3C2500B MEMORY CONTROLLER 5.6.3 EXT. I/O BANK CONTROLLER SPECIAL REGISTER To control the external memory operations, the memory controller uses a dedicated set of special registers (see Table 5-15). By programming the values in the memory controller special registers, you can specify such things as •...
Page 258
The Ext I/O Bank controller has eight external I/O access control registers. These registers correspond to up to eight external I/O banks that are supported by S3C2500B. Table 5-16 describes eight registers that are used to control the timing of external I/O bank accesses.
Page 259
S3C2500B MEMORY CONTROLLER Table 5-16. Bank n Control (BnCON) Register Register Address Description Reset Value B0CON 0xF0010000 Bank 0 control register 0xC514E488 (B0SIZE=3) 0x8514E488 (B0SIZE=2) 0x4514E488 (B0SIZE=1) B1CON 0xF0010004 Bank 1 control register 0xC514E488 B2CON 0xF0010008 Bank 2 control register...
Page 261
S3C2500B MEMORY CONTROLLER NOTES 1. If WAITEN of WAITCON register is enable, memory controller can't finish access cycle until nEWAIT signal is high. If you use slow device, you can set WAITEN to '1' and control nEWAIT signal. The memory controller checks nEWAIT signal at the last cycle of TACC. If you set WAITEN to '0', the f nEWAIT signal is ignored.
Page 263
I/O devices are connected to nEWAIT, each WAIT signals of external I/O devices should be or.) nEWAIT is low active signal. When nEWAIT is a low, S3C2500B is waiting until nEWAIT is high again. nREADY in the WAITCON register is used when the external I/O device is ready for transferring data. When nREADY is low, S3C2500B transfers data.
Page 264
MEMORY CONTROLLER S3C2500B 21 20 Reserved [31:24] Reserved [23] TCOH disable for bank 7: COHDIS7 This forces TCOH to '0' for read to read, write to write, and write to read access in the bank 7 0 = disable 1 = enable...
MEMORY CONTROLLER S3C2500B 5.7 SDRAM CONTROLLER 5.7.1 FEATURES The SDRAM controller provides the following features: • Provides merging write buffer to improve system performance. • Supports for 16M-bit, 64M-bit, 128M-bit and 256M-bit SDRAM devices with two or four leaves. •...
S3C2500B MEMORY CONTROLLER 5.7.2 SDRAM SIZE AND CONFIGURATION The SDRAM controller supports a SDRAM memory ranging from 2 to 256M-byte. Table 5-19. Illustrates the supported SDRAM configurations when external bus width is 32-bits. Table 5-20. Illustrates the supported SDRAM configurations when external bus width is 16 bits.
MEMORY CONTROLLER S3C2500B 5.7.3 ADDRESS MAPPING Table 5-21. Illustrates the AHB address bus to the SDRAM address ADDR[14:0] mapping for various memory devices when external bus width is 32-bits. Table 5-22. Illustrates the AHB address bus to the SDRAM address ADDR[14:0] mapping for various memory devices when external bus width is 16-bits.
MEMORY CONTROLLER S3C2500B 5.7.4 SDRAM COMMANDS The SDRAM controller issues specific commands to the SDRAM devices by encoding the nSDCS, nSDRAS, nSDCAS and nSDWE outputs. Table 5-23. Lists all of the SDRAM commands understood by SDRAM devices. The controller supports a subset of these commands.
S3C2500B MEMORY CONTROLLER 5.7.5 EXTERNAL DATA BUS WIDTH The SDRAM controller supports not only 32-bit data bus, but also 16-bit data bus. External data bus width can be selected by the XW field of CFGREG. 5.7.6 MERGING WRITE BUFFER A merging write buffer compacts the writes of all widths into quad-word, which can be efficiently transferred to the SDRAM.
MEMORY CONTROLLER S3C2500B 5.7.8 BASIC OPERATION SDRAM initialization sequence On power-on reset, software must initialize the SDRAM controller and each of the SDRAM connected to the controller. Refer to the SDRAM data sheet for more detailed information on the start up procedure for the SDRAM used.
S3C2500B MEMORY CONTROLLER 5.7.9 SDRAM SPECIAL REGISTERS The address and reset value of the special registers in the SDRAM controller summarized in Table 5-24. Table 5-24. SDRAM Special Registers Name Address Description Reset value CFGREG 0xF0020000 Configuration register 0x00099F0C CMDREG...
Page 284
MEMORY CONTROLLER S3C2500B Table 5-25. SDRAM Configuration Register (Continue) Reg0 Description Default value External data bus Width 0 = external bus width is 32-bit. 1 = external bus width is 16-bit. Auto Pre-charge control for SDRAM accesses 0 = Auto pre-charge...
Page 285
S3C2500B MEMORY CONTROLLER 20 19 12 11 10 9 8 7 6 RESERVED [0] eXternal data bus Width : XW 0 = external bus width is 32 bit ,1 = external bus width is 16 bit [1] Auto Pre-charge control for SDRAM accesses: AP...
Page 286
MEMORY CONTROLLER S3C2500B 5.7.9.2 Command Register The configuration register 1 is 32-bit read/write (some bits are read only) register. The SDRAM initialization command, write buffer operation can be controlled by this register. Table 5-26. SDRAM Command Register Registers Address Description...
Page 287
S3C2500B MEMORY CONTROLLER RESERVED [1:0] Control bits for SDRAM device initialization : 00 = Normal operation 01 = Automatically issue a PALL to the SDRAM 10 = Automatically issue a MRS to the SDRAM 11 = reserved [2] Write buffer enable:...
Page 288
MEMORY CONTROLLER S3C2500B 5.7.9.3 Refresh Timer Register The Refresh timer register is 32-bit read/write (some bits are read only) register. This register sets the SDRAM refresh cycle. The refresh timer register is programmed with the number of system bus clock that should be counted between SDRAM refresh cycles.
Page 289
S3C2500B MEMORY CONTROLLER 5.7.9.4 Write Buffer Time-out Register The write buffer time-out register works with the merging write buffer (if write buffer is enabled). This 16-bit read/write field of register sets the cycles for a forced flush of the write buffer.
6.2 FEATURES • Supports only single master mode. • Supports 8-bit, bi-directional, serial data transfers. • Supports 7-bit addressing. Figure 6-1 shows a block diagram of the S3C2500B I C controller Data Shift buffer register (IICBUF) Control Serial Serial Clock...
C CONTROLLER S3C2500B 6.3 FUNCTIONAL DESCRIPTION The S3C2500B I C controller is the master of the serial I C. Using a prescaler register, the user can program the serial clock frequency that is supplied to the I C controller. The serial clock frequency is calculated as follows: / (16 ×...
S3C2500B C CONTROLLER 6.4 I C CONCEPTS 6.4.1 BASIC OPERATION The I C has two wires, a serial data line (SDL) and a serial clock line (SCL), to carry information between the ICs connected to the bus. Each IC is recognized by a unique address and can operate as either a transmitter or receiver, depending on the function of the specific ICs.
C CONTROLLER S3C2500B Acknowledge Acknowledge from from receiver transmitter SDA by Transmitter SDA by Receiver SCL from Master Stop Start Data Address Condition Condition Figure 6-3. Master Receiver and Slave Transmitter Even in this case, the master IC generates the timing and terminates the transfer.
S3C2500B C CONTROLLER 6.4.4 DATA VALIDITY The data on the SDA line must be stable during the high period of the clock. The high or low state of the data line can only change when clock signal on the SCL line is low.
C CONTROLLER S3C2500B 6.4.6 DATA TRSANSFER OPERATIONS 6.4.6.1 Data Byte Format Every data byte that is put on the SDA line must be 8 bits long. The number of bytes that can be transmitted per transfer is unlimited. Each byte must be followed by an acknowledge bit. Data is transferred MSB-first.
Page 303
S3C2500B C CONTROLLER 6.4.6.3 Data Transfer Format Data transfers uses the format shown in Figure 6-5. After the start condition has been generated, a 7-bit slave address is sent. The eighth bit is a data direction bit (R/W). A "0" direction bit indicates a transmission (Write) and a "1"...
Page 304
C CONTROLLER S3C2500B 6.4.6.4 I C Addressing The addressing procedure for the I C is such that the first byte after the start condition determines which slave the master will select. Usually, this first byte immediately follows the start procedure.
S3C2500B C CONTROLLER 6.5 I C SPECIAL REGISTERS The I C controller has three special registers: a control status register (IICCON), a prescaler register (IICPS), and a shift buffer register (IICBUF). 6.5.1 CONTROL STATUS REGISTER (IICCON) The control status register for the I C, IICCON, is described in Table 6-2.
Page 306
C CONTROLLER S3C2500B 6 5 4 3 2 1 Reserved [0] Buffer Flag (BF) 0 = Automatically cleared when the IICBUF register is written or read. To manually clear the BF, write 0. 1 = Automatically set when the buffer is empty in transmit mode or when the buffer is full in receive mode.
S3C2500B C CONTROLLER 6.5.2 SHIFT BUFFER REGISTER (IICBUF) The shift buffer register for the I C described in Table 6-4. Table 6-3. IICBUF Register Register Address Description Rest Value IICBUF 0xF00F0004 Shift buffer register Undefined Table 6-4. IICBUF Register Description...
C CONTROLLER S3C2500B 6.5.4 PRESCALER COUNTER REGISTER (IICCNT) The prescaler counter register for the I C is described in Table 6-8. Table 6-7. IICCNT Register Register Address Description Rest Value IICCNT 0xF00F000C Prescaler counter register 0x00000000 Table 6-8. IICCNT Register Description...
Page 309
S3C2500B C CONTROLLER IIC Setup (Reset, IICPS Setup) IICCON = Start | BF IICBUF = IIC Slave Address | 0 x 0 IICBUF = IIC Upper Address IICBUF = IIC Lower Address IICBUF = One Byte Data All Data Sent? IICCON = Stop Figure 6-7.
ETHERNET CONTROLLER 7.1 OVERVIEW The S3C2500B has two Ethernet controllers that operate at either 100M-bit or 10M-bit per second in half-duplex or full-duplex mode. In half-duplex mode, the IEEE 802.3 carrier sense multiple access with collision detection (CSMA/CD) protocol is supported. In full-duplex mode, the IEEE 802.3 MAC control layer is also supported, including the pause operation for flow control.
ETHERNET CONTROLLER S3C2500B 7.2 FEATURES The most important features and benefits of each Ethernet controller are as follows: • Cost-effective connection to an external RIC(Repeater Interface Controller)/Ethernet backbone • Buffered DMA (BDMA) engine with burst mode • BDMA Tx/Rx Buffers (BTxBUFF and BRxBUFF: 256 bytes/256 bytes) •...
S3C2500B ETHERNET CONTROLLER 7.3 MAC FUNCTION BLOCKS The major function blocks of each Ethernet of MAC layer are described in Table 7-1 and Figure 7-1. Table 7-1. MAC Function Block Descriptions Function Block Description Media Independent The interface between the physical layer and the transmit/receiver blocks.
ETHERNET CONTROLLER S3C2500B 7.3.2 PHYSICAL LAYER ENTITY (PHY) The physical layer entity, or PHY, performs all of the decoding/encoding on incoming and outgoing data. The manner of decoding and encoding (Manchester for 10BASE-T, 4B/5B for 100BASE-X, or 8B/6T for 100BASE-T4) does not affect the MII.
Page 315
S3C2500B ETHERNET CONTROLLER 7.3.4.5 Threshold Logic and Counters The transmission state machine uses a counter and logic to control the threshold of when the transmission can begin. Before transmitting the MAC waits until eight bytes or a complete frame has been placed in the MTxFIFO.
ETHERNET CONTROLLER S3C2500B 7.3.5 THE MAC RECEIVER BLOCK It complies with the IEEE802.3 standard for carrier sense multiple access with collision detection (CSMA/CD) protocol. After it receives a frame, the receiver block checks for a number of error conditions: CRC errors, alignment errors, and length errors.
S3C2500B ETHERNET CONTROLLER 7.3.6 FLOW CONTROL BLOCK Flow control is done using the MAC control frame. The receiver sends control frames to the transmitter and the transmitter pauses its operation during the time interval specified in the control frames. The flow control block provides the following functions: •...
Page 318
ETHERNET CONTROLLER S3C2500B 7.3.7.2 Control and Status This block controls the read/write operations of the bus master across the AMBA. The control logic supports the following operations: — Fixed 4-word burst size control between Tx and Rx. — Transmit threshold control (based on 1/8 of transmit buffer size) to match transmission latency to system bus latency.
Page 319
S3C2500B ETHERNET CONTROLLER 7.3.7.3 Buffer Descriptor The ownership bit in the buffer descriptor controls the owner of the descriptor. When the ownership bit is '1', the BDMA controller owns the descriptor. When the bit is '0', the CPU owns the descriptor. The owner of the descriptor always owns the associated data frame.
Page 320
ETHERNET CONTROLLER S3C2500B 18 17 Buffer Pointer TxStatus TxWidget TxLength [31:0] Buffer pointer Address of the data be transmitted. [31] Ownership bit (O) 0 = CPU 1 = BDMA [30:18] TxStatus Writing in this field don't have any mean. [30] Reserved [29] Paused Transmission of frame was paused due to the reception of a Pause control frame.
Page 321
S3C2500B ETHERNET CONTROLLER 29 28 27 26 Buffer Pointer B S E D Status RxLength [31:0] Buffer pointer Address of the frame data be saved. [31] Ownership bit (O) 0 = CPU 1 = BDMA [30] Skip BD (B) Set this bit to skip the current buffer descriptor when the ownership bit is cleared.
Page 322
ETHERNET CONTROLLER S3C2500B Buffer Descriptor Start Address Register buffer pointer #1 BRXBDCNT+0 status length buffer #1 BRxBS of BDMARXLEN not used buffer pointer #2 buffer #2 BRXBDCNT+1 status length BRxBS of BDMARXLEN not used buffer #N BRxBS of BDMARXLEN not used...
S3C2500B ETHERNET CONTROLLER 7.4 ETHERNET CONTROLLER SPECIAL REGISTERS There are two Ethernet controllers in S3C2500B. They are same each other except the base addresses for internal registers. Table 7-2. ETHERNET 0 Special Registers Registers Address Description Reset Value BDMATXCONA 0xF00A0000...
ETHERNET CONTROLLER S3C2500B 7.4.2 MAC RELATIVE SPECIAL REGISTER 7.4.2.1 MAC Transmit Control Frame Status The transmit control frame status register, CFTXSTAT provides the status of a MAC control frame as it is sent to a remote station. This operation is controlled by the MSdPause bit in the transmit control register, MACTXCON.
Page 335
S3C2500B ETHERNET CONTROLLER 7.4.2.2 MAC Control Register The MAC control register provides global control and status information for the MAC. The MLINK10 bit is a status bit. All other bits are MAC control bits. MAC control register settings affect both transmission and reception.
Page 336
ETHERNET CONTROLLER S3C2500B 7.4.2.3 CAM Control Register The three acceptance bits (MStation, MGroup, and MBroad) in the CAM control register are used to override the address comparison mode by the compare enable bit(MCompEn). By setting the CAM control register, it is possible to accept frames with all types of destination addresses.
Page 337
S3C2500B ETHERNET CONTROLLER 7.4.2.4 MAC Transmit Control Register Table 7-32. MACTXCON Register Registers Address Description Reset Value MACTXCONA 0xF00B0008 Transmit control 0x00000000 MACTXCONB 0xF00D0008 Transmit control 0x00000000 Table 7-33. MAC Transmit Control Register Description Bit Number Bit Name Description Transmit enable (MTxEn) Set this bit to enable transmission.
Page 338
ETHERNET CONTROLLER S3C2500B 7.4.2.5 MAC Transmit Status Register A transmission status flag is set in the transmit status register, MACTXSTAT, whenever the corresponding event occurs. In addition, an interrupt is generated if the corresponding enable bit in the transmit control register is set.
Page 339
S3C2500B ETHERNET CONTROLLER 7.4.2.6 MAC Receive Control Register Table 7-36. MACRXCON Register Registers Offset Description Reset Value MACRXCONA 0xF00B0010 Receive control 0x00000000 MACRXCONB 0xF00D0010 Receive control 0x00000000 Table 7-37. MAC Receive Control Register Description Bit Number Bit Name Description Receive enable (MRxEn) Set this bit to '1' to enable MAC receive operation.
Page 340
ETHERNET CONTROLLER S3C2500B 7.4.2.7 MAC Receive Status Register A receive status flag is set in the MAC receive status register, MACRXSTAT, whenever the corresponding event occurs. When a status flag is set, it remains set until another packet arrives, or until software writes a ‘1’ to the flag to clear the status bit.
Page 341
S3C2500B ETHERNET CONTROLLER 7.4.2.8 MAC Station Management Data Register Table 7-40. STADATA Register Registers Address Description Reset Value STADATAA 0xF00B0018 Station management data 0x00000000 STADATAB 0xF00D0018 Station management data 0x00000000 Table 7-41. Station Management Register Description Bit Number Bit Name...
Page 342
ETHERNET CONTROLLER S3C2500B 7.4.2.9 MAC Station Management Data Control and Address Register The MAC controller provides support for reading and writing station management data to the PHY. Setting options in station management registers does not affect the controller. Some PHYs may not support the option to suppress preambles after the first operation.
Page 343
S3C2500B ETHERNET CONTROLLER 7.4.2.10 CAM Enable Register The CAMEN register indicates which CAM entries are valid, using a direct comparison mode. Up to 21 entries, numbered 0 through 20, may be active, depending on the CAM size. If the CAM is smaller than 21 entries, the higher bits are ignored.
Page 344
ETHERNET CONTROLLER S3C2500B 7.4.2.11 MAC Missed Error Count Register The value in the missed error count register, MISSCNT, indicates the number of frames that were discarded due to various type of errors. Together with status information on frames transmitted and received, the missed error count register and the two pause count registers provide the information required for station management.
Page 345
S3C2500B ETHERNET CONTROLLER 7.4.2.12 MAC Received Pause Count Register The received pause count register, PZCNT, stores the current value of the 16-bit received pause counter. Table 7-48. PZCNT Register Registers Address Description Reset Value PZCNTA 0XF00B0040 Pause count 0x00000000 PZCNTB...
Page 346
ETHERNET CONTROLLER S3C2500B 7.4.2.14 Content Addressable Memory (CAM) Register There are 21 CAM entries for the destination address and the pause control frame. For the destination address CAM value, one destination address consists of 6 bytes. Using the 32-word space (32 × 4 bytes), you can therefore maintain up to 21 separate destination addresses.
S3C2500B ETHERNET CONTROLLER 7.5 ETHERNET OPERATIONS 7.5.1 MAC FRAME FORMAT Table 7-2 lists the eight fields in a standard (IEEE 802.3/Ethernet frame). Table 7-53. MAC Frame Format Description Field Name Field Size Description Preamble 7-byte The bits in each preamble byte are 10101010, transmitted from left to right.
Page 348
ETHERNET CONTROLLER S3C2500B Packet (Encoded on the Medium) Data Frame (sent by user) Added by transmitter Added by Transmitter, Stripped by Data frame (delivered to user) Optionaly stripped Receiver by receiver Destination Source Length or Preamble LLC data Address Address...
Page 349
S3C2500B ETHERNET CONTROLLER 7.5.1.2 Destination Address Format Bit 0 of the destination address is an address type designation bit. It identifies the address as either an individual or a group address. Group addresses are sometimes called 'multicast' addresses and individual addresses are called 'unicast' addresses.
Page 350
ETHERNET CONTROLLER S3C2500B The back-off state machine The back-off state machine implements the back-off and retry algorithm of the 802.3 CSMA/CD. When a collision is detected, the main transmission state machine starts the back-off state machine′s counters and waits for the back-off time (including zero) to elapse. This time is a multiple of 512 bit times that elapse before the frame that caused the collision is re-transmitted.
Page 351
S3C2500B ETHERNET CONTROLLER The main transmission state machine The main transmission state machine implements the remaining MAC layer protocols. If there is data to be transferred, if the inter-frame gap is valid, and if the MII is ready (that is, if there are no collisions and no CRS in full-duplex mode), the transmitter block then transmits the preamble followed by the SFD.
Page 352
ETHERNET CONTROLLER S3C2500B Tx_clk Tx_en TxD [3:0] Figure 7-8. Timing for Transmission with Collision in Preamble 7.5.1.3.2. BDMA/MAC Interface Operation for Transmission The BDI transmit operation is a simple FIFO mechanism. The BDMA engine stores data to be transmitted, and the transmission state machine empties it when the MAC successfully acquires the net.
Page 353
S3C2500B ETHERNET CONTROLLER 7.5.1.4.1. Receive Frame Timing With/Without Error If, during frame reception, both Rx_DV and Rx_er are asserted, a CRC error is reported for the current packet. As each nibble of the destination address is received, the CAM block attempts to recognize it. After receiving the last destination address nibble, if the CAM block rejects the packet, the receive block asserts the Rx_toss signal, and discards any bytes not yet removed from the receive FIFO that came from the current packet.
Page 354
ETHERNET CONTROLLER S3C2500B 7.5.1.4.2 BDMA/MAC Interface Operation for Reception The BDI receive operation is a simple FIFO mechanism. The BDMA engine stores received data to MRxFIFO, and the BDMA RxBUFF controller empties it when the BDMA RxBUFF has enough space left.
S3C2500B ETHERNET CONTROLLER 7.5.2 THE MII STATION MANAGER The MDIO (management data input/output) signal line is the transmission and reception path for control/status information for the station management entity, STA. The STA controls and reads the current operating status of the PHY layer.
ETHERNET CONTROLLER S3C2500B 7.5.3 FULL-DUPLEX PAUSE OPERATIONS Flow control can be done by the use of control frames. The receive logic in the flow control block recognise a MAC control frame as follows: — The current specification for full-duplex flow control specifies a special destination address for the Pause operation frame.
Page 357
S3C2500B ETHERNET CONTROLLER 7.5.3.1 Transmit Pause Operation To enable a full-duplex Pause operation, the special broadcast address for MAC control frames must be programmed into the CAM, and the corresponding CAM enable bit set. The special broadcast address can be a CAM location.
ETHERNET CONTROLLER S3C2500B 7.5.4 ERROR SIGNALLING The error/abnormal operation flags asserted by the MAC are arranged into transmit and receive groups. These flag groups are located either in the transmit status register (MACTXSTAT) or the receive status register (MACRXSTAT). A missed frame error counter is included for system network management purposes.
Page 359
S3C2500B ETHERNET CONTROLLER 7.5.4.2 Reporting of Reception Errors When it detects a start of frame delimiter (SFD), the MAC starts putting data it has received from the MII into the MRxFIFO. It also checks for internal errors (MRxFIFO overruns) while reception is in progress.
ETHERNET CONTROLLER S3C2500B 7.5.5 TIMING PARAMETERS FOR MII TRANSACTIONS The timing diagrams in this section conform to the guidelines described in the "Draft Supplement to ANSI/IEEE Std. 802.3, Section 22.3, Signal Characteristics." TX_CLK 28ns MIN 4.9ns MIN TXD[3:0] Output Valid TX_EN Figure 7-13.
HDLC CONTROLLER HDLC CONTROLLER 8.1 OVERVIEW The S3C2500B has three high-level data link controllers (HDLCs) to support three-channel serial communica- tions. The HDLC module supports a CPU/data link interface that conforms to the synchronous data link control (SDLC) and high-level data link control (HDLC) standards. In addition, the following function blocks are integrated into the HDLC module: —...
HDLC CONTROLLER S3C2500B 8.2 FEATURES Important features of the S3C2500B HDLC block are as follows: • • Protocol features: — Flag detection and synchronization — Zero insertion and deletion — Idle detection and transmission — FCS encoding and detection (16-bit) —...
S3C2500B HDLC CONTROLLER 8.3 FUNCTION DESCRIPTIONS Figure 8-1 shows the HDLC module's function blocks. These function blocks are described in detail in the following sections. Tx FIFO FCS Generator (8 Words) autoecho Address Flag/Abort/Idle Controlller Zero Encoder Generateor and Insertion...
HDLC CONTROLLER S3C2500B 8.3.1 HDLC FRAME FORMAT The HDLC transmits and receives data (address, control, information and CRC field) in a standard format called a frame. All frames start with an opening flag (beginning of flag, BOF, 7EH) and end with a closing flag (end of flag, EOF, 7EH).
Page 365
Not every frame, however, must actually contain information data. The word length of the I-field is eight bits in the S3C2500B HDLC module. And Its total length can be extended by 8 bits until terminated by the FCS field and the closing flag.
HDLC CONTROLLER S3C2500B 8.4 PROTOCOL FEATURES 8.4.1 INVALID FRAME A valid frame must have at least the A, C, and FCS fields between its opening and closing flags. Even if no-CRC mode is set, the frame size should not be less than 32 bits. There are three invalid frame conditions: —...
S3C2500B HDLC CONTROLLER 8.4.5 FIFO STRUCTURE In both transmit and receive directions, 32-byte (8 word) deep FIFOs are provided for the intermediate storage of data between the serial interface and the CPU Interface. 8.4.6 TWO-CHANNEL DMA ENGINE The HDLC module has a two-channel DMA engine for Tx/Rx FIFOs. The DMA TX channel programming and the RX channel programming are described in the transmitter and receiver operation sections, respectively.
Page 368
HDLC CONTROLLER S3C2500B The example in the following Table assumes a 66MHz clock from MCLK2, a 24.576MHz clock from RxC, showing a time constant for a number of commonly used baud rates. Table 8-2. Baud Rate Example of HDLC R× × C = 24.576 MHz...
S3C2500B HDLC CONTROLLER 8.4.8 DIGITAL PHASE-LOCKED LOOP (DPLL) The HDLC module contains a digital phase-locked loop (DPLL) function to recover clock information from a data stream with NRZI or FM encoding. The DPLL is driven by a clock that is normally 32 (NRZI) or 16 (FM) times the data rate.
Page 370
HDLC CONTROLLER S3C2500B In the NRZ/NRZI mode, the DPLL source clock must be 32 times the data rates. In this mode, the transmit and receive clock outputs of the DPLL are identical, and the clocks are phased so that the receiver samples the data in the middle of the bit cell.
S3C2500B HDLC CONTROLLER 8.5 HDLC OPERATIONAL DESCRIPTION The following sections describe the operation of the HDLC module. 8.5.1 HDLC INITIALIZATION A power-on or reset operation initializes the HDLC module and forces it into the reset state. After a reset, the CPU must write a minimum set of registers, as well as any options set, based on the features and operating modes required.
HDLC CONTROLLER S3C2500B 8.5.2 HDLC DATA ENCODING/DECODING Data encoding is utilized to allow the transmission of clock and data information over the same medium. This saves the need to transmit clocks and data over a separate medium as would normally be required for synchronous data.
S3C2500B HDLC CONTROLLER 8.5.3 HDLC DATA SETUP AND HOLD TIMING WITH CLOCK You can see the timing of TxD and RxD in terms of TxC and RxC HDLC clock in Figure 8-6. Table 8-3. HDLC Data Setup and Hold Timing...
HDLC CONTROLLER S3C2500B 8.5.4 HDLC TRANSMITTER OPERATION The HTxFIFO register cannot be pre-loaded when the transmitter is disabled. After the HDLC Tx is enabled, the flag or mark idle control bit (TxFLAG in HCON) is used to select either the mark idle state (inactive idle) or the flag 'time fill' (active idle) state.
Page 375
S3C2500B HDLC CONTROLLER 8.5.4.1 Transmitter Interrupt Mode The first byte of a frame (the address field) should be written into the Tx FIFO at the 'frame continue' address. Then, the transmission of the frame data starts automatically. The bytes of the frame continue to be written into the Tx FIFO as long as data is written to the 'frame continue' address.
HDLC CONTROLLER S3C2500B 8.5.5 HDLC RECEIVER OPERATION The HDLC receiver is provided with data and a pre-synchronized clock by means of the RXD and the internal DPLL clock, the TXC pin, or the RXC pin. The data is a continuous stream of binary bits. One of the characteristics of this bit stream is that a maximum of five consecutive 1s can occur unless an abort, flag, or idle condition occurs.
S3C2500B HDLC CONTROLLER 8.5.5.2 Receiver DMA Mode To use DMA operation without CPU intervention, you have to make Rx buffer descriptor in advance. And set the DMA Rx buffer descriptor pointer(DMARxPTR) register to the address of the first buffer descriptor, set the Rx Buffer Descriptor Maximum Count (RxBDMAXCNT) register which shows the maximum buffer descriptor counts, and then DMA Rx channel should be enabled.
Page 378
HDLC CONTROLLER S3C2500B TxClock Data 5 - 12 cycles Figure 8-9. CTS Delayed on If nCTS remains still High for a while after nRTS enters Low to allow data transmission from HTxFIFO, the data transmission starts 5-12 cycles after nCTS is shifted to Low...
S3C2500B HDLC CONTROLLER 8.5.7 MEMORY DATA STRUCTURE The flow control to the HDLC controller uses two data structures to exchange control information and data. — Transmit buffer descriptor — Receive buffer descriptor Each Tx DMA buffer descriptor has the following elements.
HDLC CONTROLLER S3C2500B 8.5.8 DATA BUFFER DESCRIPTOR Rx BDMA function is enabled by DRxEN bit(HCON[7]). When Rx BDMA is enabled, the BDMA fetches the Rx Buffer Data pointer and Owner bit of the next word. Then it checks the Ownership of the Buffer Descriptor. If the Owner bit is ‘1’, then BDMA owns the Buffer Descriptor, and BDMA waits until Rx.
HDLC CONTROLLER S3C2500B 8.6.2 RECEIVE BUFFER DESCRIPTOR Buffer Pointer Rx Control Bits Buffer Length [31:0] Buffer Data Pointer [15:0] Buffer Length Rx Status Bits These bits may be regarded as valid when L bit(in Rx status bit) is set [16] CD Lost (CD)
Page 383
S3C2500B HDLC CONTROLLER Rx Buffer Descriptor Start Address Buffer Data Pointer #1 Rx Bufsize Pointer Buffer Data #1 Register Status Buffer Length Value Unused Buffer Data Pointer #2 Rx Bufsize Status Buffer Length HRXBDMAXCNT = #N Buffer Data #2 Register...
HDLC CONTROLLER S3C2500B 8.7 HDLC SPECIAL REGISTERS The HDLC special registers are defined as read-only or write-only registers according to the direction of information flow. The addresses of these registers are shown in Table 8-4 and 8-5. The transmitter FIFO register can be accessed using two different addresses, the frame terminate address and the frame continue address.
Page 385
S3C2500B HDLC CONTROLLER Table 8-5. HDLC Channel B Special Registers Registers Address Description Reset Value HMODEB HDLC mode register 0×F0110000 0×00000000 HCONB 0×F0110004 HDLC control register 0×00000000 HSTATB 0×F0110008 HDLC status register 0×00000000 HINTENB 0×F011000C HDLC interrupt enable register 0×00000000...
Page 386
HDLC CONTROLLER S3C2500B Table 8-6. HDLC Channel C Special Registers Registers Address Description Reset Value HMODEC HDLC mode register 0×F0120000 0×00000000 HCONC 0×F0120004 HDLC control register 0×00000000 HSTATC 0×F0120008 HDLC status register 0×00000000 HINTENC 0×F012000C HDLC interrupt enable register 0×00000000...
Page 388
HDLC CONTROLLER S3C2500B Table 8-8. HMODE Register Description (Continued) Bit Name Description Number [14:12] Data formats (DF) When the DF bits are '000', data is transmitted and received in the NRZ data format. When DF is '001', the NRZI (zero complement) data format is selected.
Page 389
S3C2500B HDLC CONTROLLER 28 27 26 23 22 20 19 15 14 12 11 8 7 6 DPLL RxCLK TxCLK TxPL [0] Muilt-Frame in TxFIFO in DMA Operation (MFF) [15] RTRnRTS 0 = Single frame in TxFIFO 0 = Request to send...
HDLC CONTROLLER S3C2500B 8.7.2 HDLC CONTROL REGISTER Table 8-9. HCONA , HCONB, and HCONC Register Registers Address Description Reset Value HCONA HDLC channel A control register 0x00000000 0×F0100004 HCONB HDLC channel B control register 0x00000000 0×F0110004 HCONC 0×F0120004 HDLC channel C control register 0x00000000 Table 8-10.
Page 391
S3C2500B HDLC CONTROLLER Table 8-10. HCON Register Description (Continued) Bit Name Description Number DMA Rx enable The DRxEN bit lets the HDLC Rx operate on a bus system in DMA mode. (DRxEN) When DMA Rx is enabled, an interrupt request caused by the RxFA status is inhibited, and the HDLC does not use the interrupt request to request a data transfer.
Page 392
HDLC CONTROLLER S3C2500B Table 8-10. HCON Register Description (Continued) Bit Name Description Number [13:12] Rx widget alignment These bits determine how many bytes are invalid in the first memory (RxWA) word of the frame to be received. The invalid bytes are inserted when the word is assembled in the HRXFIFO.
Page 393
S3C2500B HDLC CONTROLLER Table 8-10. HCON Register Description (Continued) Bit Name Description Number [23] Tx preamble (TxPRMB) When this bit is set to '1', the content of the HPRMB register is transmitted as many TxPL bit values in interrupt mode instead of mark idle or time fill mode.
HDLC CONTROLLER S3C2500B 8.7.3 HDLC STATUS REGISTER (HSTAT) NOTE Reading the HDLC status register is a non-destructive process. The method used to clear a High-level status condition depends on the bit's function and operation mode(DMA or interrupt). For details, please see the description of each status register.
Page 397
S3C2500B HDLC CONTROLLER Table 8-12. HSTAT Register Description Bit Name Description Number [3:0] Rx remaining bytes (RxRB + 1) indicates how many data bytes are valid in a 1-word or 4- (RxRB) word boundary when the receiver has received a complete frame. In 1- word transfer mode, the RxRB value is either 0, 1, 2, or 3.
Page 398
HDLC CONTROLLER S3C2500B Table 8-12. HSTAT Register Description (Continued) Bit Name Description Number [11] Rx flag detected (RxFD) This bit is set to '1' when the last bit of the flag sequence is received. This bit generates an interrupt if enabled. You can clear this bit by writing a '1' to this bit.
Page 399
S3C2500B HDLC CONTROLLER Table 8-12. HSTAT Register Description (Continued) Bit Name Description Number [23] Rx internal error This bit is set to '1' when received frame will be detected error possibility (RxIERR) due to the receive clock is unstable. [24]...
HDLC CONTROLLER S3C2500B 8.7.6 HDLC TX FIFO (HTXFIFO) The Tx FIFO consists of eight 32-bit registers that are used for buffer storage of data to be transmitted. Data is always transferred from a full register to an empty adjacent register. The Tx FIFO can be addressed at two different register addresses: the 'frame continue' address and the 'frame terminate' address.
S3C2500B HDLC CONTROLLER 8.7.7 HDLC RX FIFO (HRXFIFO) The Rx FIFO consists of eight 32-bit registers that are used for the buffer storage of the data received. Data bytes are always transferred from a full register to an adjacent empty register. Each register has pointer bits that indicate the frame status.
S3C2500B HDLC CONTROLLER 8.7.9 HDLC PREAMBLE CONSTANT REGISTER (HPRMB) The HPRMB register is used to meet the DPLL requirements for phase-locking. The preamble pattern is transmitted as many Tx preamble length bit values in HMODE[10:8] when the Tx preamble bit (TxPRMB) is '1', and then the Tx preamble bit is cleared automatically.
Page 408
HDLC CONTROLLER S3C2500B 8.7.10 HDLC STATION ADDRESS REGISTERS (HSADR0-3) AND HMASK REGISTER Each HDLC controller has five 32-bit registers for address recognition: four station address registers and one mask register. Generally, the HDLC controller reads the address of the frame from the receiver, to check it against the four station address values, and then masks the result with the user-defined HMASK register.
S3C2500B HDLC CONTROLLER First byte Second byte Third byte Fourth byte Station address byte register and MASK register [31:24] First address byte [23:16] Second address byte [15:8] Third address byte [7:0] Fourth address byte Figure 8-22. HDLC Station Address and HMASK Register 8.7.11 DMA TX BUFFER DESCRIPTOR POINTER REGISTER...
HDLC CONTROLLER S3C2500B 8.7.12 DMA RX BUFFER DESCRIPTOR POINTER REGISTER The DMA receive buffer descriptor pointer register contains the address of the Rx buffer data pointer on the data to be received. During a DMA operation, the buffer descriptor pointer is updated by the next buffer data pointer.
S3C2500B HDLC CONTROLLER 8.7.14 RECEIVE BUFFER SIZE REGISTER The Rx buffer size register contains the 16-bit user-defined value. This user-defined count value determines the buffer size for one Buffer Descriptor. If incoming HDLC frame is longer than the Rx buffer size register value, the next buffer descriptor having the Rx buffer size value will be used.
HDLC CONTROLLER S3C2500B 8.7.16 TRANSPARENT CONTROL REGISTER The HDLC transparent register controls the transparent data flow. This is composed with Data sampling field and RTS control field. Table 8-24. Transparent Control Register Registers Address Description Reset Value TCONA 0xF010004C Transparent Control Register...
HDLC CONTROLLER S3C2500B 8.7.19 TX BUFFER DESCRIPTOR MAXIMUM COUNT REGISTER Tx Buffer Descriptor maximum count register sets tx buffer descriptor maximum counts. For example, if you set the HTXBDMAXCNT register to "0xFFF", then you can use 1(2 ) buffer descriptor. If you set the HTXBDMAXCNT register to "0xFFE", "0xFFC", "0xFF8", "0xFF0", "0xFE0", then you can use 2(2...
IOM2 & TSA CONTROLLER 9.1 OVERVIEW The IOM2-bus is an industry standard serial bus for interconnecting telecommunication ICs. The S3C2500B includes the IOM2 controller to enable a modular interface to the terminal network such as an ISDN interface. 9.2 FEATURES •...
These are a 1x-Bit rate Clock (BCL), and two Serial Data Strobes that identify the location of the B channels (SDS1 and SDS2). The S3C2500B includes two optional signals, BCL and SDS1. SDS1 is called STRB in S3C2500B. In S3C2500B, the terminal mode operation is supported but line-card mode is not supported.
S3C2500B IOM2 CONTROLLER 9.3.1 B CHANNELS The B1 and B2 provide two clear 64 Kbit/s user data channels to/from the network. 9.3.2 D CHANNEL The 16 Kbit/s D channel provides a connection between the layer-2 and layer-1 components 9.3.3 MONITOR CHANNELS There are two programming channels, monitors 0 and 1, Each channel has an associated pair of MX and MR handshake bits that control data flow.
9.3.7 CHANNEL OPERATION 9.3.7.1 Monitor channel operation The monitor channel is a handshake protocol for high speed information exchange between S3C2500B and other devices. The monitor channel operates on an asynchronous basis. While data transfers on the bus take place synchronized to frame sync, the flow of data is controlled by a handshake procedure using MX (monitor transmit) and MR (monitor receive).
Page 419
S3C2500B IOM2 CONTROLLER The monitor protocol is illustrated in figure9-2. Before the data in IOM2MTD register is transmitted, The IOM2 controller should verify that the transmission is idle, that is, MX/MR is inactive ("1") for two or more than 2 frames.
Page 420
S3C2500B 9.3.7.3 Monitor channel collision detection When more than two devices is attached to IOM2-bus, the S3C2500B resolves the collision by waiting inactive in the MX/MR bits before sending and a per bit check on the transmitted data. Monitor channel access priority is determined by the address of the monitor message contained in the first monitor byte transmitted.
Page 421
S3C2500B IOM2 CONTROLLER 9.3.7.5 TIC Bus Access The TIC bus capability enables more than one device to access IOM2 bus. The arbitration mechanism is implemented in the last byte of channel2 of IOM2 interface. This allows external communication controllers (up to 7) to access the C/I0 and D Channel in the channel0 of IOM2 interface.
Page 422
As a result, the actual data pins of the S3C2500B IOM2 interface need to be both inputs and outputs. When the DBREV bit in IOM2CON is set, the DU pin is used to receive downstream data and the DD pin is used to send upstream data.
The S3C2500B includes three time-slot-assigners (TSA), which provide flexible data path control between the three HDLCs and external interfaces. A variety of data interface can be supported by the S3C2500B with the TSA : raw Data Communication Equipment (DCE), Pulse Code Modulation (PCM) highway (non-multiplexed mode and multiplexed mode) and ISDN Oriented Modular Interface (IOM2).
IOM2 CONTROLLER S3C2500B 9.4.3 HDLC EXTERNAL PIN MULTIPLEXED SIGNALS HDLC external pins are multiplexed among the various operating modes. The Mode bits in TSAxCON determines operating mode of each TSA and HDLC external pins are automatically configured according to Mode bits as follows.
IOM2 CONTROLLER S3C2500B 9.5.1 IOM2CON REGISTER Table 9-3. IOM2CON Register (Control Register) Register Address Description Reset Value IOM2CON 0xF0130000 Control Register 0x00000000 Bit Number Bit Name Description IOM2 Enable (IOM2EN) 0 = Disable, 1 = Enable Data Bus Reverse (DBREV)
IOM2 CONTROLLER S3C2500B 9.5.2 IOM2 STATUS REGISTER Table 9-4. IOM2STAT Register (Status Register) Register Address Description Reset Value IOM2STAT 0xF0130004 Status Register 0x00000080 Bit Number Bit Name Description C/I0 Channel Buffer Available (CI0BA) 0 = C/I0 receive data is not valid...
Page 429
S3C2500B IOM2 CONTROLLER 13 12 11 10 9 8 7 6 [0] CI 0 Buffer Available (CI0BA) 0 = normal 1 = CI0 buffer available [1] Reserved [2] CI 1 Buffer Available (CI1BA) 0 = Normal 1 = CI1 buffer available...
IOM2 CONTROLLER S3C2500B 9.5.4 IOM2 TIC BUS ADDRESS REGISTER Table 9-6. IOM2TBA Register (TIC Bus Address Register) Register Address Description Reset Value IOM2TBA 0xF013000C TIC Bus Address 0x00000007 Bit Number Bit Name Description [2:0] TIC Bus Address (TBA) This field defines device-specific address used to gain access to TIC bus for D and C/I0 channel.
S3C2500B IOM2 CONTROLLER 9.5.5 IOM2 IC CHANNEL TRANSMIT DATA REGISTER Table 9-7. IOM2ICTD (IOM2 IC Channel Transmit Data Register) Register Address Description Reset Value IOM2ICTD 0xF0130010 IC Channel Transmit Data 0x000000FF Bit Number Bit Name Description [7:0] ICTD Transmit Data [31:8] Reserved.
IOM2 CONTROLLER S3C2500B 9.5.6 IOM2 C/I0 CHANNEL TRANSMIT DATA REGISTER Table 9-9. IOM2CITD0 (IOM2 C/I0 Channel Transmit Data Register) Register Address Description Reset Value IOM2CITD0 0xF0130018 C/I0 Channel Transmit Data 0x0000000F Bit Number Bit Name Description [3:0] CITD0 This field includes the data to be transmitted on the C/I0 channel.
S3C2500B IOM2 CONTROLLER 9.5.7 IOM2 C/I1 CHANNEL TRANSMIT DATA REGISTER Table 9-11. IOM2CITD1 (IOM2 C/I1 Channel Transmit Data Register) Register Address Description Reset Value IOM2CITD1 0xF0130020 C/I1 Channel Transmit Data 0x0000003F Bit Number Bit Name Description [5:0] CITD1 This field includes the data to be transmitted on the C/I1 channel.
IOM2 CONTROLLER S3C2500B 9.5.9 IOM2 MONITOR CHANNEL TRANSMIT DATA REGISTER Table 9-13. IOM2MTD (IOM2 Monitor Channel Transmit Data Register) Register Address Description Reset Value IOM2MTD 0xF0130028 Monitor Channel Transmit Data 0x000000FF Bit Number Bit Name Description [7:0] MTxD This field includes the data to be transmitted on the monitor channel selected by MSEL if MEN = 1.
S3C2500B IOM2 CONTROLLER 9.5.11 TSA A CONTROL REGISTER Table 9-15. TSAACON (TSA A Control Register) Register Address Description Reset Value TSAACON 0xF0130030 TSA A Control Register 0x00000000 Bit Number Bit Name Description [11:0] START The location of start bit of time slot assigned to HDLCA...
IOM2 CONTROLLER S3C2500B 9.5.12 TSA B CONTROL REGISTER Table 9-16. TSABCON (TSA B Control Register) Register Address Description Reset Value TSABCON 0xF0130034 TSA B Control Register 0x00000000 Bit Number Bit Name Description [11-0] START The location of start bit of time slot assigned to HDLCB...
S3C2500B IOM2 CONTROLLER 9.5.13 TSA C CONTROL REGISTER Table 9-17. TSACCON (TSA C Control Register) Register Address Description Reset Value TSACCON 0xF0130038 TSA C Control Register 0x00000000 Bit Number Bit Name Description [11:0] START The location of start bit of time slot assigned to HDLCC...
IOM2 CONTROLLER S3C2500B 9.5.14 IOM2STRB (STROBE REGISTER) Table 9-18. IOM2STRB (Strobe Register) Register Address Description Reset Value IOM2STRB 0xF013003C Strobe Register 0x00000000 Bit Number Bit Name Description [7:0] START The location of start bit of time slot assigned to STRB...
S3C2500B USB CONTROLLER USB FUNCTION CONTROLLER 10.1 OVERVIEW USB products are easy to use for end users. Electrical details, such as bus termination, are isolated from end users and plug and play is supported. There’re other merits for users; Self identifying peripherals, automatic mapping function to driver, auto configuration, dynamically attach and detach and reconfiguration, and so on.
USB CONTROLLER S3C2500B 10.2 FEATURES Important features of the S3C2510 USB block are as follows: • Fully Compliant to USB 1.1 Specification • Supports Only Full Speed Function (12Mbps) • Complete Device Configuration • Compatible with both OpenHCI and Intel UHCI Standards •...
S3C2500B USB CONTROLLER 10.3 FUNCTION DESCRIPTIONS 10.3.1 USB BUS TOPOLOGY AND PHYSICAL CONNECTION There are two kinds of cable connectors, A type for hub downstream port, and B type for device(or called as function, Node). So end users easily connect cable.
USB CONTROLLER S3C2500B 10.3.6 CONTROL TRANSACTIONS Control transfers are bursty, non-periodic, host software-initiated request/response communication, typically used for command/status operations. Control transfers allow access to different parts of a device. Control transfers are intended to support configuration/command/status type communication flows between client software and its function. A control...
S3C2500B USB CONTROLLER 10.4 USB BLOCK DESCRIPTIONS 10.4.1 USB BLOCK OVERVIEW USB block is compatible with USB spec 1.1. There're 5 EPs (Endpoint) with EP0 for control transfer. This block uses two input clocks, 133MHz and 48MHz. 133MHz clock is used to special registers access and USB-to-system bus interfacing.
S3C2500B USB CONTROLLER 10.5 USB SPECIAL REGISTERS The USB special registers are defined as read-write or read-only or write-only registers according to the direction of information flow. The addresses of these registers are shown in Table 10-1. Table 10-1. USB Registers...
USB CONTROLLER S3C2500B 10.5.1 USB FUNCTION ADDRESS REGISTER This register maintains the USB device address assigned by the host. The MCU writes the value received through a SET_ADDRESS descriptor to this register. This address is used for the next token.
Page 451
S3C2500B USB CONTROLLER [6:0] Function Address Field (FAF) [7] Address UPdate (AUP) [31:8] Reserved Figure 10-6. USBFA Register 10-11...
USB CONTROLLER S3C2500B 10.5.2 USB POWER MANAGEMENT REGISTER This register is used for suspend, resume, reset and data-swapping signaling. The different bits in this register are explained below: Table 10-4. USBPM Register Register Address Description Reset Value USBPM 0xF00E0004 USB power management register 0x00000000 Table 10-5.
Page 453
S3C2500B USB CONTROLLER [0] SUSpend Enable (SUSE) 0 = Suspend mode disable 1 = Suspend mode enable [1] SUSpend Mode (SUSM) 0 = Normal operation 1 = Suspend state [2] ResUme (RU) 0 = Normal or suspend state 1 = Resume signal generation in suspend state...
USB CONTROLLER S3C2500B 10.5.3 USB INTERRUPT REGISTER There’re five endpoints (EP0 - EP4) Each bit in this register corresponds to the respective endpoint number. All interrupts corresponding to endpoints whose direction is programmable (Mode = IN/OUT), are mapped to this register.
Page 455
S3C2500B USB CONTROLLER Table 10-7. USBINTR Register Description Bit Number Bit Name Description EP0Interrupt This bit corresponds to endpoint 0 interrupt. (EP0I) The USB sets this bit under the following conditions: 1. ORDY bit is set. 2. INRDY bit is cleared.
S3C2500B USB CONTROLLER 10.5.4 USB INTERRUPT ENABLE REGISTER Corresponding to each USB Interrupt Register (USBINTR), there is an interrupt enable bit at USB Interrupt Enable Register (USBINTRE). By default all interrupts are disbled. Table 10-8. USBINTRE Register Register Address Description...
S3C2500B USB CONTROLLER 10.5.5 USB FRAME NUMBER REGISTER These registers maintain the Frame Number within SOF Packet. Frame Number within SOF Packet are 11bits. Table 10-10. USBFN Register Register Address Description Reset Value USBFN 0xF00E0010 USB Frame Number register 0x00000000 Table 10-11.
USB CONTROLLER S3C2500B 10.5.6 USB DISCONNECT TIMER REGISTER This register turns USB bus into disconnected state. First, You set the disconnect interval time in the connect register. Next, set the enable bit USBDISCONN[31]. Then, the disconnect logic keeps the line state in SE0(Single Ended Zero).
Page 461
S3C2500B USB CONTROLLER CNTVLE [22:0] CouNT VaLuE (CNTVLE) [23:30] Reserved [31] DISconnet operation STaRT (DISSTRT) 0 = No operation 1 = Both D+/D- go to 0 and all USB registers R/W blocked. Figure 10-11. USBDISCONN Register 10-21...
USB CONTROLLER S3C2500B 10.5.7 USB ENDPOINT 0 COMMON STATUS REGISTER This register includes the control bits, status bits, and max packet size value for endpoint 0. Table 10-15. USBEP0CSR Register Register Address Description Reset Value USBEP0CSR 0xF00E0018 USB Endpoint 0 Common Status Register 0x00000001 Table 10-16.
Page 463
S3C2500B USB CONTROLLER Table 10-16. USBEP0CSR Register Description (Continued) Bit Number Bit Name Description [27] Data END The MCU sets this bit: (DEND) 1. After loading the last packet of data into the FIFO, at the same time INRDY is set.
Page 464
USB CONTROLLER S3C2500B 31 30 29 28 27 26 25 24 [3:0] MAXP value (MAXP) [3:0]value x 8 = max packet size [6:4] Reserved [7] MAXP value SETting enable (MAXPSET) 0 = MAXP value isn't changed 1 = MAXP value is changed...
S3C2500B USB CONTROLLER 10.5.8 USB ENDPOINT 1 COMMON STATUS REGISTER This register includes the control bits, status bits, IN/OUT status information, and max packet size value for endpoint 1. Table 10-17. USBEP1CSR Register Register Address Description Reset Value USBEP1CSR 0xF00E001C...
Page 466
USB CONTROLLER S3C2500B Table 10-18. USBEP1CSR Register Description (Continued) Bit Number Bit Name Description [12] In mode, AuTo This bit is valid only when endpoint 1 is set to IN. SET (IATSET) If set, whenever the MCU writes MAXP data, IINRDY will be automatically be set without any intervention from MCU.
Page 467
S3C2500B USB CONTROLLER Table 10-18. USBEP1CSR Register Description (Continued) Bit Number Bit Name Description [20] Out mode, This bit is valid only when endpoint 1 is set to OUT. Fifo FLUSH The MCU writes a “1” to flush the FIFO.
Page 468
USB CONTROLLER S3C2500B Table 10-18. USBEP1CSR Register Description (Continued) Bit Number Bit Name Description [26] In mode, UNDER This bit is valid only when endpoint 1 is set to IN run (IUNDER) ISO. The USB sets this bit when in ISO mode, an IN token is received and the IINRDY bit is not set.
Page 469
S3C2500B USB CONTROLLER 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 14 13 12 11 10 9 [2:0] MAXP value (MAXP) [19] (OUT) Data ERRor (ODERR) [2:0] value x 8 = max packet size...
USB CONTROLLER S3C2500B 10.5.9 USB ENDPOINT 2 COMMON STATUS REGISTER This register includes the control bits, status bits, IN/OUT status information, and max packet size value for endpoint 2. Table 10-19. USBEP2CSR Register Register Address Description Reset Value USBEP2CSR 0xF00E0020...
Page 471
S3C2500B USB CONTROLLER Table 10-20. USBEP2CSR Register Description (Continued) Bit Number Bit Name Description [12] In mode, AuTo This bit is only valid only when endpoint 2 is set to SET (IATSET) If set, whenever the MCU writes MAXP data, IINRDY will be automatically be set without any intervention from MCU.
Page 472
USB CONTROLLER S3C2500B Table 10-20. USBEP2CSR Register Description (Continued) Bit Number Bit Name Description [20] Out mode, This bit is valid only when endpoint 2 is set to OUT. Fifo FLUSH The MCU writes a “1” to flush the FIFO.
Page 473
S3C2500B USB CONTROLLER Table 10-20. USBEP2CSR Register Description (Continued) Bit Number Bit Name Description [27] In mode, Fifo This bit is valid only when endpoint 2 is set to IN. FLUSH (IFFLUSH) The MCU sets this bit if it intends to flush the IN FIFO.
Page 474
USB CONTROLLER S3C2500B 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 14 13 12 11 10 9 [2:0] MAXP value (MAXP) [19] (OUT) Data ERRor (ODERR) [2:0]value x 8 = max packet size...
S3C2500B USB CONTROLLER 10.5.10 USB ENDPOINT 3 COMMON STATUS REGISTER This register includes the control bits, status bits, IN/OUT status information, and max packet size value for endpoint 3. Table 10-21. USBEP3CSR Register Register Address Description Reset Value USBEP3CSR 0xF00E0024...
Page 476
USB CONTROLLER S3C2500B Table 10-22. USBEP3CSR Register Description (Continued) Bit Number Bit Name Description [12] In mode, AuTo This bit is only valid only when endpoint 3 is set to SET (IATSET) If set, whenever the MCU writes MAXP data, IINRDY will be automatically be set without any intervention from MCU.
Page 477
S3C2500B USB CONTROLLER Table 10-22. USBEP3CSR Register Description (Continued) Bit Number Bit Name Description [20] Out mode, Fifo This bit is valid only when endpoint 3 is set to OUT. FLUSH The MCU writes a “1” to flush the FIFO.
Page 478
USB CONTROLLER S3C2500B Table 10-22. USBEP3CSR Register Description (Continued) Bit Number Bit Name Description [27] In mode, Fifo This bit is valid only when endpoint 3 is set to IN. FLUSH (IFFLUSH) The MCU sets this bit if it intends to flush the IN FIFO.
Page 479
S3C2500B USB CONTROLLER 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 14 13 12 11 10 9 [3:0] MAXP value (MAXP) [19] (OUT) Data ERRor (ODERR) [3:0]value x 8 = max packet size...
USB CONTROLLER S3C2500B 10.5.11 USB ENDPOINT 4 COMMON STATUS REGISTER This register includes the control bits, status bits, IN/OUT status information, and max packet size value for endpoint 4. Table 10-23. USBEP4CSR Register Register Address Description Reset Value USBEP4CSR 0xF00E0028...
Page 481
S3C2500B USB CONTROLLER Table 10-24. USBEP4CSR Register Description (Continued) Bit Number Bit Name Description [12] In mode, AuTo This bit is only valid only when endpoint 4 is set to SET (IATSET) If set, whenever the MCU writes MAXP data, IINRDY will be automatically be set without any intervention from MCU.
Page 482
USB CONTROLLER S3C2500B Table 10-24. USBEP4CSR Register Description (Continued) Bit Number Bit Name Description [21] Out mode, This bit is valid only when endpoint 4 is set to OUT. SenD STALL The MCU writes a “1” to this bit to issue a STALL (OSDSTALL) handshake to the USB.
Page 483
S3C2500B USB CONTROLLER Table 10-24. USBEP4CSR Register Description (Continued) Bit Number Bit Name Description [27] In mode, Fifo This bit is valid only when endpoint 4 is set to IN. FLUSH (IFFLUSH) The MCU sets this bit if it intends to flush the IN FIFO.
Page 484
USB CONTROLLER S3C2500B 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 14 13 12 11 10 9 [3:0] MAXP value (MAXP) [19] (OUT) Data ERRor (ODERR) [3:0]value x 8 = max packet size...
S3C2500B USB CONTROLLER 10.5.12 USB WRITE COUNT FOR ENDPOINT 0 REGISTER When OORDY is set for OUT endpoints, USBWCEP0[22:16] maintains the byte-count number of data in FIFO due to be unloaded by the MCU. In case of IN mode, MCU first writes the byte-count number of data to be loaded into FIFO, then write data into FIFO.
S3C2500B USB CONTROLLER 10.5.13 USB WRITE COUNT FOR ENDPOINT 1 REGISTER When OORDY is set for OUT endpoints, USBWCEP1[21:16] maintains the byte-count number of data in FIFO due to be unloaded by the MCU. In case of IN mode, MCU first writes the byte-count number of data to be loaded into FIFO, then write data into FIFO.
S3C2500B USB CONTROLLER 10.5.14 USB WRITE COUNT FOR ENDPOINT 2 REGISTER When OORDY is set for OUT endpoints, USBWCEP2[21:16] maintains the byte-count number of data in FIFO due to be unloaded by the MCU. In case of IN mode, MCU first writes the byte-count number of data to be loaded into FIFO, then write data into FIFO.
S3C2500B USB CONTROLLER 10.5.15 USB WRITE COUNT FOR ENDPOINT 3 REGISTER When OORDY is set for OUT endpoints, USBWCEP3[22:16] maintains the byte-count number of data in FIFO due to be unloaded by the MCU. In case of IN mode, MCU first writes the byte-count number of data to be loaded into FIFO, then write data into FIFO.
S3C2500B USB CONTROLLER 10.5.16 USB WRITE COUNT FOR ENDPOINT 4 REGISTER When OORDY is set for OUT endpoints, USBWCEP4[22:16] maintains the byte-count number of data in FIFO due to be unloaded by the MCU. In case of IN mode, MCU first writes the byte-count number of data to be loaded into FIFO, then write data into FIFO.
S3C2500B USB CONTROLLER 10.5.17 USB ENDPOINT 0/1/2/3/4 FIFO REGISTER Each endpoint has his own FIFO. To access to each FIFO data, User must use these registers. Table 10-35. USBEP0/ 1/ 2/ 3/ 4 Descriptions Register Address Description Reset Value USBEP0...
Page 496
USB CONTROLLER S3C2500B EP0 FIFO [31:0] EndPoint 0 data FIFO EP1 FIFO [31:0] EndPoint 1 data FIFO EP2 FIFO [31:0] EndPoint 2 data FIFO EP3 FIFO [31:0] EndPoint 3 data FIFO EP4 FIFO [31:0] EndPoint 4 data FIFO Figure 10-22. USBEP0/1/2/3/4 FIFO Registers...
The Data Encryption Standard (DES) consists of the Data Encryption Algorithm (DES) and Triple Data Encryption Algorithm (TDEA, as described in ANSI X9.52). The DES/3DES accelerator of the S3C2500B is designed in such a way that they may be used in a computer system or network to provide cryptographic protection to binary coded data.
Page 498
DES/3DES S3C2500B DES/3DES PWDATA keygen key48 key1 PADDR Register write sig. key2 PENABLE key3 decode PSELx Control in_mode (state left side data sig. machine) PWRITE Status Status PWDATA des_mode left side data desctrl sbox Interrupt wr_indata PRDATA enable in_mode (state left side data sig.
DES/3DES S3C2500B 11.3.1 DES/3DES CONTROL REGISTER Table 11-2. DES/3DES Control Register Description Bit Number Bit Name Description Run Enable 0 = DES/3DES disable 1 = DES/3DES enable This bit is the same register as the Run Enable bit of the Run Enable Register.
S3C2500B DES/3DES 11.3.2 DES/3DES STATUS REGISTER Table 11-3. DES/3DES Status Register Description Bit Number Bit Name Description Idle This bit indicates whether DES/3DES is running or not [3:1] Reserved These bits have 0 value. Available DESINFIFO DESINFIFO is vacant 4(or 2, depends on DESCON[7]) words or more, this bit is set to 1.
DES/3DES S3C2500B 11.3.4 DES/3DES RUN ENABLE REGISTER Table 11-5. DES/3DES Run Enable Register Description Bit Number Bit Name Description Run Enable If you set this bit to 1, DES/3DES engine begin to run. This bit is the same register as the Run Enable bit of the DES/3DES Control Register.
Page 503
S3C2500B DES/3DES If users need to byte-swapped key value, they can control it by using DESCON[12]. If DESCON[12] is set, byte-swapped key is written to DESKEY2R. Otherwise, original key is written to DESKEY2R. 11-7...
DES/3DES S3C2500B 11.3.7 DES/3DES KEY 3 LEFT SIDE REGISTER Table 11-10. DES/3DES Key 3 Left Side Register Description Bit Number Bit Name Description [1:32] Key 3 Left Half The left half of the Key3 should be stored to this register. The 8 of each byte is parity bit, and it isn't used for encryption/decryption.
S3C2500B DES/3DES 11.3.9 DES/3DES INPUT/OUTPUT DATA FIFO REGISTER Table 11-14. DES/3DES Input Data FIFO Description Bit Number Bit Name Description [31:0] DESINFIFO This FIFO can be filled by CPU or DMA (depends on control register value). This FIFO consists of 8 words. If data are transferred by DMA the 4-word burst transaction (DESCON[7] is zero, and DCON#[5] is one) is recommended.
DES/3DES S3C2500B 11.4 DES/3DES OPERATION The 64-bit data to be encoded should be written to DESINFIFO of DES/3DES block by CPU or DMA. When the data conversion is completed, the Valid DESOUTFIFO bit in DESSTA is set to 1 and the CPU/DMA can read the encrypted data from the DESOUTFIFO.
S3C2500B DES/3DES 11.5 PERFORMANCE CALCULATION GUIDE Supposed condition: — DESINFIFO has already data to be encrypting. — DESOUTFIFO can be written data to be encrypted. Cycle Unit (Reference Figure 11-1 DES/3DES Block Diagram) Unit 1: from DESINFIFO to input buffer (1+1/2 cycle)
S3C2500B GDMA CONTROLLER GDMA CONTROLLER 12.1 OVERVIEW The S3C2500B has a six-channel General DMA controller, called the GDMA. The six-channel GDMA performs the following data transfers without CPU intervention: • Memory-to-Memory (Memory to/from Memory, Memory to/from USB) • External Device-to-Memory (External Device to/from Memory) •...
Page 509
GDMA CONTROLLER S3C2500B AHB BUS Mode Selection GDMA Channel 0 xGDMA_Req0 HUART0 GDMA_Req GDMA_Ack xGDMA_Ack0 Mode Selection Port 18 Data GDMA Channel 1 xGDMA_Req1 IOPCON1[18] HUART0 GDMA_Req GDMA_Ack xGDMA_Ack1 Mode Selection Port 19 Data GDMA Channel 2 xGDMA_Req2 IOPCON1[19] HUART0...
GDMA CONTROLLER S3C2500B 12.3.1 GDMA PROGRAMMABLE PRIORITY REGISTERS The GDMA can support the fixed priority and the round-robin priority for the local arbitration of six GDMA channels by register setting. Especially, the GDMA can program the priority order in the fixed priority mode as well as the ratio of the bus occupancy in the round-robin priority mode.
Page 513
When DPRIR is 0x0 and only GDMA channel 0, 1, and 2 are used, the expected bus occupancy for each channel is 1/3. However, S3C2500B does not work in that way, instead, GDMA channel 0 gets 4/6 of the bus occupancy, GDMA 1 1/6, and GDMA 2 1/6.
Page 514
S3C2500B GDMA CONTROLLER The following is the problem solving with software. 1. Method 1 DPRIR Channel Expected Real DPRIR Channel Occupancy System Bus Occupancy Occupancy GDMA 0 GDMA 0 GDMA 1 GDMA 1 ⇒ GDMA 2 GDMA 2 Problem Problem Solving by Method 1 Writing "0x000330", instead of "0x0"...
Page 515
GDMA CONTROLLER S3C2500B GDMA Channel Needed Recommended Problem Solving Recommended GDMA Channel Used when S/W 2 Method 2 0, 1, 2, 3, 4, or 5 Method 2 0/3 or 1/4 or 2/5 Method 2 0/2/4 or 1/3/5 Method 1 Method 1...
This bit determines the number of external GDMA requests (xGDMA_Req 0-3) that are required for a GDMA operation. In Single mode, when [4] = "0", the S3C2500B requires an external GDMA request for every GDMA operation. In Block mode, when [4] = "1", the S3C2500B requires only one external GDMA request...
Page 517
GDMA CONTROLLER S3C2500B Table 12-4. GDMA Control Register Description (Continued) Bit Number Bit Name Description Transfer size [7:6] These bits determine the transfer data width to be one byte, one half-word, or one word. If you select a byte transfer operation, the source/destination address will be increased or decreased by one with each transfer.
0, 1, 2, 3, 4, and 5. These address registers cover the whole external memory space, including the special purpose registers. You have to reference the memory map of the S3C2500B (Chapter 4) when you want to set these address registers. Depending on the settings you make to the GDMA control register (DCON), the source or destination addresses will either remain the same, or they will be increased or decreased.
S3C2500B GDMA CONTROLLER 12.3.4 GDMA TRANSFER COUNT REGISTERS The GDMA transfer count register indicates the byte transfer rate, which runs at 24-bit, on GDMA channels 0, 1, 2, 3, 4 and 5. Whenever GDMA transfer count register transmits the data of GDMA, it will be diminished by transfer width. In other words, when transfer size (TS) is byte, it will be diminished at 1, in the case of half-word at 2 and word at 4.
GDMA CONTROLLER S3C2500B 12.3.5 GDMA RUN ENABLE REGISTERS The GDMA run enable register (DRER) can enable or disable the RUN ENABLE bit, DCON[0] of the GDMA control register (DCON). The DRER register is write-only register. Table 12-7. DRER0/1/2/3/4/5 Registers Registers...
S3C2500B GDMA CONTROLLER 12.3.6 GDMA INTERRUPT PENDING REGISTER The GDMA interrupt pending register (DIPR) indicates the pending state of GDMA interrupt by the pending bit [0] of the DIPR register. The DIPR[0] is active high. The DIPR[0] can be asserted after the GDMA operation completes successfully when the Interrupt Enable field of DCON[12] is "1".
The block mode can be used only with the external GDMA request mode. 12.4.3 HUART MODE S3C2500B has two HUARTs. GDMA channel 0,1,2 can transmit the data of HUART0. GDMA channel 3,4,5 can transmit the data of HUART1. If GDMA mode selection bit [3:1] to “010” or “011”, GDMA gets ready to communicate with HUART.
12.4.4 DES MODE S3C2500B has only one DES. Any channel of GDMA can transmit the data of DES. If GDMA mode selection bit "100" or "101", GDMA gets ready to communicate with DES. If GDMA mode is "100" (DES IN mode) and GDMA receives the request signal transmitted from DES, GDMA transfers IN data of DES in memory into IN buffer/FIFO of DES.
GDMA CONTROLLER S3C2500B 12.5.3 DATA TRANSFER MODES 12.5.3.1 Single Mode A GDMA request (xGDMA_Req or an internal request) causes one byte, one half-word, or one word to be transmitted if four-data burst mode is disabled, or four times of transfer size if four-data burst mode is enabled.
Figure 12-10 provides the detailed timing data for GDMA data transfers that are triggered by external GDMA requests. Please note that read/write timing depends on which memory banks are selected. The S3C2500B has the internal clock, HCLK, as the operating clock. The clock frequency of HCLK is 133MHz,...
GDMA CONTROLLER S3C2500B 12.6.1 SINGLE AND ONE DATA BURST MODE (DCON[3:1] = 001, [4] = 0, [5] = 0) xGDMA_Req and xGDMA_Ack signals are active high. Recommand deasserted time HCLK xGDMA_Req xGDMA_Ack source dest. Address addr addr source dest. Data...
S3C2500B GDMA CONTROLLER 12.6.2 SINGLE AND FOUR DATA BURST MODE (DCON[3:1] = 001, [4] = 0, [5] = 1) xGDMA_Req & xGDMA_Ack signals are active high. In four data burst mode, GDMA transfers four data and GDMA Transfer Count Register (DTCR) value decreases by four.
GDMA CONTROLLER S3C2500B 12.6.3 BLOCK AND ONE DATA BURST MODE (DCON[3:1] = 001, [4] = 1, [5] = 0) xGDMA_Req and xGDMA_Ack signals are active high. GDMA transfers data from single xGDMA_Req signal till GDMA Transfer Count Register (DTCR) consumes to 0.
S3C2500B GDMA CONTROLLER 12.6.4 BLOCK AND FOUR DATA BURST (DCON[3:1] = 001, [4] = 1, [5] = 1) This timing diagram is the same with block and one data burst, except that it is four data burst. Recommand deasserted time...
SERIAL I/O (CONSOLE UART) 13.1 OVERVIEW The S3C2500B Console UART (Universal Asynchronous Receiver/Transmitter) unit provides one independent asynchronous serial I/O (SIO) port. The port can operate in interrupt-based mode. That is, the Console UART can generate internal interrupts to transfer data between the CPU and the serial I/O port.
Page 533
SERIAL I/O (CONSOLE UART) S3C2500B Transmit Data Register (CUTXBUF) Baud Rate Divisor Transmit Shift Register CUTXD IR TX Baud Rate Generator Encoder UART Control Register (CUCON) UART Interrupt Enable (CUINT) UART Status Register (CUSTAT) Control Character1,2 (CUCHAR1,2) Receive Data Register...
SERIAL I/O (CONSOLE UART) S3C2500B 13.3.1 CONSOLE UART CONTROL REGISTERS Table 13-2. CUCON Registers Register Address Description Size Reset Value CUCON 0xF0060000 Console UART control register 0x00000000 Table 13-3. Console UART Control Register Description Bit Number Bit Name Description [1:0]...
Page 536
11 = 8-bit [14] Infra-red mode (IR) The S3C2500B Console UART block supports infra-red (IR) transmit and receive operations. In IR mode, the transmit period is pulsed at a rate of 3/16 that of the normal serial transmit rate (when the transmit data value in the CUTXBUF register is zero).
SERIAL I/O (CONSOLE UART) S3C2500B 13.3.2 CONSOLE UART STATUS REGISTERS Table 13-4. CUSTAT Registers Register Address Description Size Reset Value CUSTAT 0xF0060004 Console UART status register 0x00060800 Table 13-5. Console UART Status Register Description Bit Number Bit Name Description Receive Data Valid...
Page 540
S3C2500B SERIAL I/O (CONSOLE UART) Table 13-5. Console UART Status Register Description (Continued) Bit Number Bit Name Description Overrun Error (OER) This bit is automatically set to '1' whenever an overrun error occurs during a serial data receiving operation. When CURXBUF has a previous valid data and a new received data is going to be written into CURXBUF, CUSTAT[4] is set to '1'.
Page 541
SERIAL I/O (CONSOLE UART) S3C2500B 18 17 16 12 11 [0] Receive Data Valid (RDV) 0 = No valid data (Receive FIFO top or CURXBUF) 1 = Valid data present (Receive FIFO top or CURXBUF) [1] Break Signal Deteced (BKD)
S3C2500B SERIAL I/O (CONSOLE UART) 13.3.4 UART TRANSMIT DATA REGISTER Table 13-8. CUTXBUF Registers Register Address Description Size Reset Value CUTXBUF 0xF006000C Console UART transmit data register – Table 13-9. Console UART Transmit Register Description Bit Number Bit Name Description...
SERIAL I/O (CONSOLE UART) S3C2500B 13.3.5 UART RECEIVE DATA REGISTER Table 13-10. CURXBUF Registers Register Address Description Size Reset Value CURXBUF 0xF0060010 Console UART receive data register – Table 13-11. Console UART Receive Register Description Bit Number Bit Name Description...
S3C2500B SERIAL I/O (CONSOLE UART) 13.3.6 UART BAUD RATE DIVISOR REGISTER The values stored in the baud rate divisor registers, CUBRD, let you determine the serial TX/RX clock rate (baud rate) as follows: PCLK2 or EXT_UCLK BRGOUT = (CNT0+1) × 16 ×...
SERIAL I/O (CONSOLE UART) S3C2500B 13.3.7 CONSOLE UART BAUD RATE EXAMPLES If the system clock frequency is 133 MHz and PCLK2 is selected, the maximum BRGOUT output clock rate is PCLK2/16 (= 4,156,250 Hz). EXT_UCLK is the external clock input pin for Console UART. PCLK2 and EXT_UCLK can be selected by CUCON[5] register.
S3C2500B SERIAL I/O (CONSOLE UART) 13.3.8 UART CONTROL CHARACTER REGISTER 1 AND 2 These Control Character registers can be used for Software Flow control. In Software Flow Control mode, you should write control characters into these registers. Any character in these registers can be used as a software control flow character and you can use maximum 8 characters for it.
Page 549
SERIAL I/O (CONSOLE UART) S3C2500B <TRANSMIT> Stop Start Data Bits (5-8) Parity Start CUTXD (1-2) INT_TXD <RECEIVE> Stop Start Data Bits (5-8) Parity Start Data Bits CURXD (1-2) INT_RXD Receive Data Receive Data CURXBUF Figure 13-12. Interrupt-Based Serial I/O Transmit and Receive Timing Diagram...
Page 550
S3C2500B SERIAL I/O (CONSOLE UART) SIO Frame Start Stop Data Bits Figure 13-13. Serial I/O Frame Timing Diagram (Normal Console UART) IR Transmit Frame Start Stop Data Bits 3/16T 7/16T 6/16T Bit frame = T Figure 13-14. Infra-Red Transmit Mode Frame Timing Diagram...
Page 551
SERIAL I/O (CONSOLE UART) S3C2500B IR Receive Frame Start Stop Data Bits 3/16T Bit frame = T 13/16T Figure 13-15. Infra-Red Receive Mode Frame Timing Diagram 13-20...
FIFO, instead of Tx/Rx buffer register(HUTXBUF/HURXBUF). They are controlled by each FIFO trigger level. The SIO control units provide software controls for mode selection, and for status and interrupt generation. In S3C2500B, software flow control or hardware flow control can be selected according to the application. 14-1...
Page 553
SERIAL I/O (HIGH-SPEED UART) S3C2500B Modem Control Signal Transmit Data TxBuffer Register Transmit Control -------------- Transmit FIFO Transmit Status (32 Bytes) HUART Transmit Shift TX pin Control Register IR Tx Encoder Status Receive Data Block RxBuffer Register Receive Control --------------...
SERIAL I/O (HIGH-SPEED UART) S3C2500B 14.3.1 HIGH-SPEED UART CONTROL REGISTERS Table 14-3. High-Speed UART Control Registers Registers Address Description Reset Value HUCON 0xF0070000 High-Speed UART control register 0x00000000 0xF0080000 Table 14-4. High-Speed UART Control Register Description Bit Number Bit Name...
Page 556
Reserved This bit should be cleared by zero. [16] Transmit FIFO enable S3C2500B High-Speed UART block support 32 byte FIFO. If this bit (TFEN) set to one, transmit data moved to Tx FIFO and then sent. [17] Receive FIFO enable S3C2500B High-Speed UART block support 32 byte FIFO.
Page 557
SERIAL I/O (HIGH-SPEED UART) S3C2500B Table 14-4. High-Speed UART Control Register Description (Continued) Bit Number Bit Name Description Receive FIFO trigger This two bit trigger level value determines when the receiver start to level (RFTL) move the received data in 32-byte receive FIFO.
S3C2500B SERIAL I/O (HIGH-SPEED UART) 14.3.2 HIGH-SPEED UART STATUS REGISTERS Table 14-5. High-Speed UART Status Registers Registers Offset Address Description Reset Value HUSTAT 0xF0070004 High-Speed UART status register – 0xF0080004 Table 14-6. High-Speed UART Status Register Description Bit Number Bit Name...
Page 561
SERIAL I/O (HIGH-SPEED UART) S3C2500B Table 14-6. High-Speed UART Status Register Description (Continued) Bit Number Bit Name Description Overrun Error (OER) This bit automatically set to "1" whenever an overrun error occurs during a serial data receiving operation. When HURXBUF has a...
Page 562
S3C2500B SERIAL I/O (HIGH-SPEED UART) Table 14-6. High-Speed UART Status Register Description (Continued) Bit Number Bit Name Description [12] Receive Event time out During Receive FIFO mode, if there is a valid data in URXFIFO or Receive FIFO within a promised time internal which is determined (E_RxTO) according to WL(Word Length) , this bit is set to '1' .
Page 563
SERIAL I/O (HIGH-SPEED UART) S3C2500B 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 [0] Receive Data Valid (RDV) 0 = No valid data (Receive FIFO-top or HURXBUF) 1 = Valid data present (Receive FIFO-top or HURXBUF)
Page 564
S3C2500B SERIAL I/O (HIGH-SPEED UART) 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 [12] Receive Event Time out (E_RxTO) 0 = A promised time is not elapsed during receiving. 1 = Valid data in a promised time...
14.3.4 HIGH-SPEED UART TRANSMIT BUFFER REGISTER S3C2500B has a 32-byte Transmit FIFO, and the bottom of FIFO is HUTXBUF. All data to be transmitted are stored into this register at first in FIFO mode, if next buffer has invalid data, then shifted to next buffer. But in non-FIFO mode, a new data to transmit will be moved from HUTXBUF to Tx shift register.
14.3.5 HIGH-SPEED UART RECEIVE BUFFER REGISTER S3C2500B has a 32-byte Receive FIFO, and the bottom of FIFO is HURXBUF. All data to be received are stored in this register at first in FIFO mode, if next buffer has invalid data, then shifted to next buffer. But in non-FIFO mode, a new received data will be moved to HURXBUF.
SERIAL I/O (HIGH-SPEED UART) S3C2500B 14.3.6 HIGH-SPEED UART BAUD RATE DIVISOR REGISTER The values stored in the baud rate divisor registers, HUBRD let you determine the serial Tx/Rx clock rate (baud rate) as follows: PCLK2 or EXT_UCLK BRGOUT = (CNT0+1) × 16 ×...
S3C2500B SERIAL I/O (HIGH-SPEED UART) 14.3.7 HIGH-SPEED UART BAUD RATE EXAMPLES High-Speed UART BRG input clock, PCLK2 is the system clock frequency divided by 2. If the system clock frequency is 133 MHz and PCLK2 is selected, the maximum BRGOUT output clock rate is PCLK2/16 (= 4,156,250 Hz).
SERIAL I/O (HIGH-SPEED UART) S3C2500B 14.3.8 HIGH-SPEED UART CONTROL CHARACTER 1 REGISTER This Control Character registers can be used for Software Flow control. In Software Flow Control mode, you should write control characters into this registers. If not, the reset value will be used as control character. For example, even if you want to use one control character, all control characters will have same value with it.
S3C2500B SERIAL I/O (HIGH-SPEED UART) 14.3.9 HIGH-SPEED UART CONTROL CHARACTER 2 REGISTER This Control Character registers can be used for Software Flow control. In Software Flow Control mode, you should write control characters into this registers. If not, the reset value will be used as control character. For example, even if you want to use one control character, all control characters will have same value with it.
SERIAL I/O (HIGH-SPEED UART) S3C2500B 14.3.10 HIGH-SPEED UART AUTOBAND BOUNDARY REGISTER This autoband boundary register limit range of each baud rate value that is auto-detected. ABB0 is the lowest boundary value (high baud rate) and ABB3 is the highest value (low baud rate) of autobaud boundary register (actually the highest boundary value is ABT3).
S3C2500B SERIAL I/O (HIGH-SPEED UART) 14.3.11 HIGH-SPEED UART AUTOBAUD TABLE REGSITER This autobaud table register corrects each baud rate divisor value that is auto-detected. For detail refer figure 14- 15. If high-speed UART uses external UCLK (29.4912 MHz) and you want to use 460800 baud rate, though high- speed UART detects baud rate divisor register value (CNT0, CNT1) as 0x04, autobaud mechanism will correct baud rate divisor register value as 0x03, because detected value is between 0x05 (ABB1) and 0x02 (ABB0).
SERIAL I/O (HIGH-SPEED UART) S3C2500B 14.4 HIGH-SPEED UART OPERATION Data Transmit Operation Flow: If there is no data at Tx Buffer FIFO of High-Speed UART (in case of FIFO, if data in the Tx FIFO are empty as same amount of trigger level), High-Speed UART generates interrupt or GDMA request signal. It depends on High-Speed UART mode.
Page 576
S3C2500B SERIAL I/O (HIGH-SPEED UART) Data Size Start Bit Figure 14-15. When Signal is Asserted During Transmit Operation Data Region Start Bit Stop Bit Figure 14-16. When CTS Signal is De-asserted During Transmit Operation 14-25...
SERIAL I/O (HIGH-SPEED UART) S3C2500B Data Region Start Bit Stop Bit Figure 14-17. Normal Received Rx Data Data Region Start Bit Stop Bit Pin Signal Internal Start Bit Signal Figure 14-18. DCD Lost During Rx Data Receive 14.4.3 SOFTWARE FLOW CONTROL Software can control High-Speed UART by control characters.
Page 578
S3C2500B SERIAL I/O (HIGH-SPEED UART) <TRANSMIT> Stop Start Data Bits (5-8) Parity Start TX DATA (1-2) INT_TXD <RECEIVE> Stop Start Data Bits (5-8) Parity Start Data Bits RX DATA (1-2) INT_RXD Receive Data Receive Data HURXBUF Figure 14-19. Interrupt-Based Serial I/O Transmit and Receive Timing Diagram...
I/O PORTS 15.1 OVERVIEW S3C2500B has 64 programmable I/O ports. I/O port function control registers (IOPCON2: upper word, IOPCON1: lower word) select either function's port or GPIO. If IOPCON1/2 register is set to GPIO, IOPMODE1/2 register should be set to either input mode or output mode.
I/O PORTS S3C2500B 15.3 I/O PORT SPECIAL REGISTER Table 15-1. I/O Port Special Registers Register Address Description Reset Value IOPMODE1 0xF0030000 I/O port mode select register for Port 0 to 31 0xF003FFFF IOPMODE2 0xF0030004 I/O port mode select register for Port 32 to 63...
Page 584
S3C2500B I/O PORTS IOPMODE1 X X X X X IOPMODE2 X X X X X IOPMODE1 IOPMODE2 Signal port Reset value Signal port Reset value GPIO[31] GPIO[63] GPIO[30] GPIO[62] GPIO[29] GPIO[61] GPIO[28] GPIO[60] GPIO[27] GPIO[59] GPIO[26] GPIO[58] GPIO[25] GPIO[57] GPIO[24]...
I/O PORTS S3C2500B 15.3.2 I/O PORT FUNCTION CONTROL REGISTER (IOPCON1/2) The I/O port function select registers, IOPCON1/2, are used for function select. IOPCON1/2 are used to configure external interrupt signals, GDMA Req/Ack signals, timer signals, UART Tx/Rx signals, and HDLC Tx/Rx signals.
Page 586
S3C2500B I/O PORTS Reserved IOPCON1 IOPCON1 Default signal Multiplexed signals (0 / 1) default value High speed UART nDSR0 (HUARTnDSR0)/GPIO[31] HUARTnDSR0 High speed UART nDTR0 (HUARTnDTR0)/GPIO[30] HUARTnDTR0 HUARTTXD0 High speed UART RTXD0 (HUARTRTXD0)/GPIO[29] High speed UART RXD0 (HUARTRXD0)/GPIO[28] HUARTRXD0 Timer Output(TOUT)[5] / GPIO[27]...
Page 587
I/O PORTS S3C2500B X X X X X IOPCON2 IOPCON2 Multiplexed signals (0 / 1) Default signal default value HDLC ch.2 TXC(HTXC2) / GPIO[63] HTXC2 HDLC ch.2 RXC(HRXC2) / GPIO[62] HRXC2 HDLC ch.2 nDCD(HnDCD2) / GPIO[61] HnDCD2 HDLC ch.2 nCTS(HnCTS2) / GPIO[60] HnCTS2 HDLC ch.2 nRTS(HnRTS2) / GPIO[59]...
S3C2500B I/O PORTS 15.3.3 I/O PORT CONTROL REGISTER FOR GDMA (IOPGDMA) If the port is used for a function's port such as an external GDMA Req/Ack signal, its signal function is determined by the IOPGDMA register. IOPGDMA register is used to configure GDMA Req/Ack signal. I/O ports provide 3-tap filtering, and you can select filtering on or off.
I/O PORTS S3C2500B 15.3.4 I/O PORT CONTROL REGISTER FOR EXTERNAL INTERRUPT (IOPEXTINT) If the port is used for a function's port such as an external interrupt request, its signal function is determined by the IOPEXTINT register. IOPEXTINT register is used to configure external interrupt request signals. I/O ports provide 3-tap filtering, and you can select filtering on or off.
Page 590
S3C2500B I/O PORTS IOPEXTINT Reserved [23:20] Control external interrupt request5 input for port 13 (xINT5) [23] 0 = active low 1 = active high [22] 0 = filtering off 1 = filtering on [21:20] 00 = level detection 01 = rising edge detection...
I/O PORTS S3C2500B 15.3.5 I/O PORT EXTERNAL INTERRUPT CLEAR REGISTER (IOPEXTINTPND) External interrupt clear register (IOPEXTINTPND) is set when external interrupt is generated, and you can clear the interrupt status by writing the IOPEXTINTPND status register to '1'. Table 15-6. IOPEXTINTPND Register...
S3C2500B I/O PORTS 15.3.6 I/O PORT DATA REGISTER (IOPDATA1/2) The I/O port data registers, IOPDATA1/2, contain one-bit read values for I/O ports that are configured to input mode and one-bit write values for ports that are configured to output mode.
INTERRUPT CONTROLLER 16.1 OVERVIEW The S3C2500B interrupt controller has a total of 39 interrupt sources. Interrupt requests can be generated by internal function blocks or external pins. The ARM940T core recognizes two kinds of interrupts: a normal interrupt request (IRQ) and a fast interrupt request (FIQ).
S3C2500B INTERRUPT CONTROLLER Table 16-2. S3C2500B External Interrupt Sources Index Values Interrupt Sources IOM2 interrupt External interrupt 5 External interrupt 4 External interrupt 3 External interrupt 2 External interrupt 1 External interrupt 0 16.4 INTERRUPT CONTROLLER SPECIAL REGISTERS 16.4.1 INTERRUPT MODE REGISTERS Bit settings in the interrupt mode registers, INTMOD and EXTMOD, specify if an interrupt is to be serviced as a fast interrupt (FIQ) or a normal interrupt (IRQ).
Page 597
INTERRUPT CONTROLLER S3C2500B INTMOD [31:0] Internal interrupt mode bits NOTE: Each of the 32 bits in the interrupt mode enable register, INTMOD, corresponds to an interrupt source. When the source interrupt mode bit is set to 1, the interrupt is processed by the ARM940T core in FIQ (fast interrupt) mode.
S3C2500B INTERRUPT CONTROLLER EXTMOD [6:0] External interrupt mode bits NOTE: Each of the 7 bits in the external interrupt mode enable register, EXTMOD, corresponds to an external interrupt source. When the source interrupt mode bit is set to 1, the interrupt is processed by the ARM940T core in FIQ (fast interrupt) mode.
Page 599
INTERRUPT CONTROLLER S3C2500B INTMASK [31:0] Individual internal interrupt mask bits NOTE: Each of the 32 bits in the interrupt mask register, INTMASK, corresponds to an interrupt source. When a source interrupt mask bit is 1, the interrupt is not serviced by the ARM940T when the corresponding interrupt request is generated.
Page 600
S3C2500B INTERRUPT CONTROLLER EXTMASK [6:0] Individual external interrupt mask bits NOTE: Each of the 7 bits in the external interrupt mask register, EXTMASK, (except for the global mask bit, G) corresponds to an external interrupt source. When a source interrupt mask bit is 1, the interrupt is not serviced by the ARM940T when the corresponding interrupt request is generated.
INTERRUPT CONTROLLER S3C2500B 16.4.3 INTERRUPT PRIORITY REGISTERS The interrupt priority registers, INTPRIOR0–INTPRIOR9, contain information about which interrupt source is assigned to the pre-defined interrupt priority field. Each INTPRIORn register value determines the priority of the corresponding interrupt source. The lowest priority value is 0x0, and the highest priority value is 0x26.
S3C2500B INTERRUPT CONTROLLER 16.4.4 INTERRUPT OFFSET REGISTER The interrupt offset registers, INTOFFSET_FIQ and INTOFFSET_IRQ, contain the interrupt offset address of the interrupt, which has the highest priority among the pending interrupts. The content of the interrupt offset address is "index value of the interrupt source”.
Page 603
INTERRUPT CONTROLLER S3C2500B Table 16-7. Index Value of Interrupt Sources Index Value Type of Interrupt Sources Returned Default Offset Value (Hex) [38] Watchdog Timer interrupt 0 x 26 [37] 32-bit Timer 5 interrupt 0 x 25 [36] 32-bit Timer 4 interrupt...
Page 604
S3C2500B INTERRUPT CONTROLLER Table 16-7. Index Value of Interrupt Sources (Continued) Index Value Type of Interrupt Sources Returned Default Offset Value (Hex) HUART 0 RX interrupt 0 x 9 HUART 0 TX interrupt 0 x 8 IIC interrupt 0 x 7...
INTERRUPT CONTROLLER S3C2500B 16.4.5 INTERRUPT BY PRIORITY REGISTER The interrupt by priority registers, IPRIORHI and IPRIORLO, contain interrupt pending bits, which are re-ordered by the INTPRIORn register settings. IPRIORLO[14] is mapped to the interrupt source of whichever bit index is written into the priority 14 field of the INTPRIORn registers.
S3C2500B 32-BIT TIMERS 32-BIT TIMERS 17.1 OVERVIEW The timer has six 32-bit timers and one watchdog timer. Six 32-bit timers have Timer Mode register (TMOD) which is used to control the operation of the six 32-bit timers, Timer Data registers (TDATAn) which are data registers for counting, Timer Counts registers (TCNTn) which are count value registers, and Timer Interrupt Clear register (TIC) which is used to clear the current interrupt.
32-BIT TIMERS S3C2500B 17.3 INTERVAL MODE OPERATION In interval mode, a timer generates one-shot pulse of preset timer clock duration whenever a time-out occurs. This pulse generates a time-out interrupt that is directly output at the timer's configured output pin (TOUTn). In...
32-BIT TIMERS 17.5 TIMER OPERATION GUIDELINES The block diagram in Figure 17-2 shows how the 32-bit timers are configured in the S3C2500B. The following guidelines apply to the timer functions. When a timer is enabled, it loads a data value (TDATA) to its count register (TCNT) and begins decrement of the count register value (TCNT).
32-BIT TIMERS S3C2500B 17.6 TIMER SPECIAL REGISTER 17.6.1 TIMER MODE REGISTER The timer mode register, TMOD, is used to control the operation of the six 32-bit timers. TMOD register settings are described in Figure 17-3. Table 17-1. TMOD Register Register...
32-BIT TIMERS S3C2500B 17.6.2 TIMER DATA REGISTERS The timer data registers, TDATA0 - TDATA5, contain a value that specifies the time-out duration for each timer. The formula for calculating the time-out duration is: (Timer data) cycles. The timer is dependent on the system bus clock. When the system bus is 133 MHz, the minimum value, 0x1 for TDATA, generates interrupt at every 7.5n sec.
S3C2500B 32-BIT TIMERS 17.6.5 WATCHDOG TIMER REGISTER (WDT) To use Watchdog Timer, Watchdog Timer Register (WDT) must be set. If WDT[29] (RST) is ‘1’ when WDT[31] (EN) was asserted, the timeout counter in watchdog timer is cleared as ‘0’. Following this cycle, WDT[29] (RST) is automatically de-asserted.
S3C2500B ELECTRICAL DATA ELECTRICAL DATA 18.1 OVERVIEW This chapter describes the S3C2500B electrical data. 18.2 ABSOLUTE MAXIMUM RATINGS Table 18-1. Absolute Maximum Ratings Symbol Parameter Rating Unit DC supply voltage 1.8V V 3.3V V DC input voltage 3.3V input buffer DC output voltage 3.3V input buffer...
ELECTRICAL DATA S3C2500B 18.4 DC ELECTRICAL SPECIFICATIONS Table 18-3. D.C Electric Characteristics = 3.3 V ± 5%, T = -40 to 85 °C Symbol PARAMETER Condition Type Unit High level input voltage LVCMOS interface – – Low level input voltage LVCMOS interface –...
Page 618
S3C2500B ELECTRICAL DATA Table 18-3. D.C Electric Characteristics (Continued) Symbol PARAMETER Condition Type Unit Low level output voltage = 1 µA Type B1 to B12 – – 0.05 = 1 mA Type B1 = 2 mA Type B2 = 4 mA...
S3C2500B ELECTRICAL DATA 18.6 AC ELECTRICAL CHARACTERISTICS Table 18-4. Operating Frequency Characteristic Units Core frequency System bus frequency USB Frequency Table 18-5. Clock AC timing specification Characteristic Units µs Internal PLL lock time – Frequency of operation (XCLK) – XCLK cycle time –...
Page 621
ELECTRICAL DATA S3C2500B Table 18-6. AC Electrical Characteristics for S3C2500B Signal Name Description Unit tnRCSd ROM/SRAM chip select delay time 1.32 3.43 tnRCSh ROM/SRAM chip select hold time 1.17 3.02 tnOEd ROM/SRAM output enable delay time 0.79 1.93 tnOEh ROM/SRAM output enable hold time 0.69...