Amba 3 APB Protocol: Specification
Amba 3 APB Protocol: Specification
Amba 3 APB Protocol: Specification
v1.0
Specification
Change history
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM Limited in the EU and
other countries, except as otherwise stated below in this proprietary notice. Other brands and names
mentioned herein may be the trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document
may be adapted or reproduced in any material form except with the prior written permission of the copyright
holder.
The product described in this document is subject to continuous developments and improvements. All
particulars of the product and its use contained in this document are given by ARM Limited in good faith.
However, all warranties implied or expressed, including but not limited to implied warranties of
merchantability, or fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable
for any loss or damage arising from the use of any information in this document, or any error or omission in
such information, or any incorrect use of the product.
1.Subject to the provisions of Clauses 2 and 3, ARM hereby grants to LICENSEE a perpetual, non-exclusive,
nontransferable, royalty free, worldwide licence to use and copy the AMBA Specification for the purpose of
developing, having developed, manufacturing, having manufactured, offering to sell, selling, supplying or
otherwise distributing products which comply with the AMBA Specification.
2.THE AMBA SPECIFICATION IS PROVIDED “AS IS” WITH NO WARRANTIES EXPRESS, IMPLIED
OR STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF SATISFACTORY
QUALITY, MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR
PURPOSE.
3. No licence, express, implied or otherwise, is granted to LICENSEE, under the provisions of Clause 1, to
use the ARM tradename, or AMBA trademark in connection with the AMBA Specification or any products
based thereon. Nothing in Clause 1 shall be construed as authority for LICENSEE to make any
representations on behalf of ARM in respect of the AMBA Specification.
ii Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Confidentiality Status
Product Status
Web Address
http://www.arm.com
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. iii
iv Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Contents
AMBA 3 APB Protocol Specification
Preface
About this specification .................................................................................. x
Feedback ..................................................................................................... xiii
Chapter 1 Introduction
1.1 About the AMBA 3 APB .............................................................................. 1-2
1.2 Changes for AMBA 3 APB Protocol Specification v1.0 ............................... 1-3
Chapter 2 Transfers
2.1 Write transfers ............................................................................................. 2-2
2.2 Read transfers ............................................................................................ 2-4
2.3 Error response ............................................................................................ 2-6
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. v
Contents
vi Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
List of Figures
AMBA 3 APB Protocol Specification
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. vii
List of Figures
viii Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Preface
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. ix
Preface
Intended audience
This specification is written to help hardware and software engineers to design systems
and modules that are compatible with the APB protocol.
Chapter 1 Introduction
Read this chapter for an overview of the APB protocol.
Chapter 2 Transfers
Read this chapter for information about the different types of APB
transfer.
Conventions
Typographical
x Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Preface
monospace Denotes text that you can enter at the keyboard, such as
commands, file and program names, and source code.
monospace bold denotes language keywords when used outside example code.
< and > Angle brackets enclose replaceable terms for assembler syntax
where they appear in code or code fragments. They appear in
normal font in running text. For example:
• MRC p15, 0 <Rd>, <CRn>, <CRm>, <Opcode_2>
• The Opcode_2 value selects which register is accessed.
Timing diagrams
The figure named Key to timing diagram conventions explains the components used in
timing diagrams. Variations, when they occur, have clear labels. You must not assume
any timing information that is not explicit in the diagrams.
Shaded bus and signal areas are undefined, so the bus or signal can assume any value
within the shaded area at that time. The actual level is unimportant and does not affect
normal operation.
Clock
HIGH to LOW
Transient
HIGH/LOW to HIGH
Bus stable
Bus change
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. xi
Preface
Signals
The signal conventions are:
Signal level The level of an asserted signal depends on whether the signal is
active-HIGH or active-LOW. Asserted means HIGH for
active-HIGH signals and LOW for active-LOW signals.
Further reading
This section lists publications that provide additional information about the AMBA 3
protocol family.
This document contains information that is specific to the APB interface. See the
following documents for other relevant information:
• AMBA AXI Protocol Specification (ARM IHI 0022).
xii Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Preface
Feedback
ARM Limited welcomes feedback on the APB protocol and its documentation.
If you have any comments or suggestions about this product, contact your supplier
giving:
• the product name
• a concise explanation of your comments.
ARM Limited also welcomes general suggestions for additions and improvements.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. xiii
Preface
xiv Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Chapter 1
Introduction
This chapter provides an overview of the AMBA 3 APB. It contains the following
section:
• About the AMBA 3 APB on page 1-2
• Changes for AMBA 3 APB Protocol Specification v1.0 on page 1-3.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 1-1
Introduction
The APB interfaces to any peripherals that are low-bandwidth and do not require the
high performance of a pipelined bus interface. The APB has unpipelined protocol.
All signal transitions are only related to the rising edge of the clock to enable the
integration of APB peripherals easily into any design flow. Every transfer takes at least
two cycles.
The APB can interface with the AMBA Advanced High-performance Bus Lite
(AHB-Lite) and AMBA Advanced Extensible Interface (AXI). You can use it to provide
access to the programmable control registers of peripheral devices.
1-2 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Introduction
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 1-3
Introduction
1-4 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Chapter 2
Transfers
This chapter describes typical AMBA 3 APB write and read transfers, and the error
response. It contains the following sections:
• Write transfers on page 2-2
• Read transfers on page 2-4
• Error response on page 2-6.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 2-1
Transfers
T0 T1 T2 T3 T4
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PWDATA Data 1
PREADY
The write transfer starts with the address, write data, write signal and select signal all
changing after the rising edge of the clock. The first clock cycle of the transfer is called
the Setup phase. After the following clock edge the enable signal is asserted,
PENABLE, and this indicates that the Access phase is taking place. The address, data
and control signals all remain valid throughout the Access phase. The transfer
completes at the end of this cycle.
The enable signal, PENABLE, is deasserted at the end of the transfer. The select signal,
PSELx, also goes LOW unless the transfer is to be followed immediately by another
transfer to the same peripheral.
Figure 2-2 on page 2-3 shows how the PREADY signal from the slave can extend the
transfer. During an Access phase, when PENABLE is HIGH, the transfer can be
extended by driving PREADY LOW. The following signals remain unchanged for the
additional cycles:
• address, PADDR
• write signal, PWRITE
2-2 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Transfers
T0 T1 T2 T3 T4 T5 T6
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PWDATA Data 1
PREADY
PREADY can take any value when PENABLE is LOW. This ensures that peripherals
that have a fixed two cycle access can tie PREADY HIGH.
Note
It is recommended that the address and write signals are not changed immediately after
a transfer but remain stable until another access occurs. This reduces power
consumption.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 2-3
Transfers
T0 T1 T2 T3 T4
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PRDATA Data 1
PREADY
Figure 2-4 on page 2-5 shows how the PREADY signal can extend the transfer. The
transfer is extended if PREADY is driven LOW during an Access phase. The protocol
ensures that the following remain unchanged for the additional cycles:
• address, PADDR
• write signal, PWRITE
• select signal, PSEL
• enable signal, PENABLE.
Figure 2-4 on page 2-5 shows that two cycles are added using the PREADY signal.
However, you can add any number of additional cycles, from zero upwards.
2-4 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Transfers
T0 T1 T2 T3 T4 T5 T6
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PRDATA Data 1
PREADY
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 2-5
Transfers
PSLVERR is only considered valid during the last cycle of an APB transfer, when
PSEL, PENABLE, and PREADY are all HIGH.
It is recommended, but not mandatory, that you drive PSLVERR LOW when it is not
being sampled. That is, when any of PSEL, PENABLE, or PREADY are LOW.
Transactions that receive an error, might or might not have changed the state of the
peripheral. This is peripheral-specific and either is acceptable. When a write transaction
receives an error this does not mean that the register within the peripheral has not been
updated. Read transactions that receive an error can return invalid data. There is no
requirement for the peripheral to drive the data bus to all 0s for a read error.
APB peripherals are not required to support the PSLVERR pin. This is true for both
existing and new APB peripheral designs. Where a peripheral does not include this pin
then the appropriate input to the APB bridge is tied LOW.
Figure 2-5 shows an example of a failing write transfer that completes with an error.
T0 T1 T2 T3 T4 T5
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PWDATA Data 1
PREADY
PSLVERR
2-6 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Transfers
T0 T1 T2 T3 T4 T5 T6
PCLK
PADDR Addr 1
PWRITE
PSEL
PENABLE
PRDATA
PREADY
PSLVERR
When bridging:
From AXI to APB An APB error is mapped back to RRESP/BRESP = SLVERR.
This is achieved by mapping PSLVERR to the AXI signals
RRESP[1] for reads and BRESP[1] for writes.
From AHB to APB PSLVERR is mapped back to HRESP = ERROR for both reads
and writes. This is achieved by mapping PSLVERR to the AHB
signal HRESP[0].
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 2-7
Transfers
2-8 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Chapter 3
Operating States
This chapter describes the AMBA 3 APB operating states. It contains the following
section:
• Operating states on page 3-2.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 3-1
Operating States
No transfer
IDLE
PSELx = 0
PENABLE = 0
Transfer
PREADY = 1 SETUP
and no PSELx = 1
transfer PENABLE = 0
PREADY = 1
and transfer
PREADY = 0
ACCESS
PSELx = 1
PENABLE = 1
SETUP When a transfer is required the bus moves into the SETUP state, where
the appropriate select signal, PSELx, is asserted. The bus only remains
in the SETUP state for one clock cycle and always moves to the ACCESS
state on the next rising edge of the clock.
ACCESS The enable signal, PENABLE, is asserted in the ACCESS state. The
address, write, select, and write data signals must remain stable during
the transition from the SETUP to ACCESS state.
Exit from the ACCESS state is controlled by the PREADY signal from
the slave:
• If PREADY is held LOW by the slave then the peripheral bus
remains in the ACCESS state.
3-2 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Operating States
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 3-3
Operating States
3-4 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Chapter 4
Signal Descriptions
This chapter describes the AMBA 3 APB signals. It contains the following section:
• AMBA 3 APB signals on page 4-2.
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. 4-1
Signal Descriptions
PCLK Clock source Clock. The rising edge of PCLK times all transfers on the APB.
PRESETn System bus equivalent Reset. The APB reset signal is active LOW. This signal is normally connected
directly to the system bus reset signal.
PADDR APB bridge Address. This is the APB address bus. It can be up to 32 bits wide and is driven
by the peripheral bus bridge unit.
PSELx APB bridge Select. The APB bridge unit generates this signal to each peripheral bus slave.
It indicates that the slave device is selected and that a data transfer is required.
There is a PSELx signal for each slave.
PENABLE APB bridge Enable. This signal indicates the second and subsequent cycles of an APB
transfer.
PWRITE APB bridge Direction. This signal indicates an APB write access when HIGH and an APB
read access when LOW.
PWDATA APB bridge Write data. This bus is driven by the peripheral bus bridge unit during write
cycles when PWRITE is HIGH. This bus can be up to 32 bits wide.
PREADY Slave interface Ready. The slave uses this signal to extend an APB transfer.
PRDATA Slave interface Read Data. The selected slave drives this bus during read cycles when
PWRITE is LOW. This bus can be up to 32-bits wide.
PSLVERR Slave interface This signal indicates a transfer failure. APB peripherals are not required to
support the PSLVERR pin. This is true for both existing and new APB
peripheral designs. Where a peripheral does not include this pin then the
appropriate input to the APB bridge is tied LOW.
4-2 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B
Index
The items in this index are listed in alphabetical order, with symbols and numerics appearing at the end. The
references given are to page numbers.
A I P
ACCESS 3-2 IDLE 3-2 PADDR 4-2
PCLK 4-2
PENABLE 4-2
C N PRDATA 4-2
PREADY 4-2
Changes for this version 1-3 No wait states PRESETn 4-2
Conventions read 2-4 PSELx 4-2
signal naming xii write 2-2 PSLVERR 4-2
timing diagram xi PWDATA 4-2
typographical x PWRITE 4-2
O
E Operating states 3-2 R
ACCESS 3-2
Error response 2-6 diagram 3-2 Read errors 2-7
Error response, read transfer 2-7 IDLE 3-2 Read transfers
Error response, write transfer 2-6 SETUP 3-2 with no wait states 2-4
Errors, mapping 2-7 Overview 1-2 with wait states 2-4
ARM IHI 0024B Copyright © 2003, 2004. ARM Limited. All rights reserved. Index-1
Index
S
SETUP 3-2
Signal descriptions 4-2
Signal naming conventions xii
State machine 3-2
T
Timing diagram conventions xi
Typographical conventions x
W
Wait states
read 2-4
write 2-2
Write errors 2-6
Write transfers
with no wait states 2-2
with wait states 2-2
Index-2 Copyright © 2003, 2004. ARM Limited. All rights reserved. ARM IHI 0024B